From 2bdb860a86859fad2de0c693a30427f8356f460d Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 2 Oct 2026 15:30:16 -0400 Subject: [PATCH 1/4] Uprate the Scottish Carer Supplement with the benefit uprating index The supplement had no uprating metadata, so the model held it at 11.70 a week from 2027 while the Carer Support Payment component kept rising. Social Security (Scotland) Act 2018 s.86B requires Scottish Ministers to bring forward legislation raising each relevant figure, which includes both components (carer's assistance is s.28, in Part 2 Chapter 2), to at least its s.86A inflation-adjusted level. Their measure is the 12 months to September CPI, rounded to the nearest 5p (s.86A report for 2026-27, sections 1.6, 2.1, 3.1 and 6.1). SSI 2026/170 reg 12(3) raised both components by the 3.8% September 2025 rate: 83.30 to 86.45 and 11.29 to 11.70. The supplement now uprates with gov.benefit_uprating_cpi, as the Carer Support Payment component and Carer's Allowance already do. That index lags OBR calendar-year CPI by a year, so it approximates rather than reproduces September CPI. As for every other uprated parameter, the model does not round projected rates to 5p: 2027-28 is 11.969 a week. Also cite s.86B and the s.86A report on rate.yaml, and replace the supplement's dead socialsecurity.gov.scot news link with the report's table of 2026-27 rates. Fixes #1957 Co-Authored-By: Claude Opus 5.5 --- changelog.d/1957.fixed.md | 1 + .../carer_support_payment/rate.yaml | 4 + .../carer_support_payment/supplement.yaml | 11 ++- .../scottish_carer_supplement.yaml | 56 ++++++++++++ ...test_scottish_carer_supplement_uprating.py | 91 +++++++++++++++++++ 5 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 changelog.d/1957.fixed.md create mode 100644 policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml create mode 100644 policyengine_uk/tests/test_scottish_carer_supplement_uprating.py diff --git a/changelog.d/1957.fixed.md b/changelog.d/1957.fixed.md new file mode 100644 index 0000000000..00de766f20 --- /dev/null +++ b/changelog.d/1957.fixed.md @@ -0,0 +1 @@ +- Uprate the Scottish Carer Supplement from 2027-28 with `gov.benefit_uprating_cpi`, the benefit uprating index the Carer Support Payment component already uses as its proxy for the previous September's CPI, instead of holding it at £11.70 a week. diff --git a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml index 1aee85e056..c3efc0c2be 100644 --- a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml +++ b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml @@ -13,3 +13,7 @@ metadata: href: https://www.mygov.scot/carer-support-payment - title: The Social Security (Up-rating) (Miscellaneous Amendments) (Scotland) Regulations 2026 reg. 12(3)(a) href: https://www.legislation.gov.uk/ssi/2026/170/regulation/12/made + - title: Social Security (Scotland) Act 2018 s. 86B (duty to uprate assistance) + href: https://www.legislation.gov.uk/asp/2018/9/section/86B + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI) + href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/4/ diff --git a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml index d375e1ac37..79e97cf390 100644 --- a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml +++ b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml @@ -7,10 +7,17 @@ metadata: period: week unit: currency-GBP label: Scottish Carer Supplement rate + uprating: gov.benefit_uprating_cpi reference: - - title: New rates for carer and disability payments in 2026 - href: https://www.socialsecurity.gov.scot/news-events/news/new-payment-rates-from-april-2026 - title: The Carer's Assistance (Miscellaneous and Consequential Amendments, Revocation, Transitional and Saving Provisions) (Scotland) Regulations 2025 reg. 3 href: https://www.legislation.gov.uk/ssi/2025/340/made - title: The Social Security (Up-rating) (Miscellaneous Amendments) (Scotland) Regulations 2026 reg. 12(3)(b) href: https://www.legislation.gov.uk/ssi/2026/170/regulation/12/made + - title: Social Security (Scotland) Act 2018 s. 86A (inflation-adjusted level) + href: https://www.legislation.gov.uk/asp/2018/9/section/86A + - title: Social Security (Scotland) Act 2018 s. 86B (duty to uprate assistance) + href: https://www.legislation.gov.uk/asp/2018/9/section/86B + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI) + href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/4/ + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, table 5 (2026-27 rates) + href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/7/ diff --git a/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml b/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml new file mode 100644 index 0000000000..0a2765052b --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml @@ -0,0 +1,56 @@ +# Social Security (Scotland) Act 2018 s.86B requires Scottish Ministers to +# bring forward legislation raising the Scottish Carer Supplement and the +# Carer Support Payment component to at least their s.86A inflation-adjusted +# levels; their measure is the 12 months to September CPI (Social Security +# Assistance in Scotland: up-rating for inflation in 2026-27, section 3). +# From 2027 the model uprates both with gov.benefit_uprating_cpi, its proxy +# for that measure, which is 184.3803432 in 2026, 188.6206824 in 2027 and +# 192.3927984 in 2028 under the OBR March 2026 EFO. The model does not round +# to the nearest 5p as Ministers do. + +- name: Scottish Carer Supplement is 11.70 a week in 2026 + period: 2026 + absolute_error_margin: 0.01 + input: + age: 35 + care_hours: 40 + country: SCOTLAND + output: + # SSI 2026/170 reg. 12(3)(b): 11.70 x 52. + scottish_carer_supplement: 608.40 + carer_support_payment: 86.45 * 52 + +- name: Scottish Carer Supplement rises with gov.benefit_uprating_cpi in 2027 + period: 2027 + absolute_error_margin: 0.01 + input: + age: 35 + care_hours: 40 + country: SCOTLAND + output: + # 11.70 x 188.6206824 / 184.3803432 x 52 = 622.39, up from 608.40. + scottish_carer_supplement: 11.70 * 188.6206824 / 184.3803432 * 52 + # The Carer Support Payment component rises by the same factor. + carer_support_payment: 86.45 * 188.6206824 / 184.3803432 * 52 + +- name: Scottish Carer Supplement keeps rising in 2028 + period: 2028 + absolute_error_margin: 0.01 + input: + age: 35 + care_hours: 40 + country: SCOTLAND + output: + # 11.70 x 192.3927984 / 184.3803432 x 52 = 634.84. + scottish_carer_supplement: 11.70 * 192.3927984 / 184.3803432 * 52 + +- name: Carer in England gets no Scottish Carer Supplement in 2027 + period: 2027 + absolute_error_margin: 0 + input: + age: 35 + care_hours: 40 + country: ENGLAND + output: + scottish_carer_supplement: 0 + carer_support_payment: 0 diff --git a/policyengine_uk/tests/test_scottish_carer_supplement_uprating.py b/policyengine_uk/tests/test_scottish_carer_supplement_uprating.py new file mode 100644 index 0000000000..802c0a8451 --- /dev/null +++ b/policyengine_uk/tests/test_scottish_carer_supplement_uprating.py @@ -0,0 +1,91 @@ +"""Uprating of the Scottish Carer Supplement. + +Social Security (Scotland) Act 2018 s.86B requires Scottish Ministers to bring +forward legislation raising each figure of assistance given under Chapter 2 of +Part 2, carer's assistance included, to at least its s.86A inflation-adjusted +level. Their measure is the 12 months to September CPI, rounded to the nearest +5p (Social Security Assistance in Scotland: up-rating for inflation in +2026-27, sections 2 and 3). SSI 2026/170 reg 12(3) raised the Carer Support +Payment component from 83.30 to 86.45 and the Scottish Carer Supplement from +11.29 to 11.70: both are the 3.8% September 2025 rate, rounded to 5p. The +supplement had no uprating metadata, so the model froze it at 11.70 a week from +2027 while the Carer Support Payment component kept rising. + +Invariants, for every year from 2027 to 2039, the last year of the uprating +index: + +1. Differential: the supplement and the Carer Support Payment component grow + by the same factor from their April 2026 rates. +2. That factor is gov.benefit_uprating_cpi relative to 2026, so the supplement + never falls while the index does not. +3. Metamorphic: setting CPI growth in the year before to g scales both + components by 1 + g on the year, to within the rounding of the index. + +The YAML tests in tests/policy/baseline/gov/social_security_scotland check +that a Carer Support Payment recipient in Scotland gets 52 weeks of the rate. +""" + +import pytest +from hypothesis import HealthCheck, given, settings +from hypothesis import strategies as st + +from policyengine_uk import CountryTaxBenefitSystem + +BASE_YEAR = 2026 +YEARS = range(BASE_YEAR + 1, 2040) +SUPPLEMENT_2026 = 11.70 +CSP_RATE_2026 = 86.45 + + +@pytest.fixture(scope="module") +def parameters(): + return CountryTaxBenefitSystem().parameters + + +@pytest.mark.parametrize("year", YEARS) +def test_supplement_uprates_with_carer_support_payment(parameters, year): + csp = parameters.gov.social_security_scotland.carer_support_payment + index = parameters.gov.benefit_uprating_cpi + factor = index(str(year)) / index(str(BASE_YEAR)) + + assert csp.supplement(str(BASE_YEAR)) == SUPPLEMENT_2026 + assert csp.rate(str(BASE_YEAR)) == CSP_RATE_2026 + assert csp.supplement(str(year)) / SUPPLEMENT_2026 == pytest.approx( + csp.rate(str(year)) / CSP_RATE_2026, rel=1e-12 + ) + assert csp.supplement(str(year)) == pytest.approx( + SUPPLEMENT_2026 * factor, rel=1e-12 + ) + if index(str(year)) >= index(str(year - 1)): + assert csp.supplement(str(year)) >= csp.supplement(str(year - 1)) + + +@settings( + max_examples=8, + deadline=None, + derandomize=True, + suppress_health_check=[HealthCheck.too_slow], +) +@given( + year=st.integers(min_value=BASE_YEAR + 1, max_value=2035), + growth=st.floats(min_value=0, max_value=0.12), +) +def test_supplement_follows_prior_year_cpi(year, growth): + system = CountryTaxBenefitSystem() + system.reset_parameters() + cpi = system.parameters.gov.economic_assumptions.yoy_growth.obr + shocked = [ + value_at_instant + for value_at_instant in cpi.consumer_price_index.values_list + if value_at_instant.instant_str == f"{year - 1}-01-01" + ] + assert len(shocked) == 1 + shocked[0].value = growth + system.process_parameters() + + csp = system.parameters.gov.social_security_scotland.carer_support_payment + supplement_growth = csp.supplement(str(year)) / csp.supplement(str(year - 1)) + rate_growth = csp.rate(str(year)) / csp.rate(str(year - 1)) + + assert supplement_growth == pytest.approx(1 + growth, abs=1e-4) + assert supplement_growth == pytest.approx(rate_growth, rel=1e-12) From f203e2766c25191452022c3bacfb3dcb0044567b Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 25 Oct 2026 11:25:36 -0400 Subject: [PATCH 2/4] Round Scottish carer's assistance rates to 5p each April Give the Scottish Carer Supplement and the Carer Support Payment component the uprating Scottish Child Payment and PAWHP use since #2575: the previous September's CPI through gov.benefit_uprating_cpi, applied each April to the previous rounded rate and rounded to the nearest 5p, as the 2026-27 s.86A report describes. Drop the changelog fragment's list marker, which towncrier would render as "- - ". Co-Authored-By: Claude Opus 5.5 --- changelog.d/1957.fixed.md | 2 +- .../carer_support_payment/rate.yaml | 15 +++++++++++++-- .../carer_support_payment/supplement.yaml | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/changelog.d/1957.fixed.md b/changelog.d/1957.fixed.md index 00de766f20..2d0f798bec 100644 --- a/changelog.d/1957.fixed.md +++ b/changelog.d/1957.fixed.md @@ -1 +1 @@ -- Uprate the Scottish Carer Supplement from 2027-28 with `gov.benefit_uprating_cpi`, the benefit uprating index the Carer Support Payment component already uses as its proxy for the previous September's CPI, instead of holding it at £11.70 a week. +Uprate the Scottish Carer Supplement each April by the previous September's CPI, rounded to the nearest 5p, instead of holding it at £11.70 a week from 2027-28, and round the Carer Support Payment component's projected rate to the nearest 5p in the same way. diff --git a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml index c3efc0c2be..2eb1ab2ed1 100644 --- a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml +++ b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml @@ -7,7 +7,18 @@ metadata: period: week unit: currency-GBP label: Carer Support Payment rate - uprating: gov.benefit_uprating_cpi + # September CPI and nearest-5p rounding follow Scottish Ministers' current + # policy; s86A leaves the choice of relevant prices to Ministers. + # Apply each year's rise to the previous rounded rate each April. + uprating: + parameter: gov.benefit_uprating_cpi + at_defined_interval: + start: "0001-01-01" + end: "0002-01-01" + enactment: "0002-04-01" + rounding: + type: nearest + interval: 0.05 reference: - title: Carer Support Payment - mygov.scot href: https://www.mygov.scot/carer-support-payment @@ -15,5 +26,5 @@ metadata: href: https://www.legislation.gov.uk/ssi/2026/170/regulation/12/made - title: Social Security (Scotland) Act 2018 s. 86B (duty to uprate assistance) href: https://www.legislation.gov.uk/asp/2018/9/section/86B - - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI) + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI, rounded to the nearest 5p) href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/4/ diff --git a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml index 79e97cf390..27762f1ed1 100644 --- a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml +++ b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml @@ -7,7 +7,18 @@ metadata: period: week unit: currency-GBP label: Scottish Carer Supplement rate - uprating: gov.benefit_uprating_cpi + # September CPI and nearest-5p rounding follow Scottish Ministers' current + # policy; s86A leaves the choice of relevant prices to Ministers. + # Apply each year's rise to the previous rounded rate each April. + uprating: + parameter: gov.benefit_uprating_cpi + at_defined_interval: + start: "0001-01-01" + end: "0002-01-01" + enactment: "0002-04-01" + rounding: + type: nearest + interval: 0.05 reference: - title: The Carer's Assistance (Miscellaneous and Consequential Amendments, Revocation, Transitional and Saving Provisions) (Scotland) Regulations 2025 reg. 3 href: https://www.legislation.gov.uk/ssi/2025/340/made @@ -17,7 +28,7 @@ metadata: href: https://www.legislation.gov.uk/asp/2018/9/section/86A - title: Social Security (Scotland) Act 2018 s. 86B (duty to uprate assistance) href: https://www.legislation.gov.uk/asp/2018/9/section/86B - - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI) + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI, rounded to the nearest 5p) href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/4/ - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, table 5 (2026-27 rates) href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/7/ From a351b15fd37959a1f2242d8b38e13154173f54e1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 25 Oct 2026 11:25:36 -0400 Subject: [PATCH 3/4] Recompute carer uprating tests for September CPI and 5p rounding #2557 re-based gov.benefit_uprating_cpi on the previous September's CPI, so the old hard-coded index values no longer hold. Expectations are now hand-computed from the enacted 2026-27 rates: 11.70 x 1.035 = 12.1095, 12.10 in April 2027, and 12.35 in April 2028 (OBR September 2027 forecast of 2.1%); the Carer Support Payment component goes 86.45 -> 89.50 -> 91.40. The Python tests check the 5p compounding against an independent Decimal reference for 2027-2039 and a derandomized September CPI scenario. Co-Authored-By: Claude Opus 5.5 --- .../scottish_carer_supplement.yaml | 28 ++-- ...test_scottish_carer_supplement_uprating.py | 151 ++++++++++++------ 2 files changed, 113 insertions(+), 66 deletions(-) diff --git a/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml b/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml index 0a2765052b..ffb1748332 100644 --- a/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/social_security_scotland/scottish_carer_supplement.yaml @@ -1,12 +1,12 @@ # Social Security (Scotland) Act 2018 s.86B requires Scottish Ministers to # bring forward legislation raising the Scottish Carer Supplement and the # Carer Support Payment component to at least their s.86A inflation-adjusted -# levels; their measure is the 12 months to September CPI (Social Security -# Assistance in Scotland: up-rating for inflation in 2026-27, section 3). -# From 2027 the model uprates both with gov.benefit_uprating_cpi, its proxy -# for that measure, which is 184.3803432 in 2026, 188.6206824 in 2027 and -# 192.3927984 in 2028 under the OBR March 2026 EFO. The model does not round -# to the nearest 5p as Ministers do. +# levels. Their measure is the 12 months to September CPI, rounded to the +# nearest 5p (Social Security Assistance in Scotland: up-rating for inflation +# in 2026-27, sections 2 and 3). From April 2027 the model raises both each +# April by the previous September's CPI (gov.benefit_uprating_cpi) and rounds +# to the nearest 5p: 3.5% for April 2027 (ONS, 21 October 2026) and the OBR +# March 2026 EFO forecast of 2.1% for April 2028. - name: Scottish Carer Supplement is 11.70 a week in 2026 period: 2026 @@ -20,7 +20,7 @@ scottish_carer_supplement: 608.40 carer_support_payment: 86.45 * 52 -- name: Scottish Carer Supplement rises with gov.benefit_uprating_cpi in 2027 +- name: Scottish Carer Supplement rises by September CPI in 2027 period: 2027 absolute_error_margin: 0.01 input: @@ -28,10 +28,10 @@ care_hours: 40 country: SCOTLAND output: - # 11.70 x 188.6206824 / 184.3803432 x 52 = 622.39, up from 608.40. - scottish_carer_supplement: 11.70 * 188.6206824 / 184.3803432 * 52 - # The Carer Support Payment component rises by the same factor. - carer_support_payment: 86.45 * 188.6206824 / 184.3803432 * 52 + # 11.70 x 1.035 = 12.1095, to the nearest 5p 12.10; x 52 = 629.20. + scottish_carer_supplement: 12.10 * 52 + # 86.45 x 1.035 = 89.47575, to the nearest 5p 89.50. + carer_support_payment: 89.50 * 52 - name: Scottish Carer Supplement keeps rising in 2028 period: 2028 @@ -41,8 +41,10 @@ care_hours: 40 country: SCOTLAND output: - # 11.70 x 192.3927984 / 184.3803432 x 52 = 634.84. - scottish_carer_supplement: 11.70 * 192.3927984 / 184.3803432 * 52 + # 12.10 x 1.021 = 12.3541, to the nearest 5p 12.35; x 52 = 642.20. + scottish_carer_supplement: 12.35 * 52 + # 89.50 x 1.021 = 91.3795, to the nearest 5p 91.40. + carer_support_payment: 91.40 * 52 - name: Carer in England gets no Scottish Carer Supplement in 2027 period: 2027 diff --git a/policyengine_uk/tests/test_scottish_carer_supplement_uprating.py b/policyengine_uk/tests/test_scottish_carer_supplement_uprating.py index 802c0a8451..dcd78f7985 100644 --- a/policyengine_uk/tests/test_scottish_carer_supplement_uprating.py +++ b/policyengine_uk/tests/test_scottish_carer_supplement_uprating.py @@ -1,4 +1,4 @@ -"""Uprating of the Scottish Carer Supplement. +"""Uprating of the Scottish Carer Supplement and Carer Support Payment. Social Security (Scotland) Act 2018 s.86B requires Scottish Ministers to bring forward legislation raising each figure of assistance given under Chapter 2 of @@ -11,53 +11,93 @@ supplement had no uprating metadata, so the model froze it at 11.70 a week from 2027 while the Carer Support Payment component kept rising. -Invariants, for every year from 2027 to 2039, the last year of the uprating -index: +Both rates now rise as Scottish Child Payment and Pension Age Winter Heating +Payment do: each April by the previous September's CPI +(gov.benefit_uprating_cpi), rounded to the nearest 5p. Invariants, for every +year from 2027 to 2039, the last year of the uprating index: -1. Differential: the supplement and the Carer Support Payment component grow - by the same factor from their April 2026 rates. -2. That factor is gov.benefit_uprating_cpi relative to 2026, so the supplement - never falls while the index does not. -3. Metamorphic: setting CPI growth in the year before to g scales both - components by 1 + g on the year, to within the rounding of the index. +1. Each April's rate is the previous rounded rate times one plus the + September CPI rise, rounded to the nearest 5p. The reference here compounds + the published 2026 rates in Decimal, independently of the index. +2. Neither rate falls, since the rise is never negative. +3. Metamorphic: setting the previous September's CPI to a published rate g + moves that April's rates to the previous rates times 1 + g, rounded to 5p, + and leaves the year before alone. The YAML tests in tests/policy/baseline/gov/social_security_scotland check -that a Carer Support Payment recipient in Scotland gets 52 weeks of the rate. +that a Carer Support Payment recipient in Scotland gets 52 weeks of each rate. """ +from decimal import ROUND_HALF_UP, Decimal + import pytest -from hypothesis import HealthCheck, given, settings +from hypothesis import HealthCheck, assume, given, settings from hypothesis import strategies as st -from policyengine_uk import CountryTaxBenefitSystem +from policyengine_uk import Simulation +from policyengine_uk.model_api import Scenario +from policyengine_uk.system import system + +CARER = "gov.social_security_scotland.carer_support_payment" +CPI_SEPTEMBER = "gov.economic_assumptions.statutory_uprating_inputs.cpi_september" +# SSI 2026/170 reg 12(3)(a) and (b). +RATES_2026 = { + f"{CARER}.supplement": Decimal("11.70"), + f"{CARER}.rate": Decimal("86.45"), +} +# Hand calculations: the 2026 rate x 1.035 (September 2026 CPI, ONS release +# of 21 October 2026), to the nearest 5p: 11.70 -> 12.1095; 86.45 -> 89.47575. +APRIL_2027 = {f"{CARER}.supplement": 12.10, f"{CARER}.rate": 89.50} +YEARS = range(2027, 2040) +FIVE_PENCE = Decimal("0.05") + +PERSON = { + "people": {"person": {"age": {2026: 40}}}, + "benunits": {"benunit": {"members": ["person"]}}, + "households": {"household": {"members": ["person"]}}, +} + + +def nearest_5p(amount: Decimal) -> Decimal: + return (amount / FIVE_PENCE).quantize(Decimal(1), ROUND_HALF_UP) * FIVE_PENCE -BASE_YEAR = 2026 -YEARS = range(BASE_YEAR + 1, 2040) -SUPPLEMENT_2026 = 11.70 -CSP_RATE_2026 = 86.45 +def weekly_rate(parameters, name, year): + return parameters.get_child(name)(f"{year}-04-30") -@pytest.fixture(scope="module") -def parameters(): - return CountryTaxBenefitSystem().parameters +@pytest.mark.parametrize("name", RATES_2026) +def test_2026_rates_are_the_enacted_ones(name): + assert weekly_rate(system.parameters, name, 2026) == float(RATES_2026[name]) -@pytest.mark.parametrize("year", YEARS) -def test_supplement_uprates_with_carer_support_payment(parameters, year): - csp = parameters.gov.social_security_scotland.carer_support_payment - index = parameters.gov.benefit_uprating_cpi - factor = index(str(year)) / index(str(BASE_YEAR)) - assert csp.supplement(str(BASE_YEAR)) == SUPPLEMENT_2026 - assert csp.rate(str(BASE_YEAR)) == CSP_RATE_2026 - assert csp.supplement(str(year)) / SUPPLEMENT_2026 == pytest.approx( - csp.rate(str(year)) / CSP_RATE_2026, rel=1e-12 +@pytest.mark.parametrize("name, expected", APRIL_2027.items()) +def test_april_2027_rates_use_september_2026_cpi(name, expected): + assert weekly_rate(system.parameters, name, 2027) == pytest.approx( + expected, abs=1e-9 ) - assert csp.supplement(str(year)) == pytest.approx( - SUPPLEMENT_2026 * factor, rel=1e-12 + + +@pytest.mark.parametrize("name", RATES_2026) +def test_each_april_compounds_the_previous_rounded_rate(name): + parameters = system.parameters + rise = parameters.gov.economic_assumptions.yoy_growth.september_cpi_uprating + previous = RATES_2026[name] + for year in YEARS: + growth = 1 + Decimal(str(rise(f"{year}-01-01"))) + expected = nearest_5p(previous * growth) + actual = weekly_rate(parameters, name, year) + assert actual == pytest.approx(float(expected), abs=1e-9), year + assert actual >= weekly_rate(parameters, name, year - 1), year + previous = expected + + +def parameters_under(changes): + simulation = Simulation( + situation=PERSON, + scenario=Scenario(parameter_changes=changes, applied_before_data_load=True), ) - if index(str(year)) >= index(str(year - 1)): - assert csp.supplement(str(year)) >= csp.supplement(str(year - 1)) + return simulation.tax_benefit_system.parameters @settings( @@ -67,25 +107,30 @@ def test_supplement_uprates_with_carer_support_payment(parameters, year): suppress_health_check=[HealthCheck.too_slow], ) @given( - year=st.integers(min_value=BASE_YEAR + 1, max_value=2035), - growth=st.floats(min_value=0, max_value=0.12), + year=st.integers(min_value=YEARS.start, max_value=2035), + september_permille=st.integers(min_value=0, max_value=120), ) -def test_supplement_follows_prior_year_cpi(year, growth): - system = CountryTaxBenefitSystem() - system.reset_parameters() - cpi = system.parameters.gov.economic_assumptions.yoy_growth.obr - shocked = [ - value_at_instant - for value_at_instant in cpi.consumer_price_index.values_list - if value_at_instant.instant_str == f"{year - 1}-01-01" - ] - assert len(shocked) == 1 - shocked[0].value = growth - system.process_parameters() - - csp = system.parameters.gov.social_security_scotland.carer_support_payment - supplement_growth = csp.supplement(str(year)) / csp.supplement(str(year - 1)) - rate_growth = csp.rate(str(year)) / csp.rate(str(year - 1)) - - assert supplement_growth == pytest.approx(1 + growth, abs=1e-4) - assert supplement_growth == pytest.approx(rate_growth, rel=1e-12) +def test_rates_follow_the_previous_september_cpi(year, september_permille): + september = Decimal(september_permille) / 1000 + expected = {} + for name in RATES_2026: + before = Decimal(f"{weekly_rate(system.parameters, name, year - 1):.2f}") + unrounded = before * (1 + september) + # The index is stored to 5 decimal places, so skip rises that land + # within a tenth of a step of a 5p half-way point. + steps = unrounded / FIVE_PENCE + remainder = abs(steps - steps.to_integral_value()) + assume(Decimal("0.5") - remainder > Decimal("0.1")) + expected[name] = (before, nearest_5p(unrounded)) + + parameters = parameters_under( + {CPI_SEPTEMBER: {f"year:{year - 1}-09-01:1": float(september)}} + ) + + for name, (before, after) in expected.items(): + assert weekly_rate(parameters, name, year - 1) == pytest.approx( + float(before), abs=1e-9 + ) + assert weekly_rate(parameters, name, year) == pytest.approx( + float(after), abs=1e-9 + ) From 09289e485517ef08a0e2f1a80568c7715e11e5bf Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 25 Oct 2026 11:27:34 -0400 Subject: [PATCH 4/4] Cite section 2.1 of the uprating report for 5p rounding The nearest-five-pence rule is in section 2.1 of the 2026-27 s.86A report; section 3.1 states only the September CPI measure. Co-Authored-By: Claude Opus 5.5 --- .../social_security_scotland/carer_support_payment/rate.yaml | 4 +++- .../carer_support_payment/supplement.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml index 2eb1ab2ed1..4cab258689 100644 --- a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml +++ b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/rate.yaml @@ -26,5 +26,7 @@ metadata: href: https://www.legislation.gov.uk/ssi/2026/170/regulation/12/made - title: Social Security (Scotland) Act 2018 s. 86B (duty to uprate assistance) href: https://www.legislation.gov.uk/asp/2018/9/section/86B - - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI, rounded to the nearest 5p) + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 2.1 (12 months to September CPI, rounded to the nearest five pence) + href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/3/ + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI) href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/4/ diff --git a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml index 27762f1ed1..533389b053 100644 --- a/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml +++ b/policyengine_uk/parameters/gov/social_security_scotland/carer_support_payment/supplement.yaml @@ -28,7 +28,9 @@ metadata: href: https://www.legislation.gov.uk/asp/2018/9/section/86A - title: Social Security (Scotland) Act 2018 s. 86B (duty to uprate assistance) href: https://www.legislation.gov.uk/asp/2018/9/section/86B - - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI, rounded to the nearest 5p) + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 2.1 (12 months to September CPI, rounded to the nearest five pence) + href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/3/ + - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, section 3 (12 months to September CPI) href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/4/ - title: Social Security Assistance in Scotland - up-rating for inflation in 2026-27, table 5 (2026-27 rates) href: https://www.gov.scot/publications/social-security-assistance-scotland-up-rating-inflation-2026-27/pages/7/