Problem
#2001 (merged as 3518331, released in 2.117.0) removed gov.dwp.carer_premium.couple. It held the single rate, and the law pays gov.dwp.carer_premium.single once for each qualifying claimant or partner. A saved policy or reform that still sets couple now fails with a bare lookup error:
ValueError: Could not find the parameter gov.dwp.carer_premium.couple (failed at couple).
Main already has a mechanism that fails with migration directions instead, REMOVED_PARAMETERS in policyengine_uk/utils/parameters.py. It is used for gov.dwp.state_pension.age.male and .female. But add_removed_parameter_aliases installs every alias under parameters.gov.dwp.state_pension.age. Adding the key gov.dwp.carer_premium.couple to the dict would therefore create gov.dwp.state_pension.age.couple and leave the carer premium path unchanged.
Proposed fix
- In
add_removed_parameter_aliases, resolve each removed path's parent node from the path itself, instead of using the fixed State Pension age node.
- Then add
"gov.dwp.carer_premium.couple" to REMOVED_PARAMETERS, with directions like: "The carer premium is now paid per qualifying claimant or partner; change gov.dwp.carer_premium.single (the per-person amount)."
- Test that
Reform.from_dict({"gov.dwp.carer_premium.couple": ...}) and a scenario naming the path both raise the new message. Also test that no alias appears under gov.dwp.state_pension.age.
Found by the independent review of #2001 after its merge with main (finding 5). It is not a correctness issue, because the reform already fails loudly.
🤖 Generated with Claude Code
Problem
#2001 (merged as 3518331, released in 2.117.0) removed
gov.dwp.carer_premium.couple. It held the single rate, and the law paysgov.dwp.carer_premium.singleonce for each qualifying claimant or partner. A saved policy or reform that still setscouplenow fails with a bare lookup error:Main already has a mechanism that fails with migration directions instead,
REMOVED_PARAMETERSinpolicyengine_uk/utils/parameters.py. It is used forgov.dwp.state_pension.age.maleand.female. Butadd_removed_parameter_aliasesinstalls every alias underparameters.gov.dwp.state_pension.age. Adding the keygov.dwp.carer_premium.coupleto the dict would therefore creategov.dwp.state_pension.age.coupleand leave the carer premium path unchanged.Proposed fix
add_removed_parameter_aliases, resolve each removed path's parent node from the path itself, instead of using the fixed State Pension age node."gov.dwp.carer_premium.couple"toREMOVED_PARAMETERS, with directions like: "The carer premium is now paid per qualifying claimant or partner; change gov.dwp.carer_premium.single (the per-person amount)."Reform.from_dict({"gov.dwp.carer_premium.couple": ...})and a scenario naming the path both raise the new message. Also test that no alias appears undergov.dwp.state_pension.age.Found by the independent review of #2001 after its merge with main (finding 5). It is not a correctness issue, because the reform already fails loudly.
🤖 Generated with Claude Code