Pin UC vs Housing Benefit mutual-exclusion contract (#201)#1638
Merged
Pin UC vs Housing Benefit mutual-exclusion contract (#201)#1638
Conversation
Add yaml regression tests for `housing_benefit_eligible` exercising the `& ~claiming_uc` clause that prevents a benunit on Universal Credit from also being eligible for Housing Benefit. The contract already holds today via the explicit guard in the eligibility formula, but nothing pinned it as a test, so a future refactor could silently allow simultaneous UC + HB awards. Other legacy benefit consistency is enforced via: - Reported anchors (`jsa_income`, `esa_income` only pay reported amounts, so unreported families don't double-up with UC). - `active.yaml` flags shutting Tax Credits, Income Support and income-based JSA off post-managed-migration (PRs #1619, #1631). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
MaxGhenis
approved these changes
Apr 20, 2026
Collaborator
MaxGhenis
left a comment
There was a problem hiding this comment.
Pure regression-test addition pinning the existing housing_benefit_eligible UC-exclusion contract. No logic change. Approving.
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.
Summary
claims_*variables #201 (with the audit summarised in the issue comment).housing_benefit_eligiblecovering the existing& ~claiming_ucclause: a benunit on Universal Credit is not HB-eligible; flippingwould_claim_ucrestores eligibility.Why this is the right scope
Other legacy benefit consistency is already enforced by:
jsa_income,esa_incomeonly pay reported amounts, so an unreported family doesn't double-up with UC.active.yamlflags — Tax Credits (5 April 2025), Income Support and income-based JSA (31 March 2026) are switched off in the parameter tree post-managed-migration, via Stop paying Tax Credits after DWP managed migration completed #1619 and Zero out Income Support and income-based JSA after managed migration #1631.The HB ↔ UC exclusion is the only live "code-level" consistency check. That's what this test pins.
Test plan
policyengine-core test policyengine_uk/tests/policy/baseline/finance/benefit/family/uc_legacy_mutual_exclusion.yaml -c policyengine_uk— 2/2 pass.make formatclean.🤖 Generated with Claude Code