Skip to content

Commit 6bae89b

Browse files
Three v1.0 items: E-Grade launcher, mechanized correspondence oracle, RMO secure-deletion runtime (#165)
Three outstanding items, in order, each verified with the real toolchain. ## 1 — Launcher conforms to the E-Grade Launcher Standard `launch.sh` implements the Hyperpolymath **E-Grade Launcher Standard** (fetched from the public `hyperpolymath/standards`): full mode surface `--auto/--start/--stop/--status/--browser/--web/--integ/--disinteg/--help/--version`, version format `vsh <ver> (<sha>) [<platform>]`, idempotent Linux desktop integration (copy-not-symlink, `Terminal=true`, `.desktop` at 0444, config/logs preserved on `--disinteg`), desktop-tools resolution ladder with graceful no-op degradation, XDG PID/log paths. Because `vsh` is a **foreground terminal shell with no server**, the server-oriented clauses (nohup daemon, `wait_for_server` URL polling, browser launch) are **honestly declared *deferred*** in the `a2ml-metadata-block` header rather than silently skipped. `scripts/run.sh` is the canonical startup command the standard searches for; `just run`/`just launch` delegate to it. `docs/LAUNCHER.md` is the conformance attestation. *Verified:* every mode, a full `--integ`/`--disinteg` idempotency cycle, shellcheck clean. ## 2 — Mechanized correspondence: compiled proven model as test oracle `proofs/lean4/ModelOracle.lean` (`lean_exe model_oracle`) compiles the **exact proven** model defs (`mkdir/rmdir/createFile/deleteFile/fsUpdate`) into an oracle. `impl/rust-cli/tests/model_oracle_correspondence.rs` generates precondition-respecting sequences, applies them to the real Rust `ShellState`, drives the same sequence through the compiled Lean model, and asserts agreement at every touched path. **1218 probes agree across 200 sequences.** This makes the proof artifact itself the oracle (stronger than hand-transcribed property tests) — but it is honestly **still differential testing, not a full refinement proof** (the v1.0 blocker). `docs/LEAN4_RUST_CORRESPONDENCE.md` documents why the Coq extraction is *not* executable (`Path → option FSNode` domain + classical axioms in `is_empty_dir_dec`; needs `FMaps.t FSNode` migration) and the roadmap. Wired into `lean-verification.yml` CI; `just test-correspondence-model`. ## 3 — RMO secure-deletion runtime (the big one) `obliterate` was fully implemented in `commands/secure_deletion.rs` but **never wired into dispatch** — unreachable dead code. Added the `Command::Obliterate` variant, parser case (`--force`), and executor arm → `secure_deletion::obliterate_path`. Added the **audit residue**: obliterate appends to `<sandbox-root>/.vsh-audit.log` — the MAA/GDPR-Art.17 attestation that survives the deletion. *Verified:* `impl/rust-cli/tests/obliterate_rmo_tests.rs` (6 tests — wiring, destruction, audit residue, irreversibility, no-plaintext-remains), full suite green, and driven through the real `vsh` binary in script mode. **Honest scope:** best-effort 3-pass overwrite on in-place filesystems only; CoW/SSD need hardware `secure_erase`; audit HMAC signing pending; **not a complete GDPR framework**. Status docs reconciled from "RMO stubs only" across CLAUDE.md, README, FAQ, ROADMAP(+_TO_V1), TOPOLOGY, `docs/wiki/*`, `methodology.a2ml`, and the ECHO-TYPES-OCHRANCE bridge (adoc + a2ml, in lock-step). ## What remains genuinely open Full mechanized Lean→Rust *refinement proof* and a complete GDPR/RMO framework (hardware erase, HMAC-signed audit) — both flagged honestly in-repo, neither overclaimed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KfgJznd6jzSeDYsSXGAXkU --- _Generated by [Claude Code](https://claude.ai/code/session_01KfgJznd6jzSeDYsSXGAXkU)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 15c082f commit 6bae89b

28 files changed

Lines changed: 1229 additions & 36 deletions

.github/workflows/lean-verification.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ jobs:
106106
cargo test --test correspondence_tests
107107
cargo test --test property_correspondence_tests
108108
109+
- name: Build Lean model oracle (proof artifact as test oracle)
110+
run: |
111+
source $HOME/.elan/env
112+
cd proofs/lean4
113+
lake build model_oracle
114+
ls -lh .lake/build/bin/model_oracle
115+
116+
- name: Differential correspondence (proven Lean model vs Rust impl)
117+
run: |
118+
cd impl/rust-cli
119+
cargo test --test model_oracle_correspondence -- --nocapture
120+
109121
- name: Report Rust binary size
110122
run: |
111123
echo "Rust binary: $(stat -c%s impl/rust-cli/target/release/vsh) bytes"

.machine_readable/ECHO_TYPES_OCHRANCE_BRIDGE.a2ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ do-not-claim = "total erasure"
4949
name = "Remove-Match-Obliterate (irreversible + audit residue)"
5050
echo-reading = "proof-relevant certificate of elimination with permitted audit residue"
5151
do-not-claim = "undoable deletion"
52-
current-status = "stubs only"
52+
current-status = "best-effort obliterate implemented + wired (3-pass overwrite + unlink + append-only audit residue); full RMO/GDPR framework incomplete (no hardware erase for CoW/SSD, no HMAC-signed audit)"
5353

5454
[valence-shell-cases.narration]
5555
name = "explain / checkpoint / restore / diff / replay"
@@ -78,7 +78,7 @@ ochrance-usage = "name receipts and attestation surfaces; do not claim crypto gu
7878
[agent-rules.forbidden-moves]
7979
production-ready = "do not claim valence-shell is production-ready"
8080
lean-rust-mechanised = "do not claim the Lean-to-Rust correspondence is mechanised"
81-
rmo-gdpr-beyond-stubs = "do not claim RMO/GDPR support exists beyond stubs"
81+
rmo-gdpr-beyond-stubs = "do not claim RMO/GDPR beyond the implemented best-effort obliterate (in-place FS only, no hardware erase, no HMAC-signed audit); do not claim a complete GDPR compliance framework"
8282
echo-proves-implementation = "do not claim Echo Types proves Valence Shell implementation correctness"
8383
ochrance-crypto = "do not claim Ochrance cryptographic integrity while hash/attestation gaps remain"
8484
exploratory-as-core = "do not merge exploratory Echo bridges into core claims without checking echo-types/docs/bridge-status.md"

.machine_readable/bot_directives/methodology.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ constraints = [
101101
"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",
104-
"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",
104+
"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.",
105105
"OCaml extraction path exists in proofs/coq/extraction.v but the extracted code is not wired into a build target",
106106
"Idris2 ABI carrier has 2 holes + 10 partial markers per the 2026-06-01 deep audit (issue #42) — these are the FFI boundary obligations",
107107
]

CHANGELOG.adoc

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,67 @@ 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+
=== Added — 2026-07-17
21+
22+
==== RMO / secure deletion (runtime)
23+
- `obliterate` is now **wired into the shell** and reachable from the REPL and
24+
scripts. It was previously implemented in `commands/secure_deletion.rs` but
25+
never dispatched (no `Command` variant, parser case, or executor arm), so it
26+
was unreachable dead code. Added `Command::Obliterate { path, force, .. }`, the
27+
`"obliterate"` parser case (with `--force`/`-f`), and the executor arm routing
28+
to `secure_deletion::obliterate_path` (file/dir dispatch). Proof reference:
29+
`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.
34+
- Tests: `impl/rust-cli/tests/obliterate_rmo_tests.rs` (6 tests) — dispatch
35+
wiring, missing-operand error, end-to-end destruction, audit residue,
36+
irreversibility (undo cannot resurrect), and no-old-plaintext-remains. Full
37+
suite green; verified through the real binary in script mode.
38+
- **Honest scope**: best-effort 3-pass overwrite (random/0x00/0xFF + fsync) on
39+
in-place filesystems only. CoW (btrfs/ZFS/APFS)/SSD FTL defeat overwrite (use
40+
`secure_erase` for hardware NIST SP 800-88 Purge); audit-log HMAC signing is
41+
still pending. NOT a complete GDPR compliance framework. Status docs
42+
reconciled from "RMO stubs only" accordingly.
43+
44+
==== Correspondence (mechanized differential oracle)
45+
- `proofs/lean4/ModelOracle.lean` + `lean_exe model_oracle` — compiles the
46+
**proven** Lean model definitions (`mkdir`/`rmdir`/`createFile`/`deleteFile`/
47+
`fsUpdate`) into a standalone oracle that reports the node type at probe paths.
48+
- `impl/rust-cli/tests/model_oracle_correspondence.rs` — differential test that
49+
generates precondition-respecting operation sequences, applies them to the real
50+
Rust `ShellState`, runs the same sequence through the compiled Lean model, and
51+
asserts they agree at every touched path. **1218 probes agree across 200
52+
sequences.** This makes the proof artifact itself the test oracle (stronger
53+
than hand-transcribed property tests); it remains differential testing, not a
54+
full refinement proof — the latter is still the v1.0 blocker. The test skips
55+
cleanly when the oracle is not built.
56+
- `just build-model-oracle` / `just test-correspondence-model`; wired into
57+
`lean-verification.yml` CI.
58+
- `docs/LEAN4_RUST_CORRESPONDENCE.md` documents the harness, why the Coq
59+
extraction is not executable (function-typed filesystem + classical axioms;
60+
needs `FMaps.t FSNode` migration), and the roadmap to full mechanization.
61+
62+
==== Launcher (E-Grade Launcher Standard)
63+
- `launch.sh` — a standard-conformant launcher implementing the Hyperpolymath
64+
E-Grade Launcher Standard mode surface: `--auto` (default), `--start`,
65+
`--stop`, `--status`, `--browser`/`--web`, `--integ`, `--disinteg`, `--help`,
66+
`--version`. Version output matches the required
67+
`vsh <version> (<sha>) [<platform>]` format. Desktop integration (Linux
68+
first-class) is idempotent, copies rather than symlinks, sets `Terminal=true`,
69+
writes the `.desktop` at 0444, and `--disinteg` preserves config and logs.
70+
Sources `keepopen.sh`/`soft-attach.sh`/`gui-error.sh` via the published
71+
resolution ladder with graceful no-op degradation when the desktop-tools are
72+
absent. PID/log paths use XDG dirs (never `/tmp`). Server-oriented clauses
73+
(nohup daemon, `wait_for_server` URL polling, browser launch) are honestly
74+
**declared deferred** in the `a2ml-metadata-block` header, since `vsh` is a
75+
foreground terminal shell with no HTTP server. See `docs/LAUNCHER.md`.
76+
- `scripts/run.sh` — the canonical startup command the standard searches for
77+
(`{repo-dir}/scripts/run.sh`); builds the release binary on first use and
78+
execs the shell.
79+
- `just run` / `just launch` now delegate to `./launch.sh --auto`.
80+
2081
=== Added — 2026-07-16
2182

2283
==== Launcher

CLAUDE.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ The Rust CLI is a functional interactive shell with these features:
5353
- NOT a full POSIX shell (word splitting in external command args, $IFS in all contexts, full function nesting still incomplete)
5454
- NOT formally verified end-to-end (Lean -> Rust is ~95% confidence via property testing, not proven)
5555
- NOT a replacement for bash/zsh in current state
56-
- No GDPR compliance (RMO/secure deletion are stubs)
57-
- No mechanized correspondence proof (property testing only)
56+
- Partial GDPR/RMO: the `obliterate` secure-deletion command is implemented and wired (3-pass overwrite + unlink + append-only audit residue), best-effort on in-place filesystems only — CoW/SSD need hardware erase and audit HMAC signing is still pending, so this is NOT a full GDPR compliance framework
57+
- No mechanized correspondence proof (property testing only; a compiled-Lean-model differential oracle now backstops it — see `docs/LEAN4_RUST_CORRESPONDENCE.md`)
5858
- Elixir NIF build broken (low priority)
5959
- BEAM daemon not implemented (planned, not built)
6060

@@ -111,7 +111,7 @@ deep-audit session). The corresponding Phase 4C design docs under
111111
### Medium Priority
112112

113113
1. Full POSIX compliance incomplete (see `docs/POSIX_COMPLIANCE.md`)
114-
2. No GDPR compliance (RMO/secure deletion are stubs)
114+
2. Partial GDPR/RMO: `obliterate` implemented (best-effort secure deletion + audit residue); full GDPR framework incomplete (HW erase for CoW/SSD, HMAC signing)
115115
3. Elixir NIF build broken (low priority)
116116

117117
### Low Priority
@@ -303,9 +303,18 @@ cargo run
303303
- Working in Rust CLI
304304

305305
### RMO (Remove-Match-Obliterate)
306-
- Irreversible deletion with proof of complete removal
307-
- Stubs only — NOT implemented
308-
- Needed for GDPR compliance
306+
- Irreversible deletion with proof of complete removal (model proven in
307+
`proofs/coq/rmo_operations.v`: `obliterate_overwrites_all_blocks`,
308+
`obliterate_not_injective`)
309+
- **Implemented and wired** in the CLI: `obliterate <file> [--force]` does a
310+
3-pass overwrite (random/0x00/0xFF, fsync) + unlink, records an irreversible
311+
`Obliterate` op, and appends an **audit residue** to `<root>/.vsh-audit.log`
312+
(the MAA attestation that survives the deletion). Parser+executor →
313+
`commands::secure_deletion::obliterate_path`. Tests:
314+
`tests/obliterate_rmo_tests.rs`.
315+
- **Honest limits** (still not full GDPR): best-effort on in-place filesystems
316+
only — CoW (btrfs/ZFS/APFS)/SSD FTL defeat overwrite (use `secure_erase` for
317+
hardware NIST SP 800-88 Purge); audit-log HMAC signing is still a TODO.
309318

310319
## License
311320

FAQ.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ What is **not** solid enough for production:
9797

9898
* The link from the proven model to the Rust runtime is *property-tested*
9999
(~85% confidence), not *mechanically proven*. This is the v1.0.0 blocker.
100-
* RMO (secure deletion / GDPR) primitives are stubs in the runtime even where
101-
the model is proved.
100+
* RMO (secure deletion / GDPR): the `obliterate` command is implemented and
101+
wired (`obliterate <file> --force` → 3-pass overwrite + unlink + append-only
102+
audit residue), but it is best-effort on in-place filesystems only (CoW/SSD
103+
need hardware erase via `secure_erase`) and is not a complete GDPR framework.
102104
* POSIX coverage is a strict subset; word-splitting in external command args,
103105
full subshell `(...)` syntax, and `~user` tilde expansion are not implemented.
104106

Justfile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ build-lean4:
4343
cd proofs/lean4 && lean FileOperations.lean
4444
@echo "✓ Lean 4 proofs checked"
4545

46+
# Build the executable model oracle (the compiled proven Lean model) used by the
47+
# differential correspondence test impl/rust-cli/tests/model_oracle_correspondence.rs
48+
build-model-oracle:
49+
@echo "Building Lean model oracle..."
50+
cd proofs/lean4 && lake build model_oracle
51+
@echo "✓ model oracle -> proofs/lean4/.lake/build/bin/model_oracle"
52+
53+
# Run the differential correspondence test (proven Lean model vs Rust impl).
54+
# Builds the oracle first so the test does not skip.
55+
test-correspondence-model: build-model-oracle
56+
cd impl/rust-cli && cargo test --test model_oracle_correspondence -- --nocapture
57+
4658
# Build Agda proofs
4759
build-agda:
4860
@echo "Building Agda proofs..."
@@ -126,13 +138,15 @@ test-cli:
126138
cd impl/rust-cli && cargo test
127139
@echo "✓ Rust CLI tests passed"
128140

129-
# Launch the interactive vsh shell (the primary deliverable). Extra args pass
130-
# through to the binary:
141+
# Launch the interactive vsh shell via the E-Grade launcher (./launch.sh).
142+
# Extra args pass through to the binary:
131143
# just run # start the interactive REPL
132144
# just run --version # print version and exit
133145
# just run script.vsh # run a script
146+
# For the full launcher mode-set (--status/--integ/--disinteg/...), call
147+
# ./launch.sh directly. See docs/LAUNCHER.md.
134148
run *ARGS:
135-
cd impl/rust-cli && cargo run -- {{ARGS}}
149+
@"{{justfile_directory()}}/launch.sh" --auto -- {{ARGS}}
136150

137151
# Build all FFI layers
138152
build-ffi: build-ffi-zig build-ffi-ocaml

QUICKSTART-USER.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ cargo build --release # build the release binary
7878
./target/release/vsh --version
7979
----
8080

81+
== Desktop integration (optional)
82+
83+
`launch.sh` is the standard-conformant launcher (E-Grade Launcher Standard). It
84+
adds a desktop menu entry so you can start `vsh` from your application launcher:
85+
86+
[source,bash]
87+
----
88+
./launch.sh --integ # install a desktop entry (Linux; idempotent)
89+
./launch.sh --status # show binary, version, platform
90+
./launch.sh --disinteg # remove it again (keeps your config and logs)
91+
----
92+
93+
`./launch.sh` with no arguments launches the shell (same as `just run`). See
94+
link:docs/LAUNCHER.md[docs/LAUNCHER.md] for the full mode set and conformance
95+
notes.
96+
8197
== Run in a container
8298

8399
[source,bash]

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Valence Shell is a formally verified shell with proven reversibility guarantees.
5454
* [x] Here Documents: `<<DELIMITER`, `<←DELIMITER`, `<<<word`
5555
* [x] Job Control: Background jobs, `fg`, `bg`, `kill`, job specifications
5656
* [x] Shell Variables: `$VAR`, `export`, assignment, expansion
57-
* [ ] GDPR Compliance: Secure deletion (`obliterate`) + audit logging (stubs only)
57+
* [~] GDPR/RMO: `obliterate` secure deletion implemented + wired (3-pass overwrite + unlink + append-only audit residue); best-effort on in-place filesystems — CoW/SSD need hardware `secure_erase`, HMAC signing pending (not a full GDPR framework)
5858
* [x] Syntax Highlighting: Real-time color-coded REPL
5959
* [x] Command Correction: Intelligent typo suggestions
6060
* [x] Friendly Errors: fish-style helpful error messages

ROADMAP.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ Hard requirements before any v1.0 claim:
112112
* [ ] CRG v2.0 grade B: 6+ diverse external targets, issues fed back.
113113
See audit `=== External validation` section for the proposed diverse-6
114114
shape.
115-
* [ ] Complete RMO (Remove-Match-Obliterate) implementation for GDPR
116-
compliance — currently stubs only. Tracked under #41.
115+
* [~] RMO (Remove-Match-Obliterate): file-level `obliterate` implemented and
116+
wired (best-effort 3-pass overwrite + unlink + append-only audit residue).
117+
Remaining for full GDPR: hardware erase for CoW/SSD, audit HMAC signing,
118+
recursive-dir hardening. Tracked under #41.
117119
* [ ] Echidna integration for automated property-based verification.
118120

119121
== v2.0 — Idris2 Extraction Path

0 commit comments

Comments
 (0)