This page is the recommended playbook for routine local validation.
For a routine Lean change, run:
lake buildOn a cold clone, fetch precompiled dependencies first:
lake exe cache get
lake buildlake exe cache get covers Mathlib and its dependencies, which is the expensive half.
It does not cover CompPoly's own modules; lake build compiles those. Downstream
projects that depend on CompPoly do get its prebuilt oleans automatically — see
build-cache.md.
lake buildlake build
lake testlake build
lake exe axiomsweep --checkaxiomsweep is kernel-level axiom/sorry accounting for every reportable
CompPoly.* declaration, diffed against the committed baseline
scripts/axiom_baseline.json. It sweeps the CompPoly library as imported by the
umbrella (tests/ and bench/ are outside it), and inherits the blind spots of any
environment walk (structure-field defaults and examples never enter the
environment) — see the module docstring in scripts/AxiomSweep.lean. It fails only on new
sorryAx or non-standard-axiom taint, so pre-existing gaps stay allowed. After
intentionally adding or closing a sorry, refresh and commit the baseline:
lake exe axiomsweep --update-baselineCI runs the same check as an enforcing gate (see lean_action_ci.yml). Native-compiler
trust is never baselineable.
./scripts/update-lib.sh
./scripts/check-imports.sh
lake buildCompPoly.lean is generated from tracked CompPoly/**/*.lean files. If it changes,
commit the regenerated file with the source changes.
./scripts/lint-style.shThis is stricter than a plain build. It runs the repository style linter and the
global Lean-file checks in ../../scripts/README.md.
python3 ./scripts/check-docs-integrity.pyRun this when editing AGENTS.md, README.md, CONTRIBUTING.md, or files under
docs/.
lake build CompPolyBench
lake exe CompPolyBench --mediumCI gates on benchmark correctness, not timings:
lake exe CompPolyBench --medium --validate-onlyBoth CI tracks run a curated subset rather than the full suite, so a new
benchmark group must be added to bench/ci-groups.txt to be covered. Timings
come from the on-demand Benchmarks workflow. See
../../bench/README.md and
benchmarking.md.
../../.github/workflows/lean_action_ci.ymlruns a warm (incremental)lake buildby default — reusing cached Lake oleans so only dirty modules rebuild — thenlake test, then the axiom sweep as an enforcing gate, and posts a build-timing report. It also buildsCompPolyBenchand runs it in--validate-onlymode over the curated group set inbench/ci-groups.txt, which checks that each group's implementations agree without collecting timings, and uploads the digests as an artifact. A full cold rebuild (rm -rf .lake/build && lake build) runs automatically whenlean-toolchainorlake-manifest.jsondiffers from the comparison base (PR base, previous push tip, or merge-base withmainon manual dispatch). You can also force a clean via Actions → Lean Action CI → Run workflow with theclean_buildinput. Ordinary source-only PR/push runs stay warm. Two Actions caches feed the warm path:.lake/packageskeyed onlean-toolchainpluslake-manifest.json, and.lake/buildkeyed additionally per commit. A dependency-cache miss is not expensive, becauselean-actionrunslake exe cache getfor us, so Mathlib's oleans are downloaded rather than compiled.../../.github/workflows/linting.ymlruns the style linter on changed.leanfiles in PRs and push builds.../../.github/workflows/check_imports.ymlchecks thatCompPoly.leanmatches the tracked source tree.../../.github/workflows/docs-integrity.ymlchecks theCLAUDE.mdsymlink, local markdown links, and backticked file paths in the docs.
Five further workflows exist that are not part of the pass/fail gate:
../../.github/workflows/benchmarks.ymlproduces benchmark timings on demand only — via Actions → Benchmarks → Run workflow, a/benchcomment from a repo member, or automatically on a PR touchingbench/**. Timings are kept out of the gate becauseubuntu-latestis a shared 2-vCPU VM whose wall-clock is not worth gating on; benchmark correctness is gated bylean_action_ci.ymlinstead. It restores the build caches but never saves them.../../.github/workflows/summary.ymlposts a PR summary on open and on every new commit. It runs underpull_request_targetand never builds or executes PR code — it reads the diff and committed source as data — which is what makes that safe for fork PRs.../../.github/workflows/review.ymlruns a PR review on demand only, triggered by a/reviewcomment from a repo member. It is deliberately not run on PR open, because the review path builds and elaborates the PR's Lean code with secrets in scope.../../.github/workflows/update_lean_project.ymlbumps the Lean toolchain and dependencies nightly, and can be dispatched manually.../../.github/workflows/lean_release_tag.ymladds a release tag whenlean-toolchainchanges onmain.
Use the direct scripts when debugging a specific failure:
./scripts/update-lib.sh
./scripts/check-imports.sh
./scripts/lint-style.sh
python3 ./scripts/check-docs-integrity.py
lake test
lake build CompPolyBench
lake exe axiomsweep --checkFor more detail on the helper scripts, see
../../scripts/README.md.