Repository navigation
Keep federally excluded income in Michigan household resources (MI-1040CR line 30) - #9795
Merged
Merged
Conversation
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>
Line 30 is "total adjustments from your U.S. Form 1040, Schedule 1". It used the federal above-the-line list without loss_ald, which still held four exclusions from gross income: us_bonds_for_higher_ed (IRC 135), qualified_adoption_assistance_expense (137), specified_possession_income (931) and puerto_rico_income (933). Total household resources include "all income exempt or excluded from AGI" (2025 MI-1040 book, page 26), and the excluded amounts already sit in the line 14 and 15 sources (line 15 is "All interest and dividend income (including nontaxable interest)"; adoption benefits are reported on Form W-2, box 12 code T), so line 30 took them back out. A new parameter, gov.states.mi.tax.income.household_resources_adjustments, lists the federal above-the-line deductions that are Schedule 1 Part II adjustments. Line 30 sums those the federal list deducts, so a federal reform that drops one drops it here too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9795 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 1 -3
Lines 76 27 -49
Branches 2 3 +1
=========================================
- Hits 76 27 -49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Review r1 on #9795: - The formula comment stated as model behaviour what is an input convention: because the federal list subtracts each exclusion from gross income, the excluded amount is entered in the income it comes from. - The differential reference took line 30's variables from the parameter under test. It now uses SCHEDULE_1_ADJUSTMENTS, written in the test from the 2025 Schedule 1, and the classification test asserts the parameter equals it. - Invariant 3 skipped every household with student loan interest. It now allows for the change D in that deduction (household resources = max(0, without - D); AGI lower by the exclusions plus D), and the grid adds six phase-out households so that case is exercised. - test_worked_example duplicated a YAML case and is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… grid Review r2 on #9795: in the phase-out households, savings bond interest and adoption benefits must change the student loan interest deduction and Puerto Rico income (added back under IRC 221(b)(2)(C)) must not; the grid now asserts each instead of "at least one". Possession income is left unchecked, since its effect depends on the federal modified AGI's treatment of section 931. The formula comment adds possession and Puerto Rico income to the input convention. 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>
This was referenced Oct 6, 2026
…s-losses' into mi-household-resources-schedule-1-adjustments
…ces-business-losses # Conflicts: # policyengine_us/tests/policy/baseline/gov/states/mi/tax/income/mi_household_resources.yaml # policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
…s-losses' into mi-household-resources-schedule-1-adjustments
Contributor
Author
|
Hand-off to the US + core hub. Head
|
…ces-schedule-1-adjustments # Conflicts: # policyengine_us/tests/test_mi_household_resources_losses.py # policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
Review r5: since #9801, the federal above-the-line total leaves dependents' person-level items out, but line 30 summed educator_expense, early_withdrawal_penalty and traditional_ira_contributions over every member with add. It now uses tax_unit_non_dep_add, as above_the_line_deductions does. Regression case: a dependent's IRA 2,000, penalty 100 and educator expenses 300 gave 47,600; the form gives 50,000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
US + core hub merge audit, us#9795 at
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MI-1040CR line 30 is "total adjustments from your U.S. Form 1040, Schedule 1". After #9790,
mi_household_resourcestakes line 30 as the federal above-the-line list withoutloss_ald. That list still holds four federal exclusions from gross income that are not Schedule 1 adjustments:us_bonds_for_higher_edqualified_adoption_assistance_expensespecified_possession_incomepuerto_rico_incomeBecause the federal list subtracts each of these from gross income, the excluded amount is entered in the income it comes from (savings bond interest in interest income, adoption benefits in wages), and line 30 then took it back out of household resources. Example: wages 30,000 and interest 2,000, of which 1,500 is excluded under section 135. The model gave 30,500; MI-1040CR line 33 is 32,000.
This PR lists the Schedule 1 Part II adjustments in a Michigan parameter. Line 30 sums the ones the federal list deducts.
#9790 has merged (
4732913a0e), so this PR now sits onmain. Its own change isgit diff $(git merge-base upstream/main HEAD) HEAD. On 2026-10-07 the US + core hub mergedmaininto the branch (99a9ba31da) with no conflicts, and the PR's diff is byte-identical to the one reviewed at6d436afaaf.The law and the forms
MCL 206.508(4): "'Total household resources' means all income received by all persons of a household in a tax year while members of a household, ... and increased by the following deductions from federal gross income: (a) Any net business loss after netting all business income and loss. (b) Any net rental or royalty loss. (c) Any carryback or carryforward of a net operating loss ..." The statute adds back only those three deductions. An exclusion is not a deduction from gross income: the amount never enters gross income, but it is still income received.
2025 MI-1040 book (page 26): total household resources "are AGI, excluding net business and farm losses, net rent and royalty losses, and any carryover of a net operating loss, plus all income exempt or excluded from AGI." None of the four is on the page 27 list of items total household resources do not include.
MI-1040CR (2025 form; book pages 31 and 32):
Federal.
Changes
gov.states.mi.tax.income.household_resources_adjustments(from 2021): the federal above-the-line deductions that are Schedule 1 Part II adjustments. Each entry carries its line in a comment: educator expenses (line 11), HSA (13), self-employment tax (15), SEP, SIMPLE and qualified plans (16), self-employed health insurance (17), early withdrawal penalty (18), alimony paid (19a), IRA (20) and student loan interest (21).mi_household_resources, line 30: sums that list, keeping only the entriesgov.irs.ald.deductionsalso lists. So a reform that repeals a federal adjustment by removing it from the federal list removes it here too, as on the federal Schedule 1.loss_alddrops off with the four exclusions, so the formula no longer special-cases it.tests/test_mi_household_resources_losses.py(from Net Michigan business and rental losses in household resources (MI-1040CR lines 16, 17 and 30) #9790): its line 30 helper now reads the Michigan list, as the formula does. Its households have no exclusions, so no expected value changes.tax_unit_non_dep_add(..., include_dependents=gov.irs.ald.filer_amounts_recorded_on_dependents), the same callabove_the_line_deductionsmakes (6d436afaaf, after review r5). A dependent's IRA deduction, early withdrawal penalty or educator expenses no longer reduce the claimant's line 30.Tests
5 new YAML cases in
mi_household_resources.yaml, with MI-1040CR line comments and expected values worked out from the form. Each also checks federal AGI, to show the exclusion is in effect federally.All 5 fail on #9790's head (giving the "before" column) and pass here.
tests/test_mi_household_resources_adjustments.py(4 tests). A 1,542-household grid: every combination of wages, interest, nontaxable interest, Schedule C income, six exclusion patterns, three Schedule 1 adjustments and premiums (1,536), plus each exclusion pattern in the student loan interest phase-out (6). A Hypothesis test runs 25 examples of up to 40 households, each household paired with a copy without exclusions. Invariants, for every input:SCHEDULE_1_ADJUSTMENTS, the nine variables written in the test from the 2025 Schedule 1 with their line numbers. Every federal above-the-line deduction from 2021 on is either one of them or one ofloss_aldand the four exclusions, never both, and each is a federal deduction. This is checked for every year 2021-2035 and every date either list changes. A new federal deduction fails the test until someone classifies it for line 30.mi_household_resources= max(0, wages + all interest + max(0, Schedule C) − Schedule 1 adjustments − premiums). Which variables count as adjustments comes from the test's own list, not the parameter. Their amounts are read from the model, since the self-employment tax and student loan interest deductions depend on income. The reference subtracts none of the exclusions.test_gridchecks each exclusion separately. Savings bond interest and adoption benefits must change the deduction (D > 0). Puerto Rico income, which the student loan MAGI adds back, must leave it unchanged (D = 0). Possession income is not checked separately in this grid. Main's merged Add back income excluded under sections 911, 931 and 933 in modified AGIs (student loan interest and 11 siblings) #9817 now adds backspecified_possession_income(section 931) in the student loan interest MAGI, alongsidepuerto_rico_income(section 933), so possession income also leaves that deduction unchanged (D = 0).us_bonds_for_higher_edandpuerto_rico_incomefromgov.irs.ald.deductions. The penalty and IRA deduction then leave line 30, and household resources still match the form.On #9790's head, 3 of the 4 tests fail: the grid, the reform test and the Hypothesis test. The classification test reads only parameters, so it passes there, as it should. The file runs in about 30 s, with a 2.2 GB peak.
6d436afaafadds a sixth YAML case, "A dependent's own Schedule 1 adjustments are not on the claimant's line 30": the claimant earns 50,000, and a dependent student has a 2,000 IRA contribution, a 100 early withdrawal penalty and 300 of educator expenses. Line 30 is 0 and line 33 is 50,000.On head
94024821ab, all 619 Michigan YAML tests pass, as do the 9 tests in this file andtest_mi_household_resources_losses.py(39 s, 2.3 GB peak).Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
b7e4229d86against this PR's headc5842079b7, for 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.mi_household_resourcesmi_refundable_creditsmi_income_taxstate_income_taxincome_taxhousehold_net_incomehousehold_benefitsComparison files are in
fixes/9795-impact/on the hub host.Microsimulation (historical run, default dataset, 2026)
Historical run at
6d436afaaf, before the main merge and the educator-expense fix requested in review r7. Base:mainat the merge based3978dfc31. Branch:6d436afaaf. These results do not establish impact at the current head. The US + core hub will rerun the impact at the new head against currentmainafter the r8 educator-expense fix, because #9833 and that fix change the amounts summed on line 30. Both historical runs ran one at a time under the shared heavy-job lock (US + core hub driver, finished 2026-10-07) onpopulace_us_2024.h5@populace-us-2024-spm-20260909: 79,729 tax units, 1,939 with nonzero Michigan household resources.mi_household_resourcesmi_refundable_creditsmi_income_taxstate_income_taxincome_taxhousehold_net_income(household)The earlier run on the same dataset (base
0a2ca21b4a, branchb845167f07, before the head-and-spouse change) was bitwise identical. The dataset has no amounts for the four exclusions this PR moves off line 30 (us_bonds_for_higher_ed,qualified_adoption_assistance_expense,specified_possession_income,puerto_rico_income). So the 8 records that changed in this historical comparison come from the head-and-spouse summation: dependents' own adjustments no longer reduce the claimant's household resources. In that historical sample, this moved Michigan's credits and tax by less than $1 in total. Compare file:~/reviews/us-hub/fixes/9795-impact/compare.2026.json.Not in this PR
specified_possession_income(section 931) in the student loan interest MAGI, alongsidepuerto_rico_income(section 933), as IRC 221(b)(2)(C) requires. That federal fix is included through the main merge and is not introduced by this PR.axiom: TheAxiomFoundation/rulespec-us#1491 queued (to be extended with the federal exclusions and line 30 companion tests)
🤖 Generated with Claude Code