Skip to main content

Module guard_state

Module guard_state 

Source
Expand description

Perpetual guard root state machine, policy identity, and receipt types. Perpetual guard root state machine, policy identity, and receipt types.

This module owns the versioned non-secret guard state types that every other lane builds on. It does not import CLI, transport, or presentation code (one-way dependency: core state is the bottom of the stack).

§State machine

Every registered root has exactly one [GuardRootState]. Transitions are centralized in [GuardRootState::transition] so adding a state makes the state/exit/documentation matrix test fail until a decision is recorded.

§Policy identity

[GuardPolicyIdentity] binds every input capable of changing findings or coverage. A mismatch makes existing attestations ineligible immediately.

Structs§

FilesystemIdentity
Non-secret filesystem identity for root replacement detection.
GitCleanAttestation
Summary of a complete clean scan outcome for one Git blob, suitable for durable reuse. Only complete clean outcomes are reusable: a blob that produced a finding, coverage gap, panic, persistence failure, or incomplete report is never inserted as clean.
GitCleanAttestationKey
Key for the clean attestation lookup: hash algorithm + blob OID + policy identity. Backend identity is recorded in the receipt but does not create different correctness outcomes.
GuardPolicyIdentity
Every input capable of changing findings or coverage, bound into one canonical identity. A mismatch makes existing attestations ineligible immediately and transitions the root to GuardRootState::StalePolicy.
GuardReceipt
Terminal receipt for a guard commit transaction or background reconciliation. Carries exact byte and object totals so the client can validate conservation.
GuardRootRecord
Persistent record for one registered guard root.

Enums§

GitHashAlgorithm
Git object hash algorithm supported by the guard.
GuardRootMode
Whether a guarded root is a Git repository or a plain filesystem root.
GuardRootState
The explicit state of one registered guard root.
GuardTransition
Events that drive the root state machine.
ReceiptError
Error returned when receipt conservation validation fails.
TransitionError
Error returned when a transition is not legal from the current state.

Constants§

GUARD_SCHEMA_VERSION
Current guard state schema version. Bumped on any incompatible change to the durable store layout or the serialized shapes in this module.