Skip to content

Site quality pass: pinned-commit chip on model pages, unique titles, contrast fixes and new site checks - #290

Draft
vahid-ahmadi wants to merge 6 commits into
vahid/r6-sitefrom
vahid/r7-site-quality
Draft

vahid-ahmadi wants to merge 6 commits into
vahid/r6-sitefrom
vahid/r7-site-quality

Conversation

@vahid-ahmadi

@vahid-ahmadi vahid-ahmadi commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What

A quality pass over the macro site (OG-UK and microsimulation pages skipped). The site was served locally and every in-scope page checked for broken links, accessibility basics, console errors, phone layout at 375px, titles and descriptions, and consistency of model names, dates, units and pins. This PR fixes what was clear and adds checks so it stays fixed. No published number changes.

Stacked on #286 (vahid/r6-site), so it is a draft. It touches the same model pages, and the base should be switched to main once #286 merges.

What the audit found

Check Result
Internal links and anchors Clean. The existing suite already covers these (3,281 tests passed before any change).
External links 272 URLs on 22 hosts: 264 OK, 0 dead (the checker reports a known-missing GitHub file and an unknown host as dead, so the path works), 8 unverified. The three DOIs among the eight resolve through the DOI handle API; the publishers refuse scripted requests. The other five (define-model.org ×2, openicpsr.org ×2, one econweb.ucsd.edu PDF) answer 403 or fail certificate verification from a script and were not opened in a browser.
Console errors None on the 61 in-scope pages, and no failed resource or broken image.
Phone layout, 375px No horizontal scroll on any of the 61 pages (no rule sets overflow-x on html or body, so nothing is clipped out of the measurement); tables stack into labelled cards.
Alt text, heading order, form labels, table headers Clean. Alt text and heading order were already tested; labels and header cells are tested from this PR.
Contrast Three token misuses, fixed below.
Titles and descriptions Four UK/US pairs of topic pages shared a title, fixed below. 43 of 61 descriptions run past 160 characters and 19 past 200, so search results cut them; left alone (#292).
Model names, units Each model has one display name (BoE SVAR, OBR emulator, FRB/US, US HANK, DEFINE-UK). Two other spellings appear and are left: "FRB-US" 14 times where the pages cite the Fed's 2010 model as Coenen et al. name it, and "OBR macro model" 4 times on the working-paper page for the OBR's own model. pp, bp and £bn are used uniformly.
Pins Every reference to a model's current pin matches integration/pyproject.toml. Older commits are named as history (0fe04c9, a822045, b56fe3b on /obr/validation, c827ab8 on /svar/validation), and DEFINE-UK names its upstream commit 846081a, which is not in that file. Five source links pointed at main; two are moved here, three are left (below).
Stale dates The data store was last updated on 16 Nov 2026 and the pages say so, quietly. Seven releases announced for 17, 18 and 20 Nov (earnings, unemployment, vacancies, CPI, core CPI, public-sector borrowing and debt) are not in it, so those pages are one announced release behind. The cause is the failing scheduled fetch in #223; the refreshed data sits on the data/vintage-refresh branch with no PR. A notice for readers is proposed in #292.

Changes

1. The pinned commit is visible on every model page. The hero strip on the four tabs of the OBR emulator, BoE SVAR, FRB/US and US HANK gains a chip with the short commit, linking the model repository at that commit. tools/model_hero.py reads it from the [models] extra in integration/pyproject.toml, the one place a model commit is declared. The stylesheet already had an unused .mh-pin rule for it.

tests/test_model_pins.py ties the two together:

  • the hero strip on all 36 model pages is what the script would stamp today, so a re-pin fails CI until the pages are re-stamped;
  • each pinned model's four tabs carry the chip;
  • every link from the site into a pinned repository at a commit names the pinned commit. One link to the pre-refresh SVAR commit c827ab8 is deliberate and is listed with its reason.

The microsimulation (pinned by package version), OG-UK and DEFINE-UK (not installed from that file) get no chip. Papers and reports get none either: they are dated documents, and the chip states what the repository installs today.

2. Topic page titles. /economy/topics/growth and /economy/us/topics/growth were both "Growth — PolicyEngine Macro", and likewise inflation, jobs and reform. economy/topics.py now builds the title from the same words as the heading: "UK growth", "US growth".

3. Link previews on release digests. The 12 generated digests and the release-notes index had no Open Graph tags. notes/generate_release_notes.py now writes the set the rest of the site carries.

4. Contrast.

  • Chart source lines (.vc-source) and the "No" pills in the /models comparison table: faint text on a grey surface, 4.39:1. Now the muted text colour, about 7:1 (computed colours re-read in the browser after the change).
  • Dark mode, primary buttons ("Run a hosted model" on the homepage and /models): white on the dark-mode primary teal #38B2AC, 2.58:1. Now --primary-foreground, the token paired with that teal, about 7.5:1. Light mode is unchanged because the token is white there.

5. Two source links move from main to the pin. On /svar/validation, results/unemployment_satellite_validation.json and docs/band_decision.md now link at 17f5d82. Both files have the same blob hash at the pin and on main today.

6. Two text corrections on /models/compare, from the audit in #293. Edited in results.json and rebuilt with build.py; no verdict changes and no stored path changes.

  • FRB/US spending row: "per 0.046% of GDP" and "0.81 on impact" become 0.045% and 0.83. I checked the size against the source: in the October 2026 LONGBASE at 162cfe6, egfe is 1,106.9 and xgdp 24,537.6 in 2026Q3, so federal purchases are 4.51% of GDP and a 1% rise is 0.045%; the stored impact response 0.0373% divided by that is 0.83.
  • BoE SVAR row: the four places that said the response "builds" to h = 8 now say it is there on impact and roughly flat to h = 8. The reason cites the audit's 6,000-draw run (−0.39% per 25bp on impact, −0.42% at h = 8). I did not re-run the SVAR. The row's medians still come from the 600-draw fixture: whether to move them to a run at the pin is left for Vahid, as Independent reproduction and cross-model plausibility audit, 26 Nov 2026 #293 asks.

7. Checks. Six structural tests join tests/test_site_integrity.py: unique page titles, link-preview metadata, unique ids within a page, labelled form controls, header cells on every table, rel="noopener" on new-tab links. tools/check_external_links.py checks external links at one request per host per second, HEAD first; it is a manual tool, not a CI gate, because its result depends on other servers.

8. Docs. CONTRIBUTING.md and tests/README.md give the current page count (71, where they said 84 and 78) and describe the new script, test file and tool.

Decisions to check

  • style.css version not bumped. Bumping STYLE_VERSION rewrites one line on all 71 pages and would conflict with any other open PR that does the same. vercel.json sets no long cache on style.css, so the three colour changes reach readers on the next revalidation.
  • Three main links left on /models/compare. They point at obr-macroeconomic-model/docs/monetary_conditioning.md and us-frb-model/VALIDATION.md. Both files differ between the pin and main. For the first, the page text draws on a section that exists only on main ("Why the result differs from the Bank of England's range"), so pinning it would point at a file without that section. For the second I did not check which version the page's figures follow, so I left it.
  • The chip says what this repository installs, not what the hosted server runs. The two differ between a re-pin and the next deploy. The chip's tooltip names integration/pyproject.toml for that reason.

Follow-ups

Not verified

  • The five external links listed above were not opened in a browser.
  • Contrast was measured in light mode on 53 pages and in dark mode on 15. Text over gradients and images was skipped.
  • No integration job runs on this PR. I ran integration/tests/test_site_contract.py against this branch's own source (PYTHONPATH=src): 13 passed.
  • integration/src/policyengine_macro/core.py line 590 still tells tool users that egfe is "~4.6% of GDP, so 0.01 is roughly 0.046% of GDP". That is backend text and is left for the adapter PR (Adapters: forward obr #90 labels, label the DEFINE parameter mismatch, deprecate recommend_model's horizon #289).

Tests

python3 -m pytest tests -q: 3,679 passed, 87 skipped. site_nav.py, site_contract.py and every generator --check pass.

🤖 Generated with Claude Code

vahid-ahmadi and others added 5 commits November 27, 2026 00:02
…nk-preview tags

Four UK/US topic pairs shared one <title>. Each now reads as its heading
does (UK growth, US growth). The 12 release digests and their index gain
the Open Graph tags the rest of the site carries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/model_hero.py reads the [models] extra in integration/pyproject.toml
and stamps a chip linking the model repository at that commit on the four
tabs of the OBR emulator, BoE SVAR, FRB/US and US HANK. A new test fails
when a page shows or links any other commit. Two SVAR validation links
move from main to the pin, where the files are identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rast fixes

Unique titles, link-preview metadata, unique ids, labelled form controls,
table header cells and rel=noopener join tests/test_site_integrity.py.
tools/check_external_links.py is a manual tool. Chart source lines and the
No cells on /models move from the faint to the muted text colour (4.39:1
to about 7:1 on the grey surface).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rimary teal

White on the dark-mode primary (#38B2AC) is 2.58:1. --primary-foreground
is #0B0E14 there (7.6:1) and #FFFFFF in light mode, so light is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
macromod Ready Ready Preview Nov 27, 2026 12:14am UTC

Request Review

… contrast on the rule that wins

FRB/US spending row: a 1% rise in federal purchases is 0.045% of GDP
(egfe is 4.51% of xgdp in 2026Q3, October 2026 LONGBASE at 162cfe6), so
the impact ratio is 0.83, not 0.81. BoE SVAR row: the response is on
impact and roughly flat to h = 8, not building. No verdict or stored
path changes. The No-pill colour fix moves to #compare .yn-no, the rule
that sets it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — f2e8ddca Deployed Nov 27, 2026 by vercel[bot]
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