Repository navigation
Import the UK model module directly in the contract's household route - #651
Merged
Merged
Conversation
scripts/check_uk_candidate.py sets POLICYENGINE_SKIP_COUNTRY_IMPORTS,
which leaves policyengine.uk as None, so every household-route row of
the reform-contract gate errored ('NoneType' object has no attribute
'calculate_household') and every candidate since the gate went live
was rejected. Fixes #650.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 17, 2026
MaxGhenis
marked this pull request as ready for review
October 17, 2026 02:30
Contributor
Author
|
Merge audit (W1, session local_37646626): merged at 9799449, pinned with
|
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #650
Independent review: an Opus 5.5 review approved 9799449 (the Codex lanes were closed), in
review-out.md. It reproduced the CI failure under the switch and the fix. It also found that the sampled propertyroutes_agree_and_baselines_holdcalls the same route and is fixed by the same change. That accounts for CI's 15 errors plus 1 fail.Reproducer: tests/test_uk_budget_reform_contract.py::test_the_household_route_runs_where_country_imports_are_skipped
What broke
The reform-contract gate rejected every UK candidate since it went live: 2.134.5, 2.134.6 and 2.134.7 (#639, #644, #647).
wrapper.householdrow errored:AttributeError: 'NoneType' object has no attribute 'calculate_household'. That is 15 errors, plus 1 fail whereunknown_pathexpected anew_crediterror.scripts/check_uk_candidate.pysetsPOLICYENGINE_SKIP_COUNTRY_IMPORTS=1when it is imported, sopolicyengine/__init__.pysetspolicyengine.uk = None. The route calledpe.uk.calculate_household.full-1.1.0-run-pe-uk-2.134.7-no-flag.log).The fix
The route imports
policyengine.tax_benefit_models.uk, the modulepolicyengine.uknames, directly. So it runs whatever the switch says. No check, verdict or report shape changes.Tests
test_the_household_route_runs_where_country_imports_are_skippedsetspolicyengine.uktoNone, as the gate's process leaves it, and runsapril_rate_changeon the household route. Every row passes, apart from the parameter checks the route reports unsupported by design. It fails on main's route.POLICYENGINE_SKIP_COUNTRY_IMPORTS=1,run_budget_reform_contract(routes=["wrapper.household"])gives 70 pass and 0 error. CI's run gave 15 errors.test_uk_budget_reform_contract.pyandtest_uk_candidate_gates.pygive 414 passed.ruffis clean.After this
The next certify run should no longer fail these rows. Candidates may still be held by other gates, which this doesn't touch: the 2.134.7 receipt also shows
replay: construction_inert, andbudget_inputsandmetrics_reviewneeding review.🤖 Generated with Claude Code