Skip to content

Commit e0e0d32

Browse files
docs+annotate: Filesystem cluster — 26 inline AXIOM: + 8 §(d) DEBT entries (Phase 2c) (#62)
## Summary Phase 2c of the standards#203 trusted-base rollout. Largest single cluster: Coq + Lean Filesystem (**34 markers total** — 13 Coq + 21 Lean). ## Coq side (13 markers — classifications from #58 Phase 1 triage) ### 8 §(c) AXIOM inline annotations | Line | Identifier | Note | |-----:|------------|------| | 96 | `fs_eq_dec` | Treat as §(c) until property-test budget lands; promote to §(b) then. | | 104 | `mkdir_rmdir_inverse` | POSIX semantics | | 114 | `create_unlink_inverse` | POSIX semantics | | 124 | `read_write_identity` | POSIX semantics | | 130 | `chmod_identity` | POSIX semantics | | 136 | `chown_identity` | POSIX semantics | | 142 | `rename_identity` | POSIX semantics | | 147 | `rename_inverse` | POSIX semantics | ### 5 §(d) DEBT entries (no inline; enumerated in proof-debt.md) - `mkdir_not_identity` (L300), `write_different_not_identity` (L316), `transaction_cno` (L397), `mkdir_idempotent` (L421), `snapshot_restore_identity` (L453). All DISCHARGE candidates per #58. ## Lean side (21 markers — new Phase 2c triage) ### 18 §(c) AXIOM inline annotations - **10 POSIX primitives** (opaque ops): `mkdir`, `rmdir`, `create`, `unlink`, `readFile`, `writeFile`, `stat`, `chmod`, `chown`, `rename`. - **6 POSIX semantics axioms** (mirror Coq §(c)): `mkdir_rmdir_inverse`, `create_unlink_inverse`, `read_write_identity`, `chmod_identity`, `rename_identity`, `rename_inverse`. - **2 snapshot primitives** (opaque ops): `snapshot`, `restore`. ### 3 §(d) DEBT entries (mirror Coq DISCHARGE) - `mkdir_not_identity` (L233), `snapshot_restore_identity` (L288), `mkdir_idempotent` (L309). ## docs/proof-debt.md - New "Phase 2c triage — Lean Filesystem cluster" section with full per-marker tables (primitives / semantics / snapshot / discharge). - §(d) DEBT bucket gains 8 new Filesystem entries (5 Coq + 3 Lean), each with owner + INDEFINITE deadline. - "Lean — pending triage" count updates from 49 → 28. ## Verification ``` $ bash ../standards/scripts/check-trusted-base.sh . [INFO] Found 129 soundness-relevant escape hatch(es). [ERROR] 88/129 escape hatch(es) are undocumented. ``` Down from 122 (after #61) and 123 (after #60). Δ = 34 = the cluster size exactly. **0 Filesystem-specific errors remain.** ## Cumulative progress | PR | Cluster | Markers | Cumulative documented | |-----|---------------|--------:|----------------------:| | #60 | Lambda | 5 | 5 | | #61 | CNO common | 1 | 7 (+1 already-passing) | | #62 | Filesystem | 34 | 41 | Remaining clusters (untriaged Lean + already-triaged Coq): Quantum (50), Physics (39). Out of scope for this PR. Refs standards#203, #58, #60, #61. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 885d85b commit e0e0d32

3 files changed

Lines changed: 137 additions & 3 deletions

File tree

docs/proof-debt.md

Lines changed: 107 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,58 @@ First cluster: `proofs/lean4/LambdaCNO.lean` (3 axioms).
4545
The two §(c) entries are annotated inline with `-- AXIOM:` leading
4646
comments. The §(d) entry below has an owner + deadline.
4747

48+
## Phase 2c triage — Lean Filesystem cluster (2026-05-27)
49+
50+
Second Lean cluster: `proofs/lean4/FilesystemCNO.lean` (21 axioms).
51+
52+
### POSIX primitive operations (§(c) AXIOM — opaque ops, 10)
53+
54+
| Line | Identifier | Disposition | Justification |
55+
|-----:|------------|-------------|---------------|
56+
| 56 | `mkdir` | §(c) AXIOM | Opaque POSIX primitive — no executable body in the model. |
57+
| 60 | `rmdir` | §(c) AXIOM | Opaque POSIX primitive. |
58+
| 64 | `create` | §(c) AXIOM | Opaque POSIX primitive. |
59+
| 68 | `unlink` | §(c) AXIOM | Opaque POSIX primitive. |
60+
| 72 | `readFile` | §(c) AXIOM | Opaque POSIX primitive. |
61+
| 76 | `writeFile` | §(c) AXIOM | Opaque POSIX primitive. |
62+
| 80 | `stat` | §(c) AXIOM | Opaque POSIX primitive. |
63+
| 84 | `chmod` | §(c) AXIOM | Opaque POSIX primitive. |
64+
| 88 | `chown` | §(c) AXIOM | Opaque POSIX primitive. |
65+
| 92 | `rename` | §(c) AXIOM | Opaque POSIX primitive. |
66+
67+
### POSIX semantics specifications (§(c) AXIOM — mirror Coq, 6)
68+
69+
| Line | Identifier | Disposition |
70+
|-----:|------------|-------------|
71+
| 98 | `mkdir_rmdir_inverse` | §(c) AXIOM (mirrors Coq) |
72+
| 104 | `create_unlink_inverse`| §(c) AXIOM (mirrors Coq) |
73+
| 109 | `read_write_identity` | §(c) AXIOM (mirrors Coq) |
74+
| 115 | `chmod_identity` | §(c) AXIOM (mirrors Coq) |
75+
| 121 | `rename_identity` | §(c) AXIOM (mirrors Coq) |
76+
| 126 | `rename_inverse` | §(c) AXIOM (mirrors Coq) |
77+
78+
### Snapshot primitives (§(c) AXIOM — opaque ops, 2)
79+
80+
| Line | Identifier | Disposition |
81+
|-----:|------------|-------------|
82+
| 281 | `snapshot` | §(c) AXIOM (opaque snapshot primitive) |
83+
| 285 | `restore` | §(c) AXIOM (opaque restore primitive) |
84+
85+
### Discharge candidates (§(d) DEBT — 3)
86+
87+
These claim provable existence / equality facts that should follow
88+
from the §(c) primitives once the model is concretely defined. They
89+
need a discharge PR — see §(d) DEBT below.
90+
91+
| Line | Identifier | Disposition | Plan |
92+
|-----:|------------|-------------|------|
93+
| 233 | `mkdir_not_identity` | §(d) DEBT | Existence proof; exhibit one concrete `fs` lacking the path. |
94+
| 288 | `snapshot_restore_identity` | §(d) DEBT | Composite theorem; derivable from `snapshot`/`restore` once a concrete snapshot model lands. |
95+
| 309 | `mkdir_idempotent` | §(d) DEBT | Follows from `mkdir_rmdir_inverse` family with stronger repeat-mkdir semantics. |
96+
97+
All 18 §(c) entries above are annotated inline with `-- AXIOM:`
98+
leading comments.
99+
48100
## (a) DISCHARGE backlog (Coq, 17)
49101

50102
Provable propositions currently stated as `Axiom`. Enumerated in
@@ -85,6 +137,38 @@ no longer in §(d).
85137
- **Deadline**: INDEFINITE (blocked on `SetCategory` instance —
86138
universe-polymorphism scaffolding precondition).
87139

140+
- `proofs/coq/filesystem/FilesystemCNO.v:300``mkdir_not_identity`
141+
- **Owner**: @hyperpolymath
142+
- **Plan**: existence proof; exhibit one concrete `fs` lacking the
143+
path. Triaged DISCHARGE in #58.
144+
- **Deadline**: INDEFINITE (small proof; awaits a discharge PR).
145+
146+
- `proofs/coq/filesystem/FilesystemCNO.v:316``write_different_not_identity`
147+
- **Owner**: @hyperpolymath
148+
- **Plan**: existence proof; exhibit one concrete content mismatch.
149+
Triaged DISCHARGE in #58.
150+
- **Deadline**: INDEFINITE.
151+
152+
- `proofs/coq/filesystem/FilesystemCNO.v:397``transaction_cno`
153+
- **Owner**: @hyperpolymath
154+
- **Plan**: composite theorem; derivable from primitive `_inverse`
155+
axioms once a `transaction` definition is in place. Triaged
156+
DISCHARGE in #58.
157+
- **Deadline**: INDEFINITE (blocked on `transaction` definition).
158+
159+
- `proofs/coq/filesystem/FilesystemCNO.v:421``mkdir_idempotent`
160+
- **Owner**: @hyperpolymath
161+
- **Plan**: follows from `mkdir_rmdir_inverse` family + stronger
162+
repeat-mkdir semantics. Triaged DISCHARGE in #58.
163+
- **Deadline**: INDEFINITE.
164+
165+
- `proofs/coq/filesystem/FilesystemCNO.v:453``snapshot_restore_identity`
166+
- **Owner**: @hyperpolymath
167+
- **Plan**: composite theorem; derivable from primitive `_identity`
168+
/ `_inverse` axioms once a snapshot model lands. Triaged DISCHARGE
169+
in #58.
170+
- **Deadline**: INDEFINITE.
171+
88172
### Lean — provable, awaiting proof
89173

90174
- `proofs/lean4/LambdaCNO.lean:183``subst_closed_term`
@@ -95,11 +179,31 @@ no longer in §(d).
95179
- **Deadline**: INDEFINITE (no proof-PR scheduled yet — provable;
96180
awaits Lean-side discharge push).
97181

182+
- `proofs/lean4/FilesystemCNO.lean:233``mkdir_not_identity`
183+
- **Owner**: @hyperpolymath
184+
- **Plan**: existence proof; exhibit one concrete `fs` lacking the
185+
path. Mirrors Coq site at `FilesystemCNO.v:300`.
186+
- **Deadline**: INDEFINITE.
187+
188+
- `proofs/lean4/FilesystemCNO.lean:288``snapshot_restore_identity`
189+
- **Owner**: @hyperpolymath
190+
- **Plan**: composite theorem; derivable from `snapshot`/`restore`
191+
primitives once a concrete snapshot model is in place. Mirrors
192+
Coq site at `FilesystemCNO.v:453`.
193+
- **Deadline**: INDEFINITE.
194+
195+
- `proofs/lean4/FilesystemCNO.lean:309``mkdir_idempotent`
196+
- **Owner**: @hyperpolymath
197+
- **Plan**: follows from `mkdir_rmdir_inverse` + stronger
198+
repeat-mkdir semantics. Mirrors Coq site at `FilesystemCNO.v:421`.
199+
- **Deadline**: INDEFINITE.
200+
98201
### Lean — pending triage
99202

100-
49 Lean axioms remain to be triaged (FilesystemCNO 21, QuantumCNO 14,
101-
StatMech 14). Triage planned in cluster-sized PRs through
102-
2026-06 — see this file's status block at the bottom.
203+
28 Lean axioms remain to be triaged (QuantumCNO 14, StatMech 14;
204+
Lambda and Filesystem clusters done in Phase 2a/2c). Triage planned
205+
in cluster-sized PRs through 2026-06 — see this file's status block
206+
at the bottom.
103207

104208
### Idris2 — pending triage
105209

proofs/coq/filesystem/FilesystemCNO.v

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ Parameter rename : Path -> Path -> Filesystem -> Filesystem.
9393
(** ** Filesystem State Equality *)
9494

9595
(** Two filesystems are equal if they have the same structure and content *)
96+
(* AXIOM: fs_eq_dec; decidable equality over opaque FileContent — currently
97+
§(c) NECESSARY AXIOM; promote to §(b) TRUSTED with property-test budget
98+
when a concrete FileContent type lands. See docs/proof-debt.md and
99+
docs/proof-debt-triage.md row FilesystemCNO.v:96. *)
96100
Axiom fs_eq_dec : forall (fs1 fs2 : Filesystem), {fs1 = fs2} + {fs1 <> fs2}.
97101

98102
(** Filesystem equality is an equivalence relation *)
@@ -101,6 +105,8 @@ Notation "fs1 =fs= fs2" := (fs1 = fs2) (at level 70).
101105
(** ** Operation Axioms *)
102106

103107
(** mkdir followed by rmdir is identity (if directory doesn't exist initially) *)
108+
(* AXIOM: mkdir_rmdir_inverse; POSIX-semantics specification (model-layer);
109+
§(c) per docs/proof-debt.md. *)
104110
Axiom mkdir_rmdir_inverse :
105111
forall (p : Path) (fs : Filesystem),
106112
(* Precondition: p doesn't exist *)
@@ -111,6 +117,7 @@ Axiom mkdir_rmdir_inverse :
111117
rmdir p (mkdir p fs) =fs= fs.
112118

113119
(** create followed by unlink is identity (if file doesn't exist initially) *)
120+
(* AXIOM: create_unlink_inverse; POSIX-semantics specification; §(c) per docs/proof-debt.md. *)
114121
Axiom create_unlink_inverse :
115122
forall (p : Path) (fs : Filesystem),
116123
(* Precondition: p doesn't exist *)
@@ -121,29 +128,34 @@ Axiom create_unlink_inverse :
121128
unlink p (create p fs) =fs= fs.
122129

123130
(** read followed by write is identity (preserves filesystem) *)
131+
(* AXIOM: read_write_identity; POSIX-semantics specification; §(c) per docs/proof-debt.md. *)
124132
Axiom read_write_identity :
125133
forall (p : Path) (fs : Filesystem) (content : FileContent),
126134
read_file p fs = Some content ->
127135
write_file p content fs =fs= fs.
128136

129137
(** chmod to current permissions is identity *)
138+
(* AXIOM: chmod_identity; POSIX-semantics specification; §(c) per docs/proof-debt.md. *)
130139
Axiom chmod_identity :
131140
forall (p : Path) (fs : Filesystem) (meta : FileMetadata),
132141
stat p fs = Some meta ->
133142
chmod p (permissions meta) fs =fs= fs.
134143

135144
(** chown to current owner is identity *)
145+
(* AXIOM: chown_identity; POSIX-semantics specification; §(c) per docs/proof-debt.md. *)
136146
Axiom chown_identity :
137147
forall (p : Path) (fs : Filesystem) (meta : FileMetadata),
138148
stat p fs = Some meta ->
139149
chown p (owner meta) fs =fs= fs.
140150

141151
(** rename to same path is identity *)
152+
(* AXIOM: rename_identity; POSIX-semantics specification; §(c) per docs/proof-debt.md. *)
142153
Axiom rename_identity :
143154
forall (p : Path) (fs : Filesystem),
144155
rename p p fs =fs= fs.
145156

146157
(** rename A to B followed by rename B to A is identity *)
158+
(* AXIOM: rename_inverse; POSIX-semantics specification; §(c) per docs/proof-debt.md. *)
147159
Axiom rename_inverse :
148160
forall (p1 p2 : Path) (fs : Filesystem),
149161
p1 <> p2 ->

proofs/lean4/FilesystemCNO.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,61 +52,77 @@ abbrev Filesystem : Type := List FileEntry
5252
/-! ## Filesystem Operations -/
5353

5454
/-- Create directory -/
55+
-- AXIOM: mkdir; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
5556
axiom mkdir : Path → Filesystem → Filesystem
5657

5758
/-- Remove directory -/
59+
-- AXIOM: rmdir; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
5860
axiom rmdir : Path → Filesystem → Filesystem
5961

6062
/-- Create file -/
63+
-- AXIOM: create; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
6164
axiom create : Path → Filesystem → Filesystem
6265

6366
/-- Delete file -/
67+
-- AXIOM: unlink; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
6468
axiom unlink : Path → Filesystem → Filesystem
6569

6670
/-- Read file content -/
71+
-- AXIOM: readFile; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
6772
axiom readFile : Path → Filesystem → Option FileContent
6873

6974
/-- Write file content -/
75+
-- AXIOM: writeFile; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
7076
axiom writeFile : Path → FileContent → Filesystem → Filesystem
7177

7278
/-- Get file metadata -/
79+
-- AXIOM: stat; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
7380
axiom stat : Path → Filesystem → Option FileMetadata
7481

7582
/-- Change permissions -/
83+
-- AXIOM: chmod; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
7684
axiom chmod : Path → PermSet → Filesystem → Filesystem
7785

7886
/-- Change owner -/
87+
-- AXIOM: chown; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
7988
axiom chown : Path → Nat → Filesystem → Filesystem
8089

8190
/-- Rename/move file -/
91+
-- AXIOM: rename; opaque POSIX primitive op; §(c) per docs/proof-debt.md.
8292
axiom rename : Path → Path → Filesystem → Filesystem
8393

8494
/-! ## Operation Axioms -/
8595

8696
/-- mkdir followed by rmdir is identity -/
97+
-- AXIOM: mkdir_rmdir_inverse; POSIX-semantics specification (mirrors Coq); §(c) per docs/proof-debt.md.
8798
axiom mkdir_rmdir_inverse (p : Path) (fs : Filesystem) :
8899
-- Precondition: p doesn't exist
89100
rmdir p (mkdir p fs) = fs
90101

91102
/-- create followed by unlink is identity -/
103+
-- AXIOM: create_unlink_inverse; POSIX-semantics specification (mirrors Coq); §(c) per docs/proof-debt.md.
92104
axiom create_unlink_inverse (p : Path) (fs : Filesystem) :
93105
unlink p (create p fs) = fs
94106

95107
/-- read followed by write is identity -/
108+
-- AXIOM: read_write_identity; POSIX-semantics specification (mirrors Coq); §(c) per docs/proof-debt.md.
96109
axiom read_write_identity (p : Path) (fs : Filesystem) (content : FileContent) :
97110
readFile p fs = some content →
98111
writeFile p content fs = fs
99112

100113
/-- chmod to current permissions is identity -/
114+
-- AXIOM: chmod_identity; POSIX-semantics specification (mirrors Coq); §(c) per docs/proof-debt.md.
101115
axiom chmod_identity (p : Path) (fs : Filesystem) (meta : FileMetadata) :
102116
stat p fs = some meta
103117
chmod p meta.permissions fs = fs
104118

105119
/-- rename to same path is identity -/
120+
-- AXIOM: rename_identity; POSIX-semantics specification (mirrors Coq); §(c) per docs/proof-debt.md.
106121
axiom rename_identity (p : Path) (fs : Filesystem) :
107122
rename p p fs = fs
108123

109124
/-- rename A to B followed by rename B to A is identity -/
125+
-- AXIOM: rename_inverse; POSIX-semantics specification (mirrors Coq); §(c) per docs/proof-debt.md.
110126
axiom rename_inverse (p1 p2 : Path) (fs : Filesystem) :
111127
p1 ≠ p2 →
112128
rename p2 p1 (rename p1 p2 fs) = fs
@@ -261,9 +277,11 @@ example (p : Path) :
261277
/-! ## Snapshot and Restore -/
262278

263279
/-- Snapshot operation -/
280+
-- AXIOM: snapshot; opaque snapshot primitive; §(c) per docs/proof-debt.md.
264281
axiom snapshot : Filesystem → Filesystem
265282

266283
/-- Restore from snapshot -/
284+
-- AXIOM: restore; opaque restore primitive; §(c) per docs/proof-debt.md.
267285
axiom restore : Filesystem → Filesystem → Filesystem
268286

269287
/-- snapshot followed by restore is identity -/

0 commit comments

Comments
 (0)