Repository navigation
fix(build-lectures): check a page taken from the execution cache for error outputs (#322) - #326
Merged
Merged
Conversation
…error outputs (#322) myst-nb 1.4.0 renders a page it takes from the execution cache from jupyter-cache's merged copy, but writes the notebook it read, without outputs, to _build/jupyter_execute. The error-outputs check read only those, so it saw nothing on any page a build did not execute itself: a pull request's build over a restored execution cache, and a later build that rereads the pages, as html does after pdflatex in a book with parts. Wherever myst-nb looks in the cache for a page (cache mode, no exclude pattern, after the notebook's own mystnb overrides), the check now matches the written notebook against the cache with myst-nb's own two jupyter-cache calls and checks the merged copy. A notebook with no match is checked as written; a cache that cannot be read is reported as an unreadable notebook is. The config mirror cites the upstream lines it follows. The new harness job build-cache-error-guard executes a display-time error into the cache, then builds with fail with --all over the same _build and over the execution cache alone. Both pass on today's check (run 43694544644). The comment in action.yml, the build-lectures chapter and build-jupyter-cache's Behaviour 3 are corrected, including the rereading after pdflatex in a book with parts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMaaUb1oFVdDs82xVHp
Contributor
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.
🔵 Needs a closer look
The change affects scheduled lecture-matrix build-lectures behavior and the PR notes it must only be merged after the 2026-11-16 02:00 UTC run with organiser confirmation, requiring human coordination before proceeding.
No open issues 🎉
What changed in this PR
Fixes build-lectures error-output detection for pages rendered from the myst-nb execution cache by validating outputs against the cache’s merged notebook copy (so cached tracebacks can’t slip through).
Changes:
- Update
check-error-outputs.pyto mirror myst-nb/jupyter-cache cache lookup and check the cached merged notebook when a page is served from cache. - Add a CI harness job to reproduce the cached-page failure mode and prevent regressions (including restored-cache scenarios).
- Update action docs and changelog to reflect the corrected cached-page behavior and its implications.
| File | Description |
|---|---|
| docs/user/actions/build-lectures.md | Documents how error-output checking works for cached pages and how unreadable caches are reported, including the reread-after-pdflatex “book with parts” case. |
| docs/user/actions/build-jupyter-cache.md | Clarifies builder behavior around rereading pages after pdflatex and how cached-page outputs are checked across builders. |
| docs/dev/TESTING.md | Updates the testing matrix to include the new build-cache-error-guard harness job for build-lectures. |
| CHANGELOG.md | Adds an Unreleased entry noting the fixed cached-page error-output checking behavior and its potential impact. |
| build-lectures/check-error-outputs.py | Implements cache-aware error-output checking by mirroring myst-nb/jupyter-cache rules for locating and validating cached merged notebook outputs. |
| build-lectures/action.yml | Updates the inline comment to explain that cached pages may be written without outputs and are therefore checked via the cache copy. |
| .github/workflows/test-actions.yml | Adds the build-cache-error-guard job to assert cached display-time errors fail under error-outputs: fail for both rereads and restored-cache-only builds. |
Review effort: Balanced
This was referenced Nov 15, 2026
build-lectures: report Python warnings in cell outputs, as
warning-outputs beside error-outputs
#330
Open
mmcky
added a commit
that referenced
this pull request
Nov 16, 2026
) (#331) Part of #302. Closes #310. This is the last of the three PRs the maintainer approved on 2026-11-15. PR A, #328, added the watcher. PR B, QuantEcon/test-actions-lecture-intro#94, realigned the canary's workflows with `templates/` at `v0` and scheduled `ci.yml` and `publish.yml` on Sunday. This PR adds the drift check that keeps them aligned, the four follow-ups from #328's review, and the docs. ## Why The canary is only worth watching while it runs what consumers run. Before #94 its `ci.yml`, `cache.yml` and `publish.yml` had drifted a long way from `templates/` without anyone noticing, and the next release that changes a template would start the same drift again. A comparison read through the API every day reports that drift as it happens, and it also catches the opposite case: a declared difference that has quietly stopped being true. ## Changes | File | What | |---|---| | `scripts/canary-drift.py` | New. It reads the canary's `ci.yml`, `cache.yml`, `publish.yml` and `restore.yml`, and `templates/` at the commit `v0` points to, and compares each pair as YAML. `--self-test` runs it on small workflows, loads the real declarations file, and checks `canary-watch.yml`'s schedule filters | | `.github/canary-drift.yml` | New. Every difference the canary's file headers declare, each with its reason, and where the canary must hold a value, that value: 17 for `ci.yml`, 1 for `cache.yml`, 16 for `publish.yml`, none for `restore.yml` | | `.github/workflows/canary-watch.yml` | A `drift` job beside `watch`, which runs on every run of the workflow, and a `drift-report` job after `report`, on the same issue. Both checks' verdicts go through one `--verdict` step | | `scripts/canary-watch.sh` | The four #328 follow-ups (below); `TOPIC`, which picks the check whose record a report keeps on the canary issue, `runs` or `drift`; `--verdict FILE STATUS HEADING`, which writes the summary and the job's outputs | | `.github/workflows/test-actions.yml` | The `canary-watch` job self-tests the drift script too, in a venv with the pinned PyYAML. Both scripts, the declarations file and `canary-watch.yml` are on the gate's must-run list | | `docs/dev/TESTING.md` | The canary as #94 left it, with its schedules and marker checks; which deploy its GitHub Pages site shows; the watcher's two checks; the gate's build cache restored "as lecture-dp's `ci.yml` does"; and "What is not covered" brought up to date | | `CONTRIBUTING.md` | Staged Releases: the lecture matrix at the candidate, for a release that changes what a build reports; dispatching the canary's `cache.yml`, `ci.yml` and `publish.yml` once `v0` has moved; and the Sunday hours to keep the gate out of | | `docs/dev/PLAN.md` | The canary paragraph and item 0c say where #302 stands, since they described the canary as it was before #94. The Release gating row lists #302 alone, and the Testing row drops #100, which is closed | | `docs/user/versioning.md` | A staged release is described as passing the release gate, not as the canary's previews and cache build against the new tag, with a link to CONTRIBUTING's Staged Releases | | `CHANGELOG.md` | A Documentation entry for the release-process change. As with #328, the CI itself gets no entry, since it ships to no consumer | **What the drift check compares.** Each workflow is flattened into dotted paths. A list item is keyed by its `name`, then `id`, then `uses`, then its index. Comments and key order do not count. Values are compared with their types, so YAML's `true` is not its `1`. A path in the declarations covers everything beneath it, except an `if`, `continue-on-error` or `permissions` key, which a declaration covers only by naming it or by giving a value that holds it. Red findings: | Finding | Example | |---|---| | A difference that nothing declares | A template gains a step that the canary's copy lacks | | A declared difference that no longer differs | The canary goes back to the template's `cron`, and the declaration stays | | A declared `value`, a mapping or list included, that the canary no longer holds | `jobs.build.container.image` changes in the canary but not in the declarations | | A `quantecon/actions` action that does not run at `@v0`, declared or not | `preview-cloudflare@main` in a declared Cloudflare step | | An `if`, `continue-on-error` or `permissions` key that no declaration names | `if: false` on the declared "Check both previews serve this build" step | | The steps both workflows have, in another order | A step moved above the one it followed in the template | | A workflow, or `v0`, that cannot be read | The API is down, or the canary's file is not YAML | It lists at most eight problems per workflow, then "and N more". Step names are escaped, so none can put a line of its own in the log. The commit `v0` was read at is on a line of its own, outside the red lines that the report hashes, so a red that persists across a `v0` move is not reported again. A declarations file in the wrong shape, such as an entry with no `why` or a path listed twice, stops the check. It is then reported as a stopped watcher, with the reason in the run's log. **One issue, as #302's ruling has it.** Both checks report on `🔴 Canary watch: QuantEcon/test-actions-lecture-intro`, labelled `canary`. Each keeps its own record there, a marker of its own, so one check's state never stands for the other's, and the drift report runs after the runs report, so that two reports never open two issues. A check with no record on the open issue says in full what it found when it turns red, and adds nothing when it is green. **The four #328 follow-ups:** 1. **`markers()` fails loudly.** If the issue or its comments cannot be read, the report stops and records nothing. Before, it found no markers and commented again. 2. **The markers' author is an input.** `MARKER_AUTHOR` defaults to `github-actions[bot]`, is set in the workflow's `env`, and must look like a login. 3. **One stopped text.** `STOPPED` is defined once in the script. The workflow gets it through `--verdict`, which adds it whenever a check exits non-zero without writing a 🔴 line. Nothing else prints it. 4. **A missing label lists nothing.** `gh issue list --label` on a label that does not exist returns `[]` and exits 0; checked today with gh 2.104.0. A comment in `report()` now says so. ## Departures from the ruling 1. **Daily, not weekly.** The drift job runs on the watcher's daily schedule, so a `v0` move that changes a template shows the next morning, and a comment is made only when the findings change. To go weekly: add a weekly cron to `on.schedule`, and give the `drift` job `if: github.event.schedule != '30 6 * * *'`, as the comment above the job says. That filter skips one cron, so a cron edited later runs the job more often, never less, and the drift check's self-test fails on a filter that names a cron the workflow does not have. 2. **Third-party actions' versions are not compared.** The canary's Dependabot moves its `actions/*` pins on its own schedule, while the templates move only with a release, so comparing them would turn drift red after every Dependabot merge. To compare them: set `DRIFT_COMPARE_VERSIONS: 'true'` in `canary-watch.yml`'s env. ## What I checked, and how **The review's findings, red first.** A throwaway branch, `scratch/302-review-fixes`, ran each finding through d8f745a's code and through this PR's, in [run 43785403141](https://github.com/QuantEcon/actions/actions/runs/43785403141), on bash 5.3. The branch is deleted. Each finding was applied to the canary's real workflows, read at its `main`, and to `templates/` at `v0`: | Finding | d8f745a | Now | |---|---|---| | `preview-cloudflare@main` in either Cloudflare step | ✅ Green | 🔴 "runs `quantecon/actions/preview-cloudflare@main`, where the canary runs every `quantecon/actions` action at `@v0`" | | `build-lectures@main` in publish's Build PDF step | ✅ Green | 🔴 The same, for `jobs.build.steps[Build PDF].uses` | | `[email protected]` in `jobs.release-assets` | ✅ Green | 🔴 The same, for its "Attach the site to the release" step | | `permissions: write-all` on `jobs.release-assets` | ✅ Green | 🔴 "is `write-all` here, where the declarations give `{contents: write}`" | | `if: false` on "Check both previews serve this build" | ✅ Green | 🔴 "is `false` here, where the declarations give `github.event_name != 'pull_request'`" | | `continue-on-error: true` on the same step | ✅ Green | 🔴 "is only in the canary" | | Two steps swapped | ✅ Green | 🔴 "`jobs.build.steps` has `Build` before `Checkout` here, and after it in the template" | | `fetch-depth: true` for the template's `1` | ✅ Green | 🔴 | | A declared value on a mapping path that the canary does not hold | ✅ Green | 🔴 | | The red line at two `v0` commits | Differs, so a new comment | The same: no commit in it | | A step named `"x\n::warning::y"` | A `::warning::` line of its own in the finding | One line, escaped | | `canary-watch.yml`'s drift job filter, and the same file with line 29's cron edited | Not checked | 🔴 "runs on a schedule only when it is '30 6 * * *'"; this PR's workflow ✅ | | d8f745a's `canary-watch.sh` with this PR's self-test | | 🔴 13 cases, all the one-issue ones; this PR's script ✅ | The same run's live check, as the watcher runs it, is green: `ci.yml` matches `templates/ci.yml` at `v0` apart from 17 declared differences, `cache.yml` 1, `publish.yml` 16, and `restore.yml` exactly. The four new declarations are the guarded keys the canary has: the preview check's `if`, the release-asset upload's `if`, and `jobs.release-assets`' `if` and `permissions`, each the template's own, uncommented. **Earlier rounds.** The drift check, read live from the canary: a throwaway branch, `scratch/302-drift-checks`, ran it in [run 43781530288](https://github.com/QuantEcon/actions/actions/runs/43781530288), through the same `--verdict` step the watcher uses, at d8f745a's parent; the branch is deleted. The declaration counts below are from then. | Job | Result | What it printed | |---|---|---| | Drift, canary at its `main` (32cab47) | ✅ Green | `cache.yml` matches `templates/cache.yml` at `v0` (f7e98be), apart from 1 declared difference; `ci.yml` 16; `publish.yml` 13; `restore.yml` exactly | | Drift, canary at afd76d2, before #94 | 🔴 Red, as it must be | `cache.yml`, `ci.yml` and `publish.yml` have drifted, for example the old `Build and Cache` step, which is only in the canary, and declared values that are absent there; `restore.yml` ✅ | | main's `canary-watch.sh` (c596497) with this PR's self-test, the label's old description put back | 🔴 Red, as it must be | Exactly the 18 new cases fail: `MARKER_AUTHOR`, an unreadable issue or comments, the drift topic, `TOPIC` and `MARKER_AUTHOR` validation, `--verdict` and `--stopped`, since removed. Every older case passes | | This PR's `canary-watch.sh` | ✅ Green | The self-test passes on bash 5.3 | **Locally,** both self-tests pass, on bash 3.2 and Python with PyYAML 6.0.3. So do `generate-docs.py --check --check-examples --actionlint`, `actionlint` and `scripts/lint-shell.py`, with actionlint 1.7.12 and shellcheck 0.11.0. The new TESTING.md text was checked against the canary's workflows: `gate.yml`'s deploy job, `publish.yml` and `restore.yml` share the `pages` concurrency group, and only the gate and `publish.yml` read their deploy back. In CONTRIBUTING, the lecture matrix command depends on `test-containers-lectures.yml` running `./actions-repo/*` from a checkout of `github.sha` and filing no issue on a dispatch, which I confirmed in the file. No canary workflow was dispatched for this PR. Every read of the canary went through the API. ## What to watch after merge - **The first scheduled run,** at 06:30 UTC after the merge, should show both checks green: `cache.yml`'s scheduled run, and the four workflows matching `templates/` at `v0`. Being green, it files nothing. - **A release that changes a template** turns the drift check red until a canary pull request realigns the copy, or updates `.github/canary-drift.yml` if the difference is deliberate, unless the change is to a third-party action's version or under a declared path. That red is intended: the issue says which paths to fix. - **#326 also adds to `## [Unreleased]`.** Whichever PR merges second gets a small CHANGELOG conflict at that heading: keep both entries, with `### Fixed` after `### Documentation`. ## What the drift check does not see These are in TESTING.md's canary section too: - **A declared path's own content.** A step only the canary has can change its script or inputs, or the action it runs if that is not `quantecon/actions`', and stay green. - **New keys under a declaration with no value.** A future `v0` that adds `on.pull_request.types` or `workflow_dispatch.inputs` to `templates/ci.yml` stays green, under the value-less `on.pull_request` and `on.workflow_dispatch` declarations. ## Not in this PR - **`ci.yml` and `publish.yml` on the watch list.** A one-line PR adds them to `CANARY_WORKFLOWS` after their first scheduled runs on Sunday 2026-11-22, as the organiser ruled. Until then the watcher reads `cache.yml` alone. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WT8bMaEFAot565L8kcyAcz
Brings in #328, #329 and #331. CHANGELOG.md conflicted under [Unreleased]: #331's Documentation entry now comes before #322's Fixed entry, in the file's section order. test-actions.yml and docs/dev/TESTING.md merged cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMaaUb1oFVdDs82xVHp
Merged
mmcky
added a commit
that referenced
this pull request
Nov 16, 2026
Cuts v0.21.0, a minor release, because it carries a change marked⚠️ BREAKING: #326, for #322. `build-lectures`' `error-outputs` check now checks a page taken from the execution cache, which it used to pass unchecked. `v0` is on v0.20.1, and moves to v0.21.0 only after the release gate and the lecture matrix have passed it. ## What's in it | Change | PR | Issue | |---|---|---| |⚠️ BREAKING `build-lectures`: the `error-outputs` check reads a page taken from the execution cache from the cache's copy, as myst-nb renders it, and checks its outputs | #326 | #322 | | Docs: a release that changes what a build reports dispatches the lecture matrix at the candidate, and once `v0` has moved, the canary's `cache.yml`, `ci.yml` and `publish.yml`. TESTING describes the canary watcher and its drift check, and the user manual's versioning page says a staged release passes the release gate | #328, #331 | #302, #310 | | Docs: which actions live here, and the README's "Standalone actions" table | #332 | | **What breaks.** A site whose cached pages carry an error traceback now fails its build where it used to pass: in a pull request's build over a restored execution cache, as `templates/ci.yml` sets up, and in a later build that rereads the pages, as `html` does after `pdflatex` in a book with parts. Such a site can fix the cell, tag a deliberate one `raises-exception`, or set `error-outputs: 'warn'` meanwhile. An execution cache the check can't read is now reported as an unreadable notebook is, which also fails the step under `fail`, the default. The inputs, the output and the annotations are unchanged. Also merged since v0.20.1, with no entry of their own: - #325 and #329, PLAN only; - the canary watcher's workflow and scripts (#328, #331). They run in this repository and reach no consumer; the Documentation entry above covers them. ## Changes in this PR | File | Change | |---|---| | `CHANGELOG.md` | `## [0.21.0] - 2026-11-16` below an empty `## [Unreleased]` | | `docs/dev/PLAN.md` | The release line: the latest release is v0.21.0, and `@v0` is on v0.20.1 until the gate has passed it | The date is today's in UTC. ## What I checked - **The CHANGELOG:** the diff adds 2 lines and deletes none, and everything from `## [0.20.1]` down is byte-identical to `main`. Every PR merged since v0.20.1 has its entry, or is covered above. - **`generate-docs.py --check --check-examples`:** 23 files current; 70 steps and 18 workflows checked. - **No other page** names a release as the current one. `scripts/canary-drift.py`'s `@v0.20.1` is a sample pin in its self-test. ## Staging, after the tag As CONTRIBUTING's Staged Releases says: 1. **The release gate:** `gate.yml` on the canary's `main`, with `candidate=v0.21.0` and the self-test off. It must be green, with each site serving the marker for the release commit. The `error-outputs` check's summary line in its log must say how many notebooks came "with the outputs the execution cache holds", which shows the candidate's check ran. The run is linked here. 2. **The lecture matrix at the candidate,** because the release changes what a build reports: a check that can now fail a build. The run is linked here, and I'll read each red leg's log and say here why it isn't the candidate's, or hold the release. 3. **Nothing staged by hand.** The gate restores its execution cache both ways, which is #322's pull-request case. It shows the candidate's check reads the cache cleanly in the pinned image, but no gate page has an error output to catch. The reread case, in a book with parts, is the harness's: `build-cache-error-guard` covers both cases, a rebuild with `--all` over the same `_build` and a build over the execution cache alone, on every pull request that changes an action. Its last run, on #326's head, was green (run 43787220029), and that head's `build-lectures/` and `test-actions.yml` are what merged. 4. **Once `v0` has moved:** the canary's `cache.yml`, then `ci.yml` and `publish.yml`, dispatched on its `main`, with their runs linked here. Container images don't go through the canary, and this release changes none. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WT8bMbZoC2dpGt3sPyBjyd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
This waits for Monday. It changes
build-lectures/, which the scheduled lecture-matrix run of 2026-11-16 02:00 UTC uses frommain. Merge it only on the organiser's word, after that run has finished.Closes #322.
build-lectures' error-outputs check (#247) reads the notebooks myst-nb writes to_build/jupyter_execute. On a cache hit, myst-nb 1.4.0 renders the page from jupyter-cache's merged copy (myst_nb/core/execute/cache.py:37) but writes the notebook it read, which has no outputs (myst_nb/sphinx_.py:183). So the check found no error output on any page the build took from the execution cache. That covers a pull request's build over a restoredcache-type: 'execution'cache, whichtemplates/ci.ymlsets up, and a later build in the same job that rereads the pages, ashtmldoes afterpdflatexin a book with parts. The comment inaction.ymland two chapters said the opposite.The check now reads such a page as the page shows it. Wherever myst-nb looks in the cache for a page, it matches the written notebook against the cache with myst-nb's own two jupyter-cache calls and checks the merged copy. A notebook the cache has no match for was executed by the build that wrote it, and is checked as written, as before.
error-outputs: fail--allover the same_build, thehtmlbuild afterpdflatexin a book with parts, or a build over a restored execution cacheraises-exceptioncell on a page from the cacheexclude_patternsentry keeps from executing, or one whosemystnbfrontmatter sets anotherexecution_modefailthe step failsThe inputs, the output and the annotations are unchanged. The log's summary line gains a count: "Checked N executed notebook(s) in …, M of them with the outputs the execution cache holds: …".
Changes
build-lectures/check-error-outputs.pyread_config()reads_config.ymlonce, andbook_allows_errors()keeps its rule.book_execution()mirrors how jupyter-book sets myst-nb'sexecution_mode,execution_excludepatternsandexecution_cache_pathfromexecute:andsphinx.config. The notebook's ownmystnbmetadata overrides them.uses_cache()mirrors myst-nb's choice of the cache client, andcached_copy()makes myst-nb's two jupyter-cache calls. Each mirrored rule cites its upstream file and line (myst-nb 1.4.0, jupyter-book 1.0.4.post1), so drift can be checked at a version bump. The mirror is about 20 lines of code.build-lectures/action.yml.github/workflows/test-actions.ymlbuild-cache-error-guard, afterbuild-display-error-guardand beside it inharness-summary'sneeds:. It uses the same fixture. Onehtmlbuild withwarnexecutes the pages into the cache (count 1). Then two builds withfailtake every page from the cache:--allover the same_build, then over nothing but_build/.jupyter_cache. Each must fail with a count of 1. Each also checks the premise: the written notebook holds no error output, the page shows the traceback, and myst-nb wrote no failure report.docs/user/actions/build-lectures.mdpdflatex, a book with parts is read again by the next builder.docs/user/actions/build-jupyter-cache.mdhtmlrereads every page afterpdflatexin a book with parts, and each builder checks every page's outputs, the cache's copy for a page taken from it.docs/dev/TESTING.mdbuild-lectures' row gains the new job.CHANGELOG.md[Unreleased],### Fixed, markedThe⚠️ BREAKING marker is the maintainer's call. I marked it, as agreed with the organiser, by #300's precedent: a
### Fixedentry, marked because a build that passed can now fail where the check now sees a traceback. Dropping the marker changes one line. For today's consumers the expected impact is nil (below).What I checked, and how
The issue's facts were checked against
mainbefore any code, and the check is summarised in the comment on #322. myst-nb 1.4.0 and jupyter-cache 1.0.1 were read from source, the versions run 43683024646 logged from thequanteconimage. That run's log has the check's counts: 11 error outputs (allowed there byexecute.allow_errors) afterjupyterandpdflatex, and 0 afterhtml. In the same run, a first build given a copied cache counted 0 too, which is the pull-request case.The new job fails on today's code. A throwaway workflow on
scratch/322-cache-errors, frommain, ran the job alone against today'sbuild-lectures(run 43694544644). In both later builds myst-nb loggedUsing cached notebookfor every page, and the check reported "0 error output(s) reported, 0 allowed". Both assertions failed: "build-lectures reported [success] for a page taken from the execution cache whose display raised" and "build-lectures reported [success] over a restored execution cache whose display_error page shows a traceback". (The first scratch run, 43694290594, stopped at the first assertion; the second ran the restored-cache steps after it as well.) The branch is deleted. This PR's run shows the job green.Locally, with myst-nb 1.4.0, jupyter-cache 1.0.1 and jupyter-book 1.0.4.post1 in a scratch environment. The same fixture, built over a hand-staged cache, failed under
failwith the fix and passed without it. In each of the following, the check took the page from the cache, or didn't, as myst-nb would have: book modeoff(quoted, and YAML's unquotedfalse);sphinx.config.nb_execution_mode: forceoverexecute_notebooks: cache; an exclude pattern on the page; the notebook's ownmystnb.execution_mode: off; no cache directory; and a relativeexecute.cachewith nothing at the default path. A cache record whose notebook file was missing was reported as unread, and failed the step.Callers.
lecture-dp,test-lecture-theme-sphinxand the canary callbuild-lectures@v0. All three leaveerror-outputsatfailand setexecute_notebooks: "cache". The canary and the theme corpus exclude only_static/*. Their cache builds runbuild-jupyter-cachewithout restoring a cache first, so every page executes there, and a cache with an error output the check doesn't allow is never saved. Their pull-request builds should therefore see nothing new. A code search of the org forexecution_modefinds no page in those three repositories, nor in the other lecture repositories on the rollout plan.Timing. On the fixture, from the log timestamps, the check step took 0.84–0.85 s without the lookup (run 43694544644, all three builds). With it, the step took 1.79–1.88 s in this PR's
build-cache-error-guardjob (run 43694796149): about 1 s more per build, with three notebooks each read from the cache. Locally, almost all of that is importing jupyter-cache and SQLAlchemy once (0.15 s against 0.02 s for the script alone), so a larger book should add little beyond reading one cached notebook per page. The gate's run at release will show it on a real book.The local checks, with actionlint 1.7.12 and shellcheck 0.11.0. These are clean:
python3 scripts/generate-docs.py --check --check-examples --actionlint …(no description changed, so no generated file changes),actionlintandpython3 scripts/lint-shell.py. Againstmain,CHANGELOG.mdgains one entry and loses no line, and everything from## [0.20.1]down is unchanged.What to watch after merge
Monday's matrix comes first, and this merges only after it. With the fix, the matrix's
jupyterbuild afterpdflatex(a book with parts) checks the cached copies. Those carry the same outputs itshtmlbuild already passed. Its--allretry checks the pages it takes from the cache.At the staged release, the canary should exercise this. The release gate's
build-jupyter-cacherun (builders: 'jupyter,pdflatex,html', on a book with parts) should pass. Itshtmlbuild's log should read "…, N of them with the outputs the execution cache holds", with N equal to the number of notebooks. So should the gate'shtmlbuild over the restored execution cache. A green gate with those counts shows the check finding real cached copies with no false positive. Compare the check step's duration there with the fixture's figures.Not in this PR
build-jupyter-cache/action.yml, the bjc-alert fixture andbuild-lectures' jupyter-guard loop: unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMaaUb1oFVdDs82xVHp