Expand description
rigorix-verifier — protocol-only verification of Rigorix audit envelopes.
Strategy A (SDK freeze D-2): the HMAC trail must be independently
checkable anywhere — this crate verifies envelopes WITHOUT depending on
rigorix-engine. The envelope structs below are FROZEN copies of
rigorix-oss engine/src/audit/domain/envelope.rs + the redacted identity
ref from identity/domain/claim.rs (contract freeze: do not edit them to
match engine internals; edit them only when the SDK schemas change).
@canonical schemas/envelope.json (Rigorix Audit Envelope v2) — the contract
this verifier checks against; the frozen structs below mirror rigorix-oss
engine/src/audit/domain/envelope.rs.
Canonicalization contract (must reproduce the engine byte-exact):
HMAC-SHA256 over serde_json::to_string(envelope with signature = None).
Struct field order is declaration order; Options with skip_serializing_if
are omitted when None; Options without it serialize as null; empty
vectors/maps with skip_serializing_if are omitted. The signature field is
NOT skipped — canonical bytes include "signature": null.
Structs§
- Approval
Record Ref - Audit
Envelope - Claim
Levels - What the producing deployment can do, on two independent axes.
- Compaction
Checkpoint - ADR-016 anchor-signed compaction checkpoint.
- Effect
Record - The frozen wire record (mirrors enterprise
EffectRecordResponse). - Effect
Record Artifact - The effect-commitment artifact: record + settlement evidence + levels.
- Execution
Event Ref - History
Action Ref - One prior action in an anchor-signed history slice (mirrors engine
HistoryAction; parameter values never appear). - History
Slice - ADR-016 anchor-signed history projection the guard consumes in anchored mode.
- Identity
Ref - Ledger
Receipt - ADR-016 anchor-signed ledger receipt.
- Precondition
Finding Ref - ADR-017 R1/B dispatch-time precondition finding (mirrors the engine
PreconditionFindingRef). Fixed shape:exit_codeis always serialized (nullforerror/unarmed). Only aninputs_hashis recorded \u2014 never parameter values or raw stdout (SpanPrivacy). - Requirement
Finding Ref - R9/ADR-015 redacted operator step-requirement finding (mirrors the engine
RequirementFindingRef). Parameter VALUES never appear (SpanPrivacy). - Resolver
Identity - Who settled an ambiguous attempt (
ResolverIdentity). - Scope
Violation Ref - Score
Dimension Ref - Scoring
Result Ref - Sequence
Policy Finding Ref - Settlement
Evidence - Provider evidence that settled an attempt (mirrors OSS
ObservedOutcome), plus the exact read-back bytes and the optional resolver.
Enums§
- Durability
- Durability axis: how long the record survives.
- Effect
State - Lifecycle state of a recorded effect (mirrors rigorix-oss
EffectState). - Event
Status - EventStatus mirrors the engine enum EXACTLY — including the absence of
rename_all: serde emits the capitalized variant names (Success,Failure,Skipped,Cancelled). - History
Integrity - ADR-016: which integrity regime produced an envelope’s evidence.
- History
Policy - ADR-016: a recorded history-policy opt-in.
- Identity
Source - Intent
Hash Provenance - How an approval’s
intent_hashcame to exist (#1243). - Outcome
Verdict - What a provider read-back proved (mirrors rigorix-oss
OutcomeVerdict). - Resolver
Kind - The class of a resolver (mirrors enterprise
ResolverKind). - Scope
Check Status - Whether the R5 effect-scope check ran, separate from what it found (#1189).
- Settlement
Level - Settlement axis: whether provider evidence can prove the effect settled.
- Verify
Error - JSON Schema conformance failure.
Functions§
- canonical_
bytes - Compute the canonical envelope bytes: parse, null the signature, serialize
exactly as the engine’s
compute_signaturedoes. - canonical_
bytes_ of - Canonical bytes of a parsed envelope (
signaturenulled, sorted maps) — ADR-016: the SAME bytes define the HMAC signature,prev_hash, ledgerenvelope_hash, and checkpointprior_head/new_head(one form). - compaction_
checkpoint_ signing_ bytes - Canonical signing bytes for a compaction checkpoint (
signulled). - envelope_
hash - SHA-256 (hex) of an envelope’s canonical bytes — the
prev_hashvalue a successor stores (and the ledgerenvelope_hash). - envelope_
hash_ of - SHA-256 (hex) of a parsed envelope’s canonical bytes.
- history_
slice_ signing_ bytes - Canonical signing bytes for a history slice (
signulled). - ledger_
receipt_ signing_ bytes - Canonical signing bytes for a ledger receipt (
signulled). - sign
- Compute the HMAC-SHA256 hex signature over the canonical form.
- validate_
schema - Validate an envelope against the SDK envelope schema (
envelope.json). - verify_
catalog_ subset - Verify that every method in
candidateis declared in the frozen catalog (schemas/api/catalog.json). - verify_
chain - Verify the local per-producer chain (ADR-016 Phase A), strictly — no gap is accepted. For each producer with chained envelopes:
- verify_
chain_ with_ checkpoints - Verify the local per-producer chain, accepting a gap iff it is covered
by a valid anchor-signed compaction checkpoint (ADR-016 AC 7): the
checkpoint must bracket the gap with
prior_head == hash(before)andnew_head == prev_hash(after), and name exactly the missing sequence range. An uncovered gap fails. - verify_
compaction_ checkpoint - Verify a compaction checkpoint’s Ed25519 signature.
- verify_
ed25519 - Verify an Ed25519 signature (
sig_hex, 64 bytes) overcanonicalwith the anchor’s public key (public_key_hex, 32 bytes). - verify_
effect_ record - Structural verification of an effect-commitment artifact.
- verify_
history_ slice - Verify a history slice’s Ed25519 signature.
- verify_
ledger_ receipt - Verify a ledger receipt’s Ed25519 signature.
- verify_
settlement_ evidence - Readback verification: re-derive
readback_digestfrom the exact provider bytes carried insettlement.readback(hex(SHA-256(bytes))). - verify_
signature - Verify an envelope’s signature over its canonical form.