Skip to content

NZ: read owner payments as interest only, add a terminal gate checkpoint, pin the real CREATE inventory - #1688

Merged
MaxGhenis merged 6 commits into
mainfrom
nzhub/g8x-attempt8
Nov 20, 2026
Merged

MaxGhenis merged 6 commits into
mainfrom
nzhub/g8x-attempt8

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

New Zealand data changes for one engineering measurement run on the pinned populace-us donor (48b9d479…), under ruling d3058. This is the third of the three pull requests in the Microcosm hub's donor-profile placement ruling ("New Zealand's own data work"). It edits no shared source module, and no kernel implementation hash moves.

  • Rule 1, mortgage principal. The pinned donor carries no mortgage principal: the US concept mapping reads it only inside the non-invertible mortgage_payments sum. Both NZ money declarations now route household.mortgage_principal as pending (Belgium's awaits/reason shape). The Accommodation Supplement owner payments (accommodation_supplement_owner_weekly_required_payments) read annual mortgage interest × 1/52 through a one-concept scale, and the concept mapping lists fact:household.mortgage_principal as unmapped with its reason. Generated NZ resources drop the column from seven transport nodes, the scenarios and the export contract. Owners' costs are understated further, beyond MC8's rates and insurance gap; the binding note and both pending entries say so, and the unmapped reason gives the cause and how to restore principal.
  • Terminal gate checkpoint. NZ's entitlement declaration adds nz.gates.terminal to its checkpoints, so a run writes the terminal gate closure's manifest before export.prepare refuses on a blocking gate report. That manifest includes the calibration diagnostics, six evidence nodes and the battery, which no earlier checkpoint records. graph_to_json is byte-identical with and without the entry: no node, edge, param or gate changes.
  • D4, the real CREATE inventory. The attempt-7 CREATE inventory on donor 48b9d479… becomes a test fixture with a provenance sibling, and replaces the circular composition helper. The NZ graph now composes against the real inventory plus a declared three-column gap (household.tenure, person.enrolled_full_time, person.legal_marital_status), which the donor staging will fill. New tests pin the exact gap, its dtypes, the real columns' coverage (with the one dtype that differs from the concept schema, nullable Int64 for household.reference_person_id), the fixture's guard and a compile refusal against the real inventory alone. The guard checks the fixture's payload digest, the donor's identity and the CREATE kernel ref; it cannot see a staging change under the same kernel ref, so the provenance says to rerun the probe then.

What moves

  • tests/golden/nz_country_spec.json: the fingerprint and eight resource hashes (the seven rule-1 files plus entitlement_graph.json).
  • frame/tests/golden/concept-coverage/axiom-nz.json and docs/concept-coverage/axiom-nz.md: principal leaves the concept inputs and joins the unmapped concepts.
  • Node keys of the 34 NZ nodes whose declared inputs or outputs drop the column. Seven are in the transport graph: nz.money.normalize, nz.encode.person, nz.as.inputs, nz.evidence.donor_ranges, nz.evidence.support, nz.gates.terminal and nz.export.prepare. Twenty-seven are in the scenarios document: nz.scn.S1.inputs, nz.scn.S2.inputs and nz.scn.S3.inputs, and each of the eight variants' money.normalize, encode.person and inputs nodes. A node's key hashes its own declaration and folds in its inputs' keys (microcosm-graph/.../keys.py:288-296). nz.evidence.donor_ranges runs on nz.open, so its stored artifact is not reused either. The keys of NZ nodes that take the mapping, money or export documents as params move too, and so does every NZ node downstream of any of these. These are NZ's own nodes.
  • frame/adapters/axiom_concept_mappings/nz.json is a country file inside the shared frame package (ruling term 11). No kernel implementation hash moves. The default hash covers a kernel's Python module source and its dependency versions. The gate battery also hashes its binding descriptions and binding-source digests (transport/gate_kernels.py:786), and one UK kernel adds the UK spec's fingerprint (uk_runtime/graph_national.py:1007). This diff changes none of those inputs: no Python source under packages/*/src changes, and neither the old nor the new digest of the file appears elsewhere in the tree.
  • No Belgian file changes. refresh_concept_coverage --check passes for axiom-be.

Known trade-off and follow-ups

  • Checkpoint order. entitlement.py appends the cell diagnostics collector after the document's checkpoints, and the collector feeds the terminal battery. So it now executes inside the nz.gates.terminal checkpoint, after nz.calibration.diagnostics and six nz.evidence.* nodes that no earlier checkpoint runs. If one of those seven raises, the run stops before the collector runs, and the cell diagnostics manifest that the old order kept is not written. No data-only fix exists. A small shared change to entitlement.py, which lets a document list the collector ahead of the terminal checkpoint, will come as its own pull request through the Microcosm hub, with Belgium's review, before the measurement run; New Zealand's document then lists it.
  • D4 inference. The fixture was captured at 67ab33e8a. Between that commit and the branch's first base 402c3587df, only additive changes touched CREATE's hashed modules (build/country_spec.py, build/reference_factors.py); no column-producing module changed. The later merge with main brought Frame: share unchanged tables under copy-on-write, and refuse raw writes into shared buffers #1666's frame/bundle.py, which CREATE's hash also reads. On five toy cases, CREATE's frame and receipt bytes are identical with and without that bundle.py (measured for Let transport CREATE take an optional donor-decoding profile #1698). So the column set at this head is inferred. The Tier 2 preflight has not run on this head or on a candidate head; it is the planned check before the measurement run, and it compares its CREATE inventory with the fixture. One later local measurement supports the inference: on 2026-11-20 a CREATE probe on the real donor, at an unpublished local integration of this branch (at 358e9432a8) with Let transport CREATE take an optional donor-decoding profile #1698 and Let an entitlement document place its cell-diagnostics checkpoint #1699 and with New Zealand's donor profile selected, returned these 26 columns in the same order with the same dtypes, plus the three gap columns.
  • Duties for the donor-staging work. Refresh the fixture and its provenance, empty _AWAITING_DONOR_STAGING, and invert or delete test_nz_refuses_the_real_inventory_alone_at_graph_compile, which fails once the gap is empty.

Tests

Run locally, serially, one file at a time:

  • frame: test_group_encode.py 82 passed; test_concept_mapping.py 287; test_axiom_concept_mapping.py 15.
  • build: test_nz_money_normalization.py 66; test_nz_transport_declarations.py 76 passed, 2 skipped; test_nz_spec_package.py 1208; test_transport_evidence_kernels.py 165 passed before the roster pin moved from 11 to 10 normalized columns, then TestSupportRoster 19 passed; test_transport_entitlement_graph.py 80; test_transport_composed_graph.py 472; test_nz_transport_toy_graph.py 45; test_nz_as_bridge.py 34; test_spec_engine_country_bundles.py 22; test_transport_gate_bindings.py 131; test_be_money_normalization.py 34 passed, 17 skipped; test_spec_only_country_packages.py 37; test_country_gates_manifest.py 8; and the other NZ transport files.
  • Generators: --check passes for build_nz_transport_graph.py, build_nz_entitlement_graph.py and build_nz_benefit_gross_up.py.
  • Local failures outside this change: test_us_package_loads and three [us] cases fail on a local engine-ABI mismatch (policyengine-us 1.764.6 installed against 2.2.1 locked). Main's CI passed at the base commit.
  • In-session reviews: a completeness check and a test-strength check (9 of 9 mutants killed), plus a critic pass.
  • Independent review, round 1 (at 358e9432a8): approve, with two P2s, both taken. The fixture test's docstring now states what it can detect, and this description states the hash rule and the downstream node keys exactly. Its "Needs Max" line cites the changelog and coverage-report text this merge puts on main; those are repository docs, and ruling d3058 already covers the interim owner-cost reading. Round 2 (at 0771c33b20): approve, both round-1 points closed, and three new P2s, all taken. The node-key list above now names the nodes whose declarations change: seven in the transport graph and 27 in the scenarios document, from a node-by-node comparison of both documents at the base and this head. The D4 paragraph says the Tier 2 check is still to run. Commit a4819b2470 pins the one dtype gap to Int64 in the inventory coverage test: with float64 in the fixture's place the old assertion passed and the new one fails. That commit follows the review, so CI is its check.

axiom: n/a: no rule or parameter changes; New Zealand's concept mapping changes which donor facts feed one existing rule input (owner payments read mortgage interest only), as described above

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits November 19, 2026 09:50
…int, pin the real CREATE inventory

Interim New Zealand data changes for one measurement run on the pinned
populace-us donor (ruling d3058, rule 1 and two run aids). No shared source
module changes and no kernel implementation hash moves.

- Rule 1: the pinned donor carries no mortgage principal, so both NZ money
  declarations route household.mortgage_principal pending, the Accommodation
  Supplement owner payments read annual mortgage interest x 1/52, and the
  concept mapping lists the principal concept as unmapped with its reason.
  Generated NZ resources drop the column.
- Checkpoint: NZ's entitlement declaration adds nz.gates.terminal, so a run
  keeps the terminal gate closure's manifest when export.prepare refuses.
- D4: the attempt-7 CREATE inventory on donor 48b9d479 becomes a test
  fixture, replacing the circular composition helper; three columns the
  donor staging will add are declared as an explicit gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The terminal gate closure also holds two evidence nodes the calibration
checkpoint already records, so name the six that no earlier checkpoint
records instead of calling them the closure's six.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 3 commits November 20, 2026 17:46
The test checks the fixture's payload digest, the donor's identity and
the CREATE kernel ref. Its docstring claimed any CREATE change would fail
it. A staging change under the same kernel ref passes, so the docstring
now says so and points to the provenance's refresh rule.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The coverage test named the column whose dtype differs from the concept
schema but not the dtype, so a fixture refresh that turned
household.reference_person_id into float64 would have passed. It now
compares the gap as a mapping and pins nullable Int64.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 20, 2026 22:17
@MaxGhenis
MaxGhenis merged commit b9e2972 into main Nov 20, 2026
12 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merge audit (NZ hub). Merged 2026-11-20 22:28 UTC at head a4819b2470 as squash commit b9e2972fa1. The commit's tree is identical to the head's, and its parent is main 2f45706fc2.

  • CI: 12 of 12 checks passed at a4819b2470 (run 44806590478), including both engine-free jobs.
  • Independent review: round 1 approved at 358e9432a8 with two P2s. Round 2 approved at 0771c33b20 with three P2s and no P0 or P1. All five are taken: four in this description and the fixture test's docstring, and one as the test pin in a4819b2470. That commit follows round 2, so CI is its only check.
  • Coordination: the Microcosm hub read this pull request against Let an entitlement document place its cell-diagnostics checkpoint #1699 and found no file or input they share, so it set no order between them. No Belgian file changes.
  • Still to run: the Tier 2 preflight on the real donor, which the description's D4 paragraph names as the check of the fixture's column set.

MaxGhenis added a commit that referenced this pull request Nov 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Nov 21, 2026
Brings in #1688, #1699, #1700, #1698 and #1703. None touches a file PR 3
changes, and none touches a pin file, so the interim C9 can read CI's
digests against a branch that contains the main CI merges with.

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