registrystack / registrystack/registry-stack
Feature: caseworkctl audit verify — offline verification of the hash-chained audit journal
- Lingua principale
- Rust
- Stelle
- 2
- Fork
- 0
- Merge medio
- 2h 55m
- PR unite (30g)
- 130
Descrizione
### Context
The audit journal is an append-only hash chain of envelopes (`envelope_id`, `timestamp_unix_ms`, `prev_hash`, `record`, `record_hash`; see `crates/registry-platform-audit`). Operators need to verify a journal offline in two situations:
- after restoring an instance from an export, to confirm the chain is intact and continues from the exported head;
- during incident review, to demonstrate the journal was not truncated or rewritten.
Nothing shipped does this today — verification requires re-implementing the chain derivation from the crate source. I had to write an independent verifier to prove chain continuity across an export/restore cycle (it reproduced the runtime's hashes and confirmed post-restore appends extended the exported head), which is exactly the check operators should get out of the box.
### Ask
Add `caseworkctl audit verify` that:
- takes a journal path plus the audit master key (via a `secret:` reference or env),
- re-derives and checks every record hash and prev-hash link,
- prints the verified record count and head hash, and exits nonzero on any mismatch,
- optionally accepts a known head (`--from-head `) to verify continuation from that head rather than from genesis — the export/restore case.
Implementation can reuse `registry-platform-audit`'s hashing directly rather than a parallel implementation.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with the caseworkctl audit command entry point and the hashing implementation in crates/registry-platform-audit, then trace how journal paths and secret: or environment references are handled. Define completion as verifying every record and prev-hash link, supporting --from-head, printing the record count and head hash, and returning nonzero on mismatch.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- cli, security
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 58/100