Archivist
Q2 capstone: Python CLI that produces tamper-evident Merkle manifests for journalism source bundles.
Scenario
Twenty-six weeks in. Pinter ch 11–18 (rings, ideals, quotient rings) done, hash functions and Merkle trees understood, AES walked from S-box to GCM, concurrent-Python toolkit working. The Q2 capstone is to build a Merkle-tree archival CLI in Python that hashes a real Memory Hole investigation source bundle and produces a tamper-evident manifest. End-to-end verifiable. Public repo. Used in production.
Success criteria
- CLI takes a directory and emits (manifest.json, root_hash.txt) where manifest is a Merkle tree of file hashes.
- Verify command takes a directory and a manifest, returns 0/1 + a per-file diff if any file's hash does not match.
- Concurrent hashing: tested to scale to 10,000 files on a developer laptop within 30 seconds.
- 100 percent test coverage on the verify path; property-based tests via Hypothesis on the tree-construction path.
- Used to manifest one real Memory Hole investigation source bundle (Pittsburgh Water or SFK Drownings).
What the CLI does
archivist init ./pittsburgh-water-sources
archivist verify ./pittsburgh-water-sources --manifest manifest.json
The init command walks the directory, computes SHA-256 for each file, builds a Merkle tree, writes manifest.json (the leaves and the inner nodes) and root_hash.txt (just the root). Anyone with the root hash can later verify any file in the bundle without the rest, by walking the Merkle proof from the leaf to the root.
What’s verified
- Each file’s bytes have not been altered since the manifest was written.
- No files have been added or removed.
- The root hash matches what the journalist published at the time of investigation release.
Stretch criteria (optional, no extra XP)
- Detached signature on the root hash with the journalist’s PGP key.
- Append-only: a
sealmode that publishes the root hash to a public timestamping service so the manifest cannot be backdated. - Web visualization: a small HTML page that renders the tree and lets a reader click any leaf to verify it.
Why this capstone matters
The /archive skill already hashes sources. This capstone makes that hashing into a verifiable structure that a reader can independently check. It is the first cryptographic component of the Trustless Journalism Protocol shipped under your name.