DEFINE-UK ecological stock-flow

DEFINE-UK

Run the adapter locally and reproduce the gates.

Discover hosted, run locally

The upstream is unlicensed, so the hosted server lists scenarios and bridges results but never runs the model: you produce the deltas on your machine.

1

Hosted MCP tools

Three tools on the hosted MCP server reach this model. None of them runs it.

The three toolsWhat each returns
  • define_list_scenarios: the curated scenario set.
  • define_scenario: local run instructions, never results.
  • define_scenario_incidence (experimental): turns a define_payload of locally produced deltas into a pre-tax earnings overlay on PolicyEngine’s UK population.
  • What each scenario represents is on the overview; the gates behind the numbers are on the validation page.
2

Install locally

The adapter installs from GitHub and vendors nothing upstream: at runtime it fetches DEFINE-model/DEFINE_UK_1.1 at pinned commit 846081a and runs the published notebook unmodified. A fresh run needs local R with the notebook’s packages; after that, deltas are instant from the cached pinned run.

pip install git+https://github.com/PolicyEngine/define-uk-model
3

CLI scenario runs

List the curated scenarios, then run one locally for its deltas against 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 baseline
4

Development: gates and the clean room

The test suite carries the validation gate. Hermetic artifact checks run everywhere; the oracle comparisons run where a local cache exists and must skip in CI, where passing would mean the unlicensed upstream was fetched.

git clone https://github.com/PolicyEngine/define-uk-model
cd define-uk-model
pytest                    # hermetic gate everywhere; oracle tests need the local cache
The clean-room reimplementationSolves the whole manual · milestone 2 not passed · thirteen manual gaps pinned
  • A Python reimplementation of the published Model Manual v1.1 is the route to a hostable model. The upstream code is used only as a numerical oracle (REIMPLEMENTATION.md).
  • Every printed equation of the manual (§3.1–§3.4.7) is registered and the whole model solves quarter by quarter.
  • It does not reproduce the upstream run: baseline GDP falls up to 44% below it by 2040, and its green-investment multiplier is 1.52 against the upstream’s full-run 2.30.
  • So milestone 2 is not passed and nothing here is hostable yet; the hosted tools continue to return run instructions.
  • Thirteen gaps in the manual are pinned by tests as machine-readable records, not absorbed into a tolerance: a net-lending residual the manual itself says “should equal 0”, identities that fail at the manual’s own initial values, and symbols 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, so credit rationing collapses to a constant and desired power-sector investment turns negative.
  • The climate-policy scenarios run through that section; it is recorded in full for the authors.