Skip to content

Commit 192a25a

Browse files
docs(handover): correct B7 audit claim + add HP smoke fixtures + onboarding (closes B7) (#218)
## Summary This PR **corrects a factual error** in the 2026-06-03 _"what stops echidna from running proof work across the estate"_ audit. The B7 entry said: > _HP type-checker ecosystem (13 provers) corpus-only — Rust adapters not scaffolded in `src/rust/provers/`._ That is wrong. The backends exist and are wired: | File | Lines | What's there | |---|---|---| | `src/rust/provers/hp_ecosystem.rs` | 50-153 | `HPEcosystemBackend`: full `ProverBackend` impl, parse_file / parse_string / apply_tactic / verify_proof | | `src/rust/provers/mod.rs` | 1774-1824 | `ProverFactory::create` routes TypeLL + KatagoriaVerifier through `HPEcosystemBackend`, 39 other `*TypeChecker` variants through `TypedWasmBackend::for_kind` | | `tests/common/mod.rs` | 114, 185, 245 | HP-ecosystem dispatch already special-cased in the smoke harness | | `tests/gnn_augment_integration.rs` | 545 | `test_hp_ecosystem_gnn_wires_top_premise` covers GNN wiring | ## What's actually outstanding The audit's underlying intuition (estate proof work won't run end-to-end on these provers) is correct, but the gap is downstream of the scaffold: 1. **Upstream binaries are not packaged** — `typell`, `katagoria`, `tropical-type-check` aren't in any Containerfile or `manifests/live-provers.scm`. CI runs get "binary not found" rather than verify results. 2. **No smoke fixtures** for the three Tier-8-canonical provers (Echo, Tropical, Kategoria). _Added here._ 3. **No documented onboarding** for new HP disciplines, even though the pattern is mechanical (~4 files). _Added here._ ## What this PR delivers - `docs/handover/B7-AUDIT-CORRECTION.md` — correction memo with file:line evidence. - `tests/fixtures/hp/echo_trivial.tll` — discipline `echo`, identity goal. - `tests/fixtures/hp/tropical_trivial.tll` — discipline `tropical`, zero-cost identity. - `tests/fixtures/hp/katagoria_trivial.k` — discipline `verify`, identity isomorphism. - `docs/HP-BACKEND-ONBOARDING.md` — step-by-step for adding a new HP discipline, with line refs into the 4 files an author must touch. ## What this PR does NOT do - Does not add stub backends (they exist; stubbing would regress). - Does not package the upstream binaries (deferred to D18 / L3 gate path). - Does not extract per-discipline GNN training data (deferred — F26 TypeDiscipline Phase-2). ## Test plan - [x] Three smoke fixtures parse as valid `#discipline:`-tagged source. - [x] No code changes (docs + fixtures only), so no compile/test regression possible. - [ ] Owner reviews the correction and confirms B7 is now correctly characterised. ## Estate context This PR is **#4 of 5** in the C12/C14/C15/B7/D18 critical-blocker pass. - C12 PR (echidnabot manifest): hyperpolymath/echidnabot#84 - C14 PR (cross-repo proof DAG design): #217 - C15 PR (gitbot-fleet hypatia wiring): hyperpolymath/gitbot-fleet#257 - D18 PR (L3 gate checklist): queued 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 32ae572 commit 192a25a

6 files changed

Lines changed: 602 additions & 0 deletions

File tree

docs/HP-BACKEND-ONBOARDING.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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+
# Onboarding a new HP type-discipline backend
7+
8+
This is the working checklist for adding a new HP-ecosystem type
9+
discipline to echidna. The 41 existing variants (TypeLL,
10+
KatagoriaVerifier, TropicalTypeChecker, EchoTypeChecker, ...) all
11+
followed this same pattern.
12+
13+
For background on what already exists, see
14+
`docs/handover/B7-AUDIT-CORRECTION.md`.
15+
16+
## Where the wiring lives
17+
18+
Adding a new discipline `Foo` (i.e. `ProverKind::FooTypeChecker`)
19+
touches exactly four files:
20+
21+
| File | What to add |
22+
|-------------------------------------------------|-------------------------------------------------------------------|
23+
| `src/rust/provers/mod.rs` | Enum variant + parser arm + is_hp_ecosystem + default_executable |
24+
| `src/rust/provers/hp_ecosystem.rs::upstream()` | One match arm: `Foo => ("typell", "foo")` |
25+
| `src/rust/provers/typed_wasm.rs::type_info_for` | `TypeInfo` selector for the discipline (the typed_wasm route) |
26+
| `tests/fixtures/hp/foo_trivial.tll` | One smoke fixture exercising the new wire |
27+
28+
If the discipline ships its own CLI (i.e. not `typell --discipline=foo`
29+
but a standalone binary), it routes through `HPEcosystemBackend` and
30+
the `upstream()` arm returns `("foo-cli", "foo")`. If it lives under
31+
`typell`, it routes through `TypedWasmBackend` via the discipline
32+
parameter.
33+
34+
The deciding question: **does the upstream maintainer ship a separate
35+
binary?** Examples:
36+
37+
- `KatagoriaVerifier` → standalone `katagoria` binary → `HPEcosystemBackend`.
38+
- `TropicalTypeChecker` → standalone `tropical-type-check` binary → either path (currently `TypedWasmBackend`).
39+
- `EchoTypeChecker` → bundled under `typell``TypedWasmBackend`.
40+
41+
## Step-by-step
42+
43+
### 1. Add the enum variant
44+
45+
`src/rust/provers/mod.rs`, in the `ProverKind` enum (around line 294):
46+
47+
```rust
48+
pub enum ProverKind {
49+
// ...
50+
FooTypeChecker,
51+
// ...
52+
}
53+
```
54+
55+
### 2. Parser arm
56+
57+
Same file, around line 567 (the string-to-ProverKind parser):
58+
59+
```rust
60+
"footypechecker" | "foo" => Ok(ProverKind::FooTypeChecker),
61+
```
62+
63+
### 3. `is_hp_ecosystem` arm
64+
65+
Same file, around line 434:
66+
67+
```rust
68+
pub fn is_hp_ecosystem(&self) -> bool {
69+
matches!(self,
70+
// ...
71+
| ProverKind::FooTypeChecker
72+
)
73+
}
74+
```
75+
76+
### 4. `default_executable` arm
77+
78+
Same file, around line 1360. Either:
79+
80+
```rust
81+
ProverKind::FooTypeChecker => "typell", // bundled
82+
// or
83+
ProverKind::FooTypeChecker => "foo-cli", // standalone
84+
```
85+
86+
### 5. Factory routing arm
87+
88+
Same file, `ProverFactory::create` (around line 1822). Add to the
89+
appropriate match arm:
90+
91+
- Standalone binary: add to the `HPEcosystemBackend` arm at line
92+
1776-1778.
93+
- Bundled discipline: add to the `TypedWasmBackend` arm at lines
94+
1784-1822.
95+
96+
### 6. (Bundled discipline only) `upstream()` arm
97+
98+
`src/rust/provers/hp_ecosystem.rs`, the `upstream()` match around
99+
line 63:
100+
101+
```rust
102+
ProverKind::FooTypeChecker => ("typell", "foo"),
103+
```
104+
105+
### 7. `TypeInfo` selector
106+
107+
`src/rust/provers/typed_wasm.rs::type_info_for` — return the discipline's
108+
parametric `TypeInfo` so the unified verifier knows what to check.
109+
110+
### 8. Smoke fixture
111+
112+
`tests/fixtures/hp/foo_trivial.tll`:
113+
114+
```
115+
# SPDX-License-Identifier: MPL-2.0
116+
#discipline: foo
117+
118+
theorem foo_identity : ... .
119+
Proof.
120+
foo_refl.
121+
Qed.
122+
```
123+
124+
### 9. Run the smoke
125+
126+
`tests/gnn_augment_integration.rs::test_hp_ecosystem_gnn_wires_top_premise`
127+
already loops over `is_hp_ecosystem()` kinds, so the new variant gets
128+
GNN-wiring coverage for free. A direct backend smoke takes one more
129+
line in `tests/common/mod.rs` if you want it.
130+
131+
## What you DON'T need to touch
132+
133+
- **Confidence levels** — the trust bridge reads
134+
`is_hp_ecosystem()` once; no per-discipline tuning.
135+
- **Corpus extractors** — the HP corpus is built by
136+
`crates/typed_wasm` and indexed by Sigma parameters; new disciplines
137+
inherit the existing pipeline.
138+
- **Result formatter**`result_formatter.rs` reads `ProverKind`
139+
via Display; the variant name is the user-facing label.
140+
141+
## When the upstream binary doesn't ship
142+
143+
For early-development disciplines where the upstream tool isn't yet
144+
buildable (e.g. an unreleased Wokelang variant), the backend will
145+
return a "binary not found" runtime error. That is the right
146+
behaviour — echidna's trust bridge surfaces it as
147+
`ProverOutcome::Unsupported` and the caller sees a clear signal.
148+
149+
Do **not** stub the backend to return spurious success. Estate
150+
consumers (per the C12 per-repo manifest) configure `[provers]
151+
disabled = ["foo"]` to opt out cleanly.

0 commit comments

Comments
 (0)