Add UK source packages for #251 and #253: UC payment indicator × child entitlement crosses (April 2023 to May 2026) and Scotland's council-area household total on the households spec - #252
Conversation
…to May 2026 - Two Stat-Xplore UC_Households source packages for chronicle#251, Great Britain, one record set per month from April 2023 through May 2026, the latest month in DWP's 18 August 2026 quarterly release (the window extends the issue's April-December 2025 request at the maintainers' direction): family type × payment indicator × child entitlement (760 facts) and number of children × payment indicator × child entitlement (1,216 joint facts). - The children cube was requested with total: true on the child-entitlement recode, so DWP's own Total over child entitlement lands as 608 further facts under the distinct total_benefit_units measure, table_record_kind total and filters child_entitlement: all, in a .total record set per month. Chronicle never sums the joint cells; the Total row omits an '== all' constraint because its source column carries the publisher label 'Total', which the guard cell pins instead. - Raw API responses are archived verbatim (the query is echoed inside them), sha-pinned in the manifests and uploaded to ledger-raw under raw/uk/dwp/. All publisher categories, including the unknown and not-available tails and literal zeros, are preserved; no cell was suppressed, no month is missing, and no category code changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Register both aliases in SOURCE_PACKAGE_ALIASES and the sorted UK_BUNDLE_SOURCES; add their validate-package/build-suite pairs to the harness doc and extend the UC family-type row of the UK source checklist (fact counts, the publisher-emitted margin, the r/p revision markers). - Tests pin the 38-month window, every publisher category and literal zero, sample cells at April 2023, April 2025 and May 2026, the echoed query against the returned field items and manifest digest, the publisher Total as a margin (|Total - (No + Yes)| at most 8), the re-aggregation to the three #239 pairwise cubes over April-December 2025 (gaps at most 6, 9 and 7 within the 15-household disclosure tolerance) and agent acceptance with zero row-semantic errors. - Bundle pins move by the 2,584 new facts (+68 per month for each of the 38 months); the semantic-duplicate count and period count are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- After rebasing over #250, the 27 April-December months of 2023, 2024 and 2025 overlap the new cross: summing its four payment x child-entitlement cells per family type lands on the published detail cell within 11 households (126 of 135 cells differ, disclosure control), under the same 15-household tolerance #250 applies. The published Total is not compared and no fact is emitted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
48b245f to
b25a165
Compare
…ouseholds spec - chronicle#253: the 32 all-occupied-households cells of the pinned NRS Census 2022 UV404 council-area export are filed a second time as the nrs.census2022.uv404.council.households record set on uk.local_geography.households.by_local_authority.v1, mirroring the NRS constituency leg (domain household_count, geography groupby, the publisher's 'All occupied households' row label kept as the evidenced filter). Same artifact, same rows, same guards, same values; the household_count domain keeps fact and semantic keys distinct from the tenure filing, so nothing collides and nothing is reconciled. - A consumer now resolves all 361 UK local authorities (296 + 22 England and Wales, 11 Northern Ireland, 32 Scotland) from one record-set spec, as it already does for the 650 constituencies; tests pin both covers, the cell-for-cell identity with the tenure filing and the 2,509,275 Scotland total. The NISRA header and the UK source checklist drop the stale 'a second Scottish package would collide' note. - Bundle pins move by the 32 facts (nrs, calendar_year:2022, household). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Review at fee140f8 (Claude Code, high effort; fresh checkout, full suite: 884 passed, 1 skipped, exit 0 — 17 more than the body's 866 because the bundle test runs here and passes; validate-package on all four touched packages: 0 errors, 0 warnings; ruff check clean at the locked 0.14.10; both artifact shas and sizes match the manifests and are enforced at build).
What checks out
- Facts are the raw cube cells exactly. Re-walking the
[38, 5, 2, 2]and[38, 8, 2, 3]cubes againstbuild_facts(2025)gives 760 of 760 and 1,824 of 1,824 with zero mismatches; the children package splits 1,216 detailbenefit_unitsand 608total_benefit_units. - The Totals are the publisher's. The archived response echoes
total: trueon the child-entitlement recode and carries a thirdTotalitem with no URI; the total record sets sit on their own spec withtable_record_kind: total,child_entitlement: alland a guard on theTotallabel, so a consumer pinning the two named values cannot pick them up. Chronicle sums nothing; the only sums are in tests. |Total − (No + Yes)| is at most 8 in every month. - The joints re-aggregate to #239's three pairwise packages over the nine overlapping months within 6, 9 and 7 households, as the tests pin, and the family cross re-aggregates to #250's 135 detail cells within 11.
- Window and provenance. 38 contiguous months from 2023-04 to 2026-05, June 2026 correctly absent; the
rmarkers on 2024-06 to 2026-02 andpon 2026-03 to 2026-05 are in the archived bytes and pinned exactly;extraction_methodrecords the database, measure, the four field URIs in response order, the month range and the recodetotalflags, and the test asserts the echoed query equals the declaration.source_urlis the REST endpoint, parity with #239. - Scotland (#253) is an additional filing, not a replacement: a new
nrs.census2022.uv404.council.householdsrecord set on the households spec, byte-identical rows to the tenure block, 32 cells summing to 2,509,275 and asserted equal cell-for-cell; 361 local authorities and 650 constituencies now each resolve on one spec. The NISRA change is comment-only. - Bundle arithmetic is exact: +2,616 = 760 + 1,824 + 32, with the per-source, per-geography, per-entity and per-month deltas all consistent and no other package moved. The provenance-class line-count test is satisfied.
Question
The family cross's 20-cell monthly sum against #250's published GB Total is off by 16 in two months — October 2023 (−16) and December 2025 (+16), with the rest within ±14 — above the 15-household tolerance #250 quotes for its own Total-versus-detail check. The body explicitly declines that comparison and the test compares only the detail cells, which is the right choice; a 20-cell sum accumulating DWP's cell-level perturbation makes 16 plausible. I recomputed both months from the archived cube and #250's CSV and get the same figures. Worth one sentence in the family package header so the next reader does not treat it as a discrepancy.
Nits
- Neither header mentions the two-child-limit repeal from 2026-04-06. DWP's definition of child entitlement is a child element in the award, so Yes/No is stable across the window and the repeal changes how many children are paid for, not whether the element exists; one line saying so would pre-empt the question.
- The Totals carry no
source_row_dimensionswhere #250's did — deliberate and correct here, since the unpivot parser puts each dimension label in the row and a declaredallwould be compared against the labelTotaland fail; the children header explains it. tests/test_dwp_uc_composition_source_packages.py:663uses a naivedatetime.strptime, which tripsDTZ007on newer ruff only.
Could not verify
The R2 object at the manifest key, a live Stat-Xplore re-query (the echoed query block is the evidence), and microcosm's claim that its 111 UC references pin exact dimension sets.
Approving. The two crosses give microcosm the joint the pairwise packages could not, and every reconciliation the body claims reproduces.
|
@vahid-ahmadi Thanks for the review. Answering the question here rather than pushing; the three comment-only lines are queued for the next revision of these packages (the November 2026 DWP release extends the window), so the PR merges as reviewed. Question — the 20-cell monthly sum against #250's TotalReproduced: −16 in October 2023 and +16 in December 2025, the other 25 months within ±14. It is two disclosure-control layers compounding, not a discrepancy:
The 15 in #250 is the observed bound of a five-cell comparison, not a publisher tolerance, so a 20-cell sum was never expected to meet it. The test therefore compares the finest published grain (the detail cells) and leaves the Total out deliberately; a sentence saying so goes in the family package header at the next touch. Nits
|
Summary
UC_Householdssource packages, Great Britain, monthly April 2023 to May 2026 (38 months, the latest month in DWP's 18 August 2026 quarterly release), for the joint distribution that the Add UK source packages for #233–#237: UC child-entitlement and nil-award crosses, award-band and Scotland histories, ONS family tables, HMRC Child Benefit, census household composition #239 pairwise crosses cannot identify:dwp-uc-households-family-type-payment-indicator-child-entitlement-april-2023-may-2026: Family Type × Payment Indicator × Child Entitlement, 760 facts (benefit_units).dwp-uc-households-children-payment-indicator-child-entitlement-april-2023-may-2026: Number of Children × Payment Indicator × Child Entitlement, 1,216 joint facts (benefit_units) plus DWP's own Total over Child Entitlement per (month, number of children, payment indicator), 608 facts under the distincttotal_benefit_unitsmeasure withchild_entitlement: allandtable_record_kind: total. The Total is the publisher'stotal: truerecode item, not a sum of the joint cells.r) and March–May 2026 as provisional (p) in this extract; both markers are archived in the response bytes and pinned by a test.totalflags) inside the response bytes, which are stored verbatim, sha-pinned in the manifests and uploaded toledger-raw(raw/uk/dwp/…). Both Yes/No categories, all five family types (includingUnknown or missing family type), all eight child-count categories (includingUnknown or missingandNot available prior to April 2019) and every literal publisher zero are preserved; no cell is suppressed in the returned cubes, so no row is omitted. DWP's Number of Children axis keeps its publisher meaning (verified declared under-20s), not qualifying children.nrs.census2022.uv404.council.householdsrecord set onuk.local_geography.households.by_local_authority.v1, mirroring the NRS constituency leg (domainhousehold_count, geography groupby, the publisher'sAll occupied householdsrow label kept as the evidenced filter). Same artifact, rows, guards and values; thehousehold_countdomain keeps the fact and semantic keys distinct from the tenure filing. A consumer now resolves all 361 UK local authorities from one spec, as it already does for the 650 constituencies. No new download, no value change, no reconciliation between legs or grains.dwp.uc_benefit_units/dwp.uc_households,benefit_unit,K03000001,period.type: month, filter keysfamily_type/number_of_children/payment_indicator/child_entitlement).Chronicle governance
ledger-source-ingestorvalid: true,row_semantic_error_count: 0for both packages (build-suite).ledger-source-fidelity: PASS — every emitted value resolves to a cell of the archived response; all 2,584 facts carry source-row and source-cell lineage.ledger-boundary: PASS — the publisher Total is DWP's owntotal: trueitem; the margin and pairwise reconciliations exist only as tests and emit no computed fact.Consumer note
Binding, averaging and any use of the longer history stay in microcosm (#882, PR #883); microcosm's 111 UC references pin exact dimension sets, so none of them can pick up the new three-dimension facts.
Tests
uv run chronicle validate-package <alias> --year 2025for both aliases: valid, 0 errors, 0 warnings (38 record sets / 760 facts; 76 record sets / 1,824 facts).uv run chronicle build-suite <alias> --year 2025 --out … --replacefor both: zero stage errors, lineage coverage 1.0, agent acceptance valid withrow_semantic_error_count: 0.uv run pytest -q tests/test_dwp_uc_composition_source_packages.py tests/test_source_package_alias_drift.py tests/test_chronicle_suite.py: 43 passed.uv run chronicle validate-package nrs-census2022-uv404-tenure-council-area --year 2022and itsbuild-suite: 10 record sets / 320 facts, 0 errors, agent acceptance valid withrow_semantic_error_count: 0.uv run pytest -q tests/test_uk_local_household_count_legs.py: 3 passed (361 local authorities and 650 constituencies on one spec each; Scotland's 32 cells identical to the tenure filing, sum 2,509,275; 64 distinct fact keys).uv run pytest -q tests/test_chronicle_source_package.py -k 'provenance_class or dwp': 9 passed.uv run pytest -q --ignore=tests/test_chronicle_bundle.py: 866 passed, 1 skipped.uv run pytest -q tests/test_chronicle_bundle.py::test_build_bundle_writes_merged_consumer_contract: 1 passed (bundle 195,193 facts on top of Add UC family type totals from 2023 #250, 169 packages, 164 tables, 177 semantic duplicates and 269 periods unchanged).uv run ruff check: clean; the four modified Python files passruff format --check(nine untouched test files fail the repo-wide format check on main as well);git diff --check: clean.Fixes #251, fixes #253
🤖 Generated with Claude Code