Skip to content

UK dataset build: full migration from policyengine-uk-data (master epic) #665

Description

@juaristi22

Goal

Migrate the UK dataset build fully from policyengine-uk-data into microcosm, at parity, then archive policyengine-uk-data (the policyengine-us-data precedent). End state: policyengine-uk consumes only microcosm-built datasets — national default, sparse default, and the local variant — calibrated exclusively from chronicle facts.

This epic supersedes #144, which tracked the same goal as a flat backlog.

Architecture invariants

  • Frame is the carrier through every stage; calibration is rowwise via the microcosm.calibrate front door.
  • Country package = pure JSON specs (build/uk/), executed by shared runtimes; Python in uk_runtime/ migrates toward specs (Move country build choices into declarative specs #159).
  • Target values come only from pinned chronicle consumer artifacts; computed targets (uprating, rate×count, splits) are explicit microcosm-side declarations.
  • Scope ruling carried from Migrate remaining policyengine-uk-data backlog before archive #144 (2026-07-24): the build is based solely on raw microdata, ledger facts, and the rules engine (plus inflation/aging updates) — no inheritance of processed artifacts whose generating code stays behind in uk-data.
  • No stage ships degraded: fail-closed plan, closed-world gate entries, evidence_absent over invented passes.
  • Every build attempt — including failed rungs and discarded candidates — appends a hash-chained Logbook row (Chronicle: one append-only trace for every build attempt at every rung #628), so the migration's intermediate-build history stays reconstructible.
  • Never import policyengine_uk_data — port definitions, don't wrap them.

Phases

Phase Contents Milestone
P0 Unblockers (A) Fresh national rebuild passes armed gates; schema-4 verification lands
P1 Facts wave 2 (B) + target references (C) + calibration seam (D) First microcosm-calibrated national release, on the certified spine, from chronicle facts only
P2 Raw ingest + imputations (E) + uprating (F) Spine built in microcosm from raw sources; FRS 2024-25 refresh
P3 Facts wave 3 (B) + local areas (G) UK local variant published (constituency + LA weights)
P4 Sparse default (H) + downstream integration (I) ~50k L0 national default; policyengine-uk consumes microcosm datasets
P5 Decommission (J) policyengine-uk-data archived

Workstreams

Related, non-blocking: #365, #31, #552/#364/#467, #180, #325, Logbook epics #637/#641 (workstream H publication surface), #661 (diagnostics carry chronicle package IDs — workstream D), naming cleanups #639/#640.

Carried-over uk-data backlog

policyengine-uk-data stayed active after #144's June bookkeeping and accumulates new issues — 5 open as of 2026-08-12: PolicyEngine/policyengine-uk-data#438 (stale public-transfer feed, state pension ≡ £0 → workstream F/#148), PolicyEngine/policyengine-uk-data#448 (Scottish/Welsh council tax +20–30%, WAS owned_land instability → E and C/D), PolicyEngine/policyengine-uk-data#450 (UC deduction attributes imputation → E, new stage), PolicyEngine/policyengine-uk-data#452 (UC caseload ~40% below admin counts → D/E), PolicyEngine/policyengine-uk-data#453 (unsourced mortgage target → B, already a recorded chronicle blocked source). Dispositions live in the roadmap doc's Appendix B; workstream J re-sweeps the live list at decommission time.

Sequencing notes

  • C/D deliberately run on the existing certified spine first: prove facts→targets→calibration→gates at parity before any ingest work, then E swaps the spine underneath a fixed harness.
  • E (microcosm-side) and wave 3 (chronicle-side) parallelize; G needs both.
  • H needs only D + schema-4 verification — the exact-k machinery is country-agnostic.
  • The incumbent keeps releasing until I completes; every incumbent refresh widens the parity bar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions