Repository navigation
Conversation
UC Regs 2013 reg. 49(1) and its legacy equivalents (HB Regs 2006 reg. 47, HB (SPC) Regs 2006 reg. 45, IS Regs 1987 reg. 49, JSA Regs 1996 reg. 111, ESA Regs 2008 reg. 113, SPC Regs 2002 reg. 19) calculate capital at market or surrender value less 10% where a sale would incur expenses and less any encumbrance secured on it. The model summed every capital source at full value. Each programme gets a capital.sale_expenses node (rate 0.1 and the sources whose sale incurs expenses: land, property and corporate_wealth, not cash savings). A shared helper applies the 10% before the encumbrance and never values an encumbered asset below nil. New household inputs carry debt secured on other residential property, non-residential property and land; the Enhanced FRS has none, so they default to zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Each programme's sale-expense parameters now cite its GB and NI regulations, the guidance paragraph that orders the 10% before the encumbrance, and per-asset guidance with exact PDF page anchors (DMG ch 52 for ESA, HBGM Annex F for HB savings, H1656/H1665/H1673-H1675 for UC). - The source-list descriptions and changelog say plainly that corporate_wealth also holds unit trusts, ISAs, employee share options and, in datasets built before the pension split, non-DB pension wealth. - The helper and secured-debt docs say debts net within a source category. - The property-test oracle fixes the sale-expense assets and the 10% itself instead of reading the parameters, checks pension-age HB, and runs on larger populations. New hand-computed cases cover HB second homes and premises, per-source flooring between two encumbered sources, pension-age HB, and a monthly secured debt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HBGM W1.430 states only the general 10% rule; the rule that real property always has costs of sale comes from R(IS) 21/93, as DMG 29622 applies it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the capital variables onto main's claimant/partner allocation and person-level sources, valuing household sources through valued_capital. Update the let-property tests #1950 added: £10,000 of property is now £9,000 of capital under reg. 49(1), so 12 tariff steps, not 16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two tests main added after this branch's earlier base assumed full-value capital: - The CTR savings-credit-only case holds savings 10,000 and a 7,000 second property: capital is 10,000 + 90% of 7,000 = 16,300 (SPC Regs 2002 reg. 19(a)), still over the 16,000 limit, so CTR stays nil. Deemed income is 13 steps x 52 = 676, Pension Credit income 13,314 + 676 = 13,990, and savings credit 60% of (12,376 - 208.07 x 52) less 40% of (13,990 - 12,376) = 288.22. - The reported-capital property test's proxy oracle now values land, property and shares at 90% and savings at face value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le-expense-share-split
…eduction corporate_wealth is now itemised in the capital sources lists (#1974), so the sale-expense lists name directly_held_shares, which DWP values less 10% for costs of sale (ADM H1665; DMG 29671/52671/84763; HBGM W1.513), and unitemised_corporate_wealth, which keeps the previous flat treatment on datasets that do not itemise. Unit trusts have no costs of sale even when sold through a broker (ADM H1673-H1674; DMG 29680-29681, 52680-52681, 84771-84772; HBGM W1.530-W1.531), and an ISA is valued at what the holder would get by withdrawing it, with no paragraph applying the 10% (ADM H1656-H1658; DMG 29662-29664, 52662, 84748-84750). The survey bucket of unit and investment trusts is treated as having no costs of sale; investment trusts were 8.2% and 6.9% of the pooled funds in stocks and shares ISAs at 5 April 2022 and 2025 (HMRC ISA Table 9.6). The property tests keep their own legal asset set and assert each programme's list against it, and gain the split invariants: the residual, backward compatibility with every component nil, conservation at a zero rate, split effect = rate x (trusts + ISA), and no double counting. #1974's itemising-invariance test no longer holds by design and is replaced by them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep main's recorded benefit-unit capital (benunit_reported_capital), which replaces the valued household sources as recorded, and register the secured-debt inputs beside main's uprating entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
£20,000 of shares is £18,000 of Pension Credit capital (SPC Regs 2002 reg. 19(a)), still over the CTR limit: deemed income 16 x 52 = 832, Pension Credit income 14,146, savings credit 933.816 - 0.4 x 1,770 = 225.82. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's Housing Benefit passport (#1927 and the Universal Credit limb) gives a family on a passporting benefit nil HB capital, so the property's independent reg 47 valuation applies only to non-passported families. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ale-expense-share-split # Conflicts: # docs/book/assumptions/growthfactors.md # policyengine_uk/data/uprating_indices.yaml # policyengine_uk/tests/test_capital_valuation_properties.py
…le-expense-share-split # Conflicts: # docs/book/assumptions/growthfactors.md # policyengine_uk/data/uprating_indices.yaml # policyengine_uk/tests/test_capital_share_components.py
#1974 replaced the components-plus-residual design with one share_like_capital block that keeps the supplied corporate_wealth exactly. This follow-up now splits that block in two: - share_like_capital_with_sale_expenses: share_like_capital less the itemised holdings in gov.dwp.share_like_capital.without_sale_expenses (unit and investment trusts, stocks and shares ISAs), floored at nil; all of it when nothing is itemised. - share_like_capital_without_sale_expenses: the rest, exactly nil when nothing is itemised. The six capital lists name both parts and the six sale-expense lists the first, so datasets that carry only corporate_wealth keep #1969's flat 10% exactly (differential test, annual and monthly, against the lists before itemising, including negative aggregates and a value whose 90% is a fraction of a penny over the limit). The exempt holdings are a parameter list, so the methodology call on investment trusts and ISAs (d1396) is a one-line change. Merged the refreshed #1969 (54ed063) and #1974 (7784193). #1969's property oracle reads the share-like sources from an unitemised household's corporate_wealth; the split invariants (definition of both parts, the unitemised differential, split effect = 10% of trusts plus ISAs on UC capital, components-only valuation) are in test_capital_share_components. Dropping the nothing-itemised branch from the formula fails the differential. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of 54ed063: half the generated units now decline Universal Credit, so the Housing Benefit passport cannot remove every working-age unit from the reg 47 differential, and a passported unit's HB capital is asserted to be nil rather than skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uping Review of b7e6bc5: - gov.dwp.share_like_capital.without_sale_expenses started in 2013, after the legacy capital lists (JSA from 1996-10-07), so a 2012 simulation with unitemised corporate_wealth raised ParameterNotFoundError; it now starts at 1996-10-07, and Income Support and JSA capital in 2012 are tested (both fail with the 2013 start). - An empty exempt list made add() return None; the exempt holdings are now summed from a numeric zero, and an empty-list reform (every share-like holding less 10%) is tested. - The property oracle now follows the engine's float32 grouping (components left to right, exempt holdings summed before subtraction) and compares exactly; the reviewer's example (trusts £200,000, ISA £199,999.984375) is pinned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ale-expense-share-split
…le-expense-share-split # Conflicts: # policyengine_uk/tests/test_capital_share_components.py
Delta review of b541677 (F1): coverage of the HB passport-nil assertion and the working-age reg 47 differential depended on Hypothesis draws. The checks move into check_valuation(), which counts the branches it ran, and a fixed test asserts both run: a UC claimant with £5,000 of savings (passported, nil HB capital) and a non-claimant with a mortgaged second home (valued under reg 47). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ale-expense-share-split
…le-expense-share-split # Conflicts: # policyengine_uk/tests/test_capital_share_components.py
Savings 12,000 plus a 5,000 property is 12,000 + 4,500 = 16,500 of Pension Credit capital (SPC Regs 2002 reg. 19(a)), still over the 16,000 CTR limit. Deemed income is 13 a week, so the savings credit is 0.6 x 29.93 - 0.4 x 15 = 11.958 a week (621.82). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main now values Universal Credit property on its own path (#2439: property_sources, secured debt, a 10% property_sale_cost_rate) and carries regulation 77 company substitution (#1965). Reconcile: - One UC rate: property_sale_cost_rate becomes capital.sale_expenses.rate, used by the property path and the financial pool; UC sale_expenses.sources lists the financial source with costs of sale, corporate_wealth. - The financial pool is valued with valued_capital, so shares count at 90%. - As the second of #1965 and #1969 to land, value reg. 77 holdings where they leave capital: at 90% from the pool (household_uc_pool_company_holdings), in the override floor (household_uc_reported_financial_capital) and from a complete override, which is a countable figure; in full from a recorded financial total, which is used unvalued. A shared counted_share helper. - Keep main's secured-debt inputs, documenting the legacy equivalents, and add owned_land_secured_debt in the same shape. - Tests main added that assumed full-value shares, rewritten from the law: the reg. 77 company cases, the property-capital and mock suites, the company-override conservation identities and the savings-credit-only cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… penny From the GPT-6.1 Sol review of a7d8988: - A recorded benunit_reported_capital total holds its owner's reg. 77 holding at full value, while the pool counts that holding at 90%. The report now consumes its known holding part at the counted 90% (household_uc_reported_financial_capital), so it can no longer eat another unit's savings; the owner's own assessment still takes the full holding off the report. The company-override conservation oracle consumes the same way, and a YAML regression pins the reviewer's case: £16,500 of savings and a £10,000 report that is all holding give [0, 16,500]. - valued_capital rounds the 90% value down to the penny in the claimant's favour (ADM H1665), in float64 with a guard against binary noise. A YAML regression puts £1,000 of savings and £16,666.67 of shares at exactly £16,000.00, which passes the limit (WRA 2012 s. 5(1)(a), UC reg. 18(1)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inputs are float32, so 90% of £16,001 came to £14,400.8994 and the penny floor gave £14,400.89 (the HB £16,001 case failed). less_sale_expenses takes the value to the penny in float64 before the 10% deduction and rounds down to the penny (ADM H1665). The UC property path now uses it too, so every reg. 49(1)(a) valuation rounds the same way. Adds a Hypothesis property checking 90% of every whole-penny float32 input up to £131,071.99 against integer pence, and a UC YAML case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sol review v4b found that rounding the input to the penny first could round up (the ADM H1665 example gave 930.94, not 930.93), that nothing was rounded at the last stage, and that UC rounds to the nearest penny. - capital.round_down per programme: false for UC (UC Regs 2013 reg 6(1); NI reg 7(1)) and HB (HB Regs 2006 reg 80; HB (SPC) reg 61(6); NI 78(8), 59(7)); true for IS (reg 27), JSA (reg 92), ESA (reg 3(a)) and Pension Credit (reg 24A), which count a fraction only to the claimant's advantage. - exact_amount removes float32 storage error only where a value is the stored form of a whole penny; other values are kept exactly. - Each valuation, each UC holding and property share, and each programme's assessed capital (the last stage) is rounded by that rule. - A recorded financial total below its owner's holding now consumes the holding at its counted value, as an override does, so no part of the holding is left for another unit. Tests: the H1665 example (930.93 / 930.94), whole-penny properties for both rules, a never-wrong-way bound for any float32 input, UC half-penny, 16,000.00 after a holding, a three-way split, IS shared-capital rounding, and reports below the holding in the reg 77 conservation grid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ale-expense-share-split # Conflicts: # policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sale_expenses/sources.yaml # policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sources.yaml
Reg 77 holdings are shares with sale expenses, so HOLDINGS_SOURCE is share_like_capital_with_sale_expenses: the holdings budget and the 90% counted share both read it, where #1969 read corporate_wealth. The test file keeps the round-3 fixes (projected years, the 16,000 overshoot, the power-of-two precondition, the grouping example, the exempt list's start). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sol review v5 at b3f6f60: - exact_amount raised an underflow warning on zero inputs, failing test_warning_filters. Errors are now ignored inside np.errstate, and twice the gap is compared with the spacing. - IS, JSA and ESA read household values through benunit.max, which is float64, so exact_amount used float64 spacing and never removed float32 storage error: 16,000.01 of savings floored to 16,000.00, at the limit. A value equal to its float32 is now judged at float32 spacing. - From 131,072 float32 cannot hold every penny, so no penny is identified and the stored value is kept; rounding down then never goes against the claimant. - The Lifetime ISA's 75% and UC company capital are worked in float64 from the stored amounts; company capital is rounded under reg. 6(1). - test_uc_capital_allocation expected exact conservation; each share is now its own nearest-penny amount (1.00 three ways is 0.33 each). - Docstrings: the guard's intended tolerance; no report leaves a holding in the pool. Tests: a model-level property that every programme counts whole-penny savings, shares and Lifetime ISA balances to the penny; widened-input and above-131,072 helper checks; YAML for 16,000.01 of savings under IS, JSA and ESA and a 1,000.04 Lifetime ISA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rate's references now list each scheme's rule for capital outside the United Kingdom after its UK valuation rule, as the legacy rates do. The sale-expense list's description now says that each rule's closing words follow both limbs, and that under SSI 2021/249 councils take regulation 70(1)'s deductions off the value regulation 70(2) gives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Your follow-up at |
MaxGhenis
marked this pull request as ready for review
November 5, 2026 11:22
MaxGhenis
added a commit
that referenced
this pull request
Nov 6, 2026
MaxGhenis
added a commit
that referenced
this pull request
Nov 6, 2026
Open
17 tasks
Resolve three conflicts and keep main's person-level ISA allocation: - shard_durations.toml: main's regenerated table, with this PR's three renamed share-component tests (same durations). - growthfactors.md: main's text, which already lists the three secured-debt inputs this PR documents and moves main_residence_value and other_residential_property_value to house prices. - uc_assessable_capital.py: this PR's sale_expenses.sources wording with main's prose, and the stocks and shares ISA at its withdrawal value. Main (#2712, through #1969) moves each stocks and shares ISA balance out of share_like_capital into its holder's unit. This PR replaces share_like_capital in every capital list with its two parts, so counted_person_sources would have dropped the ISA person source. The ISA now maps to share_like_capital_without_sale_expenses, which holds it because gov.dwp.share_like_capital.without_sale_expenses lists stocks_and_shares_isa; no programme's sale-expense list names that part, so each means test counts the balance at face value. The parameter and variable descriptions name the new household source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch values stocks and shares ISAs without the deduction for expenses of sale (ADM H1656-H1658), and the ISA person source now comes out of share_like_capital_without_sale_expenses. Main's person ISA cases expected 90%, so each counted ISA rises by a tenth. Cases 13 to 15 test a boundary, so their inputs move to keep it: a 30,600 ISA in Case 13, and household totals of 16,000 and 6,000 in Cases 14 and 15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's tests valued all of share_like_capital, and each stocks and shares ISA, at 90%. On this branch only share_like_capital_with_sale_expenses takes the deduction, and the ISA person source comes out of share_like_capital_without_sale_expenses at face value. The helpers now value each part by whether the programme's sale_expenses.sources lists it, and the hand-worked cases follow: the producer-shape households give UC capital of 10,900, 8,950, 14,000 and 11,000, and the list-reform test drops share_like_capital_without_sale_expenses, the source that holds the ISA. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test checked each total to within £0.011, and CI at df8c1ea failed it. The engine holds totals in float32. Its float32 sum can round a penny under the exact total, which the test's docstring allows, and it then stores that figure to float32's step, which the £0.011 bound didn't allow for above about £16,000. CI drew a household the test expects at £16,834.13: the engine gives £16,834.12, held as 16,834.119, which is £0.0109 under, and the test's own float32 subtraction read £0.0117. The check now subtracts in float64 and allows a penny plus one float32 step at the expected value. Two households are pinned: CI's, and one expected at £37,747.34 that the engine holds as 37,747.328, which is £0.0119 under and fails the old bound in float64 too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
vahid-ahmadi
left a comment
Collaborator
There was a problem hiding this comment.
Following up on my review at 6c5cbc83b, now at 7849e11.
María's blockers are fixed, so the CHANGES_REQUESTED decision is stale. This confirms Max's 5 Nov note.
- C1.
uc_overseas_property_capitalanduc_other_property_capitalare now listed inuniversal_credit/means_test/capital/property_sources.yaml, outside the financial pool, so a financial-only report no longer wipes them. - C2. All 23 checks pass at this head.
- @juaristi22, could you re-review or dismiss so the decision reflects that?
My must #1 is still open, but it is now a data dependency, not a code defect.
pension_credit_reported_capital.py:22-26documents that a financial-only total stored in that column is treated as a complete override, so Pension Credit counts no land or property.- uk-data still writes FRS
TOTCAPB4there (frs.py:1872). - The move to
benunit_reported_capitalis in uk-data#552, which is still an open draft. - Until that release lands, PC on the certified file behaves as on
main. It is not a regression, but the property gap stays.
Merge order.
- This branch contains #1969 at
59a1c4ad2, so #1969 must merge first. - It also carries the itemised-ISA 10% that my #1969 review flagged.
person_isa_capital.yaml:79expects [6,000, 8,400] here, against [6,000, 9,000] onmain. - So the order is #1969 together with #2131, then this PR.
My other points (land figure in the body and changelog, increment over #1969, PC categories in the changelog) are addressed.
Review drafted with AI assistance and checked against the code at 7849e11.
The without_sale_expenses description and the changelog fragment now say the model counts a stocks and shares ISA at its full withdrawal value because H1656 says nothing about costs of sale, not that a paragraph exempts it. The description also notes that employee share options, which the survey asks about with employee shares, take the deduction as an approximation. A comment on COMPONENTS says every name on the exempt list must be one of them, since the formula reads only COMPONENTS to decide whether a household itemises. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
valued_capital reads only each programme's capital.sources, so a name on capital.sale_expenses.sources outside them is never valued. The property now asserts the sale list is a subset of the counted sources for all six programmes, which the intersection check alone could not see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…omments #1969's changelog fragment said the 10% reached all of share_like_capital, unit trusts included, "until the data separate them". It now names what takes the deduction after the split: land, property, directly held shares and any corporate_wealth a dataset does not itemise. The ISA docs named share_like_capital as the source the stocks and shares ISA balances leave. They now name share_like_capital_without_sale_expenses, and say every means test counts that part at withdrawal value. The test comments and the parameter description say the model reads ADM H1656's silence on costs of sale as no deduction, rather than saying H1656 rules one out. The COMPONENTS comment notes that share_like_capital sums the same names, and invariant 7 allows float32's step as well as a penny. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Thanks for the review at
|
#1969 now values unit trusts and stocks and shares ISAs at full value in every means test, through share_like_capital_without_sale_expenses, and takes the 10% only from share_like_capital_with_sale_expenses. This branch held #1969 at 59a1c4a, before that split. Each of the six sale-expense lists keeps #2688's overseas and other real estate and names the part with sale expenses, and Pension Credit's capital sources name both parts. test_isa_balances.py and test_stored_household_totals.py take #1969's full-value ISA expectations, which reverses e041345. test_property_wealth_components.py now checks the two parts, and the property-wealth docs say which part takes the 10%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pany deductions consistent under reforms Answers review fold-r1 at 8f755b9. - P1: household_sources(law) replaces the HOUSEHOLD_SOURCE_OF constant. It maps a stocks and shares ISA balance to the share-like part that holds the household's ISAs under the period's gov.dwp.share_like_capital.without_sale_expenses. counted_person_sources, pooled_person_capital (now given parameters by all six formulas) and valued_person_capital read it, so a reform that takes stocks_and_shares_isa off the exempt list nets the balance out of the part with sale expenses and values it less 10%. stocks_and_shares_isa_countable_capital bounds balances by that part where it falls short of min(stocks_and_shares_isa, share_like_capital) by more than share_like_capital's float32 spacing; rounding alone leaves it short by at most half that, so nonnegative holdings keep today's bound. - P2: the part with sale expenses is held between nil and share_like_capital where the itemised sum is positive, so signed holdings can't push the parts apart. The property test draws signed components, includes the 1e9 / -1e9 / 1 case, and asserts the parts sum to the total within half its float32 spacing. - P3: household_uc_company_holding_pool_scale is nil when UC's sources don't list share_like_capital_with_sale_expenses, so no holding leaves the pool; the owner's own assessment still takes it off a report. - P4: the CTR docstring says the household route doesn't yet count share_like_capital, and older datasets may mix it with pension wealth. - P5/P6: the share-split fragment, the exempt parameter, the ISA docs page and two test docstrings name the six DWP capital assessments instead of every means test; the ISA docs page and the touched docstrings describe the routing and bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rings Comments and documentation strings only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #1969's answers to its fold-r1 review: person ISAs routed by the exempt list, share parts that sum under signed inputs, no company-holding deduction from trusts after a source-list reform, the CTR docstring, and "the six DWP capital assessments" in place of "every means test". No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al programmes The CTR sources description said corporate_wealth was left out because the data mixed it with pension wealth that could not be separated. The schemes count shares and other investments; this route does not count them yet, even where a dataset supplies them separately, and older datasets can mix them with pension wealth. The engineering note now lists CTR's capital directory and its assessable-capital route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e the means-test wording Review fold-r2 P1: the rounding exception bounded a balance by the part that holds the ISAs only where the part fell short by more than share_like_capital's float32 spacing, so exact signed cancellation could leave a pound the part does not hold (2**23 shares, -1 trusts, a 1 ISA). The bound is now the smallest of stocks_and_shares_isa, share_like_capital and the holdings behind the part: the listed holdings' float32 sum, clamped as the part with sale expenses clamps it (nil where the itemised sum is not positive), or, under a reform that moves the ISAs, the part with sale expenses itself, which rounds once from that complement. Adds the witness, its mirror and an unitemised case as regressions, and an exact sweep over signed holdings near powers of two with the ISA exemption on and off and UC counting each part or both. P3: scope the each-means-test claims in the ISA variable, the docs page and the person-ISA test to the six DWP capital assessments, with Council Tax Reduction using them only through its UC and Pension Credit routes, and state the share parts' ranges for signed itemised sums. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sweep counts the parts under Universal Credit only, so the module docstring now says so rather than claiming every programme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and round the reform-route complement once On the baseline route the bound read only the listed holdings, so a direct input or a reformed formula of either share part could leave the part that holds the ISAs short while the balances kept their value, sending the pool below nil (a lodger's UC capital fell from £5,000 to £2,500). Where the stored part falls short of the holdings behind it by more than share_like_capital's float32 spacing, which the parts' own formulas never do for a list of two holdings, the stored part now bounds the balances, on either route. Under a reform that takes the ISAs off the exempt list, the holdings behind the part with sale expenses are now share_like_capital less the listed holdings computed in float64, so they round once. The stored part rounds the listed float32 sum and then the subtraction, so for a list of two holdings it could fall a pound short of a balance the holdings cover. One-name lists, the default reform included, give the same holdings as before. Rename the £100.01 test, whose name described the old slack rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ls short Review r3 (P2). The fallback in stocks_and_shares_isa_countable_capital switched to the stored part only where it fell more than share_like_capital's float32 spacing short of the holdings behind it, so it could not tell the parts' own rounding from a direct input or a replaced or neutralised formula within that spacing. With share_like_capital of 2**23, a £1 ISA balance and the part that holds the ISAs entered as nil, the holder kept £1 the part did not hold: UC for a holder and a lodger sharing £10,000 of savings came to [£5,000.50, £4,999.50], or [£5,000.45, £4,999.55] with the ISAs off the exempt list, instead of [£5,000, £5,000]. The rounding allowance now applies only where both stored parts equal the split the parts' own formulas give. formula_split recomputes share_like_capital_with_sale_expenses with its own formula from the same share_like_capital, itemised holdings and exempt list, casts it to float32 as the engine stores a formula result, and takes the other part as share_like_capital less it, as that part's formula does. The same float32 operations on the same values give the same result, so the formulas' own split always matches and keeps its rounding allowance exactly as before. Where either stored part differs, the stored part bounds the balances wherever it falls short of the holdings. Values equal to the formulas' split, however supplied, give the formulas' results. The variable's documentation and the ISA assumptions page say so. Adds the reviewer's two witnesses (both routes) and structural variants, replacing either part's formula or neutralising the part, as regressions that fail at 45c48dc, and a test that a replacement giving the formulas' values changes nothing while an input of the other part still bounds the balances by the part that holds the ISAs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r3 (P3). Invariant 10 and the docstring of test_a_stored_part_short_of_its_holdings_bounds_the_balances said a directly supplied part falling short of its holdings forces the balances below it, while the code at 45c48dc switched to the part only beyond share_like_capital's float32 spacing. With the previous commit the claim holds for any shortfall once either stored part differs from the formulas' split. Invariant 10 now says the balances exceed the stored part only where both parts are the formulas' split, and then by no more than that spacing; that an input or a replaced or neutralised formula making either part differ bounds them by the stored part however little it falls short; and that values equal to the formulas' change no result. The test docstring notes its shortfalls all exceed the spacing and points to the test of those within it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l or less, holdings for NaN Invariant 10, the variable's documentation and formula comment, and the ISA assumptions page said the balances hold no more than the stored part that holds the ISAs, and that the pool never counts less than nil of it. That overstates the guarantee. bounded_holdings floors the bound at nil, so a stored part below nil cannot bound the balances below nil. With the part entered as -1, or given as -20 by the formulas' own split (the verifier's cases), the balances hold nil and the pool counts the negative part as it stands. A missing (NaN) stored part is never the formulas' split and never less than the holdings, so the holdings stay the bound. Each passage now says what the code does: the balances hold no more than the stored part, or nil where it is nil or less, plus at most share_like_capital's float32 spacing where both parts are the formulas' split, and a NaN part leaves the bound at the holdings. The claim that the pool never counts less than nil now covers only overridden parts of nil or more; the stored-part test's docstring says its parts are all nil or more. Text only: no formula, assertion or expected value changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r4 found that invariant 10, the variable documentation and comment, and the ISA assumptions page state the stored-part bound without exception. Where stocks_and_shares_isa or share_like_capital is missing (NaN), household_total and so the overall bound are NaN, the comparisons are false, and bounded_holdings leaves finite balances of nil or more unchanged, so a balance can exceed the stored part. Each passage now limits the guarantees to the case where none of the bound's three amounts is missing, and says what happens otherwise. The text also said a missing stored part "leaves the bound at the holdings". That is true of the holdings term only: the bound is still the smallest of stocks_and_shares_isa, share_like_capital and the holdings. It now says the missing part never replaces the holdings as a bound, and the code comment says "overall bound" where it means the final one. Text only: no executable line, assertion or expected value changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1969's later rounds bound person ISA balances by the holdings behind their stored part, round the reform-route complement once, and qualify the bound text for missing aggregates. The merge is clean on top of 6e4c632, which keeps review r1's two text fixes (CTR's capital route and the capital table). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #2577
Reproducer: policyengine_uk/tests/test_property_wealth_components.py::test_financial_reports_preserve_separately_valued_property; policyengine_uk/tests/test_property_wealth_components.py::test_household_land_value_is_at_least_direct_uk_land; policyengine_uk/tests/test_property_wealth_components.py::test_new_inputs_at_zero_reproduce_main; policyengine_uk/tests/test_uc_company_owner_properties.py::test_household_capital_is_allocated_and_conserved_across_benefit_units
axiom: TheAxiomFoundation/rulespec-uk#395 queued
We stacked this PR on #1969: it merges #1969's head
0f35157f9, which carries all of #2131, keeps #1969's history, and #1969 must merge first. Where both branches changed the same file, this branch takes #1969's version and applies only its own changes. It keeps #1969'stest_isa_balances.pyandtest_stored_household_totals.pyunchanged. Sogit diff 0f35157f9..HEADholds only this PR's own change, in 56 files. Companion data #543 follows data #501; the model and the component data release must land together with a compatible dependency pin.What the code does
Inputs. The PR adds the WAS household stock inputs
overseas_property_valueandother_property_value. Both carry GDP-per-capita uprating, as a class attribute for situations and inpolicyengine_uk/data/uprating_indices.yamlundergov.economic_assumptions.yoy_growth.obr.per_capita.gdpfor datasets.Wealth.
property_wealthaddsresidential_property_value,non_residential_property_value,owned_land,overseas_property_valueandother_property_value.total_wealthaddsproperty_wealthonce, beside corporate, pension and savings wealth. A savedproperty_wealthcolumn still overrides the formula; the data release must stop storing it.Household land.
household_land_valueapplies the regional land intensity toresidential_property_value + non_residential_property_value + other_property_value, summed directly, then addsowned_landat full value. Direct UK land therefore counts once, identified overseas property contributes no UK land, and unclassified other real estate keeps the regional approximation. The formula no longer reads the savedproperty_wealthtotal, so on a dataset whose producer imputed the components and the saved total separately, household land moves by the regional intensity times their difference. For a London household in 2026 withmain_residence_valueof £200,000 and a savedproperty_wealthof £300,000, household land falls from £255,000 onmainto £170,000 here: London's 0.85 intensity times the £100,000 gap.On the certified file at data-year values, household land rises from about £5,113bn to £5,521bn (+£408bn, +8.0%), with 12,353 households changing (measurement at
798491cb7).git diff 798491cb7 329f05cdashows no change tohousehold_land_value, the inputs it reads, the land intensity parameters or the certified file pin (policyengine-uk-data 1.58.1). The check against the MHCLG land target stays open.Means tests. Every means test that counts household property reaches both new inputs:
uc_overseas_property_capitalanduc_other_property_capitalincapital/property_sources.yamlless_sale_expenses)benunit_reported_capitalreplaces the financial pool only; the property pool stays countedcapital/sources.yamlandcapital/property_sources.yamlcapital/sale_expenses/sources.yamlpension_credit_assessable_capitaladds the report to separately valued land and property, including existing domestic categoriesmeans_test/capital/sources.yamlsale_expenses/sources.yamlcapital/sources.yamlsale_expenses/sources.yamlcapital/sources.yamlon the household route; Pension Credit's capital on a savings-credit-only award; Universal Credit's capital for a working-age applicant with an award, outside Scotland's scheme from April 2022capital/sale_expenses/sources.yamlA complete
uc_reported_capitaloverride still replaces ordinary UC capital before the regulation 77 company substitution. A nonnegativepension_credit_reported_capitalstill replaces the whole Pension Credit assessment; its formula returns -1, which means no complete override. If a dataset stores a financial-only survey total inpension_credit_reported_capitalrather than inbenunit_reported_capital, thepension_credit_assessable_capitalformula treats that total as a complete override and counts none of the household's land or property for Pension Credit. The certified file's producer stores FRSTOTCAPB4in that column, and 37,916 of the file's 61,214 benefit units carry a nonnegative value (measurement). For those units the formula counts no land or property, in the data year or any year the model projects the file to, until the producer moves the total tobenunit_reported_capital(pension_credit_reported_capitaldocumentation;docs/engineering/property-wealth-components.md). The uprating index forpension_credit_reported_capitaluprates programme observations that a dataset stores directly in that column. The model infers no new secured-debt inputs for the two new categories.Universal Credit's
uc_property_capitalreads each variable in itsproperty_sourceslist directly. Thepension_credit_assessable_capitalformula passes Pension Credit's list tovalued_capital(..., sources=...), which skips any name missing fromcapital.sources. A test checks each name in that list againstcapital.sourceson every date either list changes, and each name in UC's list against the model's variables.Council tax reduction. Since
main's #1995, thecouncil_tax_reduction_assessable_capitalformula takes a household route for an applicant outside the guarantee credit, savings-credit-only, Universal Credit and passported routes. That route sums the sources ingov.local_authorities.council_tax_reduction.capital.sources, takes 10% off those in itssale_expenses.sources, and deducts the debt secured on other residential property, non-residential property and, through #1969, land. This branch addsoverseas_property_valueandother_property_valueto both lists. Under each rule cited below, the council values capital outside the United Kingdom at its market value there or, where that country prohibits transferring that value, at what it would realise if sold in the United Kingdom to a willing buyer, and takes 10%, where there would be expenses attributable to sale, and any encumbrance secured on it off the value under either limb. In England, the default scheme's rule (SI 2012/2886 Sch para 66) applies to a working-age applicant only where the council has not made its own scheme; the model applies it to every English working-age applicant on the household route. The data hold no secured debt for either input, so the route'sSECURED_DEBTstays as it was, and the route counts each input at 90% of its value.council_tax_reduction_capital_valuation.yamlpins that at £90,000 for £100,000 of overseas property and £45,000 for £50,000 of other real estate, for a working-age applicant without Universal Credit and a pensioner without Pension Credit in England, Wales and Scotland. A seventh case gives a working-age applicant in England with a Universal Credit award £10,000 of overseas property, £5,000 of other real estate and £1,000 of land:council_tax_reduction_assessable_capitalequalsuc_assessable_capital, £13,500, where the household route would add the land at £900, which Universal Credit leaves out.Main. This branch gets
mainat83c2554b2through #1969'sa418a0040, which mergesmainat83c2554b2into #1969's branch. Before65fc4a6e9, it gotmainat95dfc62f8through #1969's3dbdb0027, whose history mergesmainataf9361114(154f92286) and then at95dfc62f8(3c395c3e4). Between52b30809fandaf9361114,mainmerged #2839, under which the formulas count each person's cash and stocks and shares ISAs in their own benefit unit, and #1995, under which the council tax reduction formula takes the household route above; #1969's description explains how its formulas combine its valuation with #2839's pooling. Between95dfc62f8and83c2554b2,mainchanged two of this PR's files,uprating_indices.yamlandesa_income_capital.yaml, and git merged both without conflict. Inuprating_indices.yaml, this branch keeps #1969's file, addsother_property_valueandoverseas_property_value, and rewrites the comment onpension_credit_reported_capital. Whend7caedad2merged3dbdb0027into this branch, git found conflicts only in the documentation strings ofpension_credit_assessable_capitalanduc_assessable_capital; each keeps #1969's text and this branch's sentences on financial-only reports. GitHub reports this head mergeable intomainat2c570224b.Stored totals.
test_stored_household_totals.py::test_stored_household_totals_grow_past_the_projection_horizon, whichmain's #2781 added, failed in CI ond0648474a, GitHub's merge off40cb894cintomainat0080274d: UC capital came to £5,800 against an expected £6,000, because #1969's formula then valued the £2,000 stocks-and-shares ISA at market value less 10%. #1969'sc11d7c1d9made that test expect the deduction, and #1969'sfc066bd31and this branch'se0413453edid the same intest_isa_balances.py. #2131, which #1969 now carries, puts the unit and investment trusts and stocks and shares ISAs that a dataset itemises inshare_like_capital_without_sale_expenses, which no sale-expense list names, so all six DWP means tests count them at full value. Itsce91e92eamakes the stored-totals test expect £6,000 again, and its90e52b48amakestest_isa_balances.pycount the ISA in full. This head takes both files from0f35157f9unchanged, which reversese0413453eand this branch's rewording of one comment in each. The stored-totals test now expects UC capital to equal savings plus the stored cash ISA and stocks and shares ISA totals at face value, six times savings for this household, in every year from 2025 to 2040. That test reads Universal Credit capital;test_stored_totals_and_person_balances_agree_in_every_year, in the same file, reads all seven means tests' assessable capital. Both new inputs reach Pension Credit and the four legacy programmes through each one'scapital/sources.yaml, Universal Credit through itscapital/property_sources.yaml, andcouncil_tax_reduction_assessable_capitalthrough its owncapital/sources.yaml, through Pension Credit's capital on a savings-credit-only award, and through Universal Credit's capital for a working-age applicant with a Universal Credit award, outside Scotland's scheme from April 2022. The national council tax reduction formula and the Merton, Kingston upon Thames, Newham, Westminster and Oxford formulas test that variable, so both inputs reach those schemes as well. No dataset in the file stores either input, so both default to zero and leave every figure unchanged.Law
sale_expenses/rate.yamlcites the same regulation after its UK valuation rule.capital/sources.yaml,sale_expenses/sources.yamlandsale_expenses/rate.yamlall cite: SI 2012/2885 Sch 1 para 33 (pensioners in England), SI 2012/2886 Sch para 66 (England's default scheme), WSI 2013/3029 Sch 1 para 27 and Sch 6 para 29 (Wales), SSI 2012/319 reg 43 (Scotland, pension age), SSI 2012/303 reg 47 (Scotland, working age to 31 March 2022) and SSI 2021/249 reg 70 (Scotland, working age from 1 April 2022). In the first six, the council takes off 10% and any encumbrance under closing words that follow both limbs; under SSI 2021/249, it takes reg 70(1)'s deductions off the value reg 70(2) gives.Invariants
property_wealthequals the sum of its saved components for every nonnegative input.total_wealth.household_land_valuenever falls belowowned_land, and an overseas-only household has zero UK land. A negative input breaks the bound:other_property_valueof -1 withowned_landof £20,000.50 in London gives £19,999.65.council_tax_reduction_assessable_capital, within float32 rounding of the total, and never reduces it.property_sourceslist appears in itscapital.sourceson each date either list changes, and every name in UC's list names a model variable.main's wealth, land and capital outputs on a hand-built grid pinned frommainat2da212ab. For the two rows with other residential, non-residential or corporate wealth, the grid pins wealth, land and Universal Credit capital on the first and wealth and land only on the second. Value means-tested capital less 10% sale expenses and secured debt #1969's formulas take sale expenses off other residential and non-residential property and offshare_like_capital_with_sale_expenses, which holds all of row 9's unitemisedcorporate_wealth, so they change these rows' other capital outputs independently of the new inputs. Row 8's UC capital comes to £207,000 onmainat2da212aband6c6e229a, atf40cb894cand at1aacd327.Tests
The current head,
329f05cda9275194f79549b7a0d0f0fbd6c774fd, merges #1969's head0f35157f9into6e4c632eawithout conflict. Since8f755b981, #1969 bounds a person's ISA balances by the share part that holds them and the holdings behind it, computes the reform-route complement in float64, and qualifies the bound's text for missing aggregates. Those changes reach only the cash and share parts of capital:_person_capital_poolsubtracts nothing from the property sources, andSALE_EXPENSE_ASSETSstill names both new inputs. Before that,630b0e26emerged #1969's1b41af993, and6e4c632eachanged two texts. Council tax reduction'scapital/sources.yamlnow says its route doesn't yet countcorporate_wealthor the itemised share-like holdings, although the schemes count shares.docs/engineering/property-wealth-components.mdnow lists council tax reduction in its capital table and its benefit capital row. We ran no tests locally at329f05cda.65fc4a6e90f0fb4c26c0b2cc8342cbf7342bd178merged #1969's8f755b981into7849e1128. Through #2131, #1969 now splitsshare_like_capitalintoshare_like_capital_with_sale_expenses, which takes the 10%, andshare_like_capital_without_sale_expenses, which holds itemised unit and investment trusts and stocks and shares ISAs at full value. Git found conflicts in ten files, and the merge resolves them as follows:sale_expenses/sources.yamllists keep Value means-tested capital less 10% sale expenses and secured debt #1969's description, then this PR's paragraph on the new inputs. The five lists other than Universal Credit's nameowned_land,other_residential_property_value,non_residential_property_value,share_like_capital_with_sale_expenses,overseas_property_valueandother_property_value. Universal Credit's names onlyshare_like_capital_with_sale_expenses, as on Value means-tested capital less 10% sale expenses and secured debt #1969.capital/sources.yamlnames savings, cash ISAs, land, other residential and non-residential property, both parts ofshare_like_capital, and the two new inputs.test_capital_valuation_properties.py,SALE_EXPENSE_ASSETSnames land, other residential and non-residential property, the two new inputs andshare_like_capital_with_sale_expenses. The file keeps Value means-tested capital less 10% sale expenses and secured debt #1969's check (d6cf32529) that each programme's capital sources include every name on its sale-expense list.test_isa_balances.pyandtest_stored_household_totals.pyare Value means-tested capital less 10% sale expenses and secured debt #1969's files (see "Stored totals").Two files that this PR adds named
share_like_capital, so the merge also changes them:test_property_wealth_components.py::test_property_capital_lists_preserve_each_source_onceasserted that each programme's two lists nameshare_like_capitalonce. No list names it now, so without a change all 12 cases, six programmes in 2024 and 2026, would fail. The test now asserts that neither list namesshare_like_capital, that each names the part with sale expenses once, and that only the capital list names the part without. TheZERO_INPUT_GRIDcomment now names the part with sale expenses.docs/engineering/property-wealth-components.mdsays that each programme's capital sources name both parts and its sale-expense list only the part with sale expenses, so itemised trusts and stocks and shares ISAs count at full value.On our reading of the code, the split moves no fixed expectation in this PR's tests. Their share-like wealth is unitemised
corporate_wealth, andshare_like_capital_with_sale_expensesequalsshare_like_capitalfor a household that itemises nothing. Inperson_isa_capital.yaml, which this PR doesn't change, Case 2 again expectsmain's [6,000, 9,000], where it expected [6,000, 8,400] at7849e1128(review). We ran no tests locally at65fc4a6e9.CI at
329f05cda(Code changes, run 44173506705) passed every job. The 90-minute job limit cancelled Python shard 2 on the first attempt after its 2,003 tests had passed with none failing, and its rerun passed.The head before
65fc4a6e9,7849e11283d4813d133a0f8ec0d0d3b3c69d929d, changed three text files from8bfd46a9f: it merged #1969's then head59a1c4ad2, which reworded #1969's changelog fragment, and it added six citations to council tax reduction'ssale_expenses/rate.yamland reworded the last sentences ofsale_expenses/sources.yaml's description. No other file changed, and it merged withmainat040e9a5f0and with #1969's then head without conflict.8bfd46a9fmerges #1969's3dbdb0027into80e0d344f(d7caedad2) and adds four commits: council tax reduction's lists and cases (b6549961a), the legacy sale-expense rate citations and the engineering page's rewrapped paragraph (2567d1cac), the growth factors page (f6dcf990c) and the council tax reduction property test (8bfd46a9f). We ran each command below on its own at8bfd46a9f7fcfa1aa5fc23aab8ca78d74fd4fa13, on a clean checkout afteruv sync --frozen --extra dev, and loaded no survey data:uv run --frozen policyengine-core test <directory> -c policyengine_uk:gov/dwp1,019 passed,finance/benefit/family1,810 passed, council tax reduction 359 passed.uv run --frozen pytest <path> -n 4:test_capital_valuation_properties.py18 passed,test_stock_capital_periods.py2 passed,test_uc_property_capital.py65 passed,test_uc_property_capital_mock.py26 passed,test_person_isa_capital.py32 passed,test_savings_credit_only_receipt_properties.py6 passed,test_stored_household_totals.py42 passed,test_property_wealth_components.py63 passed andtest_isa_balances.py2 passed, andpolicyengine_uk/tests/code_health3,186 passed.uvx ruff@0.17.2 format --check .: 2,236 files already formatted.uvx ruff@0.17.2 check .anduvx ruff@0.17.2 check --select F811,F821 policyengine_uk: all checks passed.git diff --check 80e0d344f..8bfd46a9f: clean..github/check_fix_pr.pyon this title and body, with the diff from the merge base95dfc62f8: PASS, 34 changed executable tests.git merge-tree --write-tree --name-onlymerges8bfd46a9fwithmainat95dfc62f8and with Value means-tested capital less 10% sale expenses and secured debt #1969's then head3dbdb0027without conflict.Mutation checks on the council tax reduction lists, each in a scratch copy of
8bfd46a9f:overseas_property_valuein the sale-expense list, the three overseas cases incouncil_tax_reduction_capital_valuation.yamlfail at £100,000 against £90,000, and so does the property test's overseas half. Without it in the capital list, the same cases and the same half fail at £0.other_property_valuein the sale-expense list, the three other real estate cases fail at £50,000 against £45,000, and so does the property test's other real estate half; without it in the capital list, the same cases and the same half fail at £0.d7caedad2, the six household-route cases fail at £0 and both halves of the property test fail; the land case and the Universal Credit case pass.CI at
7849e1128passed every job, including the seven Python shards, the YAML job andTest / Result.80e0d344fchanges only text on top of0d760fccd: thepension_credit_reported_capitaldocumentation string, the changelog fragment, two test comments, the Universal Credit sale-expense rate description, five sale-expense reference lists and the engineering page. In Python it changes only comments and one string constant; in YAML, only descriptions and references. We ran each command below on its own at80e0d344f, on a clean checkout afteruv sync --frozen --extra dev, and loaded no survey data:uv run --frozen pytest <path> -n 4:test_parameter_descriptions.py24 passed,test_isa_balances.py2 passed,test_property_wealth_components.py61 passed,policyengine_uk/tests/code_health3,115 passed.CountryTaxBenefitSystem()loads every changed parameter file, and the Universal Credit sale-expense rate still gives 0.1 on 2026-01-01.uvx ruff@0.17.2 format --check .: 2,184 files already formatted.uvx ruff@0.17.2 check .anduvx ruff@0.17.2 check --select F811,F821 policyengine_uk: all checks passed.git diff --check 0d760fccd..80e0d344f: clean..github/check_fix_pr.pyon this title and body, with the diff from the merge base52b30809f: PASS.For one person aged 75 in London with £40,000 of other residential property, we built a 2025 dataset that also holds £1,000 of savings and stores 1,000 in
pension_credit_reported_capital. From it the model givespension_credit_assessable_capitalof 1,000.00 in 2025, 1,040.00 in 2026 and 1,268.69 in 2032, while the column reads the uprated stored value, and 45,627.87 in 2033, when the formula returns -1. Without the column, the model gives 37,792.48 in 2026. From a situation that sets 1,000 for 2026 and the £40,000 of property for 2026 and 2027, it gives 1,000.00 in 2026 and 36,000.00 in 2027, when the column reads -1. The model gives the same figures at8bfd46a9f.0d760fccdchanges only text: the changelog fragment, test comments, thepension_credit_reported_capitaldocumentation string, one parameter description and the engineering page. We ran each command below on its own, on a clean checkout of1aacd327b615b20ecfe43562cf890c032e1d4dd5afteruv sync --frozen --extra dev, and loaded no survey data.We ran each Python file on its own with
uv run --frozen pytest <file> -n 4:test_stored_household_totals.py: 42 passed (208 s)test_property_wealth_components.py: 61 passedtest_isa_balances.py: 2 passedtest_uc_company_owner_properties.py: 7 passedtest_pension_credit_reported_capital_properties.py: 4 passedpolicy/baseline/finance/benefit/family/universal_credit/test_uc_capital_allocation.py: 1 passedtest_benunit_reported_capital_properties.py: 7 passedtest_capital_valuation_properties.py: 18 passedtest_projection_horizon.py: 14 passedtest_savings_credit_only_receipt_properties.py: 6 passedtest_stock_capital_periods.py: 2 passedtest_uc_company_override_properties.py: 11 passedtest_uc_property_capital.py: 65 passedtest_uc_property_capital_mock.py: 26 passedtest_uprating_inputs_reach_data.py: 18 passedtest_savings_income_uprating.py: 134 passedtest_capital_share_components.py: 14 passed (2,238 s)Of the test files
mainchanged between2da212aband52b30809f, onlytest_stored_household_totals.pyreadsproperty_wealth,household_land_value,total_wealth, a capital source list or an assessable-capital variable.YAML files, each with
uv run --frozen policyengine-core test <file> -c policyengine_uk:esa_income_capital.yaml: 18 passedhousing_benefit_capital.yaml: 21 passedincome_support_capital.yaml: 18 passedjsa_income_capital.yaml: 17 passeduc_assessable_capital.yaml: 23 passedpension_credit_reported_capital.yaml: 31 passedbenunit_reported_capital.yaml: 6 passedhousehold_land_value.yaml: 15 passedproperty_wealth_components.yaml: 13 passedcapital_valuation.yaml: 26 passedpension_credit_income.yaml: 10 passedcouncil_tax_reduction_pension_credit.yaml: 23 passedYAML directories, with the same command:
household/wealth: 45 passedgov/dwp: 856 passedAt
1aacd327b, which carries #1969 before #2131's split,main's version oftest_stored_household_totals.pyfailstest_stored_household_totals_grow_past_the_projection_horizonwith £5,800.00 against £6,000.00 ± 0.06, as it failed in CI ond0648474a, and the merged version, which then expected £5,800, passes.We also ran these checks at
1aacd327b:uv run --frozen pytest policyengine_uk/tests/code_health -n 4: 3,115 passed.uvx ruff@0.17.2 format --check .: 2,184 files already formatted.uvx ruff@0.17.2 check .anduvx ruff@0.17.2 check --select F811,F821 policyengine_uk: all checks passed.git diff --check f40cb894c..1aacd327b: clean..github/check_fix_pr.pyon the title and body, with the diff from the merge base withmain: PASS, 31 changed executable tests.git merge-tree --write-tree --name-only 1aacd327b origin/mainat52b30809f: no conflict.git diff --stat b4e872273..1aacd327b: 45 files changed, 2,631 insertions, 85 deletions.Runs at
f40cb894con clean checkouts.We ran each Python file on its own with
uv run --frozen pytest <file> -n 4:test_property_wealth_components.py: 61 passedtest_isa_balances.py: 2 passedtest_uc_company_owner_properties.py: 7 passedtest_pension_credit_reported_capital_properties.py: 4 passedpolicy/baseline/finance/benefit/family/universal_credit/test_uc_capital_allocation.py: 1 passedtest_benunit_reported_capital_properties.py: 7 passedtest_capital_valuation_properties.py: 8 passedtest_projection_horizon.py: 14 passedtest_savings_credit_only_receipt_properties.py: 6 passedtest_stock_capital_periods.py: 2 passedtest_uc_company_override_properties.py: 11 passedtest_uc_property_capital.py: 65 passedtest_uc_property_capital_mock.py: 26 passedtest_uprating_inputs_reach_data.py: 18 passedtest_savings_income_uprating.py: 134 passedtest_capital_share_components.py: 14 passedYAML directories at
f40cb894c, withuv run --frozen policyengine-core test <directory> -c policyengine_uk:household/wealth: 45 passedgov/dwp: 851 passedMutation checks at
f40cb894c:test_new_inputs_at_zero_reproduce_mainfails whenoverseas_property_valuedefaults to £1,000 instead of zero: 9 failed, 9 passed, one failure for each omitted-input row.uc_non_residential_property_capitalfrom UC'sproperty_sources.yaml: 2 failed, 16 passed. Row 8's UC capital falls to £135,000.test_household_capital_is_allocated_and_conserved_across_benefit_unitsfails whenuc_assessable_capitalskips its final penny rounding, and when one benefit unit loses a penny.test_property_source_lists_name_configured_sourcesfails when a mutant misspells one name in Pension Credit's list, and again in UC's list.Checks at
f40cb894c:policyengine_uk/tests/code_health: 3,111 passed.git diff --checkand the fix-evidence check pass.main(d0648474a): the seven Python shards gave 1 failed, 11,642 passed, the failure being the stored-totals test above (shard 5/7), and the YAML job 5,526 passed.We didn't run the tests that need a survey dataset, the full suite or the documentation build locally. CI ran all three at
7849e1128and passed.Aggregate impact at
329f05cda(run 44173505966) compared this PR merged intomain(8a9a26dc14) withmainat2c570224b1on the certifiedenhanced_frs_2024_25.h5(policyengine-uk-data 1.58.1). Universal Credit spending rises by £222.8m in 2025-26 and by up to £1.53bn in 2029-30, Pension Credit by £0.7m to £1.1m a year and Housing Benefit by £0.3m to £42.2m a year. On the same base and file, the same job gave #1969 at0f35157f9the same impact figures in every table (run 44021044211), so on that file this PR changes none of them. We haven't measured the effect with the component data release, which doesn't exist yet.🤖 Generated with Claude Code