Skip to main content

Crate rigorix_verifier

Crate rigorix_verifier 

Source
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§

ApprovalRecordRef
AuditEnvelope
ClaimLevels
What the producing deployment can do, on two independent axes.
CompactionCheckpoint
ADR-016 anchor-signed compaction checkpoint.
EffectRecord
The frozen wire record (mirrors enterprise EffectRecordResponse).
EffectRecordArtifact
The effect-commitment artifact: record + settlement evidence + levels.
ExecutionEventRef
HistoryActionRef
One prior action in an anchor-signed history slice (mirrors engine HistoryAction; parameter values never appear).
HistorySlice
ADR-016 anchor-signed history projection the guard consumes in anchored mode.
IdentityRef
LedgerReceipt
ADR-016 anchor-signed ledger receipt.
PreconditionFindingRef
ADR-017 R1/B dispatch-time precondition finding (mirrors the engine PreconditionFindingRef). Fixed shape: exit_code is always serialized (null for error/unarmed). Only an inputs_hash is recorded \u2014 never parameter values or raw stdout (SpanPrivacy).
RequirementFindingRef
R9/ADR-015 redacted operator step-requirement finding (mirrors the engine RequirementFindingRef). Parameter VALUES never appear (SpanPrivacy).
ResolverIdentity
Who settled an ambiguous attempt (ResolverIdentity).
ScopeViolationRef
ScoreDimensionRef
ScoringResultRef
SequencePolicyFindingRef
SettlementEvidence
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.
EffectState
Lifecycle state of a recorded effect (mirrors rigorix-oss EffectState).
EventStatus
EventStatus mirrors the engine enum EXACTLY — including the absence of rename_all: serde emits the capitalized variant names (Success, Failure, Skipped, Cancelled).
HistoryIntegrity
ADR-016: which integrity regime produced an envelope’s evidence.
HistoryPolicy
ADR-016: a recorded history-policy opt-in.
IdentitySource
IntentHashProvenance
How an approval’s intent_hash came to exist (#1243).
OutcomeVerdict
What a provider read-back proved (mirrors rigorix-oss OutcomeVerdict).
ResolverKind
The class of a resolver (mirrors enterprise ResolverKind).
ScopeCheckStatus
Whether the R5 effect-scope check ran, separate from what it found (#1189).
SettlementLevel
Settlement axis: whether provider evidence can prove the effect settled.
VerifyError
JSON Schema conformance failure.

Functions§

canonical_bytes
Compute the canonical envelope bytes: parse, null the signature, serialize exactly as the engine’s compute_signature does.
canonical_bytes_of
Canonical bytes of a parsed envelope (signature nulled, sorted maps) — ADR-016: the SAME bytes define the HMAC signature, prev_hash, ledger envelope_hash, and checkpoint prior_head/new_head (one form).
compaction_checkpoint_signing_bytes
Canonical signing bytes for a compaction checkpoint (sig nulled).
envelope_hash
SHA-256 (hex) of an envelope’s canonical bytes — the prev_hash value a successor stores (and the ledger envelope_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 (sig nulled).
ledger_receipt_signing_bytes
Canonical signing bytes for a ledger receipt (sig nulled).
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 candidate is 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) and new_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) over canonical with 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_digest from the exact provider bytes carried in settlement.readback (hex(SHA-256(bytes))).
verify_signature
Verify an envelope’s signature over its canonical form.

Type Aliases§

VerifyResult