Skip to content

UK reform contract: wrapper.household errors under the candidate script, so every UK candidate is rejected #645

Closed as not planned

Description

@MaxGhenis

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

  1. MaxGhenis commented on Oct 17, 2026

    @MaxGhenis
    ContributorAuthor

    Duplicate of #650, fixed by #651.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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