Skip to content

Count Oregon retirement credit and Kids Credit income as the statutes define it - #11174

Merged
hua7450 merged 3 commits into
mainfrom
or-retirement-credit-kids-credit-income
Nov 20, 2026
Merged

hua7450 merged 3 commits into
mainfrom
or-retirement-credit-kids-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

Retirement income credit. or_retirement_credit_household_income added only tax-exempt interest to federal AGI (less taxable Social Security). ORS 316.157(2)(c) (2023 edition, page 25; the 2025 edition at ors316.html has the same lists) also adds a list of otherwise exempt income in (A), and in (B) disallows each category's net loss above $1,000. The model took losses in full and missed most of the (A) items.

Oregon Kids Credit. or_ctc phased out on or_agi alone. ORS 315.273(1)(c)(A), as amended by Oregon Laws 2025, chapter 321, section 16 (page 7), defines the qualifying income limit as Oregon-modified AGI plus "(i) Losses of the taxpayer, to the extent that those losses exceed $20,000; and (ii) Foreign earned income ... that is excluded from adjusted gross income." The loss add-back has been in the law since HB 3235 (2023) section 2(1)(c) (page 1). Item (ii) applies to tax years beginning on or after January 1, 2025 (chapter 321, section 17(2), page 8).

What changes

Retirement income credit household income

  • New list retirement_income/household_income/additions.yaml, each entry cited to its ORS 316.157(2)(c)(A) item:

    • (ii) child_support_received;
    • (vii) and (ix) tax_exempt_disability_benefits (accident and health insurance proceeds, sick pay outside AGI; the taxable part is already in AGI);
    • (x) tax_exempt_strike_benefits (Count strike benefits other than gifts in federal gross income #10727 already put taxable strike benefits in AGI);
    • (xi) workers_compensation;
    • (xiii) veterans_benefits;
    • (xiv) ssi: a Social Security Act payment excluded from gross income, and not a section 86 benefit, which is all that (2)(b) and (2)(f) leave out;
    • (xv) welfare payments: tanf (an SPM-unit amount; the tax unit counts its members' shares, so a family grant counts in full), general_assistance, and or_ssp (the Oregon Supplemental Income Program, "Yes" on the OR-17 checklist, page 128);
    • (xvii) tax_exempt_interest_income (already counted);
    • (xix) section_911_excluded_income.
  • Whose income. (2)(b) counts "the aggregate income of the taxpayer and the spouse". The formula now sums the additions over the head and spouse with tax_unit_non_dep_add. The exception is child support ("received by the taxpayer", but it may be recorded on the child), which household_income/filer_amounts_recorded_on_dependents.yaml lists. Before, adds summed every member, so a dependent's tax-exempt interest counted, and with SSI on the list a dependent's SSI would have counted too.

  • Loss limit. New variable or_retirement_credit_disallowed_losses and parameter household_income/loss_limit.yaml ($1,000). For each of the four categories in (B)(i)-(iv), it adds back max(net loss − 1,000, 0). The net loss is the head's and spouse's, as deducted in AGI:

    • (i) dispositions: Form 1040 line 7a (filer_loss_limited_net_capital_gains, so only the capital loss deducted under IRC 1211(b) counts) plus Form 4797 (other_net_gain);
    • (ii) farms: farm_operations_income;
    • (iii) trade or business: total_self_employment_income and partnership_s_corp_income (the model does not split partnership income by activity);
    • (iv) rents, royalties and other income: rental_income, farm_rent_income, estate_income.

    This follows Publication OR-17, page 107: "Combine all income from similar sources for net income or loss. Any net loss from the source is limited to $1,000." The section 461(l) limit isn't applied to the add-back; it binds only on losses far above the credit's income limits, where the credit is zero either way.

  • Capital loss carryover (source conflict, ruled). Publication OR-17 (page 107, and "Capital loss carryover No" on the checklist, page 127) disallows capital loss carryforwards. The statute disallows net operating loss carryovers by name ((B)(v)) but no capital loss carryover, and an IRC 1212(b) carryover nets inside the year's dispositions. Under the statute-first rule the ruling follows the statute: the carryover is not added back. I recorded it in source_conflicts/candidates.yaml as us-or:retirement-credit-capital-loss-carryover (step 1 of CONTRIBUTING's "Source conflicts"; no marker yet).

Oregon Kids Credit qualifying income

  • New variable or_ctc_qualifying_income, read by or_ctc in place of or_agi. It is or_agi (worksheet line 1) plus losses above $20,000 plus the parameter list ctc/qualifying_income/additions.yaml, which is empty before 2025 and holds section_911_excluded_income from 2025 (worksheet line 12, Schedule 1 line 8d).
  • New parameter ctc/qualifying_income/loss_threshold.yaml ($20,000; ORS 315.273(5) indexes only the credit amount and the phase-out start, so it is fixed).
  • Losses follow the worksheet's Part B lines (2025 Form OR-40 instructions, page 24; the same lines 10a-10e on 2023 page 19 and 2024 page 20). Each line counts only if it is a loss, for the head and spouse:
    • 11a, Form 1040 line 7a: filer_loss_limited_net_capital_gains;
    • 11b, Schedule 1 line 3: total_self_employment_income;
    • 11c, Schedule 1 line 4: other_net_gain;
    • 11d, Schedule 1 line 5: rental_income, farm_rent_income, partnership_s_corp_income, estate_income;
    • 11e, Schedule 1 line 6: farm_operations_income.
  • The 2023 and 2024 worksheets have no exclusion line, so the statute and the forms agree that foreign earned income counts only from 2025 (audit.csv's TWO-READINGS row is out of date).
  • The reduction/start.yaml description now says "qualifying income" instead of "Oregon adjusted gross income".
  • Compatibility with Apply Oregon deductions for tips, overtime and 2025 vehicle interest #11142 (tips and overtime): Apply Oregon deductions for tips, overtime and 2025 vehicle interest #11142 applies the Schedule 1-A subtractions in or_taxable_income, after or_agi. Since or_ctc_qualifying_income starts from or_agi, those subtractions stay out of qualifying income, which matches worksheet line 2. The or_ctc case Apply Oregon deductions for tips, overtime and 2025 vehicle interest #11142 adds (AGI 30,000, subtractions 3,500, expected 325.50) gives the same result on this branch. Apply Oregon deductions for tips, overtime and 2025 vehicle interest #11142 inserts its case at the top of or_ctc.yaml and this PR appends at the end, and the two PRs change different Python files.

Who is affected

  • Retirement income credit (nonrefundable; filers 62 or older with pension income). Household income rises, so the credit falls or ends and Oregon tax rises, for filers whose household has veterans' benefits, workers' compensation, child support, SSI or the state supplement, TANF or general assistance, tax-exempt disability or strike benefits, or excluded foreign income, or a net loss above $1,000 in a category. Household income falls slightly (credit up) where a dependent had tax-exempt interest, which no longer counts.
  • Oregon Kids Credit (refundable; children under 6). Qualifying income rises, so the credit falls or ends, for filers whose losses on the worksheet lines total more than $20,000 (from 2023) or who exclude foreign earned income (from 2025).

Tests

  • Moved from Audit state credit income definitions against the law (CI run, do not merge) #10812 into a new or_retirement_credit_household_income.yaml: all 11 retirement cases (veterans' benefits, workers' comp, child support, SSI, general assistance, strike benefits, disability, business loss, capital loss, capital loss carryover, foreign earned income). Expected values are unchanged except the carryover case, which now expects 10,000 under the statute ruling, as a regression test with the conflict explained in its comment. The filers are now 63 rather than 65, because at 65 PolicyEngine computes SSI for a low-income filer, and SSI now counts. The strike benefits case passes since Count strike benefits other than gifts in federal gross income #10727 (taxable benefits in AGI); I kept it and added the review's tax-exempt case (tax_exempt_strike_benefits 2,000, expected 12,000).
  • Moved the Kids Credit business loss case into or_ctc.yaml (expected 0; qualifying income 50,000).
  • Added (retirement): a business loss of exactly 1,000 (no add-back) and of 1,001 (adds back 1); a 10,000 capital loss (only the 3,000 deducted counts: adds back 2,000); a couple whose categories net separately (business adds back 3,000, rents 3,000 − 6,000 add back 2,000, a 500 farm loss nothing: 12,500 + 5,000 = 17,500); a dependent's SSI (not counted); child support recorded on the child (counted); SPM-unit TANF for a grandparent and grandchild (counted in full). In or_retirement_credit.yaml, an end-to-end 66-year-old with a 14,000 pension and 4,000 veterans' benefits: household income 18,000, credit (7,500 − 3,000) × 9% = 405 (675 on main).
  • Added (Kids Credit): losses of exactly 20,000 (full 1,050) and 21,000 (840); a capital loss limited to 3,000 plus an 18,000 rental loss (840); the review's foreign earned income case (or_agi 20,000, exclusion 10,000: (30,000 − 26,550)/5,000 = 69%, 1,050 × 0.31 = 325.50); the same inputs in 2024 (full 1,000); a 2023 loss add-back (27,500: 500).
  • Existing tests: no expected value changed.

Not in this PR

Oregon's other #10812 audit rows:

  • Retirement credit: the nontaxable part of pensions beyond return of investment and Roth distributions (two readings); railroad tier 2 (no tier input on main; Tax railroad retirement benefits under IRC 86 and 72(r) and subtract them from state income #10696); gifts, inheritances, life insurance, personal injury damages and parental support; exempt military pay, nontaxable dividends and ministers' rental allowances (no inputs); depreciation above $5,000 and net operating loss carryovers ((B)(v)-(vi), no inputs); the Oregon income tax refund that (C)(ii) excludes (salt_refund_income covers every state); alimony outside AGI (two readings).
  • Kids Credit: the tip, overtime and vehicle interest add-back (worksheet line 2, Apply Oregon deductions for tips, overtime and 2025 vehicle interest #11142); the bar on married filing separately (ORS 315.273(3)(c)); nonresident and part-year income ((1)(c)(B)); worksheet lines 11f (net operating loss) and 11g (Oregon subtraction codes 321 and 355-357), which have no inputs.

Tested on Modal: run w1-or-a, 223/223 passed (220 YAML files: the Oregon test folder and every partner test; and 3 pytest files: the source-conflict guard, the Oregon/Maine/Hawaii claimable-filer invariants and the Kids Credit sunset tests). After the second commit, which only adds this PR's link to the source-conflict candidate, run w1-or-b re-ran the source-conflict guard and the new household income file: 2/2 passed.

🤖 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 (d095dc3).
⚠️ Report is 238 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #11174   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         4    +3     
  Lines           24        83   +59     
  Branches         0         3    +3     
=========================================
+ Hits            24        83   +59     
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 00:13

@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 income measures match the statutes and the Department of Revenue worksheets for every item the PR encodes: the Kids Credit under ORS 315.273 and the retirement income credit under ORS 316.157, which carries its own definition of household income. The source-conflict entry is sound (OAR 150-316-0225 has no carryover rule, so the statute governs). There is no double counting against AGI, no circular read and no new input, and no existing case changed. Two fixes before I approve.

Before merge

  1. The ORS 316.157 citations point at page 25, but half the cited text is on page 26. In the 2023 edition PDF, page 25 ends with (2)(c)(B)(iii). Page 26 opens with (iv) and (v) ("The amount of any net operating loss carryovers or carrybacks included in federal adjusted gross income") and also holds (C), (d) and (f). That affects loss_limit.yaml (lines 9-10), or_retirement_credit_household_income.py, or_retirement_credit_disallowed_losses.py and the source_conflicts/candidates.yaml entry, whose deciding text is (B)(v). Please cite pages 25-26 (href on page 25, title ending #page 25-26).
  2. The loss add-back uses raw business losses. or_retirement_credit_disallowed_losses.py (lines 65-66) adds back the loss above $1,000 from the inputs, but federal AGI deducts business losses only up to the section 461(l) cap (313,000 single in 2025). Above the cap the formula adds back loss AGI never held. Code trace, not run: 2025, single, age 63, pension 12,000, business loss 400,000 gives household income 98,000 and no credit; with only the deducted loss added back it is 11,000 and a 675 credit, which is also what main gives. The capital loss side already uses the amount deducted. Subtracting excess_business_loss from the business add-back, floored at zero, fixes it; please add one case.

Optional

  • Life insurance proceeds. ORS 316.157(2)(c)(A)(vi) adds them and life_insurance_benefits exists, but the list leaves them out (so did main). A $14,000 pension with $10,000 of proceeds gets $675 where the statute gives $0.
  • Kids Credit loss floor. All seven new cases would still pass if the lines were netted together; one case with a gain on one line and a loss on another would pin the per-line floor.
  • References. Several lists repeat one PDF with different pages (Publication OR-17, Oregon Laws 2025 chapter 321, the 2025 OR-40 instructions); one entry each with a page-range title fits the repo style.
  • TANF. SPM-unit tanf is split by head count when the SPM unit holds several tax units, so another family's grant can land in the retiree's household income.
  • Section 911. section_911_excluded_income includes the Form 2555 housing deduction, which neither statute adds.
  • filer_amounts_recorded_on_dependents is a data-recording convention (child support recorded on a child); its description reads as an Oregon rule.
  • Register entry. years.from: 2024 is narrower than the 2018 parameters.

DTrim99 and others added 3 commits November 20, 2026 11:07
…es define it

The retirement income credit's household income now adds the otherwise
exempt income ORS 316.157(2)(c)(A) lists (child support, tax-exempt
disability and strike benefits, workers' compensation, veterans' benefits,
SSI, TANF, general assistance, the state supplement and excluded foreign
income) for the taxpayer and spouse, and adds back each category's net loss
above $1,000 under (2)(c)(B). A capital loss carryover is not added back,
following the statute over Publication OR-17; the conflict is recorded as a
source-conflict candidate.

The Oregon Kids Credit now phases out on qualifying income under ORS
315.273(1)(c)(A): Oregon-modified AGI plus worksheet losses above $20,000
and, from 2025, excluded foreign earned income.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…back losses AGI never deducted

ORS 316.157(2)(c)(B)(iv) through (2)(d) sit on PDF page 26, so the
loss-limit parameter, both variables and the source-conflict entry now
cite pages 25-26. The disallowed-loss add-back now subtracts the
section 461(l) excess business loss, which AGI never deducted, and a
new test pins a $400,000 Schedule C loss case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99
DTrim99 force-pushed the or-retirement-credit-kids-credit-income branch from 33d881a to d095dc3 Compare November 20, 2026 16:09
@DTrim99

DTrim99 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks, Ziming. Fixed in d095dc3, rebased on main.

Fixed (your "Before merge" items)

  1. Pages 25-26. The ORS 316.157 citations in loss_limit.yaml (title ends #page 25-26, link still opens page 25), both retirement credit variables and the candidates.yaml entry now cite pages 25-26. I checked the 2023 PDF: page 25 ends at (2)(c)(B)(iii), and page 26 holds (iv), (v), (C), (d), (e) and (f). additions.yaml and filer_amounts_recorded_on_dependents.yaml cite only page-25 text, so they're unchanged.

  2. Losses AGI never deducted. or_retirement_credit_disallowed_losses now returns max_(0, disallowed_losses - excess_business_loss). I subtracted the excess from the total add-back rather than the business line alone. excess_business_loss aggregates Schedule C, farm, rental, estate, partnership/S-corp and Form 4797 losses, so it is exactly the loss AGI doesn't deduct. Subtracting it from the business line alone would still over-count a large farm or rental loss. A 400,000 farm loss gives household income 11,000 and a 675 credit this way, against 98,000 and no credit with the business line only. The capital-loss line can't be reduced by this.

    New case, from your trace (2025, single, age 63, pension 12,000, business loss 400,000):

    Figure Value
    Excess business loss 87,000
    AGI -301,000
    Add-back 312,000
    Household income 11,000
    Credit 675

Skipped (optional, not in this round): life insurance proceeds, the Kids Credit per-line floor test, reference consolidation, the TANF split, Section 911, the filer_amounts_recorded_on_dependents description and the register's years.from.

Verification: the Oregon retirement credit and Kids Credit tests pass locally after the rebase (62/62), as do the source-conflicts tests (251/251). An independent check confirmed the pages and the new figures by hand. It also tested a farm loss, a Schedule C loss plus a capital loss, and a large Form 4797 loss offset by gains.

@DTrim99
DTrim99 requested a review from hua7450 November 20, 2026 16:09

@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 fixes are in. The ORS 316.157 citations now give pages 25-26, including the register entry, and the business loss add-back subtracts excess_business_loss, so loss AGI never deducted isn't added back. The new case pins it (pension 12,000 with a 400,000 business loss gives household income 11,000 and a 675 credit). Comparing the PR's own diff before and after the rebase, those are the only changes. Approving.

@hua7450
hua7450 merged commit 070cae3 into main Nov 20, 2026
40 checks passed
@hua7450
hua7450 deleted the or-retirement-credit-kids-credit-income branch November 20, 2026 17:55
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