Skip to main content

Surface

Enum Surface 

Source
pub enum Surface {
    Routing,
    Declagent,
    Conversation,
    Knowledge,
    Skill,
    Registry {
        kind: String,
    },
    Trajectory,
    Run,
    Intent,
}
Expand description

Which persisted surface an op mutates — the proposal’s surfaces.

Intent (B5) is a leased execution-intent surface. Its Surface::tag string "intent" enters the op_id content digest and is therefore frozen forever — changing it would re-address every historical intent op. The enum is deliberately NOT #[non_exhaustive]: the repo bans the _ => wildcards that would force, so a new surface variant is a compile error at every match — the intended review gate. The serde wire form stays a tagged union (#[serde(rename_all = "snake_case")]).

Variants§

§

Routing

§

Declagent

§

Conversation

§

Knowledge

§

Skill

§

Registry

Fields

§kind: String
§

Trajectory

§

Run

§

Intent

Leased execution-intent ledger (B5): payload {id: run_id, agent_id, epoch, status}. Folds under FoldTier::Leased — LWW-per-run_id with monotone status plus per-agent epoch fencing, so a stale-epoch write from a failed-over lease holder loses deterministically at the fold. See crate::lease.

Implementations§

Source§

impl Surface

Source

pub fn tag(&self) -> String

Stable string form: the fold’s grouping key and part of the op_id digest.

Source

pub fn fold_tier(&self) -> FoldTier

The proposal’s fold-rule table. Routing observations are grow-only log entries (“sync the observations, not the result”); the EMA replay over them is the caller-injected crate::fold::SyncState::replay.

Source

pub fn is_event_stream(&self) -> bool

Is this surface an event stream — a multiset keyed by op_id rather than a set of content-deduped logical entities?

Two surfaces are event streams, for the same structural reason but with different downstream handling:

  • Routing — the proposal’s “replays the merged multiset of observations”: agent x succeeded twice is two events that must both reach the EMA replay.
  • Conversation (B2, kernel-review correction) — a conversation turn has exactly one author and propagates by op replication, so op identity IS turn identity. Content-keying was a reproduced data-loss bug: two genuine “yes” turns stamped at the same payload-second (cached now(), rapid double-confirm) fold to one entry. Keyed by op_id, a resent op dedups but two distinct authorings never collapse. Unlike routing, conversation turns are independent entries (no path-dependent replay), so they tolerate LastN retention — see Surface::is_replay_stream.

Event-stream surfaces fold keyed by op_id — see OpRecord::fold_key.

Source

pub fn is_replay_stream(&self) -> bool

Is this surface a path-dependent replay stream — one whose folded result is recomputed from the ordered multiset (routing’s EMA), so that dropping ANY entry corrupts every device’s recomputed value? Only these are retention-forbidden (compact rejects any non-keep-all rule on them). This is narrower than Surface::is_event_stream: conversation is an event-stream multiset too, but its turns are independent, so LastN over them is well-defined and allowed. Routing is the only replay stream today; a new one is a compile-error here (no _ arm), the intended review gate.

Trait Implementations§

Source§

impl Clone for Surface

Source§

fn clone(&self) -> Surface

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Surface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Surface

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Surface

Source§

impl PartialEq for Surface

Source§

fn eq(&self, other: &Surface) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Surface

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Surface

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more