|
| 1 | +<!-- |
| 2 | +SPDX-License-Identifier: MPL-2.0 |
| 3 | +SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk> |
| 4 | +--> |
| 5 | + |
| 6 | +# B7 audit correction — HP ecosystem backends are NOT corpus-only |
| 7 | + |
| 8 | +**Status**: Correction. |
| 9 | +**Origin**: The 2026-06-03 "what stops echidna from running proof work |
| 10 | +across the estate" punch list listed **B7** as: |
| 11 | + |
| 12 | +> _HP type-checker ecosystem (13 provers) corpus-only — KatagoriaVerifier, |
| 13 | +> Modal/Session/Choreographic/Epistemic/Refinement/Echo/Dependent/QTT/ |
| 14 | +> Effect-Row/Tropical/TypeLL backends missing. Rust adapters not |
| 15 | +> scaffolded in `src/rust/provers/`. Corpus contributes to vocab/training |
| 16 | +> only._ |
| 17 | +
|
| 18 | +That characterisation is incorrect. This memo replaces B7's "scaffold |
| 19 | +missing adapters" framing with what is actually missing. |
| 20 | + |
| 21 | +## What is actually in tree (verified 2026-06-03) |
| 22 | + |
| 23 | +### Unified `HPEcosystemBackend` |
| 24 | + |
| 25 | +`src/rust/provers/hp_ecosystem.rs:50-153` defines |
| 26 | +`HPEcosystemBackend`, a full `ProverBackend` implementation that: |
| 27 | + |
| 28 | +- Pattern-matches on `ProverKind` to select the upstream CLI |
| 29 | + (`typell`, `katagoria`, `tropical-type-check`) and discipline tag |
| 30 | + (`echo`, `session`, `qtt`, `effect-row`, ...) — see |
| 31 | + `hp_ecosystem.rs::upstream()` lines 63-126. |
| 32 | +- Implements `parse_file`, `parse_string`, `apply_tactic`, and |
| 33 | + `verify_proof` against the upstream binary — lines 156-330. |
| 34 | +- Injects a `#discipline:` header when the source lacks one (lines |
| 35 | + 196-205), so estate consumers don't need to know the wire format. |
| 36 | + |
| 37 | +### Routing in `ProverFactory::create` |
| 38 | + |
| 39 | +`src/rust/provers/mod.rs:1774-1824` routes: |
| 40 | + |
| 41 | +| ProverKind | Backend | |
| 42 | +|-------------------------------------------------------|--------------------------------------------------| |
| 43 | +| `TypeLL`, `KatagoriaVerifier` | `hp_ecosystem::HPEcosystemBackend` | |
| 44 | +| 39 other `*TypeChecker` variants incl. `EchoTypeChecker`, `TropicalTypeChecker` | `typed_wasm::TypedWasmBackend::for_kind` | |
| 45 | + |
| 46 | +Both routes exist on `main`. None of the 41 enum variants falls |
| 47 | +through to "unsupported". |
| 48 | + |
| 49 | +### Test infrastructure |
| 50 | + |
| 51 | +`tests/common/mod.rs:114`, `:185`, `:245` already special-case |
| 52 | +`k.is_hp_ecosystem()` for executable / args / default-binary resolution |
| 53 | +in the prover-smoke harness. `tests/gnn_augment_integration.rs:545` |
| 54 | +covers `test_hp_ecosystem_gnn_wires_top_premise`. |
| 55 | + |
| 56 | +## What is genuinely outstanding for these backends |
| 57 | + |
| 58 | +The audit's underlying intuition (estate proof work won't run end-to-end |
| 59 | +on these provers) is correct — but the gap is downstream of the |
| 60 | +scaffold, not the scaffold itself: |
| 61 | + |
| 62 | +1. **Upstream binaries are not packaged.** `typell`, `katagoria`, and |
| 63 | + `tropical-type-check` are referenced from `hp_ecosystem.rs::upstream()` |
| 64 | + but none of them ship in any of echidna's Containerfiles or the |
| 65 | + Guix manifest. `manifests/live-provers.scm` covers Z3, CVC5, Lean4, |
| 66 | + Coq, Agda, Isabelle, Idris2, F*, Dafny, TLAPS — the HP triad is |
| 67 | + absent. A live CI run can compile and dispatch but the subprocess |
| 68 | + exits with "binary not found". |
| 69 | + |
| 70 | +2. **No smoke fixture for the three named provers.** `tests/chapel_fixtures/` |
| 71 | + has `coq_trivial.v` and `lean_trivial.lean`; there is no equivalent |
| 72 | + `echo_trivial.tll`, `tropical_trivial.tll`, or `katagoria_trivial.k`. |
| 73 | + This PR adds the minimum three. |
| 74 | + |
| 75 | +3. **No discoverability for "how do I add a new HP discipline."** |
| 76 | + Adding a discipline today means editing the 39-arm match in |
| 77 | + `hp_ecosystem.rs::upstream()`, the 41-arm match in |
| 78 | + `ProverFactory::create`, and matching arms in `is_hp_ecosystem()` |
| 79 | + and `default_executable()`. There is no documented onboarding flow. |
| 80 | + |
| 81 | +## What this PR delivers |
| 82 | + |
| 83 | +- This correction memo (`docs/handover/B7-AUDIT-CORRECTION.md`). |
| 84 | +- Three smoke fixtures (`tests/fixtures/hp/`): |
| 85 | + - `echo_trivial.tll` — discipline `echo`, single identity goal. |
| 86 | + - `tropical_trivial.tll` — discipline `tropical`, resource-aware identity. |
| 87 | + - `katagoria_trivial.k` — discipline `verify`, single isomorphism. |
| 88 | +- A short onboarding doc (`docs/HP-BACKEND-ONBOARDING.md`) listing the |
| 89 | + ~4 files an author must touch to add a new HP discipline, with line |
| 90 | + references. |
| 91 | + |
| 92 | +What it does **not** deliver: |
| 93 | + |
| 94 | +- The upstream `typell` / `katagoria` / `tropical-type-check` binaries |
| 95 | + (those live in `developer-ecosystem/katagoria`, |
| 96 | + `verification-ecosystem/tropical-resource-typing`, and |
| 97 | + `verification-ecosystem/typell` and are owner-managed). |
| 98 | +- A live CI run gate (that needs the binaries packaged first; see |
| 99 | + the L3 path checklist in the D18 PR). |
| 100 | +- Per-discipline GNN training data extraction (TypeDiscipline Phase-2 |
| 101 | + deferred — audit item F26). |
| 102 | + |
| 103 | +## Cross-references |
| 104 | + |
| 105 | +- `docs/handover/TODO.md` P4 — Wave-4 + HP ecosystem expansion (now |
| 106 | + partially superseded for the HP rows). |
| 107 | +- `docs/PROVER_COUNT.md` Tier-8 — canonical 41-variant inventory. |
| 108 | +- C12 PR (echidnabot manifest) — per-repo opt-in shape that consumers |
| 109 | + using these backends will adopt. |
| 110 | +- D18 PR (L3 gate checklist) — packaging the upstream binaries is one |
| 111 | + of the L3 → L1 hand-off criteria. |
0 commit comments