pub enum Capability {
Viewer,
Author,
Maintainer,
}Expand description
What a session may do, derived from Readiness (design AC-01…04).
The levels are cumulative for the mutating axis (Maintainer implies Author implies Viewer).
Operator is orthogonal — recovery actions available to any human at the machine under explicit
confirmation — and is represented as a separate query on Readiness itself
(Readiness::may_operate) rather than a point on this ladder or a method here: derive below
discards read_only on the way to a Capability, so the one fact may_operate needs does not
survive to exist as a method on this type (RFC 012 F-a).
Variants§
Viewer
Every read surface. The default when signing readiness is absent or read-only mode is on.
Author
Viewer plus queue-affecting operations: commit, rollback draft.
Maintainer
Author plus history-publishing: seal, merge execution, ref/tag publication, trust changes.
Implementations§
Source§impl Capability
impl Capability
Sourcepub const fn derive(readiness: Readiness) -> Self
pub const fn derive(readiness: Readiness) -> Self
Derive the mutating-axis capability from readiness. Read-only mode collapses everything to
Capability::Viewer regardless of key presence (design NFR-S01).
The one fold, and the only place the grant/withhold decision is made — through
RoleReadiness::arms, so no gate can grow its own rule (RFC 026 §3).
Unknown grants (RFC 016 Q1): the affordance is still offered, since hiding seal from someone
whose key is adopted would be its own confident-but-wrong picture (C-T4d). What Unknown
changes is what stikk claims about the outcome, not what it offers. Unverifiable,
Mismatch and NotAdopted withhold, for the opposite reason: prikk will refuse, so offering
the action would be offering a failure.
True when this capability permits queue-affecting operations (commit, rollback draft).
Sourcepub const fn may_publish(self) -> bool
pub const fn may_publish(self) -> bool
True when this capability permits history-publishing operations (seal, merge, publication, trust changes).