Skip to content

README: Jupyter Book 1 for every cutover; mystmd a second phase after them - #110

Merged
mmcky merged 2 commits into
mainfrom
docs/jb1-first
Nov 27, 2026
Merged

mmcky merged 2 commits into
mainfrom
docs/jb1-first

Conversation

@mmcky

@mmcky mmcky commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Why

On 2026-11-27 the owner settled when the engine changes. In the project-monorepo session: "Let's focus on jb1(sphinx) as that makes validation easier and we will treat mystmd as an upgrade to the live sites once the monorepo is established and powering quantecon python lecture sites." This README's stages still said stage 3's workflow builds "on either engine" and stage 9's mystmd builds run "alongside, from stage 3". QuantEcon/project-monorepo#145 brings the project's notes into line, and this PR brings in this repository's README.

What changes

README.md only:

  • The stages paragraph: stages 1 to 8 move every series here on Jupyter Book 1, and stages 9 and 10 are a second phase, an upgrade of the live sites to mystmd once this repository publishes them.
  • Stage 3: builds on Jupyter Book 1, with the engine input coming with mystmd.
  • Stage 9: after the cutovers, as the second phase's first step.
  • Stage 10: the end of the second phase.
  • The status line, from October 2026: stage 3 is under way, every site builds in CI, and the publishing pathway is next.

site-build.yml's "build on mystmd (QuantEcon/actions#337)" note, under what it doesn't do yet, follows in the next change to that workflow. Touching the workflow builds all six sites. No lecture content changes, and no build changes.

Copilot: not requested (Matt, 2026-11-22).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG

mmcky and others added 2 commits November 27, 2026 22:34
… them

The owner, 2026-11-27, in the project-monorepo session: "Let's focus on
jb1(sphinx) as that makes validation easier and we will treat mystmd as
an upgrade to the live sites once the monorepo is established and
powering quantecon python lecture sites." The stages list said stage 3
builds on either engine and stage 9 builds mystmd alongside from stage
3; both now say when. The status line, from October, now says stage 3
is under way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
Stage 9's bold label still said "mystmd builds alongside"; it now reads
"mystmd, after the cutovers", as the plan of record does. The status
line called the publishing pathway next, though it is stage 3 itself,
and gave every site a PDF, though dp publishes none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
@mmcky
mmcky merged commit 9efe41b into main Nov 27, 2026
@mmcky
mmcky deleted the docs/jb1-first branch November 27, 2026 21:16
mmcky added a commit that referenced this pull request Nov 28, 2026
## Why

The last open part of QuantEcon/project-monorepo#77. Its acceptance criteria:
- "A pull request that touches one shared lecture rebuilds every product that lists it and no other";
- "A planted broken lecture fails every product that holds it and no other product's build".

Today every pull request and push to `main` that touches a build input builds all six sites. A fix to one intro lecture also rebuilds intermediate, programming and jax on the GPU machines. For pushes to `main` the owner chose the same narrowing on 2026-11-27, in the project-monorepo session: "Affected only (Recommended)". The schedule and a manual run still build every site.

## What it adds

- **`tools/affected-sites`** reads the changed paths and prints the sites, of those named, that they reach:
  - a lecture, or its own `_static/<slug>/` files: the sites whose `_toc.yml` lists it, at any depth of parts, chapters and sections;
  - a `_static/_shared/` asset: the sites of the lectures the ledger records as using it, or every site when it records none;
  - a `_static/<dir>/` that is no pool lecture's folder: every site;
  - a site's own file: that site (`sites/README.md` reaches none);
  - `tools/sync` and `sync/state.yml`: the sites in the `series` environment, here or at the base, since only those run `tools/sync` (today dp). `sync.yml`'s near-daily pin refresh starts no run, but the next push takes it in, and it builds dp alone;
  - any other build input: every site. That covers the bibliography, any other pool file, a build tool, `_base/`, `sync/manifest.yml` (which `tools/stage-site` reads for every site) and the workflow. These are the workflow's path filter outside the pool and the sites, and a test keeps the two lists in step;
  - anything else (documentation, the tests, another workflow, the other sync records): none.

  With `--base`, the contents lists and the ledger are read at the base too. So a lecture a change drops still builds the sites that listed it, and a shared asset its old users' sites. Paths come NUL-separated with `-z`. The tool refuses a `--base` that is no commit, and a contents list or ledger it can't parse, with exit 2. Links between sites don't widen the set: intersphinx resolves them against the other site's published inventory, not this build.
- **`site-build.yml`**'s first job chooses the sites:
  - **A pull request** is compared with its base.
  - **A push** is compared with the head of the last build on `main` that succeeded, not the commit before it. That build may be a push, scheduled or manual one, but never a pull request's. A run cancelled while it waits (the concurrency group keeps one waiting), cancelled by hand, or failed then leaves nothing unbuilt: the next push takes its change in. A step of its own reads that run through the API, with `actions: read`. It runs only on a push, and is the only step that holds the token.
  - **While a site stays red on `main`,** no build succeeds, so each push builds all that has changed since the last green build. The header says to mend a red site first. It also says to re-run an older push build's failed jobs, not all its jobs.
  - **The schedule and a manual run** take every site, and so does a base that can't be found or fetched.
  - The diff is `git diff --no-renames --name-only -z`. A renamed or moved file counts by its old path as well as its new one, and a name git would quote keeps its bytes. Only the base commit is fetched: a diff of two trees needs no history.
  - **A change to the rule itself** (the tool or this workflow) builds every site without asking the tool, so a broken tool can't skip its own build.
  - The job writes "Sites built: … " and the reason to the run summary. When a change reaches no site, the build job is skipped, since GitHub refuses an empty matrix.
- **The header:** who builds what, and how a push is compared. "What it does not do" now puts mystmd and the shared cache in the second phase, after the cutovers, which takes in the note deferred from #110.
- **Docs:** README's build paragraph and tools table, and `sites/README.md`'s "Building a site in CI".

## Checked

- **Tests:** 501 passed and 1 skipped. They cover:
  - every rule (24 cases), including a section nested in a part and the series inputs;
  - a site moved out of the series environment, read at the base, and a site with no `site.yml`;
  - over a real git history: a dropped lecture, the ledger read at the base, a renamed lecture, an asset moved between two lectures' folders, and a name git would quote;
  - a key with no site, a base that is no commit, and a contents list that can't be parsed;
  - the workflow, read for its path filter (both events), its diff flags, the rule check, the push base's query step, and that only that step holds the token.

  Six of the new tests fail on the first version of the tool, and dropping the ledger's base reading fails one. actionlint and pool-check are clean.
- **On the real pool,** with the workflow's own diff command:
  - `git mv lectures/os_stochastic.md lectures/os_stochastic_v2.md` builds dp and intermediate;
  - moving an `about_py` figure into `os_stochastic`'s folder builds dp, programming and intermediate;
  - a new `_static/lecture_specific/…` builds all six;
  - `about_py/café.png` builds programming;
  - the pin refresh `fc2ea1f` builds dp alone.
- **On tonight's merges** (each squash commit against its parent):

  | Merge | Sites it would build |
  |---|---|
  | the refresh #107 (two intro lectures) | intro alone, instead of all six |
  | #101 (pool-check, its tests, `sites/README.md`) | none; it built all six |
  | #110 (the README) | none |
  | #106 (`site-build.yml`) | all six |
  | #109 (`tools/stage-site`) | all six |

- **Real runs, each from a throwaway draft against this branch, now closed:**
  - #112 planted a failing cell in a lecture that dp and intermediate list. Only those two legs ran, and both failed in the strict build on the planted error.
  - #113 changed only `sites/README.md`. The matrix job reported no site, and the build job was skipped.

  The evidence comments below have the details.
- **This PR's own build** changes the workflow, so it builds all six: the "rule itself" path.
- **The push path** can't run before the merge. Its query, run now against this repository, returns 31f29fc (#101), the last build on `main` that succeeded. The first push after the merge carries this workflow, so it builds all six. The "Sites built" summaries of the first two push builds on `main` are to be read after the merge. The first should say it touches the rule, against 31f29fc. The second should be compared with the merge commit, if the first went green.

The validation rule: this changes which sites build, not how. The legs that run are unchanged steps, so a full output comparison isn't needed. The planted test is the evidence.

Copilot: not requested (Matt, 2026-11-22).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
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.

1 participant