You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UK reform contract: wrapper.household errors under the candidate script, so every UK candidate is rejected #645
Every automatic UK candidate is rejected by the reform_contract gate because every wrapper.household row errors with:
AttributeError: 'NoneType' object has no attribute 'calculate_household'
Cause.scripts/check_uk_candidate.py sets POLICYENGINE_SKIP_COUNTRY_IMPORTS=1 at startup (line 43). With that flag, policyengine/__init__.py binds policyengine.uk = None. The contract's _WrapperHouseholdRoute._call then reaches the wrapper as pe.uk.calculate_household(...), so each household case errors before it runs. The country routes import policyengine_uk directly and are unaffected.
Evidence. Candidate 2.134.5-1.58.2 (pair 996a156c…, #639) was rejected with "16 contract row(s) failed". In the published gates/reform_contract.json, 15 are error rows and 1 is a fail row (unknown_path's rejection check, whose actual error is the same AttributeError), all on wrapper.household. Candidate 2.134.6-1.58.2 (#644) is qualifying on the same code.
Effect. No UK candidate can reach qualified or needs_review through certify-uk-release, so automatic promotion cannot pick up the pe-uk releases due before the 28 October Budget.
Fix. Import policyengine.tax_benefit_models.uk in the route. It exposes the same calculate_household function and does not depend on the skip flag. Add a regression test that runs the route in a subprocess with the flag set.
Activity
MaxGhenis commentedon Oct 17, 2026
Duplicate of #650, fixed by #651.