Skip to content

Add share-like wealth component inputs - #1974

Open
MaxGhenis wants to merge 1 commit into
add-isa-balance-variablesfrom
wealth-share-components
Open

MaxGhenis wants to merge 1 commit into
add-isa-balance-variablesfrom
wealth-share-components

Conversation

@MaxGhenis

Copy link
Copy Markdown
Collaborator

Stacked on #1791 (cash_isa, stocks_and_shares_isa); GitHub retargets it to main when #1791 merges.

What

Two household STOCK inputs for the parts of corporate_wealth that the means tests value differently, and uprating for all four components:

  • directly_held_shares: UK shares, listed or not, and employee shares and share options, held outside ISAs and pooled funds. Quoted shares are valued less 10% for the expenses of sale (ADM H1665).
  • unit_and_investment_trusts: the Wealth and Assets Survey asks unit trusts and investment trusts as one question. Unit trusts have no costs of sale (ADM H1673-H1674).
  • directly_held_shares, unit_and_investment_trusts, cash_isa and stocks_and_shares_isa join corporate_wealth under per-capita GDP in uprating_indices.yaml, so a dataset's identity corporate_wealth == directly_held_shares + unit_and_investment_trusts + stocks_and_shares_isa survives projection. Add cash ISA and stocks and shares ISA holdings variables #1791 left the ISA balances out of the uprating list.
  • corporate_wealth's documentation names its components.

The inputs have no consumers yet, so no output moves on any dataset. The follow-up stacked on #1969 points the capital and sale-expense source lists at them, so unit trusts and stocks and shares ISAs escape the 10% deduction. The data side is PolicyEngine/policyengine-uk-data#501, which builds corporate_wealth as the exact sum of the three, plus the microcosm mirror.

Tests

tests/test_wealth_components.py checks:

  • each component matches corporate_wealth's entity, quantity type, class uprating and uprating_indices.yaml index;
  • cash_isa uprates with savings;
  • total_wealth does not add the components on top of corporate_wealth.

tests/code_health passes locally.

axiom: n/a: input variables only, no rule change

🤖 Generated with Claude Code

corporate_wealth bundles three assets the means tests value differently:
quoted shares less 10% for the expenses of sale (ADM H1665), unit trusts at
the manager's withdrawal price with no deduction (H1673-H1674), and stocks
and shares ISAs at their withdrawal value (H1656). Add household inputs for
the two parts not yet modelled, directly_held_shares (UK shares and employee
shares and options) and unit_and_investment_trusts, and uprate them, cash_isa
and stocks_and_shares_isa with per-capita GDP like corporate_wealth, so a
dataset's identity corporate_wealth == sum of components survives
projection. The inputs have no consumers yet.

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

Copy link
Copy Markdown
Collaborator

Reviewed commit 54f4c7da480f79963967dc6689af022e82673636. Needs changes; review coverage is partial. The additive wealth inputs passed their focused tests. The current-main integration now needs a documentation conflict resolved and the #1791 dependency handled before merge.

Confirmed integration conflict. A prospective merge of this exact head onto main 3c48247eb92b221312565bff3a1dbf0b87306e22, attempted on 2 October 2026, stopped with a content conflict in growthfactors.md. The attempt safely aborted without changing the PR. No integration tests ran on that prospective merged tree. GitHub's mergeability against the current add-isa-balance-variables base does not establish mergeability against main.

Preserve the component contract. test_wealth_components.py:26 verifies the share components use the same entity, stock semantics and uprating as corporate_wealth; test_wealth_components.py:42 checks they are not added again to total_wealth. These are useful inputs even before data builders or benefit formulas consume them. Their addition does not establish that every supported dataset has split pensions out of its corporate-wealth bundle, so it does not by itself resolve #1837.

Repair and acceptance steps:

  1. Land the ISA input parent Add cash ISA and stocks and shares ISA holdings variables #1791 first, then retarget this PR to main and rebase on its actual tip. If the parent is consolidated through another agreed route, preserve both ISA definitions and their changelog rather than dropping the dependency silently.
  2. Resolve growthfactors.md by retaining current-main descriptions and this PR's new component entries. Check the final prose against policyengine_uk/data/uprating_indices.yaml and variable metadata; do not select an entire outdated document side.
  3. Keep corporate_wealth as the aggregate holding its share/fund components, with cash_isa following the savings contract. Preserve the no-double-count test and the common uprating index, so a dataset that supplies the component identity retains it when projected.
  4. Run the focused suite on the integrated tree and obtain new-head hosted checks. Check documentation rendering if conflict resolution materially changes the page. Report any data migration separately, with its supported schema and consumers; no population-impact claim is needed for this input-only change.

Suggested checks after resolving the dependency and conflict:

uv run --no-sync pytest policyengine_uk/tests/test_wealth_components.py -q
uv run --no-sync ruff format --check .
uv run --no-sync ruff check .

Validation already completed on this exact PR snapshot: 3 tests passed in test_wealth_components.py, using an asserted snapshot import, core 3.32.9 and the existing environment without installing dependencies. That run preceded the attempted current-main integration. The combined tree, final documentation resolution, hosted CI after retargeting and any population-data consumers remain unverified.

Live posting check (2026-10-02T15:12:45.036767+00:00): same reviewed commit; GitHub reports MERGEABLE. No hosted checks reported. These checks do not replace the remaining validation listed above.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants