Skip to content

Commit 4883a42

Browse files
committed
feat(rmo): wire obliterate into dispatch + audit residue (secure deletion)
The obliterate secure-deletion command was fully implemented in commands/secure_deletion.rs but never wired into dispatch — no Command variant, no parser case, no executor arm — so it was unreachable dead code from the REPL/scripts. This binds the proven RMO model to a usable runtime. Wiring: - parser: Command::Obliterate { path, force, redirects } + "obliterate" case (--force/-f skips the confirmation guard). - executable: executor arm -> commands::secure_deletion::obliterate_path (routes file vs directory); proof_reference -> OBLITERATE_IRREVERSIBLE; description arm. - secure_deletion: obliterate_path dispatcher. Audit residue (MAA / GDPR Article 17 attestation): - obliterate/obliterate_dir append an append-only record to <sandbox-root>/.vsh-audit.log via AuditLog. The data is destroyed; the proof-of-deletion survives. Sandboxed under the shell root (testable, isolated). Tests: impl/rust-cli/tests/obliterate_rmo_tests.rs (6) — dispatch wiring, missing-operand error, end-to-end destruction, audit residue, irreversibility (undo cannot resurrect), no-old-plaintext-remains. Full suite green (317 lib + all integration); verified through the real vsh binary in script mode. Honest scope (docs reconciled from "RMO stubs only"): best-effort 3-pass overwrite (random/0x00/0xFF + fsync) on in-place filesystems only; CoW/SSD need hardware secure_erase; audit HMAC signing pending; NOT a complete GDPR framework. Updated CLAUDE.md, README, FAQ, ROADMAP(+_TO_V1), TOPOLOGY, docs/wiki/*, methodology.a2ml, and the ECHO-TYPES-OCHRANCE bridge (adoc + a2ml) in lock-step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KfgJznd6jzSeDYsSXGAXkU
1 parent 378e7e2 commit 4883a42

17 files changed

Lines changed: 282 additions & 24 deletions

.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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
=== Added — 2026-07-17
2121

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+
2244
==== Correspondence (mechanized differential oracle)
2345
- `proofs/lean4/ModelOracle.lean` + `lean_exe model_oracle` — compiles the
2446
**proven** Lean model definitions (`mkdir`/`rmdir`/`createFile`/`deleteFile`/

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

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

TOPOLOGY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ FORMAL VERIFICATION
7272
Reversibility Proofs ██████████ 100% All 8 ops proven in all 6 systems
7373
Permission Proofs (chmod/chown) ██████████ 100% NEW — 42 theorems across 6 systems
7474
MAA Framework (RMR) ██████████ 100% Reversible ops with audit trails
75-
MAA Framework (RMO) ██░░░░░░░░ 20% Irreversibility proofs, stubs only
75+
MAA Framework (RMO) ████░░░░░░ 40% Proofs + wired `obliterate` (best-effort + audit residue); no HW erase/HMAC
7676
Extraction Gap (Lean → Rust) ██████░░░░ 60% ~95% confidence via property testing
7777
7878
IMPLEMENTATION LAYERS

docs/ECHO-TYPES-OCHRANCE-BRIDGE.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Valence Shell supplies the shell operations; Echo Types supplies the language fo
3030
Valence Shell already has RMR and RMO vocabulary:
3131

3232
* RMR: Remove-Match-Reverse, reversible transactions with undo/redo proof.
33-
* RMO: Remove-Match-Obliterate, irreversible deletion with proof of complete removal; currently stubs only.
33+
* RMO: Remove-Match-Obliterate, irreversible deletion with proof of complete removal. The `obliterate` command is implemented and wired (best-effort 3-pass overwrite + unlink + append-only audit residue); the full RMO/GDPR framework (hardware erase for CoW/SSD, audit HMAC signing) is incomplete.
3434

3535
Without Echo Types, these can be misread as only implementation features. With Echo Types, they become cases in a broader theory of information change.
3636

@@ -148,7 +148,7 @@ When working in Valence Shell, Claude and similar agents must observe these rule
148148

149149
* Do not claim Valence Shell is production-ready.
150150
* Do not claim the Lean-to-Rust correspondence is mechanised.
151-
* Do not claim RMO/GDPR support exists beyond stubs.
151+
* Do not claim RMO/GDPR support beyond the implemented best-effort `obliterate` (in-place FS only; no hardware erase, no HMAC-signed audit) — i.e. do not claim a complete GDPR compliance framework.
152152
* Do not claim Echo Types proves Valence Shell implementation correctness.
153153
* Do not claim Ochrance cryptographic integrity while its hash/attestation gaps remain open.
154154
* Do not merge exploratory Echo bridges into core claims without checking `docs/bridge-status.md` in echo-types.

docs/ROADMAP_TO_V1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ plan builds on.
2727
- Lean→Rust correspondence is **tested, not mechanized** (~85–95% confidence)
2828
- Not a full POSIX shell: word splitting in external args, `~user`,
2929
subshell `(...)`, SIGCHLD/Ctrl+Z incomplete (`docs/POSIX_COMPLIANCE.md`)
30-
- RMO/secure deletion are stubs; GDPR claims not yet shippable
30+
- RMO `obliterate` implemented + wired (best-effort overwrite + unlink + audit residue); full GDPR not yet shippable (HW erase for CoW/SSD, HMAC signing pending)
3131
- Backlog is decomposed fan-out-ready in Tier-S issues:
3232
#41→(#86,#87,#88) seams, #42→(#76#81) proofs, #43→(#82#85) tests,
3333
#45→(#63#66, #90#94) theory frontiers

0 commit comments

Comments
 (0)