proof(merkle): Stage 1.3 — IO↔pure bridge (proven Either-monad mirror + thin FFI assumption)#50
Merged
Merged
Conversation
…-monad mirror + thin FFI assumption) Connect the proven Merkle theorems to the production IO crypto path without faking the FFI. IO is opaque, so the bridge is decomposed: - rootHashBytesE / verifyProofE: pure Either-monad mirrors of rootHashBytesIO / verifyProofIO (same control flow; a pure failing combiner cf models hashPairBlake3). - rootHashBytesE_spec / verifyProofE_spec (PROVEN): when cf models a pure combiner h with no failure, the Either-monad folds compute exactly the proven pure spec (Right (rootHashWith h t) / Right (verifyProofWith h ...)). This is the "modulo the Either allocation-failure plumbing" content, fully machine-checked. - rootHashBytesIO_spec / verifyProofIO_spec (PROVEN conditionally): the production IO folds compute the proven result, GIVEN the sole assumed boundary -- the IO fold equals `pure` of its pure mirror -- passed as an explicit `reflect` hypothesis. No postulate / believe_me; the trust boundary is named, not hidden. New module Ochrance.Filesystem.MerkleIO (added to ipkg). Clean --total build, 20/20. PROOFS.adoc: Stage 1.3 marked DONE; proven surface + optimisation ledger updated (root combiner now unlocked given the FFI-reflection hypothesis). https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ
hyperpolymath
marked this pull request as ready for review
June 18, 2026 00:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage 1.3 of the proof campaign — the IO↔pure bridge, connecting the proven Merkle theorems to the production IO crypto path without faking the FFI. IO is opaque, so the bridge is decomposed (the approach chosen for this stage): a fully machine-checked pure part + one explicit, named trust assumption.
New module
ochrance-core/Ochrance/Filesystem/MerkleIO.idrrootHashBytesE/verifyProofE— pureEither-monad mirrors ofrootHashBytesIO/verifyProofIO(identical control flow; a pure failing combinercfmodelshashPairBlake3, whoseLeftis BLAKE3 buffer-allocation failure).rootHashBytesE_spec/verifyProofE_spec(PROVEN) — whencfmodels a pure combinerhwith no failure, theEither-monad folds compute exactly the proven pure spec:Right (rootHashWith h t)/Right (verifyProofWith h …). This is the "modulo the Either allocation-failure plumbing" content, fully machine-checked by induction.rootHashBytesIO_spec/verifyProofIO_spec(PROVEN, conditional) — the production IO folds compute the proven result, given the sole assumed boundary: the IO fold equalspureof its pure mirror, passed as an explicitreflecthypothesis argument.The honesty story (why decompose)
The only thing not machine-checked is the opaque-IO reflection — and it is named, not hidden: no
postulate, nobelieve_me. Everything provable is proven; the FFI trust boundary is a visible hypothesis the production theorems are explicitly conditional on. This is the smallest honest assumption and keeps the crypto-integrity claim (issue #39) truthful.Verification
idris2 --build ochrance.ipkgunder--total, 20/20, exit 0. Nobelieve_me/assert_*/postulate/holes.docs/PROOFS.adoc: Stage 1.3 marked DONE; proven surface + optimisation ledger updated (the "real BLAKE3 in IO" optimisation is now unlocked given the FFI-reflection hypothesis).Next: Stage 1.4 — introduce
CollisionResistant hand statemerkleBinding(the other typed hypothesis; discharged in Stage 4).🤖 Generated with Claude Code
https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ
Generated by Claude Code