Manifest & Reconciliation Verification
Almost everything else in this book tests behavior — does this function, screen, or service do the right thing? This page is about a different, quieter failure: incompleteness. Every part passed its test, and yet the whole is wrong because something is silently missing — a file that didn’t deploy, a row that didn’t migrate, a record the batch job skipped. Behavior tests rarely catch this, because the thing that’s absent has no test; it simply isn’t there. The tool for it is manifest verification (also called reconciliation): declare the set you expect, compare it to the set that actually exists, and flag any difference.
The idea: commit to a list, then check reality against it
Section titled “The idea: commit to a list, then check reality against it”A manifest is a declared, authoritative list of what should exist — the expected set. Verification is a plain set comparison against what’s really there, and the crucial part is that you check it both directions:
MANIFEST (expected) REALITY (actual) ──────────────────── ──────────────── a b c d a b d e │ │ ▼ ▼ MISSING = expected − actual = { c } ← in the list, not there (usually the dangerous one) EXTRA = actual − expected = { e } ← there, not in the list (an "orphan"; often a leftover or a bug)One direction is not enough. Checking only “is everything I expected present?” misses the stray extra file an attacker planted or a bad deploy left behind. Checking only “does everything here belong?” misses the file that never arrived. Completeness is a two-way check.
This is the same shape as a Merkle root in the Bitcoin book: a compact commitment to a list, against which membership and completeness can be verified cheaply. A manifest is the un-cryptographic, everyday version of the same discipline.
Reconciliation: two sources that must agree
Section titled “Reconciliation: two sources that must agree”Reconciliation is manifest verification where both sides are “real” — two independent records of the same truth that should match. It’s the standard integrity check whenever data or artifacts move:
- A data migration: row counts (and, better, per-column checksums) in the source table must equal the destination. “The app works on the new database” says nothing about the 4,000 rows that silently dropped.
- A deploy: the set of files in the build output must equal the set served in production. A half-uploaded deploy passes every smoke test that happens to hit the pages that did upload.
- A batch / ETL job: records read must equal records written plus records rejected — and every rejection must be accounted for, not just dropped.
- A backup: the only real test of a backup is a restore that reconciles back to the original. An unverified backup is a hope, not a safeguard.
- A paginated API pull: did you actually fetch all N pages, or stop at a silent truncation? Reconcile the count you got against the total the API reported.
Under the hood — missing vs. extra vs. altered
Section titled “Under the hood — missing vs. extra vs. altered”Set comparison catches missing and extra, but not altered — a file that’s present, named correctly, and wrong inside. For that, the manifest has to commit to content, not just names: store a hash (checksum) per item and compare hashes, not just the list of keys. Names-only reconciliation answers “is the right set here?”; hash-based reconciliation also answers “is each item unchanged?” — which is exactly the jump from a table of contents to a Merkle root.
A worked example: verifying a book like a block
Section titled “A worked example: verifying a book like a block”This one is real, and it’s why this page exists. The First-Principles books you’re reading declare a chapter list on each book’s landing page — that landing is the manifest: the authoritative set of pages the book claims to contain. The actual pages are the Markdown files on disk. A manifest-verification script compared the two, in both directions, for every book:
manifest = every page linked from the landing (the "table of contents") disk = every page file that actually exists MISSING = listed on the landing but no file → a broken link (dangerous) ORPHAN = a file exists but the landing never lists it → reachable, but off the mapRunning it found zero missing (no dangling links — good) but two orphan pages: a pair of hand-written walkthrough pages that existed on disk and were reachable through the sidebar, yet were absent from the landing’s chapter list. Every one of those pages worked; no behavior test would ever have flagged them. Only comparing the declared set to the real set surfaced the gap — which was then fixed so the manifest matched the disk exactly. That is manifest verification earning its keep on the very artifact you’re reading.
The architect’s lens
Section titled “The architect’s lens”- Why does it exist? Because behavior testing checks the parts that are present and is blind to what’s absent; completeness needs its own, separate check.
- What problem does it solve? Silent incompleteness — the dropped row, the un-uploaded file, the skipped record — that passes every functional test because the missing thing has no test.
- What are the trade-offs? It needs a trustworthy expected set (the manifest) to compare against; if the manifest itself is wrong or stale, the check gives false confidence. Hash-based reconciliation costs more than a name check but is the only way to catch altered items.
- When should I avoid it? When there’s no meaningful “complete set” to declare — genuinely open-ended or streaming outputs where “all of them” isn’t defined. Then monitor rates and invariants instead.
- What breaks if I remove it? Migrations lose rows unnoticed, deploys ship half the site, backups can’t be trusted, and ETL jobs drop records — each invisible until a user hits the hole.
Check your understanding
Section titled “Check your understanding”- Behavior tests pass on every component, yet the system is wrong. What class of failure does manifest verification catch that behavior tests structurally cannot?
- Why must the manifest check run in both directions? Give a concrete failure that a one-directional (“is everything I expected present?”) check would miss.
- Set comparison catches missing and extra but not altered. What do you have to add to the manifest to catch an item that’s present but changed — and which Bitcoin concept is that the everyday version of?
- Give two real situations where reconciliation is the right check, and name the two sides being reconciled.
- In the book example, what’s the difference between a missing page and an orphan page, and why is one more dangerous than the other?
Show answers
- Silent incompleteness — something that should exist is simply absent. Behavior tests exercise the things that are present; a missing item has no test to fail, so it slips through. Only comparing the expected set to the actual set reveals it.
- Because “everything I expected is present” doesn’t catch extra items that shouldn’t be there — a stale
leftover file, an attacker-planted artifact, a duplicate row. Concrete miss: a deploy where a needed file
never uploaded and an old file wasn’t removed can have matching counts and pass a one-way check, while the
site is broken. Only
actual − expectedfinds the orphan. - Store a hash/checksum per item in the manifest and compare hashes, not just names/keys — then a present- but-changed item shows up as a mismatch. It’s the everyday version of a Merkle root, which commits to the content of the list, not just its membership.
- Any two: a data migration (source table ↔ destination table, by row count/checksum); a deploy (build output ↔ files served in production); a batch/ETL job (records read ↔ records written + rejected); a backup (original ↔ restored copy); a paginated pull (records received ↔ total the API reported).
- A missing page is listed in the chapter list but has no file → a broken link a reader will hit (dangerous). An orphan page has a file but isn’t listed → it still works and may be reachable another way (e.g. a sidebar), so it’s an integrity/discoverability gap rather than a user-facing break. Missing is more dangerous because it fails the reader directly.