Skip to content

Commit 969b73e

Browse files
ci(proofs): gate the Lean 4 verification corpus (verification/proofs/lean4) (#275)
## What Adds CI coverage for the **Lean 4 trust-pipeline property proofs** under `verification/proofs/lean4/` — they previously fell through every proof-CI filter. - New `verif-lean` job in `dogfood-proofs-ci.yml`, a structural clone of the existing `lean` job (elan shim + pinned-toolchain pre-install with retry/backoff, then `just`), reading the pin from `verification/proofs/lean4/lean-toolchain` and running a new `just proofs-verif-lean` recipe. - New Justfile recipe `proofs-verif-lean` = `cd verification/proofs/lean4 && lake build`, also added to the `proofs` roll-up so `just proofs` checks it locally too. - Path triggers extended to `verification/proofs/lean4/**` (both `push` and `pull_request`). ## Why `dogfood-proofs-ci` gated only `proofs/{coq,lean,agda}` + `src/idris`; the `idris2-abi-ci` and `agda-meta-checker` workflows are path-filtered to `src/abi/**` and `meta-checker/**`. So the five property proofs here (`ConfidenceLattice`, `ParetoMaximality`, `ParetoStrongMaximality`, `IntegrityVerification`, `PortfolioCompleteness`) had **no** gate — regressions would have landed silently. ## Verification (run locally, not eyeballed) On **Lean 4.13.0** (installed via the project's pinned tarball, the same version the corpus pins): - Fresh `lake build` with `.lake/build` cleared first → all 5 modules compile, `Build completed successfully`, exit 0 (~24 s). - `just proofs-verif-lean` → exit 0. - `grep -nE 'sorry|admit|^\s*axiom |native_decide'` across the corpus → **none** — these are genuine, hole-free proofs. No mathlib dependency (`lake-manifest` `packages: []`), so the job builds well under the 20-minute timeout. ## Notes - No source/proof files changed — CI wiring only. - Next in the same sweep (separate PRs): gate `verification/proofs/idris2` (Idris2, `idris2 --check` per file), and a weekly cron for the heavier Isabelle/Mizar corpora. 🤖 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 ed5602b commit 969b73e

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ on:
1818
branches: [main]
1919
paths:
2020
- 'proofs/**'
21+
- 'verification/proofs/lean4/**'
2122
- 'Justfile'
2223
- '.github/workflows/dogfood-proofs-ci.yml'
2324
pull_request:
2425
branches: [main]
2526
paths:
2627
- 'proofs/**'
28+
- 'verification/proofs/lean4/**'
2729
- 'Justfile'
2830
- '.github/workflows/dogfood-proofs-ci.yml'
2931
workflow_dispatch:
@@ -115,6 +117,56 @@ jobs:
115117
- name: Build Lean corpus
116118
run: just proofs-lean
117119

120+
verif-lean:
121+
name: Lean 4 (verification)
122+
runs-on: ubuntu-latest
123+
timeout-minutes: 20
124+
steps:
125+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
126+
127+
- name: Install elan + pinned Lean toolchain
128+
run: |
129+
set -euo pipefail
130+
# Mirrors the `lean` job: install the elan shim only, then pre-install the
131+
# toolchain pinned by verification/proofs/lean4/lean-toolchain with
132+
# retry/backoff so the Build step does not lazily resolve it (elan's release
133+
# tag lookup against the GitHub API can transiently fail). This corpus has no
134+
# mathlib dependency (lake-manifest packages: []), so it builds fast.
135+
curl -fsSL --retry 3 \
136+
https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \
137+
-o /tmp/elan-init.sh
138+
sh /tmp/elan-init.sh -y --default-toolchain none
139+
export PATH="$HOME/.elan/bin:$PATH"
140+
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
141+
toolchain="$(tr -d '[:space:]' < verification/proofs/lean4/lean-toolchain)"
142+
for attempt in 1 2 3 4 5; do
143+
if elan toolchain install "$toolchain"; then
144+
break
145+
fi
146+
if [ "$attempt" -eq 5 ]; then
147+
echo "elan toolchain install failed after 5 attempts" >&2
148+
exit 1
149+
fi
150+
backoff=$((attempt * 5))
151+
echo "elan toolchain install failed (attempt $attempt); retrying in ${backoff}s" >&2
152+
sleep "$backoff"
153+
done
154+
elan default "$toolchain"
155+
lean --version
156+
157+
- name: Install just
158+
run: |
159+
set -euo pipefail
160+
curl -fsSL --retry 3 \
161+
"https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \
162+
-o /tmp/just.tar.gz
163+
mkdir -p "$HOME/.local/bin"
164+
tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just
165+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
166+
167+
- name: Build Lean verification corpus
168+
run: just proofs-verif-lean
169+
118170
agda:
119171
name: Agda
120172
runs-on: ubuntu-latest

Justfile

Lines changed: 9 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
253+
proofs: proofs-coq proofs-lean proofs-agda proofs-idris proofs-verif-lean
254254

255255
# Compile the Coq proof corpus (proofs/coq/**/*.v).
256256
proofs-coq:
@@ -284,6 +284,14 @@ proofs-agda:
284284
proofs-idris:
285285
cd src/idris && idris2 --typecheck echidna-validator.ipkg
286286

287+
# Distinct from proofs-lean: the verification-pipeline *property* proofs
288+
# (ConfidenceLattice, ParetoMaximality, ParetoStrongMaximality, IntegrityVerification,
289+
# PortfolioCompleteness) under verification/proofs/lean4, not the dogfood corpus under
290+
# proofs/lean. No mathlib dependency (lake-manifest packages: []), so the build is light.
291+
# Build the Lean 4 trust-pipeline property proofs via Lake (verification/proofs/lean4).
292+
proofs-verif-lean:
293+
cd verification/proofs/lean4 && lake build
294+
287295
# Format code
288296
fmt:
289297
cargo fmt

0 commit comments

Comments
 (0)