Skip to content

forward/sync don't carry shared assets referenced by lectures — quant-econ.bib and _admonition/* dangle and fail strict builds #117

Description

@mmcky

A distinct forward-resync gap surfaced during the intermediate lecture-python.zh-cn resync wave (2026-07-19). It is the mirror image of #107: where #107 is about the resync dropping a target-side adaptation, this is about the resync not carrying across an upstream-side addition to a shared file.

Mechanism

forward resyncs each lecture's .md body — including any new {cite}`Key` directives that upstream added — but does not sync the shared bibliography lectures/_static/quant-econ.bib. When an upstream lecture begins citing a reference that upstream also newly added to its own .bib, the resync brings the {cite} into the target lecture while the key stays absent from the target repo's stale .bib. Under the strict build (-n -W) Sphinx emits WARNING: could not find bibtex key "<Key>", which -W promotes to a hard build failure.

Evidence (4 of 36 lectures in one Tier of the wave)

PR Lecture Missing key(s)
QuantEcon/lecture-python.zh-cn#123 likelihood_ratio_process Blume_Easley2006
QuantEcon/lecture-python.zh-cn#124 likelihood_ratio_process_2 Blume_Easley2006
QuantEcon/lecture-python.zh-cn#164 rational_expectations Lucas_Prescott_1971 (3 uses)
QuantEcon/lecture-python.zh-cn#171 mccall_persist_trans MaCurdy1982, Meghir2004

All four keys were present verbatim in the upstream lecture-python.myst quant-econ.bib and absent from the zh-cn copy, confirming the target bibliography is a stale snapshot the resync never updates. Fixed manually this wave by copying the specific entries across.

Why it is easy to miss

A per-lecture content review cannot catch it: a {cite} lives in prose and the key it needs lives in a separate file. There is no execution error either — it is a build-time cross-reference check, so only a cold strict build surfaces it (a cached build can pass and hide it).

Suggested fix, cheapest first

  1. Lint (minimum): after resyncing a lecture, extract every {cite}`Key` in the translated file and assert each Key resolves in the target repo's .bib; if not, pull the missing entry from the upstream .bib (or flag it on the PR). Deterministic and would have caught all four pre-merge.
  2. Sync shared assets (better): treat _static/quant-econ.bib as part of the resync surface and diff-and-merge new upstream entries when a resynced lecture references them.
  3. Generalise (best): a shared-asset drift check — any file a resynced lecture references by name (bib keys, _static/… paths, data URLs) should resolve in the target repo after the resync. This subsumes the bib case and would also catch missing data/image assets.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions