chore: Cleanup and linting after the initial Clean changes#104
Merged
Conversation
…dtumad/cleanup-pass
Move the environment-linter pass out of the `build` job into a separate `lint` job so it shows up independently in the checks list. The lint job `needs: build` and restores the project oleans from a commit-keyed cache the build job publishes (lean-action's own cache covers dependencies only, not the per-commit project build), so `lake lint` runs without a redundant full rebuild. The restore is best-effort — on a miss, lean-action rebuilds, so the job stays correct. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tamirhemo
approved these changes
Jun 26, 2026
dtumad
added a commit
that referenced
this pull request
Jun 27, 2026
The W11 channel-pull work (byte finish, state gate, program polarity flip + ROM provider + capstone link retirement) was developed on top of the same cleanup main landed in #104, so the 3-way merge flagged conflicts on every line both sides re-touched relative to the #102 base. Resolved all proof/contract conflicts to the W11 side (the correct end state — the merged circuits carry the byte/state/program pulls, whose off-gate `Requirements` and paired reader `Assumptions` the W11 proofs discharge; main's pre-pull proofs would not typecheck against them). The only net new content from main was its CI-workflow rework (lean-action restore-keys), taken as-is. `Math/Gate.lean` resolved to the W11 superset (main's consolidated gate lemmas + `off_gate_vacuous`). Flip invariants verified intact: `programLookups` negated, build green (3638 jobs, 0/0 bar the pre-existing `sp1_witness_decode` sorry), `lake lint` + native_decide/skipKernelTC guards pass, flip-critical decls axiom-clean `[propext, Classical.choice, Quot.sound]`. Co-Authored-By: Claude Opus 4.8 <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.
Summary
This branch began as a proof/lemma cleanup pass after the initial Clean-native refactor and
grew to also restructure and harden CI. The two halves are independent and neither changes any
declarations or mathematical content.
CI
The CI workflow (
.github/workflows/lean_action_ci.yml) went from a single build job to fourjobs, and the project now has
lake test/lake lintdrivers plus lightweight compiler trust guards.Job graph
guards— source-policy gates on a standard runner, in parallel with the heavy build so aforbidden pattern fails the PR in seconds without a Lean build:
scripts/check_no_skipkerneltc.sh— noset_option (debug.)skipKernelTCin source (it bypassesthe kernel type-check re-run, the trust anchor for axiom-clean proofs).
scripts/check_no_native_decide.sh— nonative_decidein the mainSP1Clean/library (it truststhe whole compiler via
Lean.ofReduceBool/Lean.trustCompiler).build— the heavy project build, now also publishing the freshly-built.lake/buildoleans to acommit-keyed cache (
lake-build-${{ github.sha }}) for the downstream jobs. lean-action's own cacheonly covers dependencies (keyed on the manifest), not the per-commit project build.
lint(needs: build) —lake lint(the newsp1Lintdriver) split into its own job so it showsup as an independent check. Restores the commit-keyed cache so it reads the already-built oleans instead
of rebuilding.
test(needs: build, parallel withlint) —lake test(the newSP1CleanTestlibrary: thewitness-generation + whole-trace
native_decideconformance anchors, checked against batteries dumpedfrom SP1's real Rust prover). Restores the same cache and only elaborates the test modules. Split out so
the trusted-compiler checks are clearly independent in the checks list.
Test / lint drivers and the test-library split
SP1CleanTestlibrary (globSP1CleanTest.+) holding all witness/traceconformance anchors — the only place
native_decideis allowed. It importsSP1Cleanbut is neverimported by it, so the default
lake build SP1Cleanstaysnative_decide-free (now enforced by theguardsjob). Wired as thetestDriverinlakefile.toml.scripts/sp1Lint.lean+ asp1Lintlean_exe, wired as thelintDriver. A thin custom driverover the Batteries
#lintframework running a curated subset of linters over the hand-writtenSP1Clean.*declarations only, excluding the auto-generatedExtracted/+*Vectorscode (the stockrunLinterscopes by namespace root and can't make that exclusion). Residual suppressions live inscripts/nolints.json.moreLeanArgson everyhand-written pillar (
SP1Math/SP1Model/SP1FormalModel/SP1Native/SP1Proofs+SP1CleanTest),which keeps the auto-gen
SP1Extractedlibrary out of the linter set. All eight flags are at zeroviolations.
scripts/run_audit.shnow invokes both guard scripts as gates and reports thenative_decidecountfrom
SP1CleanTest/rather thanSP1Clean/.Cleanup
duplicated across all nine
DivRemChip/Soundness/*.leanvariant files into a single sharedDivRemChip/Soundness/Tail.leanhelper (Already in perf: optimize the expensive portions of DivRem proofs #103 so could either merge that first or just close it).Bridge/Formal/Core/Mathfiles across Bitwise, Lt, Jal,Addw, Shift, Store*, Load* chips, …) and extracted shared helper lemmas into
Math/Gate.leanandMath/Word.lean.AGENTS.md,docs/agents/proof-patterns.md,docs/architecture.md,docs/roadmap.md,docs/release-audit.md) and the audit snapshots (axiom-census.txt,axiom-ledger.md,compile-profile.md) to match the new layout and CI, plus minor generator tweaks(
update_extracted.py,scripts/gen_axiom_probe.py).