Repository navigation
Conversation
relationship_inputs now sets is_unmarried_partner_of_household_head where PERRP is 43, 44, 46 or 47, the retired derivation (archived cps.py lines 1214-1221). The #720 Census person-column restore appends PERRP to every pooled vintage from its pinned member; no pinned H5 carries it. The stage refuses a missing or out-of-domain PERRP, reference-person codes 40/41 off the P_SEQ == 1 row, and two partners in one household, and its gate keeps the weighted partner share in 1-5%. ACS multispine rows map PUMS RELSHIPP 22/24 natively, so the flag is not a QRF transfer target. The flag leaves the eCPS parity known-gap register and becomes a required release input. Pool, engine ABI, spec bundle and F0 pins are re-derived by their repo tools; the coverage manifest is regenerated. Refs #38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The relationship gate's new unmarried-partner share band moves the us_base and us_national gates-manifest, policy and spec-fingerprint digests in test_us_battery_bindings.py; us_pool and us_local are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The partner flag's native ACS provision moves the pool's remaining-stage input manifest digest (3bd50a8d... to a3a76a5f...). The engine ABI lock test pins it, and the charter-H3 post-transfer parity fixture carries it as a graph parameter; the fixture is regenerated with tools/graph_us_post_transfer_fixture.py, and its expected cells do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Repin the projection-provision Counter in test_us_multispine_pool.py (assembled-native 7 -> 8, declared-absent 1165 -> 1164). The module constant moved in the first commit; this test skips in CI without the policyengine-us extra, so CI could not see the stale literal. - ACS local lane: build_optional_acs_multispine withholds the ACS RELSHIPP partner flag when the base lacks the column, as it already does for the SPM role. A base built before #38 then leaves the flag off both spines, as before, instead of half null rows that the reviewed-fill gate refuses only after every fit. The provenance records it under withheld_native_inputs; tests cover both arms. - Export US_UNMARRIED_PARTNER_FLAG from relationship_inputs. - Narrow the relationship_inputs docstring: the P_SEQ check catches a mis-join only where it moves a 40 or 41; the restore's identity checks guard the rest. - Changelog and docs: the reference-person refusal runs both ways; older --base-h5 bases are refused where the stage runs (PUF support-base builder, national release); the local lane withholds instead. - Add the partner flag to the pool dtype fixture's ACS arm, name partner inputs in the release telemetry label, and correct the A_EXPRRP test comment. Every repo pin tool reports current after these edits. Refs #38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build_optional_acs_multispine checked the mapped frame's person columns to decide whether to withhold the ACS partner flag. Three existing tests stub the mapped frame with a bare object, so the check raised AttributeError. Check the native-mapping receipt instead: the flag is there exactly when map_acs_native_inputs produced it, and the frame is touched only when it must be dropped. Refs #38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- _without_person_column now uses Frame.replace_tables, so withholding the flag no longer deep-copies the full ACS spine twice. - COVERAGE_PROGRESS: the partner-flag row said every pre-#38 frame is refused; it now names where (raw stage, PUF support-base builder, national release) and the local lane's withholding. - Changelog and docs: the national release refuses an older base either way (the stage on a generic base, the relationship gate on a stacked pool), and that includes its default base, the published national build. Refs #38 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- P1 #1 (tools/build_us_multispine_pool.py): invalidate pre-#38 assembled/transferred/simulated checkpoints carrying is_household_head without is_unmarried_partner_of_household_head while keeping pre-operator assembled checkpoints valid; add regression test in test_us_multispine_pool_tool.py. - P1 #2 (asec_checkpoint.py): bump ASEC_RAW_STAGE_SCHEMA_VERSION to 4, require PERRP in _RAW_STAGE_REQUIRED_PERSON_COLUMNS, and validate complete integers in 40..59; update test_us_asec_checkpoint.py. - P2 #3 (relationship_inputs.py, acs_multispine.py): reject nulls and non-Boolean values in _relationship_surface_carries_signal, us_relationship_inputs_summary, and us_relationship_inputs_signal_gate; fail closed on incomplete or non-Boolean donor is_unmarried_partner_of_household_head before ACS pooling/transfer; add regression tests in test_us_relationship_inputs.py and test_us_acs_multispine.py. - P2 #4 (multispine_pool.py): move is_unmarried_partner_of_household_head to _POOL_PRE_CLONE_NATIVE_COMPLETE_OUTPUTS (available_by='pre_clone_enriched', provision='pre_clone_source_and_acs_native_engine_input'), keeping it excluded from QRF transfer targets and accurately reflecting prepare_multispine_source_inputs_for_clone; regenerate engine_abi.lock.json, H3 fixture, US bundle, release input coverage manifest, and spec-engine coverage pins via repo tools, and update pool/ABI contract tests. - P2 #5 (tools/_legacy/build_us_acs_multispine_base.py, tools/build_us_acs_local_release.py, changelog.d/38-us-unmarried-partner-perrp.added.md): disclose withheld_native_inputs in staging/package reviewed_limitations (naming spm_unit_head_spouse_earned_cap and engine default False across both spines) and in us_source_coverage.json; qualify changelog base/national refusals vs ACS local withholding; add regression tests. - P2 #6 (relationship_inputs.py): allow head_count == 0 only on source-verified ACS group-quarters households (RELSHIPP in {37, 38} sole person, A_EXPRRP == 14, TYPEHUGQ in {2, 3}, person_spine == 'acs_2024_1yr', null PERIDNUM where present) while requiring partner_count == 0 on them and rejecting unverified zero-head units; add regression tests. - P3 #7 (docs/us-asec-census-person-columns.md): separate member observation counts from the production PERIDNUM join. - Verified repin_us_pool_engine_contracts.py --check, repin_us_spec_engine_contracts.py --check, generate_us_bundle_from_constants.py --check, spec_engine_coverage.py --check (51018/51018, 41/41), ci_test_plan.py verify, ruff check ., and targeted US build/graph tests.
- Route verified ACS group-quarters channel checks through support_gate_source_channel_series instead of reading person_spine directly and pin relationship_inputs._verified_acs_group_quarters_households in test_us_spine_blindness.py. - Add PERRP [40, 43, 41] aligned with P_SEQ to _raw_asec_frame in test_us_puf_support_base_builder.py and assert survival on raw reloads. - Validate completeness and Boolean types before aggregating shares or household counts in relationship_inputs.py so nullable Int64 / non-Boolean outputs fail closed via GateResult rather than raising TypeError, with a regression test. - Separate schema-v4 raw refusal, stale multispine pool recomputation, and ACS local False fallback across changelog and docs.
|
Agent comment: Addressed round-2 review (
Verified locally on |
- Iterate non-null values in Python in relationship_inputs._has_non_boolean_values and acs_multispine.build_optional_acs_multispine so Categorical columns with non-Boolean entries and pd.NA fail closed via GateResult / ValueError rather than raising TypeError from .map().all(). - Add categorical regression cases to test_us_relationship_inputs.py and test_us_acs_multispine.py.
|
Agent comment: Scoped round-3 review ( Fixed the remaining non-blocking findings at
Verified locally on |
|
Merged
Keeping draft while GitHub Actions CI runs on |
|
Ready — merge held by repository ruleset
|
Refs #38.
The US build now sets
is_unmarried_partner_of_household_headfrom CensusPERRP. Until now it sat in the eCPS parity known-gap register as a reviewed source-unavailability exclusion. The pinned Census person members carryPERRPfor every pooled year, so the gap no longer holds. Max ruled to build it on 2026-12-01 (d1099).What this changes
ASEC_CENSUS_PERSON_COLUMNSgainsPERRP(domain 40-59). The Pooled ASEC 2022/2023 vintages lack the NOW_* coverage recodes: reported Medicaid at interview thins to 24.6M vs ~58M survey under 65 on the certified artifact #720 restore appends it to every pooled vintage by exactPERIDNUMjoin from that vintage's pinned Census member. No pinned H5 carriesPERRP, the 2025 file included.relationship_inputssets the flag wherePERRPis 43, 44, 46 or 47. Those are opposite-sex and same-sex unmarried partners of the reference person, with and without relatives. This is the retired derivation (archived commit42ed5d45c56df80d754fbe24cce21cfeb8d05cbe,datasets/cps/cps.pylines 1214-1221; codes at lines 188-195). The stage refuses a frame in four cases:PERRPis missing. The archive read a missing column as all-False; this stage never reads absence as "no partner".P_SEQ == 1row disagree, either way.relationship_inputsreuse check (_relationship_surface_carries_signal) requires all four output columns to be complete strict Booleans with >1 distinct value. The signal gate (us_relationship_inputs_signal_gateandgates.json, base and national) enforces the weighted partner-share band (1-5%), fails closed on null or non-Boolean output columns (including nullableInt64and non-Booleancategorydtypes) before computing shares or household counts, and fails heads marked as partners or households with multiple partners. On assembled multispine frames,us_relationship_inputs_signal_gateallowshead_count == 0strictly for source-verified ACS group-quarters households (RELSHIPP in {37, 38}sole person,person_support_channel == "acs"viasupport_gate_source_channel_serieson assembled support metadata, plusA_EXPRRP == 14,TYPEHUGQ in {2, 3}, and nullPERIDNUMchecked when those columns are present) while requiring zero partners on them and rejecting unverified zero-head households.RELSHIPP22 and 24 (opposite-sex and same-sex unmarried partner) to the flag natively at assembly, just asRELSHIPP20 maps tois_household_head. Because ASEC rows receiveis_unmarried_partner_of_household_headduring pre-clone enrichment (prepare_multispine_source_inputs_for_clone), the flag belongs tomultispine_pool._POOL_PRE_CLONE_NATIVE_COMPLETE_OUTPUTS(available_by="pre_clone_enriched",provision="pre_clone_source_and_acs_native_engine_input") alongside_ACS_NATIVE_INPUT_CONTRACTSand remains excluded from QRF transfer targets.relationship_inputs, and existing pre-Populate remaining US tax-input and reported-observation layers #38 donor bases omit the flag.build_optional_acs_multispinekeeps the ACS spine's flag only when the base carries a complete strict Boolean column (failing closed on nulls or non-Boolean dtypes including nullableInt64andcategory), and otherwise withholds the input across both spines while recordingwithheld_native_inputsinus_source_coverage.jsonand packagedreviewed_limitations(notingspm_unit_head_spouse_earned_capusesFalsewhen the input is withheld).required(171 required, 5 reviewed exclusions).RESTORED_REFERENCE_ECPS_REQUIRED_INPUTSand the export's required person columns pick it up throughUS_RELATIONSHIP_INPUTS_OUTPUT_COLUMNS.financial_assistanceandsurvivor_benefits, keep their exclusions.PECOHAB,A_FAMRELandA_FAMTYPstay unrestored: the flag readsPERRPalone.Evidence
Codebook. The Census API codebooks for survey years 2023-2026 give the same 20 codes, 40-59. The four files below are byte-identical (sha256 prefix
2607bf8e03173a29), fetched 2026-12-02 01:32Z.The ACS 2024 PUMS data dictionary (
PUMS_Data_Dictionary_2024.csv, fetched 2026-12-02 01:32Z) givesRELSHIPP22 "Opposite-sex unmarried partner" and 24 "Same-sex unmarried partner". It gives 21 and 23 as spouses and 34 as a roommate or housemate.Pinned members. Each archive and member matched its pin in
education_assistance_source.py. Shares are weighted byMARSUPWT.PERRPnullsP_SEQ == 1)pppub23.csvpppub24.csvpppub25.csvpppub26.csvThe 40/41 counts equal the Build J head counts the old scenario test pinned for 2022-2024.
A_EXPRRPis no substitute. In all four members its code 13 holdsPERRP44, 47 and 55, so partners mix with housemates. Its code 12 holdsPERRP43, 46, 54, 56 and 58.Engine. policyengine-us 2.145.3 defines the flag as a yearly person boolean input. Its one consumer is
spm_unit_head_spouse_earned_cap. The scenario test now checks that the flag binds there: with no spouse, a reference person earning $40,000 and a partner earning $2,500 give a cap of $2,500 with the flag and $40,000 without it.What a release needs
asecpub24/25/26archives (tools/build_us_puf_support_base.py --stage all --asec-education-source ...), so the restore runs on every build. A Route A build at a commit that includes this PR carries the flag.12693b9db03dand has noPERRP. This is inferred from the driver at that commit and the release id; the run's own records were not read.--base-h5, resumed pool checkpoints, and ACS local simulations have distinct behaviour on pre-Populate remaining US tax-input and reported-observation layers #38 artifacts:asec_checkpoint.py) fails closed at load.ASEC_RAW_STAGE_SCHEMA_VERSIONbumps from3to4and_RAW_STAGE_REQUIRED_PERSON_COLUMNSgainsPERRP(complete integers in40..59), so the schema-v4 raw loader rejectssources.yaml's pre-Populate remaining US tax-input and reported-observation layers #38asec_raw_stagepin (51e9fafc…,_CANONICAL_INPUT_PIN_BUILD_ID = "populace-us-2024-pool-inc2-run7"intools/us_bundle_generation/core.py) before enrichment.build_us_multispine_poolaccepts a local schema-v4 raw checkpoint and SHA via--asec-raw-stage-h5/--asec-raw-stage-sha256; updating the canonicalsources.yamlpin requires rebuilding a replacement schema-v4 checkpoint and recording its build receipt (any external release of a record-level checkpoint remains subject to Max's data-rule decision and is not done here).--base-h5bases built pre-Populate remaining US tax-input and reported-observation layers #38 fail closed. The PUF support-base builder rerunsrelationship_inputsand fails; the national release (including its default_download_base_h5()releases.jsonpublished national build until rebuilt) fails either inrelationship_inputs(generic base) or inus_relationship_inputs_signal_gate(stacked-pool base).build_us_multispine_pool._checkpoint_missing_person_outputsignores pre-Populate remaining US tax-input and reported-observation layers #38assembled,transferred, andsimulatedcheckpoints carryingis_household_headwithoutis_unmarried_partner_of_household_headand recomputes those stages from scratch (keeping pre-operatorassembledcheckpoints valid).False. On pre-Populate remaining US tax-input and reported-observation layers #38 donor bases withoutis_unmarried_partner_of_household_head, ACS local staging recordswithheld_native_inputsinus_source_coverage.jsonandreviewed_limitations, so ACS local simulations useFalsefor the missingis_unmarried_partner_of_household_headinput when calculatingspm_unit_head_spouse_earned_cap(a fresh base built from pinned sources carries the flag).US_RELEASE_REQUIRED_PERSON_SOURCE_COLUMNS), release coverage and parity all require the flag.Pins moved
tools/repin_us_pool_engine_contracts.py:POOL_PROJECTION_INPUT_PROVISION_COUNTS:assembled_native_engine_input7,pre_clone_source_and_acs_native_engine_input1,declared_absent_engine_input1164.POOL_REMAINING_STAGE_INPUT_MANIFEST_SHA256:c80b538926234c292f8c995383c82fa164cabd830fb57f1da90b6c2421f64f1a.engine_abi.lock.json).tools/repin_us_spec_engine_contracts.py --legacy-only->tools/generate_us_bundle_from_constants.py->tools/repin_us_spec_engine_contracts.py->tools/spec_engine_coverage.py:source_stages.jsonSHA-256:5c022fb43bb6215af418ecdef4a6971ead2e8f202acbfa9b0b5d6bb1401d8173(test_us_bundle_core_contracts.py).spec_sha256:bde2a8b1ec35c25c043323a48d91f558d81b7a6fc2ac718dc0f7435c7415d94a.docs/evidence/spec-engine/us-f0-coverage.json):51018/51018configuration fields,41/41inventory checks;inventory_coverage.pypins (full_checkpointab1abc39…,late_resource_semantics14fefbef…,source_manifestbe558114…).tools/build_us_release_input_coverage_manifest.py:release_input_coverage_manifest.json(171required,5reviewed exclusions).tools/graph_us_post_transfer_fixture.py: H3 post-transfer fixture.test_support/ hand-pinned constants verified against tools:us_baseandus_nationalgate-scope digests inpackages/microcosm-build/tests/engine_free/us/test_us_battery_bindings.py(SCOPE_PINS).test_spec_engine_engine_abi.pyremaining-stage manifest digest (c80b5389…).test_us_multispine_pool.pyprovisionCounter(7assembled-native,1pre-clone-native,1164declared-absent) and pre-clone manifest check.Tests & local checks
test_us_relationship_inputs(engine_free+engine_scenario): partner/non-partnerPERRPcodes, missing/invalidPERRP,P_SEQ == 1disagreement, multi-partner households, support clones, completeness refusal onNone,int, nullableInt64(pd.NA), and non-Booleancategory([False, "invalid", pd.NA]) columns before share coercion, source-verified ACS group-quarters zero-head allowance (requiring assembledperson_support_channel == "acs"withRELSHIPP in {37, 38}, plus optional checks onA_EXPRRP == 14,TYPEHUGQ in {2, 3}, and nullPERIDNUMwhen present) vs zero-partner enforcement, and enginespm_unit_head_spouse_earned_capbinding.test_us_asec_checkpoint: raw-stage schemav4PERRPmissing/domain checks.test_us_acs_inputs,test_us_acs_multispine,test_us_acs_multispine_legacy_builder, &test_us_acs_local_release_tool:RELSHIPP22/24 native mapping, pre-Populate remaining US tax-input and reported-observation layers #38 donor withholding & staging/packaging disclosure inus_source_coverage.jsonandreviewed_limitations, and strict Boolean refusal (None,int, nullableInt64,category) on donor columns.test_us_multispine_pool&test_us_multispine_pool_tool: pre-clone boundary (pre_clone_enriched), stale pre-Populate remaining US tax-input and reported-observation layers #38 checkpoint invalidation, and preserved pre-operatorassembledresume.test_us_puf_support_base_builder:_raw_asec_framecarriesPERRP = [40, 43, 41]aligned withP_SEQacross dual-export and repair reloads.test_us_spine_blindness: pins_GATE_SOURCE_CHANNEL_CALLERS["relationship_inputs.py"] == frozenset({"_verified_acs_group_quarters_households"})and_GATE_SOURCE_SCOPE_HELPER_CALLERS[("relationship_inputs.py", "_verified_acs_group_quarters_households")] == frozenset({"us_relationship_inputs_summary"})with no directperson_spineread.origin/mainthroughe124f968(#1865,#1849,#1860; headsa4969921ba/8784917275):ruff check .,ci_test_plan.py verify,git diff --check,tools/repin_us_pool_engine_contracts.py --check,tools/repin_us_spec_engine_contracts.py --check,tools/generate_us_bundle_from_constants.py --check,tools/spec_engine_coverage.py --check(51018/51018fields,41/41checks ata4969921ba), and targeted pytest acrosstest_us_bundle_core_contracts.py,test_spec_engine_coverage_tool.py,test_us_multispine_pool_tool.py,test_spec_engine_field_usage.py,test_us_relationship_inputs.py(engine_free+engine_scenario),test_us_acs_multispine.py,test_us_spine_blindness.py,test_us_puf_support_base_builder.py,test_us_battery_bindings.py,test_us_acs_local_release_tool.py,test_us_fiscal_refresh_builder.py, andtest_us_base_subsample.py(3skipped in the#1849/#1860subsample/refresh suites).Review history
9f66a60757,review-r1bREQUEST_CHANGES): 2 P1 + 4 P2 + 1 P3 fixed in8f212f1a9calongside clean merge withorigin/main(134477a281).8f212f1a9c,20261203-090130-pr1844-review-r2REQUEST_CHANGES): 1 P1 + 1 P2 + 2 P3 +engine-freeCI spine-blindness failure fixed ine8f2f1ac82.e8f2f1ac82,20261203-093456-pr1844-review-r3): verdict lineREQUEST_CHANGES, levels0P0,0P1,1P2,2P3; Round-2 P1, P2, both P3s, and theengine-freeCI fix verified CLOSED (per review policy, levels decide and scoped closure completes review without opening a fourth round)..map(...).all()with Pythonany(not isinstance(value, (bool, np.bool_)) ...)inrelationship_inputs._has_non_boolean_valuesandacs_multispine.pysocategorycolumns with non-Boolean entries andpd.NAfail closed viaGateResult/ValueErrorinstead of raisingTypeError, with categorical regression tests added totest_us_relationship_inputs.pyandtest_us_acs_multispine.py.us_relationship_inputs_signal_gate, qualified optional GQ columns as checked when present, creditedtest_us_acs_local_release_tool.pyand named bothtest_us_spine_blindness.pycaller-allowlist entries, and separated local schema-v4 checkpoint CLI override from canonical pin receipt updates.🤖 Generated with Claude Code