Skip to content

Medicaid MAGI household composition from co-resident parent ids (fixes #9404) - #9406

Draft
MaxGhenis wants to merge 4 commits into
mainfrom
medicaid-magi-parent-ids
Draft

Medicaid MAGI household composition from co-resident parent ids (fixes #9404)#9406
MaxGhenis wants to merge 4 commits into
mainfrom
medicaid-magi-parent-ids

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Fixes policyengine-us#9404.

Use optional parent_1_id and parent_2_id person inputs to identify co-resident parents and siblings for Medicaid MAGI household rules. The three-generation Ohio 2026 regression now gives the 30-year-old's four children a five-person household with $23,334 income and the 27-year-old's child a two-person household with $24,010 income. Those five children qualify for Medicaid; the 17- and 16-year-olds use the 56-year-old's three-person tax household with $94,504 income and remain ineligible. All seven use tax-filer household rules.

Fallback contract: when every parent ID in a household is zero, outputs remain bit-identical to the existing model. The zero-ID regression retains size 10 and income $141,848 for all seven children. Medicaid formulas fall back per person when both IDs are zero; parent status switches to links only in households containing a nonzero parent ID. Breastfeeding still independently identifies mothers.

Outputs change only once a dataset or situation supplies parent IDs, including the planned Microcosm export in microcosm#884. Parent pointers use person_id, with zero reserved for unknown; they resolve only within actual household membership. Both-parent exceptions require two distinct resolving parents who are not the head and spouse of one joint-filing tax unit. Non-filer child households count self, co-resident parents, and child-age siblings once each, including half siblings.

Validation (all final commands exited 0):

  • .venv/bin/policyengine-core test policyengine_us/tests/policy/baseline/gov/hhs/medicaid policyengine_us/tests/policy/baseline/gov/hhs/chip policyengine_us/tests/policy/baseline/household/demographic -c policyengine_us: 792 passed, covering all 128 YAML files plus the demographic Python file.
  • .venv/bin/pytest policyengine_us/tests/core/test_parent_links.py -q: 2 passed; interleaved linked/unlinked households, repeated IDs across households, and exact zero/omitted-input equality.
  • .venv/bin/pytest policyengine_us/tests/policy/baseline/household/demographic/geographic/test_three_digit_zip_code.py -q: 9 passed.
  • Offline differential audit: 110 arrays across eleven zero-ID fixtures byte-identical to original formulas at 1ca1d4eec, including decimal incomes.
  • Ruff formatting and lint passed. The original income suite passed 38 tests, new fixtures reproduced the bug before changes, and the focused suites passed 100 tests. Checkpoint logs and the audit script are retained locally with REPORT.md for dispatcher review.

No parameter YAML, partner contract, model version, data-release pin, or medicaid_person_is_required_to_file changes. The offline lane reconstructed the issue fixture from the assignment; original issue text was unavailable. Local commits are ready for the dispatcher to push and open as a draft.

Dispatcher note. Implemented by an Astra lane working offline in a pre-provisioned clone; reviewed and pushed by the dispatching session. The three-generation YAML fixture is a stylized reconstruction of Microcosm Build P household 1009324 (the 56-year-old's income is set to the $94,504 residual that reproduces the pre-fix $141,848 pooled household income; child ages are placeholders), not the record itself. The data-side export that will populate the new ids is microcosm#884. Companion disclosure in the paper: obbba-paper#2.

🤖 Generated with Claude Code

MaxGhenis and others added 4 commits September 7, 2026 16:50
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e21799b) to head (e1849f2).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #9406    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            3        10     +7     
  Lines           33       187   +154     
  Branches         0         5     +5     
==========================================
+ Hits            33       187   +154     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Medicaid MAGI household: 'living with both parents' proxy pools grandparent income in multigenerational households

1 participant