pub enum SpoolFacet {
Content,
Governance,
Membership,
Named(String),
}Expand description
A named facet lineage within one repo/spool.
The three well-known variants name the content-side lineages the Spool model
versions independently. SpoolFacet::Named carries any other facet token
so the set is genuinely open — the substrate treats the facet purely as a
string that suffixes the scope and prefixes ref names.
Variants§
Content
The versioned file tree — “a repo” today. The default facet: it maps
to the unchanged per-worktree scope token and the refs/spool/content/…
prefix, so pre-facet callers keep their exact behavior.
Governance
Visibility + policy-as-code, versioned as content.
Membership
Grants + roles, versioned as content.
Named(String)
Any other named facet lineage. The set of facets is open; callers may version an arbitrary named lineage on the same substrate.
Implementations§
Source§impl SpoolFacet
impl SpoolFacet
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
True for the default (content) facet, which composes to the unchanged
per-worktree scope token. A Named("content") also normalizes here so
the well-known token and its string spelling never diverge.
Sourcepub fn scope_token(&self, base_scope: &str) -> String
pub fn scope_token(&self, base_scope: &str) -> String
Compose a facet-qualified oplog scope token from the per-worktree base
scope (wt-<digest>, from Repository::op_scope).
The default (content) facet returns the base scope unchanged, so the
scope string — and therefore every existing oplog batch, undo record, and
IsolationKey::LocalHead — is byte-identical to the pre-facet world.
Every other facet appends /<token>, giving that facet its own scope
partition: its batches, its undo/redo view, its isolation key.
Sourcepub fn ref_prefix(&self) -> String
pub fn ref_prefix(&self) -> String
The ref-name prefix for this facet: refs/spool/<facet>.
All of a facet’s refs live under this prefix; validate_ref_name accepts
it as an ordinary hierarchical name.
Sourcepub fn thread_ref(&self, name: &str) -> String
pub fn thread_ref(&self, name: &str) -> String
The facet’s thread ref for name — refs/spool/<facet>/threads/<name>.
A facet’s HEAD attaches to one of these ([Head::Attached]).
Sourcepub fn marker_ref(&self, name: &str) -> String
pub fn marker_ref(&self, name: &str) -> String
The facet’s marker ref for name — refs/spool/<facet>/markers/<name>.