Skip to content

sites/: one folder per published site, with the checks that keep them true - #64

Merged
mmcky merged 3 commits into
mainfrom
sites-21
Nov 16, 2026
Merged

mmcky merged 3 commits into
mainfrom
sites-21

Conversation

@mmcky

@mmcky mmcky commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

One folder per published site, sites/<key>/, for all six series, with the checks that keep them true. For QuantEcon/project-monorepo#21; its Done when (every site builds through the build workflow) follows with the workflow and dp's first build (QuantEcon/project-monorepo#25, QuantEcon/project-monorepo#77), so this does not complete it.

The folder is sites/, not products/

By the owner's decision of 2026-11-17: every entry is exactly one published site, and a future course or reader is also one site. The empty products/ placeholder goes, and the vocabulary follows in the tools, tests, README and workflow comments (tools/promote's PRODUCT_PAGES becomes SITE_PAGES, same behaviour; only a skip message's wording changes). "Product" stays only where it quotes history.

What each sites/<key>/ holds

  • The series' _config.yml and _toc.yml, verbatim at the pin, plus additions on lines marked # site addition. Removing every marked line gives back the series' file byte for byte. The additions: a per-site execution cache (_build/jupyter_cache/<key>); intersphinx_disabled_reftypes: [] where the series lacks it; the site mapping itself in intersphinx_mapping where it lacks that (dp, a consumer, maps nothing: no site maps dp); only_build_toc_files: true for programming and advanced, so a build reads only the site's lectures; and, in dp's toc, mccall_risk after mccall_fitted_vfi (decided 2026-10-09 on QuantEcon/project-monorepo#76).
  • The site's own pages (intro, status, troubleshooting, zreferences, about, about_jax, as each series has them) and its branding and page assets under _static/, byte-identical to the series.
  • site.yml, the fields the build workflow reads:
Site runner cell_timeout publishes url
intro ubuntu-latest 600 html, pdf, notebooks https://intro.quantecon.org/
programming g4dn.2xlarge 600 html, pdf, notebooks https://python-programming.quantecon.org/
intermediate g4dn.2xlarge 2400 html, pdf, notebooks https://python.quantecon.org/
advanced ubuntu-latest 7200 html, pdf, notebooks https://python-advanced.quantecon.org/
dp ubuntu-latest 2400 html https://quantecon.github.io/lecture-dp/
jax g4dn.2xlarge 2400 html, pdf, notebooks https://jax.quantecon.org/

Runner and outputs come from each series' publish.yml and ci.yml at its pin; cell_timeout is execute: timeout (no series sets a job time limit); url is html.baseurl. dp publishes HTML only.

sites/README.md records the fields, every deviation from verbatim, how to stage and build a site locally, and the rules from QuantEcon/project-monorepo#22 and QuantEcon/project-monorepo#76: every site maps itself, no site maps dp, names are unique across the published sites, and a link with no target in the site resolves on the lecture's home site.

Tools and checks

  • tools/stage-site <key> copies a site's pages and _static into the pool folder before jb build (the copy step the owner ruled), refusing any destination that already exists, and records what it copied in _build/stage-site.json. --clean removes only what that record lists, while its bytes are still the site's.
  • tools/pool-check gains five rules, run on every pull request that touches lectures/ or sites/: site-layout, site-toc (every entry a pool lecture or a site page), site-page (no site file shares a path with the pool), site-config (branding present, the required additions present, no consumer mapped, a non-consumer mapped to its url; a section of the wrong type is a finding, not a crash) and site-yml.
  • tools/drift-check gains site-stale: after every sync, each site file is compared with the series' copy at the pin (additions removed); a difference is a drift issue that closes itself when the site is brought into step.

Checked

  • 253 passed, 1 skipped (tools/tests/test_sites.py and the drift-check tests are new). tools/pool-check, tools/assets-report --check-index and tools/drift-check are clean on the tree.
  • dp, programming and intro were staged and built locally with Jupyter Book 1 (-n -W --keep-going, execution off). The only warnings came from execution being off; no {doc} link or cross-reference failed, and the out-of-site links resolved to their home sites. A real, executing build is QuantEcon/project-monorepo#25's. A strict build is stricter than intro's and advanced's own publish builds; that is for QuantEcon/project-monorepo#25 to settle per site.

Review

An independent adversarial review found no blocking defect; its two should-fix findings (a clean that could remove a tracked file identical to a site file, and no watch on the copied files upstream) and five minor ones are settled in the third commit, each with a test.

Lecture content is unchanged: no file under lectures/ changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMXuHMiWb8victibwcU

mmcky and others added 3 commits November 17, 2026 10:15
…, and stage-site

Implements QuantEcon/project-monorepo#21 and records the cross-reference
policy of QuantEcon/project-monorepo#22.

- products/ is renamed sites/ (owner, 2026-11-17), and the vocabulary with
  it: promote's PRODUCT_PAGES is SITE_PAGES (same pages, same behaviour),
  pool-check and drift-check say "site page", the README's model is
  mirror -> pool -> sites.
- sites/<key>/ for intro, programming, intermediate, advanced, dp and jax:
  the series' _config.yml and _toc.yml verbatim at the pins in
  sync/state.yml, with each addition marked in place; the site's own pages
  and branding verbatim; site.yml with type, runner, time_limit, publishes
  and url, each sourced in a comment. sites/README.md records the fields,
  every deviation from verbatim, how to stage and build, and the rules.
- dp's _toc.yml adds mccall_risk after mccall_fitted_vfi (#21, 2026-10-08).
- tools/pool-check checks the sites (site-layout, site-toc, site-page,
  site-config, site-yml); pool-check.yml runs on sites/** too.
- tools/stage-site copies a site's pages and _static/ files into lectures/
  before a build and removes them after; it never overwrites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMXuHMiWb8victibwcU
…eview's fixes

From the independent review of sites-21:

- tools/stage-site never removes a file it did not copy. Staging refuses any
  destination that exists, whatever its bytes, and records what it copies,
  and the folders it makes, in _build/stage-site.json (git-ignored, outside
  the pool); --clean removes only what the record lists, each file while its
  bytes are the ones copied. One site at a time. It takes only a key that
  names a site folder (_toc.yml and site.yml), never `.` or `..`.
- tools/drift-check reports site-stale (drift, so an issue that closes
  itself): every file in a series' sites/<key>/ but site.yml is compared
  with the series' lectures/<path> at the pin, _config.yml and _toc.yml with
  the site's additions removed. Every added line now holds the marker
  `# site addition`, so removing those lines gives the series' file back
  exactly; the six sites' additions are re-marked that way.
- tools/pool-check also requires only_build_toc_files: true and the site's
  own execute.cache, and reports a _config.yml section of the wrong type as
  site-config instead of crashing.
- README: cell_timeout in the summary of site.yml; sites/README.md records
  the markers, the record, site-stale, and that -n -W is stricter than
  intro's and advanced's own publish builds (#25 settles it per site).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMXuHMiWb8victibwcU

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.

🔵 Needs a closer look

The change adds new site staging semantics and CI-gating drift/pool checks whose real-world behavior in Jupyter Book builds and GitHub Actions runners needs human validation beyond what unit tests can confirm.

No open issues 🎉

What changed in this PR

Introduce a first-class sites/<key>/ layer (one folder per published site) and update tooling/CI checks so each site’s configs, pages, assets, and metadata stay consistent with the pool and upstream series pins.

Changes:

  • Add sites/<key>/ folders (configs, TOCs, site pages/assets) plus site.yml metadata for each published site.
  • Add tools/stage-site to stage/clean site-only pages and _static/ assets into/out of lectures/ for builds.
  • Extend tools/pool-check and tools/drift-check with site-aware validation and drift detection; update workflow/tests/docs and terminology (products → sites).
File Description
tools/​tests/​test_sites.py Adds new tests covering site validation rules, stage-site staging/cleaning behavior, and drift-check’s site-stale behavior.
tools/​tests/​test_site_pages.py Updates tests and terminology from “product pages” to “site pages” and adjusts expectations accordingly.
tools/​tests/​test_pool_check.py Updates pool-check test expectations, including wording changes to refer to “site pages”.
tools/​tests/​conftest.py Adjusts test harness setup so scratch repos include and can invoke the new tools/stage-site tool.
tools/​stage-site Introduces a new CLI tool to copy a site’s pages and _static/ assets into the pool for builds and safely clean only what it staged.
tools/​promote Renames PRODUCT_PAGES to SITE_PAGES and updates related wording while keeping behavior consistent.
tools/​pool-check Extends pool-check with site-focused rules validating sites/<key>/ structure, toc/page resolution, config invariants, and path collisions.
tools/​drift-check Adds a site-stale drift rule to compare committed site copies against upstream series pins (with site additions stripped) and updates wording to “sites”.
sync/​toc.yml Updates comments/wording to reflect that per-site TOCs live under sites/<key>/.
sites/​README.md Adds documentation for the sites/ layout, site.yml fields, invariants, staging workflow, and deviation rules.
sites/​programming/​troubleshooting.md Adds the programming site troubleshooting page under sites/programming/.
sites/​programming/​status.md Adds the programming site status page under sites/programming/.
sites/​programming/​site.yml Adds site.yml for the programming site with build/workflow metadata (runner, outputs, timeouts, URL).
sites/​programming/​intro.md Adds the programming site intro/landing page under sites/programming/.
sites/​programming/​_toc.yml Adds the programming site TOC selecting pool lectures and site pages for builds.
sites/​programming/​_config.yml Adds the programming site Jupyter Book configuration, largely verbatim with marked site-specific additions.
sites/​jax/​zreferences.md Adds the jax site references page under sites/jax/.
sites/​jax/​troubleshooting.md Adds the jax site troubleshooting page under sites/jax/.
sites/​jax/​status.md Adds the jax site status page under sites/jax/.
sites/​jax/​site.yml Adds site.yml for the jax site with build/workflow metadata (runner, outputs, timeouts, URL).
sites/​jax/​intro.md Adds the jax site intro/landing page under sites/jax/.
sites/​jax/​about_jax.md Adds the jax site “about JAX” page under sites/jax/.
sites/​jax/​_toc.yml Adds the jax site TOC selecting pool lectures and site pages for builds.
sites/​jax/​_config.yml Adds the jax site Jupyter Book configuration, largely verbatim with marked site-specific additions.
sites/​intro/​zreferences.md Adds the intro site references page under sites/intro/.
sites/​intro/​troubleshooting.md Adds the intro site troubleshooting page under sites/intro/.
sites/​intro/​status.md Adds the intro site status page under sites/intro/.
sites/​intro/​site.yml Adds site.yml for the intro site with build/workflow metadata (runner, outputs, timeouts, URL).
sites/​intro/​intro.md Adds the intro site landing page under sites/intro/.
sites/​intro/​about.md Adds the intro site about page under sites/intro/.
sites/​intro/​_toc.yml Adds the intro site TOC selecting pool lectures and site pages for builds.
sites/​intro/​_config.yml Adds the intro site Jupyter Book configuration, largely verbatim with marked site-specific additions.
sites/​intermediate/​zreferences.md Adds the intermediate site references page under sites/intermediate/.
sites/​intermediate/​troubleshooting.md Adds the intermediate site troubleshooting page under sites/intermediate/.
sites/​intermediate/​status.md Adds the intermediate site status page under sites/intermediate/.
sites/​intermediate/​site.yml Adds site.yml for the intermediate site with build/workflow metadata (runner, outputs, timeouts, URL).
sites/​intermediate/​intro.md Adds the intermediate site landing page under sites/intermediate/.
sites/​intermediate/​_toc.yml Adds the intermediate site TOC selecting pool lectures and site pages for builds.
sites/​intermediate/​_config.yml Adds the intermediate site Jupyter Book configuration, largely verbatim with marked site-specific additions.
sites/​dp/​zreferences.md Adds the dp site references page under sites/dp/.
sites/​dp/​status.md Adds the dp site status page under sites/dp/.
sites/​dp/​site.yml Adds site.yml for the dp site with HTML-only publishing metadata used by workflows.
sites/​dp/​intro.md Adds the dp site landing page under sites/dp/.
sites/​dp/​_toc.yml Adds the dp site TOC selecting pool lectures and site pages (including the documented dp-specific ordering change).
sites/​dp/​_config.yml Adds the dp site Jupyter Book configuration, largely verbatim with marked site-specific additions.
sites/​advanced/​zreferences.md Adds the advanced site references page under sites/advanced/.
sites/​advanced/​troubleshooting.md Adds the advanced site troubleshooting page under sites/advanced/.
sites/​advanced/​status.md Adds the advanced site status page under sites/advanced/.
sites/​advanced/​site.yml Adds site.yml for the advanced site with build/workflow metadata (runner, outputs, timeouts, URL).
sites/​advanced/​intro.md Adds the advanced site landing page under sites/advanced/.
sites/​advanced/​_toc.yml Adds the advanced site TOC selecting pool lectures and site pages for builds.
sites/​advanced/​_config.yml Adds the advanced site Jupyter Book configuration, largely verbatim with marked site-specific additions.
README.md Updates repository documentation to describe the mirror → pool → sites model and the related tools/checks.
products/​.gitkeep Removes the obsolete products/ placeholder file as the repository vocabulary shifts to sites/.
.github/​workflows/​pool-check.yml Updates the pool-check workflow to run when sites/** changes and reflects site-related checks in comments.
_base/​README.md Updates placeholder documentation wording from “product” to “site”.

Review effort: Balanced

@mmcky
mmcky merged commit 2bb7cec into main Nov 16, 2026
6 checks passed
@mmcky
mmcky deleted the sites-21 branch November 16, 2026 23:47
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