Repository navigation
pool-check: check the pool's layout; drift-check: names across the sites - #35
Conversation
The first of the pool invariants QuantEcon/project-monorepo#11 asks for, in CI before step 2 of QuantEcon/project-monorepo#24 promotes the remaining series. tools/pool-check reads lectures/ only and needs no mirror: a flat pool of <slug>.md files and _static/, no name starting with `_`, no two names that differ only in case, every folder at the top of _static/ a lecture's own or _shared/ (the merged bibliography the one file there), each file in _static/<slug>/ used by <slug>.md alone, and every asset reference file-relative and inside lectures/. It finds references with promote's own parser. pool-check.yml runs it on pull requests that touch the pool. tools/drift-check gains two drift findings. name-shared: a lecture name two canonical-eligible series list in their tocs must be one lecture in both, by promotion's rule, whether the name is in the pool yet or not, so the check now reconstructs every canonical-eligible series. toc-unpromoted: an accepted toc lists a lecture the pool does not hold, the mistake the review of #33 found (accepting clears toc-changed whether or not the pool followed it). lectures/_static/.gitkeep goes: _static/ has content, and the file is the one thing the layout check finds, in today's pool and with every series promoted into a scratch copy. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMXcpeiNdBg6ekmYJWp
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
Two moderate active issues remain: drift detection can falsely compare publishing sites against a non-publishing canonical series in tools/drift-check, and tools/pool-check does not reliably honor its documented exit status on unexpected exceptions.
2 open issues
What changed in this PR
This pull request introduces new CI and tooling guardrails for the monorepo “pool” (lectures/) by adding a dedicated tools/pool-check validator and extending tools/drift-check with additional drift findings to enforce cross-site naming consistency and detect accepted TOCs that reference unpromoted pool content.
Changes:
- Add
tools/pool-check(plus tests) and a new GitHub Actions workflow to run it on PRs touching the pool. - Extend
tools/drift-checkwith new drift findings (name-shared,toc-unpromoted) and associated tests. - Update documentation and remove
lectures/_static/.gitkeepto satisfy the new pool layout rule.
Approval Readiness
This pull request requires changes.
tools/drift-check(moderate):check_namesselectsbasefrom the ledger’s canonical series even when that series isn’t inholders, which can produce falsename-shareddrift comparisons against a non-publishing canonical copy.tools/pool-check(moderate): The tool documents exit status2for errors, but unexpected exceptions can bubble up and typically exit1, violating the documented contract and creating noisier CI output.
| File | Summary |
|---|---|
tools/tests/test_pool_check.py |
Adds pytest coverage for pool-check rules/tags and expected outputs. |
tools/tests/test_drift_check_names.py |
Adds tests for name-shared (cross-site lecture-name uniqueness / collision detection). |
tools/tests/test_consumer.py |
Adds/regresses coverage around toc-unpromoted behavior for consumer series. |
tools/tests/conftest.py |
Updates the test harness to include and exercise tools/pool-check. |
tools/pool-check |
New tool to validate lectures/ layout and asset/reference invariants using promote’s parser. |
tools/drift-check |
Adds drift findings (name-shared, toc-unpromoted) and updates drift logic/mirror reconstruction accordingly. |
README.md |
Documents the new pool-check tool/workflow and the added drift-check findings. |
lectures/_static/.gitkeep |
Removes a placeholder file that violates the new pool layout check. |
.github/workflows/pool-check.yml |
Adds CI workflow to run tools/pool-check on relevant pull request changes. |
Review effort: Balanced
…t 2 on any error From Copilot's review of #35. check_names compared the sites that list a name with the ledger's canonical copy even when the canonical series no longer lists it, so a finding could say a site publishes a lecture it does not. The copy the others are compared with is now the canonical one when its series lists the name, else one the ledger records, else the first in manifest order. pool-check exited 1, its status for a broken rule, on any error but its own. Like bib-merge, it now prints the traceback and exits 2, and promote exiting as it loads (PyYAML missing) is an error too. drift-check had the same gap, and it mattered more there: drift-check.yml takes 1 as findings to handle, so a crash left the check job green with no report. Its main now wraps the run the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMXcpeiNdBg6ekmYJWp

The first of the pool invariants that QuantEcon/project-monorepo#11 asks for. They land in CI before step 2 of QuantEcon/project-monorepo#24 promotes the remaining series, so each series' promotion pull request is checked as it lands.
tools/pool-check(new) readslectures/only and needs no mirror;pool-check.ymlruns it on every pull request that touches the pool. It finds references with promote's own parser, so the two tools agree on what a lecture refers to. Each rule it can break is reported under a tag:top-levellectures/holds lectures (<slug>.md) and_static/, nothing elseunderscore_casestatic-entry_static/is a lecture's own folder,_shared/orquant-econ.bibasset-owner_static/<slug>/is used by<slug>.mdaloneroot-relative/_static/...escapeslectures/tools/drift-checkgains twodriftfindings, each an issue that closes itself when the finding clears:name-shared: a lecture name that two canonical-eligible series list in their tocs must be one lecture in both, by promotion's rule, whether the name is in the pool yet or not. This is the uniqueness across the published sites that QuantEcon/project-monorepo#11 asks for, and it keeps the renames of QuantEcon/project-monorepo#76 true. It reads every canonical-eligible series' toc, so the check job now reconstructsjaxas well. A consumer only republishes, sodp's toc is not read for it.toc-unpromoted: an accepted toc lists a lecture the pool does not hold. Accepting a toc clearstoc-changedwhether or not the pool followed it, as the review of promote: take dp's lectures from their home series; retire the dp-test sync source #33 found; this is the check proposed on QuantEcon/project-monorepo#11 after that review.lectures/_static/.gitkeepis removed._static/has had content since the first promotion, and the file is the one thing the layout check finds.Measured before the checks were written (2026-11-04, every series at its pin in
sync/state.yml):maintoday.gitkeeponly--tocfor each,jaxlast).gitkeeponly; the drift-check reads cleanAcross the six tocs, only
autodiff(programming, jax) andpandas_panel(programming, intermediate) are listed by two canonical-eligible series, and each is one lecture in both. All 49 lectures indp's accepted toc are in the ledger.Not in this pull request: the four promote changes that QuantEcon/project-monorepo#11 holds back until the whole-estate promotion shows which of them matter. The scratch run shows that one does, twice:
rob_markov_perf(advanced) shares an asset withmarkov_perf, andarellano_jax(jax) shares one witharellano. Each promotes once it and its partner are promoted in one batch. That belongs to step 2 of QuantEcon/project-monorepo#24.Checks run: the tools' tests (137 pass; the test of names that differ only in case is skipped on a case-insensitive file system, and runs here on Ubuntu), then
tools/pool-check,tools/drift-checkandtools/bib-mergeon a bench at these pins, all clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMXcpeiNdBg6ekmYJWp