|
| 1 | +<!-- SPDX-License-Identifier: PMPL-1.0-or-later --> |
| 2 | +<!-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> --> |
| 3 | + |
| 4 | +# ECHIDNA Roadmap |
| 5 | + |
| 6 | +**Status**: canonical • supersedes the aspirational parts of |
| 7 | +[`FUTURE_DEVELOPMENT_ROADMAP.md`](./FUTURE_DEVELOPMENT_ROADMAP.md). |
| 8 | +**Last revised**: 2026‑04‑20 |
| 9 | +**Scope**: the shortest honest path from today's repo to the endpoint vision. |
| 10 | + |
| 11 | +This document is the single source of truth for where ECHIDNA is going. |
| 12 | +The domain‑specific plans under [`handover/`](./handover/) and |
| 13 | +[`design/SPARK_ADOPTION_PLAN.md`](./design/SPARK_ADOPTION_PLAN.md) are |
| 14 | +still authoritative for their sub‑areas; they fit *inside* this |
| 15 | +roadmap as implementations of individual stages. |
| 16 | + |
| 17 | +## 1. Endpoint |
| 18 | + |
| 19 | +ECHIDNA, when complete, is the **reasoning substrate of the |
| 20 | +hyperpolymath ecosystem** — not just a proof tool. It is: |
| 21 | + |
| 22 | +* a unified interface to every mature theorem prover, SMT solver, |
| 23 | + model checker, and type checker in public use; |
| 24 | +* an ML layer (GNN + Transformer over Flux.jl) that actually learns |
| 25 | + premise selection, tactic synthesis, and strategy routing well |
| 26 | + enough to beat hand‑curated choices on held‑out theorems; |
| 27 | +* a persistent E‑R layer (Verisim) that stores every proof, tactic |
| 28 | + application, and version as a content‑addressed row and closes a |
| 29 | + real learning loop over historical outcomes; |
| 30 | +* a parallel dispatch layer (Chapel) that runs portfolio solves |
| 31 | + across CPU cores and dispatches specialised work to coprocessors |
| 32 | + (GPU / tensor / vector / FPGA / QPU); |
| 33 | +* a high‑speed IPC fabric (Cap'n Proto) between the Rust core and |
| 34 | + the Julia ML sidecar and between the backend and the frontend; |
| 35 | +* a frontend in AffineScript + Deno (TEA architecture) with i18n via |
| 36 | + the LOL locale repo; |
| 37 | +* a 16‑endpoint Zig ABI that external consumers (Coursera labs, |
| 38 | + other projects) link against, with an SPDX‑pinned, Guix‑built, |
| 39 | + Chainguard‑based container managed by Stapeln and hardened by the |
| 40 | + Vordr / Selur / Svalinn / Cerro‑Torre surround; |
| 41 | +* itself formally verified — the trust kernel's critical invariants |
| 42 | + are proved in SPARK and in Idris2 / Agda. |
| 43 | + |
| 44 | +From a user's seat: **indistinguishable from magic for easy |
| 45 | +obligations, honest about ambiguity for hard ones, never silently |
| 46 | +wrong.** |
| 47 | + |
| 48 | +## 2. Stage map |
| 49 | + |
| 50 | +``` |
| 51 | +Stage 1 Train the model at all ML layer can receive signal |
| 52 | + 1a extractors emit premises [done 2026‑04‑20, 22 of 50 ✓] |
| 53 | + 1b align_premises joins correctly [done 2026‑04‑19 ✓] |
| 54 | + 1c residual extractor gaps fixed [in progress, 28 to go] |
| 55 | + 1d vocab covers the surface [255 K; target ~1 M] |
| 56 | +
|
| 57 | +Stage 2 Signal becomes useful MRR moves off 0.66 baseline |
| 58 | + 2a run training at scale hardware task |
| 59 | + 2b online vocab growth new feature |
| 60 | + 2c re‑baseline and publish metrics run gate |
| 61 | +
|
| 62 | +Stage 3 Learning loop closes model improves from outcomes |
| 63 | + 3a Verisim read paths cross‑prover queries by goal_hash |
| 64 | + 3b hypatia strategy loop wired `mv_prover_success_by_class` reads |
| 65 | + 3c Proof / TacticApplication / ProofVersion emission wired |
| 66 | + [defined 2026‑04‑19 ✓, emission pending] |
| 67 | +
|
| 68 | +Stage 4 Interaction layer honest every declared ProverKind works |
| 69 | + 4a typed_wasm → crates/typed_wasm extract to standalone crate |
| 70 | + 4b 40 TypeChecker variant dispatch Sigma‑route via the crate |
| 71 | + 4c tactic synthesis template 37 suggest_tactics stubs replaced |
| 72 | + 4d search_theorems template 49 stubs replaced, query Verisim |
| 73 | +
|
| 74 | +Stage 5 Distributed & fast scale + specialised hardware |
| 75 | + 5a Cap'n Proto IPC Rust ↔ Julia, :8090 |
| 76 | + 5b Chapel full integration dispatch.rs picks by config |
| 77 | + 5c coprocessor abstraction trait + tensor/vector/QPU/FPGA |
| 78 | + 5d Tier‑4 live‑CI provisioning 19 backends, Containerfile path |
| 79 | +
|
| 80 | +Stage 6 Cross‑prover semantics translation actually works |
| 81 | + 6a OpenTheory bridge real bidirectional term translation |
| 82 | + 6b Dedukti bridge real λΠ modulo as lingua franca |
| 83 | + 6c mathematical identity arbitration canonicalise across representations |
| 84 | + 6d Coursera delivery Zig ABI exposes capability |
| 85 | +
|
| 86 | +Stage 7 Sovereign tooling surround the rest of the ecosystem |
| 87 | + 7a Stapeln container lifecycle |
| 88 | + 7b Vordr entry gate |
| 89 | + 7c Selur scheduler |
| 90 | + 7d Svalinn trust boundary |
| 91 | + 7e Cerro‑Torre observability |
| 92 | + 7f AffineScript‑TEA frontend src/rescript/, ≥33 modules |
| 93 | + 7g LOL i18n locale/ + t!() macro |
| 94 | + 7h Zig ABI 16‑endpoint surface src/zig/echidna_abi.zig |
| 95 | +
|
| 96 | +Stage 8 Self‑verified ECHIDNA proves ECHIDNA |
| 97 | + 8a Idris2 meta‑proofs extend from 32 modules to full kernel |
| 98 | + 8b Agda meta‑proofs extend from 12 modules |
| 99 | + 8c SPARK‑verified trust kernel crates/echidna-core-spark/ |
| 100 | + 8d panic‑attack hardened proptest + AFL++ nightly |
| 101 | +``` |
| 102 | + |
| 103 | +## 3. Endpoint target — row by row |
| 104 | + |
| 105 | +| Claim | Today | End‑state target | |
| 106 | +|---|---|---| |
| 107 | +| "Every important solver" | 59 backends; 37 `suggest_tactics` stubs; 49 `search_theorems` stubs | **65 backends, every one with real `suggest_tactics` (GNN‑ranked top‑k) and `search_theorems` (queries Verisim by `goal_hash`) — no `Ok(vec![])` returns anywhere** | |
| 108 | +| "Vocab at 2.5 M" | 255 K | **~1 M canonical tokens** after Mathport + Iris + VST + Flyspeck + HoTT absorption, with **online growth** adding tokens during training | |
| 109 | +| "Chapel fully supported" | 2 files, POC only | **`dispatch.rs` picks Chapel‑parallel dispatch by config**; runtime init + cancellation + error propagation wired; ≥1 OoM speedup on portfolio solves | |
| 110 | +| "Cap'n Proto serialisation" | 0 `.capnp` files | **`crates/echidna-wire/`** contains schemas for ProofState / Goal / Tactic / EmbeddingRequest / RankingResponse; IPC on :8090 is Cap'n Proto; JSON retained only as debug fallback | |
| 111 | +| "Vordr / Selur / Svalinn / Cerro‑Torre / Stapeln" | Not present | Each named as a versioned dependency in Cargo.toml or the container definition, wired into its role | |
| 112 | +| "AffineScript‑TEA frontend" | Not present (10 `.res` files stub) | **`src/rescript/`** holds ≥33 AffineScript‑TEA modules, persistent Model → Msg → Update loop, talks to core over Cap'n Proto WebSocket | |
| 113 | +| "LOL i18n" | Not present | **`locale/`** with LOL‑sourced translations; `t!()` macro for every user‑facing string | |
| 114 | +| "Rust/SPARK base stable" | Rust only | **`crates/echidna-core-spark/`** holds the Ada/SPARK‑verified kernel (axiom scanning, trust‑level computation); proved free of runtime errors; called from Rust via C ABI | |
| 115 | +| "16‑endpoint Zig ABI" | 4 shared libs, endpoint count unverified | **`src/zig/echidna_abi.zig`** exports exactly 16 functions (`echidna_prove`, `echidna_apply_tactic`, `echidna_rank_premises`, `echidna_verify_certificate`, `echidna_post_octad`, `echidna_query_identity`, …) with a versioned header | |
| 116 | +| "100 K+ per prover" | Uneven; long tail <20 K | **Top 15 provers ≥ 100 K records each**; next 20 ≥ 25 K each; bottom 10 synthetically augmented to ≥ 10 K; `stats_UNIFIED.json` reports the distribution publicly | |
| 117 | +| "Panic‑attacked" | No fuzz infra | **`benches/panic_attack/`** with proptest + AFL++ harnesses covering every parser, FFI boundary, IPC schema; nightly CI ≥ 1 h; zero known panic paths | |
| 118 | +| "Prover count" | 59 real, 105 declared | **`ProverKind` = 65 variants, every one factory‑dispatched**; CLAUDE.md states the canonical count; no orphans | |
| 119 | + |
| 120 | +## 4. Current sprint — "the smallest set that flips half the table" |
| 121 | + |
| 122 | +Five concrete commitments. Landed together inside ~6 weeks they move |
| 123 | +"Every important solver", "Vocab", "Prover count", half of "100 K+", |
| 124 | +and start the self‑learning loop closure. |
| 125 | + |
| 126 | +| # | Stage | Commitment | Agent tier | |
| 127 | +|---|---|---|---| |
| 128 | +| S1 | 1c | Finish the extractor premise‑emission wave (22 done; 28 remaining) | **Sonnet** (in flight) | |
| 129 | +| S2 | 2a / 2c | Run training on the fixed corpus; record new MRR; commit `metrics_baseline.jsonl` | **Hardware / you** | |
| 130 | +| S3 | 4a / 4b | Extract `typed_wasm` to `crates/typed_wasm/`; route 40 TypeChecker variants through Sigma parameters | **Opus‑design + Sonnet‑impl** | |
| 131 | +| S4 | 3a / 3b | Wire Verisim cross‑prover read paths (`goal_hash` queries + `mv_prover_success_by_class` + hypatia loop) | **Opus‑design + Sonnet‑impl** | |
| 132 | +| S5 | 4c / 4d (pilot) | Tactic synthesis template for 5 high‑value provers (coq, lean, agda, isabelle, z3) using the GNN | **Opus‑design + Sonnet‑impl** | |
| 133 | + |
| 134 | +After S1–S5 land, the roadmap's next sprint takes up Stage 5 (IPC + |
| 135 | +Chapel + Tier‑4 CI) and Stage 8 begins in parallel. |
| 136 | + |
| 137 | +## 5. Agent‑tier guidance |
| 138 | + |
| 139 | +**Opus** (supervisor): architecture, schema design, cross‑module |
| 140 | +contracts, merge review. Touches: IPC protocol design, Verisim |
| 141 | +schema additions, Chapel FFI shape, coprocessor trait, SPARK kernel |
| 142 | +surface. |
| 143 | + |
| 144 | +**Sonnet** (executor): focused implementation against a clear spec, |
| 145 | +3–20 files, moderate complexity. Touches: per‑prover tactic |
| 146 | +synthesis, Verisim read client, typed_wasm crate extraction, |
| 147 | +adapter code, worker logic. |
| 148 | + |
| 149 | +**Haiku** (bulk): template‑driven mechanical edits, CI YAML, |
| 150 | +deletes, repetitive stubs. Touches: Tier‑4 provisioning shell |
| 151 | +commands, extractor boilerplate, per‑prover factory branches that |
| 152 | +follow a mould, localisation key additions. |
| 153 | + |
| 154 | +## 6. Inheritance from existing planning docs |
| 155 | + |
| 156 | +* **[`docs/FUTURE_DEVELOPMENT_ROADMAP.md`](FUTURE_DEVELOPMENT_ROADMAP.md)** |
| 157 | + — 2026‑01‑29 vision document. Its chapters on RL for tactic |
| 158 | + search (§1.1), active learning (§1.2), and distributed dispatch |
| 159 | + map onto Stages 3c / 4c and 5b/5c of this roadmap. Retain as |
| 160 | + background reading; this document is the source of truth for |
| 161 | + sequencing. |
| 162 | +* **[`docs/handover/PRODUCTION-WIRING-PLAN.md`](handover/PRODUCTION-WIRING-PLAN.md)** |
| 163 | + — L1/L2/L3 sprint doc. L1 = Stage 5a. L2 = Stage 5b. L3 Wave‑1/2 |
| 164 | + are complete (in Stage 4 surface); Wave‑3 is partially complete in |
| 165 | + this branch (tamarin/proverif/metamath/twelf/ortools); Wave‑4 is |
| 166 | + Stage 5d. |
| 167 | +* **[`docs/design/SPARK_ADOPTION_PLAN.md`](design/SPARK_ADOPTION_PLAN.md)** |
| 168 | + — design for the SPARK‑verified kernel. Executes Stage 8c. |
| 169 | +* **[`docs/handover/L1-CAPNPROTO-PROMPT.md`](handover/L1-CAPNPROTO-PROMPT.md)** |
| 170 | + — implementation brief for Stage 5a. Use as the Sonnet prompt |
| 171 | + when S6 begins. |
| 172 | +* **[`docs/handover/L2-CHAPEL-PROMPT.md`](handover/L2-CHAPEL-PROMPT.md)** |
| 173 | + — implementation brief for Stage 5b. |
| 174 | +* **[`docs/handover/L3-LIVE-PROVER-CI-PROMPT.md`](handover/L3-LIVE-PROVER-CI-PROMPT.md)** |
| 175 | + — implementation brief for Stage 5d. |
| 176 | +* **[`docs/handover/STATE.md`](handover/STATE.md)** and |
| 177 | + **[`.machine_readable/6a2/STATE.a2ml`](../.machine_readable/6a2/STATE.a2ml)** |
| 178 | + — running log of session‑by‑session progress. Continue to use as |
| 179 | + running state; sync highlights to §2 of this document at each |
| 180 | + sprint boundary. |
| 181 | + |
| 182 | +## 7. How to update this roadmap |
| 183 | + |
| 184 | +* When a stage sub‑item lands, mark its line `[done YYYY‑MM‑DD ✓]` |
| 185 | + in §2 and update the corresponding row of §3. |
| 186 | +* When a new endpoint target emerges, add a row to §3, extend §2's |
| 187 | + stage map if it doesn't already fit, and add it to the sprint |
| 188 | + plan in §4 only once it's next‑up. |
| 189 | +* Don't remove rows from §3 when they land — keep the history |
| 190 | + visible, the "Today" column becomes "Done" and the "End‑state" |
| 191 | + column stays as the invariant. |
| 192 | +* Record non‑trivial decisions in this doc, not in chat. |
0 commit comments