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
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
impl Surface
Sourcepub fn tag(&self) -> String
pub fn tag(&self) -> String
Stable string form: the fold’s grouping key and part of the op_id
digest.
Sourcepub fn fold_tier(&self) -> FoldTier
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.
Sourcepub fn is_event_stream(&self) -> bool
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 succeededtwice 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 byop_id, a resent op dedups but two distinct authorings never collapse. Unlike routing, conversation turns are independent entries (no path-dependent replay), so they tolerateLastNretention — seeSurface::is_replay_stream.
Event-stream surfaces fold keyed by op_id — see OpRecord::fold_key.
Sourcepub fn is_replay_stream(&self) -> bool
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.