Skip to main content

Module authority

Module authority 

Source
Expand description

Content-addressed authority provenance — the portable semantic layer.

This is the mesh half of the Content-Addressed Authority Provenance design (PLAN step 1 / task #134). Software supply-chain security protects the provenance of artifacts that execute; this applies the same techniques to the provenance of the authority under which execution is permitted.

Four distinct proofs, never collapsed:

ProofMechanismAnswers
IdentityAuthorityId/GrantId (CID)is this the exact object?
Assertiondetached signature (crate::assertion::Assertion)who vouched for it?
Authorizationattenuation algebra (check_derivation)is this legal?
Enforcementplatform witness (agent-bridle)what did the OS enforce?

Scope of this module (deliberately portable): it owns Authority / Grant and their typed CIDs, the resolved-authority lattice (ResolvedScope / ResolvedAuthority), the ScopeRelation, the pure admission decision (admit, the L3 BOUND law), and the verifier contract (AttestationVerifier). It never learns a native fence format (SBPL / Landlock / AppContainer) — agent-bridle projects its native fence into a ResolvedAuthority and calls admit here.

The seven governing laws (each carries a proof obligation, discharged separately by the formal specs — task #137): L1 IDENTITY, L2 NON-EQUIVOCATION, L3 BOUND, L4 FLOOR, L5 PROVENANCE, L6 AUTHORIZATION, L7 FAIL-CLOSED. This module implements the executable form of L3/L6/L7 and the L1 typed-identity discipline.

Structs§

AdmissionReject
The reason an admission is refused (L3 + L7): the axis whose resolved fence exceeded its bound, and how.
AttestationId
The content identity of an operator Attestation (signing is deferred — the id is stable now so an Elevation edge can name it before the verifier lands).
Authority
A portable authority value: exactly the mesh Caveats lattice, given a stable content identity for the first time. Introducing an identity, not a new authority model — Newt has no Grant type today; authority is a bare Caveats, so AuthorityId is the first stable name a delegated authority ever gets.
AuthorityId
The content identity of an Authority value.
AuthorityMismatch
The two authority ids in an BindError::AuthorityCidMismatch (boxed so the error variant stays small).
DenyAllElevations
The fail-closed default verifier: rejects every elevation (L7). Signing is deferred (contract §8), so until a real operator-key verifier lands, no elevation edge is admissible — only attenuation (algebra) is.
Grant
A grant: a reference to an Authority value plus the Derivation that justifies holding it.
GrantId
The content identity of a Grant (its authority-ref + derivation).
ResolvedAuthority
Per-axis resolved authority for the four OS-confinement axes (the axes a native fence governs; max_calls/valid_for_generation are gate budget, not fence scope, and are out of this projection).
ResolvedGrant
A Grant paired with the exact Authority body it names — and the pairing is only constructible when the body’s CID equals the grant’s authority field. This is the whole point of content addressing: the caveats an edge is judged against are provably the caveats the grant commits to, not a body a buggy or hostile resolver substituted. Every function that reasons about a grant’s authority value takes a ResolvedGrant, so the mismatch case is unrepresentable rather than merely checked-somewhere.

Enums§

AdmissionDecision
The admission decision (L3 BOUND). Admit iff, on every axis, the fence’s resolved scope stays within the bound delegated ∪ closure; any widening, incomparability, or undecidable comparison refuses fail-closed.
BindError
Why an Authority body could not be bound to a Grant.
ChainDecision
Whether a derivation chain is trusted.
ChainReject
Why a derivation chain is not trusted.
ConfinedAxis
The four OS-confinement axes (names an AdmissionReject).
Derivation
How a Grant came to hold its authority (the authorization proof — L6).
DerivationDecision
Result of checking one derivation edge (L6 + L7).
DerivationReject
Why a derivation edge is not valid.
ResolvedScope
What a native fence actually permits on ONE axis, expressed portably (the projection agent-bridle produces from its native profile). The lattice the L3 BOUND law is computed over — fidelity is never asserted.
ScopeRelation
How a resolved scope stands relative to a bounding scope (does the fence stay within what was authorized?).

Traits§

AttestationVerifier
The verifier contract for operator Elevation attestations (L6). Real signature verification is provided downstream (agent-bridle / newt operator key); Phase A ships only the contract plus a fail-closed default.

Functions§

admit
The pure L3 admission decision. For every axis, the actually-permitted authority (resolved, projected from the native fence by agent-bridle) must be ⊆ the bound delegated ∪ closure:
check_derivation
Check a single derivation edge for child against its parent (L6).
empty_closure
A no-authority closure (all axes deny/empty) — the common case where the harness adds nothing beyond the delegated grant.
relate
Relate a resolved fence scope to the bound it must stay within: does resolved ⊆ bound? Returns the precise relation so a widening (ScopeRelation::Superset) is a distinct, reportable fact from an undecidable comparison (ScopeRelation::Unknown). Containment is per dimension: Bounded ⊆ Bounded iff both concrete ⊆ concrete and classes ⊆ classes.
verify_chain
Verify a full derivation chain against an externally-trusted root (L5).