Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ heading here; `tests/test_repo_hygiene.py` asserts that they do.

## [Unreleased]

### Site quality pass: titles, link previews, contrast, a pinned-commit chip and new checks

No published number changes.

- **Pinned commit on every model page.** The hero strip on the four tabs of the OBR emulator, BoE SVAR, FRB/US and US HANK now carries a chip with the model commit this repository installs, linking the model repository at that commit. `tools/model_hero.py` reads it from the `[models]` extra in `integration/pyproject.toml`, and `tests/test_model_pins.py` fails if a page shows, or links a source file at, any other commit (one deliberate link to the pre-refresh SVAR commit is listed there). The microsimulation, OG-UK and DEFINE-UK are not pinned by commit in that file and get no chip.
- **Page titles.** The UK and US topic pages shared a title in four pairs ("Growth — PolicyEngine Macro" twice, and likewise inflation, jobs and reform). Each now leads with the country, as its heading does: "UK growth", "US growth".
- **Link previews.** The 12 release digests and the release-notes index had no Open Graph tags, so a shared link showed a bare URL. They now carry the same set as the rest of the site.
- **Contrast.** Chart source lines (`.vc-source`) and the "No" pills in the `/models` comparison table used the faint text colour on a grey surface, 4.39:1 against the 4.5:1 small text needs. Both use the muted text colour now (about 7:1). In dark mode the primary buttons ("Run a hosted model", "Run a model") set white text on the dark-mode primary teal, 2.58:1; they now use `--primary-foreground`, the token paired with that teal (about 7.5:1). Light mode is unchanged.
- **Source links.** Two links on `/svar/validation` (the unemployment-satellite validation file and the band decision note) pointed at `main`; they now point at the pinned commit `17f5d82`, where both files are byte-identical to `main` today.
- **`/models/compare`, two corrections from the audit in #293** (results file `2026-11-19.3`; no verdict changes). FRB/US spending row: a 1% rise in federal purchases is 0.045% of GDP, not 0.046% (`egfe` is 4.51% of `xgdp` in 2026Q3 in the October 2026 LONGBASE at `162cfe6`), so the impact ratio the page derives from it is 0.83, not 0.81; the stored GDP path is untouched. BoE SVAR row: the response no longer "builds" to h = 8. It is there on impact and roughly flat to h = 8 (−0.39% per 25bp on impact and −0.42% at h = 8 in the audit's 6,000-draw run at the pin). The row's medians still come from the 600-draw fixture.
- **Checks.** `tests/test_site_integrity.py` gains six structural tests: unique page titles, link-preview metadata, unique ids within a page, labelled form controls, header cells on every table, and `rel="noopener"` on new-tab links. `tools/check_external_links.py` checks every external link at a polite rate; it is a manual tool, not a CI gate, because its result depends on other servers.
- **Docs.** `CONTRIBUTING.md` and `tests/README.md` give the current page count (71) and describe the new script, test file and tool.

### Model pages: provenance review of the SVAR, FRB/US, HANK and DEFINE-UK pages

Every change was checked against the model repository at the pinned commit; no model was run.
Expand Down
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Thanks for helping. This repository holds three separable things, and each has
its own rules:

- **the site** — 84 static HTML pages, no build step, many of them *generated*
- **the site** — 71 static HTML pages, no build step, many of them *generated*
- **the integration layer** (`integration/`) — the `pe-macro` CLI and the MCP
server, published as the `policyengine-macro` package
- **two append-only archives** — `data/vintages/` and `forecasts/rounds/`
Expand Down Expand Up @@ -48,6 +48,13 @@ cd integration && pytest tests -q # integration layer (fast)
cd integration && pytest tests -q --runslow # + real model solves (slow)
```

External links are checked by hand, because the answer depends on other
people's servers:

```bash
python3 tools/check_external_links.py # every http(s) link, politely
```

And the two contract scripts, which are checks rather than tests and are what
`site-provenance.yml` finishes with:

Expand Down Expand Up @@ -86,6 +93,7 @@ hand-written and part generated. Edit outside the markers freely; never inside.
| `forecasts/ingest_outturns.py` | `forecasts/outturns.json` — the data store mapped onto the variables the models forecast. Appends, never edits. | `forecast-archive.yml` |
| `forecasts/nowcast.py` | generates a forecast round from the hosted MCP server and archives it *before* the outturn exists. No `--check`; it is scheduled (`nowcast-round.yml`) and refuses far more often than it writes. | scheduled only |
| `validation/figures/make_charts.py` | every inline `<svg class="vchart" data-chart="…">` on `obr/validation`, `svar/validation`, `frb-us/validation` and `us-hank/validation`. | `site-provenance.yml` |
| `tools/model_hero.py` | the hero strip on every model page (`<section class="hero model-hero">`): icon, kind line, title, lede and the fact chips, **including the pinned-commit chip read from the `[models]` extra in `integration/pyproject.toml`**. Re-run it after a re-pin. | `site-tests.yml` (`tests/test_model_pins.py`) |
| `assets/make_hero.py` | the `hero-fan` inline SVG in the homepage hero. | `site-provenance.yml` |
| `assets/make_current_outlooks.py` | `obr-current-outlook` on `obr/methodology/index.html` and `boe-current-outlook` on `svar/index.html`. | `site-provenance.yml` |
| `olg/figures/make_showcase.py` | the `olg-stats` headline table on `olg/index.html`. | `site-provenance.yml` |
Expand Down
10 changes: 7 additions & 3 deletions economy/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3193,18 +3193,22 @@ def page(topic: dict) -> str:
f'<ul class="xp-list">{rows}</ul>',
)
short = SHORT_LEDES.get((topic["country"], slug))
# The same words as the <h1>: "UK growth", "US growth". The bare topic
# title gave four UK/US pairs one <title> each, so two browser tabs or two
# search results could not be told apart.
page_title = f'{topic["country"].upper()} {topic["title"][0].lower() + topic["title"][1:]}'
head = f"""<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{esc(topic["title"])} — PolicyEngine Macro</title>
<title>{esc(page_title)} — PolicyEngine Macro</title>
<meta name="description" content="{esc(lede)}" />
<link rel="canonical" href="{SITE}{url}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{SITE}{url}" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — {esc(topic["title"])}" />
<meta property="og:title" content="PolicyEngine Macro — {esc(page_title)}" />
<meta property="og:description" content="{esc(lede)}" />
<meta property="og:image" content="{SITE}/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand All @@ -3224,7 +3228,7 @@ def page(topic: dict) -> str:
body = f"""<main id="top">
<section class="hero model-hero">
<div class="hero-inner">
<h1 class="page-title tp-h1">{topic_icon(slug, 24)}{esc(topic["country"].upper())} {esc(topic["title"][0].lower() + topic["title"][1:])}</h1>
<h1 class="page-title tp-h1">{topic_icon(slug, 24)}{esc(page_title)}</h1>
<p class="lede">{esc(short) if short else esc(topic["heading"])}</p>
</div>
</section>
Expand Down
4 changes: 2 additions & 2 deletions economy/topics/growth/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Growth — PolicyEngine Macro</title>
<title>UK growth — PolicyEngine Macro</title>
<meta name="description" content="Real GDP is 1.9% up on the year in 2026Q3; boe-svar&#x27;s first open quarter, 2026Q4, is 1.9%." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/topics/growth" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/topics/growth" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Growth" />
<meta property="og:title" content="PolicyEngine Macro — UK growth" />
<meta property="og:description" content="Real GDP is 1.9% up on the year in 2026Q3; boe-svar&#x27;s first open quarter, 2026Q4, is 1.9%." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/topics/inflation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Inflation — PolicyEngine Macro</title>
<title>UK inflation — PolicyEngine Macro</title>
<meta name="description" content="CPI is 3.1% in 2026Q3 and core 2.8% in 2026-09; the model&#x27;s median does not reach 3% again until 2026Q4." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/topics/inflation" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/topics/inflation" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Inflation" />
<meta property="og:title" content="PolicyEngine Macro — UK inflation" />
<meta property="og:description" content="CPI is 3.1% in 2026Q3 and core 2.8% in 2026-09; the model&#x27;s median does not reach 3% again until 2026Q4." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/topics/jobs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Jobs — PolicyEngine Macro</title>
<title>UK jobs — PolicyEngine Macro</title>
<meta name="description" content="Unemployment is 4.9% in 2026Q2 and vacancies 691.0 thousand in 2026-08; the satellite forecast runs 4 quarters and then stops." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/topics/jobs" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/topics/jobs" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Jobs" />
<meta property="og:title" content="PolicyEngine Macro — UK jobs" />
<meta property="og:description" content="Unemployment is 4.9% in 2026Q2 and vacancies 691.0 thousand in 2026-08; the satellite forecast runs 4 quarters and then stops." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/topics/public-finances/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Public finances — PolicyEngine Macro</title>
<title>UK public finances — PolicyEngine Macro</title>
<meta name="description" content="Net borrowing is stored as -24,520.0 (£m, a negative balance) for 2026-09 and debt is 94.0% of GDP; the OBR emulator runs scenarios, not a forecast." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/topics/public-finances" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/topics/public-finances" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Public finances" />
<meta property="og:title" content="PolicyEngine Macro — UK public finances" />
<meta property="og:description" content="Net borrowing is stored as -24,520.0 (£m, a negative balance) for 2026-09 and debt is 94.0% of GDP; the OBR emulator runs scenarios, not a forecast." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/topics/rates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Rates and gilts — PolicyEngine Macro</title>
<title>UK rates and gilts — PolicyEngine Macro</title>
<meta name="description" content="Bank Rate is 4.0% and the 10-year gilt 5.2514% — and no model on this site forecasts either." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/topics/rates" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/topics/rates" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Rates and gilts" />
<meta property="og:title" content="PolicyEngine Macro — UK rates and gilts" />
<meta property="og:description" content="Bank Rate is 4.0% and the 10-year gilt 5.2514% — and no model on this site forecasts either." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/topics/reform/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Tax and benefit reform — PolicyEngine Macro</title>
<title>UK tax and benefit reform — PolicyEngine Macro</title>
<meta name="description" content="No series stands behind this one: pe-microsim scores a reform over a single policy year and cannot see GDP, inflation, interest rates and macro feedback without a macro bridge." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/topics/reform" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/topics/reform" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Tax and benefit reform" />
<meta property="og:title" content="PolicyEngine Macro — UK tax and benefit reform" />
<meta property="og:description" content="No series stands behind this one: pe-microsim scores a reform over a single policy year and cannot see GDP, inflation, interest rates and macro feedback without a macro bridge." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/us/topics/growth/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Growth — PolicyEngine Macro</title>
<title>US growth — PolicyEngine Macro</title>
<meta name="description" content="Real GDP is 2.1% up on the year in 2026Q3, derived here from a stored level of 24,611.077; no model on this site forecasts US output, and the 2.3% shown for 2026Q4 below is a conditioning baseline, not a forecast." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/us/topics/growth" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/us/topics/growth" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Growth" />
<meta property="og:title" content="PolicyEngine Macro — US growth" />
<meta property="og:description" content="Real GDP is 2.1% up on the year in 2026Q3, derived here from a stored level of 24,611.077; no model on this site forecasts US output, and the 2.3% shown for 2026Q4 below is a conditioning baseline, not a forecast." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/us/topics/inflation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Inflation — PolicyEngine Macro</title>
<title>US inflation — PolicyEngine Macro</title>
<meta name="description" content="CPI is 3.7% up on the year in 2026-09, derived here from a stored index of 336.298; the store carries no US core CPI series, so this page has no core reading — and no model here forecasts the headline either." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/us/topics/inflation" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/us/topics/inflation" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Inflation" />
<meta property="og:title" content="PolicyEngine Macro — US inflation" />
<meta property="og:description" content="CPI is 3.7% up on the year in 2026-09, derived here from a stored index of 336.298; the store carries no US core CPI series, so this page has no core reading — and no model here forecasts the headline either." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/us/topics/jobs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Jobs — PolicyEngine Macro</title>
<title>US jobs — PolicyEngine Macro</title>
<meta name="description" content="Unemployment is 4.1% in 2026-10 and payrolls 159.3m in 2026-10; there is no US vacancies series in the store, and no model here forecasts either number." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/us/topics/jobs" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/us/topics/jobs" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Jobs" />
<meta property="og:title" content="PolicyEngine Macro — US jobs" />
<meta property="og:description" content="Unemployment is 4.1% in 2026-10 and payrolls 159.3m in 2026-10; there is no US vacancies series in the store, and no model here forecasts either number." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
4 changes: 2 additions & 2 deletions economy/us/topics/rates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Rates and Treasuries — PolicyEngine Macro</title>
<title>US rates and Treasuries — PolicyEngine Macro</title>
<meta name="description" content="The effective federal funds rate is 3.88% in 2026-10 and the 10-year Treasury 5.1% on 2026-11-12 — and no model on this site forecasts either." />
<link rel="canonical" href="https://policyengine-macro.vercel.app/economy/us/topics/rates" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://policyengine-macro.vercel.app/economy/us/topics/rates" />
<meta property="og:site_name" content="PolicyEngine Macro" />
<meta property="og:title" content="PolicyEngine Macro — Rates and Treasuries" />
<meta property="og:title" content="PolicyEngine Macro — US rates and Treasuries" />
<meta property="og:description" content="The effective federal funds rate is 3.88% in 2026-10 and the 10-year Treasury 5.1% on 2026-11-12 — and no model on this site forecasts either." />
<meta property="og:image" content="https://policyengine-macro.vercel.app/assets/og-image.png" />
<meta property="og:image:alt" content="PolicyEngine Macro — open economic models for the UK and US" />
Expand Down
Loading