Skip to content

Commit ce16ce3

Browse files
hyperpolymathArena Agentarena-agentcoderabbitai[bot]
authored
Re-audit the assurance boundary; repair the Agda tree so it actually compiles (#221)
## What this is A re-audit of Valence Shell's assurance boundary and its claimed relationship to JanusKey, plus the first round of *actually executing* the proof legs that the repository had been asserting. Four commits, 79 files. The headline: **the headline docs were already honest; the drift lived in the secondary surfaces — and the Agda proof tree had never been compiled at all.** ## 1. The audit (commit `31866dd`) `docs/audits/2026-11-01-assurance-boundary-audit.adoc` — 24 findings (AB-01…AB-24) plus AP-1…AP-8, with provenance, a corrected-artefacts list, and a deliberately-not-changed list. Audits append; `2026-06-01-deep-audit.adoc` is untouched. - **JanusKey / `reversible-core`: not imported.** Canonical wording adopted: *"JanusKey integration is planned; Valence Shell has no implemented dependency on it."* `reversible-core` appears zero times in the tree. Cross-repo orientation documents are explicitly *not* mechanised dependencies. - **RMO restated** as best-effort local overwrite/unlink plus an audit residue — not physical erasure, not GDPR compliance. `.vsh-audit.log` residue is unsigned and the audit says so. - **The extraction gap is kept as *the* trust boundary**: Lean/Coq/etc. model → Rust/POSIX is still an open obligation (F-1), not a refinement proof. Prose that read orientation docs or test suites as a refinement proof was corrected. - **JanusKey section is measured, not asserted**, and lists exactly what would change the verdict. ### Grading against `mathesis` and `standards` Percentages (~85% / ~95% confidence) were **removed, not adjusted** — the estate forbids the form. They were replaced by the closed vocabulary (`proven`, `proven-with-postulates`, `argued`, `tested-only`, `open`) in a 17-row Proof Ledger (`EXPLAINME.adoc#proof-ledger`), and by mathesis's discrete ladder (Open / Claimed / Grade 3 / 2i / 2ii / 1). Two policy conclusions the audit refuses to soften: - Six parallel hand-written models are **six statements, not one translated witness**, so nothing here reaches Grade 2i/2ii. The Grade-3-adjacent rows are Coq/Lean-sourced rather than Agda-sourced — the reverse of the estate's source-of-truth order. - PROOF-POLICY §1 maps Rust to Creusot. There are no Creusot contracts in `impl/rust-cli/`, so the Rust rows are `argued` / `tested-only`. ## 2. The Agda tree repaired (commit `a903c3f`) **It did not compile. At all.** Every module failed with a parse error under the repository's own `agda <file>` invocation, and `valence-shell.agda-lib` was itself unparseable (`.agda-lib` has no comment syntax; it opened with `--` lines). So the `proven-with-postulates` rows had never been produced by a compiler. Defects found and repaired, each commented in place: - nested `with` under `... | yes refl with …` in six modules — Agda cannot parse that layout, and re-indenting only makes it *silently regroup* the clauses; - `FilesystemModel.agda:118` declaring a record field `parentExists` in a module that already defines `parentExists` (hard error, masked by the parse error); same class for `isFile` and `defaultPerms`; - `lzero` imported from `Level` (moved to `Agda.Primitive` in stdlib 2.x); - `rmdir-removes-path` proving `⊥` with `λ ()`; - `reverseSequence` built from foldl `reverse`, so the composition theorem could not reduce; - `FilesystemEquivalence` asserting over `Reversible` where `singleOpReversible` needs the `ReversibleDP` default-permissions witness; - **`FileContentOperations` and `RMOOperations` rewritten** against the model that exists — they used constructors and helper names that were never defined (`file`/`directory` vs `File`/`Directory`, `getNodeType`, `delete-file`, `path-exists`, `is-file`) and redefined `case_of_` four times in `where` blocks. **Verified: 9/9 modules type-check** under Agda 2.6.4.3 + stdlib 2.1.1 *and* Agda 2.7.0.1 + stdlib 2.2, one postulate, no holes. **Not claimed as Grade 3.** The estate invocation is not satisfied, and the two rejections are recorded verbatim in `proofs/agda/VERIFICATION.adoc`: ``` FilesystemModel.agda:179 Cannot postulate funext with safe flag FilesystemModel.agda:155 Cannot eliminate reflexive equation p = p of type List String because K has been disabled ``` The second is not a `funext` problem: any case split on `Dec (p ≡ p)` needs K. The Agda rows are therefore `proven-with-postulates`, *reproduced under a recorded waiver*, not upgraded. ## 3. The verification round (commit `e34decf`) The audit's AP-8 said "no prover was installed, so nothing was re-run". That is now partly discharged, with results written into the audit, the ledger and `PROOF-NEEDS.adoc`: - **Agda**: installed and run (see above). One module had never been checked since 2026-04; the last recorded "verified working" version was wrong about the file even parsing. - **Z3** (z3-solver 5.3.3, exit codes ignored — Z3 exits 0 for both `sat` and `unsat`, so every `(check-sat)` was parsed individually): `unsat` for the named theorems in `copy_move_operations`, `filesystem_operations`, `permission_operations`, `rmo_operations`; **`symlink_operations.smt2` contains one bare `sat` and never negates a goal, so it proves nothing** — its ledger coverage drops to `open`. - **Not installable here**: Rust/rustup, Creusot, Why3, Kani, Lean/elan, Coq/Rocq, Idris2, Isabelle, Mizar. The sandbox egress allowlist permits only PyPI, codeload and github.com, so no mainstream toolchain channel is reachable. Those rows still rest on the repository's own recorded evidence and now say so explicitly instead of implying a re-run. ## 4. Dated correction (commit `694ca03`) `docs/PROOF_HOLES_AUDIT.adoc` claimed holes were "filled" and postulates "PROVEN" on 2026-04-03. No compiler had ever seen the files. A dated correction block says so and points at what is now true. Historical session records are left as records. ## Deliberately not changed `CONTINUATION_SESSION_COMPLETE.adoc`, `SESSION_COMPLETE.adoc`, `EXTRACTION_SUMMARY.adoc`, `docs/PHASE*`, `docs/SESSION_*`, `.machine_readable/6a2/ECOSYSTEM.a2ml` — these are dated records, not current claims. `docs/audits/2026-06-01-deep-audit.adoc` is untouched (audits append). ## Reproducing ```sh # Agda (either toolchain; both give 9/9) agda --library-file=<stdlib>.agda-lib --library=valence-shell <Module>.agda agda ... --safe # Cannot postulate funext with safe flag agda ... --without-K # K has been disabled # Z3 z3 proofs/z3/rmo_operations.smt2 # parse each (check-sat); rc is not a verdict # gate this audit must keep passing bash .github/scripts/check-bridge-forbidden-phrases.sh ``` ## Still open (not fixed by this PR) - F-1, the model→Rust refinement gap, remains the v1.0 blocker. - `funext` discharge and the `--without-K` refactor — both proof campaigns, both needed before any Agda row can be Grade 3. - Creusot contracts for the CLI; Kani harnesses at the FFI seam. - §4 exception notes for Isabelle/Mizar/Z3, and a decision on whether to keep Mizar and Z3 at all given the failure-swallowing Mizar target. - No CI enforcement of the PROOF-POLICY vocabulary or the new ledger. --------- Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> Co-authored-by: Arena Agent <agent@arena.ai> Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 295c3ca commit ce16ce3

81 files changed

Lines changed: 2389 additions & 1223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/CLAUDE.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Before making claims about reversibility, obliteration, Lean↔Rust mechanisatio
1111

1212
The bridge is **documentation-and-orientation-only**, not a mechanised dependency. Keep RMR (reversible) and RMO (irreversible + audit residue) distinct.
1313

14+
The same discipline applies to `hyperpolymath/januskey` and its `reversible-core` crate: **not imported, not a dependency** (measured 2026-11-01 — no import under `proofs/`, no `Cargo.toml` entry, no `.gitmodules`). JanusKey's integration is planned on its side ("Phase 2 — NEXT") and the D204 ruling is a decision, not an implementation. If a change adds `reversible-core`, it is an *implementation* dependency and does not move any claim across the extraction gap. Reversibility here is *algorithmic*, not thermodynamic. Audit record: `docs/audits/2026-11-01-assurance-boundary-audit.adoc`.
15+
1416
## Machine-Readable Artefacts
1517

1618
The following files in `.machine_readable/` contain structured project metadata:

‎.machine_readable/bot_directives/methodology.a2ml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ perfective = 10 # % for SPDX headers, doc updates, formatting, style
5555
# Customise this per project — the template default is generic.
5656

5757
[methodology.unique-strength]
58-
description = "Proof-backed MAA (Mutually Assured Accountability) framework with polyglot verification: the SAME core reversibility theorems proven across 6 independent proof systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3) on top of DIFFERENT logical foundations (CIC, dependent TT, intensional TT, HOL, Tarski-Grothendieck set theory, SMT). Cross-validation between foundations catches modelling errors that any single prover would miss, and the Idris2 ABI layer carries the proof story across the FFI boundary into the Rust CLI runtime. Sibling projects diverge: echidna is dyadic-Coq-only, proven is single-Idris2, ephapax is four-layer-Coq for typed-wasm — none of them carry cross-foundation cross-validation. Divergent-mode work in valence-shell must DEEPEN the polyglot story (close a hole in System X by porting the proof from System Y, tighten the cross-system correspondence, extend Idris2 ABI coverage of newly-proven operations) rather than introduce a 7th system or substitute a stronger single-prover stack."
58+
description = "Proof-backed MAA (Mutually Assured Accountability) framework with polyglot verification: the SAME core reversibility theorems proven across 6 independent proof systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3) on top of DIFFERENT logical foundations (CIC, dependent TT, intensional TT, HOL, Tarski-Grothendieck set theory, SMT). Cross-validation between foundations catches modelling errors that any single prover would miss. The Idris2 ABI layer documents the ABI (layout, encodings, axioms) and is hole-free; it does NOT transport proofs across the FFI boundary into the Rust CLI runtime — the model-to-Rust refinement gap remains open and is the project's stated trust boundary. Sibling projects diverge: echidna is dyadic-Coq-only, proven is single-Idris2, ephapax is four-layer-Coq for typed-wasm — none of them carry cross-foundation cross-validation. Divergent-mode work in valence-shell must DEEPEN the polyglot story (close a hole in System X by porting the proof from System Y, tighten the cross-system correspondence, extend Idris2 ABI coverage of newly-proven operations) rather than introduce a 7th system or substitute a stronger single-prover stack."
5959
deepen-not-broaden = true
6060

6161
# ============================================================================
@@ -74,12 +74,12 @@ rules = [
7474
"Polyglot stays at exactly 6 verification systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3) — do not add a 7th and do not drop one to simplify",
7575
"Lean 4 is the canonical specification — when foundations disagree, Lean is the source of truth and the others cross-validate",
7676
"Coq proofs in proofs/coq/ MUST remain extractable to OCaml — no introduction of non-computational axioms beyond the documented set (funext, well-formedness, decidability of is_empty_dir)",
77-
"Proof-hole count is monotone non-increasing — never trade a closed hole for a new one without an explicit ADR; PROOF_HOLES_AUDIT.md is the bookkeeping",
77+
"Proof-hole count is monotone non-increasing — never trade a closed hole for a new one without an explicit ADR; PROOF_HOLES_AUDIT.adoc is the bookkeeping",
7878
"RMR (Remove-Match-Reverse) theorems are reversibility statements; RMO (Remove-Match-Obliterate) theorems are NON-injectivity statements — never collapse the two; the historical mis-statement obliterate_not_reversible was already caught and replaced 2026-04-03",
7979
"Idris2 ABI layer is the only sanctioned proof-to-FFI carrier — do not bypass it with raw C bindings or unverified Rust FFI",
8080
"Rust is the single production runtime — divergent work goes into impl/rust-cli/, not into impl/ocaml/ (extraction target, design only) or impl/elixir/ (reference, stale)",
8181
"POSIX coverage is a means, not an end — do not add shell syntax that has no path to a proof story",
82-
"Honest-status discipline — every claim must have a counterpart caveat (EXPLAINME.adoc pattern); README/CLAUDE.md numbers MUST match docs/PROOF_HOLES_AUDIT.md and reality",
82+
"Honest-status discipline — every claim must have a counterpart caveat (EXPLAINME.adoc pattern); README/CLAUDE.md numbers MUST match docs/PROOF_HOLES_AUDIT.adoc and reality",
8383
]
8484

8585
# Language invariant for the core strength: there is no SINGLE language —
@@ -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 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",
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.adoc",
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): the obliterate command IS implemented and wired (parser+executor -> commands::secure_deletion::obliterate_path; 3-pass overwrite + unlink + append-only audit residue at <root>/.vsh-audit.log; tests/obliterate_rmo_tests.rs). Best-effort on in-place filesystems only; CoW/SSD need hardware secure_erase; audit HMAC signing still pending. Do NOT claim a full GDPR compliance framework.",

‎0-AI-MANIFEST.a2ml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ human-explainme = "EXPLAINME.adoc"
3131
human-faq = "FAQ.adoc"
3232

3333
[honest-status]
34-
# The single source of truth for proof debt is docs/PROOF_HOLES_AUDIT.md.
34+
# The single source of truth for proof debt is docs/PROOF_HOLES_AUDIT.adoc.
3535
# If you see different numbers anywhere, file an issue.
36-
proof-holes-doc = "docs/PROOF_HOLES_AUDIT.md"
36+
proof-holes-doc = "docs/PROOF_HOLES_AUDIT.adoc"
3737
deep-audit-log-dir = "docs/audits/"
3838
latest-deep-audit = "docs/audits/2026-06-01-deep-audit.adoc"
3939

@@ -63,15 +63,15 @@ service-discovery = "Groove Protocol — not currently wired"
6363
[delivery-promises]
6464
# Every agent session must:
6565
# 1. Read INTENT before changing scope.
66-
# 2. Update docs/PROOF_HOLES_AUDIT.md the same commit that changes any proof.
66+
# 2. Update docs/PROOF_HOLES_AUDIT.adoc the same commit that changes any proof.
6767
# 3. Keep README/CLAUDE.md numbers in sync with reality (see docs/audits/).
6868
# 4. Never collapse the 6-system polyglot stack (divergent invariant).
6969
update-on-touch = [
7070
".machine_readable/INTENT.contractile",
7171
".machine_readable/MUST.contractile",
7272
".machine_readable/TRUST.contractile",
7373
".machine_readable/ADJUST.contractile",
74-
"docs/PROOF_HOLES_AUDIT.md",
74+
"docs/PROOF_HOLES_AUDIT.adoc",
7575
"docs/audits/",
7676
"CLAUDE.md",
7777
"README.adoc",

‎CHANGELOG.adoc‎

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
== [Unreleased]
1313

14+
=== Changed — 2026-11-01 (assurance-boundary re-audit)
15+
16+
- Corrected prose that had drifted across the assurance boundary. The audit
17+
record is `docs/audits/2026-11-01-assurance-boundary-audit.adoc`. In summary:
18+
* the CLI banner and the Elixir moduledoc no longer call the project
19+
"thermodynamic" — the claim is *algorithmic* reversibility only;
20+
* RMO is described everywhere as best-effort local overwrite + unlink + audit
21+
residue, never as physical erasure or GDPR compliance;
22+
* the trust-boundary diagram now names the shipped Rust CLI, keeping the
23+
extraction/refinement gap as the boundary;
24+
* a test comment that said a Lean theorem proves the Rust normaliser now says
25+
what it actually proves (the Lean model of the normaliser);
26+
* `docs/THEORY-FEED.adoc` states the measured JanusKey situation: zero
27+
imports, no `reversible-core` dependency, integration planned upstream only.
28+
- Stale `.md` references to `docs/LEAN4_RUST_CORRESPONDENCE`, `PROOF_HOLES_AUDIT`,
29+
`OCAML_EXTRACTION` and `ZIG_LEAN_EXTRACTION` corrected to `.adoc`.
30+
31+
=== Added — 2026-11-01 (estate proof-policy alignment)
32+
33+
- `EXPLAINME.adoc` now carries the **Proof Ledger** required by `standards`
34+
`docs/README-EXPLAINME-STANDARD.adoc` §5: 17 obligation rows, each with a
35+
status from the closed vocabulary (`proven`, `proven-with-postulates`,
36+
`argued`, `tested-only`, `open`), the checker invocation, the location and the
37+
trust boundary. The header states that no prover was installed in the audit
38+
environment, so no row was re-run.
39+
- `CLAUDE.md` gains a normative proof-policy block mapping obligation classes to
40+
the verifiers `standards/3-practice/PROOF-POLICY.adoc` assigns
41+
(Rust→Creusot, ABI/APIs→Idris2, theory→Agda rechecked in Rocq and Lean).
42+
- Confidence percentages (~85%, ~95%) are no longer used on any current claim
43+
surface. `mathesis` §6 forbids the form; the replacement is a status token per
44+
obligation, and mathesis Grades 3/2i/2ii/1 where a grade is needed.
45+
- Recorded, not fixed: the Agda tree postulates `funext` and is built without
46+
the canonical `--safe --without-K --cubical-compatible` invocation, so no Agda
47+
row can be `proven`; the Mizar target swallows failure (`|| echo`). Both are
48+
logged as AP-6, AP-7 and AP-8 in the audit.
49+
1450
=== Planned
1551
- Glob expansion (*.txt, ?.rs, [a-z]*)
1652
- Quote processing (proper escaping, single/double quotes)
1753
- Full POSIX shell compliance (subset)
18-
- RMO (Remove-Match-Obliterate) proofs for GDPR compliance
54+
- RMO (Remove-Match-Obliterate) non-injectivity proofs — audit evidence about the
55+
abstract model, explicitly not a GDPR compliance determination
1956

2057
=== Added — 2026-07-17
2158

@@ -27,10 +64,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2764
`"obliterate"` parser case (with `--force`/`-f`), and the executor arm routing
2865
to `secure_deletion::obliterate_path` (file/dir dispatch). Proof reference:
2966
`OBLITERATE_IRREVERSIBLE`.
30-
- **Audit residue**: obliterate now appends an append-only record to
31-
`<sandbox-root>/.vsh-audit.log` — the MAA attestation that survives the data
32-
destruction (GDPR Article 17 evidence). Data is destroyed; proof-of-deletion
33-
persists.
67+
- **Audit residue**: obliterate appends an append-only record to
68+
`<sandbox-root>/.vsh-audit.log` — an unsigned record that the command ran,
69+
which survives the deletion.
70+
71+
*Corrected 2026-11-01:* this bullet originally read "the MAA attestation that
72+
survives the data destruction (GDPR Article 17 evidence). Data is destroyed;
73+
proof-of-deletion persists." That overstated the guarantee. The overwrite is
74+
best-effort and local; CoW extents, journals, snapshots, device spares and
75+
replicas are outside it, and an unsigned residue is not an attestation or legal
76+
evidence. See `docs/RMO-DURABILITY-BOUNDARY.adoc`.
3477
- Tests: `impl/rust-cli/tests/obliterate_rmo_tests.rs` (6 tests) — dispatch
3578
wiring, missing-operand error, end-to-end destruction, audit residue,
3679
irreversibility (undo cannot resurrect), and no-old-plaintext-remains. Full
@@ -55,7 +98,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5598
cleanly when the oracle is not built.
5699
- `just build-model-oracle` / `just test-correspondence-model`; wired into
57100
`lean-verification.yml` CI.
58-
- `docs/LEAN4_RUST_CORRESPONDENCE.md` documents the harness, why the Coq
101+
- `docs/LEAN4_RUST_CORRESPONDENCE.adoc` documents the harness, why the Coq
59102
extraction is not executable (function-typed filesystem + classical axioms;
60103
needs `FMaps.t FSNode` migration), and the roadmap to full mechanization.
61104

@@ -109,7 +152,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
109152
2026-06-02 admits (#56/#57/#58) are all closed. Remaining assumptions
110153
are standard/justified: Coq `functional_extensionality` (stdlib) +
111154
`is_empty_dir_dec` (justified classical), Agda `funext` (structural).
112-
Docs reconciled: `PROOF_HOLES_AUDIT.md`, `README.adoc`, `FAQ.adoc`,
155+
Docs reconciled: `PROOF_HOLES_AUDIT.adoc`, `README.adoc`, `FAQ.adoc`,
113156
`CLAUDE.md`, `docs/wiki/`, `ROADMAP*.{adoc,md}`,
114157
`.machine_readable/6a2/STATE.a2ml`, `bot_directives/methodology.a2ml`.
115158

@@ -350,7 +393,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
350393
- Updated REPL with new parser and external execution
351394

352395
- **Architecture Documentation**
353-
- LEAN4_RUST_CORRESPONDENCE.md
396+
- LEAN4_RUST_CORRESPONDENCE.adoc
354397
- ECHIDNA_INTEGRATION.md
355398
- ARCHITECTURE.md
356399
- POSIX_COMPLIANCE.md with 14-milestone roadmap
@@ -372,8 +415,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
372415
=== Documentation
373416
- PHASE6_M1_DESIGN.md
374417
- EXTRACTION_SUMMARY.md (500 lines)
375-
- docs/OCAML_EXTRACTION.md (600 lines)
376-
- docs/ZIG_LEAN_EXTRACTION.md (700 lines)
418+
- docs/OCAML_EXTRACTION.adoc (600 lines)
419+
- docs/ZIG_LEAN_EXTRACTION.adoc (700 lines)
377420

378421
== [0.6.0] - 2025-12-01
379422

0 commit comments

Comments
 (0)