Repository navigation
Refuse correspondence entities in the group kernels, and pin #1480's review follow-ups - #1518
Merged
Merged
Conversation
Cover a closure-only Child module and a second role entity so selected-path and hardcoded guards cannot allow duplicate unit inputs. Extend the old-gather comparison to retain its coverage without role defaults.
Keep Person and Household inputs on their correspondence tables instead of writing them again on built units. Cover both entities through encode_groups and scenario_override.
Brings the branch up to main so CI tests these commits on current code. Main has changed neither of this branch's two files since 6448792, and git merges without conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review of #1518 at e8e6589 found three optional gaps: - test_person_role_bindings_and_defaults_go_on_the_person_table now selects DEPENDANT_PATH and owns dependant_age and dependant_in_care, so a kernel that gathers only Child's defaults, or only the first role entity's, fails it. - test_group_kernels_refuse_a_correspondence_entity also runs on a mapping whose correspondence names Individual and Residence, so a guard that spells out Person and Household fails it. - column_kernels' module docstring names both group-kernel refusals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
November 9, 2026 11:57
Contributor
Author
|
Landed by squash as
|
DTrim99
added a commit
that referenced
this pull request
Nov 9, 2026
Main brings #1533/#1536/#1537 (UK build-folder switch and publication through the emitter), #1518 and #1549. No conflicts; none of the 46 files overlaps this branch. repin_us_spec_engine_contracts --check, generate_us_bundle_from_constants --check (spec_sha256 23366c65), spec_engine_coverage --check (42451/42451 fields, 41/41 checks) and repin_us_pool_engine_contracts --check are clean; the release input coverage manifest and the H3 parity fixture regenerate unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Three follow-ups to #1480 (S2b PR 2), from the three optional findings (P3s) in its approving review (#1480 (comment)), and the three optional findings of this PR's own review.
What it changes
e1e90dccpins the type-only default clashes.test_person_and_child_type_only_defaults_conflictruns each type-only pair (0/False,0/0.0,False/0.0,1/True) in both gather orders and expects the "conflicting defaults" refusal. Before, only the merge property caught a weakened type check, and only on runs that drew a clash on type alone: the review'sisinstance_typesmutant survived 72 of its 100 seeded runs.eafaad73tests the group kernels'person_rolerefusal against every role in the mapping.test_group_kernels_refuse_a_person_role_entitynow adds a closure-onlyChildmodule (xx/child_defaults.yaml) and a secondperson_roleentity,Dependant, so a guard that reads only the selected modules, or namesChildalone, fails it.test_without_person_role_defaults_encoding_matches_the_old_gathertakes the second entity too and still checks what its name says: with noperson_roledefault in the closure, the kernel writes exactly the columns and values of the old gather, which ignoredperson_roleentities.2ec2c55fmakes both group kernels (concepts.encode_groups@1andtransport.scenario_override@1, through_group_inputsintransport/column_kernels.py) refuse anengine_entitythat the mapping's entity correspondence names (PersonandHousehold).concepts.encode@1writes those entities' inputs on their own tables, so a group kernel would write them again on built units.test_group_kernels_refuse_a_correspondence_entitycovers both kernels and both entities.1ce20fdetakes up this PR's review.test_person_role_bindings_and_defaults_go_on_the_person_tablealso selectsDependant's module and owns its binding and its default, soconcepts.encode@1must gather every role entity's defaults.test_group_kernels_refuse_a_correspondence_entityalso runs on a mapping whose correspondence namesIndividualandResidence, so the guard must read the mapping's names. The module docstring names both group-kernel refusals.Invariant. For any mapping, each group kernel refuses every
person_roleentity and every entity the mapping's correspondence names.Mutants [the independent review executed these on scratch copies, one whole-file run each]:
values_only(the type check dropped)e8e65896isinstance_typese8e65896intcomes before an equalboolguard_selected_pathse8e65896test_group_kernels_refuse_a_person_role_entityguard_hardcoded_childe8e65896test_group_kernels_refuse_a_person_role_entityencode_hardcoded_child1ce20fdetest_person_role_bindings_and_defaults_go_on_the_person_tableencode_first_role_only1ce20fdetest_person_role_bindings_and_defaults_go_on_the_person_tablecorr_hardcoded_names1ce20fdeother-namescases oftest_group_kernels_refuse_a_correspondence_entity1ce20fdeRestricted to the type-only test and the merge property,
values_onlyfails all 8 type-only cases andisinstance_typesfails the same 2 on each of seeds 1 to 10. The unmutated column file passes 52 at1ce20fde, under a fixed seed and under pytest's random seed.What it refuses on main
On main
3db65154, 12 group-kernel nodes appear in the 674 tracked JSON files, all withengine_entityFamily: 8concepts.encode_groups@1and 3transport.scenario_override@1in NZ'sscenarios.json, and 1concepts.encode_groups@1in NZ'stransport_graph.json[executed]. NZ's correspondence maps{household: Household, person: Person}. The Python graph builders (tools/build_nz_transport_graph.py,tools/build_nz_entitlement_graph.py, which copiesnz.as.inputs, and the composed-graph test support) also passFamily. So the new guard refuses no node that NZ or the toy graphs build.Reach
From main
3db65154to1ce20fde, 6 of the 45 kernels in the composed toy registry move:calibration.prepare@1,concepts.encode@1,concepts.encode_groups@1,takeup.assign@1,transport.scenario_override@1andtransport.unit_attributes@1[executed]. The threesimulate.*keep their hashes, and the US primary-QRF worker identity stays byte-identical. A node on one of the six kernels gets a new node key, and so does each node that reads its outputs, so the next run of a graph recomputes them.Runs on the merge with main
One file per process on tree
be5f2f0b(e8e65896, which merges main3db65154) [executed].1ce20fdediffers from it only in the module docstring and the column test.test_transport_column_kernels.pytest_transport_population_kernels.pytest_transport_declared_units.pytest_transport_graph.pytest_transport_holdout_separation.pytest_group_encode.pytest_concept_mapping.pytest_nz_transport_declarations.pytest_nz_transport_toy_graph.pytest_nz_money_normalization.pytest_nz_reference_aging.pytest_transport_evidence_kernels.pytest_transport_composed_graph.pytest_nz_spec_package.py, in a scratch git repositoryEvery skip waits on
NZ_CHRONICLE_ARTIFACT, which the local run leaves unset.Review and clearance
e8e65896with three optional findings, which1ce20fdetakes up, and approved1ce20fdeafter a delta review.1ce20fde: the guard refuses none of NZ's 12 group-kernel nodes, which all nameFamily.Checklist
1ce20fde: all 11 checks passed.🤖 Generated with Claude Code