Repository navigation
fix(crosscheck): move the Lean image to v4.28.0 and name imports that exist in the Lean skills - #145
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The image checked files against Lean v4.10.0, whose core lacks List.Pairwise, so a core-only file that builds with the repository's own toolchain failed lean_check. Mathlib.Data.Nat.Defs no longer exists at v4.28.0, so the placeholder and the timing snippet import Mathlib.Data.Nat.Basic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…overnance note for the Lean v4.28.0 image LT-1 covers keeping the Lean image on a release that builds what the pipeline produces. It governs this change, following the MR-1 precedent, and the maintainer confirms that in the note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pl and /drt-oracle Mathlib.Data.Nat.Defs is gone in Mathlib v4.28.0, so /lean-spec names Mathlib.Data.Nat.Basic. Five other imports the skills named exist in neither v4.10.0 nor v4.28.0: Analysis.SpecialFunctions.Basic, Data.Array.Basic, Data.HashMap.Basic, Data.Json and Tactic.DeriveDecidableEq. They become Mathlib.Data.Real.Basic, no import for Array, Std.Data.HashMap, Lean.Data.Json and no import for deriving DecidableEq. Each replacement compiles in the v4.28.0 image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nance note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ance note Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tier: 3
Intent: intent/2026-10-27-lean-image-v4-28.md
Spec: intent/2026-10-27-lean-image-v4-28-spec.md
Plan: intent/2026-10-27-lean-image-v4-28-plan.md
Task: LT-1.1
What changes
This is for anyone running
/lean-spec,/lean-impl,/correspondence-reviewor/drt-oracle.lean_check,lean_runandlean_testnow judge files against Lean v4.28.0 and Mathlibv4.28.0, the toolchain the rest of the repository uses. Before, a core-only file that usedList.Pairwisefailed with "environment does not contain 'List.Pairwise'". That is the failure behind PR #144.crosscheck/mcp-server/lean-harness/lean-toolchainandlakefile.leanpin v4.28.0.Mathlib.Data.Nat.Defsdoes not exist at v4.28.0, soCrosscheck/Program.leanand the timing snippet incrosscheck/scripts/build-lean-docker.shimportMathlib.Data.Nat.Basic./lean-spec,/lean-impland/drt-oraclenow name only imports that compile in the new image. Six of the imports they named fail there, and five of those also fail in the old image.Every host must rebuild with
crosscheck/scripts/build-lean-docker.sh. On the old image, the corrected/lean-spectable namesMathlib.Data.Nat.Basic, which does not exist there.Imports the skills name (measured 2026-10-28)
Each probe is
import <module>followed by#eval 1. Each was run withdocker run --rm --network none --memory 2g --cpus 2 -v <dir>:/work <image> check /work/program.lean, which is whatlean_checkruns.:latest):v4.28-test)Mathlib.Data.Nat.DefsMathlib.Data.Nat.Basic(pass)Mathlib.Tactic.DeriveDecidableEqderiving DecidableEqis core (pass)Mathlib.Analysis.SpecialFunctions.BasicMathlib.Data.Real.Basic(pass)Mathlib.Data.Array.BasicArray.foldlandArray.mapIdxare core (pass)Mathlib.Data.HashMap.BasicStd.Data.HashMap(pass)Mathlib.Data.JsonLean.Data.Json(pass)Mathlib.Data.List.Basic,Finset.Basic,Multiset.Basic,Tactic.LinarithResults (image built as
crosscheck-lean:v4.28-test, with:latestuntouched)npm test. 382 passed and 25 skipped, measured with and withoutLEAN_DOCKER_IMAGEset.RUN_E2E=1 npm run test:e2e. 20 passed. No e2e test uses the Lean image, so the Lean checks below drovedocker runthe wayrunLeanindocker.tsdoes.List.Pairwiseprobe (measured). The new image passes it in 4 s, and the old image fails it.import Mathlib.Data.List.BasicwithList.Pairwisebydecide. Passes in 7 s.formal-verification/lean/CrosscheckModel/Power.lean. Passes with 4sorrywarnings in 8 s.docker statsonce a second.Not yet reached: CI does not build the Lean image, so CI does not catch the pins drifting again. The property that blocks it is the hosted-runner time and disk the Mathlib oleans need. LT-1's acceptance records the open question.
Protected-Surface Amendment
Target file(s):
docs/assurance/ROADMAP.md(+ 3 others, see Diff Plan)Class: A (harness and workflow definitions, and governance documents the gates read)
Matched rule:
docs/assurance/**,crosscheck/skills/*/SKILL.mdDate: 2026-10-28
Change Description
docs/assurance/ROADMAP.mdgains one item, LT-1, in the Next horizon. It covers keeping the Crosscheck Lean image on a Lean and Mathlib release that builds what the pipeline produces. No other item, status or section changes./lean-spec: three rows, for natural numbers, decidability and reals, plus the same decidability advice in its build-error table./lean-impl: two rows, for arrays and hash maps./drt-oracle: one line, for JSON.Rationale
The trigger is PR #145, which moves the Crosscheck Lean image from Lean and Mathlib v4.10.0 to v4.28.0. The image could not build the OCPP 1.6 model in PR #144, because the model uses
List.Pairwisefrom Lean core, and v4.10.0's core does not have it. With v4.28.0,/lean-spec's instruction toimport Mathlib.Data.Nat.Defsfails, because that module no longer exists.The skill tables were checked on 2026-10-28. Each module was compiled in both images with
docker run --rm --network none -v <dir>:/work <image> check /work/program.lean, which is whatlean_checkruns. Five more imports named in the skills fail on both images:Mathlib.Analysis.SpecialFunctions.BasicMathlib.Data.Array.BasicMathlib.Data.HashMap.BasicMathlib.Data.JsonMathlib.Tactic.DeriveDecidableEqSo a model that follows those rows fails
lean_checktoday, whichever image it uses. Every replacement passes in the v4.28.0 image. The plan lists each result:intent/2026-10-27-lean-image-v4-28-plan.md.The maintainer asked on 2026-10-28 for everything #145 needs to be prepared for approval.
Governing Roadmap Item
docs/assurance/ROADMAP.md(Next horizon, item LT-1, added by this change)lean_check.No existing item covered the Lean image. ER-1 and VA-1 are the nearest, and citing either would stretch its scope. LT-1 is added by this change and authorises it. This follows
restore-hooks-and-mr-1-2026-09-29.md, which added MR-1 under MR-1.REQUIRES HUMAN VERIFICATION: The maintainer confirms that LT-1 may authorise its own addition, and the five skill-table corrections that were broken before this change.
Authority
Diff Plan
docs/assurance/ROADMAP.mdcrosscheck/skills/lean-spec/SKILL.mdMathlib.Data.Nat.DefswithMathlib.Data.Nat.Basic;Mathlib.Tactic.DeriveDecidableEqwith no import, in both tables;Mathlib.Analysis.SpecialFunctions.BasicwithMathlib.Data.Real.Basiccrosscheck/skills/lean-impl/SKILL.mdMathlib.Data.Array.Basicwith no import;Mathlib.Data.HashMap.BasicwithStd.Data.HashMapcrosscheck/skills/drt-oracle/SKILL.mdMathlib.Data.JsonwithLean.Data.JsonTest / Coverage Impact
node scripts/ci/skill-references.mjschecks the slash references in the skills. The change adds no slash reference.Review Checklist
Mechanical items. Tick each one only after running its command, and write the command and its output under the item. If a command cannot run, leave the item unticked and add
REQUIRES HUMAN VERIFICATION:and the reason.*-bot,*[bot]*,claude-*or an agent name.Output:
hnippsmatches none of the patterns.grep -n "LT-1" docs/assurance/ROADMAP.mdfinds it.Output: lines 100 (Next horizon table), 128 (item paragraph) and 139.
git diff --name-only origin/main...HEAD, filtered by the protected globs, equals the diff plan's file list.Output:
crosscheck/skills/drt-oracle/SKILL.md,crosscheck/skills/lean-impl/SKILL.md,crosscheck/skills/lean-spec/SKILL.md,docs/assurance/ROADMAP.md. These are the diff plan's four files.## Protected-Surface Amendmentheading.Output:
gh pr view 145 --json body --jq .body | grep -c '^## Protected-Surface Amendment'prints 1.REQUIRES HUMAN VERIFICATION:markers above have been resolved. Command: the count of unresolved markers is zero.Judgment items. A human decides these, or an agent ticks them on the maintainer's explicit instruction.
<!-- aspirational -->+ linked issue). Not applicable: no Class B file changes.🤖 Generated with Claude Code