Skip to content

Refuse correspondence entities in the group kernels, and pin #1480's review follow-ups - #1518

Merged
MaxGhenis merged 6 commits into
mainfrom
be/s2b-p3-followup
Nov 9, 2026
Merged

MaxGhenis merged 6 commits into
mainfrom
be/s2b-p3-followup

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

  1. e1e90dcc pins the type-only default clashes. test_person_and_child_type_only_defaults_conflict runs 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's isinstance_types mutant survived 72 of its 100 seeded runs.
  2. eafaad73 tests the group kernels' person_role refusal against every role in the mapping. test_group_kernels_refuse_a_person_role_entity now adds a closure-only Child module (xx/child_defaults.yaml) and a second person_role entity, Dependant, so a guard that reads only the selected modules, or names Child alone, fails it. test_without_person_role_defaults_encoding_matches_the_old_gather takes the second entity too and still checks what its name says: with no person_role default in the closure, the kernel writes exactly the columns and values of the old gather, which ignored person_role entities.
  3. 2ec2c55f makes both group kernels (concepts.encode_groups@1 and transport.scenario_override@1, through _group_inputs in transport/column_kernels.py) refuse an engine_entity that the mapping's entity correspondence names (Person and Household). concepts.encode@1 writes those entities' inputs on their own tables, so a group kernel would write them again on built units. test_group_kernels_refuse_a_correspondence_entity covers both kernels and both entities.
  4. 1ce20fde takes up this PR's review. test_person_role_bindings_and_defaults_go_on_the_person_table also selects Dependant's module and owns its binding and its default, so concepts.encode@1 must gather every role entity's defaults. test_group_kernels_refuse_a_correspondence_entity also runs on a mapping whose correspondence names Individual and Residence, 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_role entity and every entity the mapping's correspondence names.

Mutants [the independent review executed these on scratch copies, one whole-file run each]:

Mutant Head What fails
values_only (the type check dropped) e8e65896 all 8 type-only cases and the merge property
isinstance_types e8e65896 the 2 cases where an int comes before an equal bool
guard_selected_paths e8e65896 test_group_kernels_refuse_a_person_role_entity
guard_hardcoded_child e8e65896 test_group_kernels_refuse_a_person_role_entity
encode_hardcoded_child 1ce20fde test_person_role_bindings_and_defaults_go_on_the_person_table
encode_first_role_only 1ce20fde test_person_role_bindings_and_defaults_go_on_the_person_table
corr_hardcoded_names 1ce20fde the 4 other-names cases of test_group_kernels_refuse_a_correspondence_entity
The correspondence guard removed 1ce20fde all 8 cases of that test

Restricted to the type-only test and the merge property, values_only fails all 8 type-only cases and isinstance_types fails the same 2 on each of seeds 1 to 10. The unmutated column file passes 52 at 1ce20fde, 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 with engine_entity Family: 8 concepts.encode_groups@1 and 3 transport.scenario_override@1 in NZ's scenarios.json, and 1 concepts.encode_groups@1 in NZ's transport_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 copies nz.as.inputs, and the composed-graph test support) also pass Family. So the new guard refuses no node that NZ or the toy graphs build.

Reach

From main 3db65154 to 1ce20fde, 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@1 and transport.unit_attributes@1 [executed]. The three simulate.* 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 main 3db65154) [executed]. 1ce20fde differs from it only in the module docstring and the column test.

File Passed Skipped
test_transport_column_kernels.py 48 0
test_transport_population_kernels.py 38 0
test_transport_declared_units.py 18 0
test_transport_graph.py 15 0
test_transport_holdout_separation.py 51 0
test_group_encode.py 82 0
test_concept_mapping.py 266 0
test_nz_transport_declarations.py 60 2
test_nz_transport_toy_graph.py 40 0
test_nz_money_normalization.py 56 0
test_nz_reference_aging.py 7 18
test_transport_evidence_kernels.py 156 0
test_transport_composed_graph.py 469 0
test_nz_spec_package.py, in a scratch git repository 1,203 0

Every skip waits on NZ_CHRONICLE_ARTIFACT, which the local run leaves unset.

Review and clearance

  • An independent Opus 5.5 agent reviewed the change, because the operator had held every Codex review lane. It approved e8e65896 with three optional findings, which 1ce20fde takes up, and approved 1ce20fde after a delta review.
  • The NZ hub cleared 1ce20fde: the guard refuses none of NZ's 12 group-kernel nodes, which all name Family.

Checklist

  • Local runs on the merge with main.
  • Reach: the kernel hashes this moves, and the US primary-QRF worker identity.
  • An independent review.
  • The NZ hub's clearance.
  • CI at 1ce20fde: all 11 checks passed.

🤖 Generated with Claude Code

MaxGhenis and others added 6 commits November 4, 2026 15:31
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 in #1482 and the rest of main since 6448792, so CI tests these
commits on top of #1482. Main has changed neither of this branch's files
since 6448792, and git merges without conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
MaxGhenis marked this pull request as ready for review November 9, 2026 11:57
@MaxGhenis
MaxGhenis merged commit f28ce75 into main Nov 9, 2026
11 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Landed by squash as f28ce75f, at head 1ce20fde, on parent 3db65154, with the head's tree (24c5138a).

  • CI: all 11 checks passed at 1ce20fde.
  • Review: an independent Opus 5.5 agent approved e8e65896 with three optional findings, which 1ce20fde takes up. It then approved 1ce20fde after a delta review, with no P1 or P2. The review fell to Opus because the operator had held every Codex lane.
  • NZ hub: cleared 1ce20fde on condition that CI passed and the verdict held at the landed head. Both did.
  • Main: stayed at 3db65154, the commit this head merges, up to the landing.

@MaxGhenis
MaxGhenis deleted the be/s2b-p3-followup branch November 9, 2026 11:58
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>
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