Expand description
Lattice surface for the PDP — re-export of S1’s canonical types (#567).
S4 (#570) originally developed the TE evaluator + AVC against a stub lattice
(StubLinearLattice + a local SecurityLabel(u32) + a Lattice dominance
trait) so the two streams could proceed in parallel. S1 has landed
(feature/security-mac-ucan @ 406ff9fdc) with the real, canonical types in
hyprstream_rpc::auth::mac, and this file is now a thin re-export so the rest
of the PDP (te.rs, avc.rs, compiled.rs) consumes S1 directly. The stub is
deleted.
§What changed at reconciliation (the S1 contract, as landed)
SecurityLabelis no longer an opaqueu32interned id. It is S1’s structured value — a point in the product latticeLevel × Assurance × CompartmentSet— and isCopy + Ord + Hash(compartments are a packedu64bitset), so it still keys the AVC directly with no interning indirection. Crucially it has noDefault: an unlabeled subject/object isOption::None⇒ deny, never a permissive default.- Dominance (
⊒) and join (⊔) are intrinsic to the value (SecurityLabel::can_access,SecurityLabel::join/SecurityLabel::join_all), and re-exposed onSecurityContext::can_accessfor a verified subject. They are NOT methods on aLatticetrait — content truth, no policy argument. The oldLattice::can_access/jointrait is gone; the PDP floor now calls the intrinsic order (seete.rs). Latticeis now S1’s policy object (the closed, versioned compartment name↔bit vocabulary). The PDP holds it to (a) align its TE matrix columns to the exact bits a label carries viaLattice::compartment_names, (b)validatelabels at enrollment/seal, and (c) embed it, viaLattice::to_bytes, inside the signedCompiledPolicyso every process reconstructs the identical bit map (compiled).LatticeVersionis bound toCompiledPolicy.generation.
The MAC floor (per-op subject.ctx ⊒ object.label + IFC join) is computed
against the intrinsic order and is independent of any grant/token/UCAN
(design §3, §10).
Structs§
- Compartment
- A need-to-know compartment name (the categories axis vocabulary).
- Compartment
Set - A fixed bitset of compartment bits — the powerset-lattice axis, packed so
SecurityLabelstaysCopy + Ord + Hash. - Lattice
- The active lattice policy: the closed compartment vocabulary (name↔bit) and the version. Levels and assurances are fixed by their enums (TCB), so only the open dimension — compartments — needs a registry.
- Lattice
Codec Error - Failure decoding a
Latticefrom its canonical byte form: either the CBOR itself was malformed or the decoded vocabulary was rejected (seeLatticeDecodeError). Carries a rendered message; the distinction is not load-bearing for callers, which fail closed either way. - Lattice
Version - Monotonic lattice policy version. Crypto-agility / policy-agility rule
(design §14): the suite/lattice is pinned and versioned; migration is a
deliberate version bump, never an in-band negotiation. Labels and the
(UCAN, bundle_hash)approval (S5) bind this version so a label minted under v1 can’t be silently reinterpreted under v2. - Security
Context - A verified subject’s security context = the clearance label the monitor compares against object labels.
- Security
Label - A complete security label: a point in the product lattice
Level × Assurance × CompartmentSet.
Enums§
- Assurance
- Crypto-assurance axis (#548) — a total order derived from verified key material, never claimed.
- Label
Error - Reasons a label fails the well-formedness policy. All are fail-closed.
- Lattice
Decode Error - Reasons a serialized
Latticeis rejected on decode. All fail-closed: a malformed wire vocabulary never silently becomes a smaller/different lattice. - Level
- Multi-Level-Security sensitivity level — a total order (the MLS axis).
- Verified
KeyMaterial - How a principal’s key material was verified, used to derive (never trust) an
Assurance. Produced by the envelope/claims verification layer — this type is the seam between “what crypto verified” and “what the lattice sees”.
Constants§
- MAX_
COMPARTMENTS - Number of distinct compartments representable in a label.
Traits§
- Subject
Context Claims - Seam for carrying a subject clearance on the verified claims/envelope.
Functions§
- ifc_
join - IFC convenience: join a slice of input labels into the derived label (design
§3 — sealed at rollup). Thin forwarder over S1’s intrinsic
SecurityLabel::join_all. Non-empty joins use the per-axis algebraic identity(Public, PqHybrid, {}); empty input instead yields the fail-closed(Public, Unverified, {}), which the seal/rollup policy (S2) must treat as suspicious. This is the function S6/seal-time labeling calls; it lives here so PDP callers have a single entry-point without reaching across crates.