Skip to content

Stats NZ regional resident population at 30 June 2023 (NZ, G8-d4) - #379

Merged
MaxGhenis merged 2 commits into
mainfrom
nzhub/g8d4-erp-2023
Oct 22, 2026
Merged

MaxGhenis merged 2 commits into
mainfrom
nzhub/g8d4-erp-2023

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

What

Adds Stats NZ's estimated resident population at 30 June 2023 for the 16 regional council areas and New Zealand: 17 facts in the existing stats_nz/subnational_population_estimates_2025 package. This is G8-d4 of the NZ Microcosm plan (microcosm#1183).

  • Source: Table 1 of the already-pinned subnational workbook (sha256 001e8a89…50a6, unchanged). The facts are cells B7:B22 and B25, under the column header 2023, which has no P marker.
  • Period: calendar_year: 2023, coverage 2023-06-30 to 2023-06-30. These are the release's 2023-base estimates, which are different from the 7 March 2023 census-night count.
  • Status: not provisional. The header carries no P. The workbook's Contents sheet and footnotes don't call 2023 final or revised either, so no status is asserted.
  • Concept and geography: the same ERP concept, REGC codes (regc_2025), provenance and assertion as the existing 2025 facts. The New Zealand row is read directly, never summed.
  • No arithmetic: no ratios or growth rates; the consumer computes them.
  • One package: reference periods compile per record set, so no sibling package is needed.

Why

Max ruled on 2026-10-21 (cos d1598) that Microcosm NZ scales the 2023 Census structure to the June 2025 ERP, holding households and families per person constant. That needs each region's ERP at the Census-time base, June 2023, alongside the June 2025 facts this package already emits.

Checks

  • tests/test_chronicle_nz_population.py: 58 passed in the build lane, and the hub re-ran it at this head (58 passed).
  • Mutants:
    • column B→C fails setup at the year-header guard;
    • B→C with a matching 2024 P header fails test_every_fact_equals_one_published_cell_with_no_scaling (200,400 vs 198,500).
  • Bundle pins: main's pins plus the measured single-source delta: +17 facts (1,579,263 → 1,579,280), stats_nz 2,015 → 2,032, and +1 fact at each of the 17 existing geography keys. No geography key is added. The full delta is in the commit message.
  • The original 85 facts, their consumer rows and all 2,265 source cells are byte-identical.

Invariants

  • Every new fact equals exactly one published cell, at scale 1.
  • The existing 2025 facts are unchanged.
  • No fact is derived from others.

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits October 21, 2026 23:12
G8-d4: add 17 direct Table 1 B7:B22/B25 cells to the existing package.
Keep CY2023 / 2023-06-30 coverage, the unmarked numeric 2023 header,
REGC2025 geography and existing concept/provenance/assertion. Guard source
headings and row labels. Contents and workbook footnotes do not explicitly
call 2023 final or revised. No new artifact or computed values.

Measured single-source build_bundle delta (before/after outputs deleted):
- facts 85 -> 102 (+17); source cells 2265 -> 2265 (+0).
- geography keys 17 -> 17 (+0); no added/removed by_geography keys.
- sources 1 -> 1 (+0); packages 1 -> 1 (+0).
- source-table keys 1 -> 1 (+0); parsed source sheets 2 -> 2 (+0).
- bundle warnings 0 -> 0 (+0); errors and duplicate-key counts stay 0.
- period keys 1 -> 2 (+1), adding calendar_year:2023 with 17 facts;
  calendar_year:2025 stays 85. Entity keys 1 -> 1 (+0), person 85 -> 102.
- source-region count 5 -> 6 (+1); source-record and consumer-fact counts
  85 -> 102 (+17). Unique aggregate and semantic keys 85 -> 102 (+17);
  unique source-series keys 5 -> 6 (+1); other unique key counts unchanged.
- observed measure stats_nz:population +17; observed/canonical concept
  stats_nz.estimated_resident_population +17 each.
- by_source stats_nz +17; existing table key +17:
  stats_nz:Subnational population estimates: At 30 June 2025 (provisional), Tables 1 and 3
- by_geography +1 each (5 -> 6): country:NZ, region:01, region:02,
  region:03, region:04, region:05, region:06, region:07, region:08,
  region:09, region:12, region:13, region:14, region:15, region:16,
  region:17, region:18.

Default-bundle pins = local main 140316a
(pins identical at assigned base aa288c3)
plus that measured delta:
- facts 1579263 -> 1579280 (+17).
- geography keys 102613 -> 102613 (+0); source count 56 -> 56 (+0);
  packages 405 -> 405 (+0); table keys 347 -> 347 (+0).
- warnings 122 -> 122 (+0); period keys 523 -> 523 (+0), because
  calendar_year:2023 already exists; entity keys 12 -> 12 (+0).
- calendar_year:2023 111185 -> 111202 (+17); person 521319 -> 521336 (+17).
- stats_nz 2015 -> 2032 (+17); existing Tables 1 and 3 key 85 -> 102 (+17).
- country:NZ 6131 -> 6132 (+1); each of the 16 region keys listed above
  30 -> 31 (+1); no added/removed by_geography keys.

Original 85 facts, consumer rows and full source cells are byte-identical.
Both B-to-C selector mutants were killed by the exact-cell regression test;
package restored afterward. Independent source-fidelity, boundary and pin
arithmetic reviews PASS. Targeted package tests: 58 passed (12 dependency
deprecation warnings). Ruff checks pass for both changed test files.
Full/default bundle test intentionally left to CI.

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Review of #379 (GPT-6.1 Sol, head 8bcb66a):
- The new CY2023 record set inherited provenance_class from the YAML anchor.
  test_every_source_package_record_set_declares_provenance_class counts
  record_set_id and provenance_class lines and failed (14703 == 14702).
  Repeat `provenance_class: census` under the record_set_id, as the four sibling
  sets already do. Consumer rows are unchanged (the reviewer hashed all 102
  rows with and without the line), so the bundle pins stand.
- Quote geography_id '08' and '09' like every other REGC code in the file.
- Restore the README's portable validation commands (build-suite and the
  three test files) in place of the lane's scratch-path commands.

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

Copy link
Copy Markdown
Contributor Author

Merge audit (NZ hub): head f6d4c39.

  • Independent GPT-6.1 Sol review r1 (8bcb66a) returned REQUEST_CHANGES on one blocker: a missing explicit provenance_class. It was fixed in f6d4c39 with quoted REGC 08/09 and the README commands restored.
  • The delta review r2 (f6d4c39) returned APPROVE: the provenance test passes, the 102 consumer rows are byte-identical (sha b04760e3…), the original 85 match main, and nits 3/4 were accepted by design.
  • CI: Chronicle surface, bundle and checks all pass. Mergeable/CLEAN; no changes requested. Merging with a merge commit.

@MaxGhenis
MaxGhenis merged commit 6d6af42 into main Oct 22, 2026
3 checks passed
@MaxGhenis
MaxGhenis deleted the nzhub/g8d4-erp-2023 branch October 22, 2026 11:49
anth-volk added a commit that referenced this pull request Oct 22, 2026
Brings in #379 (Stats NZ regional estimated resident population at
30 June 2023: 17 facts in `stats-nz-subnational-population-estimates-2025`,
with the merged-bundle count pins in `tests/test_chronicle_bundle.py`). No
textual conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant