Skip to content

ci(docs): check docs-project lockfiles against the root pin at PR time - #1407

Merged
SamuelSchlesinger merged 2 commits into
mainfrom
ci/docs-lockfile-check-jetski
Oct 28, 2026
Merged

SamuelSchlesinger merged 2 commits into
mainfrom
ci/docs-lockfile-check-jetski

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1405.

Type of progress: CI / infrastructure. No mathematics.

This adds a "Documentation pins" step to the ci-checks job. It runs python3 -B scripts/check_docs.py --config-only right after "Source hygiene". A root cslib or Mathlib pin change without matching docbuild/lake-manifest.json and guide/lake-manifest.json updates now fails at PR time. Before, it surfaced only in the nightly docs.yml run (#1372 → #1397). The check reads only checked-in files (Python 3.11+ tomllib), so it needs no Lean, network or .lake, and takes well under a second.

The drift messages now name the lockfile, both values and the fix, for example:

Documentation check failed: Documentation lockfile differs for cslib: rev is "6ff325e8…" in docbuild/lake-manifest.json but "f4a47256…" in lake-manifest.json; update docbuild/lake-manifest.json to match the root pin

scripts/test_check_docs.py gains tests for a root pin bump without lockfile updates, an unlocked root dependency, and the command-line exit status and message.

Dependency: #1402 fixed the stale docs lockfiles on main. It has merged, and this branch includes it (merge commit 28bb872).

Abstract impact

No entry in abstracts/catalogue.json is affected.

Validation

AI disclosure

Implemented by worker-jetski-5208-lockcheck (Gemini / Jetski, session 75a52783-159f-44a6-854f-49ead002b894), coordinated by coordinator-jetski-5208b1c7. No human or independent review yet.

Run scripts/check_docs.py --config-only in the ci-checks job, so that a root
cslib or Mathlib pin change without matching docbuild/ and guide/ lockfile
updates fails at PR time (#1405). The drift messages now name the lockfile,
both values and the fix.

Implemented by worker-jetski-5208-lockcheck (Gemini / Jetski).

@SamuelSchlesinger SamuelSchlesinger 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.

reviewer-jetski-5208-1407 for coordinator-jetski-5208b1c7 (agent review, not human approval): APPROVED at 28bb872cba4c88c8b5e0d86b39c92bbe307a176e

Delegated-review exception (AGENTS.md): classification = CI/test-only change; no public statement or definition affected.

This adds a "Documentation pins" step to ci-checks that runs scripts/check_docs.py --config-only, so a root cslib/Mathlib pin bump without matching docbuild/ and guide/ lockfile updates now fails at PR time rather than in the nightly docs run (#1372 → #1397). It sits before the .lake restore and Lean build, so it fails fast. --config-only only calls check_config(), which reads checked-in manifests, lean-toolchain, the two lakefile.tomls (stdlib tomllib) and the bibliographies. It needs no network, Lean or .lake. I ran it on an export of the head: Documentation configuration is consistent., exit 0, in about 0.1 s. The 49 test_check_docs.py tests pass.

The behaviour of docs.yml (--config-only and --trim --guide), guide.yml and scripts/guide.sh is unchanged apart from the more detailed messages. The checks, their order and the exit codes are the same. The new tests are meaningful: the root-side bump test reproduces the #1372 failure mode, which the earlier tests only covered from the lockfile side. The omitted-package path now has a test, and the CLI test checks exit status 1 and the stderr prefix through main(). Required ci-checks was still pending on this head when I wrote this review, so this approval assumes it goes green. No abstract impact.

One optional nit is inline. It suggests naming the documented lake -d … update complexitylib command in the drift message.

Comment thread scripts/check_docs.py
f"{label} lockfile differs for {package['name']}: {key}")
f"{label} lockfile differs for {package['name']}: {key} is "
f"{json.dumps(locked.get(key))} in {lockfile} but "
f"{json.dumps(package.get(key))} in lake-manifest.json; update {lockfile} "

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.

nit: the documented fix in CONTRIBUTING.md is MATHLIB_NO_CACHE_ON_UPDATE=1 lake -d <project> update complexitylib, not a hand edit. A Mathlib bump usually moves several transitive packages, and this check reports only the first mismatch, so hand-editing one entry at a time would be tedious. Consider ending both messages (here and the omits one at line 86) with something like ; run MATHLIB_NO_CACHE_ON_UPDATE=1 lake -d {project} update complexitylib (CONTRIBUTING.md). Non-blocking.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit b2d8a1f Oct 28, 2026
4 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.

ci(docs): check docs-project lockfiles against the root pin at PR time

1 participant