Skip to content

Count only the claimant and spouse in Michigan household resources (MI-1040CR lines 14-27, 30 and 31) - #9796

Merged
MaxGhenis merged 32 commits into
mainfrom
mi-household-resources-claimant-spouse
Oct 10, 2026
Merged

MaxGhenis merged 32 commits into
mainfrom
mi-household-resources-claimant-spouse

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Michigan total household resources (mi_household_resources, used by the homestead property tax credit and the home heating credit) summed every source over all tax unit members. So a dependent's own wages, interest, pensions and capital gains raised the claimant's household resources, and a dependent's Schedule 1 adjustments, such as the deduction for half of self-employment tax, lowered them. MCL 206.508(3) says "'Household' means a claimant and spouse". #9790 fixed this for lines 16 and 17. This PR goes line by line through the rest of the MI-1040CR: lines 14-27, 30 and 31.

Example (2025): a parent with wages of 40,000 and a 17-year-old dependent with 8,000 of wages, 200 of interest and 3,000 of Schedule C income. The model gave 47,988.06: 40,000 + 8,000 + 200, less the dependent's 211.94 self-employment tax deduction. The form gives 40,000.

Main merge and CI follow-up

Merged main at 30192579689d02dde1d04dd305b47e3aee73fa5f into the approved head abff6ae89c7b76b39eb134de059b5c97d686db55 with merge commit afaad539dd882fccae4ee5cf1ead3b53a945bc49. d1143 follow-up head: dd85603c7fc1d5d3e2d8ff431901e7d4e1167d5a. Current head: 08f20a99e95726c9c558047859366f399c136543, a references-only commit on top of it that cites the 2025 MI-1040CR-7 book (see "The law and the forms"). Main includes #9790, #9801, #9795 and #9855. This PR is second in the Michigan chain: #9795 → #9796 → #9840.

  • Line 30 keeps Keep federally excluded income in Michigan household resources (MI-1040CR line 30) #9795's gov.states.mi.tax.income.household_resources_adjustments, filtered to deductions still present in gov.irs.ald.deductions, and Count only the claimant and spouse in Michigan household resources (MI-1040CR lines 14-27, 30 and 31) #9796's tax_unit_non_dep_add claimant-and-spouse summation. The list includes educator_expense_ald, capped per eligible educator. Federal income exclusions stay in Michigan resources.
  • All 48 household-resources YAML cases are retained: 33 from the earlier main merge plus 15 from this PR. Expected values are unchanged. Arithmetic remains in the comments: educator expenses produce 50,000 − 300 = 49,700, including expenses above the cap; the mixed exclusion/adjustment case produces 53,000 − 3,300 − 1,200 = 48,500.
  • Use the filers' Schedule D for the tax on net capital gain #9855's filer Schedule D lines, distribution floors, tax-unit aggregate input support, federal capital-gain cases, and Vermont and Hawaii cases are retained. filer_loss_limited_net_capital_gains now reads the shared filer Schedule D line 16, which also feeds the Schedule D worksheet and routing. Michigan's line 19 and Form 1040 line 7a therefore apply their capital-loss limit to the same filer amount.
  • The dependent investment-income failure comes from float32 rounding when summing all members' capital gains and then subtracting the dependents' amounts. The helper compares net_capital_gains with the ordinary computed all-member aggregate at the aggregate's storage precision. When they match, line 16 uses the filers' short- and long-term components directly. When they differ, line 16 starts from the supplied aggregate, subtracts the dependents' long- and short-term gains separately, and adds the filers' distributions. Each filer's distributions are floored separately.
  • The supplied-aggregate convention remains unchanged: it represents all members' net gains before distributions. An aggregate equal to the ordinary computed value uses the direct filer components. A differing aggregate can make line 16 differ from component-derived lines 7 plus 15, so statutory net capital gain and the worksheet may differ for inconsistent aggregate/component inputs; the existing Use the filers' Schedule D for the tax on net capital gain #9855 behavior is preserved.

Michigan retirement invariant: intended exception (d1143)

Max ruled d1143 on 2026-10-09 to follow the form. MI-1040CR lines 18 and 21 (2025 booklet, PDF page 28 / printed page 32) count pensions only for the claimant and spouse, but include SSI received for dependent adults who live with them. A dependent adult's pension can therefore lower their SSI, reduce Michigan household resources, and increase the claimant's refundable heating credit. This is intended.

The retirement invariant now exempts Michigan only from the assertion that dependent retirement income never lowers net state income tax. Every other state's assertion remains strict. Michigan still must preserve claimant AGI, taxable income, pension benefits, subtractions and tax before refundable credits; units without dependent income must remain unchanged.

A paired 2025 YAML regression computes actual SSI for a dependent adult with zero or $2,400 of pension: SSI falls from $11,604 to $9,444 because $2,400 − 12 × $20 = $2,160 is countable unearned income. Household resources fall from $21,604 to $19,444. The standard heating allowance is $815 less 3.5% of household resources, producing $58.86 and $134.46. Applying the 2025 60% funding factor gives heating credits of $35.316 and $80.676, reducing net Michigan tax by $45.36 ($2,160 × 3.5% × 60%). Claimant AGI remains $10,000; pension benefit, subtractions, taxable income and tax before refundable credits remain zero.

The d1143 follow-up changes tests, not Michigan formulas. The PR remains draft.

Validation

Validation tree: dd85603c7fc1d5d3e2d8ff431901e7d4e1167d5a, following 27ffb3b8c2d20ccc9ab4889ba56598c34901fba1. The retirement and EITC invariants and the household-resources and homestead YAMLs passed on b09d151287e33eedf519305f811382c0aff25bd6. The subsequent correction changes only two inputs in the new home-heating fixture; those earlier test files and all model formulas are unchanged. The final home-heating and capital-gain results below refer to dd85603c7fc1d5d3e2d8ff431901e7d4e1167d5a. The requested matrix runs as single files in the foreground, one process at a time. Local validation uses Python 3.13.9 and policyengine-core 3.32.15.

Final matrix: 85 passed across six files.

Test group Cases Results
Dependent-retirement invariant 4 4 passed
Dependent EITC investment-income invariant 3 3 passed
Michigan household-resources YAML 48 48 passed
Michigan homestead credit YAML 2 2 passed
Michigan home-heating credit YAML 12, including the paired d1143 case 12 passed
Capital-gain YAML 16, including all 6 capital-gain regressions 16 passed

retirement: 35.05 s reported by pytest (1612.47 s wall); eitc: 1158.61 s reported by pytest (1756.53 s wall); resources: 155.20 s reported by pytest (2002.94 s wall); homestead: 51.95 s reported by pytest (1870.58 s wall); heating: 85.40 s reported by pytest (1729.76 s wall); capital: 39.14 s reported by pytest (877.77 s wall). Startup was slow under host load. The retirement timing helper could not read a sandbox-restricted system metric after pytest passed; subsequent commands use portable elapsed timing. Peak RSS is unavailable.

  • make format, Ruff formatting and lint, and git diff --cached --check: passed.
  • Existing expected outputs were preserved; partner contract tests were not edited.

The initial home-heating attempt had 11 passed and 1 failed: supplying zero SSI for the heads initialized the whole person input array to zero, bypassing the dependents' SSI formulas. The fixture now computes SSI with explicit take-up flags for all four people; its expected outputs are unchanged. The failed attempt is retained as diagnostic evidence.

08f20a99e9 changes only the reference tuple of mi_household_resources and one reference in household_resources_all_members.yaml. mi_household_resources.yaml passed 48 of 48 on it (policyengine-core 3.32.15). No folder or full-suite runs were done for these follow-ups. The microsimulation impact at the current head is in "Hub microsimulation impact (current head)" below.

The law and the forms

MCL 206.508 (https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-508): "(3) 'Household' means a claimant and spouse. (4) 'Total household resources' means all income received by all persons of a household in a tax year while members of a household, ..."

MCL 206.510(1) (https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-510): "'Income' means the sum of federal adjusted gross income ... plus all income specifically excluded or exempt ... Also, a person who is enrolled in an accident or health insurance plan may deduct from income the amount that person paid in premiums in the tax year for that insurance plan for the person's family."

2025 MI-1040 book (https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2025/MI-1040-Book.pdf):

  • Page 26: "Total household resources are the total income (taxable and nontaxable) of both spouses or of a single person maintaining a household."
  • Page 31, before line 14: "Include all taxable and nontaxable income you and your spouse received in 2025."
  • Page 32, lines 21, 22, 24, 27 and 30:
    • Line 21: "Enter all Social Security, Supplemental Security Income (SSI), and/or Railroad Retirement benefits. Include death benefits and amounts received for minor children or other dependent adults who live with you."
    • Line 22: "Enter child support and all payments received as a foster parent."
    • Line 24: "... This includes the amount of financial support you received if you are claimed as a dependent on someone else's return."
    • Line 27: "Enter the total payments made to your household by MDHHS and all other public assistance payments such as state adoption subsidies."
    • Line 30: "Enter total adjustments from your U.S. Form 1040, Schedule 1."
  • Pages 32-33, line 31: "Enter health insurance premiums, Health Maintenance Organization (HMO) premiums, or other insurance premiums you paid for yourself and your family."

The 2025 MI-1040CR-7 book (home heating credit) has the same text on whose income counts. michigan.gov has removed it (TY2025/MI-1040CR-7-Book.pdf returns 404), so the PR cites the Wayback Machine copy of 2026-02-18. It is byte-identical to the NBER TAXSIM mirror (sha256 f540a3dd…). Page 4 has "the total income (taxable and nontaxable) of both spouses or of a single person maintaining a household", and page 8 has "Include all taxable and nontaxable income you and your spouse received in 2025." Its resources are on lines 17-35, so MI-1040CR lines 21, 22, 24, 27 and 30 are CR-7 lines 24, 25, 27, 30 and 32 (page 9), with the same wording. The 2024 CR-7 book has the same text on lines 26, 27, 29, 32 and 34.

Line by line

MI-1040CR line PolicyEngine sources Whose amounts count Before
14 wages, strike pay, long-term disability irs_employment_income, strike_benefits, disability_benefits claimant and spouse all members
15 interest and dividends interest_income, dividend_income claimant and spouse all members
16 business income as #9790 claimant and spouse (#9790)
17 rents and royalties as #9790 claimant and spouse (#9790)
18 pensions and annuities pension_income, retirement_benefits_from_ss_exempt_employment claimant and spouse all members
19 capital gains, "from your U.S. Schedule D" filer_loss_limited_net_capital_gains (was loss_limited_net_capital_gains) claimant and spouse all members
20 alimony, other taxable income alimony_income, gambling_winnings claimant and spouse all members
21 Social Security, SSI, railroad retirement social_security, ssi, railroad_benefits every member: "amounts received for minor children or other dependent adults who live with you" unchanged
22 child support, foster parent payments child_support_received every member: child support is received for the children, whoever's record holds it unchanged
23 unemployment compensation unemployment_compensation claimant and spouse all members
24 gifts and support received miscellaneous_income claimant and spouse. The dependent sentence is about a claimant who is someone else's dependent, i.e. this tax unit's head all members
25 other nontaxable income gi_cash_assistance (guaranteed income pilot payments) claimant and spouse: nothing shows a pilot payment is public assistance paid to the household all members
26 workers' compensation, VA benefits veterans_benefits, workers_compensation claimant and spouse all members
27 MDHHS and other public assistance tanf, general_assistance every member: "payments made to your household". A FIP grant covers the children in the case, and tanf is an SPM-unit amount that reaches the tax unit in per-person shares, so counting only the head's share would drop the children's part of the grant unchanged
30 Schedule 1 adjustments gov.states.mi.tax.income.household_resources_adjustments, filtered by gov.irs.ald.deductions; includes capped educator_expense_ald claimant and spouse ("your U.S. Form 1040, Schedule 1"). The tax-unit totals are read as they are, so supplied amounts and reforms are kept; #9801 makes them leave dependents out all members
31 health insurance premiums health_insurance_premiums every member: "for yourself and your family"; MCL 206.510(1) "for the person's family" unchanged

Changes

  • mi_household_resources:
  • gov.states.mi.tax.income.household_resources:
    • Line 19 is filer_loss_limited_net_capital_gains (the head and spouse's Schedule D, with the same netting and loss limit).
    • gi_cash_assistance counts only for the claimant and spouse: nothing shows that a pilot payment is public assistance paid to the claimant's household.
    • Each source has an MI-1040CR line comment.
  • filer_loss_limited_net_capital_gains (read by Michigan and by net investment income) reads the filers' Schedule D line 16 from Use the filers' Schedule D for the tax on net capital gain #9855's shared filer_schedule_d_lines, then applies the capital-loss limit. Capital gain distributions are floored separately for each filer. A net_capital_gains amount matching the ordinary computed all-member aggregate at its storage precision uses the head and spouse's components directly, preventing a dependent's large gains from introducing rounding changes. For a differing supplied aggregate, the helper subtracts dependent long- and short-term gains separately from that supplied amount before adding the filers' distributions. It does not reconstruct the supplied amount through a residual against the rounded computed aggregate. Tax-unit inputs remain supported: wages 10,000 plus a supplied 5,000 give 15,000, and a supplied −5,000 is limited to −3,000.
  • References: MCL 206.510 and page 33 of the 2025 book.

Tests

Six new deterministic cases in net_capital_gain.yaml cover the shared Schedule D calculation:

  • A head with a 977 gain and a dependent with 16,776,240 retains 977 on Form 1040 line 7a, statutory net capital gain and the worksheet. The float32 all-member aggregate rounds 16,777,217 to 16,777,216; subtracting the dependent previously gave 976.
  • Spouses' distributions of −2,000 and 1,500 are floored separately. With long-term gains of 6,000 and short-term losses of −3,000, line 16 is 4,500; the dependent's gains and distributions are excluded.
  • A supplied all-member aggregate of 15,000 removes the dependent's 8,000 net gain and adds the head's 1,500 distributions, producing line 16 of 8,500. Component-derived statutory gain remains 6,500 and worksheet gain 7,500, preserving Use the filers' Schedule D for the tax on net capital gain #9855's documented aggregate/component split.
  • A supplied aggregate of 16,777,216 with a filer component of −1 remains 16,777,216. Directly reading the supplied amount avoids losing a dollar through a float32 residual.
  • A supplied aggregate of 20,000,000 with dependent gains of 16,776,240 gives line 16 of 3,223,760. The rounded computed aggregate cannot add an extra dollar to this override.
  • A supplied aggregate of 1 remains 1 even when the filer's component gain is 2**60. Reconstructing it through even a float64 residual would lose the supplied dollar.

mi_household_resources.yaml: 15 claimant-and-spouse cases plus the 33 now on main (48 in all), with MI-1040CR line comments and expected values worked out from the form. The "was" values come from running the cases on #9790's head b6c5f613ce, where 6 fail. The 3 guards pass on both:

  • a working dependent: wages 8,000, interest 200 and Schedule C 3,000; the dependent's self-employment tax deduction stays off line 30. 40,000 (was 47,988.06).
  • Social Security survivors benefits paid for a 10-year-old (line 21), with the child's own interest left out. 39,000 (was 39,400).
  • both spouses' income counts and a child's does not. 50,500 (was 51,500).
  • a dependent parent: Social Security counts, pension does not. 65,000 (was 71,000).
  • a dependent's capital loss does not reduce the claimant's line 19. 52,000 (was 47,000).
  • a dependent's early withdrawal penalty is not on line 30. 49,000 (was 48,500).
  • three unchanged-behavior guards: SSI and child support for a child (lines 21 and 22), a FIP grant for a parent and two children (line 27), and premiums for a child's coverage (line 31).
  • a dependent's deductible alimony is not on the claimant's line 30 (40,000); guaranteed income pilot payments count only for the claimant and spouse (41,000).
  • supplied tax unit amounts: a net_capital_gains input of 5,000 counts on line 19 (15,000), and one of −5,000 is limited to −3,000 (7,000). Both fail on the r1 code. Supplied self_employment_tax_ald and self_employed_pension_contribution_ald amounts come off line 30 (8,000), as does a supplied self_employed_health_insurance_ald (9,000). dependent_net_investment_income.yaml adds a case where a supplied net_capital_gains of 100,000 is net investment income.
  • "Cannot be negative", "Reduced to 0" and "Partially reduced" set long_term_capital_gains in place of the tax-unit net_capital_gains and keep their expected values. The new cases above cover the supplied amount.

test_mi_household_resources_members.py: a deterministic test of every source on a child and on a dependent parent, a spouse test, and Hypothesis tests. Households have a head, an optional spouse, and 0-2 dependents aged 10, 16 or 75, with sparse random amounts of 26 inputs and a random FIP grant. Invariants, for every household:

  1. mi_household_resources equals a reference written from the form: max(0, the head and spouse's lines 14-20 and 23-26 + every member's lines 21, 22 and 27 − the head and spouse's line 30 − every member's premiums). Lines 16, 17 and 19 net and floor as the form does. This is a differential test against the form.
  2. A dependent's own income and adjustments do not matter: zeroing them leaves household resources unchanged.
  3. Amounts received for the household count wherever they are recorded: moving a dependent's line 21, 22 or 27 amount, or premium, to the head leaves household resources unchanged.
  4. Raising a dependent's line 21, 22 or 27 amount by d raises household resources by between 0 and d, and by exactly d when they were positive.
  5. Each of the spouse's own sources adds what it adds on the head.

The first Hypothesis counterexample was a test gap, not a model error. In a household with no income, the model computes a FIP grant, which counts on line 27, but the reference had left it out. The SPM unit's tanf is now an input.

Historical validation on head b10ac14936 (before #9795), one process at a time:

Hub microsimulation impact (current head)

A real microsimulation on the default dataset, main at the merge base 3019257968 against this PR's head 08f20a99e9, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.

Output 2025 change 2026 change 2025 records changed (weighted) 2026 records changed (weighted)
mi_household_resources -6.33bn -6.59bn 126 (423,983) 126 (427,011)
mi_refundable_credits +12.75M +10.60M 22 (84,483) 21 (77,146)
mi_income_tax -12.75M -10.60M 22 (84,483) 21 (77,146)
mi_homestead_property_tax_credit +4.41M +2.65M 7 (21,068) 6 (13,279)
mi_home_heating_credit +8.34M +7.94M 16 (66,611) 16 (67,086)
filer_loss_limited_net_capital_gains +0 +0 0 (0) 0 (0)
net_investment_income_tax +0 +0 0 (0) 0 (0)
adjusted_gross_income +0 +0 0 (0) 0 (0)
state_income_tax -12.75M -10.60M 22 (84,483) 21 (77,146)
income_tax +0 +0 0 (0) 0 (0)
household_net_income +12.75M +10.60M 22 (84,483) 21 (77,146)
household_benefits +0 +0 0 (0) 0 (0)

08f20a99e9 differs from the d1143 follow-up head dd85603c7f only in references. The Michigan figures match the earlier approved-head estimate (abff6ae89c, below) at the precision shown. Household resources fall in all 126 changed units, and every changed credit rises. The refundable-credit change equals the homestead plus home heating changes up to float32 rounding: $4,414,000 + $8,336,907 = $12,750,907 against $12,750,904 in 2025, and $2,651,825 + $7,943,936 = $10,595,762 against $10,595,763 in 2026. The federal capital-gain follow-ups (78a463146, 27ffb3b8c) change no record on the default dataset: filer_loss_limited_net_capital_gains, net_investment_income_tax, adjusted_gross_income and income_tax are identical record by record in both years. Each side-year ran under the shared heavy-job lock with a 20 GB footprint cap; peak footprint was 14.3 GB.

Comparison files are in fixes/9796-impact/ on the hub host.

Historical hub microsimulation impact (approved head abff6ae, superseded)

Historical results on the default dataset, main at the earlier merge base 0a8c3c2c43 against approved head abff6ae89c, for 2025 and 2026. These estimates predate the latest main merge and CI follow-ups. "Hub microsimulation impact (current head)" above supersedes them, with the same Michigan totals. The original runs went one at a time under the shared heavy-job lock. Sums are weighted.

Output 2025 change 2026 change 2025 records changed (weighted) 2026 records changed (weighted)
mi_household_resources -6.33bn -6.59bn 126 (423,983) 126 (427,011)
mi_refundable_credits +12.75M +10.60M 22 (84,483) 21 (77,146)
mi_income_tax -12.75M -10.60M 22 (84,483) 21 (77,146)
mi_homestead_property_tax_credit +4.41M +2.65M 7 (21,068) 6 (13,279)
mi_home_heating_credit +8.34M +7.94M 16 (66,611) 16 (67,086)
state_income_tax -12.75M -10.60M 22 (84,483) 21 (77,146)
income_tax +0 +0 0 (0) 0 (0)
household_net_income +12.75M +10.60M 22 (84,483) 21 (77,146)
household_benefits +0 +0 0 (0) 0 (0)

Excluding dependents' income lowers household resources on all 126 changed units, and every changed credit record rises. The refundable-credit increase equals the homestead plus home heating increases in each year: $4.41M + $8.34M = $12.75M in 2025.

Earlier historical microsimulation (default dataset, 2026)

Historical impact, superseded: this section predates #9795 and the main merge above. The figures are kept as originally measured. The later approved-head estimate is "Historical hub microsimulation impact (approved head abff6ae, superseded)"; both are superseded by "Hub microsimulation impact (current head)" above.

Base: #9790's head 0a2ca21b4a merged with #9801 at 1a97062090, which is everything here except this PR's own change. Branch: b10ac14936. The two ran one at a time under the shared heavy-job lock and a 24 GB watchdog (peak 15.4 GB) on populace_us_2024.h5@populace-us-2024-spm-20260909: 79,729 tax units, 1,974 in Michigan.

base branch change
mi_household_resources (weighted) $521.54B $513.50B −$8.04B: −$8.036B in 109 Michigan units, all with a dependent
mi_homestead_property_tax_credit $801.9M $802.9M +$1.02M (6 Michigan units)
mi_home_heating_credit $172.4M $177.1M +$4.68M: +$4.53M in 9 Michigan units
mi_refundable_credits $1,592.2M $1,597.9M +$5.70M: +$5.55M in 15 Michigan units
mi_income_tax / state_income_tax −$5.70M: −$5.55M in 15 Michigan units
mi_eitc, adjusted_gross_income, loss_limited_net_capital_gains 0
  • The totals also include 2 tax units that the measurement script leaves without a state, because it takes a unit's state from a flagged head. Between them they net −$7.2M of household resources and +$0.15M of credits.
  • Household resources fall for all 109 changed Michigan units; none rises. Each has a dependent whose own income no longer counts. The unweighted median change is −$7,529 (p10 −$51,628, p90 −$290).
  • On that historical head, filer_loss_limited_net_capital_gains differed in 31 units by at most $0.03 (one float32 spacing; −$977 weighted on $1.63T), from its summation order. income_tax differed by less than a cent in one unit. The current precision fix removes the computed-gain dependence on the dependents' amounts; these historical measurements do not validate the follow-up head.

Coordination

Not in this PR (follow-ups, sent to the US + core hub)

  • Line 31 premiums already deducted on line 30, and the $300 exclusions in MCL 206.510(1)(a) and (b): a follow-up PR on branch mi-household-resources-premiums-gambling, stacked on this one. It also maps miscellaneous_income (taxable other income) to line 20 and gifts (financial_assistance) to line 24.
  • Foster parent payments (line 22) and Schedule E Part IV REMIC income (line 17) have no input.

axiom: TheAxiomFoundation/rulespec-us#1491 queued (extended for MCL 206.508(3), household = claimant and spouse; the signed encoder run needs approval)

🤖 Generated with Claude Code

MaxGhenis and others added 12 commits October 4, 2026 15:13
A filer with capital losses or other capital gains enters capital gain
distributions on Schedule D line 13 (2025 Instructions for Schedule D), so
they net against the losses before the 26 U.S.C. 1211(b) limit on line 21.
The model added distributions (non_sch_d_capital_gains) to gross income and
deducted min(3,000, losses) separately: a 5,000 long-term loss with 3,000 of
distributions gave 0 in AGI instead of -2,000.

- capital_losses_allowed_against_gains (new): losses allowed up to the
  gains in gross income, distributions included (1211(b), first part).
- limited_capital_loss: the net loss up to the limit (1211(b)(1)-(2),
  Schedule D line 21). loss_ald deducts both. This also nets spouses'
  gains and losses on a joint return.
- loss_limited_net_capital_gains (+ person version): Form 1040 line 7a,
  max(-limit, LT + ST + distributions). Net investment income no longer
  adds the distributions separately (Form 8960 line 5a).
- has_qdiv_or_ltcg: qualified dividends, or Schedule D lines 15 and 16
  both above zero (Form 1040 instructions, line 16).
- dependent_taxable_ss_magi: the same netting on the dependent's return.
- dc_self_employment_loss_addition: subtracts both capital parts of
  loss_ald.

Tests: YAML cases with form line comments; grid, Hypothesis property and
monotonicity tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ons-agi

# Conflicts:
#	policyengine_us/parameters/gov/irs/investment/income/sources.yaml
filer_loss_limited_net_capital_gains (from #9784) now nets the head and
spouse's capital gain distributions with their Schedule D gains and losses
before the 1211(b) limit, and net investment income no longer adds the
distributions separately. The invariant test's reference computation
follows: distributions move from the person-level Form 8960 amounts to
the Schedule D inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
capital_losses_allowed_against_gains counts only the capital gains that
gov.irs.gross_income.sources includes, and dependent_taxable_ss_magi nets
distributions only when both sources are listed. Cover both branches with
reforms that drop non_sch_d_capital_gains or capital_gains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the independent review of #9788:
- mi_household_resources subtracted all above-the-line deductions,
  including the capital loss already netted in the capital gains line
  (MI-1040CR line 30 is U.S. Schedule 1 adjustments only). It now leaves
  out capital_losses_allowed_against_gains and limited_capital_loss. The
  two existing loss-limit cases double counted the loss: 44,000 -> 47,000
  and 47,000 -> 48,500.
- has_qdiv_or_ltcg figures Schedule D lines 15 and 16 over the head and
  spouse, so a dependent's loss cannot switch off the filer's worksheet.
- Distributions are floored at zero per person in every line 7a variable
  (box 2a is not negative), as irs_gross_income does.
- Capital losses are deductible only while capital_gains is a gross income
  source, matching dependent_taxable_ss_magi under such a reform.
- Test that the two loss-limit parameters agree; rename the #9784
  invariant test that no longer compares with the pre-change formula.
- loss_ald label: "Business and capital loss ALD".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI caught two tests written against the old capital loss formula:
- test_dependent_losses_agi_invariants (#9647) compared limited_capital_loss
  with min(cap, sum of losses), which does not net one spouse's gains
  against the other's losses. Its reference now splits 1211(b) the same
  way: losses allowed up to the gains, plus the excess up to the cap.
  Renamed ..._match_all_member_formula.
- md_capital_gains_surtax "partial offset" set capital_losses (a formula
  variable, max(0, -capital_gains)) to 50,000 next to 150,000 of net gains,
  a state no inputs can produce, and its comment applied the $3,000 cap to
  losses within gains. It now inputs the short-term loss directly
  (30,000 gains less 50,000 losses = -20,000): Schedule D line 16 and Form
  502CG line 1 are 100,000, surtax 2,000 (same on main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MCL 206.508(4) adds back "any net business loss after netting all business
income and loss" and "any net rental or royalty loss". The MI-1040CR nets
line 16 (Schedule C, Form 4797 Part II, Schedule E Parts II and III,
Schedule F) and line 17 (Schedule E Parts I and V) and floors each total at
zero. Line 30 is the U.S. Schedule 1 adjustments, so loss_ald, which holds
business, rental and capital losses, is no longer subtracted there.

Estate and trust income and Form 4797 ordinary gains now count on line 16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MCL 206.508(3): "'Household' means a claimant and spouse." Netting every
tax unit member's sources let a dependent's business or rental loss offset
the claimant's income (a 15-year-old's Schedule C loss of 20,000 took the
claimant's household resources from 70,000 to 50,000). Lines 16 and 17 now
sum only non-dependents, as loss_ald and irs_gross_income do.

Tests: three dependent YAML cases and a deterministic dependent property
test. The loss_ald reform check now runs once, on the grid, instead of on
every Hypothesis example; test_properties drops from 931 s in CI to about
8 s. The deterministic tests no longer need hypothesis. Small inputs are
drawn at $100 or more, the tolerance docstring is corrected, and comments
list Schedule E Part IV (REMIC) on line 17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MCL 206.508(3) defines the household as "a claimant and spouse", and the
MI-1040CR asks for the income "you and your spouse received". Every
household resources source except lines 16 and 17 was summed over all tax
unit members, so a dependent's wages, interest, pensions and capital gains
raised the claimant's household resources, and a dependent's Schedule 1
adjustments (such as the deduction for half of self-employment tax)
lowered them.

- Sources are summed over the head and spouse with tax_unit_non_dep_add.
- Line 21 (Social Security, SSI and railroad retirement, including amounts
  received for minor children or dependent adults), line 22 (child
  support) and line 27 (public assistance paid to the household) still
  count for every member, as the form says.
- Line 19 reads filer_loss_limited_net_capital_gains, the head and
  spouse's Schedule D.
- Line 30 sums the head and spouse's Schedule 1 adjustments, with the
  self-employment adjustments read per person.
- Line 31 premiums paid for the family are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no income, the model computes a Michigan FIP grant (tanf) for the
test household, which counts on line 27 but was missing from the test's
reference. Each SPM unit now gets a tanf input, drawn at random in the
Hypothesis test and counted in full on line 27 of the reference. The
Hypothesis tests also run more examples (50 and 30).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
irs_gross_income leaves tax unit dependents' income off the filer's
return, but self_employment_tax_ald, self_employed_health_insurance_ald
and self_employed_pension_contribution_ald summed every member's
person-level amount, and above_the_line_deductions summed every member's
IRA contributions, early withdrawal penalty, educator expenses, adoption
assistance and education bond interest. A dependent's Schedule SE and
Schedule 1 deductions belong on the dependent's own return.

- The three self-employment aggregates sum their _person variables over
  non-dependents; alimony_expense_ald masks dependents.
- above_the_line_deductions sums gov.irs.ald.deductions with
  tax_unit_non_dep_add.
- Readers that sum the ALD list themselves do the same: taxable_ss_magi,
  taxable_uc_agi, student_loan_interest_ald_magi,
  adjusted_gross_income_person and ma_part_b_agi.
- mo_adjusted_gross_income takes personal ALDs over non-dependents, so its
  remaining-ALD allocation never goes negative.
- medicaid_adjusted_gross_income_person attributes a dependent's own
  person-level deductions to the dependent instead of the head.
- ma_gross_income_loss_adjustment leaves out dependents' losses, as the
  federal gross income it adjusts does.

The _person variables keep each person's own amount, which a dependent's
own return (dependent_taxable_ss_magi) uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (31149d1).
⚠️ Report is 199 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #9796    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            4        11     +7     
  Lines           76       265   +189     
  Branches         2        14    +12     
==========================================
+ Hits            76       265   +189     
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.

MaxGhenis and others added 7 commits October 5, 2026 13:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-resources-claimant-spouse

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e member lists

Review r1:
- Line 30 reads the tax-unit adjustments as they are, so supplied inputs
  and reforms of self_employment_tax_ald and the other aggregates are
  respected. #9801 (merged in) makes those aggregates and
  alimony_expense_ald leave dependents out.
- The every-member sources (lines 21, 22 and 27) move to a parameter,
  gov.states.mi.tax.income.household_resources_all_members, and a source
  defined for a group larger than the tax unit (an SPM unit amount) is
  aggregated as a household amount, so a reform cannot hit an entity error.
- gi_cash_assistance counts only for the claimant and spouse: nothing shows a
  pilot payment is public assistance paid to the claimant's household.
- Tests: dependent alimony and guaranteed income YAML cases; property tests
  always have a dependent and a positive-resources household; a reform test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ons-agi

# Conflicts:
#	policyengine_us/tests/core/test_dependent_losses_agi_invariants.py
#	policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
… and move the distributions comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to mi-household-resources-business-losses

# Conflicts:
#	policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
…change in the changelog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits October 6, 2026 00:54
…s-losses' into mi-household-resources-claimant-spouse

# Conflicts:
#	policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
…aggregate-input cases

Review r1 finding 1: filer_loss_limited_net_capital_gains summed the head's
and spouse's components, so a tax unit net_capital_gains input was ignored
(wages 10,000 plus a 5,000 aggregate gain gave 10,000, not 15,000). It now
takes net_capital_gains less the dependents' own gains and losses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd SE health insurance cases

Review r2 follow-ups: a supplied net_capital_gains reaches net investment
income (YAML case), a supplied self-employed health insurance deduction comes
off Michigan line 30 (YAML case), and the variable documents how a supplied
total combines with dependents' person-level gains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits October 6, 2026 04:35
…ces-claimant-spouse

# Conflicts:
#	changelog.d/fix-dependent-ald-filer-agi.fixed.md
#	policyengine_us/tests/core/test_ald_determinism.py
#	policyengine_us/tests/core/test_dependent_above_the_line_deductions_invariants.py
#	policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/medicaid_adjusted_gross_income_person.yaml
#	policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/above_the_line_deductions/dependent_above_the_line_deductions.yaml
#	policyengine_us/tests/policy/baseline/gov/states/mi/tax/income/mi_household_resources.yaml
#	policyengine_us/variables/gov/hhs/medicaid/income/medicaid_adjusted_gross_income_person.py
#	policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/above_the_line_deductions/above_the_line_deductions.py
#	policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/above_the_line_deductions/alimony_expense_ald.py
#	policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/above_the_line_deductions/student_loan_interest/student_loan_interest_ald_magi.py
#	policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/adjusted_gross_income_person.py
#	policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/filer_loss_limited_net_capital_gains.py
#	policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/social_security/taxable_ss_magi.py
#	policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/unemployment_insurance/taxable_uc_agi.py
#	policyengine_us/variables/gov/states/ma/tax/income/adjusted_gross_income/ma_part_b_agi.py
#	policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
…ive Schedule C and F income

With #9801 on main: line 30 sums gov.irs.ald.filer_amounts_recorded_on_dependents
over every member, as above_the_line_deductions does, and the losses test now
draws positive dependent Schedule C and F income, whose self-employment tax
deduction is on the dependent's own return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 6, 2026
Line 16 of the filers' Schedule D now starts from the tax unit
net_capital_gains and takes out dependents' person-level gains and
losses, as #9796 does for Form 1040 line 7a. The Schedule D Tax
Worksheet read net_capital_gains on main, so a tax unit amount supplied
there keeps reaching worksheet line 7.

filer_loss_limited_net_capital_gains goes back to main's formula, so
this PR no longer edits the file #9796 and #9840 change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve line 30 with #9795's Michigan Schedule 1 adjustment list, including capped educator expenses, and #9796's claimant-and-spouse summation. Preserve all 48 household resources cases and their expected values.
MaxGhenis added a commit that referenced this pull request Oct 9, 2026
* Use the filers' Schedule D for the tax on net capital gain

Net capital gain (26 U.S.C. 1222(11), 1(h)(11)), the Schedule D Tax
Worksheet and the 28% rate gain summed long- and short-term gains,
capital gain distributions, qualified dividends, collectibles gain and
Form 4952 elections over every tax unit member. Adjusted gross income
leaves out tax unit dependents, whose items are on their own returns
(2025 Form 8814, line 4), so a dependent's gain or dividends let the
filer's ordinary income be taxed at capital gain rates. The rate side
also added a negative capital gain distributions input, which AGI
floors at zero (Form 1099-DIV box 2a).

A new helper, filer_schedule_d_lines, gives the head and spouse's
Schedule D lines 7, 15 and 16 with distributions floored per person. It
now feeds filer_loss_limited_net_capital_gains (Form 1040 line 7a),
has_qdiv_or_ltcg, net_capital_gain and the worksheet's Form 4952 lines,
so the AGI side and the rate side read the same lines. Qualified
dividends, the Form 4952 election and the 28% rate gain inputs are
summed over the head and spouse with tax_unit_non_dep_add.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Trim the Schedule D property tests' Hypothesis examples

Keeps the remaining pytest group's added time small: the file now takes
about 50 s of CPU locally (6 tests, 1.4 GB peak footprint).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep a supplied net_capital_gains in Schedule D line 16

Line 16 of the filers' Schedule D now starts from the tax unit
net_capital_gains and takes out dependents' person-level gains and
losses, as #9796 does for Form 1040 line 7a. The Schedule D Tax
Worksheet read net_capital_gains on main, so a tax unit amount supplied
there keeps reaching worksheet line 7.

filer_loss_limited_net_capital_gains goes back to main's formula, so
this PR no longer edits the file #9796 and #9840 change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use the filers' amounts in Vermont's and Hawaii's capital gain lines

Review r1 found that Vermont's flat capital gains exclusion took every
member's qualified dividends out of the now filer-only
adjusted_net_capital_gain. A dependent's 3,000 of dividends cut a 4,000
exclusion to 1,000 (Vermont tax 936.33 to 1,036.82). The dividends are
now the head and spouse's, as in the federal amount.

Hawaii's Tax on Capital Gains Worksheet took the smaller of the filers'
net capital gain (line 7) and every member's long-term gains (line 4),
so a dependent's loss shrank the head's line 8. Line 4 is now the head
and spouse's too.

The property tests also give dependents section 1202 gain, a long-term
loss carryover and Schedule D line 18 small business stock gain, and
no longer claim the grid runs without Hypothesis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Test that a supplied net_capital_gains reaches Schedule D line 16

Review r2 asked for a case covering 2b7bf4f: distributions of 1,000
and a tax unit net_capital_gains input of -5,000 make line 16 a loss of
4,000, so has_qdiv_or_ltcg is false and worksheet line 9 is 0. Main
turned the flag on there. The helper's line 16 comment now says it is
figured from net_capital_gains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Clarify Schedule D worksheet scope and aggregate input limitation

* Match the changelog and helper docstring to the PR's scope

The 28% Rate Gain Worksheet was already filer-only on main (#9988), so the
fragment no longer claims this PR changes it, and it now names Vermont's
dividend subtraction. The helper docstring sentence was missing an "and".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as draft October 9, 2026 10:14
MaxGhenis and others added 2 commits October 9, 2026 12:07
michigan.gov has removed the 2025 home heating credit book
(TY2025/MI-1040CR-7-Book.pdf now returns 404), so cite the Wayback
Machine capture of 2026-02-18. It is byte-identical to the NBER TAXSIM
mirror (sha256 f540a3dd...). Its total household resources lines 17-33
say the same as MI-1040CR lines 14-31 about whose income counts:
"you and your spouse", Social Security "for minor children or other
dependent adults who live with you" (line 24), child support and foster
care payments (line 25), MDHHS payments "made to your household"
(line 30), and premiums "for yourself and your family" (line 33).
References only; no formula or value changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hand-off back to the US + core hub (from session local_cd1d9b85, a second launch of chip task_9cba9253; it did not rebuild this PR)

@MaxGhenis
MaxGhenis marked this pull request as ready for review October 9, 2026 21:01
@MaxGhenis
MaxGhenis merged commit c6633c6 into main Oct 10, 2026
33 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#9796 at 08f20a99e95726c9c558047859366f399c136543 (squash): Michigan household resources count only the claimant and spouse (MCL 206.508(3); MI-1040CR lines 14-27, 30 and 31).

  • Review: independent GPT-6.1 Sol delta review r5 approves this exact head, covering abff6ae through 08f20a9.
  • Gates checked live at merge:
    • gh pr checks exits 0;
    • the latest Pull request run at the head concluded success;
    • MERGEABLE, not a draft, no CHANGES_REQUESTED;
    • the semantic-overlap guard;
    • head pinned.
  • Impact: a hub microsim at this head (merge base 3019257968), for 2025 and 2026.
    • mi_household_resources falls $6.33B and $6.59B (126 units).
    • mi_income_tax falls $12.75M and $10.60M, as refundable credits rise.
    • AGI and filer capital gains are unchanged.
  • Axiom: rulespec-us#1491 queued.
  • --admin: used only because a required approving review is the sole block.

@MaxGhenis
MaxGhenis deleted the mi-household-resources-claimant-spouse branch October 10, 2026 08:21
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