Skip to content

Count SSI and net Schedule E losses in Maine fairness credit income - #11185

Merged
hua7450 merged 5 commits into
mainfrom
me-fairness-credit-income
Nov 23, 2026
Merged

hua7450 merged 5 commits into
mainfrom
me-fairness-credit-income

Conversation

@DTrim99

@DTrim99 DTrim99 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #10812 (state credit income audit).

What was wrong

me_sales_and_property_tax_fairness_credit_income added irs_gross_income, tax_exempt_social_security and tax_exempt_interest_income. Two parts of the statute's income were wrong.

SSI never counted. 36 M.R.S. 5213-A(1)(B)(3) and 5219-KK(1)(D)(3) add "Payments received under the federal Social Security Act and railroad retirement benefits to the extent not included in federal adjusted gross income". The Schedule PTFC/STFC instructions for line 1a, which line 2b points to, say "all payments received under the federal Social Security Act, including regular social security benefits, social security disability benefits and supplemental security income" (2025, page 3; 2021, page 3).

Schedule E losses were dropped before they were combined. 5213-A(1)(B)(1) and 5219-KK(1)(D)(1) add back "Trade or business losses; capital losses; any net loss resulting from combining the income or loss from rental real estate and royalties, the income or loss from partnerships and S corporations; the income or loss from estates and trusts, the income or loss from real estate mortgage investment conduits and the net farm rental income or loss; any loss associated with the sale of business property; and farm losses included in federal adjusted gross income". Schedule PTFC/STFC line 3 adds federal total income (line 2a, Form 1040 line 9) and line 2d: "the amount of any negative amount (net loss) included on federal Form 1040 or Form 1040-SR, line 7 and federal Schedule 1, lines 3, 4, 5, 6, and 8a through 8z" (2025, pages 1 and 4; the 2021 schedule has the same lines). irs_gross_income drops each person's loss from each source on its own, so a rental loss never offset partnership income on Schedule 1 line 5, and the partnership income reached the credit income in full. The statute nets only these Schedule E items ("any net loss resulting from combining"). Trade or business, capital and farm losses are added back in full, which main already does.

What changes

  • A new variable, me_fairness_credit_ssi, the head's and spouse's SSI, is added to income_sources.yaml. MRS Rule 813 .01(B) and (C) base the credit on the claimant's "individual income" or a married couple's "joint income", and .03 on "the taxpayer's federal adjusted gross income" (pages 1 and 4), so a tax unit dependent's SSI is the dependent's own.
  • A new variable, me_fairness_credit_federal_income, replaces irs_gross_income in the list. It starts from irs_gross_income and, for Schedule 1 line 5 only, subtracts the losses that offset income on that line: the smaller of the line's income and its losses, over the head and spouse together. Only the line's net loss is added back. Every other source stays as in irs_gross_income, each person's loss from each source left out, so trade or business, capital and farm losses are added back in full. One more piece completes that for capital losses. capital_gains adds a person's short-term and long-term results before irs_gross_income floors them, so a new helper, me_fairness_credit_netted_capital_loss, adds back the loss absorbed by the same filer's other-term gains, for the head and spouse. It handles Schedule D line 13 distributions and the prior-year long-term carryover the same way as Vermont's Add back losses and listed deductions in Vermont renter credit income #11178.
  • The line 5 sources are a parameter list under gov.states.me.tax.income.credits.fairness.federal_lines:
Federal line Sources Federal source
Schedule 1 line 5 rental_income, partnership_s_corp_income, estate_income, farm_rent_income 2025 Schedule E, page 2, line 41: "Combine lines 26, 32, 37, 39, and 40", the same items the statute lists (REMICs have no input)

Only sources that federal gross income counts are netted, so a reform that drops a source from gross income stays consistent. A tax unit dependent's items stay out, as in irs_gross_income.

Reading for lines 3, 6 and 7 (statute over the schedule). Schedule PTFC/STFC line 2d adds back only the net loss on Form 1040 line 7 and Schedule 1 lines 3 and 6, as well as line 5. The statute says "net loss resulting from combining" only for the Schedule E items, and adds back trade or business, capital and farm losses "included in federal adjusted gross income" without netting. Following CONTRIBUTING ("Source conflicts"), the model follows the statute on lines 3, 6 and 7 and keeps main's treatment there. The conflict is registered as us-me:fairness-credit-loss-add-backs (2021-2025; the 2024 schedule has the same line 2d text). The two readings differ for a return with two Schedule C businesses (or two farms) of opposite sign, or spouses with opposite capital results. A first version of this PR followed the schedule on those lines, and review moved it to the statute.

Who is affected

Maine residents claiming the property tax fairness credit or the sales tax fairness credit (both refundable credits against Maine income tax):

  • Filers whose head or spouse receives SSI: income rises by that SSI, so the credits fall or stay the same.
  • Filers with a loss and income from another Schedule E item on Schedule 1 line 5 (for example a rental loss and partnership income): income falls, so the credits rise or stay the same.

Both new variables leave a tax unit dependent's SSI and losses out. The list itself is still summed over every member, so a dependent's nontaxable Social Security and tax-exempt interest still count, as on main; #10647 and #9894 switch that sum to the head and spouse, and both new entries are tax-unit amounts that work unchanged under that switch. An earlier commit here listed ssi itself, summed over every member, and CI's test_dependent_retirement_income_state_invariants.py caught it: an elderly dependent's pension lowered the dependent's own SSI, which lowered the family's credit income and raised the credit.

Tests

Moved from #10812 (me_sales_and_property_tax_fairness_credit_income_audit.yaml) into a new me_sales_and_property_tax_fairness_credit_income.yaml (main has no such file; #10722 and #10647 create it too), values unchanged:

  • SSI counts (13,000).
  • A rental loss absorbed by partnership income on Schedule 1 line 5 is not added back (25,000).

Added, with arithmetic in each comment:

  • Same file: a dependent child's SSI stays out of the parent's income (20,000, not 26,000); a joint spouse's SSI counts (13,000); SSI lowers a senior renter's property tax fairness credit (income 13,000, credit 1,280 rather than 1,400; sales tax credit 155); wages plus SSI exactly at the single phase-out start of 25,450 (credit 155) and 1 dollar above (145); a rental loss that exactly offsets partnership income leaves income at 25,450 (155), and a loss 1 dollar smaller leaves 25,451 (145).
  • New me_fairness_credit_federal_income.yaml, 10 cases, including one for a source a reform takes out of federal gross income (23,000): a Schedule 1 line 5 net loss is added back only to zero (20,000); estate and farm rental losses net with rental income (3,000); a loss on one line does not offset another (25,000); a dependent's rental loss stays on the dependent's return (10,000). Off line 5, losses are added back in full: two kinds of Schedule C business (10,000), joint spouses' Schedule C (30,000), farm (8,000) and capital (30,000) results, and capital gain distributions with a capital loss (22,000).
  • me_fairness_credit_federal_income.yaml, within one filer: a 2025 single filer with 20,000 of wages, a 10,000 long-term gain and a 4,000 short-term loss gives 30,000, the same as splitting those items across spouses. Also cases for line 13 distributions, a long-term carryover, capital_gains given without its parts, and a dependent's own netting (left out).
  • me_sales_and_property_tax_fairness_credit_income.yaml, the two review examples: 10,000 of Schedule C income with a 3,000 SSTB loss gives 10,000, and joint spouses with a 10,000 capital gain and a 4,000 capital loss give 10,000.

Existing tests changed: inputs only, no expected value. me/tax/income/integration.yaml, case "taxsim_record_22242_2024.yaml (Property Tax Fairness Credit Debug)": the 77-year-old spouse has only 847.58 of interest and dividends between the two of them, so the model computes about 11,139 of SSI for her. Counting it cut the property tax fairness credit by 4% of that (445.57), and me_income_tax came out -924.43 instead of -1,370 (run w1-me-a). The case reproduces a TAXSIM record, which holds tax inputs only, and it already sets snap: 0 and tanf: 0 for that reason; it now sets ssi: 0 for both people as well, and -1,370 stands.

Not in this PR

axiom: needed (rulespec-us has no us-me module for 36 M.R.S. 5219-KK, and its 5213-A module does not encode the (1)(B) income definition; no encoder run was authorized for this PR)

After the review fixes, tested locally: the two changed test files (21), the Maine fairness credit directory and the Maine integration file (34), the Maine invariant tests (16) and test_source_conflicts.py (251) all pass. Before them, tested on Modal: run w1-me-c, 251/251 passed (249 YAML files: the Maine folder, every partner file, the changed files and the 20 tests outside the Maine folder with a Maine household; plus test_source_conflicts.py and test_dependent_retirement_income_state_invariants.py, 4 of 4). Run w1-me-a failed only the integration case above.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #11185   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         3    +2     
  Lines           24        64   +40     
  Branches         0         2    +2     
=========================================
+ Hits            24        64   +40     
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.

@DTrim99
DTrim99 requested a review from hua7450 November 20, 2026 04:31

@hua7450 hua7450 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, David. Counting the head's and spouse's SSI, leaving out Maine's state supplement and netting the Schedule E items on Schedule 1 line 5 all match 36 M.R.S. 5213-A and 5219-KK. The per-line arithmetic, max(net, 0) per line, equals Schedule PTFC/STFC line 2a plus line 2d. SSI adds no cycle, no new inputs are added, and all 20 new expected values check by hand. Two fixes before I approve.

Before merge

  1. Netting on Schedule 1 lines 3 and 6 and Form 1040 line 7. The statute adds back "Trade or business losses; capital losses; ... and farm losses included in federal adjusted gross income". It keeps "any net loss resulting from combining" for the Schedule E items only, which suggests the other losses are added back gross. The PR follows Schedule PTFC/STFC line 2d, which adds back only the net loss on each line. Two examples:

    • $10,000 of Schedule C income and a $3,000 SSTB loss: 7,000 under the PR, 10,000 under the statute (as on main).
    • One spouse with a $10,000 gain and the other with a $4,000 loss.

    The PR body acknowledges this, but CONTRIBUTING ("Source conflicts") says the statute comes first and asks the PR to record any other reading in source_conflicts/candidates.yaml. Please either net only line 5 and keep main's per-source floor for lines 3, 6 and 7, or keep the schedule's netting and add the candidate entry (statute against line 2d, 2021-2025) explaining why it is a true tie.

  2. += in me_fairness_credit_federal_income.py (lines 53-54). The repo style is line_income = line_income + ..., and the same for line_losses. No value is wrong today.

Optional

  • me_fairness_credit_ssi rebuilds tax_unit_non_dep_add by hand; return tax_unit_non_dep_add(tax_unit, period, ["ssi"]) gives the same result.
  • Line 8p (follow-up, same on main). Line 2a is Form 1040 line 9, which includes the Schedule 1 line 8p excess business loss adjustment, and federal total income leaves it out. This only matters for business losses above the section 461(l) threshold (about 313,000 single in 2025).
  • Tests. "SSI is a payment received under the federal Social Security Act." repeats the senior renter SSI case, and the SSI boundary pair re-pins the 25,450 edge the rental-loss pair already covers. The new names also don't follow the "Case N," convention.

@DTrim99
DTrim99 force-pushed the me-fairness-credit-income branch from fbc98f6 to a24bc83 Compare November 20, 2026 21:48
@DTrim99 DTrim99 changed the title Count SSI and net losses by federal line in Maine fairness credit income Count SSI and net Schedule E losses in Maine fairness credit income Nov 20, 2026
@DTrim99

DTrim99 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks, Ziming. Fixed in a24bc83, rebased on main. I updated the title and body to match.

Fixed (your "Before merge" items)

  1. Lines 3, 6 and 7 follow the statute. I took your first option: statute first, per CONTRIBUTING.
    • The netting. me_fairness_credit_federal_income now nets only the Schedule 1 line 5 (Schedule E) items. Everything else comes from main's irs_gross_income, so trade or business, capital and farm losses are added back in full, as on main. The PR's SSI change and its other changes stay.

    • Parameter files. The three that nothing reads any more are gone: schedule_1_line_3.yaml, schedule_1_line_6.yaml and form_1040_line_7.yaml. schedule_1_line_5.yaml stays.

    • Your two examples are new cases in me_sales_and_property_tax_fairness_credit_income.yaml, and both give 10,000:

      • $10,000 of Schedule C income with a $3,000 SSTB loss;
      • joint spouses with a $10,000 capital gain and a $4,000 capital loss.
    • Changed expected values. Five cases in me_fairness_credit_federal_income.yaml had pinned netting off line 5. Only their expected values and names changed, each with a one-line reason:

      Case Was Now
      Schedule C + SSTB loss 7,000 10,000
      Spouse's Schedule C loss 26,000 30,000
      Spouse's farm loss 5,000 8,000
      Spouse's capital loss 26,000 30,000
      Capital gain distributions with a capital loss 20,000 22,000
    • New source_conflicts/candidates.yaml entry us-me:fairness-credit-loss-add-backs. It records the statute against Schedule PTFC/STFC line 2d for 2021-2025, follows: statute. The 36 M.R.S. 5219-KK text is quoted from legislature.maine.gov. The line 2d text is quoted from the 2021, 2022, 2023 and 2025 schedules. I couldn't find a copy of the 2024 schedule, and the entry says it is unchecked.

    • Wording. The documentation, comments and changelog fragment now describe line 5 netting only.

  2. +=. The two lines are now written out (x = x + ...).

Skipped (optional, not in this round):

  • the tax_unit_non_dep_add rewrite of me_fairness_credit_ssi;
  • line 8p, which can be a follow-up;
  • test trimming and "Case N" naming.

Verification:

  • After the rebase, the Maine fairness credit tests and the source-conflict tests pass locally. Before it, the Maine integration file and the Maine invariant tests passed too.
  • An independent check ran seven households through the model and got the results described above: a Schedule E rental gain and loss still net, Schedule C, capital and farm losses come back in full, and a dependent's rental loss stays out.

@DTrim99
DTrim99 requested a review from hua7450 November 20, 2026 21:49

@hua7450 hua7450 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, David. Both items are fixed. Only the Schedule 1 line 5 items net now, the three deleted line parameters have no readers, and no += is left. The us-me:fairness-credit-loss-add-backs entry is complete, and its quotes match 5219-KK and the 2021 and 2025 schedules. The changed and new expected values all check by hand. One gap before I approve.

Before merge

  1. One filer's short-term and long-term results still net against each other. capital_gains adds a person's short-term and long-term gains, and irs_gross_income floors that sum. So, by code trace: a 2025 single filer with $20,000 of wages, a $10,000 long-term gain and a $4,000 short-term loss gets 26,000. Put the same Schedule D items on two spouses of a joint return and the model gives 30,000. The new entry says capital losses are "added back in full", which holds only in the second case. Two existing cases also disagree:

    • 2,000 of distributions with a 5,000 long-term loss gives 22,000;
    • a 2,000 short-term gain with the same loss gives 20,000;

    yet both returns have the same Schedule D, the same −3,000 on line 7 and the same AGI. Main already nets this way, but the PR now registers the opposite reading.

    Please either:

    • add back each filer's negative short-term and long-term amounts separately (the part netted inside one person is max_(0, -st) + max_(0, -lt) - max_(0, -(st + lt)) per head and spouse; the part beyond the gains is already back through irs_gross_income), so the code matches the entry (my preference, since it follows the statute the entry cites); or
    • net capital results across the whole return, both spouses together, and say so in the entry.

    Either way, please add a single-filer case with offsetting short-term and long-term results. PR 11178 has the same question for Vermont, so it's worth answering both the same way.

Optional

  • The 2024 schedule has the same line 2d text on page 4 (found through the Wayback Machine), so the entry's "2024 unchecked" can be dropped.
  • Line 8p. With the statute reading, only the allowed part of a business loss is in AGI, so the model's result matches the statute. The schedule's line 2a route would add the 8p amount. Noting that difference in the entry is optional.
  • Tests. The two new cases in me_sales_and_property_tax_fairness_credit_income.yaml repeat cases in me_fairness_credit_federal_income.yaml.
  • From the first round, still open: the tax_unit_non_dep_add rewrite of me_fairness_credit_ssi.

DTrim99 and others added 5 commits November 23, 2026 09:37
Maine's sales and property tax fairness credits count payments under the
federal Social Security Act, which include SSI (Schedule PTFC/STFC lines 1a
and 2b), and add back only a federal line's net loss (line 2d). The income
now adds ssi and starts from federal total income with each line's net loss
added back, so a rental loss offsets partnership income on Schedule 1 line 5
and spouses' Schedule C, Schedule F and capital results net on their lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the false side of the gross-income-source check in
me_fairness_credit_federal_income, which codecov flagged as a partial line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The income list summed ssi over every tax unit member, so a dependent's SSI
counted in the family's income, and a dependent's pension, by lowering that
SSI, could raise the credit. Rule 813 bases the credits on the claimant's
individual income or a married couple's joint income, so the list now holds
me_fairness_credit_ssi, the head's and spouse's SSI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…credit income, per 36 M.R.S. 5219-KK

Federal income for the Maine sales and property tax fairness credit is now
irs_gross_income minus the netted Schedule 1 line 5 losses. Other federal
lines keep losses floored per source, as 36 M.R.S. 5213-A(1)(B)(1) and
5219-KK(1)(D)(1) provide. Removes the unused line 3, line 6 and Form 1040
line 7 parameters, updates the affected test expectations, adds the
reviewer examples, and records the statute vs. form line 2d conflict in
source_conflicts/candidates.yaml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er's gains in Maine fairness credit income

Add me_fairness_credit_netted_capital_loss, which adds back the capital
losses that one filer's short-term/long-term netting absorbs (including
Schedule D line 13 distributions and the line 14 long-term carryover),
for the head and the spouse, so every capital loss in federal AGI comes
back once. Extend the YAML cases, the source-conflict entry, and the
changelog fragment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99
DTrim99 force-pushed the me-fairness-credit-income branch from a24bc83 to e83633e Compare November 23, 2026 14:40
@DTrim99

DTrim99 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks, Ziming. Fixed in e83633e, rebased on main. I took your preferred option and answered it the same way as Vermont's #11178. I updated the PR body and changelog to match.

Fixed (your "Before merge" item)

  1. One filer's short-term and long-term results no longer net away a loss.

    • New helper. For the head and spouse, me_fairness_credit_netted_capital_loss adds back the capital loss absorbed by the same person's other-term gains. It handles Schedule D line 13 distributions and the prior-year long-term carryover the same way as Add back losses and listed deductions in Vermont renter credit income #11178's Vermont helper, and when only capital_gains is given, that stands in for long-term gains.
    • Exactness. The rest of each filer's loss already comes back through irs_gross_income's per-person floor. So irs_gross_income plus the helper equals each filer's gross capital gains: every capital loss in AGI comes back exactly once.
    2025 case Before After
    Single filer: $20,000 wages, $10,000 LT gain, $4,000 ST loss 26,000 30,000
    The same items split between spouses 30,000 30,000
    $2,000 distributions without Schedule D, $5,000 LT loss (existing case) 22,000 22,000
    $2,000 ST gain, $5,000 LT loss (your trace) 20,000 22,000
    • New cases. The single-filer case is appended, plus one for each new branch: line 13 distributions, the carryover, capital_gains given without its parts, and a dependent's own netting (left out). No existing expected value changed.
    • Register entry and docs. The entry and the variable docs now say "added back in full" accurately. "Cannot be separated" covers only losses inside one input: two sales in one holding period, or a short-term carryover inside the short-term input.

Also done (your optional item): I found the 2024 Schedule PTFC/STFC through the Wayback Machine, and its page 4 has the same line 2d text. The entry now covers 2021-2025, with no "2024 unchecked".

Skipped (optional, not in this round):

  • the line 8p note;
  • the two duplicate cases in me_sales_and_property_tax_fairness_credit_income.yaml;
  • the tax_unit_non_dep_add rewrite of me_fairness_credit_ssi.

Verification:

  • After the rebase, the Maine fairness credit tests (35) and the source-conflict tests (251) pass locally. Before it, the property and sales fairness folders (87) and the Maine invariant tests passed.
  • An independent check ran 19 households through the model. In every case Maine income equals gross income plus the helper, with no double count.

@hua7450 hua7450 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, David. me_fairness_credit_netted_capital_loss now adds back the loss netted inside one filer, so each filer's income carries gross capital gains. That matches the statute and the register entry. Last round's examples now agree: 30,000 for the single filer and for the same items split between spouses, and 22,000 for both cases that disagreed. The 3,000 limit still holds and nothing is counted twice. Approving.

Optional:

  • PR body. It still says main already adds capital losses back in full, and "Who is affected" leaves out filers whose income now rises.
  • Shared helper (follow-up). The new helper repeats Vermont's within-person netting from PR 11178 line for line. Once both are merged, one federal calculation could replace the two.
  • Earlier optional items, still open: the 2024 schedule in the entry's sources, the tax_unit_non_dep_add rewrite of me_fairness_credit_ssi, and the duplicate test cases.

@hua7450
hua7450 merged commit 1dbf376 into main Nov 23, 2026
40 checks passed
@hua7450
hua7450 deleted the me-fairness-credit-income branch November 23, 2026 18:23
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.

2 participants