Skip to content

Merge main into #2573's branch (resolves a comment-only conflict) - #2592

Closed
MaxGhenis wants to merge 15 commits into
microcosm-engine-inputs-2572from
hub/merge-main-into-2572
Closed

MaxGhenis wants to merge 15 commits into
microcosm-engine-inputs-2572from
hub/merge-main-into-2572

Conversation

@MaxGhenis

Copy link
Copy Markdown
Collaborator

@juaristi22: #2573 is approved at 7b73a30dd (independent review of #2573 with #2580; all 17 checks pass), but it now conflicts with main after #2571 merged overnight.

The only conflict is the header comment of policyengine_uk/data/uprating_indices.yaml: #2571 rewrote it, and your branch had extended the old text. This merge keeps main's header and carries your note (liquid and solid fuel are CPI-uprated LCFS spending) into it. No mapping line conflicted; the merged file parses, and no conflict markers remain in the tree.

Merging this PR fast-forwards your branch, so #2573 becomes mergeable again and the hub lands it through the merge queue. If you'd rather resolve it yourself, close this.

🤖 Generated with Claude Code

juaristi22 and others added 15 commits October 22, 2026 16:16
The £2,000 NICs exemption cap from 6 April 2029 covers salary-sacrificed
and bonus-sacrificed pension contributions together, and FA 2004
s. 228ZA(5)(b) adds both back to annual allowance threshold income, so no
rule treats the two routes apart. Datasets still need to: HMRC's salary
sacrifice users and reliefs come from ASHE, which does not cover bonus
sacrifice, and the OBR costs the bonus route on its own base (costing
note, paragraphs 1.4, 1.5 and 1.9).

pension_contributions_via_bonus_sacrifice is a person input uprated with
average earnings, as the OBR projects its base (paragraph 1.8).
pension_contributions_via_salary_sacrifice_from_pay now adds it to the
salary input under the same pay condition, so the cap, the NICs excess
and the annual allowance readers follow. A negative value in either
input counts as none rather than offsetting the other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maintenance paid by a spouse, civil partner, former spouse or former civil
partner is income for Universal Credit (UC Regs 2013 reg. 66(1)(d)),
Pension Credit (SPC Regs 2002 reg. 15(5)(d)) and Housing Benefit (HB Regs
2006 reg. 40; HB (SPC) Regs 2006 reg. 29(1)(o)). Child maintenance is
none of these. No means test counted either: maintenance_income holds the
FRS child maintenance questions, and datasets put the payments from an
absent partner in private_transfer_income, which reaches only HBAI and
market income.

spousal_maintenance_income is a new person input, uprated by GDP per
head as the other two are. It counts:
- in UC unearned income, from 2013-04-29;
- in Pension Credit income, and in the savings credit non-qualifying
  income (reg. 9(f));
- in Housing Benefit income, less £15 a week where the family includes a
  child or young person (HB Regs 2006 Sch 5 para 47; HB (SPC) Regs 2006
  Sch 5 para 20), under both regimes. On the pension-age savings credit
  only route the disregard comes off the Pension Credit figure, which
  counts the maintenance in full (reg. 27(4)(c)(ii));
- in market income, household market income and HBAI income.

maintenance_income is documented as child maintenance, and the child
maintenance page now describes the split. Datasets that do not supply the
new input keep today's results.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Support Payment

FRS benefit code 6 is "Bereavement Support Payment / Widowed Parent's
Allowance", and datasets put it in bsp_reported, which reaches household
benefits and HBAI only. The two benefits are treated differently.
Bereavement Support Payment is tax-free, is not Universal Credit unearned
income and has had frozen rates since April 2017. Widowed Parent's
Allowance (SSCBA 1992 s.39A) rises with CPI and:
- is taxable (ITEPA 2003 s.577), so it is in social_security_income and
  also reaches Income Support and tax credit income;
- is UC unearned income (UC Regs 2013 reg. 66(1)(b)(vi));
- counts in Housing Benefit less £15 a week (HB Regs 2006 Sch 5 para 16;
  HB (SPC) Regs 2006 Sch 5 para 7);
- is disregarded by £10 a week in Income Support (IS Regs 1987 Sch 9
  para 16(h));
- is a welfare benefit for the benefit cap (WRA 2012 s.96(10)(n));
- overlaps with Carer's Allowance (SI 1979/597 regs 4 and 12) and Carer
  Support Payment (SSI 2023/302 reg. 16(3)(e)), as a whole payment: its
  additional pension is not separated.

widowed_parents_allowance_reported is a CPI-uprated person input and
widowed_parents_allowance adds it. Like Bereavement Support Payment it is
in household benefits, government spending, HBAI income and benefits, the
pre-Budget household benefits, disable_simulated_benefits and the fiscal
partition.

Pension Credit is left alone: the allowance is not payable from State
Pension age or while the recipient lives with a partner (s.39A(4) and
(5)), so no Pension Credit claimant or partner can receive it.

bsp_reported keeps its CPI uprating until datasets split code 6 (#2381).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uprate_student_loan_plans had four problems:
- Step 3 never fired. base_year_age = age - (year - 2023) and
  uni_start_year = year - age + 18 give base_year_age = 2041 -
  uni_start_year, so uni_start_year >= 2012 implies base_year_age <= 29,
  and Step 3's test base_year_age > 29 is never true. No Plan 2 holders
  were added above the base year's oldest.
- It mixed two models. Step 1 assigns plans by the projection year's
  intake, which suits projected datasets: they copy the base year with
  ages fixed. Steps 2 and 3 tested base_year_age, which is a person's
  base-year age only if ages advance.
- The base year was a constant, 2023, while datasets built on FRS 2024-25
  start in 2024.
- The generator was seeded by the year and drew by position, so a person
  could be a new holder in one year and not the next, and the result
  depended on row order.

apply_uprating now passes the dataset's first year down. Steps 2 and 3
compare the data's age with the base year's oldest holder of the plan,
who started university in the plan's first intake: 2012 for Plan 2 and
1998 for income-contingent Plan 1 loans. On a 2024 dataset, Step 3 adds
Plan 2 holders aged 31 to 35 in 2029 and Step 2 adds Plan 1 holders aged
45 and 46. Each person's draw comes from splitmix64_uniform on person_id,
with a salt of its own.

Step 1 is unchanged. Stored student_loan_repayments still override the
formula (#1764).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine's energy inputs are electricity_consumption, gas_consumption
and domestic_energy_consumption. Homes off the gas grid heat with oil,
LPG, coal or wood, which ONS household spending records as liquid fuels
(COICOP 04.5.3) and solid fuels (04.5.4). Without inputs for them, an
energy reform cannot reach those homes, which cluster in rural areas and
Northern Ireland.

liquid_fuel_consumption and solid_fuel_consumption are household inputs,
annual, GBP, default 0. They are part of
housing_water_and_electricity_consumption, so they are not added to
consumption. They join DATASET_UPRATING_EXCLUSIONS, so dataset projection
treats them as it treats the other energy inputs: flat for now, and
projected from a declared price year once #2526 settles it. No formula
reads them yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixture pinned Child Benefit, Universal Credit and the other awards
with bare values, which do not apply to 2026, so the model computed them
and they reached Council Tax Reduction income: 36 of the 45 cases failed.
Keying the benefit-unit inputs by year, as the people inputs already are,
isolates the statutory income list as intended. The CTR formula is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s in England only

Step 2 wrote every Plan 1 loan off 29 years after the course started, but
loans first paid before 1 September 2006 (the 2005 and earlier intakes)
are written off at 65 (GOV.UK, "When your student loan gets written off
or cancelled"). Projected from 2024 to 2029, Step 2 now adds holders at
ages 45 to 49 (the 1998 to 2002 intakes), not 45 and 46. It also now
requires the 1998 or a later intake, the first with income-contingent
loans, which the 29-year write-off had bounded before. Step 1's write-off
of existing holders is unchanged.

Step 4 goes back to England only. Plan 5 is the only plan that did not
exist in the base year; the 2023-and-later intakes in Wales, Scotland and
Northern Ireland are on plans (2, 4 and 1) the data already holds at those
ages, so adding holders there would count borrowers twice. The funding
nation still sets the plan in Steps 2 and 3.

uprate_student_loan_plans also returns early without person_id, which it
keys the take-up draws on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fuels had joined DATASET_UPRATING_EXCLUSIONS, which holds the
electricity and gas inputs flat because their stored amounts are NEED kWh
priced at Ofgem's 2026-27 unit rates. Ofgem's cap does not cover heating
oil, LPG, coal or wood, and the planned source is Microcosm's COICOP
04.5.3 and 04.5.4 figures at data-year prices. Holding them flat would
leave projected years at 2024 prices, and #2571, which projects that
exclusion set from a declared price year, would then apply an energy
declaration to them that does not describe them.

They now leave the exclusions and are listed under CPI in
uprating_indices.yaml, as the other LCFS consumption variables are, until
a dataset declares their own price year. This also makes this PR and
#2571 independent in meaning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rd limit

- spousal_maintenance_income: Universal Credit counts maintenance under a
  court order or an agreement (reg. 66(1)(d)); voluntary payments are
  counted too, as survey data cannot separate them. Maintenance from a
  former cohabiting partner does not belong in the input: Universal Credit
  and Pension Credit do not count it, while working-age Housing Benefit
  does (Sch 5 para 47), which the model does not capture.
- income_support_applicable_income: paras 36 and 37 of Sch 9, which limit
  the widowed parent's allowance and war pension disregards together, are
  not modelled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's #2571 rewrote the header comment of policyengine_uk/data/uprating_indices.yaml (energy variables now use the declaration-aware projector). This branch had extended the old header with the note that liquid and solid fuel consumption are CPI-uprated LCFS spending. Keep main's header and carry that note into it. No mapping line conflicted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

UK hub (Claude session, for Max): closing. @juaristi22 rebased #2573 onto main at 10:16Z (head 112056f), which resolves the conflict this PR fixed. Thanks.

@MaxGhenis MaxGhenis closed this Oct 23, 2026
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.

2 participants