From 13fcdb51f355be5577fe5d405277b5e0e8f41ae7 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 00:28:19 -0500 Subject: [PATCH 1/9] Activate uprating for filing-status parameter children Co-Authored-By: Claude Opus 5.5 --- .../fix-breakdown-parameter-uprating.fixed.md | 1 + .../capital_gains/income_threshold.yaml | 3 + .../irs/income/exemption/phase_out/start.yaml | 34 +++- .../max_amount.yaml | 15 +- .../code_health/test_uprating_placement.py | 69 ++++++++ .../core/test_breakdown_parameter_uprating.py | 164 ++++++++++++++++++ .../taxable_income/exemptions/exemptions.yaml | 38 ++++ .../co_collegeinvest_contribution.yaml | 59 +++++++ .../capital_gains_tax_increase.yaml | 28 +++ 9 files changed, 407 insertions(+), 4 deletions(-) create mode 100644 changelog.d/fix-breakdown-parameter-uprating.fixed.md create mode 100644 policyengine_us/tests/core/test_breakdown_parameter_uprating.py create mode 100644 policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml diff --git a/changelog.d/fix-breakdown-parameter-uprating.fixed.md b/changelog.d/fix-breakdown-parameter-uprating.fixed.md new file mode 100644 index 00000000000..c9adf733691 --- /dev/null +++ b/changelog.d/fix-breakdown-parameter-uprating.fixed.md @@ -0,0 +1 @@ +Activated filing-status parameter uprating for Colorado's CollegeInvest subtraction, legacy personal exemption phaseout thresholds, and the Biden FY2025 capital gains proposal, and added Colorado's published 2026 limits. diff --git a/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml b/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml index 183952a3ca7..46cab9ed193 100644 --- a/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml +++ b/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml @@ -6,6 +6,9 @@ metadata: label: Threshold above which capital income is taxed as ordinary income unit: currency-USD period: year + propagate_metadata_to_children: true + # Treasury indexes these thresholds after 2024 without specifying an index + # or rounding interval; use the existing IRS inflation index for projections. uprating: gov.irs.uprating breakdown: diff --git a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml index ec4a2083852..6340bd2d5f2 100644 --- a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml +++ b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml @@ -4,7 +4,10 @@ metadata: breakdown: - filing_status unit: currency-USD - # This parent uprating remains inactive pending selective propagation in PolicyEngine/policyengine-core#537. + # Keep CBO's legacy forecasts for counterfactual reforms; personal exemptions + # remain suspended under current law. Project from the final forecast year. + # Historical section 68(b) rounds down to $50, then halves the joint amount + # for separate filers. Set rounding on each child to preserve that order. uprating: gov.irs.uprating reference: - title: 26 U.S. Code § 151 - Allowance of deductions for personal exemptions (d)(3)(B) @@ -14,6 +17,10 @@ metadata: - title: CBO Tax Parameters and Effective Marginal Tax Rates | Jan 2025 # 1. Tax Parameters. href: https://www.cbo.gov/data/budget-economic-data + - title: 26 U.S.C. 68(b) (2024 edition), applicable amount and inflation adjustment + href: https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partI-sec68.htm + - title: CBO January 2025 tax parameter forecasts + href: https://raw.githubusercontent.com/US-CBO/cbo-data/main/data/budget/tax_parameters/annual_cy_2025-01.csv JOINT: values: @@ -36,6 +43,11 @@ JOINT: 2035-01-01: 487_400 metadata: unit: currency-USD + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 50 SINGLE: values: 2013-01-01: 250_000 @@ -57,6 +69,11 @@ SINGLE: 2035-01-01: 406_200 metadata: unit: currency-USD + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 50 SEPARATE: values: 2013-01-01: 150_000 @@ -78,6 +95,11 @@ SEPARATE: 2035-01-01: 243_700 metadata: unit: currency-USD + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 25 HEAD_OF_HOUSEHOLD: values: 2013-01-01: 275_000 @@ -99,6 +121,11 @@ HEAD_OF_HOUSEHOLD: 2035-01-01: 446_800 metadata: unit: currency-USD + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 50 SURVIVING_SPOUSE: values: 2013-01-01: 300_000 @@ -120,3 +147,8 @@ SURVIVING_SPOUSE: 2035-01-01: 487_400 metadata: unit: currency-USD + uprating: + parameter: gov.irs.uprating + rounding: + type: downwards + interval: 50 diff --git a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml index 74ec81f366f..6e2a4ecfe13 100644 --- a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml +++ b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml @@ -5,15 +5,17 @@ metadata: label: Colorado CollegeInvest contribution subtraction max amount breakdown: - filing_status - # This parent uprating remains inactive pending selective propagation in PolicyEngine/policyengine-core#537. + propagate_metadata_to_children: true + # Project beyond published limits with the IRS inflation index as a proxy. + # C.R.S. 39-22-104(4)(i)(II)(C) uses state college tuition, room and board + # costs and permits the Department of Revenue to round to the nearest $100. uprating: parameter: gov.irs.uprating rounding: type: nearest interval: 100 -# Rounded to $100 per C.R.S. 39-22-104(4)(j)(II)(C), this approximates the true uprating for college tuition, room, and board. reference: - - title: C.R.S. 39-22-104(4)(j)(II)(B) + - title: C.R.S. 39-22-104(4)(i)(II)(B)-(C) href: https://law.justia.com/codes/colorado/2022/title-39/article-22/part-1/section-39-22-104/ - title: 2023 Colorado Individual Tax Filing Guide 104 Book - Subtractions Line 10 href: https://tax.colorado.gov/sites/tax/files/documents/Book0104_2023.pdf#page=13 @@ -21,6 +23,8 @@ metadata: href: https://tax.colorado.gov/sites/tax/files/documents/DR0104_book_2024.pdf#page=20 - title: 2025 Colorado Individual Tax Filing Guide 104 Book, Subtractions Line 10 href: https://tax.colorado.gov/sites/tax/files/documents/Book104_2025.pdf#page=20 + - title: Colorado Department of Revenue - CollegeInvest Contribution Subtraction, Per-Beneficiary Limits + href: https://tax.colorado.gov/income-tax-topics-collegeinvest-contribution-subtraction HEAD_OF_HOUSEHOLD: values: @@ -29,6 +33,7 @@ HEAD_OF_HOUSEHOLD: 2023-01-01: 20_700 2024-01-01: 22_700 2025-01-01: 25_400 + 2026-01-01: 26_200 metadata: unit: currency-USD period: year @@ -39,6 +44,7 @@ JOINT: 2023-01-01: 31_000 2024-01-01: 34_000 2025-01-01: 38_100 + 2026-01-01: 39_200 metadata: unit: currency-USD period: year @@ -49,6 +55,7 @@ SEPARATE: 2023-01-01: 20_700 2024-01-01: 22_700 2025-01-01: 25_400 + 2026-01-01: 26_200 metadata: unit: currency-USD period: year @@ -59,6 +66,7 @@ SINGLE: 2023-01-01: 20_700 2024-01-01: 22_700 2025-01-01: 25_400 + 2026-01-01: 26_200 metadata: unit: currency-USD period: year @@ -69,6 +77,7 @@ SURVIVING_SPOUSE: 2023-01-01: 20_700 2024-01-01: 22_700 2025-01-01: 25_400 + 2026-01-01: 26_200 metadata: unit: currency-USD period: year diff --git a/policyengine_us/tests/code_health/test_uprating_placement.py b/policyengine_us/tests/code_health/test_uprating_placement.py index 5b82e900d1d..be9dec71cf9 100644 --- a/policyengine_us/tests/code_health/test_uprating_placement.py +++ b/policyengine_us/tests/code_health/test_uprating_placement.py @@ -1,6 +1,10 @@ +import pytest import yaml +from policyengine_core.parameters import Parameter, ParameterNode +from policyengine_core.parameters.operations import propagate_parameter_metadata from policyengine_us.model_api import REPO +from policyengine_us.system import system PARAMETERS_ROOT = REPO / "parameters" @@ -92,3 +96,68 @@ def test_no_uprating_block_is_a_sibling_of_values(): " parameter: ...\n" "Offending nodes:\n" + "\n".join(violations) ) + + +def _find_unapplied_breakdown_uprating(root): + """Find parent uprating that reaches no metadata on some scalar leaves.""" + violations = {} + for node in root.get_descendants(): + if not isinstance(node, ParameterNode): + continue + if not node.metadata.get("breakdown"): + continue + if node.metadata.get("uprating") is None: + continue + missing = [ + leaf.name + for leaf in node.get_descendants() + if isinstance(leaf, Parameter) and leaf.metadata.get("uprating") is None + ] + if missing: + violations[node.name] = missing + return violations + + +def test_parent_uprating_reaches_breakdown_leaves(): + violations = _find_unapplied_breakdown_uprating(system.parameters) + assert not violations, ( + "The built parameter system omits uprating from leaves below parents " + "that declare both breakdown and uprating metadata. Add uprating to " + "each leaf, enable metadata propagation, or remove unsupported parent " + "uprating:\n" + + "\n".join( + f"{parent}: {', '.join(leaves)}" + for parent, leaves in sorted(violations.items()) + ) + ) + + +@pytest.mark.parametrize( + "propagation, leaf_uprating, missing", + [ + (None, (), ("SINGLE", "JOINT")), + (True, (), ()), + (False, (), ("SINGLE", "JOINT")), + (False, ("SINGLE", "JOINT"), ()), + (False, ("SINGLE",), ("JOINT",)), + ], +) +def test_detect_unapplied_parent_uprating(propagation, leaf_uprating, missing): + metadata = { + "breakdown": ["filing_status"], + "uprating": "price_index", + } + if propagation is not None: + metadata["propagate_metadata_to_children"] = propagation + threshold = {"metadata": metadata} + for status in ("SINGLE", "JOINT"): + threshold[status] = {"values": {"2024-01-01": 100}} + if status in leaf_uprating: + threshold[status]["metadata"] = {"uprating": "price_index"} + root = ParameterNode("", data={"threshold": threshold}) + propagate_parameter_metadata(root) + + expected = ( + {"threshold": [f"threshold.{status}" for status in missing]} if missing else {} + ) + assert _find_unapplied_breakdown_uprating(root) == expected diff --git a/policyengine_us/tests/core/test_breakdown_parameter_uprating.py b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py new file mode 100644 index 00000000000..e01c3f9fd1e --- /dev/null +++ b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py @@ -0,0 +1,164 @@ +"""Check Core's uprating of filing-status parameter children. + +Household YAML tests cannot read parameter values directly. These tests reuse +the built system to check projections, rounding and preservation of authored +values without constructing another model or household simulation. +""" + +from pathlib import Path + +import pytest +import yaml +from hypothesis import example, given, settings +from hypothesis import strategies as st +from policyengine_core.parameters import get_parameter + +from policyengine_us.system import system + + +STATUSES = ( + "SINGLE", + "SEPARATE", + "JOINT", + "HEAD_OF_HOUSEHOLD", + "SURVIVING_SPOUSE", +) +CO_PATH = "gov.states.co.tax.income.subtractions.collegeinvest_contribution.max_amount" +PEP_PATH = "gov.irs.income.exemption.phase_out.start" +BIDEN_PATH = "gov.contrib.biden.budget_2025.capital_gains.income_threshold" +PEP_ANCHORS = { + "SINGLE": 406_200, + "SEPARATE": 243_700, + "JOINT": 487_400, + "HEAD_OF_HOUSEHOLD": 446_800, + "SURVIVING_SPOUSE": 487_400, +} +PARAMETER_ROOT = Path(__file__).resolve().parents[2] / "parameters" +PROPERTY_SETTINGS = { + "max_examples": 20, + "deadline": None, + "derandomize": True, + "database": None, +} + + +def _value(path, status, year): + return get_parameter(system.parameters, f"{path}.{status}")(f"{year}-01-01") + + +def _irs_factor(year, anchor_year): + index = system.parameters.gov.irs.uprating + return index(f"{year}-01-01") / index(f"{anchor_year}-01-01") + + +def _authored_values(): + cases = [] + for path in (CO_PATH, PEP_PATH, BIDEN_PATH): + filename = PARAMETER_ROOT / f"{path.replace('.', '/')}.yaml" + data = yaml.safe_load(filename.read_text()) + for status in STATUSES: + for date, entry in data[status]["values"].items(): + value = entry["value"] if isinstance(entry, dict) else entry + cases.append((path, status, str(date), value)) + return tuple(cases) + + +AUTHORED_VALUES = _authored_values() + + +@pytest.mark.parametrize("status", STATUSES) +def test_colorado_2027_projects_from_published_2026_limit(status): + # Colorado publishes $39,200 for joint filers and $26,200 otherwise. + # The retained IRS-index proxy rounds the projected amount to $100. + # 26,200 * 181.97958333333335 / 176.71308333333332 = 26,980.8267 -> 27,000. + # 39,200 * 181.97958333333335 / 176.71308333333332 = 40,368.2598 -> 40,400. + anchor = 39_200 if status == "JOINT" else 26_200 + expected = 40_400 if status == "JOINT" else 27_000 + assert _value(CO_PATH, status, 2027) == expected + assert expected > anchor + + +@pytest.mark.parametrize("status", STATUSES) +def test_personal_exemption_2036_projects_after_last_cbo_forecast(status): + # CBO's last forecast supplies the 2035 anchors. Historical IRC 68(b) + # rounds down to $50; separate filers receive half the joint amount. + # Multiply by 217.05 / 212.85, then round down: + # single: 406,200 * factor = 414,215.222 -> 414,200; + # separate: 243,700 * factor = 248,508.739 -> 248,500; + # joint/surviving spouse: 487,400 * factor = 497,017.477 -> 497,000; + # head of household: 446,800 * factor = 455,616.350 -> 455,600. + expected = { + "SINGLE": 414_200, + "SEPARATE": 248_500, + "JOINT": 497_000, + "HEAD_OF_HOUSEHOLD": 455_600, + "SURVIVING_SPOUSE": 497_000, + }[status] + assert _value(PEP_PATH, status, 2036) == expected + assert expected > PEP_ANCHORS[status] + + +@pytest.mark.parametrize("status", STATUSES) +def test_biden_2025_projects_from_proposed_2024_threshold(status): + # Treasury's FY2025 proposal indexes $1 million ($500,000 for separate + # filers) after 2024 and specifies no rounding interval. + # 1,000,000 * 172.797 / 167.95475 = 1,028,830.6820735942; + # separate filers receive half: 514,415.3410367971. + anchor = 500_000 if status == "SEPARATE" else 1_000_000 + expected = 514_415.3410367971 if status == "SEPARATE" else 1_028_830.6820735942 + assert _value(BIDEN_PATH, status, 2025) == pytest.approx( + expected, rel=1e-12, abs=1e-8 + ) + assert expected > anchor + + +@settings(**PROPERTY_SETTINGS) +@given(year=st.integers(2027, 2050), status=st.sampled_from(STATUSES)) +def test_colorado_projection_rounding_bounds_and_order(year, status): + anchor = 39_200 if status == "JOINT" else 26_200 + value = _value(CO_PATH, status, year) + unrounded = anchor * _irs_factor(year, 2026) + assert value % 100 == 0 + assert abs(value - unrounded) <= 50 + assert value >= _value(CO_PATH, status, year - 1) + assert value > anchor + assert _value(CO_PATH, "SURVIVING_SPOUSE", year) == _value(CO_PATH, "SINGLE", year) + + +@settings(**PROPERTY_SETTINGS) +@given(year=st.integers(2036, 2050), status=st.sampled_from(STATUSES)) +def test_personal_exemption_projection_rounding_bounds_and_order(year, status): + value = _value(PEP_PATH, status, year) + interval = 25 if status == "SEPARATE" else 50 + unrounded = PEP_ANCHORS[status] * _irs_factor(year, 2035) + assert value % interval == 0 + assert 0 <= unrounded - value < interval + assert value >= _value(PEP_PATH, status, year - 1) + assert value > PEP_ANCHORS[status] + joint = _value(PEP_PATH, "JOINT", year) + assert _value(PEP_PATH, "SEPARATE", year) == joint / 2 + assert _value(PEP_PATH, "SURVIVING_SPOUSE", year) == joint + + +@settings(**PROPERTY_SETTINGS) +@given(year=st.integers(2025, 2050), status=st.sampled_from(STATUSES)) +def test_biden_projection_tracks_index_and_filing_status_ratios(year, status): + anchor = 500_000 if status == "SEPARATE" else 1_000_000 + value = _value(BIDEN_PATH, status, year) + assert value / anchor == pytest.approx(_irs_factor(year, 2024), rel=1e-12) + assert value >= _value(BIDEN_PATH, status, year - 1) + assert value > anchor + joint = _value(BIDEN_PATH, "JOINT", year) + assert _value(BIDEN_PATH, "SEPARATE", year) == pytest.approx(joint / 2, rel=1e-12) + for same_threshold in ("SINGLE", "HEAD_OF_HOUSEHOLD", "SURVIVING_SPOUSE"): + assert _value(BIDEN_PATH, same_threshold, year) == joint + + +@settings(**PROPERTY_SETTINGS) +@given(case=st.sampled_from(AUTHORED_VALUES)) +@example(case=(CO_PATH, "SINGLE", "2021-01-01", float("inf"))) +@example(case=(PEP_PATH, "JOINT", "2018-01-01", float("inf"))) +def test_uprating_preserves_authored_values(case): + path, status, date, expected = case + actual = get_parameter(system.parameters, f"{path}.{status}")(date) + assert actual == expected diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml new file mode 100644 index 00000000000..4d68f797f25 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml @@ -0,0 +1,38 @@ +# Congress keeps personal exemptions suspended after 2017. +- name: Personal exemptions remain zero under current law after 2035 + period: 2036 + input: + exemptions_count: 1 + adjusted_gross_income: [0, 414_199, 414_200, 414_201, 1_000_000] + filing_status: SINGLE + output: + exemptions: [0, 0, 0, 0, 0] + +# Isolate the legacy threshold in a counterfactual with a $1,000 exemption. +# 406,200 * 217.05 / 212.85 = 414,215.22199, rounded down to $50 = 414,200. +# One full $2,500 step above the threshold phases out 2% * $1,000 = $20. +- name: A restored exemption uses the projected single phaseout threshold + period: 2036 + absolute_error_margin: 0.001 + input: + gov.irs.income.exemption.suspended: false + gov.irs.income.exemption.amount: 1_000 + exemptions_count: 1 + adjusted_gross_income: [414_199, 414_200, 416_700] + filing_status: SINGLE + output: + exemptions: [1_000, 1_000, 980] + +# 243,700 * 217.05 / 212.85 = 248,508.73855 -> 248,500 (down to $25). +# One full $1,250 step above the threshold phases out 2% * $1,000 = $20. +- name: A restored exemption uses half the joint threshold for separate filers + period: 2036 + absolute_error_margin: 0.001 + input: + gov.irs.income.exemption.suspended: false + gov.irs.income.exemption.amount: 1_000 + exemptions_count: 1 + adjusted_gross_income: [248_499, 248_500, 249_750] + filing_status: SEPARATE + output: + exemptions: [1_000, 1_000, 980] diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml index ef9bdf73d0a..e112367ebbf 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml @@ -37,3 +37,62 @@ output: co_collegeinvest_subtraction: 25_000 # below capped amount + +# Colorado DOR publishes 2026 limits of $26,200 and $39,200. +# Subtract min(contribution, filing-status limit), including at either side. +- name: Single filers subtract contributions up to the published 2026 limit + period: 2026 + input: + investment_in_529_plan: [26_199, 26_200, 26_201] + filing_status: SINGLE + state_code: CO + output: + co_collegeinvest_subtraction: [26_199, 26_200, 26_200] + +- name: Joint filers subtract contributions up to the published 2026 limit + period: 2026 + input: + investment_in_529_plan: [39_199, 39_200, 39_201] + filing_status: JOINT + state_code: CO + output: + co_collegeinvest_subtraction: [39_199, 39_200, 39_200] + +- name: Other filing statuses use the published 2026 single limit + period: 2026 + input: + investment_in_529_plan: 50_000 + filing_status: [SEPARATE, HEAD_OF_HOUSEHOLD, SURVIVING_SPOUSE] + state_code: CO + output: + co_collegeinvest_subtraction: [26_200, 26_200, 26_200] + +# Project the 2026 actuals with the existing IRS inflation proxy: +# 26,200 * 181.97958333333335 / 176.71308333333332 = 26,980.8267 -> 27,000. +# 39,200 * the same ratio = 40,368.2598 -> 40,400 (nearest $100). +- name: Single filers use the projected cap after the last published year + period: 2027 + input: + investment_in_529_plan: [26_999, 27_000, 27_001] + filing_status: SINGLE + state_code: CO + output: + co_collegeinvest_subtraction: [26_999, 27_000, 27_000] + +- name: Joint filers use the projected cap after the last published year + period: 2027 + input: + investment_in_529_plan: [40_399, 40_400, 40_401] + filing_status: JOINT + state_code: CO + output: + co_collegeinvest_subtraction: [40_399, 40_400, 40_400] + +- name: Other states do not receive Colorado's subtraction + period: 2027 + input: + investment_in_529_plan: 50_000 + filing_status: SINGLE + state_code: CA + output: + co_collegeinvest_subtraction: 0 diff --git a/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml b/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml index 2e452539778..c2540e2d0d2 100644 --- a/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml +++ b/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml @@ -57,3 +57,31 @@ taxable_income: 48_475 income_tax_main_rates: 5_563.50 capital_gains_tax: 15 + +# Treasury indexes the 2024 $1m threshold after 2024. With the IRS proxy, +# $1m * 172.797 / 167.95475 = $1,028,830.6820735942 in 2025. +# Set taxable income directly to isolate the threshold. All $100,000 of gains +# otherwise face 20%; the excess faces 37%, adding 17% of the excess. +- name: The proposal indexes the single threshold before taxing excess gains + period: 2025 + absolute_error_margin: 0.01 + reforms: policyengine_us.reforms.biden.budget_2025.capital_gains_tax_increase.capital_gains_tax_increase + input: + filing_status: SINGLE + taxable_income: [1_028_830, 1_028_830.6820735942, 1_028_832] + long_term_capital_gains: 100_000 + output: + capital_gains_tax: [20_000, 20_000, 20_000.2240475] + +# Separate: $500,000 * 172.797 / 167.95475 = $514,415.3410367971. +# At $514,417, tax = $20,000 + ($514,417 - $514,415.3410367971) * 17%. +- name: The proposal indexes half the threshold for separate filers + period: 2025 + absolute_error_margin: 0.01 + reforms: policyengine_us.reforms.biden.budget_2025.capital_gains_tax_increase.capital_gains_tax_increase + input: + filing_status: SEPARATE + taxable_income: [514_415, 514_415.3410367971, 514_417] + long_term_capital_gains: 100_000 + output: + capital_gains_tax: [20_000, 20_000, 20_000.2820237] From 91c5e9b90e27e6f6cc26367aa9eebe3f21250eab Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 00:35:29 -0500 Subject: [PATCH 2/9] Check parameter projections through 2100 Co-Authored-By: Claude Opus 5.5 --- .../core/test_breakdown_parameter_uprating.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/policyengine_us/tests/core/test_breakdown_parameter_uprating.py b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py index e01c3f9fd1e..cda5bbb588a 100644 --- a/policyengine_us/tests/core/test_breakdown_parameter_uprating.py +++ b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py @@ -113,7 +113,8 @@ def test_biden_2025_projects_from_proposed_2024_threshold(status): @settings(**PROPERTY_SETTINGS) -@given(year=st.integers(2027, 2050), status=st.sampled_from(STATUSES)) +@given(year=st.integers(2027, 2100), status=st.sampled_from(STATUSES)) +@example(year=2100, status="SEPARATE") def test_colorado_projection_rounding_bounds_and_order(year, status): anchor = 39_200 if status == "JOINT" else 26_200 value = _value(CO_PATH, status, year) @@ -126,8 +127,11 @@ def test_colorado_projection_rounding_bounds_and_order(year, status): @settings(**PROPERTY_SETTINGS) -@given(year=st.integers(2036, 2050), status=st.sampled_from(STATUSES)) +@given(year=st.integers(2036, 2100), status=st.sampled_from(STATUSES)) +@example(year=2100, status="SEPARATE") +@example(year=2043, status="SEPARATE") def test_personal_exemption_projection_rounding_bounds_and_order(year, status): + assert system.parameters.gov.irs.income.exemption.suspended(f"{year}-01-01") value = _value(PEP_PATH, status, year) interval = 25 if status == "SEPARATE" else 50 unrounded = PEP_ANCHORS[status] * _irs_factor(year, 2035) @@ -141,8 +145,12 @@ def test_personal_exemption_projection_rounding_bounds_and_order(year, status): @settings(**PROPERTY_SETTINGS) -@given(year=st.integers(2025, 2050), status=st.sampled_from(STATUSES)) +@given(year=st.integers(2025, 2100), status=st.sampled_from(STATUSES)) +@example(year=2100, status="SEPARATE") def test_biden_projection_tracks_index_and_filing_status_ratios(year, status): + assert not system.parameters.gov.contrib.biden.budget_2025.capital_gains.active( + f"{year}-01-01" + ) anchor = 500_000 if status == "SEPARATE" else 1_000_000 value = _value(BIDEN_PATH, status, year) assert value / anchor == pytest.approx(_irs_factor(year, 2024), rel=1e-12) From 3924bdd457c668ba012fb13588979f67a8fb2ad3 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 00:39:18 -0500 Subject: [PATCH 3/9] Match entity-array lengths in uprating test cases Co-Authored-By: Claude Opus 5.5 --- .../taxable_income/exemptions/exemptions.yaml | 12 +++++------ .../co_collegeinvest_contribution.yaml | 20 +++++++++---------- .../capital_gains_tax_increase.yaml | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml index 4d68f797f25..5ea7ed1a9d6 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml @@ -2,9 +2,9 @@ - name: Personal exemptions remain zero under current law after 2035 period: 2036 input: - exemptions_count: 1 + exemptions_count: [1, 1, 1, 1, 1] adjusted_gross_income: [0, 414_199, 414_200, 414_201, 1_000_000] - filing_status: SINGLE + filing_status: [SINGLE, SINGLE, SINGLE, SINGLE, SINGLE] output: exemptions: [0, 0, 0, 0, 0] @@ -17,9 +17,9 @@ input: gov.irs.income.exemption.suspended: false gov.irs.income.exemption.amount: 1_000 - exemptions_count: 1 + exemptions_count: [1, 1, 1] adjusted_gross_income: [414_199, 414_200, 416_700] - filing_status: SINGLE + filing_status: [SINGLE, SINGLE, SINGLE] output: exemptions: [1_000, 1_000, 980] @@ -31,8 +31,8 @@ input: gov.irs.income.exemption.suspended: false gov.irs.income.exemption.amount: 1_000 - exemptions_count: 1 + exemptions_count: [1, 1, 1] adjusted_gross_income: [248_499, 248_500, 249_750] - filing_status: SEPARATE + filing_status: [SEPARATE, SEPARATE, SEPARATE] output: exemptions: [1_000, 1_000, 980] diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml index e112367ebbf..5c5f136496f 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_contribution.yaml @@ -44,8 +44,8 @@ period: 2026 input: investment_in_529_plan: [26_199, 26_200, 26_201] - filing_status: SINGLE - state_code: CO + filing_status: [SINGLE, SINGLE, SINGLE] + state_code: [CO, CO, CO] output: co_collegeinvest_subtraction: [26_199, 26_200, 26_200] @@ -53,17 +53,17 @@ period: 2026 input: investment_in_529_plan: [39_199, 39_200, 39_201] - filing_status: JOINT - state_code: CO + filing_status: [JOINT, JOINT, JOINT] + state_code: [CO, CO, CO] output: co_collegeinvest_subtraction: [39_199, 39_200, 39_200] - name: Other filing statuses use the published 2026 single limit period: 2026 input: - investment_in_529_plan: 50_000 + investment_in_529_plan: [50_000, 50_000, 50_000] filing_status: [SEPARATE, HEAD_OF_HOUSEHOLD, SURVIVING_SPOUSE] - state_code: CO + state_code: [CO, CO, CO] output: co_collegeinvest_subtraction: [26_200, 26_200, 26_200] @@ -74,8 +74,8 @@ period: 2027 input: investment_in_529_plan: [26_999, 27_000, 27_001] - filing_status: SINGLE - state_code: CO + filing_status: [SINGLE, SINGLE, SINGLE] + state_code: [CO, CO, CO] output: co_collegeinvest_subtraction: [26_999, 27_000, 27_000] @@ -83,8 +83,8 @@ period: 2027 input: investment_in_529_plan: [40_399, 40_400, 40_401] - filing_status: JOINT - state_code: CO + filing_status: [JOINT, JOINT, JOINT] + state_code: [CO, CO, CO] output: co_collegeinvest_subtraction: [40_399, 40_400, 40_400] diff --git a/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml b/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml index c2540e2d0d2..91c33c30c70 100644 --- a/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml +++ b/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml @@ -67,9 +67,9 @@ absolute_error_margin: 0.01 reforms: policyengine_us.reforms.biden.budget_2025.capital_gains_tax_increase.capital_gains_tax_increase input: - filing_status: SINGLE + filing_status: [SINGLE, SINGLE, SINGLE] taxable_income: [1_028_830, 1_028_830.6820735942, 1_028_832] - long_term_capital_gains: 100_000 + long_term_capital_gains: [100_000, 100_000, 100_000] output: capital_gains_tax: [20_000, 20_000, 20_000.2240475] @@ -80,8 +80,8 @@ absolute_error_margin: 0.01 reforms: policyengine_us.reforms.biden.budget_2025.capital_gains_tax_increase.capital_gains_tax_increase input: - filing_status: SEPARATE + filing_status: [SEPARATE, SEPARATE, SEPARATE] taxable_income: [514_415, 514_415.3410367971, 514_417] - long_term_capital_gains: 100_000 + long_term_capital_gains: [100_000, 100_000, 100_000] output: capital_gains_tax: [20_000, 20_000, 20_000.2820237] From 8a2d8c6b7f2db3055515c4e0f92c23db1f722853 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 00:47:45 -0500 Subject: [PATCH 4/9] Clarify the sources and projection assumptions Co-Authored-By: Claude Opus 5.5 --- .../biden/budget_2025/capital_gains/income_threshold.yaml | 2 +- .../gov/irs/income/exemption/phase_out/start.yaml | 4 ++-- .../collegeinvest_contribution/max_amount.yaml | 5 +++-- .../tests/core/test_breakdown_parameter_uprating.py | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml b/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml index 46cab9ed193..9b93fa57f60 100644 --- a/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml +++ b/policyengine_us/parameters/gov/contrib/biden/budget_2025/capital_gains/income_threshold.yaml @@ -7,7 +7,7 @@ metadata: unit: currency-USD period: year propagate_metadata_to_children: true - # Treasury indexes these thresholds after 2024 without specifying an index + # Treasury proposes indexing these thresholds after 2024 without specifying an index # or rounding interval; use the existing IRS inflation index for projections. uprating: gov.irs.uprating diff --git a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml index 6340bd2d5f2..c52df1cdbcc 100644 --- a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml +++ b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml @@ -6,8 +6,8 @@ metadata: unit: currency-USD # Keep CBO's legacy forecasts for counterfactual reforms; personal exemptions # remain suspended under current law. Project from the final forecast year. - # Historical section 68(b) rounds down to $50, then halves the joint amount - # for separate filers. Set rounding on each child to preserve that order. + # Under historical section 68(b), round down to $50 before halving the + # joint amount for separate filers. Set child rounding to preserve that order. uprating: gov.irs.uprating reference: - title: 26 U.S. Code § 151 - Allowance of deductions for personal exemptions (d)(3)(B) diff --git a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml index 6e2a4ecfe13..6e2d70713a8 100644 --- a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml +++ b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml @@ -7,8 +7,9 @@ metadata: - filing_status propagate_metadata_to_children: true # Project beyond published limits with the IRS inflation index as a proxy. - # C.R.S. 39-22-104(4)(i)(II)(C) uses state college tuition, room and board - # costs and permits the Department of Revenue to round to the nearest $100. + # Under C.R.S. 39-22-104(4)(i)(II)(C), the Department of Higher Education + # supplies annual tuition, room and board cost changes for state colleges. + # The Department of Revenue may round limits to the nearest $100. uprating: parameter: gov.irs.uprating rounding: diff --git a/policyengine_us/tests/core/test_breakdown_parameter_uprating.py b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py index cda5bbb588a..b872a195275 100644 --- a/policyengine_us/tests/core/test_breakdown_parameter_uprating.py +++ b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py @@ -80,8 +80,8 @@ def test_colorado_2027_projects_from_published_2026_limit(status): @pytest.mark.parametrize("status", STATUSES) def test_personal_exemption_2036_projects_after_last_cbo_forecast(status): - # CBO's last forecast supplies the 2035 anchors. Historical IRC 68(b) - # rounds down to $50; separate filers receive half the joint amount. + # Use CBO's 2035 forecasts as anchors. Under historical IRC 68(b), round + # down to $50; separate filers receive half the joint amount. # Multiply by 217.05 / 212.85, then round down: # single: 406,200 * factor = 414,215.222 -> 414,200; # separate: 243,700 * factor = 248,508.739 -> 248,500; @@ -100,8 +100,8 @@ def test_personal_exemption_2036_projects_after_last_cbo_forecast(status): @pytest.mark.parametrize("status", STATUSES) def test_biden_2025_projects_from_proposed_2024_threshold(status): - # Treasury's FY2025 proposal indexes $1 million ($500,000 for separate - # filers) after 2024 and specifies no rounding interval. + # Treasury proposes indexing $1 million ($500,000 for separate filers) + # after 2024 in its FY2025 proposal, without specifying a rounding interval. # 1,000,000 * 172.797 / 167.95475 = 1,028,830.6820735942; # separate filers receive half: 514,415.3410367971. anchor = 500_000 if status == "SEPARATE" else 1_000_000 From f1194993838012d7d7f45d8b0bb57200862b7521 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 01:05:51 -0500 Subject: [PATCH 5/9] Reuse the active reform fixture in capital gains tests Co-Authored-By: Claude Opus 5.5 --- .../contrib/biden/budget_2025/capital_gains_tax_increase.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml b/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml index 91c33c30c70..af5a15e336a 100644 --- a/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml +++ b/policyengine_us/tests/policy/contrib/biden/budget_2025/capital_gains_tax_increase.yaml @@ -67,6 +67,7 @@ absolute_error_margin: 0.01 reforms: policyengine_us.reforms.biden.budget_2025.capital_gains_tax_increase.capital_gains_tax_increase input: + gov.contrib.biden.budget_2025.capital_gains.active: true filing_status: [SINGLE, SINGLE, SINGLE] taxable_income: [1_028_830, 1_028_830.6820735942, 1_028_832] long_term_capital_gains: [100_000, 100_000, 100_000] @@ -80,6 +81,7 @@ absolute_error_margin: 0.01 reforms: policyengine_us.reforms.biden.budget_2025.capital_gains_tax_increase.capital_gains_tax_increase input: + gov.contrib.biden.budget_2025.capital_gains.active: true filing_status: [SEPARATE, SEPARATE, SEPARATE] taxable_income: [514_415, 514_415.3410367971, 514_417] long_term_capital_gains: [100_000, 100_000, 100_000] From 7d3b7c5ae6d7ecf1b354a4063356e782f1b62757 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 01:34:29 -0500 Subject: [PATCH 6/9] Cite the government copies of the indexing statutes Co-Authored-By: Claude Opus 5.5 --- .../gov/irs/income/exemption/phase_out/start.yaml | 6 ++---- .../subtractions/collegeinvest_contribution/max_amount.yaml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml index c52df1cdbcc..fa2398f944d 100644 --- a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml +++ b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml @@ -12,13 +12,11 @@ metadata: reference: - title: 26 U.S. Code § 151 - Allowance of deductions for personal exemptions (d)(3)(B) href: https://www.law.cornell.edu/uscode/text/26/151#d_3_B - - title: 26 U.S. Code § 68 - Overall limitation on itemized deductions (b)(1) - href: https://www.law.cornell.edu/uscode/text/26/68#b_1 + - title: 26 U.S.C. 68(b) (2024 edition), applicable amount and inflation adjustment + href: https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partI-sec68.htm - title: CBO Tax Parameters and Effective Marginal Tax Rates | Jan 2025 # 1. Tax Parameters. href: https://www.cbo.gov/data/budget-economic-data - - title: 26 U.S.C. 68(b) (2024 edition), applicable amount and inflation adjustment - href: https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partI-sec68.htm - title: CBO January 2025 tax parameter forecasts href: https://raw.githubusercontent.com/US-CBO/cbo-data/main/data/budget/tax_parameters/annual_cy_2025-01.csv diff --git a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml index 6e2d70713a8..d02727f626b 100644 --- a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml +++ b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml @@ -17,7 +17,7 @@ metadata: interval: 100 reference: - title: C.R.S. 39-22-104(4)(i)(II)(B)-(C) - href: https://law.justia.com/codes/colorado/2022/title-39/article-22/part-1/section-39-22-104/ + href: https://content.leg.colorado.gov/sites/default/files/images/olls/crs2024-title-39.pdf#page=393 - title: 2023 Colorado Individual Tax Filing Guide 104 Book - Subtractions Line 10 href: https://tax.colorado.gov/sites/tax/files/documents/Book0104_2023.pdf#page=13 - title: 2024 Colorado Individual Tax Filing Guide 104 Book - Subtractions Line 10 From 91d9ba6b1f57b62ca0c545d236e54521f6bb0248 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 23:22:35 -0500 Subject: [PATCH 7/9] Address filing-status parameter uprating review findings Co-Authored-By: Claude Opus 5.5 --- .../fix-breakdown-parameter-uprating.fixed.md | 1 + .../irs/income/exemption/phase_out/start.yaml | 2 +- .../gov/states/co/tax/income/rate.yaml | 4 +-- .../max_amount.yaml | 4 +-- .../core/test_breakdown_parameter_uprating.py | 5 +-- .../taxable_income/exemptions/exemptions.yaml | 32 +++++++++++++++++++ .../co_collegeinvest_subtraction.py | 4 +-- 7 files changed, 41 insertions(+), 11 deletions(-) diff --git a/changelog.d/fix-breakdown-parameter-uprating.fixed.md b/changelog.d/fix-breakdown-parameter-uprating.fixed.md index c9adf733691..9ee47ae9d2c 100644 --- a/changelog.d/fix-breakdown-parameter-uprating.fixed.md +++ b/changelog.d/fix-breakdown-parameter-uprating.fixed.md @@ -1 +1,2 @@ Activated filing-status parameter uprating for Colorado's CollegeInvest subtraction, legacy personal exemption phaseout thresholds, and the Biden FY2025 capital gains proposal, and added Colorado's published 2026 limits. +Corrected the 2032 head-of-household exemption phaseout threshold to match CBO's January 2025 forecast. diff --git a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml index fa2398f944d..5a0fb2dfad7 100644 --- a/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml +++ b/policyengine_us/parameters/gov/irs/income/exemption/phase_out/start.yaml @@ -113,7 +113,7 @@ HEAD_OF_HOUSEHOLD: 2029-01-01: 397_200 2030-01-01: 405_000 2031-01-01: 413_050 - 2032-01-01: 421_050 + 2032-01-01: 421_200 2033-01-01: 429_550 2034-01-01: 438_100 2035-01-01: 446_800 diff --git a/policyengine_us/parameters/gov/states/co/tax/income/rate.yaml b/policyengine_us/parameters/gov/states/co/tax/income/rate.yaml index e69f5b6aa02..c06f52733ec 100644 --- a/policyengine_us/parameters/gov/states/co/tax/income/rate.yaml +++ b/policyengine_us/parameters/gov/states/co/tax/income/rate.yaml @@ -6,9 +6,9 @@ metadata: # THE FOLLOWING THREE REFERENCES JOINTLY DETERMINE THE TAX RATE ON THE FORM reference: - title: Colorado Legislation, C.R.S. 39-22-104 (1.5), (1.7) (a), (b) - href: https://law.justia.com/codes/colorado/2022/title-39/article-22/part-1/section-39-22-104/ + href: https://content.leg.colorado.gov/sites/default/files/images/olls/crs2024-title-39.pdf#page=387 - title: Colorado Constitution, Article 10, Taxpayer's Bill of Rights (TABOR) - href: https://law.justia.com/constitution/colorado/cnart10.html + href: https://content.leg.colorado.gov/sites/default/files/images/olls/crs2024-title-00.pdf#page=102 - title: Colorado Proposition 121, passed by the electorate in November 2022 href: https://leg.colorado.gov/sites/default/files/initiative%2520referendum_proposition%20121%20final%20lc%20packet.pdf#page=1 - title: 2021 Colorado Individual Income Tax Filing Guide, 104 Book diff --git a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml index d02727f626b..9c8a40c8fb3 100644 --- a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml +++ b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml @@ -16,8 +16,8 @@ metadata: type: nearest interval: 100 reference: - - title: C.R.S. 39-22-104(4)(i)(II)(B)-(C) - href: https://content.leg.colorado.gov/sites/default/files/images/olls/crs2024-title-39.pdf#page=393 + - title: "C.R.S. 39-22-104(4)(i)(II)(B)-(C) #page 392-393" + href: https://content.leg.colorado.gov/sites/default/files/images/olls/crs2024-title-39.pdf#page=392 - title: 2023 Colorado Individual Tax Filing Guide 104 Book - Subtractions Line 10 href: https://tax.colorado.gov/sites/tax/files/documents/Book0104_2023.pdf#page=13 - title: 2024 Colorado Individual Tax Filing Guide 104 Book - Subtractions Line 10 diff --git a/policyengine_us/tests/core/test_breakdown_parameter_uprating.py b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py index b872a195275..03d5afa24ab 100644 --- a/policyengine_us/tests/core/test_breakdown_parameter_uprating.py +++ b/policyengine_us/tests/core/test_breakdown_parameter_uprating.py @@ -162,10 +162,7 @@ def test_biden_projection_tracks_index_and_filing_status_ratios(year, status): assert _value(BIDEN_PATH, same_threshold, year) == joint -@settings(**PROPERTY_SETTINGS) -@given(case=st.sampled_from(AUTHORED_VALUES)) -@example(case=(CO_PATH, "SINGLE", "2021-01-01", float("inf"))) -@example(case=(PEP_PATH, "JOINT", "2018-01-01", float("inf"))) +@pytest.mark.parametrize("case", AUTHORED_VALUES) def test_uprating_preserves_authored_values(case): path, status, date, expected = case actual = get_parameter(system.parameters, f"{path}.{status}")(date) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml index 5ea7ed1a9d6..dbe238ea4da 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml @@ -23,6 +23,22 @@ output: exemptions: [1_000, 1_000, 980] +# CBO's January 2025 CSV gives the 2032 head-of-household threshold as $421,200: +# https://raw.githubusercontent.com/US-CBO/cbo-data/main/data/budget/tax_parameters/annual_cy_2025-01.csv +# At $421,200, excess AGI = $0; at $423,700, excess AGI / $2,500 = 1 step. +# $1,000 * (1 - 1 * 0.02) = $980 after one full step. +- name: A restored exemption uses CBO's 2032 head-of-household threshold + period: 2032 + absolute_error_margin: 0.001 + input: + gov.irs.income.exemption.suspended: false + gov.irs.income.exemption.amount: 1_000 + exemptions_count: [1, 1, 1] + adjusted_gross_income: [421_199, 421_200, 423_700] + filing_status: [HEAD_OF_HOUSEHOLD, HEAD_OF_HOUSEHOLD, HEAD_OF_HOUSEHOLD] + output: + exemptions: [1_000, 1_000, 980] + # 243,700 * 217.05 / 212.85 = 248,508.73855 -> 248,500 (down to $25). # One full $1,250 step above the threshold phases out 2% * $1,000 = $20. - name: A restored exemption uses half the joint threshold for separate filers @@ -36,3 +52,19 @@ filing_status: [SEPARATE, SEPARATE, SEPARATE] output: exemptions: [1_000, 1_000, 980] + +# 487,400 * (217.05 / 212.85)^3 = 516,825.49806 in 2038. +# Round down to $50 = $516,800; rounding to nearest would give $516,850. +# At $519,300, ($519,300 - $516,800) / $2,500 = 1 full step. +# $1,000 * (1 - 1 * 0.02) = $980. +- name: A restored exemption rounds the projected joint threshold down + period: 2038 + absolute_error_margin: 0.001 + input: + gov.irs.income.exemption.suspended: false + gov.irs.income.exemption.amount: 1_000 + exemptions_count: [1, 1, 1] + adjusted_gross_income: [516_799, 516_800, 519_300] + filing_status: [JOINT, JOINT, JOINT] + output: + exemptions: [1_000, 1_000, 980] diff --git a/policyengine_us/variables/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_subtraction.py b/policyengine_us/variables/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_subtraction.py index 7da893f2fd4..15e7f591dec 100644 --- a/policyengine_us/variables/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_subtraction.py +++ b/policyengine_us/variables/gov/states/co/tax/income/subtractions/collegeinvest_contribution/co_collegeinvest_subtraction.py @@ -10,8 +10,8 @@ class co_collegeinvest_subtraction(Variable): reference = ( "https://tax.colorado.gov/sites/tax/files/documents/DR0104AD_2022.pdf#page=1", "https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2022.pdf#page=12", - "https://law.justia.com/codes/colorado/2022/title-39/article-22/part-1/section-39-22-104/", - # C.R.S. 39-22-104(4)(i)(II)(B) + # C.R.S. 39-22-104(4)(i)(II)(B)-(C), PDF pages 392-393. + "https://content.leg.colorado.gov/sites/default/files/images/olls/crs2024-title-39.pdf#page=392", ) defined_for = StateCode.CO From 70d91852271c7d78d60c6255f8070777033fe2c7 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 15 Nov 2026 01:39:06 -0500 Subject: [PATCH 8/9] Cite Colorado's 2026 CollegeInvest subtraction limits Co-Authored-By: Claude Opus 5.5 --- .../subtractions/collegeinvest_contribution/max_amount.yaml | 2 ++ .../gov/irs/income/taxable_income/exemptions/exemptions.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml index 9c8a40c8fb3..3e1cdfe3b8e 100644 --- a/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml +++ b/policyengine_us/parameters/gov/states/co/tax/income/subtractions/collegeinvest_contribution/max_amount.yaml @@ -26,6 +26,8 @@ metadata: href: https://tax.colorado.gov/sites/tax/files/documents/Book104_2025.pdf#page=20 - title: Colorado Department of Revenue - CollegeInvest Contribution Subtraction, Per-Beneficiary Limits href: https://tax.colorado.gov/income-tax-topics-collegeinvest-contribution-subtraction + - title: Colorado Department of Revenue - CollegeInvest Contribution Subtraction, November 2026 + href: https://tax.colorado.gov/sites/default/files/2026-11/ITT_CollegeInvest_Contribution_Subtraction_Nov_2026.pdf#page=2 HEAD_OF_HOUSEHOLD: values: diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml index dbe238ea4da..780fe1ede15 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml @@ -23,7 +23,7 @@ output: exemptions: [1_000, 1_000, 980] -# CBO's January 2025 CSV gives the 2032 head-of-household threshold as $421,200: +# CBO gives the 2032 head-of-household threshold as $421,200 in its January 2025 CSV: # https://raw.githubusercontent.com/US-CBO/cbo-data/main/data/budget/tax_parameters/annual_cy_2025-01.csv # At $421,200, excess AGI = $0; at $423,700, excess AGI / $2,500 = 1 step. # $1,000 * (1 - 1 * 0.02) = $980 after one full step. From ec5403f3b4c9138e933b34c81c8196f5f36f240c Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 15 Nov 2026 18:17:19 -0500 Subject: [PATCH 9/9] Check the first dollar above each restored exemption threshold The exemptions formula on main counts a fraction of a phaseout step as a full step, following IRC 151(d)(3)(B). A case that tests only one full step above its threshold then passes for any threshold within that step. Add adjusted gross income $1 above the threshold to each of the four restored-exemption cases. The joint case again separates rounding the 2038 threshold down to $516,800 from rounding it to the nearest $50. Co-Authored-By: Claude Fable 5.2 --- .../taxable_income/exemptions/exemptions.yaml | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml index 4ce2522e015..168aafa2028 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml @@ -209,61 +209,67 @@ # Isolate the legacy threshold in a counterfactual with a $1,000 exemption. # 406,200 * 217.05 / 212.85 = 414,215.22199, rounded down to $50 = 414,200. -# One full $2,500 step above the threshold phases out 2% * $1,000 = $20. +# Filers lose 2% for each $2,500, or fraction of $2,500, of AGI above the +# threshold (IRC 151(d)(3)(B)): $1 and $2,500 above it each make one step. +# One step phases out 2% * $1,000 = $20. - name: A restored exemption uses the projected single phaseout threshold period: 2036 absolute_error_margin: 0.001 input: gov.irs.income.exemption.suspended: false gov.irs.income.exemption.amount: 1_000 - exemptions_count: [1, 1, 1] - adjusted_gross_income: [414_199, 414_200, 416_700] - filing_status: [SINGLE, SINGLE, SINGLE] + exemptions_count: [1, 1, 1, 1] + adjusted_gross_income: [414_199, 414_200, 414_201, 416_700] + filing_status: [SINGLE, SINGLE, SINGLE, SINGLE] output: - exemptions: [1_000, 1_000, 980] + exemptions: [1_000, 1_000, 980, 980] # CBO gives the 2032 head-of-household threshold as $421,200 in its January 2025 CSV: # https://raw.githubusercontent.com/US-CBO/cbo-data/main/data/budget/tax_parameters/annual_cy_2025-01.csv -# At $421,200, excess AGI = $0; at $423,700, excess AGI / $2,500 = 1 step. -# $1,000 * (1 - 1 * 0.02) = $980 after one full step. +# At $421,200, excess AGI = $0. At $421,201, $1 / $2,500 rounds up to 1 step; +# at $423,700, $2,500 / $2,500 = 1 step. +# $1,000 * (1 - 1 * 0.02) = $980 after one step. - name: A restored exemption uses CBO's 2032 head-of-household threshold period: 2032 absolute_error_margin: 0.001 input: gov.irs.income.exemption.suspended: false gov.irs.income.exemption.amount: 1_000 - exemptions_count: [1, 1, 1] - adjusted_gross_income: [421_199, 421_200, 423_700] - filing_status: [HEAD_OF_HOUSEHOLD, HEAD_OF_HOUSEHOLD, HEAD_OF_HOUSEHOLD] + exemptions_count: [1, 1, 1, 1] + adjusted_gross_income: [421_199, 421_200, 421_201, 423_700] + filing_status: [HEAD_OF_HOUSEHOLD, HEAD_OF_HOUSEHOLD, HEAD_OF_HOUSEHOLD, HEAD_OF_HOUSEHOLD] output: - exemptions: [1_000, 1_000, 980] + exemptions: [1_000, 1_000, 980, 980] # 243,700 * 217.05 / 212.85 = 248,508.73855 -> 248,500 (down to $25). -# One full $1,250 step above the threshold phases out 2% * $1,000 = $20. +# Separate filers lose 2% for each $1,250, or fraction of $1,250, above the +# threshold: $1 and $1,250 above it each phase out 2% * $1,000 = $20. - name: A restored exemption uses half the joint threshold for separate filers period: 2036 absolute_error_margin: 0.001 input: gov.irs.income.exemption.suspended: false gov.irs.income.exemption.amount: 1_000 - exemptions_count: [1, 1, 1] - adjusted_gross_income: [248_499, 248_500, 249_750] - filing_status: [SEPARATE, SEPARATE, SEPARATE] + exemptions_count: [1, 1, 1, 1] + adjusted_gross_income: [248_499, 248_500, 248_501, 249_750] + filing_status: [SEPARATE, SEPARATE, SEPARATE, SEPARATE] output: - exemptions: [1_000, 1_000, 980] + exemptions: [1_000, 1_000, 980, 980] # 487,400 * (217.05 / 212.85)^3 = 516,825.49806 in 2038. # Round down to $50 = $516,800; rounding to nearest would give $516,850. -# At $519,300, ($519,300 - $516,800) / $2,500 = 1 full step. -# $1,000 * (1 - 1 * 0.02) = $980. +# At $516,801, ($516,801 - $516,800) / $2,500 rounds up to 1 step, so the +# exemption falls to $1,000 * (1 - 1 * 0.02) = $980. A $516,850 threshold +# would leave $1,000. +# At $519,300, ($519,300 - $516,800) / $2,500 = 1 step: $980. - name: A restored exemption rounds the projected joint threshold down period: 2038 absolute_error_margin: 0.001 input: gov.irs.income.exemption.suspended: false gov.irs.income.exemption.amount: 1_000 - exemptions_count: [1, 1, 1] - adjusted_gross_income: [516_799, 516_800, 519_300] - filing_status: [JOINT, JOINT, JOINT] + exemptions_count: [1, 1, 1, 1] + adjusted_gross_income: [516_799, 516_800, 516_801, 519_300] + filing_status: [JOINT, JOINT, JOINT, JOINT] output: - exemptions: [1_000, 1_000, 980] + exemptions: [1_000, 1_000, 980, 980]