Skip to content

Explain migration for the removed couple carer-premium parameter - #2451

Merged
juaristi22 merged 1 commit into
mainfrom
fix-2137-removed-parameter-migrations
Oct 19, 2026
Merged

juaristi22 merged 1 commit into
mainfrom
fix-2137-removed-parameter-migrations

Conversation

@juaristi22

Copy link
Copy Markdown
Collaborator

Fixes #2137

Saved reforms and Scenarios that set the removed gov.dwp.carer_premium.couple parameter now receive migration directions naming gov.dwp.carer_premium.single, the per-person weekly amount. They previously failed with a bare lookup error.

Register the removed path with the existing generic alias installer. Valid per-person reforms and the State Pension/OBR migration aliases retain their behavior; no benefit formula, policy value or alias-installation function changes.

Validation: 179 focused tests passed (6 new regressions and 173 existing migration, reform, Scenario and carer controls). Before the change, the new regressions produced 5 failures and 1 passing control. make format, Ruff and git diff --check passed. The tests cover the public entry points, correct alias parent, hidden removed-parameter metadata and valid replacement reforms.

Local Python 3.13.14 / Core 3.32.27 differs from locked Core 3.33.2. Full make test, documentation builds and private-data simulations were not run for this diagnostic-only registry change; hosted full CI remains required.

Reproducer: policyengine_uk/tests/test_removed_carer_premium_parameter.py::test_removed_carer_premium_reforms_give_migration_directions

axiom: n/a: migration diagnostics only; no policy provision, parameter value or benefit calculation changes.

@juaristi22 juaristi22 self-assigned this Oct 16, 2026

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right, fine to approve.

@juaristi22, this is a small, correct change. Main already resolves each removed path's parent from the path itself, so the one new REMOVED_PARAMETERS entry is all the fix needs. The message points to the right replacement: carer_premium.single is the per-person amount, and carer_premium.py:73 pays it once for each qualifying claimant or partner.

  1. nit, policyengine_uk/utils/parameters.py:163: #2490 also edits this file. I merged the two branches locally and they merge cleanly. Whichever lands second should still rerun this test file.

What I checked

  • Read the issue, the PR body and the full diff. Read add_removed_parameter_aliases on main and confirmed it already walks the parent path.
  • Ran pytest policyengine_uk/tests/test_removed_carer_premium_parameter.py: 6 passed. With utils/parameters.py reverted to main: 5 failed, 1 passed (the valid-reform control).
  • ruff check and ruff format --check on both changed Python files: clean.
  • Hosted CI on 413de23 is green.
  • Process: the changelog fragment is .fixed.md; the Reproducer and axiom lines are present; the Fix evidence check is green.
  • Not checked: the policyengine.py or API layers that read the parameter tree.

🤖 Generated with Claude Code

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, per my review above. The shoulds and nits can follow.

@juaristi22
juaristi22 added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit a0c89fe Oct 19, 2026
14 checks passed
@juaristi22
juaristi22 deleted the fix-2137-removed-parameter-migrations branch October 19, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give migration directions for the removed gov.dwp.carer_premium.couple parameter (generalise add_removed_parameter_aliases)

2 participants