Repository navigation
Count Oregon retirement credit and Kids Credit income as the statutes define it - #11174
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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. 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
- 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.pyand thesource_conflicts/candidates.yamlentry, whose deciding text is (B)(v). Please cite pages 25-26 (href on page 25, title ending#page 25-26). - 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. Subtractingexcess_business_lossfrom 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_benefitsexists, 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
tanfis 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_incomeincludes the Form 2555 housing deduction, which neither statute adds. filer_amounts_recorded_on_dependentsis a data-recording convention (child support recorded on a child); its description reads as an Oregon rule.- Register entry.
years.from: 2024is narrower than the 2018 parameters.
…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>
33d881a to
d095dc3
Compare
|
Thanks, Ziming. Fixed in d095dc3, rebased on main. Fixed (your "Before merge" items)
Skipped (optional, not in this round): life insurance proceeds, the Kids Credit per-line floor test, reference consolidation, the TANF split, Section 911, the 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. |
hua7450
left a comment
There was a problem hiding this comment.
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.
Part of #10812 (state credit income audit).
What was wrong
Retirement income credit.
or_retirement_credit_household_incomeadded 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_ctcphased out onor_agialone. 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:child_support_received;tax_exempt_disability_benefits(accident and health insurance proceeds, sick pay outside AGI; the taxable part is already in AGI);tax_exempt_strike_benefits(Count strike benefits other than gifts in federal gross income #10727 already put taxable strike benefits in AGI);workers_compensation;veterans_benefits;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;tanf(an SPM-unit amount; the tax unit counts its members' shares, so a family grant counts in full),general_assistance, andor_ssp(the Oregon Supplemental Income Program, "Yes" on the OR-17 checklist, page 128);tax_exempt_interest_income(already counted);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), whichhousehold_income/filer_amounts_recorded_on_dependents.yamllists. Before,addssummed 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_lossesand parameterhousehold_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:filer_loss_limited_net_capital_gains, so only the capital loss deducted under IRC 1211(b) counts) plus Form 4797 (other_net_gain);farm_operations_income;total_self_employment_incomeandpartnership_s_corp_income(the model does not split partnership income by activity);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.yamlasus-or:retirement-credit-capital-loss-carryover(step 1 of CONTRIBUTING's "Source conflicts"; no marker yet).Oregon Kids Credit qualifying income
or_ctc_qualifying_income, read byor_ctcin place ofor_agi. It isor_agi(worksheet line 1) plus losses above $20,000 plus the parameter listctc/qualifying_income/additions.yaml, which is empty before 2025 and holdssection_911_excluded_incomefrom 2025 (worksheet line 12, Schedule 1 line 8d).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).filer_loss_limited_net_capital_gains;total_self_employment_income;other_net_gain;rental_income,farm_rent_income,partnership_s_corp_income,estate_income;farm_operations_income.reduction/start.yamldescription now says "qualifying income" instead of "Oregon adjusted gross income".or_taxable_income, afteror_agi. Sinceor_ctc_qualifying_incomestarts fromor_agi, those subtractions stay out of qualifying income, which matches worksheet line 2. Theor_ctccase 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 ofor_ctc.yamland this PR appends at the end, and the two PRs change different Python files.Who is affected
Tests
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_benefits2,000, expected 12,000).or_ctc.yaml(expected 0; qualifying income 50,000).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).Not in this PR
Oregon's other #10812 audit rows:
salt_refund_incomecovers every state); alimony outside AGI (two readings).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, runw1-or-bre-ran the source-conflict guard and the new household income file: 2/2 passed.🤖 Generated with Claude Code