Repository navigation
Add NZ reporting classifiers: income deciles and receipt groups (G8-p) - #1234
Merged
Merged
Conversation
Implement weighted income cells, strict assigned receipt groups, and typed baseline mappings carried into scenario branches by stable unit ID. Declare NZ A1/A2 parameters, shared MC11 predicate and expected structural zeros; keep unresolved gross payment and Veterans Pension inputs fail-closed. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The as_rate_bridge, gates and country_package resource hashes move, the new reporting_classifiers resource is added, and the fingerprint changes; each hash equals sha256 of the committed file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ance Merge origin/main while preserving reporting admissions and cell-contract validation. Use exact dyadic integer midpoint ranks, cover large populations against a Fraction oracle, and document distinct clone reporting units. Archive A1/A2 methods with local provenance anchors and regenerate the NZ golden. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/microcosm-build/tests/golden/nz_country_spec.json
The A2 method note now cites the pinned axiom-corpus release, path and sha256 of the SSR 2018 PCO XML it was read from. The MC11 predicate citation in as_rate_bridge.json points to the in-repo method note instead of a local absolute path, and the tie-key evidence names build_benefit_units rather than stale line numbers. NZ golden regenerated for the two resource hashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 13, 2026 08:04
…w test The expected legacy_json set in test_nz_generation_zero_views_come_from_ the_country_spec_seam predates the new nz/reporting_classifiers.json resource (the same gap CI found for #1249's chronicle_feed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The golden now pins both chronicle_feed.json (from #1249) and reporting_classifiers.json (this PR); every other resource hash equals one side of the merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merged by the NZ hub (session local_e407a527) at e4753f7 with --squash. Gates: |
juaristi22
added a commit
that referenced
this pull request
Oct 17, 2026
The drafter's free-text rule (1307-02) treated any #N or word#N as an issue reference, so it accepted text that numbers a record or a cell: "household #4521 carries weight #312", "record #1234 decides the cell", "#7 rows against the #50-row floor". It took any four-two-two digit group for a date ("household 1234-05-06"), and its percent check missed the full-width sign ("#25" followed by U+FF05). Meanwhile it refused the repository's usual citations: issue-comment anchors and full GitHub URLs. The --approved-by check accepted login-shaped figures such as "4521" and "rows-7-of-50". figure_free now strips only the citations it can tell from a figure: microcosm#N, chronicle#N, uk-data#N and PolicyEngine/<repo>#N, each optionally anchored #issuecomment-N, with nothing running into the reference from the left; GitHub URLs of a PolicyEngine issue or pull request, optionally anchored the same way; and ISO dates of real days in 2000-2099. Any digit left, a bare #N included, refuses the text, as does a percent sign in any form NFKC folds into "%" and the Arabic, per-mille and per-ten-thousand signs. A comment cited as "issue comment N" stays refused; its anchor form passes. --approved-by must also start with a letter and hold at most one run of digits, within GitHub's login shape, so ordinary logins such as juaristi22 pass. The review's probes and the accepted citation forms are parametrized tests, beside numbers that stay refused because the rule cannot tell them from a figure (K=15, a plan code, a bare year). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the NZ reporting classifiers the graph reports by: income decile (A1) and receipt group (A2), carried from the baseline into every scenario branch by stable unit id. This is package G8-p of #1183. The production graph wiring is G8-w; here only toy graphs wire complete branches.
What it adds
Shared, country-neutral code:
microcosm/frame/reporting.py::63);:280);:370);:391).build/transport/reporting_kernels.py::195), typed baseline carry (:247) and a receipt producer (:290);:152);platform_bitwise(:175).artifact_types.py:40adds the nominal income-cells type;registry.py:384registers the producers;entitlement.py:68admits declarative reporting nodes.NZ spec,
build/nz/reporting_classifiers.json::6).:139).:169).:312).as_rate_bridge.json:422(MC11) now references this resource's single superannuitant predicate.gates.json:235lists the S0–S4 superannuitant structural zeros in the cell-support notes; the resource also has machine-readable rows.country_package.json:101registers the resource.Open items (fail closed, disclosed)
reporting_classifiers.json:203). G8-w or the engine path must supply them before activation.:190);Invariants (Hypothesis and example tests)
test_transport_reporting_kernels.py:267).:485).Tests
Hub re-run at this head, one file per run:
ruff check,tools/ci_test_plan.py verifyandgit diff --checkpass.Mutants (each failing a named test, with a passing control):
test_exact_weighted_midpoint_boundaries_and_uneven_weights;test_boundary_ties_split_by_stable_unit_id;Mutant logs are in the lane report.
The NZ golden country spec is regenerated (bced1c2). Only the
as_rate_bridge,gatesandcountry_packagehashes move, the newreporting_classifiersresource is added, and the fingerprint changes; each hash equals its committed file.How it was built
docs/nz-reporting-classifiers-method.mdholds the A1/A2 method basis and the SSR 2018 reg 17/18 reading, and each provenance entry inreporting_classifiers.jsonanchors to it.Review
eps × n_bins × 4snap.left = tile([78, 46, 37], 104),weights = [left, 80, left]. Unit 312's exact midpoint is ½, so cell 6, but scaling every weight by 0.1 moved it to cell 5. It also found 14 boundary and 2 scaling failures in larger symmetric populations.fractions.Fractionoracle differential;ruff check, the CI plan and diff-check pass.nz-rulespec-2026-07-25, path and sha2565f1250b9…);as_rate_bridge.jsonpoints to the in-repo note instead of a local path;build_benefit_unitsinstead of stale line numbers;reporting_classifiers.jsonto the generation-zero expected resource set (CI's engine-free job failed without it).chronicle_feed.json) and regenerates the golden. Every resource hash equals one merge side's; onlycountry_package.json(edited on both sides) and the fingerprint are new.country_package.jsonis the exact union of both merge parents. The golden recomputes byte-equal (4,645 bytes), with all 24 resource hashes current.ruff check, the CI plan and diff-check pass.origin/main(9a17ccac):.axiom/corpus-locks/nz/regulation/2026-06-16-rulespec-nz-pco.jsonrecords the cited path with sha2565f1250b9…85d8fand size 1,272,548. The local corpus file hashes to the same value.manifests/releases/nz-rulespec-2026-07-25.jsonincludes that regulation scope.🤖 Generated with Claude Code