From 4933997685c7f8c8353cf7d54730743f88cf17a6 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 09:44:24 -0400 Subject: [PATCH 01/17] WIP: Oregon federal tax subtraction follows the OR-17 worksheet credits Co-Authored-By: Claude Opus 5.5 --- .../refundable_credits.yaml | 50 +++++++++++++++++++ .../or_federal_tax_liability_subtraction.py | 43 ++++++++++------ 2 files changed, 78 insertions(+), 15 deletions(-) create mode 100644 policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml diff --git a/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml b/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml new file mode 100644 index 00000000000..3829be75b83 --- /dev/null +++ b/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml @@ -0,0 +1,50 @@ +description: Oregon reduces the federal income tax liability it subtracts by these federal refundable credits. +values: + # Federal tax worksheet, Part A, of each year's Publication OR-17. The earned + # income credit is never listed (ORS 316.685(1)(b)), and outside 2021 neither + # is the additional child tax credit. + 2017-01-01: + - refundable_american_opportunity_credit # Line 6 + - assigned_aca_ptc # Line 7 (Form 8962, line 24) + 2020-01-01: + - refundable_american_opportunity_credit # Line 6 + - assigned_aca_ptc # Line 7 (Form 8962, line 24) + - recovery_rebate_credit # Line 8, with the stimulus payments received + 2021-01-01: + # Line 8 is the child tax credit on Schedule 8812, line 14e. Line 2 adds + # back the nonrefundable part that line 1 already nets out. + - refundable_ctc + - refundable_american_opportunity_credit # Line 9 + - recovery_rebate_credit # Line 10, with the stimulus payments received + - assigned_aca_ptc # Line 11 (Form 8962, line 24) + - cdcc # Line 12 (Schedule 3, line 13g) + 2022-01-01: + - refundable_american_opportunity_credit # Line 6 + - assigned_aca_ptc # Line 7 (Form 8962, line 24) + # From 2025, line 7 is the refundable adoption credit (Form 1040, line 30), + # which is not modeled, and the premium tax credit moves to line 8. +metadata: + unit: list + period: year + label: Oregon federal tax liability subtraction refundable credits + reference: + - title: ORS 316.685(1)(b) + href: https://www.oregonlegislature.gov/bills_laws/ors/ors316.html + - title: 2017 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2017.pdf#page=63 + - title: 2018 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2018.pdf#page=68 + - title: 2019 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2019.pdf#page=63 + - title: 2020 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 9 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2020.pdf#page=66 + - title: 2021 Publication OR-17, Federal tax worksheet, Part A, lines 8 to 13 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=72 + - title: 2022 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2022.pdf#page=73 + - title: 2023 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2023.pdf#page=73 + - title: 2024 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2024.pdf#page=71 + - title: 2025 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 9 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 diff --git a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py index 43168c0596f..965331e3c5d 100644 --- a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py +++ b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py @@ -8,24 +8,37 @@ class or_federal_tax_liability_subtraction(Variable): unit = USD definition_period = YEAR reference = ( - "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=71", - "https://www.oregonlegislature.gov/bills_laws/ors/ors316.html", # Subsection 316.800 + # ORS 316.680(1)(b), 316.685 and 316.695(3). + "https://www.oregonlegislature.gov/bills_laws/ors/ors316.html", + # Federal tax worksheet, Part A. + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71", + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=72", ) defined_for = StateCode.OR def formula(tax_unit, period, parameters): - # calculate Oregon concept of federal income tax - federal_itax = tax_unit("income_tax", period) - federal_eitc = tax_unit("eitc", period) - or_federal_income_tax = max_(0, federal_itax + federal_eitc) - # limit subtraction based on caps scaled to federal AGI - filing_status = tax_unit("filing_status", period) - status = filing_status.possible_values p = ( parameters(period) .gov.states["or"] - .tax.income.subtractions.federal_tax_liability.cap + .tax.income.subtractions.federal_tax_liability + ) + # Federal tax worksheet, line 5: federal income tax after nonrefundable + # credits plus the other taxes on Schedule 2, lines 8, 16 and 17. The + # worksheet leaves out the net investment income tax (Schedule 2, line + # 12) and Social Security and Medicare taxes on unreported tips and + # wages (lines 5 and 6; ORS 316.685(3)(a)). + tax_before_refundable_credits = tax_unit( + "income_tax_before_refundable_credits", period + ) - add(tax_unit, period, ["net_investment_income_tax", "unreported_payroll_tax"]) + # Only the refundable credits the worksheet lists reduce the liability. + # The earned income credit never does (ORS 316.685(1)(b)). + refundable_credits = add(tax_unit, period, p.refundable_credits) + or_federal_income_tax = max_( + 0, tax_before_refundable_credits - refundable_credits ) + # limit subtraction based on caps scaled to federal AGI + filing_status = tax_unit("filing_status", period) + status = filing_status.possible_values federal_agi = tax_unit("adjusted_gross_income", period) cap = select( [ @@ -36,11 +49,11 @@ def formula(tax_unit, period, parameters): filing_status == status.SURVIVING_SPOUSE, ], [ - p.single.calc(federal_agi), - p.joint.calc(federal_agi), - p.head_of_household.calc(federal_agi), - p.separate.calc(federal_agi), - p.surviving_spouse.calc(federal_agi), + p.cap.single.calc(federal_agi), + p.cap.joint.calc(federal_agi), + p.cap.head_of_household.calc(federal_agi), + p.cap.separate.calc(federal_agi), + p.cap.surviving_spouse.calc(federal_agi), ], ) return min_(or_federal_income_tax, cap) From cae52810adb9fea043e9370a97b61c5461fe2f72 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 11:32:09 -0400 Subject: [PATCH 02/17] Reduce Oregon's federal tax subtraction by the OR-17 worksheet's refundable credits only ORS 316.680(1)(b) and 316.685; Publication OR-17 federal tax worksheet, Part A (2017-2025). The worksheet starts from Form 1040 line 22 plus the other income taxes on Schedule 2, lines 8, 16 and 17, and subtracts only the American Opportunity credit, the premium tax credit, and in 2020-2021 the recovery rebate credit and (2021) the refundable child tax and child care credits. Main used income_tax + eitc, so it subtracted the additional child tax credit in every year, never subtracted the premium tax credit, and kept the net investment income tax. Co-Authored-By: Claude Opus 5.5 --- ...federal-tax-subtraction-worksheet.fixed.md | 1 + .../or_federal_tax_liability_subtraction.yaml | 138 ++++++++++++++++-- .../or_federal_tax_liability_subtraction.py | 4 +- 3 files changed, 131 insertions(+), 12 deletions(-) create mode 100644 changelog.d/or-federal-tax-subtraction-worksheet.fixed.md diff --git a/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md b/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md new file mode 100644 index 00000000000..33f2b52f04b --- /dev/null +++ b/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md @@ -0,0 +1 @@ +Reduce Oregon's federal tax liability subtraction by the premium tax credit and only the other refundable credits on the Publication OR-17 federal tax worksheet, and leave out the net investment income tax. diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml index 4e8190d3f01..cd07ffd2cd2 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml @@ -4,7 +4,7 @@ state_code: OR filing_status: SINGLE adjusted_gross_income: 80_000 - income_tax: 10_000 + income_tax_before_refundable_credits: 10_000 eitc: 0 output: or_federal_tax_liability_subtraction: 7_050 @@ -15,7 +15,8 @@ state_code: OR filing_status: SINGLE adjusted_gross_income: 80_000 - income_tax: 6_000 + # 6,000 of federal income tax plus the 1,000 EITC it nets out. + income_tax_before_refundable_credits: 7_000 eitc: 1_000 output: or_federal_tax_liability_subtraction: 7_000 @@ -26,7 +27,7 @@ state_code: OR filing_status: SINGLE adjusted_gross_income: 145_000 - income_tax: 10_000 + income_tax_before_refundable_credits: 10_000 eitc: 0 output: or_federal_tax_liability_subtraction: 0 @@ -37,7 +38,7 @@ state_code: OR filing_status: SEPARATE adjusted_gross_income: 80_000 - income_tax: 10_000 + income_tax_before_refundable_credits: 10_000 eitc: 0 output: or_federal_tax_liability_subtraction: 3_525 @@ -48,7 +49,7 @@ state_code: OR filing_status: SEPARATE adjusted_gross_income: 145_000 - income_tax: 10_000 + income_tax_before_refundable_credits: 10_000 eitc: 0 output: or_federal_tax_liability_subtraction: 0 @@ -59,8 +60,8 @@ state_code: OR filing_status: JOINT adjusted_gross_income: 80_000 - income_tax: 10_000 - eitc: 0 + income_tax_before_refundable_credits: 10_000 + eitc: 0 output: or_federal_tax_liability_subtraction: 7_050 @@ -70,7 +71,7 @@ state_code: OR filing_status: JOINT adjusted_gross_income: 290_000 - income_tax: 10_000 + income_tax_before_refundable_credits: 10_000 eitc: 0 output: or_federal_tax_liability_subtraction: 0 @@ -85,7 +86,7 @@ state_code: OR filing_status: SINGLE adjusted_gross_income: 80_000 - income_tax: 10_000 + income_tax_before_refundable_credits: 10_000 eitc: 0 output: or_federal_tax_liability_subtraction: 8_750 @@ -96,7 +97,7 @@ state_code: OR filing_status: JOINT adjusted_gross_income: 255_000 - income_tax: 30_000 + income_tax_before_refundable_credits: 30_000 eitc: 0 output: or_federal_tax_liability_subtraction: 7_000 @@ -107,8 +108,123 @@ state_code: OR filing_status: SEPARATE adjusted_gross_income: 80_000 - income_tax: 10_000 + income_tax_before_refundable_credits: 10_000 eitc: 0 output: # 50% x 8,750 or_federal_tax_liability_subtraction: 4_375 + +# Federal tax worksheet, Part A, 2025 Publication OR-17, PDF pages 71-72: line 5 +# (federal tax after nonrefundable credits plus other income taxes) less the +# American Opportunity, refundable adoption and premium tax credits (lines 6 to +# 9), floored at zero (line 10), then capped (line 12). +- name: Case 11, 2025 premium tax credit reduces the subtraction. + period: 2025 + input: + state_code: OR + filing_status: SINGLE + adjusted_gross_income: 45_000 + income_tax_before_refundable_credits: 4_000 + assigned_aca_ptc: 1_500 + eitc: 0 + output: + # 4,000 - 1,500 + or_federal_tax_liability_subtraction: 2_500 + +- name: Case 12, 2025 additional child tax credit does not reduce the subtraction. + period: 2025 + input: + state_code: OR + filing_status: JOINT + adjusted_gross_income: 60_000 + # Form 1040 line 22 is 0; a 1,000 additional tax on an early retirement + # plan distribution is Schedule 2, line 8 (worksheet line 4). + income_tax_before_refundable_credits: 1_000 + refundable_ctc: 3_000 + assigned_aca_ptc: 0 + eitc: 500 + output: + or_federal_tax_liability_subtraction: 1_000 + +- name: Case 13, 2025 listed credits above the liability floor the subtraction at zero. + period: 2025 + input: + state_code: OR + filing_status: SINGLE + adjusted_gross_income: 40_000 + income_tax_before_refundable_credits: 2_000 + refundable_american_opportunity_credit: 1_000 + assigned_aca_ptc: 1_500 + eitc: 0 + output: + # max(0, 2,000 - 1,000 - 1,500) + or_federal_tax_liability_subtraction: 0 + +- name: Case 14, 2025 net investment income tax and unreported payroll tax are not subtracted. + period: 2025 + input: + state_code: OR + filing_status: SINGLE + adjusted_gross_income: 90_000 + income_tax_before_refundable_credits: 5_000 + # Schedule 2, lines 12 and 5, which worksheet line 4 leaves out. + net_investment_income_tax: 600 + unreported_payroll_tax: 400 + assigned_aca_ptc: 0 + eitc: 0 + output: + # 5,000 - 600 - 400 + or_federal_tax_liability_subtraction: 4_000 + +# 2021 Publication OR-17, PDF page 72: lines 8 to 12 subtract the refundable +# child tax credit, the American Opportunity credit, the recovery rebate credit +# with stimulus payments received, the premium tax credit and the refundable +# child and dependent care credit. +- name: Case 15, 2021 refundable child tax, recovery rebate and child care credits reduce the subtraction. + period: 2021 + input: + state_code: OR + filing_status: JOINT + adjusted_gross_income: 80_000 + income_tax_before_refundable_credits: 9_000 + refundable_ctc: 3_000 + recovery_rebate_credit: 2_800 + cdcc: 1_000 + assigned_aca_ptc: 0 + eitc: 0 + output: + # 9,000 - 3,000 - 2,800 - 1,000 + or_federal_tax_liability_subtraction: 2_200 + +# 2020 Publication OR-17, PDF page 66: line 8 subtracts the stimulus payments +# received plus the recovery rebate credit; the additional child tax credit is +# not listed. +- name: Case 16, 2020 recovery rebate credit reduces the subtraction but the additional child tax credit does not. + period: 2020 + input: + state_code: OR + filing_status: JOINT + adjusted_gross_income: 50_000 + income_tax_before_refundable_credits: 3_000 + recovery_rebate_credit: 2_400 + refundable_ctc: 1_000 + assigned_aca_ptc: 0 + eitc: 0 + output: + # 3,000 - 2,400 + or_federal_tax_liability_subtraction: 600 + +- name: Case 17, 2026 premium tax credit and American Opportunity credit reduce the subtraction. + period: 2026 + input: + state_code: OR + filing_status: HEAD_OF_HOUSEHOLD + adjusted_gross_income: 70_000 + income_tax_before_refundable_credits: 6_000 + refundable_american_opportunity_credit: 1_000 + assigned_aca_ptc: 2_000 + refundable_ctc: 1_700 + eitc: 0 + output: + # 6,000 - 1,000 - 2,000 + or_federal_tax_liability_subtraction: 3_000 diff --git a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py index 965331e3c5d..9081a942735 100644 --- a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py +++ b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py @@ -29,7 +29,9 @@ def formula(tax_unit, period, parameters): # wages (lines 5 and 6; ORS 316.685(3)(a)). tax_before_refundable_credits = tax_unit( "income_tax_before_refundable_credits", period - ) - add(tax_unit, period, ["net_investment_income_tax", "unreported_payroll_tax"]) + ) - add( + tax_unit, period, ["net_investment_income_tax", "unreported_payroll_tax"] + ) # Only the refundable credits the worksheet lists reduce the liability. # The earned income credit never does (ORS 316.685(1)(b)). refundable_credits = add(tax_unit, period, p.refundable_credits) From 9c52f85e4b98341303b54d6e4534977db3d747ef Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 11:32:42 -0400 Subject: [PATCH 03/17] Cite OR-17 worksheet pages per repo convention Co-Authored-By: Claude Opus 5.5 --- .../refundable_credits.yaml | 20 +++++++++---------- .../or_federal_tax_liability_subtraction.py | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml b/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml index 3829be75b83..402c412bdac 100644 --- a/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml +++ b/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml @@ -28,23 +28,23 @@ metadata: period: year label: Oregon federal tax liability subtraction refundable credits reference: - - title: ORS 316.685(1)(b) + - title: ORS 316.680(1)(b) and 316.685 href: https://www.oregonlegislature.gov/bills_laws/ors/ors316.html - - title: 2017 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + - title: "2017 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 63" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2017.pdf#page=63 - - title: 2018 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + - title: "2018 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 68" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2018.pdf#page=68 - - title: 2019 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + - title: "2019 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 63" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2019.pdf#page=63 - - title: 2020 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 9 + - title: "2020 Publication OR-17, federal tax worksheet, Part A, lines 6 to 9 #page 65-66" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2020.pdf#page=66 - - title: 2021 Publication OR-17, Federal tax worksheet, Part A, lines 8 to 13 + - title: "2021 Publication OR-17, federal tax worksheet, Part A, lines 2 and 8 to 13 #page 72-73" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=72 - - title: 2022 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + - title: "2022 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 73" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2022.pdf#page=73 - - title: 2023 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + - title: "2023 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 73" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2023.pdf#page=73 - - title: 2024 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 8 + - title: "2024 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 71" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2024.pdf#page=71 - - title: 2025 Publication OR-17, Federal tax worksheet, Part A, lines 6 to 9 + - title: "2025 Publication OR-17, federal tax worksheet, Part A, lines 6 to 9 #page 71-72" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 diff --git a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py index 9081a942735..e2409c59d60 100644 --- a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py +++ b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py @@ -10,7 +10,8 @@ class or_federal_tax_liability_subtraction(Variable): reference = ( # ORS 316.680(1)(b), 316.685 and 316.695(3). "https://www.oregonlegislature.gov/bills_laws/ors/ors316.html", - # Federal tax worksheet, Part A. + # Publication OR-17, federal tax worksheet, Part A: PDF pages 71-72 + # in 2025 and 72-73 in 2021. "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71", "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=72", ) From 9c97660168b03aa8aaf2f93a26c14d46d6e4a393 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 12:00:28 -0400 Subject: [PATCH 04/17] Add invariants for Oregon's federal tax liability subtraction Bounds, independence from the EITC (and the ACTC outside 2021), and 1-Lipschitz responses to listed credits and federal tax, checked with Hypothesis on batches of twin tax units in one simulation per example. Co-Authored-By: Claude Opus 5.5 --- ...al_tax_liability_subtraction_invariants.py | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py diff --git a/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py new file mode 100644 index 00000000000..a6244e1992b --- /dev/null +++ b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py @@ -0,0 +1,119 @@ +"""Oregon's federal tax liability subtraction follows the OR-17 worksheet. + +ORS 316.680(1)(b) and 316.685; Publication OR-17, federal tax worksheet, +Part A. The subtraction is federal tax after nonrefundable credits plus other +income taxes, less only the refundable credits the worksheet lists, floored at +zero and capped by federal AGI. These properties hold for every input: + +1. 0 <= subtraction <= min(federal tax before refundable credits, cap). +2. The earned income credit never changes it (ORS 316.685(1)(b)), and outside + 2021 neither does the additional child tax credit. +3. Raising a listed credit (the premium tax credit) by d lowers it by at most d. +4. Raising federal tax before refundable credits by d raises it by at most d. + +Each Hypothesis example evaluates a batch of tax units and their variants in +one vectorized simulation. +""" + +import numpy as np +import pytest +from hypothesis import HealthCheck, given, settings +from hypothesis import strategies as st + +from policyengine_us import Simulation + +TOLERANCE = 0.01 +FILING_STATUSES = ("SINGLE", "JOINT", "HEAD_OF_HOUSEHOLD", "SEPARATE") +CREDITS = ( + "eitc", + "refundable_ctc", + "refundable_american_opportunity_credit", + "assigned_aca_ptc", + "recovery_rebate_credit", + "cdcc", +) +VARIANTS = ("base", "eitc", "refundable_ctc", "assigned_aca_ptc", "tax") + + +@st.composite +def tax_unit(draw): + return { + "filing_status": draw(st.sampled_from(FILING_STATUSES)), + "adjusted_gross_income": draw(st.integers(0, 300_000)), + "income_tax_before_refundable_credits": draw(st.integers(0, 20_000)), + "net_investment_income_tax": draw(st.integers(0, 2_000)), + "unreported_payroll_tax": draw(st.integers(0, 1_000)), + **{credit: draw(st.integers(0, 6_000)) for credit in CREDITS}, + "delta": draw(st.integers(1, 5_000)), + } + + +def _run(units, year): + situation = {"people": {}, "tax_units": {}, "households": {}} + rows = [] + for i, unit in enumerate(units): + for variant in VARIANTS: + inputs = {k: v for k, v in unit.items() if k != "delta"} + if variant == "tax": + inputs["income_tax_before_refundable_credits"] += unit["delta"] + elif variant != "base": + inputs[variant] += unit["delta"] + name = f"{i}_{variant}" + situation["people"][name] = {"age": {year: 40}} + situation["tax_units"][name] = { + "members": [name], + **{k: {year: v} for k, v in inputs.items()}, + } + situation["households"][name] = { + "members": [name], + "state_code": {year: "OR"}, + } + rows.append((i, variant)) + simulation = Simulation(situation=situation) + values = simulation.calculate("or_federal_tax_liability_subtraction", year) + result = {} + for (i, variant), value in zip(rows, values): + result.setdefault(i, {})[variant] = float(value) + # The largest cap, at zero AGI, from the simulation's own parameters. + p = ( + simulation.tax_benefit_system.parameters(f"{year}-01-01") + .gov.states["or"] + .tax.income.subtractions.federal_tax_liability.cap + ) + zero = np.array([0.0]) + cap = { + "SINGLE": p.single.calc(zero)[0], + "JOINT": p.joint.calc(zero)[0], + "HEAD_OF_HOUSEHOLD": p.head_of_household.calc(zero)[0], + "SEPARATE": p.separate.calc(zero)[0], + } + return result, cap + + +@pytest.mark.parametrize("year", [2020, 2021, 2025]) +@settings( + max_examples=4, + deadline=None, + derandomize=True, + suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large], +) +@given(units=st.lists(tax_unit(), min_size=6, max_size=6)) +def test_or_federal_tax_liability_subtraction_invariants(year, units): + result, cap = _run(units, year) + for i, unit in enumerate(units): + r = result[i] + base, delta = r["base"], unit["delta"] + # 1. Bounds. + assert -TOLERANCE <= base + assert base <= unit["income_tax_before_refundable_credits"] + TOLERANCE + assert base <= cap[unit["filing_status"]] + TOLERANCE + # 2. Credits the worksheet never lists. + assert r["eitc"] == pytest.approx(base, abs=TOLERANCE) + if year == 2021: + assert base - delta - TOLERANCE <= r["refundable_ctc"] <= base + TOLERANCE + else: + assert r["refundable_ctc"] == pytest.approx(base, abs=TOLERANCE) + # 3. A listed credit lowers the subtraction by at most its increase. + assert base - delta - TOLERANCE <= r["assigned_aca_ptc"] <= base + TOLERANCE + # 4. More federal tax raises it by at most the increase. + assert base - TOLERANCE <= r["tax"] <= base + delta + TOLERANCE From 0f5c79db79d8f3e94240b7729479881dcc5194cd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 21:52:42 +0000 Subject: [PATCH 05/17] Pin no premium tax credit in Oregon's 50k single-filer integration cases These cases test the kicker and assume Oregon subtracts the whole federal liability. The model gives this household (no coverage inputs) a 3,264 (2024) or 3,736 (2025) premium tax credit, which the OR-17 worksheet now nets out of the subtraction, so the kicker cases broke. Setting aca_ptc to 0, as the file's elderly case already does, keeps them testing what their comments compute. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6Fmi4DmuA9GyXnRKdV --- .../gov/states/or/tax/income/integration.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/integration.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/integration.yaml index b026b0ab870..fd5e0a324ef 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/integration.yaml @@ -139,6 +139,9 @@ tax_units: tax_unit: members: [person1] + # No marketplace premium tax credit, so Oregon subtracts the whole + # federal liability (Publication OR-17 nets the credit out). + aca_ptc: 0 households: household: members: [person1] @@ -198,6 +201,9 @@ tax_units: tax_unit: members: [person1] + # No marketplace premium tax credit, so Oregon subtracts the whole + # federal liability (Publication OR-17 nets the credit out). + aca_ptc: 0 households: household: members: [person1] @@ -227,6 +233,9 @@ tax_units: tax_unit: members: [person1] + # No marketplace premium tax credit, so Oregon subtracts the whole + # federal liability (Publication OR-17 nets the credit out). + aca_ptc: 0 or_tax_before_credits_in_prior_year: 2_000 households: household: @@ -252,6 +261,9 @@ tax_units: tax_unit: members: [person1] + # No marketplace premium tax credit, so Oregon subtracts the whole + # federal liability (Publication OR-17 nets the credit out). + aca_ptc: 0 or_tax_before_credits_in_prior_year: 2_000 households: household: From 073c5c7b5c9d130958bdf1af63d97ef4b40e58dd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 22:16:58 +0000 Subject: [PATCH 06/17] Answer the hub review of the Oregon federal tax subtraction - Record the worksheet's NIIT exclusion and its unlisted refundable credits as source-conflict candidates, and list this PR on the claim-of-right item. - Reword the formula comment: the other-taxes line differs by year. - Drop single-page numbers from reference titles and open the 2020 href on the first cited page. - Tighten the Hypothesis properties: bound by T less the NIIT and unreported payroll tax and by the cap at the unit's AGI, and require a listed credit to lower an uncapped subtraction dollar for dollar. Dropping the premium tax credit, the NIIT netting, or the 2021 child tax or child care credit now fails it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6Fmi4DmuA9GyXnRKdV --- .../refundable_credits.yaml | 14 ++-- ...al_tax_liability_subtraction_invariants.py | 69 ++++++++++++------- .../or_federal_tax_liability_subtraction.py | 11 +-- source_conflicts/candidates.yaml | 62 +++++++++++++++++ 4 files changed, 120 insertions(+), 36 deletions(-) diff --git a/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml b/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml index 402c412bdac..d31d7b597fd 100644 --- a/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml +++ b/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml @@ -30,21 +30,21 @@ metadata: reference: - title: ORS 316.680(1)(b) and 316.685 href: https://www.oregonlegislature.gov/bills_laws/ors/ors316.html - - title: "2017 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 63" + - title: "2017 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2017.pdf#page=63 - - title: "2018 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 68" + - title: "2018 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2018.pdf#page=68 - - title: "2019 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 63" + - title: "2019 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2019.pdf#page=63 - title: "2020 Publication OR-17, federal tax worksheet, Part A, lines 6 to 9 #page 65-66" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2020.pdf#page=66 + href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2020.pdf#page=65 - title: "2021 Publication OR-17, federal tax worksheet, Part A, lines 2 and 8 to 13 #page 72-73" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=72 - - title: "2022 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 73" + - title: "2022 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2022.pdf#page=73 - - title: "2023 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 73" + - title: "2023 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2023.pdf#page=73 - - title: "2024 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8 #page 71" + - title: "2024 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2024.pdf#page=71 - title: "2025 Publication OR-17, federal tax worksheet, Part A, lines 6 to 9 #page 71-72" href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 diff --git a/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py index a6244e1992b..398f6294a0f 100644 --- a/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py +++ b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py @@ -3,13 +3,17 @@ ORS 316.680(1)(b) and 316.685; Publication OR-17, federal tax worksheet, Part A. The subtraction is federal tax after nonrefundable credits plus other income taxes, less only the refundable credits the worksheet lists, floored at -zero and capped by federal AGI. These properties hold for every input: +zero and capped by a schedule that falls with federal AGI. With T the federal +tax before refundable credits, these properties hold for every input: -1. 0 <= subtraction <= min(federal tax before refundable credits, cap). +1. 0 <= subtraction <= min(max(0, T - NIIT - unreported payroll tax), cap(AGI)): the + worksheet leaves out those two taxes, and the cap binds at the unit's AGI. 2. The earned income credit never changes it (ORS 316.685(1)(b)), and outside 2021 neither does the additional child tax credit. -3. Raising a listed credit (the premium tax credit) by d lowers it by at most d. -4. Raising federal tax before refundable credits by d raises it by at most d. +3. While the cap does not bind, raising a listed credit by d lowers it to + exactly max(0, subtraction - d): the premium tax credit every year, and the + refundable child tax credit and child care credit in 2021. +4. Raising T by d raises it by at most d, and never lowers it. Each Hypothesis example evaluates a batch of tax units and their variants in one vectorized simulation. @@ -32,18 +36,18 @@ "recovery_rebate_credit", "cdcc", ) -VARIANTS = ("base", "eitc", "refundable_ctc", "assigned_aca_ptc", "tax") +VARIANTS = ("base", "eitc", "refundable_ctc", "assigned_aca_ptc", "cdcc", "tax") @st.composite def tax_unit(draw): return { "filing_status": draw(st.sampled_from(FILING_STATUSES)), - "adjusted_gross_income": draw(st.integers(0, 300_000)), + "adjusted_gross_income": draw(st.integers(0, 200_000)), "income_tax_before_refundable_credits": draw(st.integers(0, 20_000)), "net_investment_income_tax": draw(st.integers(0, 2_000)), "unreported_payroll_tax": draw(st.integers(0, 1_000)), - **{credit: draw(st.integers(0, 6_000)) for credit in CREDITS}, + **{credit: draw(st.integers(0, 3_000)) for credit in CREDITS}, "delta": draw(st.integers(1, 5_000)), } @@ -74,20 +78,27 @@ def _run(units, year): result = {} for (i, variant), value in zip(rows, values): result.setdefault(i, {})[variant] = float(value) - # The largest cap, at zero AGI, from the simulation's own parameters. + # Each unit's cap at its own AGI, from the simulation's own parameters. p = ( simulation.tax_benefit_system.parameters(f"{year}-01-01") .gov.states["or"] .tax.income.subtractions.federal_tax_liability.cap ) - zero = np.array([0.0]) - cap = { - "SINGLE": p.single.calc(zero)[0], - "JOINT": p.joint.calc(zero)[0], - "HEAD_OF_HOUSEHOLD": p.head_of_household.calc(zero)[0], - "SEPARATE": p.separate.calc(zero)[0], + schedules = { + "SINGLE": p.single, + "JOINT": p.joint, + "HEAD_OF_HOUSEHOLD": p.head_of_household, + "SEPARATE": p.separate, } - return result, cap + caps = [ + float( + schedules[unit["filing_status"]].calc( + np.array([float(unit["adjusted_gross_income"])]) + )[0] + ) + for unit in units + ] + return result, caps @pytest.mark.parametrize("year", [2020, 2021, 2025]) @@ -99,21 +110,31 @@ def _run(units, year): ) @given(units=st.lists(tax_unit(), min_size=6, max_size=6)) def test_or_federal_tax_liability_subtraction_invariants(year, units): - result, cap = _run(units, year) + result, caps = _run(units, year) for i, unit in enumerate(units): r = result[i] - base, delta = r["base"], unit["delta"] + base, delta, cap = r["base"], unit["delta"], caps[i] + uncapped = cap - base > TOLERANCE # 1. Bounds. assert -TOLERANCE <= base - assert base <= unit["income_tax_before_refundable_credits"] + TOLERANCE - assert base <= cap[unit["filing_status"]] + TOLERANCE + assert base <= TOLERANCE + max( + 0, + unit["income_tax_before_refundable_credits"] + - unit["net_investment_income_tax"] + - unit["unreported_payroll_tax"], + ) + assert base <= cap + TOLERANCE # 2. Credits the worksheet never lists. assert r["eitc"] == pytest.approx(base, abs=TOLERANCE) - if year == 2021: - assert base - delta - TOLERANCE <= r["refundable_ctc"] <= base + TOLERANCE - else: + if year != 2021: assert r["refundable_ctc"] == pytest.approx(base, abs=TOLERANCE) - # 3. A listed credit lowers the subtraction by at most its increase. - assert base - delta - TOLERANCE <= r["assigned_aca_ptc"] <= base + TOLERANCE + # 3. A listed credit lowers the subtraction dollar for dollar to zero. + listed = ["assigned_aca_ptc"] + if year == 2021: + listed += ["refundable_ctc", "cdcc"] + for credit in listed: + assert r[credit] <= base + TOLERANCE + if uncapped: + assert r[credit] == pytest.approx(max(0.0, base - delta), abs=TOLERANCE) # 4. More federal tax raises it by at most the increase. assert base - TOLERANCE <= r["tax"] <= base + delta + TOLERANCE diff --git a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py index e2409c59d60..1091424144f 100644 --- a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py +++ b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py @@ -23,11 +23,12 @@ def formula(tax_unit, period, parameters): .gov.states["or"] .tax.income.subtractions.federal_tax_liability ) - # Federal tax worksheet, line 5: federal income tax after nonrefundable - # credits plus the other taxes on Schedule 2, lines 8, 16 and 17. The - # worksheet leaves out the net investment income tax (Schedule 2, line - # 12) and Social Security and Medicare taxes on unreported tips and - # wages (lines 5 and 6; ORS 316.685(3)(a)). + # Federal tax worksheet, Part A: federal tax after nonrefundable + # credits plus the other income taxes the worksheet lists for the year + # (from 2021, Schedule 2, lines 8, 16 and 17, and some line 10 + # homebuyer repayments). Every year leaves out the net investment + # income tax and the Social Security and Medicare tax on unreported + # tips and wages (ORS 316.685(3)). tax_before_refundable_credits = tax_unit( "income_tax_before_refundable_credits", period ) - add( diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 6b1dbcbedc4..ec5010d761c 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -7623,9 +7623,71 @@ candidates: - policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py prs: - https://github.com/PolicyEngine/policyengine-us/pull/10038 + - https://github.com/PolicyEngine/policyengine-us/pull/10093 state: ruled note: 'Ruled in October 2026 to follow the worksheet; establish the statutory treatment before determining whether a model change is required. Code not yet on main: or_federal_tax_liability_subtraction.' +- id: us-or:federal-tax-subtraction-niit + program: income-tax + years: + from: 2017 + to: 2025 + type: tax + question: Is the net investment income tax among the federal income taxes accrued that Oregon's federal-tax + subtraction allows, though the OR-17 worksheet's other-taxes line leaves it out? + sources: + - kind: statute + citation: ORS 316.680(1)(b) and 316.685 + url: https://www.oregonlegislature.gov/bills_laws/ors/ors316.html + - kind: worksheet + citation: 2025 OR-17 federal tax worksheet, Part A, PDF pp.71-72 (each year 2017-2025) + url: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 + readings: + statute: The statute allows federal income taxes accrued and names only the EITC and payroll and self-employment + taxes as left out, so it does not settle whether the section 1411 tax counts. + other: The worksheet's other-taxes line does not include the net investment income tax. + pe_us: + follows: gap-fill + code: + - policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py + prs: + - https://github.com/PolicyEngine/policyengine-us/pull/10093 + state: unreviewed + note: 'Code not yet on main: the subtraction nets the net investment income tax out of the federal tax, following + the worksheet as the administering agency''s reading where the text is open.' +- id: us-or:federal-tax-subtraction-unlisted-refundable-credits + program: income-tax + years: + from: 2017 + to: 2025 + type: tax + question: Do refundable credits the OR-17 worksheet does not list, such as the additional child tax credit outside + 2021 and the refundable payroll tax credit, reduce Oregon's federal-tax subtraction? + sources: + - kind: statute + citation: ORS 316.680(1)(b) and 316.685(1)(b) + url: https://www.oregonlegislature.gov/bills_laws/ors/ors316.html + - kind: guidance + citation: 2025 Publication OR-17, PDF p.71 + url: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 + - kind: worksheet + citation: 2025 OR-17 federal tax worksheet, Part A, PDF pp.71-72 (each year 2017-2025) + url: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 + readings: + statute: The statute allows federal income taxes accrued and leaves out only the EITC; it does not say how other + refundable credits count. + other: The publication's prose says credits other than the EITC reduce the subtraction, but the worksheet subtracts + only the credits it lists for each year. + pe_us: + follows: gap-fill + code: + - policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py + - policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml + prs: + - https://github.com/PolicyEngine/policyengine-us/pull/10093 + state: unreviewed + note: 'Code not yet on main: refundable_credits.yaml lists only the worksheet''s credits, the same + prose-against-worksheet question as us-or:claim-of-right-federal-tax-subtraction.' - id: us-or:liheap-final-payment-band-bound program: liheap years: From dfe261c991f60e07c1c7626981e352ea63d50357 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 23:05:44 +0000 Subject: [PATCH 07/17] Follow ORS 316.685 for Oregon's federal tax subtraction credits and taxes ORS 316.685(1)(b) leaves out only the earned income credit, so every other federal refundable credit reduces the subtraction, and so does the premium tax credit. Read the federal refundable list without the EITC, plus assigned_aca_ptc, instead of the worksheet's closed per-year list. This restores the additional child tax credit outside 2021 and the refundable payroll tax credit, and a credit added to the federal list later reduces the subtraction with no Oregon change. Keep the net investment income tax in the base: 26 U.S.C. 1411(a)(1) imposes it under Subtitle A, and ORS 316.685(3) excludes only payroll and self-employment taxes. Keep the employee payroll tax on unreported tips and wages out, per 316.685(3)(a). Move cases 12, 14, 16 and 17 to the new rules, and add a refundable payroll tax credit case, an additional child tax credit family with an early-distribution tax, and a head-of-household witness that owes the net investment income tax after clean energy credits wipe out its regular tax. Co-Authored-By: Claude Opus 5.5 --- .../refundable_credits.yaml | 50 ------- .../or_federal_tax_liability_subtraction.yaml | 135 ++++++++++++++---- .../or_federal_tax_liability_subtraction.py | 53 ++++--- 3 files changed, 143 insertions(+), 95 deletions(-) delete mode 100644 policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml diff --git a/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml b/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml deleted file mode 100644 index d31d7b597fd..00000000000 --- a/policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml +++ /dev/null @@ -1,50 +0,0 @@ -description: Oregon reduces the federal income tax liability it subtracts by these federal refundable credits. -values: - # Federal tax worksheet, Part A, of each year's Publication OR-17. The earned - # income credit is never listed (ORS 316.685(1)(b)), and outside 2021 neither - # is the additional child tax credit. - 2017-01-01: - - refundable_american_opportunity_credit # Line 6 - - assigned_aca_ptc # Line 7 (Form 8962, line 24) - 2020-01-01: - - refundable_american_opportunity_credit # Line 6 - - assigned_aca_ptc # Line 7 (Form 8962, line 24) - - recovery_rebate_credit # Line 8, with the stimulus payments received - 2021-01-01: - # Line 8 is the child tax credit on Schedule 8812, line 14e. Line 2 adds - # back the nonrefundable part that line 1 already nets out. - - refundable_ctc - - refundable_american_opportunity_credit # Line 9 - - recovery_rebate_credit # Line 10, with the stimulus payments received - - assigned_aca_ptc # Line 11 (Form 8962, line 24) - - cdcc # Line 12 (Schedule 3, line 13g) - 2022-01-01: - - refundable_american_opportunity_credit # Line 6 - - assigned_aca_ptc # Line 7 (Form 8962, line 24) - # From 2025, line 7 is the refundable adoption credit (Form 1040, line 30), - # which is not modeled, and the premium tax credit moves to line 8. -metadata: - unit: list - period: year - label: Oregon federal tax liability subtraction refundable credits - reference: - - title: ORS 316.680(1)(b) and 316.685 - href: https://www.oregonlegislature.gov/bills_laws/ors/ors316.html - - title: "2017 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2017.pdf#page=63 - - title: "2018 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2018.pdf#page=68 - - title: "2019 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2019.pdf#page=63 - - title: "2020 Publication OR-17, federal tax worksheet, Part A, lines 6 to 9 #page 65-66" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2020.pdf#page=65 - - title: "2021 Publication OR-17, federal tax worksheet, Part A, lines 2 and 8 to 13 #page 72-73" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=72 - - title: "2022 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2022.pdf#page=73 - - title: "2023 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2023.pdf#page=73 - - title: "2024 Publication OR-17, federal tax worksheet, Part A, lines 6 to 8" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2024.pdf#page=71 - - title: "2025 Publication OR-17, federal tax worksheet, Part A, lines 6 to 9 #page 71-72" - href: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml index cd07ffd2cd2..9c137ba9357 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml @@ -114,10 +114,13 @@ # 50% x 8,750 or_federal_tax_liability_subtraction: 4_375 -# Federal tax worksheet, Part A, 2025 Publication OR-17, PDF pages 71-72: line 5 -# (federal tax after nonrefundable credits plus other income taxes) less the -# American Opportunity, refundable adoption and premium tax credits (lines 6 to -# 9), floored at zero (line 10), then capped (line 12). +# ORS 316.685(1)(b) leaves out only the earned income credit, so every other +# federal refundable credit reduces the subtraction, and so does the premium tax +# credit (2025 Publication OR-17, PDF page 71: "Federal income tax credits, +# except for the EITC, reduce your federal tax subtraction."). The net +# investment income tax, a Subtitle A income tax (26 U.S.C. 1411(a)(1)), stays +# in; the employee payroll tax on unreported tips and wages comes out (ORS +# 316.685(3)(a)). Floor at zero, then apply the AGI cap. - name: Case 11, 2025 premium tax credit reduces the subtraction. period: 2025 input: @@ -131,22 +134,23 @@ # 4,000 - 1,500 or_federal_tax_liability_subtraction: 2_500 -- name: Case 12, 2025 additional child tax credit does not reduce the subtraction. +- name: Case 12, 2025 additional child tax credit reduces the subtraction but the EITC does not. period: 2025 input: state_code: OR filing_status: JOINT adjusted_gross_income: 60_000 - # Form 1040 line 22 is 0; a 1,000 additional tax on an early retirement - # plan distribution is Schedule 2, line 8 (worksheet line 4). + # Federal tax after nonrefundable credits is 0; a 1,000 additional tax on + # an early retirement plan distribution remains. income_tax_before_refundable_credits: 1_000 refundable_ctc: 3_000 assigned_aca_ptc: 0 eitc: 500 output: - or_federal_tax_liability_subtraction: 1_000 + # max(0, 1,000 - 3,000); the 500 EITC does not reduce it. + or_federal_tax_liability_subtraction: 0 -- name: Case 13, 2025 listed credits above the liability floor the subtraction at zero. +- name: Case 13, 2025 credits above the liability floor the subtraction at zero. period: 2025 input: state_code: OR @@ -160,26 +164,22 @@ # max(0, 2,000 - 1,000 - 1,500) or_federal_tax_liability_subtraction: 0 -- name: Case 14, 2025 net investment income tax and unreported payroll tax are not subtracted. +- name: Case 14, 2025 net investment income tax stays in and unreported payroll tax comes out. period: 2025 input: state_code: OR filing_status: SINGLE adjusted_gross_income: 90_000 + # Includes both taxes below. income_tax_before_refundable_credits: 5_000 - # Schedule 2, lines 12 and 5, which worksheet line 4 leaves out. net_investment_income_tax: 600 unreported_payroll_tax: 400 assigned_aca_ptc: 0 eitc: 0 output: - # 5,000 - 600 - 400 - or_federal_tax_liability_subtraction: 4_000 + # 5,000 - 400; the 600 net investment income tax is not taken out. + or_federal_tax_liability_subtraction: 4_600 -# 2021 Publication OR-17, PDF page 72: lines 8 to 12 subtract the refundable -# child tax credit, the American Opportunity credit, the recovery rebate credit -# with stimulus payments received, the premium tax credit and the refundable -# child and dependent care credit. - name: Case 15, 2021 refundable child tax, recovery rebate and child care credits reduce the subtraction. period: 2021 input: @@ -196,25 +196,22 @@ # 9,000 - 3,000 - 2,800 - 1,000 or_federal_tax_liability_subtraction: 2_200 -# 2020 Publication OR-17, PDF page 66: line 8 subtracts the stimulus payments -# received plus the recovery rebate credit; the additional child tax credit is -# not listed. -- name: Case 16, 2020 recovery rebate credit reduces the subtraction but the additional child tax credit does not. +- name: Case 16, 2020 recovery rebate credit and additional child tax credit reduce the subtraction. period: 2020 input: state_code: OR filing_status: JOINT adjusted_gross_income: 50_000 - income_tax_before_refundable_credits: 3_000 + income_tax_before_refundable_credits: 4_000 recovery_rebate_credit: 2_400 refundable_ctc: 1_000 assigned_aca_ptc: 0 eitc: 0 output: - # 3,000 - 2,400 + # 4,000 - 2,400 - 1,000 or_federal_tax_liability_subtraction: 600 -- name: Case 17, 2026 premium tax credit and American Opportunity credit reduce the subtraction. +- name: Case 17, 2026 premium tax, American Opportunity and additional child tax credits reduce the subtraction. period: 2026 input: state_code: OR @@ -226,5 +223,91 @@ refundable_ctc: 1_700 eitc: 0 output: - # 6,000 - 1,000 - 2,000 - or_federal_tax_liability_subtraction: 3_000 + # 6,000 - 1,000 - 2,000 - 1,700 + or_federal_tax_liability_subtraction: 1_300 + +- name: Case 18, 2023 refundable payroll tax credit reduces the subtraction. + period: 2023 + input: + state_code: OR + filing_status: SINGLE + adjusted_gross_income: 60_000 + income_tax_before_refundable_credits: 3_000 + refundable_payroll_tax_credit: 500 + assigned_aca_ptc: 0 + eitc: 0 + output: + # 3,000 - 500 + or_federal_tax_liability_subtraction: 2_500 + +- name: Case 19, 2025 additional child tax credit offsets the early-distribution tax. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 40 + employment_income: 20_000 + taxable_private_pension_income: 30_000 + person2: + age: 40 + person3: + age: 6 + person4: + age: 9 + tax_units: + tax_unit: + members: [person1, person2, person3, person4] + # 10% additional tax on the 30,000 early distribution. + qualified_retirement_penalty: 3_000 + # No marketplace coverage, so no premium tax credit. + aca_ptc: 0 + spm_units: + spm_unit: + members: [person1, person2, person3, person4] + households: + household: + members: [person1, person2, person3, person4] + state_code: OR + output: + adjusted_gross_income: 50_000 + # (50,000 - 31,500 standard deduction) x 10% + income_tax_before_credits: 1_850 + # 2 x 2,200 child tax credit less the 1,850 used against tax, within + # 2 x 1,700 and 15% x (20,000 - 2,500) = 2,625. + refundable_ctc: 2_550 + # 1,850 - 1,850 + 3,000 + income_tax_before_refundable_credits: 3_000 + # 3,000 - 2,550, within the 8,500 cap. The EITC does not reduce it. + or_federal_tax_liability_subtraction: 450 + +- name: Case 20, 2025 head of household keeps the net investment income tax when credits wipe out the regular tax. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 40 + long_term_capital_gains: 230_000 + person2: + age: 10 + tax_units: + tax_unit: + members: [person1, person2] + solar_electric_property_expenditures: 200_000 + spm_units: + spm_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: OR + output: + # (230,000 - 23,625 standard deduction - 64,750 at 0%) x 15% + income_tax_before_credits: 21_243.75 + # The child tax credit and the 60,000 clean energy credit, capped at tax. + income_tax_capped_non_refundable_credits: 21_243.75 + # 3.8% x (230,000 - 200,000) + net_investment_income_tax: 1_140 + # 1,140, within the 8,500 cap at 230,000. + or_federal_tax_liability_subtraction: 1_140 diff --git a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py index 1091424144f..5a22554eee9 100644 --- a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py +++ b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py @@ -10,10 +10,24 @@ class or_federal_tax_liability_subtraction(Variable): reference = ( # ORS 316.680(1)(b), 316.685 and 316.695(3). "https://www.oregonlegislature.gov/bills_laws/ors/ors316.html", - # Publication OR-17, federal tax worksheet, Part A: PDF pages 71-72 - # in 2025 and 72-73 in 2021. - "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71", + # 26 U.S.C. 1411(a)(1): the net investment income tax is imposed + # under Subtitle A. + "https://www.law.cornell.edu/uscode/text/26/1411#a_1", + # Publication OR-17, federal tax worksheet, Part A, the premium tax + # credit line (line 7, from 2025 line 8; 2021 line 11) and the 2021 + # credit lines 2 and 8 to 13. + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2017.pdf#page=63", + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2018.pdf#page=68", + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2019.pdf#page=63", + # PDF pages 65-66 + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2020.pdf#page=65", + # PDF pages 72-73 "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2021.pdf#page=72", + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2022.pdf#page=73", + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2023.pdf#page=73", + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2024.pdf#page=71", + # PDF pages 71-72 + "https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71", ) defined_for = StateCode.OR @@ -23,23 +37,24 @@ def formula(tax_unit, period, parameters): .gov.states["or"] .tax.income.subtractions.federal_tax_liability ) - # Federal tax worksheet, Part A: federal tax after nonrefundable - # credits plus the other income taxes the worksheet lists for the year - # (from 2021, Schedule 2, lines 8, 16 and 17, and some line 10 - # homebuyer repayments). Every year leaves out the net investment - # income tax and the Social Security and Medicare tax on unreported - # tips and wages (ORS 316.685(3)). - tax_before_refundable_credits = tax_unit( + # Federal tax after nonrefundable credits plus the other taxes in + # income_tax_before_refundable_credits. The net investment income tax + # stays in: it is imposed under Subtitle A (26 U.S.C. 1411(a)(1)), and + # ORS 316.685(3) does not exclude it. The employee Social Security and + # Medicare tax on unreported tips and wages comes out (ORS + # 316.685(3)(a)). + federal_tax = tax_unit( "income_tax_before_refundable_credits", period - ) - add( - tax_unit, period, ["net_investment_income_tax", "unreported_payroll_tax"] - ) - # Only the refundable credits the worksheet lists reduce the liability. - # The earned income credit never does (ORS 316.685(1)(b)). - refundable_credits = add(tax_unit, period, p.refundable_credits) - or_federal_income_tax = max_( - 0, tax_before_refundable_credits - refundable_credits - ) + ) - tax_unit("unreported_payroll_tax", period) + # Every federal refundable credit except the earned income credit + # reduces the liability (ORS 316.685(1)(b)), and so does the premium + # tax credit (Form 8962, line 24), which the federal list omits. + federal_refundable_credits = parameters(period).gov.irs.credits.refundable + reducing_credits = [ + credit for credit in federal_refundable_credits if credit != "eitc" + ] + ["assigned_aca_ptc"] + refundable_credits = add(tax_unit, period, reducing_credits) + or_federal_income_tax = max_(0, federal_tax - refundable_credits) # limit subtraction based on caps scaled to federal AGI filing_status = tax_unit("filing_status", period) status = filing_status.possible_values From 5255c3bae64058233067e1cfdc8fc13e64973bcd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 23:07:08 +0000 Subject: [PATCH 08/17] Record Oregon federal tax subtraction rulings for the statute The net investment income tax and refundable credits the OR-17 worksheet does not list are ruled for ORS 316.685, and the code now follows it. The claim-of-right item was ruled for the statute on 2026-10-20; its note said otherwise. Drop the deleted refundable_credits.yaml from the code paths. Co-Authored-By: Claude Opus 5.5 --- source_conflicts/candidates.yaml | 36 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index ec5010d761c..63208930806 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -7614,19 +7614,21 @@ candidates: citation: 2025 OR-17 federal tax subtraction worksheet, PDF pp.71-72 (also 2017, 2018 and 2021) url: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 readings: - statute: The statute refers to federal income taxes accrued; how it treats the section 1341 credit is unresolved. + statute: ORS 316.685(1)(b) leaves out only the earned income credit, so the section 1341 credit reduces the + subtraction. other: The prose says credits except EITC reduce the subtraction, but the worksheet does not subtract the section 1341 credit. pe_us: - follows: unknown + follows: statute code: - policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py prs: - https://github.com/PolicyEngine/policyengine-us/pull/10038 - https://github.com/PolicyEngine/policyengine-us/pull/10093 state: ruled - note: 'Ruled in October 2026 to follow the worksheet; establish the statutory treatment before determining whether - a model change is required. Code not yet on main: or_federal_tax_liability_subtraction.' + note: Ruled for the statute on 2026-10-20. The formula subtracts every federal refundable credit except the EITC, + so the section 1341 credit reduces the subtraction once it is in gov.irs.credits.refundable. The worksheet's + list conflicts with the statute. - id: us-or:federal-tax-subtraction-niit program: income-tax years: @@ -7643,18 +7645,19 @@ candidates: citation: 2025 OR-17 federal tax worksheet, Part A, PDF pp.71-72 (each year 2017-2025) url: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 readings: - statute: The statute allows federal income taxes accrued and names only the EITC and payroll and self-employment - taxes as left out, so it does not settle whether the section 1411 tax counts. + statute: 26 U.S.C. 1411(a)(1) imposes the net investment income tax under Subtitle A, and the closed list in ORS + 316.685(3) excludes only payroll taxes and the self-employment tax (chapter 2), not chapter 2A, so the net + investment income tax counts. other: The worksheet's other-taxes line does not include the net investment income tax. pe_us: - follows: gap-fill + follows: statute code: - policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py prs: - https://github.com/PolicyEngine/policyengine-us/pull/10093 - state: unreviewed - note: 'Code not yet on main: the subtraction nets the net investment income tax out of the federal tax, following - the worksheet as the administering agency''s reading where the text is open.' + state: ruled + note: The code follows the statute and keeps the net investment income tax in the federal tax it subtracts; the + worksheet's other-taxes line leaves it out. - id: us-or:federal-tax-subtraction-unlisted-refundable-credits program: income-tax years: @@ -7674,20 +7677,19 @@ candidates: citation: 2025 OR-17 federal tax worksheet, Part A, PDF pp.71-72 (each year 2017-2025) url: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 readings: - statute: The statute allows federal income taxes accrued and leaves out only the EITC; it does not say how other - refundable credits count. + statute: ORS 316.685(1)(b) leaves out only the earned income credit, so every other refundable credit reduces the + subtraction. other: The publication's prose says credits other than the EITC reduce the subtraction, but the worksheet subtracts only the credits it lists for each year. pe_us: - follows: gap-fill + follows: statute code: - policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py - - policyengine_us/parameters/gov/states/or/tax/income/subtractions/federal_tax_liability/refundable_credits.yaml prs: - https://github.com/PolicyEngine/policyengine-us/pull/10093 - state: unreviewed - note: 'Code not yet on main: refundable_credits.yaml lists only the worksheet''s credits, the same - prose-against-worksheet question as us-or:claim-of-right-federal-tax-subtraction.' + state: ruled + note: The code follows the statute and subtracts every federal refundable credit except the EITC, plus the premium + tax credit, including credits the worksheet does not list, such as the additional child tax credit outside 2021. - id: us-or:liheap-final-payment-band-bound program: liheap years: From 86cece33124b15689dfe734acd84f0551302e23d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 23:10:16 +0000 Subject: [PATCH 09/17] Re-derive Oregon federal tax subtraction properties for ORS 316.685 Bound the subtraction by the AGI cap and by federal tax before refundable credits less the unreported payroll tax, check that the EITC and the net investment income tax (with T fixed) never move it, and check that the premium tax credit, the additional child tax credit, the refundable payroll tax credit, the unreported payroll tax and, in 2021, the child care credit lower it by exactly min(d, slack) below the cap. Co-Authored-By: Claude Opus 5.5 --- ...al_tax_liability_subtraction_invariants.py | 68 ++++++++++++------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py index 398f6294a0f..5c6d803eb46 100644 --- a/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py +++ b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py @@ -1,18 +1,24 @@ -"""Oregon's federal tax liability subtraction follows the OR-17 worksheet. +"""Oregon's federal tax liability subtraction follows ORS 316.685. -ORS 316.680(1)(b) and 316.685; Publication OR-17, federal tax worksheet, -Part A. The subtraction is federal tax after nonrefundable credits plus other -income taxes, less only the refundable credits the worksheet lists, floored at +ORS 316.680(1)(b) and 316.685. The subtraction is federal tax after +nonrefundable credits plus other income taxes, including the net investment +income tax (26 U.S.C. 1411(a)(1)), less the employee payroll tax on unreported +tips and wages (316.685(3)(a)), less every federal refundable credit except the +earned income credit (316.685(1)(b)) and less the premium tax credit, floored at zero and capped by a schedule that falls with federal AGI. With T the federal -tax before refundable credits, these properties hold for every input: +tax before refundable credits and U the unreported payroll tax, these +properties hold for every input: -1. 0 <= subtraction <= min(max(0, T - NIIT - unreported payroll tax), cap(AGI)): the - worksheet leaves out those two taxes, and the cap binds at the unit's AGI. -2. The earned income credit never changes it (ORS 316.685(1)(b)), and outside - 2021 neither does the additional child tax credit. -3. While the cap does not bind, raising a listed credit by d lowers it to - exactly max(0, subtraction - d): the premium tax credit every year, and the - refundable child tax credit and child care credit in 2021. +1. 0 <= subtraction <= min(max(0, T - U), cap(AGI)). +2. The earned income credit never changes it, and neither does the net + investment income tax beyond its share of T. Outside 2021 neither does the + child and dependent care credit, which is refundable only in 2021. +3. While the cap does not bind, raising a reducing credit or U by d lowers it + by exactly min(d, slack), where slack is how far the uncapped amount sits + above zero; where the cap binds, it never rises. The reducing credits are + the premium tax credit, the additional child tax credit and the refundable + payroll tax credit every year, and the child and dependent care credit in + 2021. 4. Raising T by d raises it by at most d, and never lowers it. Each Hypothesis example evaluates a batch of tax units and their variants in @@ -32,11 +38,25 @@ "eitc", "refundable_ctc", "refundable_american_opportunity_credit", + "refundable_payroll_tax_credit", "assigned_aca_ptc", "recovery_rebate_credit", "cdcc", ) -VARIANTS = ("base", "eitc", "refundable_ctc", "assigned_aca_ptc", "cdcc", "tax") +REDUCING = ( + "assigned_aca_ptc", + "refundable_ctc", + "refundable_payroll_tax_credit", + "unreported_payroll_tax", +) +VARIANTS = ( + "base", + "eitc", + "net_investment_income_tax", + "cdcc", + *REDUCING, + "tax", +) @st.composite @@ -114,27 +134,29 @@ def test_or_federal_tax_liability_subtraction_invariants(year, units): for i, unit in enumerate(units): r = result[i] base, delta, cap = r["base"], unit["delta"], caps[i] + # Below the cap the subtraction is the uncapped amount itself, so its + # slack above zero is the subtraction. uncapped = cap - base > TOLERANCE # 1. Bounds. assert -TOLERANCE <= base assert base <= TOLERANCE + max( 0, unit["income_tax_before_refundable_credits"] - - unit["net_investment_income_tax"] - unit["unreported_payroll_tax"], ) assert base <= cap + TOLERANCE - # 2. Credits the worksheet never lists. + # 2. Amounts that never change it. assert r["eitc"] == pytest.approx(base, abs=TOLERANCE) - if year != 2021: - assert r["refundable_ctc"] == pytest.approx(base, abs=TOLERANCE) - # 3. A listed credit lowers the subtraction dollar for dollar to zero. - listed = ["assigned_aca_ptc"] + assert r["net_investment_income_tax"] == pytest.approx(base, abs=TOLERANCE) + reducing = list(REDUCING) if year == 2021: - listed += ["refundable_ctc", "cdcc"] - for credit in listed: - assert r[credit] <= base + TOLERANCE + reducing.append("cdcc") + else: + assert r["cdcc"] == pytest.approx(base, abs=TOLERANCE) + # 3. A reducing amount lowers it dollar for dollar to zero. + for name in reducing: + assert -TOLERANCE <= r[name] <= base + TOLERANCE if uncapped: - assert r[credit] == pytest.approx(max(0.0, base - delta), abs=TOLERANCE) + assert r[name] == pytest.approx(base - min(delta, base), abs=TOLERANCE) # 4. More federal tax raises it by at most the increase. assert base - TOLERANCE <= r["tax"] <= base + delta + TOLERANCE From 088177c9fc0d8c12a9b6d6ccc98964d30737aab2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 23:42:24 +0000 Subject: [PATCH 10/17] Describe the ORS 316.685 rulings in the changelog fragment Co-Authored-By: Claude Opus 5.5 --- changelog.d/or-federal-tax-subtraction-worksheet.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md b/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md index 33f2b52f04b..9fb291d4c30 100644 --- a/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md +++ b/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md @@ -1 +1 @@ -Reduce Oregon's federal tax liability subtraction by the premium tax credit and only the other refundable credits on the Publication OR-17 federal tax worksheet, and leave out the net investment income tax. +Reduce Oregon's federal tax liability subtraction by every federal refundable credit except the EITC, plus the premium tax credit, and stop counting the employee payroll tax on unreported tips and wages. From 63b518fab89ebb098cce26f30dd6aed30a509005 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 18:49:25 +0000 Subject: [PATCH 11/17] Read the federal refundable credit total in Oregon's federal tax subtraction Six structural reforms add a refundable credit by overriding income_tax_refundable_credits and leave gov.irs.credits.refundable alone. Reading only the list dropped those credits from the subtraction, where main nets them through income_tax. Read income_tax_refundable_credits, back out eitc when the list carries it, and add assigned_aca_ptc. Baseline values don't move; a LIFT middle-class credit case pins the reform path. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6JQeNTyqxk53oyZpmf --- .../harris/lift/middle_class_tax_credit.yaml | 29 +++++++++++++++++++ .../or_federal_tax_liability_subtraction.py | 17 +++++++---- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/policyengine_us/tests/policy/contrib/harris/lift/middle_class_tax_credit.yaml b/policyengine_us/tests/policy/contrib/harris/lift/middle_class_tax_credit.yaml index 96b8e854e25..53c2637ab09 100644 --- a/policyengine_us/tests/policy/contrib/harris/lift/middle_class_tax_credit.yaml +++ b/policyengine_us/tests/policy/contrib/harris/lift/middle_class_tax_credit.yaml @@ -107,3 +107,32 @@ output: middle_class_tax_credit: 3_750 income_tax_refundable_credits: 3_750 + +- name: Oregon federal tax subtraction nets the reform's refundable credit + # The reform adds the credit to income_tax_refundable_credits, not to the + # gov.irs.credits.refundable list. Oregon's subtraction reads the federal + # total, so the credit reduces it as it reduces income_tax: the subtraction + # equals income_tax (2,153.37), not federal tax before the credit + # (3,871.50, the baseline value). + period: 2025 + reforms: policyengine_us.reforms.harris.lift.middle_class_tax_credit.middle_class_tax_credit + absolute_error_margin: 0.01 + input: + gov.contrib.harris.lift.middle_class_tax_credit.in_effect: true + people: + person1: + age: 35 + employment_income: 50_000 + tax_units: + tax_unit: + members: [person1] + aca_ptc: 0 + households: + household: + members: [person1] + state_code: OR + output: + middle_class_tax_credit: 1_718.13 + income_tax: 2_153.37 + or_federal_tax_liability_subtraction: 2_153.37 + or_income_tax: 3_014.64 diff --git a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py index 5a22554eee9..ddb8fec1657 100644 --- a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py +++ b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py @@ -48,12 +48,17 @@ def formula(tax_unit, period, parameters): ) - tax_unit("unreported_payroll_tax", period) # Every federal refundable credit except the earned income credit # reduces the liability (ORS 316.685(1)(b)), and so does the premium - # tax credit (Form 8962, line 24), which the federal list omits. - federal_refundable_credits = parameters(period).gov.irs.credits.refundable - reducing_credits = [ - credit for credit in federal_refundable_credits if credit != "eitc" - ] + ["assigned_aca_ptc"] - refundable_credits = add(tax_unit, period, reducing_credits) + # tax credit (Form 8962, line 24), which the federal list omits. Read + # the federal total, income_tax_refundable_credits, rather than the + # list, so credits that structural reforms add to that variable count + # too; back out the EITC only when the list carries it. + refundable = parameters(period).gov.irs.credits.refundable + eitc = tax_unit("eitc", period) if "eitc" in refundable else 0 + refundable_credits = ( + tax_unit("income_tax_refundable_credits", period) + - eitc + + tax_unit("assigned_aca_ptc", period) + ) or_federal_income_tax = max_(0, federal_tax - refundable_credits) # limit subtraction based on caps scaled to federal AGI filing_status = tax_unit("filing_status", period) From bd035718543456dfd45fdd5d80f7efcb460d0036 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 18:49:26 +0000 Subject: [PATCH 12/17] Make Oregon subtraction case 12 show the EITC is left out With a 3,000 additional child tax credit against 1,000 of tax, the case floored at 0 whether or not the EITC counted. A 600 credit leaves 400, which counting the 500 EITC would drive to 0. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6JQeNTyqxk53oyZpmf --- .../or_federal_tax_liability_subtraction.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml index 9c137ba9357..a49e84206a6 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml @@ -143,12 +143,14 @@ # Federal tax after nonrefundable credits is 0; a 1,000 additional tax on # an early retirement plan distribution remains. income_tax_before_refundable_credits: 1_000 - refundable_ctc: 3_000 + refundable_ctc: 600 assigned_aca_ptc: 0 eitc: 500 output: - # max(0, 1,000 - 3,000); the 500 EITC does not reduce it. - or_federal_tax_liability_subtraction: 0 + # 1,000 - 600 = 400. Counting the 500 EITC would give + # max(0, 1,000 - 600 - 500) = 0, and leaving out the additional child tax + # credit would give 1,000. + or_federal_tax_liability_subtraction: 400 - name: Case 13, 2025 credits above the liability floor the subtraction at zero. period: 2025 From 138658411912e5cbd13da973fdbb0c2470028cf9 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 18:49:26 +0000 Subject: [PATCH 13/17] Draw Oregon subtraction properties away from the zero floor With tax from 0 and seven credits up to 3,000, most drawn units floored at zero, so the dollar-for-dollar property mostly checked 0 = 0. Draw tax from 3,000 to 20,000 and each credit up to 1,000. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6JQeNTyqxk53oyZpmf --- .../test_or_federal_tax_liability_subtraction_invariants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py index 5c6d803eb46..5e6ecb34b91 100644 --- a/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py +++ b/policyengine_us/tests/core/test_or_federal_tax_liability_subtraction_invariants.py @@ -64,10 +64,10 @@ def tax_unit(draw): return { "filing_status": draw(st.sampled_from(FILING_STATUSES)), "adjusted_gross_income": draw(st.integers(0, 200_000)), - "income_tax_before_refundable_credits": draw(st.integers(0, 20_000)), + "income_tax_before_refundable_credits": draw(st.integers(3_000, 20_000)), "net_investment_income_tax": draw(st.integers(0, 2_000)), "unreported_payroll_tax": draw(st.integers(0, 1_000)), - **{credit: draw(st.integers(0, 3_000)) for credit in CREDITS}, + **{credit: draw(st.integers(0, 1_000)) for credit in CREDITS}, "delta": draw(st.integers(1, 5_000)), } From 2bffdc09421a380c1a7c444a7ec619eabf8c27e6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 18:49:26 +0000 Subject: [PATCH 14/17] Cite 26 U.S.C. 1411(a)(1) in the Oregon NIIT source-conflict item The item's statute reading rests on section 1411(a)(1), which its sources did not list. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6JQeNTyqxk53oyZpmf --- source_conflicts/candidates.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 90c633ec059..5cc17594d77 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -7674,6 +7674,9 @@ candidates: - kind: statute citation: ORS 316.680(1)(b) and 316.685 url: https://www.oregonlegislature.gov/bills_laws/ors/ors316.html + - kind: statute + citation: 26 U.S.C. 1411(a)(1) + url: https://www.law.cornell.edu/uscode/text/26/1411#a_1 - kind: worksheet citation: 2025 OR-17 federal tax worksheet, Part A, PDF pp.71-72 (each year 2017-2025) url: https://www.oregon.gov/dor/forms/FormsPubs/publication-or-17_101-431_2025.pdf#page=71 From 11d9ac7d5456ec74fe5fa5800af811e590dfe644 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 00:41:26 +0000 Subject: [PATCH 15/17] Pin the EITC guard in Oregon's federal tax subtraction The "eitc" in refundable guard had no test on its else branch: every baseline refundable credit list carries the EITC, so deleting the guard failed nothing. Case 21 overrides the list without the EITC; with the guard removed it returns 4,000 instead of 3,000. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6GcUUKCP2fg997bbmc --- .../or_federal_tax_liability_subtraction.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml index a49e84206a6..a4183017dbe 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml @@ -313,3 +313,19 @@ net_investment_income_tax: 1_140 # 1,140, within the 8,500 cap at 230,000. or_federal_tax_liability_subtraction: 1_140 + +- name: Case 21, 2025 with no EITC on the federal refundable credit list, the code backs out none. + period: 2025 + input: + gov.irs.credits.refundable: + [refundable_american_opportunity_credit, refundable_ctc, recovery_rebate_credit, refundable_payroll_tax_credit] + state_code: OR + filing_status: SINGLE + adjusted_gross_income: 40_000 + income_tax_before_refundable_credits: 3_000 + eitc: 1_000 + assigned_aca_ptc: 0 + output: + # income_tax_refundable_credits holds no EITC here, so the code backs out + # none: 3,000 - 0 = 3,000. Without the guard: 3,000 - (0 - 1,000) = 4,000. + or_federal_tax_liability_subtraction: 3_000 From ebc373c6e01e6968533b8727e7e8b6c6b15469e1 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 00:41:40 +0000 Subject: [PATCH 16/17] Say only what changed in the Oregon subtraction changelog Main already nets every listed refundable credit except the EITC, so the fragment now names just the two changes: the premium tax credit and the unreported payroll tax. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6GcUUKCP2fg997bbmc --- changelog.d/or-federal-tax-subtraction-worksheet.fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md b/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md index 9fb291d4c30..99c2ee6429b 100644 --- a/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md +++ b/changelog.d/or-federal-tax-subtraction-worksheet.fixed.md @@ -1 +1 @@ -Reduce Oregon's federal tax liability subtraction by every federal refundable credit except the EITC, plus the premium tax credit, and stop counting the employee payroll tax on unreported tips and wages. +Net the premium tax credit out of Oregon's federal tax liability subtraction, and stop counting the employee payroll tax on unreported tips and wages. From 7a0bf46dd89da553bcfe1784c7924bf5a5fd7a09 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 8 Nov 2026 14:16:40 -0500 Subject: [PATCH 17/17] Name both section 1341 methods in the Oregon subtraction notes - or_federal_tax_liability_subtraction.py: the comment now says the federal refundable list carries the section 1341(a)(5) credit, while relief under 1341(a)(4), an itemized deduction, already lowers income_tax_before_refundable_credits. - Case 21's override list keeps claim_of_right_credit, so the list stays the 2025 list without the EITC. - candidates.yaml: the us-or:claim-of-right-federal-tax-subtraction note dates the statute ruling and names the credit. No formula or expected value changes. Co-Authored-By: Claude Opus 5.5 --- .../or_federal_tax_liability_subtraction.yaml | 6 +++++- .../subtractions/or_federal_tax_liability_subtraction.py | 8 +++++--- source_conflicts/candidates.yaml | 8 ++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml index f3d682f7996..f858d6114f1 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.yaml @@ -318,7 +318,11 @@ period: 2025 input: gov.irs.credits.refundable: - [refundable_american_opportunity_credit, refundable_ctc, recovery_rebate_credit, refundable_payroll_tax_credit] + - refundable_american_opportunity_credit + - refundable_ctc + - recovery_rebate_credit + - refundable_payroll_tax_credit + - claim_of_right_credit state_code: OR filing_status: SINGLE adjusted_gross_income: 40_000 diff --git a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py index 2ecba3af894..f3b277c05fd 100644 --- a/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py +++ b/policyengine_us/variables/gov/states/or/tax/income/subtractions/or_federal_tax_liability_subtraction.py @@ -54,9 +54,11 @@ def formula(tax_unit, period, parameters): # the federal total, income_tax_refundable_credits, rather than the # list, so credits that structural reforms add to that variable count # too; back out the EITC only when the list carries it. The federal - # list, and so the total, includes the section 1341 credit - # (claim_of_right_credit), so section 1341 relief reduces the - # liability as well. + # list, and so the total, includes the section 1341(a)(5) credit + # (claim_of_right_credit). Relief under section 1341(a)(4), an + # itemized deduction, already lowers + # income_tax_before_refundable_credits. Either way, section 1341 + # relief reduces the liability. refundable = parameters(period).gov.irs.credits.refundable eitc = tax_unit("eitc", period) if "eitc" in refundable else 0 refundable_credits = ( diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index dac64f67e84..528def1524c 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -8582,10 +8582,10 @@ candidates: - https://github.com/PolicyEngine/policyengine-us/pull/10038 - https://github.com/PolicyEngine/policyengine-us/pull/10093 state: ruled - note: An October 2026 ruling followed the worksheet; under the later statute-first rule the code follows ORS - 316.685(1)(b). The formula subtracts every federal refundable credit except the EITC, and - gov.irs.credits.refundable lists the section 1341 credit, so it reduces the subtraction. The worksheet's list - conflicts with the statute. + note: An October 2026 ruling followed the worksheet; a 2026-10-20 ruling under the later statute-first rule chose + the statute, and the code follows ORS 316.685(1)(b). The formula subtracts every federal refundable credit except + the EITC, and gov.irs.credits.refundable lists the section 1341 credit, so that credit reduces the subtraction. + The worksheet's list conflicts with the statute. - id: us-or:federal-tax-subtraction-niit program: income-tax years: