Repository navigation
Count all of New Mexico's modified gross income sources - #11173
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11173 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 3 +2
Lines 24 49 +25
Branches 0 2 +2
=========================================
+ Hits 24 49 +25
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:
|
hua7450
left a comment
There was a problem hiding this comment.
Thanks, David. N.M.S.A. 7-2-2(L), 3.3.1.10 NMAC and the 2025 PIT-RC support every new entry, the per-person floor and counting capital gains gross. Nothing the law excludes is counted and nothing is counted twice. The four consumers (the low-income comprehensive tax rebate, the property tax rebate and its eligibility, and the child day care credit) all use the 7-2-2 definition, so no threshold needs to change. The newly read benefits are plain inputs, so there is no cycle. Two small fixes before I approve.
Before merge
+=in the formula.nm_modified_gross_income.pylines 42 and 48 usetotal += ..., both on lines this PR adds. The repo rule is to write the addition out (total = total + ...).- Partnership and S corporation results are netted before the floor. The list adds
partnership_s_corp_income, which sums the two, so one's loss reduces the other's income. 3.3.1.10(B) NMAC: "The loss from one business or activity shall not reduce the income from another business or activity." Withpartnership_income: 30_000ands_corp_income: -20_000, the regulation gives 30,000 and the formula gives 10,000, which passes the $16,000 property tax rebate test. Listingpartnership_incomeands_corp_incomeseparately fixes it, as you did for capital gains.
Optional
- A directly entered
capital_gainsno longer counts, so that household's income falls against main. The PR body says so and also says "No one's modified gross income falls". Either add the fallback Montana keeps or correct the sentence. - Whose income counts. The PIT-RC says "all household members" and the statute says spouse and dependents. The code follows the statute, but there is no
source_conflicts/candidates.yamlentry. - Section 911.
section_911_excluded_incomeincludes the Form 2555 housing deduction, which is not income. - Title and changelog say "all". Cash income with existing variables is still left out (
nm_ssi_state_supplement,railroad_benefits,survivor_benefits,strike_benefits,pfml_benefits,gi_cash_assistance,pell_grant). The PR body lists them as follow-ups. - Tests. No
s_corp_incomecase, no dependent case, and no new source carried through to the rebates or the day care credit.
Add farm, partnership and S corporation income, capital gain distributions, Form 4797 gains, general assistance, workers' compensation, disability benefits, discharged debt, gross gambling winnings, cash gifts, scholarships, miscellaneous income and excluded foreign earned income to New Mexico modified gross income (NMSA 1978 7-2-2(L), 3.3.1.10 NMAC, 2025 PIT-RC lines 4 to 11). Floor each person-level source per person, so one spouse's loss no longer reduces the other's income, and count short- and long-term capital gains separately with the long-term carryover added back, so capital losses no longer reduce gains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y in NM modified gross income Add nm_modified_gross_income_partnership_s_corp_income, which floors partnership and S-corp income at zero separately and falls back to the combined partnership_s_corp_income input when neither part is set. List it in the NM modified gross income sources in place of partnership_s_corp_income, avoid in-place += on the formula's array, and add test cases for an S-corp loss and a combined-only input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b0d6dd0 to
6524da4
Compare
|
Thanks, Ziming. Fixed in 6524da4, rebased on main. Fixed (your "Before merge" items)
Skipped (optional, not in this round): the directly entered Verification: the NM modified gross income file and the four consumers' tests pass locally after the rebase (95), as does |
hua7450
left a comment
There was a problem hiding this comment.
Thanks, David. Both fixes are in. The += lines are written out, and the new nm_modified_gross_income_partnership_s_corp_income floors partnership and S corporation income each on its own (falling back to a combined amount entered directly). The new cases pin both (a 30,000 partnership gain beside a 20,000 S corporation loss counts 30,000). Comparing the PR's own diff before and after the rebase, those are the only changes. Approving.
Part of #10812 (state credit income audit).
Part of #10062 (that issue also covers Iowa and Mississippi farm rent, which this PR leaves alone).
What was wrong
nm_modified_gross_incomefeeds the low income comprehensive tax rebate, the property tax rebate for persons 65 or older and the child day care credit. It missed most of the income NMSA 1978 § 7-2-2(L) lists, and it let losses reduce it in two ways the law bars:capital_gains, which nets short-term against long-term, andlong_term_capital_gainsalso nets the prior-year capital loss carryover.The parameter file also ended with a comment ("income such as gambling winnings, insurance settlements, scholarships, grants and inheritance,") with nothing under it.
Sources, all read directly: NMSA 1978 § 7-2-2(L) (2025 code, Justia): "all income of the taxpayer and, if any, the taxpayer's spouse and dependents, undiminished by losses and from whatever source, including" 21 items; 3.3.1.10 NMAC; and the 2025 PIT-RC instructions (general definition and lines 4 to 11 on PDF page 4, the records table on page 2). I read the PIT-RC from the rendered pages, not its shifted text layer.
What changes
New entries in
gov.states.nm.tax.income.modified_gross_income, each with its source in a comment:farm_operations_income,farm_rent_incomepartnership_s_corp_incomenon_sch_d_capital_gains(capital gain distributions without Schedule D)other_net_gain(Form 4797)general_assistanceworkers_compensationdisability_benefits(taxable and tax-exempt)debt_reliefgambling_winnings(gross)financial_assistance(cash gifts)educational_assistancemiscellaneous_incomesection_911_excluded_incomeFormula changes:
tax_unit_social_security,other_net_gain,section_911_excluded_income) or a larger group (tanf) keep the tax-unit floor. Source: 3.3.1.10(B) NMAC ("zero is the lowest amount which may be reported for any item ... The loss from one business or activity shall not reduce the income from another business or activity") and PIT-RC line 8 (page 4: you "may not offset the loss of one business, farm, or rental against the profit of another").capital_gainsis replaced byshort_term_capital_gainsand a new person variable,nm_modified_gross_income_long_term_capital_gains:long_term_capital_gainspluslong_term_capital_loss_carryover, the year's own long-term gain before the carryover. Each is floored on its own, so a short-term loss never reduces a long-term gain (or the reverse) and the carryover never reduces the year's gain; only the gain the carryover hid is restored, never the unused loss. Source: PIT-RC line 9 (page 4), "Enter your gross capital gains. Do not reduce them by capital losses", and § 7-2-2(L), "undiminished by losses". This follows the carryover add-back inaz_property_tax_credit_capital_gainsand the Montana elderly credit.Military retired pay was added by #10769 and is unchanged.
Who is affected
New Mexico filers who claim the low income comprehensive tax rebate, the property tax rebate for persons 65 or older or the child day care credit, and who have any of the newly counted income, a person-level loss beside another member's income from the same source, or capital losses or a carryover beside capital gains. Modified gross income can only rise under this change (each new entry is floored at zero, and floors per person or per part are never below the old floors), so these rebates and credits fall or are lost, and New Mexico refundable credits fall for those filers. No one's modified gross income falls. A
capital_gainsvalue entered directly with no short- or long-term parts no longer counts; the model's inputs and the household calculator use the parts.Tests
Moved from #10812 (
nm_modified_gross_income_audit.yaml), all 14 cases, intonm_modified_gross_income.yaml: farm income (36,000), partnership income (32,000), one spouse's business loss (30,000), capital losses don't reduce gains (10,000), capital gain distributions (20,500), general assistance (8,000), workers' compensation (28,000), disability benefits (26,000), discharge of indebtedness (25,000), gross gambling winnings (24,000), cash gifts (22,000), scholarships (24,000), miscellaneous income (21,500) and excluded foreign earned income (30,000). Comments keep the arithmetic and citations, now with PIT-RC line numbers; the "main:" values are dropped. The review listed no rewrites for these cases.Added, with arithmetic in each comment:
nm_modified_gross_income.yaml: a farm loss doesn't reduce wages (20,000); one spouse's capital loss doesn't reduce the other's gain (10,000); a carryover hides part of the year's gain (2,000 + 5,000 = 7,000); a carryover larger than the year's gain restores only the gain (20,000 + 3,000 = 23,000); a long-term loss for the year with a carryover counts as zero (20,000); a Form 4797 gain counts (23,000) and a Form 4797 loss is floored for the tax unit (20,000).nm_property_tax_rebate_eligibility.yaml: a 70-year-old with 12,000 of Social Security and 4,000 of workers' compensation is at the 16,000 limit (eligible), and with 4,001 is just above it (ineligible).Existing tests changed:
nm_modified_gross_income.yaml, "NM mixed positive and negative income sources" (2024): 105,000 → 115,000. The short-term gain of 10,000 no longer nets against the long-term loss of 15,000: 100,000 interest + max(10,000, 0) + max(−15,000 + 0, 0) + 5,000 dividends = 115,000 (PIT-RC line 9). The old value let a capital loss reduce a gain, which the law bars.Not in this PR
Other New Mexico gaps in the #10812 audit, left for later:
nm_ssi_state_supplement) under public assistance.pell_grant) besideeducational_assistance.strike_benefits,survivor_benefits,gi_cash_assistance,pfml_benefits.pension_incomealready holds.debt_reliefcan't be separated (PIT-RC line 11 leaves them out); losses netted inside one person's input (several businesses, or Schedule D distributions inside a net long-term loss) can't be undone; no short-term carryover memo exists.axiom: needed (rulespec-us has no us-nm module for NMSA 1978 § 7-2-2(L) or 3.3.1.10 NMAC; rulespec-us#1636 covers only (L)(15); no encoder run was authorized for this PR)
Tested on Modal: run
w1-nm-a, 250/250 passed (241 YAML files: the New Mexico folder, every partner file and every other YAML file with a New Mexico household; plus 9 Python files:test_source_conflicts.py,test_state_estate_income_invariants.py,test_claimable_filer_nm_invariants.py,test_claimable_filer_federal_invariants.py,test_dependent_elsewhere_head_spouse_swap_invariance.py,test_reference_urls.py,test_parameter_yaml_keys.py,test_no_builtin_sum_over_entity_calls.pyandtest_household_spm_resource_parity.py).🤖 Generated with Claude Code