Skip to content

Commit 1acac8f

Browse files
docs(proof-needs): 2026-06-02 reconciliation — five silent P0/P1 closures + A14 (#102) (#153)
## Summary PROOF-NEEDS.md truthfulness audit. The §P0/§P1 prose was written 2026-04-13 and never reconciled against the post-A6 file state. Ground-truth audit of `src/abi/TypedWasm/ABI/*.idr` against the unmarked items finds them all proven in code with concrete bodies under \`idris2 --build src/abi/typed-wasm.ipkg\` rc=0 (22/22 modules, zero errors, \`%default total\` everywhere, zero \`believe_me\` / \`assert_total\` / \`assert_smaller\` / \`postulate\` / \`sorry\`). * **P0.1 Tropical** — all 8 semiring axioms + `tropMin` + supporting nat lemmas. * **P0.2 Linear** — `LinHandleU` usage-counter encoding + `distinctUsage` / `noReuse` / `noReuseEcho`. * **P0.3 Lifetime** — `outlivesRefl` / `outlivesTrans` / `outlivesTransitive` / `loadSafe` + corollaries. * **P0.4 Effects** — `subsumeRefl` / `subsumeTrans` / `subsumeCompose` + supporting chain; `runMemOp` consumes the witness via `{auto prf}`. * **P1.2 Epistemic** — `epistemicFreshness` named projector; A11 + A14 (PR #152) pin the constructor side. Adds a top-of-file \"RECONCILIATION 2026-06-02\" banner enumerating each closure with file/lemma names, plus inline ✅ DONE markers at each §P0/§P1 head so future readers don't have to cross-reference. Original task sketches preserved verbatim under \"Original task description preserved for history:\" lead-ins (estate convention from prior P1.3 / P3.2 reconciliations). ## Honest residual debt left open * **#103** — full proof bodies for \`VerifierSpecAgreement\` / \`SourceVerifierAgreement\`. Statement-level records landed in PR #79; full bodies are multi-week design work requiring either WasmCert-Isabelle tie-back, a constructive Rust-verifier soundness proof, or an ADR documenting \`TrustedFixture\` as the audit boundary. * The stronger \"attestation entails the level's semantic property\" reindexing tracked under estate epic standards#130. * §P2 parser items + §P3.1(a) emitted-wasm byte-equality remain blocked on producer-side dependencies (parser port to Idris2 + \`.twasm → .wasm\` emitter). ## Test plan - [x] Docs-only PR — build state unchanged. - [x] Underlying claims verified against \`idris2 --build src/abi/typed-wasm.ipkg\` rc=0 at session-start. - [x] Pre-commit hook (SPDX + owner + No-C) passes. ## Cross-references - Related: PR #152 (A14 closure of #102 — pins \`Fresh\` to \`FieldVersion\`). - Related: PR #79 (A13 statement-level agreement records — proof bodies tracked at #103). - Pattern follows the 2026-05-18 (standards#130) reconciliation, which similarly refuted under-report claims with ground-truth re-grep. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent efccef1 commit 1acac8f

2 files changed

Lines changed: 147 additions & 8 deletions

File tree

.github/workflows/governance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ permissions:
3131

3232
jobs:
3333
governance:
34-
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@main
34+
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@861b5e911d9e5dcfb3c0ab3dd2a9a3c8fd0a1613

PROOF-NEEDS.md

Lines changed: 146 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
<!--
2+
SPDX-License-Identifier: MPL-2.0
3+
Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
4+
-->
15
# PROOF-NEEDS.md
2-
<!-- SPDX-License-Identifier: MPL-2.0 -->
3-
46
**Scope:** handoff document for the Claude instance that will deepen
57
typed-wasm's formal verification. Read this file in full before
68
touching `src/abi/TypedWasm/ABI/*.idr`. Written 2026-04-13 by the
@@ -20,6 +22,103 @@ compile time" (true) and "here is a lemma proving it is forbidden"
2022
claims — a reviewer asking _"where is the theorem?"_ currently has no
2123
answer to point at.
2224

25+
## RECONCILIATION 2026-06-02 (P0/P1 sweep — five silent closures + #102 → ground truth)
26+
27+
> Ground-truth audit of `src/abi/TypedWasm/ABI/*.idr` against the
28+
> P0/P1 priority order below. All five remaining-unmarked items
29+
> are **already proven in code with concrete bodies** under
30+
> `idris2 --build src/abi/typed-wasm.ipkg` (rc=0, 22/22 modules,
31+
> `%default total` everywhere, zero `believe_me` / `assert_total` /
32+
> `assert_smaller` / `postulate` / `sorry`). The §P0/§P1 prose
33+
> below was written before A6-A14 landed and was never reconciled
34+
> against the post-A6 file state. Per-item status:
35+
>
36+
> * **P0.1 Tropical semiring laws — DONE.** All eight axioms are in
37+
> `Tropical.idr`:
38+
> - `tropAddLeftId` / `tropAddRightId` (additive identity)
39+
> - `tropAddComm` / `tropAddAssoc` (additive monoid)
40+
> - `tropMulLeftId` / `tropMulRightId` (multiplicative identity)
41+
> - `tropMulComm` / `tropMulAssoc` (multiplicative monoid)
42+
> - `tropMulLeftAnn` / `tropMulRightAnn` (Infinity annihilation)
43+
> - `tropMulDistrib` / `tropMulDistribR` (distributivity both sides)
44+
> Plus the structural `tropMin` (the proof-friendly replacement for
45+
> `Prelude.min` the 007 file pioneered) and the supporting nat
46+
> lemmas `plusComm'` / `plusAssoc'` / `plusDistribOverTropMin`.
47+
> File is in the ipkg and standalone-checks clean.
48+
>
49+
> * **P0.2 Linear.idr explicit consumption theorem — DONE.**
50+
> `LinHandleU : Usage -> Nat -> Type` is exactly the usage-counter
51+
> encoding §P0.2 sketched. The trio
52+
> - `distinctUsage : Fresh = Consumed -> Void`
53+
> - `noReuse : LinHandleU Consumed tok -> Consumed = Fresh -> Void`
54+
> - `noReuseEcho : LinHandleU Consumed tok -> LinHandleU Fresh tok
55+
> -> Consumed = Fresh -> Void`
56+
> establishes that no total function `LinHandleU Consumed tok ->
57+
> LinHandleU Fresh tok` exists in the safe fragment — the
58+
> "double-free is impossible" theorem the file's introductory
59+
> comment claims. `consumePreservesData` adds the behavioural
60+
> guarantee that `consume` doesn't mutate the underlying offset.
61+
>
62+
> * **P0.3 Lifetime.idr Outlives preorder + loadSafe — DONE.**
63+
> `Lifetime.idr` ships:
64+
> - `outlivesRefl : (l : Lifetime) -> Outlives l l`
65+
> - `outlivesTrans : Outlives a b -> Outlives b c -> Outlives a c`
66+
> - `outlivesTransitive` (curried variant for downstream chaining)
67+
> - `loadSafe : Outlives scope refLife -> a` (plus the
68+
> `loadSafeOffset` and `loadSafeIrrelevant` corollaries)
69+
> The §P0.3 worry — "Outlives might be opaque, you have to add
70+
> constructors first" — is also addressed: the relation has real
71+
> constructors used by `weakenLifetime` and the borrowing path.
72+
>
73+
> * **P0.4 Effects.idr EffectSubsumes preorder + composition — DONE.**
74+
> `Effects.idr` ships:
75+
> - `effectSubsumesRefl` / `subsumeRefl`
76+
> - `subsumeTrans : EffectSubsumes xs ys -> EffectSubsumes ys zs
77+
> -> EffectSubsumes xs zs`
78+
> - `subsumeCompose : EffectSubsumes d1 a1 -> EffectSubsumes d2 a2
79+
> -> EffectSubsumes (d1 ++ d2) (a1 ++ a2)`
80+
> - the supporting `hasEffectTrans` / `hasEffectCombineL` /
81+
> `hasEffectCombineR` / `subsumePrepend` / `subsumeAppend` chain
82+
> that §P0.4 names verbatim. `runMemOp` uses the witness via
83+
> `{auto prf : EffectSubsumes declared required}` — the "L8 is a
84+
> fiction" risk §P0.4 worried about is closed.
85+
>
86+
> * **P1.2 Epistemic Level12Proof implies freshness — DONE.**
87+
> `epistemicFreshness : (p : Level12Proof) -> Fresh p.reader p.field
88+
> p.knownVersion p.currentVersion` is the named projector (was
89+
> inline `.freshness` record access; landed as a named lemma in
90+
> A10). Standalone check passes; the file has been in the ipkg
91+
> since the 2026-04-18 Layout fix.
92+
>
93+
> **A14 (2026-06-02) — new closure.** PR #152 ("proof(epistemic): pin
94+
> Fresh to FieldVersion") closes issue #102 by re-indexing `Fresh`
95+
> on a canonical `FieldVersion` value, symmetric to A11's `WriteSync`
96+
> tightening. `MkFresh Refl` no longer types; freshness cannot be
97+
> minted ex nihilo. `ExplicitSync` inherits the pin via its embedded
98+
> `Fresh` argument. This closes Epistemic.idr's residual-debt block.
99+
>
100+
> **What's actually still open in §P0/§P1.**
101+
>
102+
> * **#103 — Full proof bodies for `VerifierSpecAgreement` /
103+
> `SourceVerifierAgreement`.** Statement-level records landed in
104+
> PR #79; full bodies require either WasmCert-Isabelle tie-back,
105+
> a constructive Rust-verifier soundness proof, or an ADR
106+
> documenting `TrustedFixture` as the audit boundary. Multi-week
107+
> design work; owner-prioritised.
108+
>
109+
> * **Stronger "attestation entails the level's semantic property"
110+
> reindexing.** The `attestLN_Sound` family (Proofs.idr §A9) proves
111+
> `LevelAchievedIn N [attestLN witness]` for every level — the
112+
> "witness ⟹ certificate-claims-level" bridge. The stronger form
113+
> that re-indexes `LevelAttestation` itself by the witness type
114+
> (so the attestation value statically pins the level's semantic
115+
> property, not just the level number) remains future work tracked
116+
> under estate epic standards#130.
117+
>
118+
> §P2 parser items and §P3.1(a) emitted-wasm byte-equality are still
119+
> blocked on producer-side dependencies (parser port to Idris2 +
120+
> `.twasm → .wasm` emitter) — unchanged.
121+
23122
## RECONCILIATION 2026-05-30 (carrier-ABI proposals 0001 + 0002 accepted + ADR'd — read this FIRST)
24123

25124
> **The "verifier L1-L6 + L13-L16 coverage on emitted wasm" long-tail
@@ -462,7 +561,12 @@ rough difficulty.
462561

463562
### P0 — Dependability (existence proofs for the structural claims)
464563

465-
**P0.1. Tropical semiring laws — Tropical.idr.** The eight axioms of
564+
**P0.1. Tropical semiring laws — Tropical.idr. ✅ DONE (silently
565+
landed prior to 2026-06-02 — see RECONCILIATION 2026-06-02).** All
566+
eight axioms ship in `Tropical.idr` with concrete bodies; the
567+
sketch below is preserved for history.
568+
569+
Original task description preserved for history: The eight axioms of
466570
a commutative semiring with zero. 007 has done this work already in
467571
`proofs/idris2/TropicalSemiring.idr` (12 theorems, CLEAN, zero
468572
`believe_me`). Port it. Specifically prove:
@@ -490,7 +594,15 @@ Getting it into `typed-wasm.ipkg` is the entry ticket for L11.
490594
**Difficulty:** medium. Bulk of the work is Nat-arithmetic case
491595
splits. The 007 file is 333 LOC and clean, so it's a rehearsed path.
492596

493-
**P0.2. Linear.idr — explicit consumption theorem.** The file says
597+
**P0.2. Linear.idr — explicit consumption theorem. ✅ DONE
598+
(silently landed prior to 2026-06-02 — see RECONCILIATION
599+
2026-06-02).** `Linear.idr` ships the usage-counter encoding
600+
(`LinHandleU : Usage -> Nat -> Type`) plus the trio
601+
`distinctUsage` / `noReuse` / `noReuseEcho` that proves no total
602+
function `LinHandleU Consumed tok -> LinHandleU Fresh tok` is
603+
constructible. The sketch below is preserved for history.
604+
605+
Original task description preserved for history: The file says
494606
"double-free is impossible by construction" in a comment, then
495607
declares a nullary data type `NoDoubleFree` as a "witness". This is
496608
documentation, not a proof. Replace with:
@@ -528,7 +640,15 @@ Void`. That is the actual theorem behind the protocol.
528640
**Difficulty:** medium-hard. The nullary `NoDoubleFree` needs real
529641
witness manipulation. Budget a session.
530642

531-
**P0.3. Lifetime.idr — Outlives is a preorder.** File declares
643+
**P0.3. Lifetime.idr — Outlives is a preorder. ✅ DONE (silently
644+
landed prior to 2026-06-02 — see RECONCILIATION 2026-06-02).**
645+
`Lifetime.idr` ships `outlivesRefl`, `outlivesTrans`,
646+
`outlivesTransitive`, `loadSafe`, `loadSafeOffset`, and
647+
`loadSafeIrrelevant` with concrete bodies; `Outlives` has real
648+
constructors used by `weakenLifetime` and the borrowing path.
649+
The sketch below is preserved for history.
650+
651+
Original task description preserved for history: File declares
532652
`Outlives : Lifetime -> Lifetime -> Type` as an abstract relation. The
533653
safety of `LiveRef` depends on `Outlives` being at least reflexive and
534654
transitive. Prove:
@@ -554,7 +674,17 @@ Currently `LiveRef` extracts its offset and hopes for the best.
554674
**Difficulty:** medium. Depends on how `Outlives` is defined — if it's
555675
just an opaque type, you have to add constructors first.
556676

557-
**P0.4. Effects.idr — EffectSubsumes preorder + monotonicity.**
677+
**P0.4. Effects.idr — EffectSubsumes preorder + monotonicity. ✅
678+
DONE (silently landed prior to 2026-06-02 — see RECONCILIATION
679+
2026-06-02).** `Effects.idr` ships `effectSubsumesRefl`,
680+
`subsumeRefl`, `subsumeTrans`, `subsumeCompose`, plus the
681+
supporting `hasEffectTrans` / `hasEffectCombineL` /
682+
`hasEffectCombineR` / `subsumePrepend` / `subsumeAppend` chain.
683+
`runMemOp` consumes the witness via
684+
`{auto prf : EffectSubsumes declared required}` — L8 is no longer
685+
content-free. The sketch below is preserved for history.
686+
687+
Original task description preserved for history:
558688
`Proofs.idr:171` shows `attestL8_EffectSafe : EffectSubsumes declared
559689
actual -> LevelAttestation` which takes a witness and discards it.
560690
For this attestation to mean anything, `EffectSubsumes` must be a
@@ -701,7 +831,16 @@ underlying proofs.
701831
after each P0 completes.
702832

703833
**P1.2. Epistemic.idr — fix standalone check, then prove Level12Proof
704-
implies freshness.** Draft-only. First make it type-check in
834+
implies freshness. ✅ DONE (silently — standalone check fixed at
835+
the 2026-04-18 Layout pass; `epistemicFreshness` lemma landed at
836+
A10; A11 + A14 tightened the constructor side — see
837+
RECONCILIATION 2026-06-02).** `Epistemic.idr` ships
838+
`epistemicFreshness : (p : Level12Proof) -> Fresh p.reader p.field
839+
p.knownVersion p.currentVersion` as the named projector + A14
840+
(PR #152) pins `Fresh` itself to a canonical `FieldVersion`.
841+
The sketch below is preserved for history.
842+
843+
Original task description preserved for history: Draft-only. First make it type-check in
705844
isolation (figure out the missing imports / unresolved variables),
706845
then state:
707846

0 commit comments

Comments
 (0)