Skip to content

Commit 97e9bb9

Browse files
hyperpolymathclaude
andcommitted
docs(proof): proof narrative + open frontier + reconciled PROOF-NEEDS
Three docs that together replace the drifted proof-status story. **docs/PROOF-NARRATIVE.adoc** — the canonical theorem-level account: - Cross-system witness matrix (Coq / Lean 4 / Agda / Isabelle / Mizar / Z3) for ~42 named theorems - Composition story: how single_op_reversible composes through operation_sequence_reversible to is_CNO_sequence (Absolute Zero connection) - Per-area narrative: file ops, content, copy/move, symlinks, perms, RMO, equivalence, composition, POSIX error wrappers - Assumption registry with explicit escape hatches: * `funext` (Agda) — standard intensional-TT, provable in cubical * `admit.` (Coq filesystem_composition.v:199) — model gap for `rmdir → mkdir` under non-default perms; three closure paths documented (strengthen `reversible`, OpMkdirWithPerms variant, UndoLog model) * `is_empty_dir_dec` (Coq) — justified, infinite-domain quantification Adds the Idris2 ABI layer (omitted from prior audits): 23 `?holes` across 4 files. Eleven are pure ports from Coq/Lean 4 canonical proofs; twelve depend on either the model gap or external NIST SP 800-88 / information-theoretic axioms (now made explicit in §10). **docs/PROOF-OPEN-FRONTIER.adoc** — every valuable but unproven theorem, per directive "even marginal stuff": - Tier S (4 foundational): Lean→Rust mechanised refinement, close-the-admit, crash-consistency, concurrency safety - Tier A (12 single-PR): Idris2 structural holes, glob complexity, Pratt-style precedence, redirection semantics, path-traversal containment - Tier B (8 multi-day): POSIX 2024, subshell scoping, word splitting, pipeline data-flow, job control state machine, symlink loops, audit HMAC, MCP conformance - Tier C (10 marginal-but-named): reverse-direction lemmas, base cases, CNO algebra, parent_path corollaries, well_formed lifting, lattice laws on path_prefix, idempotence negative theorems, transposition, fold equivalences - Tier D (5 meta/process): Print Assumptions CI guard, Idris2 --check-hole CI, cross-system name alignment, narrative auto-generation, witness-coverage test **PROOF-NEEDS.md** — reconciled to current state. The old file listed 7 Agda postulates from a pre-2026-04-03 snapshot; all were closed in that session. Updated to reflect the live assumption registry, full closure-session history, and pointers into the new narrative. No proof bodies changed; this PR is documentation only. The companion proof-closure PR (strengthen `reversible` OpRmdir branch, port 11 structural Idris2 holes) will follow once the build oracle is verified locally. Refs #42 (proof inventory tracking issue). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent af3f4b8 commit 97e9bb9

3 files changed

Lines changed: 1164 additions & 31 deletions

File tree

PROOF-NEEDS.md

Lines changed: 78 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,92 @@
11
# PROOF-NEEDS.md
22
<!-- SPDX-License-Identifier: MPL-2.0 -->
3+
<!-- Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> -->
34

4-
## Current State
5+
> **Reconciled 2026-06-01.** This file used to list 7 open Agda postulates
6+
> from a pre-2026-04-03 snapshot — all 7 were closed during that session
7+
> (see `docs/PROOF_HOLES_AUDIT.md`). The actual current state below.
8+
>
9+
> Canonical detail: **[docs/PROOF-NARRATIVE.adoc](docs/PROOF-NARRATIVE.adoc)**
10+
> (assumption registry, cross-system witness matrix) and
11+
> **[docs/PROOF-OPEN-FRONTIER.adoc](docs/PROOF-OPEN-FRONTIER.adoc)**
12+
> (every valuable but unproven theorem, with tractability classification).
513
6-
- **LOC**: ~57,650
7-
- **Languages**: Rust, ReScript, Agda, Idris2, Zig
8-
- **Existing ABI proofs**: `src/abi/*.idr` plus extensive Agda proof suite (9 files in `proofs/agda/`)
9-
- **Dangerous patterns**:
10-
- `proofs/agda/FileContentOperations.agda`: 5 `postulate`
11-
- `proofs/agda/FilesystemModel.agda`: 1 `postulate`
12-
- `proofs/agda/RMOOperations.agda`: 1 `postulate`
13-
- `impl/mcp/src/Server.res`: 20+ `Obj.magic` in MCP tool handlers
14+
## Current State (2026-06-01)
1415

15-
## What Needs Proving
16+
- **LOC**: ~11,000 lines of formal proof (Coq 4,500 + Lean 4 2,400 + Agda 2,250 + Isabelle 1,800)
17+
- **Languages**: Rust, ReScript, Agda, Idris2, Lean 4, Coq, Isabelle/HOL, Mizar, Z3, Zig
18+
- **Proof systems**: 6 closed-core (Coq, Lean 4, Agda, Isabelle, Mizar, Z3) + 1 ABI-stub tier (Idris2)
19+
- **Named theorems**: ~478 across the 7 systems (see narrative §3)
1620

17-
### FileContentOperations Postulates (5)
18-
- These are in the core filesystem proof — content operations are critical for shell correctness
19-
- Audit each postulate: are they about byte-level I/O (acceptable axiom) or about logical properties (should be proven)?
21+
### Assumption Registry (live)
2022

21-
### FilesystemModel Postulate (1)
22-
- Foundation postulate — if this is wrong, all downstream proofs are unsound
23-
- Should be the highest priority to eliminate or justify
23+
| Layer | Item | Location | Nature |
24+
|---|---|---|---|
25+
| Agda | `postulate funext` | `proofs/agda/FilesystemModel.agda:161-162` | Standard intensional-TT axiom; provable under `--cubical` |
26+
| Coq | `admit.` mid-`single_op_reversible`, OpRmdir branch | `proofs/coq/filesystem_composition.v:199` | Model gap — `mkdir` writes `default_perms`, original may have had non-default |
27+
| Coq | `Axiom is_empty_dir_dec` (justified) | `proofs/coq/posix_errors.v` | Infinite-domain universal quantification |
28+
| Idris2 | 23 `?holes` across 4 files | `proofs/idris2/src/Filesystem/*.idr` | Type-stated, body un-discharged |
2429

25-
### RMOOperations Postulate (1)
26-
- Reversible Mutable Operations — the core innovation of valence-shell
27-
- Any unproven claim about reversibility undermines the entire system guarantee
30+
Idris2 holes by file:
31+
- `Operations.idr`: 11 holes (mkdir/rmdir, touch/rm, write, op-independence, CNO)
32+
- `RMO.idr`: 6 holes (secureDelete, overwrite, GDPR, hardwareErase, audit log)
33+
- `Composition.idr`: 4 holes (sequence + composition + undo/redo)
34+
- `Model.idr`: 2 holes (equivalence sym + trans)
2835

29-
### MCP Server Obj.magic (impl/mcp/src/Server.res)
30-
- Every filesystem operation handler uses `Obj.magic` for JSON result construction
31-
- `makeToolResult` and `makeJsonResult` return type-erased values
32-
- Prove: MCP tool responses conform to MCP protocol schema
36+
### Foundational Closure (history)
3337

34-
### Rust FFI Verification (ffi/rust/)
35-
- `ffi/rust/src/preconditions.rs`, `verification.rs`, `rmo.rs` — safety-critical FFI
36-
- Precondition checking and operation verification should have formal backing
38+
| Date | Session | Closed |
39+
|---|---|---|
40+
| 2026-03-08 | P5 — Core reversibility | 4 priority-1 theorems |
41+
| 2026-03-08 | P5 — Equivalence relations | 4 priority-2 theorems |
42+
| 2026-03-22 | RMO closure | `obliterate_not_injective` (Lean 4) via 3 aux lemmas |
43+
| 2026-04-03 | Agda closure session | All 7 Agda postulates eliminated (only `funext` remains, annotated) |
44+
| 2026-04-03 | ReScript closure | All 24 `Obj.magic` in `impl/mcp/src/Server.res` replaced with `toolResultToJson` |
45+
| 2026-04-12 | Coq well-formedness | `well_formed_ancestor_exists`, `mkdir_preserves_well_formed`, 5/6 decidability axioms proven |
46+
| 2026-06-01 | Narrative reconciliation | `obliterate_overwrites_all_blocks` (which PROOF_HOLES_AUDIT listed as the gap) confirmed closed; actual gap identified as model-perm gap in composition.v |
3747

38-
## Recommended Prover
48+
### What Needs Proving (current, prioritised)
3949

40-
- **Agda** (already in use — eliminate remaining 7 postulates)
41-
- **Idris2** for ABI layer and Rust FFI interface contracts
50+
See `docs/PROOF-OPEN-FRONTIER.adoc` for the full Tier-S/A/B/C/D catalogue.
51+
Highlights:
4252

43-
## Priority
53+
**Tier S (foundational)**:
54+
1. Lean → Rust mechanised refinement
55+
2. Close the `single_op_reversible` admit (Coq) — Tier A overlap; tractable
56+
3. Crash-consistency for begin/commit/rollback
57+
4. Concurrency safety (two `vsh` invocations on shared filesystem)
4458

45-
**HIGH** — Filesystem shell with formal reversibility guarantees. The 7 postulates in the Agda proofs are close to full verification. Eliminating them would make this a genuinely formally verified filesystem tool.
59+
**Tier A (single-PR, <1 day each)**:
60+
- Idris2: 11 of the 23 holes are purely-structural and could land in one porting PR
61+
- Glob expansion termination + complexity bound
62+
- Pratt-style precedence test corpus (POSIX shell `&&`/`||`/`!`)
63+
- Path-traversal containment proof (`resolve_path` cannot escape sandbox)
64+
65+
**Tier B (multi-day)**:
66+
- POSIX 2024 conformance proofs per M-feature
67+
- Subshell `(...)` scoping
68+
- Word splitting under quote-context
69+
- Audit log HMAC signing + verification (impl + proof)
70+
71+
### Recommended Provers
72+
73+
- **Coq** — primary truth source for filesystem model
74+
- **Lean 4** — canonical RMO proofs (`obliterate_not_injective` chain)
75+
- **Agda** — minimum-axiom witness (eliminate funext via cubical)
76+
- **Idris2** — ABI-level type expression (per estate convention `Zig=APIs+FFIs, Idris2=ABIs`)
77+
- **Isabelle/HOL** — Sledgehammer cross-validation
78+
- **Mizar** — set-theoretic third opinion
79+
- **Z3 SMT** — counterexample search for non-existent recovery functions
80+
81+
### Priority
82+
83+
**HIGH** — Single Coq admit + 23 Idris2 holes are visible and closeable;
84+
the bigger frontier (Lean→Rust refinement, crash-consistency, concurrency)
85+
is real research-level work.
86+
87+
The MAA/GDPR claims depend on `?secureDeleteIrreversibleProof`,
88+
`?overwriteIrreversibleProof`, and `?gdprDeletionCompliantProof` being
89+
discharged. Until they are, the externally-facing "formally verified"
90+
claim leans on the closed Coq/Lean 4 layer plus axiomatic NIST SP 800-88
91+
/ Shannon-entropy / physical-world assumptions which should be made
92+
explicit (see narrative §10).

0 commit comments

Comments
 (0)