Skip to content

Make every Lean warning a compile error (warningAsError, like Tau Ceti) - #751

Merged
Vilin97 merged 3 commits into
mainfrom
vasil/warning-as-error
Nov 6, 2026
Merged

Vilin97 merged 3 commits into
mainfrom
vasil/warning-as-error

Conversation

@Vilin97

@Vilin97 Vilin97 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Sets warningAsError = true in lakefile.toml [leanOptions], matching Tau Ceti.
  • Documents the rule in CONTRIBUTING.md (and the generated CLAUDE.md/AGENTS.md) and .github/CODE_QUALITY.md.

Why

CI already rejects warnings by grepping the build log. Putting the rule in the compiler adds:

  • Local builds match CI. lake build LeanPool.<Project> fails on a warning on the contributor's machine, not only after a CI round-trip.
  • Caches can't hide warnings. A module that warns produces no .olean, so an incremental or cache-restored build can't skip past it. Before, a clean rebuild could turn up warnings an incremental build never showed.
  • No opt-out. Pool sources can't set warningAsError false, because the quality gate bans set_option.

The log grep stays, to catch warnings that Lake itself prints.

Effects

  • Changing leanOptions changes every module's build trace, so this PR's CI and the first main build after merge rebuild the whole pool. Main is already warning-free under the grep gate, so the rebuild should succeed.
  • mathlib-bump.yml: a project that only warns after a bump now fails to build, so triage sends it to the repair fan-out. That is intended, since repairs already fix warnings.

Test plan

  • A local canary module with an unused variable fails lake build with error: … Variable name \h` is not explicitly referenced. With _h` it builds.
  • lake build LeanPool.FiveEighthsTheorem LeanPool.Apportionment mk_all builds with no warnings or errors under the new option.
  • CI: full-pool build plus the gates

🤖 Generated with Claude Code

Set `warningAsError = true` in the package's leanOptions, as Tau Ceti
does. CI already rejected warnings by scanning the build log; this moves
the rule into the compiler, so local `lake build` fails the same way and
a cached build can no longer hide a warning (a warning now means no
.olean). Pool files cannot opt out because `set_option` is banned by the
quality gate. The log scan stays for warnings Lake itself prints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

No added or modified Lean files under LeanPool/ in this PR. No compile-cost measurements are needed.

Advisory only — never blocks merge.

@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no blocking issue remains.

Summary

The PR sets warningAsError = true in lakefile.toml and documents the rule.

  • Lean warnings now stop module compilation as errors.

Reviews (3) · Last reviewed commit: "Keep warning policy compatible with proo..." · Reviewed by Greptile

Comment thread lakefile.toml Resolved
The lake-options quality check scans the raw lakefile text, comments
included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical source review at a5c83b04a269efa2d1e65aa7d419c3ed88e871e9: the comment issue is fixed. I checked the complete five-file change and the published repair; the repair changes only the lakefile comment, leaving parsed TOML and all other source objects unchanged. The exact existing _check_lake_options now returns no errors for that lakefile. No further technical source finding remains.

The inspected Lean/Lake 4.35 paths support the warning behavior and include strong options in module/cache traces. This review does not reproduce the author’s builds or qualify full-pool CI.

Changing [leanOptions] and .github/CODE_QUALITY.md still needs the separate direct scoped authorization required by CONTRIBUTING.md. That policy decision remains pending; this technical review grants no gate-change authority. Required current-head validation and normal protected integration also remain separate. No branch edit, queue admission, auto-merge or merge was made.

@Vilin97
Vilin97 added this pull request to the merge queue Nov 5, 2026
@Vilin97
Vilin97 removed this pull request from the merge queue due to a manual request Nov 5, 2026
@Vilin97
Vilin97 added this pull request to the merge queue Nov 5, 2026
@Vilin97

Vilin97 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer authorization: @Vilin97 directly authorized merging this PR, including its gate changes, in a Claude Code session on 2026-11-05. This is recorded for the permanent reviewer in Vilin97/lean-pool-automation#11. Merge it through the normal protected queue only, with no waivers.

🤖 Posted by Claude Code

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 5, 2026
@Vilin97
Vilin97 added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 6, 2026
@Vilin97
Vilin97 added this pull request to the merge queue Nov 6, 2026
@Vilin97
Vilin97 removed this pull request from the merge queue due to a manual request Nov 6, 2026

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical source review at 63a15b5b8dd7fe9753e30a408fce0c2210bea8b1: the native conflict with #712 is fixed by moving the existing warning-policy explanation into a separate paragraph below the gate list. The repair changes only .github/CODE_QUALITY.md; it preserves every accepted claim, the parsed warningAsError = true setting, and all other authored files. Ordinary three-way merges of all five PR files now succeed against the current #712 queue base, retaining its compiler plugin and proof-length policy.

The earlier head’s CI does not qualify this revision. This head requires its own applicable checks and normal protected integration before queue re-entry. The direct scoped authorization for #751 remains in force.

@Vilin97
Vilin97 enabled auto-merge November 6, 2026 06:49
@Vilin97
Vilin97 added this pull request to the merge queue Nov 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 6, 2026
@Vilin97
Vilin97 merged commit 49bdad2 into main Nov 6, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant