fix(cache): avoid misleading message on refs not built "on purpose"#41983
Draft
marcelolynch wants to merge 2 commits into
Draft
fix(cache): avoid misleading message on refs not built "on purpose"#41983marcelolynch wants to merge 2 commits into
marcelolynch wants to merge 2 commits into
Conversation
PR summary a022a0f01dImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
… absence `cache get` on a fork printed an alarming "no cache found for HEAD" note whenever the per-SHA fork marker was absent, even when every file was then served from mathlib's master cache. A tooling-only PR (no Lean module changes) always hits this: its CI build has a 100% master-cache hit, stages zero files, skips the upload job, and so never writes the marker — nothing failed, but the note (and `cache query`'s "CI hasn't built any of these commits yet") said otherwise. The note is now printed after the download rounds and only when files are actually missing: `downloadFiles` returns hard-failure and miss counts (`DownloadResult`), `getFiles` propagates the miss count, and `warnIfMissingFiles` picks between the fork-workflow hint (`cache query` / `--scope`) and the generic divergence warning. A read fully served by the containers prints nothing, which also retires the upfront marker probe and the ancestor-of-master special case — proxies for the consequence this now measures directly. `cache query` distinguishes the two causes of a missing marker: when the branch changes no cache-relevant file (module trees, toolchain, lakefile, manifest) it explains that CI builds of it upload nothing fork-specific, instead of claiming CI hasn't built the commits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An empty `cache query` result has two causes — CI hasn't built the commits, or its builds had nothing fork-specific to upload — and the tool cannot reliably tell them apart, so the message now states both instead of guessing one via a git-diff path heuristic. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
marcelolynch
force-pushed
the
2026/07/CacheMissKeyedHints
branch
from
July 21, 2026 17:34
7b57596 to
a022a0f
Compare
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.
cache geton a fork printed a "no cache found for HEAD" note whenever the per-SHA fork marker was absent, even when every file was then served from mathlib's master cache — which is always the case for a tooling-only PR (its CI build stages zero files, so the upload job and the marker are skipped by design). Reported in #41707 (comment).The note is now printed after the download rounds and only when files are actually missing;
cache query's no-result message names both possible causes (CI hasn't built the commits, or its builds had nothing fork-specific to upload) instead of claiming the first.🤖 Generated with Claude Code