You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(abi): type-check all 17 Idris2 proofs under 0.8.0 (#189)
## Summary
Against the pinned toolchain (**Idris2 0.8.0**, Chez backend), **6 of
the 17** core ABI proof modules did **not** type-check — yet all were
marked "✅ Complete". They rotted undetected because the build never
exercised them:
- `just typecheck` used an invalid invocation (`idris2 --check --package
boj boj.ipkg` → *"Can't find package boj"*); the correct form is
`--typecheck boj.ipkg`.
- `CartridgeDispatch` and `APIContractCoverage` were **absent from
`boj.ipkg`**, so the package build skipped them entirely.
After this PR, `cd src/abi && idris2 --typecheck boj.ipkg` builds **all
17 modules clean**. Theorem statements and the axiom budget are
unchanged — the fixes are in the proofs' *construction*.
## Proof fixes (all constructive, zero new axioms)
| Module | Root cause | Fix |
|---|---|---|
| `CartridgeDispatch` | bare-pipe `with` syntax 0.8.0 rejects;
`refusedIfNoMatch` needed a reducible `dispatch`; `absurd` lacked
`Uninhabited` instances | full-LHS `with`; `dispatch` via reducible
`dispatchOn` helper; conjunction + `statusEqSoundReady` + 3
`Uninhabited` lemmas |
| `SafePromptInjection` | `with`-abstraction rewrites goal to `True =
True` | `Right Refl` |
| `SafeCORS` | same `with` issue; undefined `fromLteTrue` | `(Refl,
Refl)`; `fromLteTrue` → `lteReflectsLTE` |
| `SafeHTTP` | missing `Data.List.Elem`/`Data.Maybe`; `IsJust`→`isJust`;
`all`→`allRec`; erased implicits; `let x : a = b` mis-parse | imports,
name fixes, explicit `{xs,ys}`, parenthesised annotations |
| `SafeWebSocket` | **elaborator OOM** — 16 MiB `maxFrameSize` baked
into a constructor `LTE` index forced a unary `Nat` |
bound-parameterised `FrameSizeSafeUpTo`;
`FrameSizeSafe`/`ControlFrameSizeSafe` become synonyms |
| `APIContractCoverage` | `representativeCatalogue` auto-bound as a
fresh implicit (shadowed the global) | fully qualified |
| `SafetyLemmas` | `allTake` referenced but undefined | added the
constructive lemma (no new axiom) |
## Plumbing & docs
- `boj.ipkg`: added `Boj.CartridgeDispatch` + `Boj.APIContractCoverage`.
- `Justfile`: `typecheck` now uses `--typecheck`; `verify-no-believe-me`
reconciled to the **sanctioned 5-axiom** trusted base (it previously
enforced *zero*, contradicting `PROOF-NEEDS.md`), and fails on any other
`believe_me` or on axiom-count drift.
- `PROOF-NEEDS.md` / `verification/proofs/README.adoc`:
build-verification notes.
## Trusted base unchanged
`believe_me` count = **5**, all in `SafetyLemmas.idr`, all `%unsafe`
class-(J) axioms (opaque `Char`/`String` primitives). No `assert_total`
/ `assert_smaller` / new `%unsafe` anywhere.
## Roadmap (this branch, follow-up commits)
- [x] Core `boj` ABI package green under 0.8.0
- [ ] Cartridge ABIs — common components
(fleet/nesy/database/agent/feedback + shared protocol/safety patterns)
- [ ] Remaining cartridge-specific proofs (~100 `.idr` files)
Draft until the cartridge ABIs are also green.
https://claude.ai/code/session_019tMcRS1Dm1nWjjYP4WvbJa
---
_Generated by [Claude
Code](https://claude.ai/code/session_019tMcRS1Dm1nWjjYP4WvbJa)_
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments