Repository navigation
Conversation
|
@hua7450 — a question about this draft. #9868 still reproduces on main (4c65c82, 2.72.3): with enhanced CPS 1.78.2, which supplies marital units but no Keeping the inferred spouse inside the head's marital unit, as this PR does, would fix it. The branch is from before #9617 (merged 2026-10-08) and needs the draft policyengine-core#600. Could you rebase it onto main, or split out the spouse restriction so it can land without the Core change? We will not open a parallel PR. 🤖 Posted by Claude Code |
|
Thanks, splitting makes sense. The spouse restriction doesn't need Core's provenance on its own: when a situation omits marital_units, Core puts everyone in one marital unit, so limiting the inferred spouse to the head's marital unit changes nothing there. It only takes effect when membership is supplied, as in enhanced CPS. I'll open a separate PR from main with just that check in the is_tax_unit_spouse fallback, alongside #9617's supplied-role branch, plus YAML cases for #9868. This PR stays a draft for filling in missing marital units, which does need policyengine-core#600. I'll merge main into it after the split lands. |
…into preserve-marital-unit-inputs # Conflicts: # policyengine_us/system.py # policyengine_us/variables/household/demographic/tax_unit/is_tax_unit_spouse.py # pyproject.toml # uv.lock
PolicyEngine/policyengine-core#600 now includes Core's main (3.34.0) and delegates the hook through reforms, so main's policyengine-us imports against it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When marital units are omitted, pair the two adults of a tax unit whose family has an explicit is_married input, so role-less couples marked married keep SSI couple treatment (DC OSSP Cases 2 and 5). Source-input snapshots now record which groups the caller supplied, so a reloaded simulation keeps inferred marital units as inferred and its tax spouse. Count NumPy and numeric true inputs, pair role inputs with overlapping periods, and leave malformed input to Core's validation. Move the new SSI cases to the end of their file, document the rules after the page introduction, and regenerate uv.lock with uv 0.13.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behavior
Fixes #9999 and addresses #9868. When a caller supplies separate marital units for a parent and adult child, the child no longer becomes an inferred tax-unit spouse. When a household omits marital units, an explicit head/spouse pair, or otherwise the two adults of a family with an explicit
is_marriedinput, forms one unit and other people get singleton units, so their SSI marital income is not pooled with the couple.is_tax_unit_head/is_tax_unit_spousepair whose true inputs overlap in period, or, without one, the two adults of a family whoseis_marriedinput is true when exactly two of its adults there are neither dependents nor separated. Conflicting dependent inputs or changing roles oris_marriedrequire explicit membership; separated people are left unpaired. Calculated tax roles never construct marriages, and ages only set a married family's children aside.Draft dependencies and scope
pyproject.tomlanduv.lock(generated with uv 0.13.4) so reviewers can run it. Replace the Git dependency with the released minimum, regenerate the lock with uv 0.13.4, and removeallow-direct-referencesbefore merge.filing_status_inputis added.is_marriedkeeps filing jointly but loses the SSI couple rate, spousal deeming and state couple rates. For example, a California parent with a disabled child sent without marital units no longer has the parent's earnings deemed to the child as a spouse's (child SSI 6,327 on main, 11,928 here, for 2026)._ssi_spouses.py,_medicaid_parents.py,_non_filer_household.py); they are left for a comment-only follow-up.Validation
The results below predate the latest round (main merge, Core 3.34.0 pin,
is_marriedpairing and snapshot provenance), which was not run locally; CI validates it. By code trace,dc_ossp.yamlCases 2 and 5, which mark a role-less couple married only throughfamilies.is_married, keep their couple rates through the new pairing.make formatandgit diff --checkpass.Policy calculations are tested in variable-named YAML files. The new Python module covers construction and dataset contracts unavailable to YAML, and runs in the existing Microsimulation job; no runner or parallel heavy process is added. Local macOS timing including imports, using the existing six dataset-copy tests as a control: 10.81 seconds / 925,057,024 bytes peak RSS before adding the nine new tests, 11.07 seconds / 841,220,096 bytes after. The lower RSS is run-to-run variation, not a claimed memory improvement. Linux CI resource reports were not downloaded; these small-fixture measurements do not certify the full runner's peak.
axiom: n/a: supplied relationship preservation and simulation entity construction, not a change to a legal provision.