Skip to content

Commit 9969ff0

Browse files
ci(proofs): gate the Idris2 verification corpus (verification/proofs/idris2) (#276)
## What Adds CI coverage for the **Idris2 trust-pipeline property proofs** under `verification/proofs/idris2/` (11 modules) — the last self-proof corpus with no gate. Follows #275 (which gated `verification/proofs/lean4`). - **New `echidna-verif-proofs.ipkg`** listing all 11 modules with `depends = base, echidnaabi`. - **New Justfile recipe `proofs-verif-idris`**: installs the `echidnaabi` package (`--install` builds it on the way), then `idris2 --typecheck echidna-verif-proofs.ipkg`. Added to the `proofs` roll-up. - **New `verif-idris` job** in `dogfood-proofs-ci.yml` (apt idris2 + source-bootstrap fallback, mirroring `idris2-abi-ci.yml`) + `verification/proofs/idris2/**` path triggers. ## Why an ipkg, not a per-file `idris2 --check` loop Two real problems surfaced while building this (caught by *running* it, not eyeballing): 1. **`idris2 --check` returns exit 0 even when a module fails to resolve an import.** Verified: a bare `idris2 --check DispatchCorrectness.idr` prints `Error: Module EchidnaABI.Types not found` but **exits 0** — a per-file loop would pass CI while broken. (Genuine *type* errors do exit 1; only module-resolution errors don't.) 2. **`DispatchCorrectness.idr` imports `EchidnaABI.Types`** — the `echidnaabi` package in `src/abi/`, unresolvable standalone. Building through the ipkg fixes both: `depends = echidnaabi` resolves the import, and the package build gives a reliable aggregate exit code. The recipe additionally fails on any `^Error` line as a belt-and-suspenders guard. ## Verification (run, not eyeballed) On **idris2 0.8.0**, from a clean state (`src/abi/build`, the installed `echidnaabi` package, and `verification/proofs/idris2/build` all removed first): - `just proofs-verif-idris` → type-checks all 11 modules (incl. DispatchCorrectness), **exit 0**. - **Negative test**: injecting `n = S n` proved by `Refl` into a module makes the ipkg typecheck **exit 1** — the gate actually gates. - Corpus is **axiom-clean**: no `believe_me` / `assert_total` / `postulate` (the two grep hits are string literals in a `patternString` data table, not real escapes); fully total. ## Notes - No proof sources changed — packaging + CI wiring only. - The `verif-idris` job mirrors `idris2-abi-ci`'s install (apt-first, source-fallback) and uses `timeout-minutes: 30` to cover the source-bootstrap fallback. - Remaining in the proof-CI sweep: a **weekly cron** for the heavier Isabelle/Mizar corpora (next). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01UAqDQaMwpUqWHUSZekGZWv)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 969b73e commit 9969ff0

3 files changed

Lines changed: 92 additions & 1 deletion

File tree

.github/workflows/dogfood-proofs-ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ on:
1919
paths:
2020
- 'proofs/**'
2121
- 'verification/proofs/lean4/**'
22+
- 'verification/proofs/idris2/**'
2223
- 'Justfile'
2324
- '.github/workflows/dogfood-proofs-ci.yml'
2425
pull_request:
2526
branches: [main]
2627
paths:
2728
- 'proofs/**'
2829
- 'verification/proofs/lean4/**'
30+
- 'verification/proofs/idris2/**'
2931
- 'Justfile'
3032
- '.github/workflows/dogfood-proofs-ci.yml'
3133
workflow_dispatch:
@@ -167,6 +169,44 @@ jobs:
167169
- name: Build Lean verification corpus
168170
run: just proofs-verif-lean
169171

172+
verif-idris:
173+
name: Idris2 (verification)
174+
runs-on: ubuntu-latest
175+
timeout-minutes: 30
176+
steps:
177+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
178+
179+
- name: Install Idris2
180+
run: |
181+
set -euo pipefail
182+
# idris2 v0.8.0 ships no prebuilt Linux release asset, so prefer the
183+
# Ubuntu 24.04 universe package and fall back to a source bootstrap from
184+
# the tag archive (mirrors idris2-abi-ci.yml's install).
185+
sudo apt-get update -qq || sudo apt-get update -qq --fix-missing
186+
sudo apt-get install -y --fix-missing idris2 2>/dev/null || {
187+
IDRIS2_VER="v0.8.0"
188+
sudo apt-get install -y --fix-missing chezscheme make libgmp-dev
189+
curl -fsSL --max-time 300 --retry 2 -o /tmp/idris2.tar.gz \
190+
"https://github.com/idris-lang/Idris2/archive/refs/tags/${IDRIS2_VER}.tar.gz"
191+
mkdir -p /tmp/idris2-src
192+
tar xzf /tmp/idris2.tar.gz -C /tmp/idris2-src --strip-components=1
193+
(cd /tmp/idris2-src && make bootstrap SCHEME=scheme && sudo make install PREFIX=/usr/local)
194+
}
195+
idris2 --version
196+
197+
- name: Install just
198+
run: |
199+
set -euo pipefail
200+
curl -fsSL --retry 3 \
201+
"https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \
202+
-o /tmp/just.tar.gz
203+
mkdir -p "$HOME/.local/bin"
204+
tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just
205+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
206+
207+
- name: Type-check Idris2 verification corpus
208+
run: just proofs-verif-idris
209+
170210
agda:
171211
name: Agda
172212
runs-on: ubuntu-latest

Justfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ test-s4-loop:
250250
# exact same commands.
251251

252252
# Type-check the whole dogfood proof corpus across every assistant.
253-
proofs: proofs-coq proofs-lean proofs-agda proofs-idris proofs-verif-lean
253+
proofs: proofs-coq proofs-lean proofs-agda proofs-idris proofs-verif-lean proofs-verif-idris
254254

255255
# Compile the Coq proof corpus (proofs/coq/**/*.v).
256256
proofs-coq:
@@ -292,6 +292,25 @@ proofs-idris:
292292
proofs-verif-lean:
293293
cd verification/proofs/lean4 && lake build
294294

295+
# DispatchCorrectness imports EchidnaABI.Types, so the echidnaabi package
296+
# (src/abi) is installed first (--install builds it on the way); the ipkg then
297+
# type-checks all 11 modules with a reliable aggregate exit code. A bare per-file
298+
# `idris2 --check` is unsafe here -- it exits 0 even on an unresolved import -- so
299+
# the ipkg build is the gate and any "Error" line is also treated as failure.
300+
# Type-check the Idris2 trust-pipeline property proofs (verification/proofs/idris2).
301+
proofs-verif-idris:
302+
#!/usr/bin/env bash
303+
set -euo pipefail
304+
(cd src/abi && idris2 --install echidnaabi.ipkg >/dev/null)
305+
cd verification/proofs/idris2
306+
out=$(idris2 --typecheck echidna-verif-proofs.ipkg 2>&1)
307+
printf '%s\n' "$out"
308+
if printf '%s\n' "$out" | grep -qE '^Error'; then
309+
echo "Idris2 verification corpus: TYPE ERRORS DETECTED" >&2
310+
exit 1
311+
fi
312+
echo "Idris2 verification corpus: all files type-check"
313+
295314
# Format code
296315
fmt:
297316
cargo fmt
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-- SPDX-License-Identifier: MPL-2.0
2+
--
3+
-- echidna-verif-proofs — Idris2 trust-pipeline property proofs.
4+
--
5+
-- These modules formalise properties of ECHIDNA's verification pipeline
6+
-- (axiom completeness/policy ordering, trust-kernel monotonicity, dispatch
7+
-- correctness/ordering, clamp bounds, proof-state serialisation round-trips,
8+
-- prover-kind injectivity, trust-level soundness).
9+
--
10+
-- Type-check the whole corpus: idris2 --typecheck echidna-verif-proofs.ipkg
11+
--
12+
-- Building via this package (rather than a per-file `idris2 --check` loop) gives
13+
-- a reliable aggregate exit code AND resolves DispatchCorrectness's
14+
-- `import EchidnaABI.Types` through `depends = echidnaabi` — the echidnaabi
15+
-- package must be installed first (`idris2 --install src/abi/echidnaabi.ipkg`).
16+
package echidna-verif-proofs
17+
18+
sourcedir = "."
19+
20+
depends = base, echidnaabi
21+
22+
modules = AxiomCompleteness
23+
, AxiomPolicyOrdering
24+
, BasicTotality
25+
, ClampTrustBounds
26+
, DispatchCorrectness
27+
, DispatchOrdering
28+
, NatLte
29+
, ProofStateSerialisation
30+
, ProverKindInjectivity
31+
, TrustKernelMonotonicity
32+
, TrustLevelSoundness

0 commit comments

Comments
 (0)