Skip to content

pool-check: check the pool's layout; drift-check: names across the sites - #35

Merged
mmcky merged 2 commits into
mainfrom
pool-check/invariants
Nov 4, 2026
Merged

mmcky merged 2 commits into
mainfrom
pool-check/invariants

Conversation

@mmcky

@mmcky mmcky commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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) reads lectures/ only and needs no mirror; pool-check.yml runs 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:

Tag Rule
top-level lectures/ holds lectures (<slug>.md) and _static/, nothing else
underscore no lecture's name starts with _
case no two lectures' names differ only in case
static-entry every entry at the top of _static/ is a lecture's own folder, _shared/ or quant-econ.bib
asset-owner a file in _static/<slug>/ is used by <slug>.md alone
root-relative asset references are file-relative, never /_static/...
escapes no reference leaves lectures/

tools/drift-check gains two drift findings, 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 reconstructs jax as well. A consumer only republishes, so dp's toc is not read for it.
  • toc-unpromoted: an accepted toc lists a lecture the pool does not hold. Accepting a toc clears toc-changed whether 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/.gitkeep is 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):

Pool Lectures Assets What the checks find
main today 52 32 .gitkeep only
A scratch copy with every series promoted (--toc for each, jax last) 323 147 .gitkeep only; the drift-check reads clean

Across the six tocs, only autodiff (programming, jax) and pandas_panel (programming, intermediate) are listed by two canonical-eligible series, and each is one lecture in both. All 49 lectures in dp'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 with markov_perf, and arellano_jax (jax) shares one with arellano. 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-check and tools/bib-merge on a bench at these pins, all clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMXcpeiNdBg6ekmYJWp

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
Copilot AI balanced review requested due to automatic review settings November 4, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-check with new drift findings (name-shared, toc-unpromoted) and associated tests.
  • Update documentation and remove lectures/_static/.gitkeep to satisfy the new pool layout rule.

Approval Readiness

This pull request requires changes.

  • tools/drift-check (moderate): check_names selects base from the ledger’s canonical series even when that series isn’t in holders, which can produce false name-shared drift comparisons against a non-publishing canonical copy.
  • tools/pool-check (moderate): The tool documents exit status 2 for errors, but unexpected exceptions can bubble up and typically exit 1, 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

Comment thread tools/drift-check Resolved
Comment thread tools/pool-check Resolved
…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
@mmcky
mmcky merged commit c511954 into main Nov 4, 2026
5 checks passed
@mmcky
mmcky deleted the pool-check/invariants branch November 4, 2026 03:21
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.

2 participants