Repository navigation
Description
v0.8.0 validation study: two native pipelines clear the Sphinx doctree cache before the final HTML build to fix ipywidget mimetype rendering — lecture-python-intro (.github/workflows/publish.yml:90), lecture-python-advanced.myst (.github/workflows/publish.yml:91). Composite build-lectures has none: nothing here touches .doctrees; its pre-build HTML steps are only Stage PDF (build-lectures/action.yml:51) and Stage notebooks (build-lectures/action.yml:70).
Intra-job trigger, not a stale cache: jb writes one shared _build/.doctrees, so HTML in a three-format job reads doctrees from the earlier pdflatex and jupyter builds; reproduces cold. That pdflatex → jupyter → html sequence is the migration target (docs/MIGRATION-GUIDE.md:313-332); single-builder consumers like lecture-dp (builder: 'html') are out of scope. Unreproduced — inferred from the native BUG: comment.
No zero-build A/B — no clear-free repo emits widget output:
-
lecture-python-advanced.myst/lectures/matsuyama.md: soleipywidgetsimport among migrated repos, cellsskip-execution(no mimetype emitted), and that repo clears. -
lecture-python-intro(also clears): executed rich output inmarkov_chains_I.md(HTML(anim.to_jshtml())) andinequality.md(plotly). -
lecture-python-programming.myst: clear-free in production, but no executed widget/animation/plotly output. -
QuantEcon/test-actions-lecture-intro: composite, no clear, no cache restore, but its canary TOC builds five rich-free lectures (geom_series,short_path,lln_clt,solow,linear_equations) underonly_build_toc_files: true, unpublished since 2026-02-10; widening cuts against_toc.yml's no-content-drift criteria — separate decision. -
Repro: build intro's
markov_chains_Iandinequalitythrough the composite pdflatex → jupyter → html with no clear; compare to the published native site. -
Matches → the clear is not load-bearing for current content; close
wontfixwith the negative result recorded. -
Diverges → add an optional
clear-doctreesinput (default off) to thebuild-lecturesHTML path, plus a MIGRATION-GUIDE note for repos coming from native pipelines. -
Lower priority: the cache stores
_buildwholesale (restore-jupyter-cache/action.yml:109), so.doctreesrides along on restore — re-check once Optimize preview builds: phased plan for the fastest PR previews (tracking) #92 Phase 1 turns onsave-cache: 'true'.
Activity
mmcky commentedon Nov 15, 2026
Re-checked against
mainat v0.20.0 (0fada07) on 2026-11-15, before work on this starts. Most of the facts hold. Line numbers have moved, one path is gone, and the scope is narrower than PLAN and QuantEcon/meta#348 say.What holds
lecture-python-introstill clears the doctrees before its finalhtmlbuild: inpublish.yml(theBUG:comment at:85, thermat:90, the build at:91), and inci.ymltoo (:80,:85,:86). Itspublish.ymlrunspdflatex, thenjupyter, thenhtml.lecture-python-advanced.mystclears them too, now atpublish.yml:100andci.yml:87.lecture-python-programming(renamed fromlecture-python-programming.myst) clears nothing inci.yml,publish.ymlorcache.yml. Itspublish.ymlalready runshtmllast (pdflatexat:94,jupyterat:103,htmlat:118)..doctrees.build-lectures' staging steps are now atbuild-lectures/action.yml:162(the PDF) and:188(the notebooks)._build/.doctrees, andbuild-jupyter-cacherunsjupyter,pdflatex, thenhtml(build-jupyter-cache/action.yml:297,:310,:323), so itshtmlbuild reads the doctrees the other two wrote.BUG:comment.What has moved
docs/MIGRATION-GUIDE.mdno longer exists. The migration steps are in Migrating an existing repository, which is where the note in the third outcome belongs.build-jupyter-cachesaves the whole of_build(build-jupyter-cache/action.yml:474), andrestore-jupyter-cache's defaultcache-type: buildrestores it, removing only the html (restore-jupyter-cache/action.yml:262), so.doctreescomes back with it. Since feat(restore-jupyter-cache): the templates restore the execution cache, keyed on the environment too (#270) #280 the templates restorecache-type: 'execution'(templates/ci.yml:174), which leaves.doctreesout.Where the executed rich output is
lecture-python-intromarkov_chains_I.md:HTML(anim.to_jshtml())at:890and:984.inequality.md: a plotlyfig.show()at:767–:775lecture-python-advanced.mystmatsuyama.md's interactive cell isskip-execution(:801); the plotly lectures render static PNGs, with everyfig.show()commented outlecture-python-programmingplotlyappears only as a link (about_py.md:430)So this issue bears on
lecture-python-introalone.lecture-python-programmingalready buildshtmllast on shared doctrees in production with nothing to clear, so its move to the full chain doesn't wait on this.For the repro
test-containers-lectures.yml) buildshtmlfirst, so as it stands it can't show this. The repro needshtmllast, afterjupyterandpdflatex, with no clear, which is howbuild-jupyter-cacheruns them.markov_chains_Ineeds no network.inequality's plotly figure is built from World Bank data fetched at build time (inequality.md:723, and:553and:572before it), and the page also reads two remote CSVs (:250,:622). An empty or failed response there is not a result for this issue.Claude Code (on behalf of mmcky), organiser session
docs(plan): name advanced's doctrees clear beside intro's
docs(plan): of the rollout repos, #98 blocks only lecture-python-intr…
mmcky commentedon Nov 15, 2026
Reproduced: no difference. The doctrees clear is not load-bearing. Built in the
quanteconimage (jupyter-book 1.0.4.post1, myst-nb 1.4.0, Sphinx 7.4.7) with this repository'sbuild-lectures, on a toc trimmed tolecture-python-intro'smarkov_chains_Iandinequality, plus a synthetic page with an executed ipywidgets slider and two plotly figures. Run 43683024646.An
htmlbuild afterjupyterandpdflatexon one_build/.doctrees, with no clear, renders every page the same as one afterrm -r _build/.doctrees. That holds inbuild-jupyter-cache's order (jupyter,pdflatex,html) and in the native pipelines' order (pdflatex,jupyter,html, wherehtmlreuses the doctrees thejupyterbuild read). It also holds whenhtmlreuses doctrees thatpdflatexread. Both animations onmarkov_chains_I, and the slider's widget view and state, render in every build. Apart from Sphinx's?v=query on three CSS links, which depends only on whether_build/htmlalready existed, the pages are byte-identical. A negative control, html withtext/plainfirst, shows the failure mode, and the comparison caught it.This is what myst-nb's design predicts. It stores every mimetype of an output in the doctree and chooses one per builder at write time (
SelectMimeType, a post-transform), so no builder's choice is kept for the next. Inbuild-jupyter-cache's order,htmlre-reads every page anyway, because thepdflatexbuild changesnumfig_secnum_depthfor a book with parts. A PR'shtmlbuild over a restoredcache-type: buildcache re-reads every page too, since a fresh checkout makes every source newer than its doctree.inequalitygave no result: the World Bank API failed in all three runs. Its plotly figure would show nothing on any builder in any case: plotly 6's default renderer in a kernel emits onlyapplication/vnd.plotly.v1+json, which myst-nb drops. That is a separate lecture-python-intro matter, not this issue.Closing as not needed:
build-lecturesgets noclear-doctreesinput. A repository coming from a native pipeline can drop itsrm -r _build/.doctrees.Claude Code (on behalf of mmcky)
docs: give the reason the doctrees clear can go, not a guarantee (#98)
docs: a native pipeline's doctrees clear needs no counterpart (#98) (#…