|
| 1 | +// SPDX-License-Identifier: MPL-2.0 |
| 2 | +// Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 3 | += Echo Types / Ochrance Bridge for Valence Shell |
| 4 | +:toc: |
| 5 | +:icons: font |
| 6 | + |
| 7 | +== Purpose |
| 8 | + |
| 9 | +This document tells humans and LLM agents how to relate Valence Shell to `hyperpolymath/echo-types` and `hyperpolymath/ochrance` without overstating the current implementation. |
| 10 | + |
| 11 | +Valence Shell is the operational shell: it executes filesystem and shell actions, tracks history, supports undo/redo, and proves a substantial reversible-operation core across multiple proof systems. |
| 12 | + |
| 13 | +Echo Types is the semantic theory of structured loss: irreversible computations are not treated as blank erasure, but as maps with proof-relevant residues. Its foundation is: |
| 14 | + |
| 15 | +[source,agda] |
| 16 | +---- |
| 17 | +Echo f y := Σ (x : A) , (f x ≡ y) |
| 18 | +---- |
| 19 | + |
| 20 | +Ochrance is the receipt and attestation layer: A2ML manifests, verified Merkle structure, linear repair, and subsystem verification give concrete evidence that a filesystem state or repair claim can be checked. |
| 21 | + |
| 22 | +The bridge is not currently a mechanised dependency. It is an architecture and documentation obligation: agents must preserve the distinction between proven Valence Shell claims, Echo Types semantic framing, and Ochrance receipt evidence. |
| 23 | + |
| 24 | +== One-sentence placement |
| 25 | + |
| 26 | +Valence Shell supplies the shell operations; Echo Types supplies the language for what information is preserved, lost, recoverable, or merely constrained by those operations; Ochrance supplies the receipts that make state and repair claims auditable. |
| 27 | + |
| 28 | +== Why Valence Shell needs Echo Types |
| 29 | + |
| 30 | +Valence Shell already has RMR and RMO vocabulary: |
| 31 | + |
| 32 | +* 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. |
| 34 | + |
| 35 | +Without Echo Types, these can be misread as only implementation features. With Echo Types, they become cases in a broader theory of information change. |
| 36 | + |
| 37 | +For a shell operation modeled as a map: |
| 38 | + |
| 39 | +[source,text] |
| 40 | +---- |
| 41 | +f : PreState -> PostState |
| 42 | +---- |
| 43 | + |
| 44 | +`Echo f y` is the proof-relevant space of pre-states that could have produced the observed post-state `y`. This lets Valence Shell say more precise things: |
| 45 | + |
| 46 | +[cols="1,2,2"] |
| 47 | +|=== |
| 48 | +| Valence Shell case | Echo Types reading | What not to claim |
| 49 | + |
| 50 | +| Reversible operation / RMR |
| 51 | +| The relevant fibre should be singleton-like, equivalence-like, or otherwise controlled enough to reconstruct the previous state under stated preconditions. |
| 52 | +| Do not claim all shell operations are reversible. |
| 53 | + |
| 54 | +| Ordinary lossy operation |
| 55 | +| The previous state is not fully recoverable, but the residue still constrains what could have happened. |
| 56 | +| Do not collapse this into total erasure. |
| 57 | + |
| 58 | +| RMO / obliteration |
| 59 | +| The point is not recovery. The point is a proof-relevant certificate that the target information has been eliminated while permitted audit residue remains. |
| 60 | +| Do not describe RMO as undoable deletion. |
| 61 | + |
| 62 | +| `explain`, `checkpoint`, `restore`, `diff`, `replay` |
| 63 | +| Human-facing projections over state transitions, residues, and evidence trails. |
| 64 | +| Do not present narration as proof unless backed by proof artefacts or receipts. |
| 65 | +|=== |
| 66 | + |
| 67 | +== The specific Echo Types material Claude must know |
| 68 | + |
| 69 | +Read these from `hyperpolymath/echo-types` before changing this bridge: |
| 70 | + |
| 71 | +* `README.md` — canonical foundation, recommended reading order, and the current identity-layer story. |
| 72 | +* `proofs/agda/EchoCanonicalIdentitySuite.agda` — curated proof entry point for the load-bearing Echo identity layer. |
| 73 | +* `docs/echo-types/MAP.adoc` — status-tagged master map. |
| 74 | +* `docs/bridge-status.md` — distinguishes exploratory bridges from core results. |
| 75 | +* `CLAUDE.md` — session ledger and working rules. |
| 76 | + |
| 77 | +The concepts that matter most for Valence Shell are: |
| 78 | + |
| 79 | +* `Echo f y := Σ (x : A) , (f x ≡ y)` as the fibre/residue object. |
| 80 | +* Canonical total completion: `A ≃ Σ B (Echo f)`. |
| 81 | +* Classification of loss/residue forms, especially epistemic, indexed, search, cost, and observational residues. |
| 82 | +* No-section / collapsing-map results as the right mental model for irreversible or obliterative shell actions. |
| 83 | +* The honesty rule: bridges can be useful while still not affecting Echo Types' core theorems. |
| 84 | + |
| 85 | +== Why Valence Shell needs Ochrance |
| 86 | + |
| 87 | +Ochrance is the natural place for concrete filesystem receipts. |
| 88 | + |
| 89 | +Valence Shell can prove that a modeled operation has a property. Ochrance can help package filesystem evidence that a particular state, manifest, repair, or attestation was checked. In bridge terms: |
| 90 | + |
| 91 | +[cols="1,2"] |
| 92 | +|=== |
| 93 | +| Concern | Ochrance role |
| 94 | + |
| 95 | +| Filesystem state evidence |
| 96 | +| A2ML manifests and validators. |
| 97 | + |
| 98 | +| Integrity of snapshots/checkpoints |
| 99 | +| Verified Merkle-tree structure, once cryptographic hashing is no longer a placeholder. |
| 100 | + |
| 101 | +| Repair / rollback evidence |
| 102 | +| Linear repair operations and proof witnesses. |
| 103 | + |
| 104 | +| Cross-tool trust boundary |
| 105 | +| Receipts that can be consumed by humans, CI, or future Echidna-style validators. |
| 106 | +|=== |
| 107 | + |
| 108 | +Ochrance has its own limitations. Current docs note placeholder XOR hashes, incomplete cryptographic attestation, and ongoing linear-repair work. Therefore Valence Shell must not imply that Ochrance already closes all production trust gaps. |
| 109 | + |
| 110 | +== Three-layer architecture |
| 111 | + |
| 112 | +[source,text] |
| 113 | +---- |
| 114 | +Layer 1: Valence Shell |
| 115 | + Executes commands; tracks operation history; exposes explain/checkpoint/diff/replay; |
| 116 | + proves reversible-operation properties in the project proof stack. |
| 117 | +
|
| 118 | +Layer 2: Echo Types |
| 119 | + Interprets operations as maps with fibres/residues; classifies what is |
| 120 | + recoverable, constrained, observationally equivalent, or genuinely lost. |
| 121 | +
|
| 122 | +Layer 3: Ochrance |
| 123 | + Emits/checks receipts: A2ML manifests, Merkle-backed state commitments, repair |
| 124 | + witnesses, and future attestation evidence. |
| 125 | +---- |
| 126 | + |
| 127 | +The key rule is separation of concerns: |
| 128 | + |
| 129 | +* Valence Shell should not absorb Echo Types as shell implementation machinery. |
| 130 | +* Echo Types should not become a dumping ground for shell-specific engineering. |
| 131 | +* Ochrance should not be used as a magic proof oracle; it is an evidence and verification framework with its own trust boundaries. |
| 132 | + |
| 133 | +== Claude / LLM instructions |
| 134 | + |
| 135 | +When working in Valence Shell, Claude and similar agents must observe these rules. |
| 136 | + |
| 137 | +=== Required framing |
| 138 | + |
| 139 | +* Treat this document and `.machine_readable/ECHO_TYPES_OCHRANCE_BRIDGE.a2ml` as the bridge entry points. |
| 140 | +* Say "bridge", "semantic framing", or "architecture dependency" unless a real code/proof dependency has been added. |
| 141 | +* Keep RMR and RMO distinct: |
| 142 | + ** RMR: reversible under preconditions. |
| 143 | + ** RMO: irreversible/obliterative with audit residue, not undo. |
| 144 | +* Use Echo Types to name residues and loss modes, not to inflate the Valence Shell proof status. |
| 145 | +* Use Ochrance to name receipts and attestation surfaces, not to claim production cryptographic guarantees until those gaps are closed upstream. |
| 146 | + |
| 147 | +=== Forbidden moves |
| 148 | + |
| 149 | +* Do not claim Valence Shell is production-ready. |
| 150 | +* Do not claim the Lean-to-Rust correspondence is mechanised. |
| 151 | +* Do not claim RMO/GDPR support exists beyond stubs. |
| 152 | +* Do not claim Echo Types proves Valence Shell implementation correctness. |
| 153 | +* Do not claim Ochrance cryptographic integrity while its hash/attestation gaps remain open. |
| 154 | +* Do not merge exploratory Echo bridges into core claims without checking `docs/bridge-status.md` in echo-types. |
| 155 | + |
| 156 | +== Minimal future implementation shape |
| 157 | + |
| 158 | +A future mechanised bridge could define a typed event like: |
| 159 | + |
| 160 | +[source,text] |
| 161 | +---- |
| 162 | +ShellEvent := { |
| 163 | + pre_state_commitment, |
| 164 | + command, |
| 165 | + post_state_commitment, |
| 166 | + valence_proof_ref, |
| 167 | + echo_residue_class, |
| 168 | + ochrance_receipt_ref, |
| 169 | + trust_boundary |
| 170 | +} |
| 171 | +---- |
| 172 | + |
| 173 | +For now this is only a design shape. It becomes implementation work only after: |
| 174 | + |
| 175 | +. Valence Shell has a concrete machine-readable event/receipt format. |
| 176 | +. Ochrance has a compatible A2ML/Merkle/attestation object for that event. |
| 177 | +. Echo Types has a suitable stable classification target for the residue class. |
| 178 | +. The bridge is labelled honestly as exploratory, partial, or mechanised. |
| 179 | + |
| 180 | +== Bottom line |
| 181 | + |
| 182 | +Valence Shell should use Echo Types as its theory of accountable information loss and Ochrance as its evidence substrate. The immediate action is documentation and agent-orientation, not pretending that a mechanised three-repo theorem already exists. |
0 commit comments