proof-aware-crypto-tooling-.../tests
mrwulf ddbb5a4fd8 fix(verify_consistency): restore RFC 9162 Step-7 terminal sn==0 check
The deployed consistency verifier implemented the RFC 9162 2.1.4.2
bit-navigation loop but its final return checked only the two
reconstructed roots, omitting the terminal condition that the new-size
navigation counter reach zero. That condition couples the consumed proof
length to the claimed tree sizes; without it, a valid proof for one
transition verifies under a lied (power-of-two) old size. Flagship: a
valid 2->3 proof is accepted under the false claim 1->3 with the size-2
root.

Fix: add `and sn == 0` to the final return.

This is the corpus's Known Gap 14 (3,867 deployed-accepts-only cases in a
pinned 73,573-case family, recorded in public log entry 13). It was
found by the project's own differential harness; a post-appeal review
round added a faithful RFC oracle as a third comparison, which showed
the deployed verifier — not the mechanized model — was the one deviating
from RFC 9162, and traced it to the missing terminal check.

Scope: verify_consistency's only production caller is the consumer-side
pin store, reached only behind a verified head signature. Generation is
RFC-correct and unaffected; the live provider service does not run this
verifier; the published standalone verify.py has no consistency verifier.
An empirical search found 0 realizable pin-advance poisons against an
honestly pinned consumer, consistent with Known Gap 14's non-claim.

Verification:
- New fail-first three-way regression test
  test_consistency_lied_size_three_way_agreement (deployed / recursive
  ConsRec model / independent faithful RFC 9162 transliteration) over the
  honest AND lied-size families; fails pre-fix, passes post-fix.
- Historical differential tests (164,479 inclusion; 164,224 consistency)
  unchanged — the fix rejects nothing honest.
- Full suite: 145 passed, 0 failed.

Public log entry 13, the attested accumulator commit, and the IACR
submission PDF are all unchanged. Vulnerable state tagged
vulnerable/sn0-consistency-fd2f6ba. See
docs/security-2026-07-23-consistency-terminal-check.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 18:34:23 +02:00
..
fixtures/mini-ed25519-verified/verification initial proof-aware tooling prototype 2026-07-03 10:51:03 +02:00
test_agent.py add policy-gated agent consequences 2026-07-03 11:05:06 +02:00
test_artifact.py add policy-gated agent consequences 2026-07-03 11:05:06 +02:00
test_attestation.py audit v3: paper-reality congruence + external-pointer integrity (Fable-5 Socratic pass) 2026-07-09 21:33:28 +02:00
test_boundaries.py audit v3: paper-reality congruence + external-pointer integrity (Fable-5 Socratic pass) 2026-07-09 21:33:28 +02:00
test_claim_cards.py initial proof-aware tooling prototype 2026-07-03 10:51:03 +02:00
test_claim_failures.py add policy-gated agent consequences 2026-07-03 11:05:06 +02:00
test_curriculum_notebooks.py curriculum: lecture 11 - the customer's-eye view (requirements card, wish-meets-supply, grow-the-supply) 2026-07-07 22:16:05 +02:00
test_doctor.py add verifier bootstrap and attestation lane 2026-07-03 11:24:13 +02:00
test_dogfood.py The provider eats its own dogfood: root signatures via the merkleized library 2026-07-06 15:21:17 +02:00
test_hygiene.py initial proof-aware tooling prototype 2026-07-03 10:51:03 +02:00
test_lean.py fix: fail-closed certificate classification + record-scoped axiom parsing (review round 6) 2026-07-16 15:15:58 +02:00
test_manifest_parsing.py initial proof-aware tooling prototype 2026-07-03 10:51:03 +02:00
test_paper_verifiers.py fix(verify_consistency): restore RFC 9162 Step-7 terminal sn==0 check 2026-07-23 18:34:23 +02:00
test_profiles.py Estate sync: boundary-axiom vocabulary + the four-tier apex reality (R4) 2026-07-06 10:04:43 +02:00
test_provider.py fix: the attestation LEAF now carries its own scope block (review round 6) 2026-07-16 15:25:19 +02:00
test_published_assets.py publish assets: sync the fail-open time bomb; llms/course/test docs refreshed (doc audit 2026-07-19) 2026-07-19 13:10:55 +02:00
test_quorum.py warden re-audit (Fable 5): fix ledger race, quorum perf, small-order honesty 2026-07-07 08:24:51 +02:00
test_risk.py add verifier bootstrap and attestation lane 2026-07-03 11:24:13 +02:00
test_signing.py add nested proof check provider 2026-07-03 13:03:58 +02:00
test_sthstore.py sthstore: equivocation poisons the pin + retains transferable evidence 2026-07-09 17:53:13 +02:00
test_transparency.py add transparency log trust provider 2026-07-03 14:09:34 +02:00
test_wallet.py docs: coherence + portability audit — clean-clone bootstrap proven 2026-07-21 18:00:08 +02:00
test_wallet_hardening.py warden hardening round: policy engine, ledger rotation, MCP UX, treasury LIVE, ops docs 2026-07-07 13:38:42 +02:00
test_walletmcp.py warden tests: quorum taxonomy, wallet firewall/ledger/latch, MCP surface (83 passing) 2026-07-06 23:40:35 +02:00
test_walletui.py estate: the SLH-DSA (FIPS 205) campaign enters the map — two new entities 2026-07-22 22:02:39 +02:00
test_web_and_witness.py publish assets: sync the fail-open time bomb; llms/course/test docs refreshed (doc audit 2026-07-19) 2026-07-19 13:10:55 +02:00