model 07 — ecological stock-flow consistent · define-uk · UK · experimental
Climate policy meets the UK financial system.
Discover the curated scenario set from the hosted server, run scenario deltas locally with one CLI command, and rebuild the validation record. The unlicensed upstream is fetched at a pinned commit and never hosted.
Discover hosted, run locally.
Four routes into the model, hosted to local. Because the upstream is unlicensed, the hosted server discovers and bridges but never runs the model — scenario deltas are produced on your machine.
Hosted MCP tools
Discovery and the incidence bridge
Three tools on the hosted MCP server reach this model: define_list_scenarios (the curated scenario set), define_scenario (returns local run instructions — the unlicensed upstream never executes on our servers), and define_scenario_incidence (experimental: pass a define_payload of locally produced deltas and they become a pre-tax earnings overlay on PolicyEngine's UK population).
Where to read the results
What each scenario represents is on the overview; the gates behind the numbers are on the validation page.
CLI scenario runs
Deltas from the terminal
The CLI lists the curated scenarios and runs any of them locally: pe-macro define-scenarios to browse, pe-macro define-scenario to produce a scenario's deltas vs baseline — real GDP, emissions, unemployment, real consumption. Deltas only, never levels.
pe-macro define-scenarios # list the curated set
pe-macro define-scenario <name> # scenario deltas vs baselineInstall locally
One pip install, upstream fetched at runtime
The adapter installs from GitHub. Nothing upstream is vendored: at runtime it fetches DEFINE-model/DEFINE_UK_1.1 at pinned commit 846081a and executes the published notebook unmodified.
R does the heavy lifting once
A fresh full run needs local R with the notebook's packages; after that, scenario deltas are instant from the cached pinned run.
pip install git+https://github.com/PolicyEngine/define-uk-modelDevelopment: gates and the clean room
Clone to rebuild the validation record
The test suite carries the validation gate: hermetic artifact checks always run, and the oracle comparisons against the pinned upstream run execute wherever a local cache exists — in CI they must skip, because a passing oracle test there would mean the unlicensed upstream was fetched.
The path to hosting
a clean-room Python reimplementation of the published Model Manual v1.1 is the route to a hostable model — protocol and milestones in REIMPLEMENTATION.md, upstream code used only as a numerical oracle.
Four slices have landed. The §2.2 accounting core — the transactions and balance-sheet matrices — is satisfied identically at the manual's own initial values. §3.2 adds the high-level macroeconomic block, §3.3.1 domestic production, and §3.3.2 the power generation sector: 118 equations, Eqs. (21)–(138), contiguous. §3.3.3 input–output and the comparison against the upstream oracle are outstanding, so nothing here is hostable yet and the hosted tools continue to return run instructions.
Reimplementing from the manual is also what surfaces its gaps, and thirteen are now pinned by tests as machine-readable gap records rather than absorbed into a tolerance, with more written up in the reimplementation notes — a net-lending residual the manual itself says “should equal 0”, identities that fail at the manual's own initial values, and symbols the equations use that the parameter tables never list. The largest is a blocker: §3.3.2 as published cannot be simulated forward. Six parameters it uses are absent from Table 5, and two variables are never defined anywhere in the manual, so credit rationing collapses to a constant and desired power-sector investment turns negative. That is the section the climate-policy scenarios run through, and it is recorded in full for the authors.
git clone https://github.com/PolicyEngine/define-uk-model
cd define-uk-model
pytest # hermetic gate everywhere; oracle tests need the local cache