Add an append-only ONS data vintage store#92
Open
vahid-ahmadi wants to merge 1 commit into
Open
Conversation
Everything on the site was pinned to published forecast vintages with no live official data behind it, so there was no way to score a forecast, and no way to tell whether an analysis had used data that existed at the time. data/fetch.py pulls three ONS series (real GDP ABMI, CPI annual rate D7G7, unemployment rate MGSX) and writes a dated snapshot per fetch. Nothing is ever edited in place: an upstream revision arrives as a new file beside the old one, so revisions are visible and any past number stays reproducible. - A fetch finding no upstream change writes nothing, so real revisions are not buried in a stream of identical files. Network failures are reported as failures, never as "no revision". - latest/ is a flattened copy for the page builders. The site is static under a CSP with connect-src 'self', so the browser cannot call the ONS; anything shown has to be baked in at build time. - JSON rather than Parquet: these series are small, and a git-diffable format makes a revision a reviewable diff instead of an opaque blob. - fetch-vintages.yml runs weekday mornings after the release window and opens a PR rather than pushing. Verified against the live API: 285 quarters of GDP to 2026Q1, 150 of CPI to 2026Q2 (2.8%), 221 of unemployment to 2026Q1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Everything on the site was pinned to published forecast vintages with no live official data behind it. That meant no way to score a forecast, and no way to tell whether an analysis had used data that existed at the time.
What
data/fetch.pypulls three ONS series and writes a dated snapshot per fetch:uk_gdp_cvmuk_cpi_yoyuk_unemployment_rateNothing is ever edited in place. An upstream revision arrives as a new file beside the old one, so revisions stay visible and any past number stays reproducible.
forecasts/records which vintage each score used.Design decisions worth flagging:
latest/exists because the site is static underconnect-src 'self'— the browser cannot call the ONS, so anything shown on a page has to be baked in at build time.Verified against the live API
285 quarters of GDP to 2026Q1 · 150 of CPI to 2026Q2 (2.8%) · 221 of unemployment to 2026Q1.
--checkpasses; re-running reportsunchangedfor all three.Note the ONS API 403s the default urllib user agent and 404s (rather than redirecting) when a series moves topic — both handled, and documented in
data/README.md.🤖 Generated with Claude Code