Skip to content

Correct the UK pipeline alignment docs page (#1621) - #1723

Merged
vahid-ahmadi merged 8 commits into
mainfrom
vahid-ahmadi/issue-1621-pipeline-alignment-plan
Oct 24, 2026
Merged

vahid-ahmadi merged 8 commits into
mainfrom
vahid-ahmadi/issue-1621-pipeline-alignment-plan

Conversation

@vahid-ahmadi

@vahid-ahmadi vahid-ahmadi commented May 27, 2026 •

Copy link
Copy Markdown
Collaborator

Corrects the UK pipeline alignment planning page (docs/book/assumptions/uk-pipeline-alignment-plan.md), written for #1621.

The page itself is already on main: it shipped in #2386 (merged 21 October 2026), and its original .added changelog entry was released in 2.143.0. This branch has merged main, dropped the released fragment and now carries only corrections to main's copy of the page.

What this PR corrects (from its changelog fragment):

Corrected the UK pipeline alignment planning page (docs/book/assumptions/uk-pipeline-alignment-plan.md): five would_claim_* formulas read reported receipt (Council Tax Reduction was missing); in data-built simulations claims_all_entitled_benefits is false and Housing Benefit and Council Tax Reduction ignore it, and eligibility for tax credits, Income Support and working-age Housing Benefit needs a reported award; policyengine-uk-data anchored take-up (#359), imputed gift aid (#347) and added a second-stage imputation (#362) in April 2026; the residual aggregates are #1621's April 2026 figures; the Income Support phase-out landed in #1631; CTC_child_element is not gated on is_CTC_eligible, so in tax-credit years an ineligible Child Tax Credit claimant's tax_credits enters its Housing Benefit and Council Tax Reduction means tests; and the third small item in #1621 was a ~-on-bool warning, not state_pension_type.

The claim-by-claim review behind these corrections, with sources, is in the "Ready for hub review" comment on this PR.

The page also records a model defect outside this docs PR: CTC_child_element is not gated on is_CTC_eligible, so in tax-credit years an ineligible Child Tax Credit claimant gets tax_credits that enter its Housing Benefit and Council Tax Reduction means tests. That needs its own issue and fix.

  • Changelog fragment: changelog.d/1621-pipeline-alignment-page-corrections.changed.md (changed).
  • Docs and changelog only; no code changes.

🤖 Generated with Claude Code

@vahid-ahmadi
vahid-ahmadi force-pushed the vahid-ahmadi/issue-1621-pipeline-alignment-plan branch from 5d4b027 to ed2657c Compare October 8, 2026 14:50
vahid-ahmadi and others added 3 commits October 12, 2026 11:02
#1621 is an umbrella tracker. Persist it in-repo as a docs page so the
queue of architectural fixes has a stable reference.

Auditing the current state:

- The three small bugs flagged in the issue body (tax_credits min_benefit
  unit, benunit_weekly_hours label, state_pension_type heuristic) have
  all been fixed since the issue was filed. Note them as done.
- The state pension residual is documented separately in #1632 (now
  covered by docs/book/programs/gov/dwp/state-pension.md), so this page
  links there rather than restating.

The remaining architectural gaps captured:

- runtime _reported consultation in would_claim_housing_benefit,
  would_claim_IS, would_claim_WTC, would_claim_CTC — needs conversion
  to input-only matching the UC/PC pattern, with stochastic assignment
  in policyengine-uk-data;
- take-up assignment in uk-data ignores reported data — needs port of
  the US assign_takeup_with_reported_anchors helper;
- second-stage QRF gap on SPI donors (analogous to
  policyengine-us-data#589) so consequential FRS-only variables
  (rent, gift_aid, pension contributions, *_reported benefits) are
  consistent with imputed income;
- residual aggregate gaps against OBR (income_support, esa_contrib,
  attendance_allowance, tax_free_childcare, state_pension).

Ends with a candidate PR sequence so the receiving repos (this one +
policyengine-uk-data) have a low-risk-first ordering.
…gelog fragment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Replace the State Pension residual with the 2024-25 figures documented
  in docs/book/programs/gov/dwp/state-pension.md (£119.0bn against
  £131.3bn, -£12.2bn) and point to policyengine-uk-data#493.
- Say that tax credits stopped paying all ongoing awards on 5 April 2025
  (gov.dwp.tax_credits.active), not only new awards.
- Drop the unverified Microcosm release date and "certified" claim.
- Remove em dashes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vahid-ahmadi
vahid-ahmadi force-pushed the vahid-ahmadi/issue-1621-pipeline-alignment-plan branch from ed2657c to 4e4e02d Compare October 12, 2026 09:10
MaxGhenis and others added 5 commits October 23, 2026 02:22
Main already carries this page (added by #2386); the merge brings the
branch up to date before the page is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- would_claim_council_tax_reduction also reads _reported (five, not four).
- The runtime pattern differs by source: data-built simulations set
  claims_all_entitled_benefits to false and HB/CTR ignore it, and the
  CTC, WTC, IS and working-age HB eligibility tests also need a reported
  award, so setting the flag does not reach non-reporters; the fix changes
  take-up only for CTR and pension-age HB.
- policyengine-uk-data#359 (take-up anchors), #347 (gift aid) and #362
  (second-stage QRF, narrower outputs) landed in April 2026, before
  Microcosm; past-tense description of the old build.
- In Microcosm, gift_aid is a stage-1 SPI output, not stage 2.
- The non-State-Pension residuals are #1621's April 2026 figures on
  Enhanced FRS 1.50.3, not May 2026 measurements; most (not all) of the
  State Pension shortfall arises in building the Enhanced FRS.
- #1621's third small item is the ~-on-bool DeprecationWarning, with no
  fix tracked; state_pension_type was a separate fix (#1618).
- The IS phase-out landed in #1631.
- Replaced the released .added fragment with a .changed fragment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the independent review of the corrections:
- On data-built simulations the flag reaches no new claimant of any of
  the five (HB and CTR ignore it; the others need a reported award), but
  in tax-credit years it turns on would_claim_CTC, and CTC_child_element
  is not gated on is_CTC_eligible, so tax_credits income can enter HB and
  CTR means tests for families that get no CTC.
- The conversion's effect is on awards (CTR and pension-age HB), not on
  take-up flags, and needs that CTC gate first.
- Microcosm's second stage is trained on FRS rows and predicts for SPI
  rows, with the same outputs as uk-data#362; named the three anchored
  flags; Enhanced FRS 1.50.3 predates #347, #359 and #362; renamed the
  small-items heading, which now lists an open item.
- Fragment no longer says data-built simulations ignore the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second-round review (household runs on main): in tax-credit years a
hand-entered family with children that reports nothing already claims CTC
by default, and CTC_child_element is not gated on is_CTC_eligible, so its
tax_credits enters the HB and CTR means tests and the tax credit award the
2024 winter payment tests read (utils/winter_heating.py); families that
report CTC but have moved to UC are affected in both kinds of simulation.
Microcosm's stage 2 lacks two of #362's reported-benefit outputs.

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

Third-round review (household runs on main): legacy closures on main come
only after tax credits end, so those families' tax_credits is zero unless a
reform keeps tax credits active; the ungated amount is the child element
less the taper and counts as income in CTR and HB means tests rather than
always cutting them; Microcosm's stage 2 matched #362 at 75167a6 and has
since added eight outputs (54b514f).

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

Copy link
Copy Markdown
Collaborator

UK hub (Claude build session, for Max)
Ready for hub review

Head: 4b08daa739c7adede799bdeb55c5375a819c6390

Context. This page already reached main, byte for byte, through #2386 (merged 21 October 2026; batch commit d50ee85), and its 1621.added.md entry is already in CHANGELOG.md under 2.143.0. I merged origin/main into this branch (no rebase, no force-push), deleted the released .added fragment, and corrected the page. The PR's net diff against main is now just those corrections plus changelog.d/1621-pipeline-alignment-page-corrections.changed.md. Suggested title: "Correct the UK pipeline alignment planning page".

Review. I had a verifier extract and check every claim, checked each correction myself, and then ran independent adversarial reviews (with household runs on main). Rounds 1 to 3 asked for changes, and round 4 approved this head.

Corrected (17)

Gap 1 (would_claim_* and claims_all_entitled_benefits)

  1. Five would_claim_* formulas read _reported, not four: would_claim_council_tax_reduction was missing (would_claim_council_tax_reduction.py:18-24).
  2. The runtime pattern differs by simulation type (claims_all_entitled_benefits.py:26-52):
    • hand-entered: flag | reported, with the flag true for families reporting under £1 across seven benefits;
    • data-built: the flag is false, and HB and CTR ignore it (would_claim_housing_benefit.py:21-22).
  3. Setting the flag does not reach non-reporters. The eligibility tests for CTC, WTC, IS and working-age HB also need a reported award (is_CTC_eligible.py:12-17, is_WTC_eligible.py:46-53, income_support_eligible.py:73-75, housing_benefit_eligible.py:59-65).
  4. New: CTC_child_element is not gated on is_CTC_eligible. In tax-credit years an ineligible claimant gets tax_credits but no child_tax_credit, and that amount enters the HB and CTR means tests (housing_benefit_applicable_income.py:94, council_tax_reduction_applicable_income.py:207) and the 2024 winter payment tests (utils/winter_heating.py:77-80). This already happens on main for hand-entered families with children that report nothing.
  5. The Fix paragraph: the conversion changes awards only for CTR and pension-age HB, and needs that CTC gate first.

Gaps 2 and 3 (take-up anchoring and the second stage)
6. The Enhanced FRS already anchored UC, PC and CB take-up on reported receipt in policyengine-uk-data#359 (merged 18 April 2026), not only Microcosm.
7. The gap 2 fix is marked done in uk-data#359.
8. uk-data#347 (17 April) imputed gift aid on SPI rows.
9. uk-data#362 (18 April) added a narrower second-stage QRF. The old description is now in the past tense.
10. In Microcosm, gift_aid is a stage-1 SPI output; stage 2 trains on FRS rows and predicts for SPI rows (source_stages.json at 75167a68).
11. Microcosm's stage 2 matched #362 at 75167a6, less two reports, and has since added eight outputs (at 54b514f).

Residual aggregates
12. The non-State-Pension residuals are #1621's April 2026 figures on Enhanced FRS 1.50.3, which predates #347, #359 and #362; they are not "May 2026 measurements".
13. The same dating fixed in the admonition.
14. "Most of" the State Pension shortfall arises in building the Enhanced FRS (state-pension.md:399-405).

Other
15. #1621's third small item is the ~-on-bool DeprecationWarning, with no fix tracked; state_pension_type was a separate fix (#1618). The heading is renamed to match.
16. The Income Support phase-out landed in #1631 (parameters/gov/dwp/income_support/active.yaml: false from 2026-04-01).
17. Replaced the released .added fragment with a .changed fragment.

Checked and correct (unchanged)

Follow-up for the hub (model defect, outside this docs PR)

  • The ungated CTC_child_element in item 4 is a live model defect for tax-credit years. A household run (2024, Welsh lone parent on £8,000, no reports) gives tax_credits £3,455, CTC £0 and CTR £0, against £574.96 CTR when would_claim_CTC is false.
  • I found no open issue for it. It needs an issue and a fix PR: gate CTC_child_element on is_CTC_eligible, as the family and disabled child elements are.

@vahid-ahmadi vahid-ahmadi changed the title Add UK pipeline alignment planning doc (#1621) Correct the UK pipeline alignment docs page (#1621) Oct 23, 2026
@vahid-ahmadi
vahid-ahmadi added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 4645b85 Oct 24, 2026
10 checks passed
@vahid-ahmadi
vahid-ahmadi deleted the vahid-ahmadi/issue-1621-pipeline-alignment-plan branch October 24, 2026 08:47
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