Expand description
Typed authority validator (Authority Model §14 + ADG).
§Status — preview
This module ships under the CELLOS_AUTHORITY_VALIDATOR_PREVIEW=1 policy
authorized by the ADR-0005 SLA council (see
Plans/cellos-code-complete-roadmap.md §7 Phase B1).
At time of landing, ADR-0005 is Proposed; the council recommended
pre-merging the B2 validator scaffold behind this preview flag if the
ADR-0005 Accept SLA (deadline 2026-05-20) slips, so post-1.0 work has a
stable foundation to rest on.
What lands here (B2-1 / B2-2 / B2-3 + T3.A / F2):
- The four typed authority variants (
ObservedAuthority,ProvenAuthority,ImposedAuthority,DeclaredAuthority) — mechanically separated per docs/authority-model.md §14 and ADR-0006 §1. - The validator function and supporting enums:
AuthorityDerivation,EpistemicStatus,RuleClass,Rule,BindingStatus,ValidationError. - The compile-fail
GuestEventBuildergate (T3.A / F2). - Property tests for the §9 non-inflation invariants
(see
testssubmodule).
What deliberately does NOT land here (B3, post-1.0):
- No producer (event-builder, supervisor admission, sni_proxy) wires these types in yet. The CloudEvent emitters keep producing today’s untyped shape until the post-1.0 wiring slice replaces them.
- No JSON Schema integration with
contracts/schemas/. The schemacell-observability-l7-authority-evidence-v1.schema.jsonlands as part of B3 (post-1.0).
§DeclaredAuthority — F2 / T3.A
ADR-0006
defines the fourth variant DeclaredAuthority (Tier ceiling 1,
epistemic status EpistemicStatus::Declared) for guest-side
cellos-telemetry declarations forwarded over the per-cell vsock
channel. The mono-class envelope (RuleClass::GuestAgentDeclaration)
prevents host-side classes from co-occurring inside the same typed
authority. The companion GuestEventBuilder trait pins the rule-class
at compile time via a const-asserted check, so a guest event-builder
cannot accidentally route through a stronger class.
§Doctrine gates
- D9 (mechanical separation): the three types share no common base
trait, expose no
From/Intoconversions between each other, and each carry their own validatedAuthorityDerivation. Merging two stacks is a compile error, not a runtime contract. - D11 (no I/O in
cellos-core): the validator is pure. It takes plain values, returnsResult. No tokio, no reqwest, no syscalls.
§Overview
The Authority Derivation Graph (ADG) — see
docs/authority-derivation-graph.md
— is the canonical record of how an authority emission was computed.
Every typed authority MUST carry an AuthorityDerivation and the
validator enforces six invariants on construction:
- Confidence non-inflation —
output.confidence ≤ max(inputs.confidence). - Tier ceiling —
output.tier ≤ min(rule_class_tier_ceiling). - Epistemic determinism —
output.epistemic_statusis the unique image of the rule-class set under the canonical mapping. - ADG presence — emissions cannot construct without an ADG (gated
by builder API and refused by the validator if
inputsorrules_appliedis empty). - Rule → class consistency — every applied rule’s declared class matches the canonical mapping.
- Type-class compatibility —
ObservedAuthoritycannot carryCRYPTOGRAPHIC_PROOFrules;ProvenAuthoritycannot be built without one;ImposedAuthorityrequiresIMPOSED_INTERCEPTION.
See submodule [validator] for the typed-authority constructors and
[crate::authority::tests] (cfg(test)-only) for the property tests.
Re-exports§
pub use derivation_result::AuthorityValidationResult;pub use declared::DeclaredAuthoritySurface;
Modules§
- declared
- F2 — guest-declared capability surface and the subset validator the host runs before accepting in-VM telemetry.
- derivation_
result - T2-B21 — typed result variants for
verify_authority_derivation.
Structs§
- Applied
Rule - One rule that fired during derivation.
- Authority
Derivation - The complete ADG sub-object. Serializable for downstream events.
- Authority
Input - One evidence atom consumed by a derivation. Mirrors the ADG
inputs[]schema; see docs/authority-derivation-graph.md. - Authority
Output - The derived
(tier, confidence, epistemic_status, binding_status)tuple. - Declared
Authority - Authority asserted by a guest-side declaration (in-VM
cellos-telemetryagent over the per-cell vsock channel) per ADR-0006. - Imposed
Authority - Authority asserted by CellOS having terminated TLS in-line and observed plaintext that the workload would not have shown without termination.
- Observed
Authority - Authority derived from CellOS’s own observation of bytes inside the cell’s network namespace.
- Proven
Authority - Authority derived from cryptographic verification of a claim CellOS did not author.
Enums§
- Authority
Input Type - Canonical input types — a strict subset of those listed in the ADG doc.
- Binding
Status - Binding status per docs/authority-model.md §6.
- Epistemic
Status - Capability-tier and confidence semantics from docs/authority-model.md §5b.
- Proven
Authority Artifact - Verified-signature artifact backing a
ProvenAuthority. Storing the artifact alongside the derivation preventsProvenAuthorityfrom being constructed from a derivation that claimsCryptographicProofwithout actually carrying the proof material. - Rule
- Named rules per
docs/authority-derivation-graph.md.
Adding a new rule requires updating that document AND
canonical_class_for_rule. - Rule
Class - Rule-class drives
EpistemicStatus; this is the canonical enum from docs/authority-derivation-graph.md. - Validation
Error - Errors the validator can return. Each variant names the specific §9 invariant it violates so debug logs and tests can distinguish them.
Traits§
- Guest
Event Builder - Compile-fail gate for guest event-builders (ADR-0006 / O2 doctrine
red-line). Implementors declare their canonical
RuleClassas an associated constant; aconst-asserted check inSelf::rule_classmakes any class other thanRuleClass::GuestAgentDeclarationa compilation error at the call site.
Functions§
- canonical_
class_ for_ rule - The canonical rule-name → rule-class mapping. Mirrors the table in docs/authority-derivation-graph.md.
- epistemic_
for_ class_ set - The deterministic class-set → epistemic-status mapping per docs/authority-derivation-graph.md:
- max_
tier_ for_ class - Tier ceiling per rule-class — the canonical mapping. The ADG doc and docs/authority-model.md §5b pin these numbers; do not change them without an ADR amendment.