registrystack / registrystack/registry-stack

Feature: caseworkctl audit verify — offline verification of the hash-chained audit journal

Open
#980 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
2
Forks
0
Avg merge
2h 55m
Merged PRs (30d)
130

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.