Fix documentation cache bootstrap - #324
Conversation
Greptile SummaryThis PR fixes a cache bootstrap deadlock introduced by the Lean 4.33 toolchain bump: the old
Confidence Score: 5/5Safe to merge — all job dependency edges, cache key namespaces, SQLite WAL validation, and freshness guards are logically consistent; no existing deploy path is left unprotected. The cache bootstrap is well-structured: the mathlib_doc_info to build handoff is enforced by an explicit needs dependency, fail-on-cache-miss prevents silent cold-start failures, and WAL checkpoint plus integrity checks run before any save. The freshness gate is defended at two points. The concurrency change correctly queues rather than cancels main runs. No correctness gap was found in the critical path. Files Needing Attention: No files require special attention beyond the minor self-referential hardcoded filename noted in the review comment.
|
| Filename | Overview |
|---|---|
| .github/workflows/docs.yml | Major restructure: adds preflight, mathlib_doc_info, and deployment_freshness jobs; splits cache namespaces; migrates to Lake-* keys matching Lean Action CI; introduces conditional doc-checkpoint restore with fail-on-cache-miss guard and per-job SQLite WAL validation |
| .github/workflows/exposition-verify.yml | Parallel fix: replaces Docs-Lake-* cache key with Lake-* to match Lean Action CI; removes docbuild from paths; unconditional Mathlib install with manifest-revision verification |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[preflight\nToolchain + Mathlib compatibility\nCache restore + mk_all check] --> B[mathlib_doc_info\nBuild Mathlib:docInfo\nWAL checkpoint + save DocsInfoMathlib-v3-*]
A --> C[exposition\nBuild LeanPool + extract\nGenerate Python site]
B --> C
B --> D[build\nRestore DocsInfo-v3-* pool checkpoint\nFallback: DocsInfoMathlib-v3- fail-on-miss\nBuild LeanPool:docInfo + docs\nWAL checkpoint + save DocsInfo-v3-*]
A --> D
C --> E[deployment_freshness\nCompare run_number vs latest main run\nOutput: deploy=true/false]
D --> E
E --> F[deploy\nif: deploy==true\nAssemble site\nRecheck freshness\nDeploy Pages]
C --> F
D --> F
Reviews (2): Last reviewed commit: "Harden documentation preflight diagnosti..." | Re-trigger Greptile
Root cause
The documentation workflow restored an OS-only
Docs-Lake-*fallback after the Lean 4.33 bump. That pulled Lean 4.32 artifacts, and the directory-only Mathlib check then skippedlake exe cache get. The job spent most of its six-hour limit rebuilding stale artifacts and timed out before it could save a compatible cache, creating a bootstrap deadlock.Fix
Lake-*cache with the same key, paths, and ordering as Lean Action CIdocInfointo a bounded job and hand off a WAL-checkpointed, integrity-checked SQLite cachedocInfobefore rerendering HTML; never cache duplicate root artifacts or HTMLValidation
actionlint -colorgit diff --checklake exe mk_all --check