Skip to content

proof(merkle): Stage 1.3 — IO↔pure bridge (proven Either-monad mirror + thin FFI assumption)#50

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-noether-hkgAV
Jun 18, 2026
Merged

proof(merkle): Stage 1.3 — IO↔pure bridge (proven Either-monad mirror + thin FFI assumption)#50
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-noether-hkgAV

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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

  • rootHashBytesE / verifyProofE — pure Either-monad mirrors of rootHashBytesIO / verifyProofIO (identical control flow; a pure failing combiner cf models hashPairBlake3, whose Left is BLAKE3 buffer-allocation failure).
  • 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 by induction.
  • rootHashBytesIO_spec / verifyProofIO_spec (PROVEN, conditional) — 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 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, no believe_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

  • Clean from-scratch idris2 --build ochrance.ipkg under --total, 20/20, exit 0. No believe_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 h and state merkleBinding (the other typed hypothesis; discharged in Stage 4).

🤖 Generated with Claude Code

https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ


Generated by Claude Code

…-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
hyperpolymath marked this pull request as ready for review June 18, 2026 00:41
@hyperpolymath
hyperpolymath merged commit 02ba7ec into main Jun 18, 2026
19 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dazzling-noether-hkgAV branch June 18, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants