Skip to content

Commit d2bd75f

Browse files
fix(idris2): make the dyadic parse front-end actually compile + gate it in CI (#340)
## What A ground-truth verification sweep ("everything claimed done must be checked with the actual provers/toolchains") found the `idris2/` dyadic parse front-end had **never been compiled**: - all 14 `idris2/src/**.idr` files carried a `// Owner:` header — Zig/C comment syntax, an Idris2 **syntax error** (owner-header hook used the wrong comment leader); - `Tests.idr` had five further never-elaborated defects underneath: an escaped `\\t =>` lambda, a `Nat`/`Int` mismatch at `newBuf`, a missing `import Ephapax.Parse.Util` (source of `ParseError`), definition-before-use ordering (`parseWithBuf`/tests after `runTests`), un-exported `runTests` (which `TestMain` imports), `mapM_` (not Idris2 Prelude), and `%default total` over a `covering` parser; - **no CI workflow builds `idris2/*.ipkg` or `src/formal/*.ipkg`**, so nothing ever caught any of this. ## Changes - Fix headers to `--` in all 14 files; repair `Tests.idr`/`TestMain.idr`. - `abi-verify.yml`: add `idris2-formal` + `idris2-parse-front` build gates (compile-time; the runtime FFI path is covered by `ffi-seams.yml`'s zig tests + documented local run). - Bump idris2 pin 0.7.0 → 0.8.0 (`.tool-versions`, `scripts/install-idris2.sh`) — 0.8.0 is what everything verifiably builds with. - `TEST-NEEDS.md`: record the parse-tests suite as compile+run verified, and `ephapax-affine.ipkg` as still un-gated (external `proven` dependency). ## Verification (all local, 2026-07-07) | Oracle | Result | |---|---| | `idris2 --build ephapax-abi.ipkg` (0.8.0) | 3/3 modules ✅ | | `idris2 --build ephapax-formal.ipkg` | 3/3 modules ✅ | | `idris2 --build ephapax-parse-tests.ipkg` | 8/8 modules + executable ✅ | | Run `ephapax-parse-tests` against zig-built `libephapax_tokbuf.so` (`-lc`) | `parse-tests: ok`, exit 0 ✅ | | `zig test` tokbuf seams + coproc | 12/12 ✅ | | Fresh `coqc` 8.18.0 rebuild of `formal/` | exit 0; `Print Assumptions` closed except the documented `preservation_l1` Admitted ✅ | | `cargo test --workspace` | exit 0 ✅ | | `just validate-wasm` (wasm-tools 1.252.0) | all modules structurally valid ✅ | 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 632910b commit d2bd75f

18 files changed

Lines changed: 99 additions & 43 deletions

File tree

.github/workflows/abi-verify.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ on:
2121
pull_request:
2222
paths:
2323
- 'src/abi/**'
24+
- 'src/formal/**'
25+
- 'idris2/**'
2426
- '.github/workflows/abi-verify.yml'
2527
push:
2628
branches: [main]
2729
paths:
2830
- 'src/abi/**'
31+
- 'src/formal/**'
32+
- 'idris2/**'
2933

3034
permissions:
3135
contents: read
@@ -56,3 +60,45 @@ jobs:
5660
# well-typed and do NOT fail the build — they are tracked in
5761
# PROOF-NEEDS.md, not hidden.
5862
idris2 --build ephapax-abi.ipkg
63+
64+
idris2-formal:
65+
name: Idris2 formal seam (ephapax-formal.ipkg)
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 20
68+
container:
69+
image: snazzybucket/idris2:latest # estate-standard Idris2 image
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
73+
74+
- name: Build (typecheck) the formal package
75+
working-directory: src/formal
76+
run: |
77+
idris2 --version
78+
idris2 --build ephapax-formal.ipkg
79+
80+
idris2-parse-front:
81+
name: Idris2 parse front-end (ephapax-parse-tests.ipkg)
82+
runs-on: ubuntu-latest
83+
timeout-minutes: 20
84+
container:
85+
image: snazzybucket/idris2:latest # estate-standard Idris2 image
86+
steps:
87+
- name: Checkout repository
88+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
89+
90+
- name: Build the parse front-end + test executable
91+
working-directory: idris2
92+
run: |
93+
idris2 --version
94+
# Compile-time gate only: the %foreign C bindings in
95+
# Parse/ZigBuffer.idr resolve libephapax_tokbuf at RUNTIME
96+
# (Chez dlopen), so building the executable needs no zig.
97+
# Running it does — that path is exercised locally via
98+
# zig build-lib -dynamic -lc ffi/zig/tokbuf.zig \
99+
# -femit-bin=libephapax_tokbuf.so
100+
# LD_LIBRARY_PATH=. ./build/exec/ephapax-parse-tests
101+
# and the zig side is unit-gated by ffi-seams.yml.
102+
# (ephapax-affine.ipkg is NOT gated here: it depends on the
103+
# external `proven` package — see PROOF-NEEDS.md.)
104+
idris2 --build ephapax-parse-tests.ipkg

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ ocaml 5.4.1
88
# directly; coq is provisioned via apt (noble ships exactly 8.18.0), kept
99
# here only as the documented pin.
1010
coq 8.18.0
11-
idris2 0.7.0
11+
idris2 0.8.0
1212
zig 0.14.0

TEST-NEEDS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ reads from there.
6666
### Build & Execution
6767
- [x] cargo build — compiles
6868
- [x] cargo test --workspace --all-targets — 467 pass, 0 fail
69+
- [x] idris2/ephapax-parse-tests.ipkg — compiles AND runs green (2026-07-07,
70+
idris2 0.8.0 + zig-built libephapax_tokbuf.so); CI-gated compile-only by
71+
abi-verify.yml `idris2-parse-front` (runtime run stays local — the estate
72+
idris2 container has no zig)
73+
- [ ] idris2/ephapax-affine.ipkg — NOT CI-gated: depends on the external
74+
`proven` Idris2 package (hyperpolymath/proven), which the estate idris2
75+
image does not carry. Gate once proven is installable in CI (or vendored).
6976
- [ ] Compile and run all 98 .eph files — not automated
7077
- [ ] CLI --help works — not verified
7178
- [ ] Self-diagnostic — none

idris2/src/Ephapax/Affine/Emit.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- SPDX-License-Identifier: MPL-2.0
2-
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+
-- Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
44
--
55
module Ephapax.Affine.Emit

idris2/src/Ephapax/Affine/Typecheck.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- SPDX-License-Identifier: MPL-2.0
2-
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+
-- Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
44
--
55
module Ephapax.Affine.Typecheck

idris2/src/Ephapax/IR/AST.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- SPDX-License-Identifier: MPL-2.0
2-
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+
-- Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
44
--
55
module Ephapax.IR.AST

idris2/src/Ephapax/IR/Decode.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- SPDX-License-Identifier: MPL-2.0
2-
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+
-- Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
44
--
55
module Ephapax.IR.Decode

idris2/src/Ephapax/IR/SExpr.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- SPDX-License-Identifier: MPL-2.0
2-
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+
-- Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
44
--
55
module Ephapax.IR.SExpr

idris2/src/Ephapax/Parse/Lexer.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- SPDX-License-Identifier: MPL-2.0
2-
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+
-- Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
44
--
55
module Ephapax.Parse.Lexer

idris2/src/Ephapax/Parse/Parser.idr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- SPDX-License-Identifier: MPL-2.0
2-
// Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
2+
-- Owner: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
44
--
55
module Ephapax.Parse.Parser

0 commit comments

Comments
 (0)