Repository navigation
policyengine-uk 2.102.4+ needs policyengine-core 3.32.9+, which the certified US default refuses #1086
Description
Problem
From policyengine-uk 2.102.4 (2026-09-30), policyengine-uk requires policyengine-core>=3.32.9; 2.102.3 and earlier accept >=3.30.1. microcosm's workspace resolves one policyengine-core for both country extras, so uv lock --upgrade-package policyengine-uk==2.104.2 moves core 3.32.5 → 3.32.12 for the US environment too.
The certified US default that latest.json points to, populace-us-2024-spm-20260915, declares compatible_core_packages: policyengine-core ==3.32.5. With core 3.32.12 installed, microcosm.data.loader._enforce_package_compatibility on that release manifest raises:
_CertifiedPackageCompatibilityError: Certified release 'populace-us-2024-spm-20260915' is incompatible with installed policyengine-core 3.32.12; release certification requires ==3.32.5.
That is the failure #936 fixed for policyengine-us. Until it is resolved, microcosm cannot lock any policyengine-uk release from 2.102.4 on without breaking US loading.
The certified UK default, populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z, already fails the same check on main. It pins policyengine-uk ==2.89.2 and policyengine-core ==3.27.1, while main locks 2.100.0 and 3.32.5.
Options
-
A. Resolve each country's core separately with
[tool.uv] conflictsbetween the US-side and UK-side extras. A first trial on main 3598c38 (nine pairwise sets, microcosm-build/data/frameus×uk, with policyengine-uk 2.104.2) is incomplete. These parts work:uv lockforks core into 3.32.5 and 3.32.12.uv sync --all-packages --locked --extra uskeeps core 3.32.5, policyengine-us 2.2.1 and spm-calculator 1.0.0.--extra ukgets core 3.32.12.
These do not:
--package microcosm-data --extra us,--package microcosm-frame --extra policyengineand--all-packages --extra policyenginestill draw core 3.32.12 with policyengine-us 2.2.1.--extra policyengine --extra ukinstalls both engines together.
A complete version needs three more things:
- conflict sets that cover microcosm-frame's
policyengineextra; - a core pin on the US-side extras;
- a lock-level test that every US install path resolves the certified trio and that every US × UK combination is refused.
CI already installs one extra per job.
-
B. Hold policyengine-uk at 2.100.0 until a certified US release moves core.
-
C. Re-certify the US default under the newer core.
What the next policyengine-uk bump touches
This was rehearsed against policyengine-uk 2.104.2 plus PolicyEngine/policyengine-uk#2021, with the engine-uk suite run under each.
- Uprating pins.
tools/pin_uk_uprating_engine_values.pymoves only the version stamp; the values are unchanged. - Concept mapping. Review the mapping, set
engine_version, then runtools/refresh_concept_coverage.py --engine policyengine-uk.- 28 inputs were added since 2.100.0: alcohol and tobacco quantities, car attributes,
lifetime_isa_balance,mortgage_debtandconsumer_debt. - None matches an existing concept.
fact:household.mortgage_principalis the repayment flow, already bound tomortgage_capital_repayment. brmaleaves the input list once Default the BRMA from the household's region policyengine-uk#2021 is in.
- 28 inputs were added since 2.100.0: alcohol and tobacco quantities, car attributes,
- UK spine graph.
tools/graph_uk_spine_fixture.pyrewrites onlyuk_spine.json, and only thenumerical_dependenciesversion strings change. - Lock hash.
APPROVED_UV_LOCK_SHA256inus_runtime/worker_identity.pyfollows the new lock hash.
These four are the only engine-uk failures at 2.104.2. Adding PolicyEngine/policyengine-uk#2021 does not change that list.
The eFRS parity reference (optional, and deliberately fenced)
uk/efrs_parity_reference.json still records policyengine-uk 2.89.0. Regenerating it with any later engine changes the surface: 2.89.1 adds bus_fare_spending, and 2.89.2 adds employment_sector and sic_industry_division. With 2.89.2 or later it does three things:
- It adds
bus_fare_spending,employment_sectorandsic_industry_division, taking the reference from 145 to 148 populated layers. This already happens at the lock's 2.100.0. - It makes
build_uk_release_input_coverage_manifest.pyrequire a--candidate-h5evidence refresh. - With Default the BRMA from the household's region policyengine-uk#2021, it adds
brmatoformula_owned_persisted_overrides_included, taking that list from 13 to 14.
The refresh is purely additive. All three new columns carry signal in the certified candidate, which gives 148 required columns and 0 exclusions, and the spine produces all three. The engine-free tests still pin the frozen candidate at 2.89.0 and 145 columns (test_frozen_candidate_retains_its_original_engine_provenance and three siblings), so the re-pin should be a deliberate step, not a side effect of a bump. experiments/791-household-composition-receipts.md says it belongs with #749.
PolicyEngine/policyengine-uk#2021 needs nothing here
brma computed from the pinned enhanced FRS for 2024, 2025, 2026, 2027, 2030 and 2032 is byte-identical with and without PolicyEngine/policyengine-uk#2021. The same holds on microcosm's certified candidate for 2023, 2024, 2025, 2026, 2028 and 2030; see the comment below. microcosm's frs_brma stage sets brma for every household, so an explicit input always beats the new region default. The only brma change is the reference bookkeeping above.
Activity
MaxGhenis commentedon Oct 2, 2026
Also checked on microcosm's certified UK candidate
populace_uk_2023.h5(revisionpopulace-uk-2023-dd68c73-4aa4b14-20260619T023711Z):brmafor 2023, 2024, 2025, 2026, 2028 and 2030 is byte-identical under policyengine-uk 2.104.2 with and without PolicyEngine/policyengine-uk#2021, for all 535,080 households (same sha256 every year). The new formula only fills households with no stored BRMA, and microcosm stores one for every household.MaxGhenis commentedon Oct 2, 2026
Corrected the description after an independent review:
microcosm-data[us]andmicrocosm-frame[policyengine]still drew core 3.32.12, andpolicyengine+ukcould be installed together.==2.89.2/==3.27.1).juaristi22 commentedon Oct 5, 2026
Two ways to fix this. Which do you prefer, @MaxGhenis?
Why it's urgent. #1095 tracks the uk-data fixes microcosm still needs. Since #1100 merged, most of its open items wait only on a policyengine-uk bump, and policyengine-uk has now released all of them:
is_hbai_dependent_childandis_claimant_or_partner;The same bump also brings engine-only fixes:
is_rentingand Child Benefit opt-outs (Fix Child Benefit opt-outs, rental flags and bus fare modelling policyengine-uk#2140).Every one of these needs policyengine-core 3.32.9 or later, and 3.32.12 or later from policyengine-uk 2.109.8. The latest releases are policyengine-uk 2.121.0 and core 3.32.17. So microcosm UK can't take any of them until this is fixed.
Option 1: build and certify a new US default under a newer core.
populace-us-2024-spm-20260915did for policyengine-us, probably won't hold here. Core 3.32.8, 3.32.16 and 3.32.17 change how uprating and auto-carry-over work, so projected-year outputs can move. That makes this a new build and certification.Option 2: give each country its own core pin (completing option A above).
Add
[tool.uv] conflictsbetween each US-side and each UK-side engine extra, and addpolicyengine-core==3.32.5on the US-side extras. Every US install path then resolves the certified trio, while the UK fork moves on its own.The 2 October trial had two gaps:
microcosm-frame[us], which installs no engine, instead ofmicrocosm-frame[policyengine], which installs policyengine-us;CI already installs one country extra per job, and
docs/agent-guide.mdalready sets up one environment per country, so nothing needs both engines in one environment.The PR would add a CI check that:
It would also re-pin
APPROVED_UV_LOCK_SHA256.On its own it changes no engine version. The UK bump would follow as a separate PR, and the US would stay on core 3.32.5 until its next certification.
Which would you prefer?
Lock policyengine-uk 2.122.2 and policyengine-core 3.32.19 (#1095)
Lock policyengine-uk 2.122.2 and policyengine-core 3.32.19 (#1095)
MaxGhenis commentedon Oct 7, 2026
@juaristi22 Option 2: give each country its own core pin.
Why not option 1:
latest.jsonpoints at the new release. Under d844 that promotion waits on US base v2: one CPS+ACS+PUF-detail pool; datasets labeled by exact record count (dense = full pool; exact-k L0 selection) #578's exact-k gate.Nothing needs both engines in one environment. No module imports both
policyengine_usandpolicyengine_uk, and CI installs one country extra per job.For the PR:
policyengine-core==3.32.5on every US-side extra, includingmicrocosm-frame[policyengine], which installs policyengine-us. Add[tool.uv] conflictsbetween each US-side and each UK-side engine extra.APPROVED_UV_LOCK_SHA256inus_runtime/worker_identity.py. Anyuv.lockchange fails the stacked-spine tests until it's re-pinned.The US moves to the newer core with its next certified build, likely the Route A rerun on the CT-fixed ladder (d713), not before.
Thanks for laying out both options so clearly.
Give each country its own policyengine-core pin (#1086)
Lock policyengine-uk 2.122.2 and policyengine-core 3.32.19 on the UK …
Give each country its own policyengine-core pin (#1086)
Lock policyengine-uk 2.122.2 and policyengine-core 3.32.19 on the UK …
Merge pull request #1143 from PolicyEngine/uk-per-country-core-pin
Lock policyengine-uk 2.122.2 and policyengine-core 3.32.19 on the UK …
Lock policyengine-uk 2.123.0 for the landlord inputs (#1106)
Lock policyengine-uk 2.123.0 for the landlord inputs (#1106)
Merge pull request #1169 from PolicyEngine/microcosm-pe-uk-core-split…
MaxGhenis commentedon Oct 9, 2026
#1169 merged (4ed3e64). It finishes what this issue asked for, on top of two earlier PRs:
What #1169 added:
microcosm-build[us],microcosm-data[us]ormicrocosm-frame[policyengine]) with one that installs policyengine-uk. That includes--all-packages --all-extras. Each country needs its ownUV_PROJECT_ENVIRONMENT.--all-packages --extra policyengine, the path the 2 October trial found drawing core 3.32.12, and--all-packages --extra policyengine --extra us. It has 16 cases.State of the lock at the merge (
uv sync --locked --dry-run, empty environment):populace-us-2024-spm-20260915requires.uv lock --checkexits 0, andAPPROVED_UV_LOCK_SHA256equals the lock's sha256.populace-uk-2023-dd68c73-4aa4b14-20260619T023711Zstill fails the loader's compatibility check (policyengine-uk ==2.89.2,policyengine-core ==3.27.1). That hasn't changed since before Give each country its own policyengine-core pin (#1086) #1143, and a new certified UK build is what clears it.PolicyEngine/policyengine-uk#2021:
policyengine_uk/variables/household/BRMA.pyin every policyengine-uk wheel on PyPI from 2.104.0 to 2.125.0 (68 wheels, each checked against PyPI's sha256). None hasdef formulaorREGION_DEFAULT_BRMA, and #2021's diff adds both. So no release givesbrmaa formula yet.frs_brmastoresbrmafor every household. On 2026-10-02,brmawas byte-identical per year with and without #2021, on the pinned eFRS and on the certified candidate (comments above).brma. That follows the ruling's "keep it to the lock". At the next deliberate re-pin under a release that carries #2021,brmajoinsformula_owned_persisted_overrides_included(13 to 14).test_uk_release_input_coverage.pyassertslen(overrides) == 13, so the re-pin can't miss it.The issue stays closed. Nothing more is needed here for #2021 or d816.
Lock policyengine-uk 2.123.0 for the landlord inputs (#1106)
Lock policyengine-uk 2.123.0 for the landlord inputs (#1106)
Lock policyengine-uk 2.127.0 (#1095)
Lock policyengine-uk 2.127.0 (#1095)
Lock policyengine-uk 2.127.0 (#1095)