Skip to content

Commit 6924532

Browse files
committed
proofs(coq): re-verify 0 admits/0 real gaps; fix build+verify from clean
Verified the Coq proof tree with coqc + Print Assumptions under Coq 8.18.0: the full _CoqProject (11 files) compiles with zero admit/Admitted/Axiom markers. obliterate_overwrites_all_blocks and overwrite_pass_equalizes_storage are 'Closed under the global context'; single_op_reversible, operation_sequence_reversible, copy_file_reversible, mkdir_two_dirs_reversible and obliterate_not_injective depend only on standard functional_extensionality. The historically-tracked '1 real gap' and the three 2026-06-02 admits (#56/#57/#58) are all closed. Remaining assumptions are standard/justified: functional_extensionality (stdlib) + is_empty_dir_dec (justified classical), Agda funext (structural). Build/tooling fixes (both failed from a clean checkout): - just build-coq and scripts/verify-proofs.sh compiled an incomplete file subset (missing filesystem_composition.v etc.), so posix_errors.v failed with 'Cannot find a physical path bound to logical path filesystem_composition'. Both now compile the full _CoqProject chain in dependency order and mkdir -p extracted before extraction.v, matching the validation.yml CI oracle. - verify-proofs.sh: fixed two latent set -e bugs that aborted before any test ran — ((VAR++)) counters (first bump from 0 returns exit 1) replaced with assignment form; per-test cd side effects isolated via subshell. - gitignore proofs/coq/.lia.cache (Coq Lia build artifact). Docs reconciled to 0 real gaps (live docs only; dated audit snapshots left as records): PROOF_HOLES_AUDIT.md, README.adoc, FAQ.adoc, CLAUDE.md, docs/wiki/{Verification-Status,For-Developers}.md, ROADMAP.adoc, docs/ROADMAP_TO_V1.md, STATE.a2ml, methodology.a2ml, CHANGELOG.adoc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KfgJznd6jzSeDYsSXGAXkU
1 parent dbab186 commit 6924532

14 files changed

Lines changed: 184 additions & 81 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,33 @@ tasks-completed = [
7171
]
7272

7373
[coq-proof-status]
74-
admitted = 3
74+
admitted = 0
7575
axioms-justified = 1
7676
admitted-detail = """
77-
3 Admitted markers as of 2026-06-02 post-PR #55 design-gap surfacing:
78-
79-
1. mkdir_two_dirs_reversible (filesystem_composition.v:697) — non-LIFO
80-
sequence reversal; not derivable from two_op_sequence_reversible as
81-
stated. Tracked as #56 (restate as LIFO sequence).
82-
83-
2. overwrite_pass_equalizes_storage (rmo_operations.v:422) — model gap.
84-
Needs Hgeom strengthening or conclusion relaxation. Tracked as #57.
85-
86-
3. obliterate_not_injective (rmo_operations.v:535) — downstream of #57;
87-
reconnects once #57 closes. Tracked as #58.
88-
89-
The prior single_op_reversible OpRmdir admit (declared 2026-04-19) was
90-
Qed-closed by PR #67 (2026-06-01) via OpMkdirWithPerms +
91-
OpCreateFileWithPerms constructor-variant approach — zero new axioms.
77+
0 Admitted markers. Re-verified 2026-07-16 with `coqc` + `Print Assumptions`
78+
under Coq 8.18.0: the full _CoqProject (11 files) compiles with zero
79+
admit/Admitted/Axiom markers. The 3 admits recorded here on 2026-06-02 are all
80+
now Qed-closed:
81+
82+
1. mkdir_two_dirs_reversible (filesystem_composition.v:681, now an Example)
83+
— CLOSED (#56); Print Assumptions: functional_extensionality_dep only.
84+
85+
2. overwrite_pass_equalizes_storage (rmo_operations.v:398) — CLOSED (#57);
86+
Print Assumptions: Closed under the global context (zero axioms).
87+
88+
3. obliterate_not_injective (rmo_operations.v:530) — CLOSED (#58);
89+
Print Assumptions: functional_extensionality_dep only.
90+
91+
The single_op_reversible OpRmdir model-permission admit (declared 2026-04-19)
92+
was Qed-closed via OpMkdirWithPerms + OpCreateFileWithPerms constructor variants
93+
— zero new axioms. The 1 real gap the audit historically tracked
94+
(obliterate_overwrites_all_blocks) is CLOSED: Print Assumptions reports Closed
95+
under the global context. Remaining Coq assumptions: functional_extensionality_dep
96+
(stdlib standard) + is_empty_dir_dec (1 justified classical).
9297
"""
9398
axiom-detail = "is_empty_dir_dec: Filesystem = Path -> option FSNode is infinite-domain; universal quantification over all paths is not constructively decidable. Migration: switch to FMaps.t FSNode."
94-
proof-debt-items-closed = [1, 2]
95-
proof-debt-open = [3]
99+
proof-debt-items-closed = [1, 2, 3]
100+
proof-debt-open = []
96101

97102
[dogfooding-status]
98103
# Section present per CRG v2.0 schema. Honest disclosure follows.

.machine_readable/bot_directives/methodology.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ constraints = [
9898
"Lean -> Rust correspondence is property-tested only (~85% confidence), NOT mechanised — closing this is the critical-path blocker to v1.0.0",
9999
"Elixir NIF build is broken — impl/elixir/ is reference-only; do not block work on it",
100100
"BEAM daemon is designed but not implemented — no current SNIF carrier",
101-
"Coq has 1 remaining real proof gap: obliterate_overwrites_all_blocks (mechanical induction over overwrite passes) — see docs/PROOF_HOLES_AUDIT.md",
101+
"Coq has 0 remaining real proof gaps: obliterate_overwrites_all_blocks is CLOSED (Print Assumptions: Closed under the global context, re-verified 2026-07-16 under Coq 8.18.0) — see docs/PROOF_HOLES_AUDIT.md",
102102
"Agda has 1 structural axiom (funext) — provable in cubical Agda, intentional in intensional TT",
103103
"Coq has 1 justified decidability axiom (is_empty_dir_dec) — infinite-domain Filesystem = Path -> option FSNode; switching to FMaps.t FSNode is the documented migration",
104104
"RMO (GDPR / secure deletion) primitives are stubs in impl/rust-cli/src/commands/secure_deletion.rs — proofs exist for the model, runtime does not yet bind to them",

CHANGELOG.adoc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Full POSIX shell compliance (subset)
1818
- RMO (Remove-Match-Obliterate) proofs for GDPR compliance
1919

20+
=== Verified — 2026-07-16
21+
22+
==== Proofs
23+
- Coq proof-debt re-verified to **0 admits / 0 real gaps** under Coq
24+
8.18.0. The full `_CoqProject` (11 files) compiles with no
25+
`admit`/`Admitted`/`Axiom` markers. `Print Assumptions` on the
26+
load-bearing theorems: `obliterate_overwrites_all_blocks` and
27+
`overwrite_pass_equalizes_storage` are *Closed under the global
28+
context* (zero axioms); `single_op_reversible`,
29+
`operation_sequence_reversible`, `copy_file_reversible`,
30+
`mkdir_two_dirs_reversible`, `obliterate_not_injective` depend only on
31+
the standard `functional_extensionality_dep`. The historically-tracked
32+
"1 real gap" (`obliterate_overwrites_all_blocks`) and the three
33+
2026-06-02 admits (#56/#57/#58) are all closed. Remaining assumptions
34+
are standard/justified: Coq `functional_extensionality` (stdlib) +
35+
`is_empty_dir_dec` (justified classical), Agda `funext` (structural).
36+
Docs reconciled: `PROOF_HOLES_AUDIT.md`, `README.adoc`, `FAQ.adoc`,
37+
`CLAUDE.md`, `docs/wiki/`, `ROADMAP*.{adoc,md}`,
38+
`.machine_readable/6a2/STATE.a2ml`, `bot_directives/methodology.a2ml`.
39+
40+
=== Fixed — 2026-07-16
41+
42+
==== Build / tooling
43+
- `just build-coq` and `scripts/verify-proofs.sh` now succeed from a
44+
clean checkout. Both previously compiled an incomplete file subset
45+
(missing `filesystem_composition.v` and others), so `posix_errors.v`
46+
failed with "Cannot find a physical path bound to logical path
47+
filesystem_composition"; both now compile the full `_CoqProject`
48+
chain in dependency order and `mkdir -p extracted` before
49+
`extraction.v` (the gitignored output dir), matching the CI oracle in
50+
`validation.yml`.
51+
- `scripts/verify-proofs.sh`: fixed two latent `set -e` bugs that
52+
aborted the script before any test ran — `((VAR++))` counters
53+
(post-increment returns the pre-value, so the first bump from 0
54+
yields exit status 1) replaced with assignment form; and per-test
55+
`cd` side effects that leaked between tests are now isolated by
56+
running each test command in a subshell.
57+
2058
=== Added — 2026-06-02
2159

2260
==== Implementation

CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The Rust CLI is a functional interactive shell with these features:
8686

8787
- 21,331 lines of Rust across 32 source files (`find impl/rust-cli/src -name '*.rs' | wc -l`; `wc -l` aggregate, measured 2026-06-01)
8888
- ~478 theorem candidates across 6 proof systems + Idris2 ABI layer (per issue #42 deep-audit inventory, 2026-06-01)
89-
- 3 proof holes remaining: 1 real gap (Coq `obliterate_overwrites_all_blocks`), 1 justified axiom (Coq `is_empty_dir_dec` — infinite-domain decidability), 1 structural axiom (Agda `funext` — standard in intensional TT) — see `docs/PROOF_HOLES_AUDIT.md`
89+
- 2 proof holes remaining, **0 real gaps**: 1 justified axiom (Coq `is_empty_dir_dec` — infinite-domain decidability), 1 structural axiom (Agda `funext` — standard in intensional TT). The former real gap (Coq `obliterate_overwrites_all_blocks`) is CLOSED — re-verified 2026-07-16 via `Print Assumptions` (*Closed under the global context*) under Coq 8.18.0 — see `docs/PROOF_HOLES_AUDIT.md`
9090
- Idris2 ABI layer: **0 proof holes** (all closed 2026-07-01, issue #151 root — builds under `--total`), 0 `partial` markers, 2 registered primitive-eq axioms (`axStringEqRefl`, `axBits8EqRefl`; gated by `.github/scripts/check-idris2-believe-me.sh`)
9191
- 7 fuzz targets in `impl/rust-cli/fuzz/fuzz_targets/` (parser, arith, job-spec, signal-parse, path-ops, glob-expansion, state-machine)
9292

@@ -95,7 +95,7 @@ The Rust CLI is a functional interactive shell with these features:
9595
### Critical Priority
9696

9797
1. **No mechanized Lean -> Rust correspondence** — testing only, ~85% confidence
98-
2. **1 real proof gap** remaining (Coq `obliterate_overwrites_all_blocks` — mechanical induction over overwrite passes), plus 2 documented axioms (1 justified decidability + 1 structural funext) — see `docs/PROOF_HOLES_AUDIT.md`
98+
2. **0 real proof gaps** — the former Coq `obliterate_overwrites_all_blocks` gap is CLOSED (re-verified 2026-07-16, *Closed under the global context*); 2 documented axioms remain (1 justified decidability + 1 structural funext) — see `docs/PROOF_HOLES_AUDIT.md`
9999
3. **NOT production-ready** — research prototype only
100100

101101
### High Priority
@@ -191,7 +191,7 @@ valence-shell/
191191
mcp/ # MCP server bindings
192192
proofs/
193193
lean4/ # Primary proof source (101 theorems)
194-
coq/ # CIC proofs + extraction (131 theorems, 3 admits in extraction.v)
194+
coq/ # CIC proofs + extraction (131 theorems, 0 admits — re-verified 2026-07-16, Coq 8.18.0)
195195
agda/ # Type theory proofs (85 theorems, 3 postulates including funext)
196196
isabelle/ # HOL proofs (76 theorems)
197197
mizar/ # Set theory proofs (63 theorems)
@@ -326,7 +326,7 @@ MPL-2.0 (Palimpsest License)
326326

327327
---
328328

329-
**Last Updated**: 2026-06-01 (drift reconcile: 32 src files / 21,331 LoC, 3 proof holes per audit, 478 theorem candidates, 7 fuzz targets)
329+
**Last Updated**: 2026-07-16 (Coq proof-debt re-verified: 0 admits / 0 real gaps under Coq 8.18.0; 2 justified/structural axioms remain. Prior 2026-06-01 drift reconcile: 32 src files / 21,331 LoC, 478 theorem candidates, 7 fuzz targets)
330330
**Version**: see `CHANGELOG.md` (release history) and `impl/rust-cli/Cargo.toml` `[package].version` (semver pin)
331331
**Status**: Advanced research prototype — NOT production-ready
332332
**Tests**: 736 passing, 0 failures, 14 ignored

FAQ.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ deep-audit inventory in `docs/audits/2026-06-01-deep-audit.adoc`.
8686
What is solid:
8787

8888
* The 6-system proofs of the model-layer operations. ~478 theorem candidates;
89-
1 real gap remaining (Coq `obliterate_overwrites_all_blocks`) + 2 documented
90-
axioms (1 justified decidability + 1 structural funext).
89+
0 real gaps (Coq `obliterate_overwrites_all_blocks` CLOSED, re-verified
90+
2026-07-16 via `Print Assumptions` under Coq 8.18.0) + 2 documented axioms
91+
(1 justified decidability + 1 structural funext).
9192
* The Rust CLI. 736 tests passing, 0 failures, 7 fuzz targets, working shell
9293
surface (pipelines, redirections, here-docs, job control, variables, control
9394
structures, glob, quoting).
@@ -116,12 +117,12 @@ plus the Idris2 ABI layer, distributed as:
116117
|===
117118
|System |Count |Notes
118119
|Lean 4 |101 |Primary source of truth
119-
|Coq |131 |Includes `extraction.v` — 3 admits remaining
120+
|Coq |131 |Includes `extraction.v` — 0 admits (re-verified 2026-07-16, Coq 8.18.0)
120121
|Isabelle/HOL |76 |Cross-validation
121122
|Agda |85 |3 postulates remaining (including funext)
122123
|Mizar |63 |Set-theoretic foundation
123124
|Z3 SMT |125 asserts |Automated decision procedures
124-
|Idris2 (ABI + filesystem) |~22 |2 holes + 10 partial markers
125+
|Idris2 (ABI + filesystem) |~22 |0 holes, 0 partials, 2 primitive-eq axioms (closed #151/#152)
125126
|===
126127

127128
If you see a stale number elsewhere in the repo, please file an issue —
@@ -178,8 +179,8 @@ Valence-shell follows the estate boundary-convention policy
178179
(`feedback_estate_boundary_conventions`):
179180

180181
* In-process FFI (Rust ↔ C) — Zig scaffolding in `impl/zig/`.
181-
* Formal ABI / proof carrier — Idris2 in `proofs/idris2/` (~22 theorems, 2 holes,
182-
10 partial markers per issue #42).
182+
* Formal ABI / proof carrier — Idris2 in `proofs/idris2/` (~22 theorems, 0 holes,
183+
0 partial markers, 2 primitive-eq axioms; closed via #151/#152, builds under `--total`).
183184
* BEAM ↔ native — would use SNIFs; not currently wired (BEAM daemon is
184185
designed but not implemented).
185186
* Compile target / typed-wasm — not currently a target.

Justfile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,22 @@ build-all: build-coq build-lean4 build-agda build-isabelle build-mizar build-idr
1515
verify-all:
1616
@./scripts/verify-proofs.sh
1717

18-
# Build Coq proofs
18+
# Build Coq proofs (full _CoqProject chain, in dependency order)
1919
build-coq:
2020
@echo "Building Coq proofs..."
21-
cd proofs/coq && coqc filesystem_model.v
22-
cd proofs/coq && coqc file_operations.v
23-
cd proofs/coq && coqc posix_errors.v
24-
cd proofs/coq && coqc extraction.v
21+
# extraction.v writes to extracted/filesystem.ml; the dir is gitignored, so create it.
22+
cd proofs/coq && mkdir -p extracted
23+
cd proofs/coq && coqc -R . ValenceShell filesystem_model.v
24+
cd proofs/coq && coqc -R . ValenceShell file_operations.v
25+
cd proofs/coq && coqc -R . ValenceShell file_content_operations.v
26+
cd proofs/coq && coqc -R . ValenceShell copy_move_operations.v
27+
cd proofs/coq && coqc -R . ValenceShell symlink_operations.v
28+
cd proofs/coq && coqc -R . ValenceShell permission_operations.v
29+
cd proofs/coq && coqc -R . ValenceShell filesystem_composition.v
30+
cd proofs/coq && coqc -R . ValenceShell filesystem_equivalence.v
31+
cd proofs/coq && coqc -R . ValenceShell posix_errors.v
32+
cd proofs/coq && coqc -R . ValenceShell rmo_operations.v
33+
cd proofs/coq && coqc -R . ValenceShell extraction.v
2534
@echo "✓ Coq proofs compiled"
2635

2736
# Build Lean 4 proofs
@@ -68,7 +77,8 @@ verify-idris2: build-idris2
6877
# Extract Coq to OCaml
6978
extract:
7079
@echo "Extracting Coq to OCaml..."
71-
cd proofs/coq && coqc extraction.v
80+
# extraction.v writes to extracted/filesystem.ml; the dir is gitignored, so create it.
81+
cd proofs/coq && mkdir -p extracted && coqc extraction.v
7282
@echo "✓ OCaml code extracted"
7383

7484
# Build OCaml FFI (legacy)

README.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Valence Shell is a formally verified shell with proven reversibility guarantees.
4242
== Formal Verification
4343
* [x] Formally Proven Reversibility: `rmdir(mkdir(p, fs)) = fs`
4444
* [x] Polyglot Verification: 6 proof systems (Coq, Lean 4, Agda, Isabelle, Mizar, Z3)
45-
* [x] ~478 Theorem Candidates: Proven across different logical foundations (1 real gap, 1 justified axiom, 1 structural axiom remain — see `docs/PROOF_HOLES_AUDIT.md`)
45+
* [x] ~478 Theorem Candidates: Proven across different logical foundations (0 real gaps; 1 justified axiom + 1 structural axiom remain — see `docs/PROOF_HOLES_AUDIT.md`)
4646
* [x] Content Operations: File read/write with proven reversibility
4747
* [x] MAA Framework: Mutually Assured Accountability with audit trails
4848

@@ -358,8 +358,8 @@ Valence Shell sits inside a three-layer architecture; the other two layers are u
358358
* If preconditions hold, `write(p, old, write(p, new, fs)) = fs`
359359
* Operations on `p1` don't affect `p2` (when `p1 ≠ p2`)
360360
* Composition: sequences of operations reverse correctly
361-
* ~478 theorem candidates proven across 6 verification systems (1 real gap + 2 axioms remain — see `docs/PROOF_HOLES_AUDIT.md`)
362-
* 2026-06-02 snapshot: 4 admits in `proofs/coq/rmo_operations.v` are annotated with explicit obligations; Idris2 0.8.0 keyword/parse fixes landed alongside (#112/#113/#115/#117) and the build oracle is strict (#118).
361+
* ~478 theorem candidates proven across 6 verification systems (0 real gaps; 2 justified/structural axioms remain — see `docs/PROOF_HOLES_AUDIT.md`)
362+
* 2026-07-16 re-verification: `proofs/coq/` compiles with **0 admits** under Coq 8.18.0; `Print Assumptions` on the load-bearing theorems reports *Closed under the global context* or dependence only on standard `functional_extensionality`. Idris2 0.8.0 keyword/parse fixes landed earlier (#112/#113/#115/#117), the build oracle is strict (#118), and the Idris2 layer is hole-free (#151/#152).
363363

364364
=== ❌ What Is NOT Guaranteed
365365

@@ -604,7 +604,7 @@ See link:LICENSE[LICENSE] for full text.
604604

605605
**Made with ❤️ by humans and AI, for humans who value formal correctness.**
606606

607-
**Status**: Advanced Research Prototype (v0.9.0) | **RSR**: PLATINUM (105/100) | **Proofs**: ~478 theorem candidates (1 real gap remaining) | **Tests**: 736 passing
607+
**Status**: Advanced Research Prototype (v0.9.0) | **RSR**: PLATINUM (105/100) | **Proofs**: ~478 theorem candidates (0 real gaps; 2 justified axioms) | **Tests**: 736 passing
608608

609609
[.text-center]
610610
_"Every operation reversible. Every claim proven. Every contributor valued."_

ROADMAP.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ Hard requirements before any v1.0 claim:
106106

107107
* [ ] Mechanized Lean → Rust correspondence (currently property testing
108108
only, ~85% confidence).
109-
* [ ] Close all real gaps in `docs/PROOF_HOLES_AUDIT.md` (post-2026-04
110-
sweep: 1 real gap, 1 justified axiom, 1 structural).
109+
* [x] Close all real gaps in `docs/PROOF_HOLES_AUDIT.md` — **DONE**
110+
(re-verified 2026-07-16 under Coq 8.18.0): 0 real gaps; 1 justified axiom
111+
(`is_empty_dir_dec`) + 1 structural (`funext`) remain.
111112
* [ ] CRG v2.0 grade B: 6+ diverse external targets, issues fed back.
112113
See audit `=== External validation` section for the proposed diverse-6
113114
shape.

0 commit comments

Comments
 (0)