Repository navigation
Description
Problem
On the data and forecast pages a reader can get from a chart to its numbers in one click: every chart on /economy, the topic pages and /forecasts has a source line with a link, to the publisher's series page, the archived round file or the forecasts page. On the model pages that is not yet true. I went through the 12 generated charts (svg.vchart) on the BoE SVAR, OBR emulator and FRB/US overview and validation pages, plus the homepage fan (27 Nov 2026, on the branch of #290):
| What the figure offers | Charts | Where |
|---|---|---|
| A source line linking the file at the pinned model commit | 1 | /obr/validation (calibration scorecard) |
A source line linking a file on this repository's main |
1 | /obr/validation (basic-rate costing) |
| A source line that names the file, with no link | 6 | /svar/validation (FEVD shares, coverage, error ratios, win counts), /obr/validation (outturn comparison), /frb-us/validation (residuals) |
| No source line; the caption carries the provenance in prose | 4 | /obr/validation (anchored deviation, whose caption links a test file at the pin; free-running against anchored), /svar/validation (frozen-origin fan), /svar (current outlook) |
| No source line and no file named | 1 | homepage hero fan (its label gives the round date, "archived 12 Nov 2026", without a link to the round) |
What it looks like: on /svar/validation the coverage chart has a grey line under it, "Source: BoE SVAR replication", with a "Source details" disclosure that opens to papers/boe-svar/figures/coverage_evaluation.json in plain text. The file is committed and served by the site, but the name is not a link, and nothing says which model commit produced it.
The mapping already exists: validation/figures/README.md has a table from every chart id to its source file, and chartkit.source_block() writes the short line and the disclosure. What is missing is the link and the pin.
Proposed design
One source line per chart, written by the generator that draws it, in one format:
- A registry beside the chart code. In
validation/figures/make_charts.py, addSOURCES: dict[chart_id, Source], whereSourcehaslocal(a path in this repository), an optionalupstream(model key and path in the model repository) and an optionalnote. Generate the README table from it so the two cannot drift. chartkit.source_block()takes theSource. It linkslocalas a same-origin path andupstreamat the pinned commit. The commit comes fromtools/model_hero.model_pins()(added in Site quality pass: pinned-commit chip on model pages, unique titles, contrast fixes and new site checks #290), so a re-pin moves every chart link andmake_charts.py --checkfails until the pages are regenerated.- The five charts with no source line get one, including the homepage fan (
assets/make_hero.py) and the/svaroutlook (assets/make_current_outlooks.py), which should link the archived round underforecasts/rounds/<round-id>/as/forecastsalready does. - A test in
tests/test_site_integrity.py: every<figure>containingsvg.vcharthas a.vc-source(or.vc-src) with at least one link, and a link into a pinned model repository names a commit, notmain. Pages for OG-UK and the microsimulation can be exempted by path until they are done.
The short line plus disclosure pattern stays as it is, so the change adds no height to the page.
Size
Three generators (validation/figures/make_charts.py, assets/make_hero.py, assets/make_current_outlooks.py) and chartkit.py; regenerates about six pages. make_charts.py covers 11 of the 13 charts and is the place to start.
Not in scope
Hand-written tables and stat tiles. Many already link their source at the pin (see #286); the rest need reading one by one. The 12 small charts on /models/compare share one source line that links the results file on this repository's main, which is right for a file that lives here.
Activity