Repository navigation
Pin that Lake lists only the first stale module - #377
Merged
Merged
Conversation
The real-Lean stale-import test used a one-level chain, where Lake's list and the checked file's import are the same module, so it could not tell whether Lake also lists the modules that import a stale one. #364's advice to build the file's imports rests on Lake not listing them. Main now imports Probe.Mid, which imports Probe.Dep. The test checks that the error ends with Probe.Dep, that Lake doesn't list Probe.Mid, and that no .olean was built, where it used to look only for Dep.olean. It is still one Lake run that elaborates nothing.
Deicyde
force-pushed
the
test/stale-import-chain
branch
from
October 18, 2026 10:16
7a38c8f to
e11d4ec
Compare
Deicyde
commented
Oct 18, 2026
Deicyde
left a comment
Contributor
Author
There was a problem hiding this comment.
Adversarial review: ready to merge once it's out of draft
Scope. The diff at 7a38c8f, reviewed statically through five lenses (style, necessity, architecture, golf, correctness), each followed by a refuter, then a completeness critic and its refuter. I checked every surviving finding before acting on it, and a must-fix-only pass checked the fixes and the description.
Conclusion: ready to merge at e11d4ec.
- The test now pins the premise of #364's advice. With
MainimportingProbe.Mid, which importsProbe.Dep, Lake's failure list is just- Probe.Dep. Lake gives a module that imports a stale one a renewed job with an empty log, and it lists only jobs whose own log has an error. That code is the same from v4.30.0 through v4.35.0 and in v4.36.0-rc1, so a fixture bump won't break the test for an unrelated reason. - The assertions can't pass falsely.
- Probe.Depcan only reach the message throughMain, thenMid, thenDep, and the failure list is the last thing Lake prints before it exits with status 3.
Fixed
- The
Probe.Midcheck looked at the whole message. It now looks for- Probe.Mid, a list entry, as the comment says. A later Lake that namesProbe.Midon some other line, such as v4.35.0's "Canceled" line under--fail-fast, won't fail the test for a reason unrelated to the premise. - The commit message left out the widened
.oleancheck (Dep.oleanto*.olean), and that message becomes the squash body. It now names all three checks.
Considered and left as is
- An empty
Depso the call fits on one line. Lake never reads Dep's body under--no-build, but the gain is cosmetic, and the wrapped call matches other calls of the same helper. - Anchoring on Lake's list header (
rpartition("logged failures:\n")). That pins the list exactly, but it would fail if the header wording ever changed.endswithplus the narrowed check covers the premise without depending on the header. *.oleanunder.lake. Under--no-build, Lake writes an.oleanthere only for alakefile.leanconfig, and the helper writeslakefile.toml. The other way is restoring one from its artifact cache, which needs an earlier cache-writable build of this module. Nothing in the suite or CI does that, and a cache hit would fail theendswithcheck first.
Verification
- The test passes locally on Lean v4.32.2 after the change, and the rest of
tests/test_batch_diagnostics.pypasses with Lake hidden from PATH. - CI on e11d4ec passes every check. Its real-Lean step ran this test with the other real-Lean diagnostics and LSP tests: "8 passed, 70 deselected" (run 39118607171).
Deicyde
marked this pull request as ready for review
October 18, 2026 17:29
Deicyde
added a commit
that referenced
this pull request
Oct 18, 2026
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.
Follow-up to #364, from its post-merge review.
Why. #364 tells agents to build the checked file's imports because, under
--no-build, Lake lists only the first modules to build, not the ones that import them. The only real-Lean test of that error used a one-level chain (MainimportsProbe.Dep), where Lake's list and the file's import are the same module. If a later Lake started listing importers too, nothing would notice that the advice's premise had changed.Change. In
test_real_lean_reports_unbuilt_imports_without_building_them,Mainnow importsProbe.Mid, which importsProbe.Dep. The test checks three things:- Probe.Dep;Probe.Mid;.oleanwas built.It's still one Lake run that elaborates nothing.
Tests. On Lean v4.32.2, the fixture toolchain, the test passes locally in about 5 seconds. Lake's output ends with:
The rest of
tests/test_batch_diagnostics.pypasses with Lake hidden from PATH, andruff checkpasses.Merge notes. Clean against main eadde9b, and no open PR touches this file.