Source of truth: packages/engine/src/simulate.ts, function simulate(baseline, budget, deltas). This page restates it; if they ever differ, the code is right and this page is wrong.
Inputs
- The official path: for each of ten years, GDP, revenue, expenditure, interest, the implicit interest rate and debt of all public administrations, as published or derived (see
data/baseline/<year>/path.json, fieldderivationon every row). - Allocations: a State programme and ten absolute amounts of payment credits. The difference with the baseline amount of that programme is the year's expenditure delta (
allocDelta). - Deltas produced by the cards (
packages/cards/src/effects.ts,deltasFor): per year and per target, a band{low, central, high}.
Per year, in this order (simulate.ts)
- Revenue = official revenue + Σ revenue deltas + GDP effect, where the GDP effect = official revenue × elasticity × Σ growth deltas, computed low-with-low, central-with-central, high-with-high (
gdpEffectOnRevenue). - GDP = official GDP × (1 + Σ growth deltas).
- Expenditure before interest = official expenditure − official interest + Σ expenditure deltas + allocation deltas.
- Interest = official interest + official implicit rate × (our previous-year debt − official previous-year debt) (
interestExtra). A smaller deficit this year lowers next year's interest; that is the only feedback loop. - Expenditure = expenditure before interest + interest.
- Balance = revenue − expenditure (negative = deficit).
- Debt = official debt + (our previous debt − official previous debt) − (our balance − official balance). With no change, debt equals the official debt exactly (golden test 1).
- Ratios = balance / GDP and debt / GDP, band by band.
Bands
Bands are added term by term; a subtraction uses low − high for the low bound and high − low for the high bound (sub); multiplying by a negative factor swaps the bounds (scale). So year ten shows the honest spread of every uncertainty compounded.
What is not modelled
Interactions between reforms (effects are added; the interface says so), any macro feedback beyond the single revenue elasticity, behavioural responses not already inside a card's numbers.
Tests that pin this down
packages/engine/test/simulate.test.ts: golden 1 (no change = official path), the four effect tests, the debt-step property (200 random budgets), the band-ordering property. packages/cards/test/golden.test.ts: golden 2 (a card reproduces its stated check).