Skip to content

Route IA CDCC fraction lookup through consolidated taxable income#8566

Merged
hua7450 merged 3 commits into
mainfrom
add-obbba-schedule-1a-deductions-to-ia-taxable-income
Jun 2, 2026
Merged

Route IA CDCC fraction lookup through consolidated taxable income#8566
hua7450 merged 3 commits into
mainfrom
add-obbba-schedule-1a-deductions-to-ia-taxable-income

Conversation

@PavelMakarchuk
Copy link
Copy Markdown
Collaborator

Summary

Closes #8563.

The Iowa child/dependent care credit fraction lookup compares "taxable income" against bracket thresholds (75 % below $10K, 65 % to $20K, etc.). PE-US's ia_cdcc was reading the dynamically generated ia_taxable_income, which resolves to the legacy ia_taxable_income_joint / _indiv path that starts from ia_net_income (Iowa AGI minus IA deductions). The 2022 IA tax reform (HF 2317) shifted Iowa's tax base to federal taxable income for 2023+, so the credit should compare against ia_taxable_income_consolidated instead.

This also fixes the failure surfaced in PolicyEngine/policyengine-taxsim#953. Federal taxable income for the sample HoH-age-75 household is $7,166 (correctly netting the OBBBA $6K enhanced senior deduction), which lands in the < $10K 75 % bracket. The legacy path was returning $13,166 (missing the senior deduction), landing in the $10K–$20K 65 % bracket, so ia_cdcc was $448.50 instead of TaxAct's $517.50.

Add a formula_2023 branch that switches the comparand for 2023+. Pre-2023 behavior is preserved by leaving the original formula intact (it continues to read the legacy ia_taxable_income).

Test plan

  • New integration test from the issue (HoH age 75, $25K wages, $13.8K interest, 1 dep, $3.5K childcare, 2025, IA): ia_taxable_income_consolidated: 7_166, ia_cdcc: 517.5. Numerically matches TaxAct within $1.
  • New 2023 paired test: $1K cdcc_potential + $9,999.99 consolidated taxable income → $750 (75 % bracket).
  • Existing 2021/2022 unit tests unchanged.
  • Full IA suite (241 tests) passes.
  • `make format` clean.
  • CI green.

🤖 Generated with Claude Code

The Iowa child/dependent care credit fraction lookup compares
taxable income against bracket thresholds. PE-US's ia_cdcc was
reading the dynamically generated ia_taxable_income, which resolves
to the legacy ia_taxable_income_joint / _indiv path that starts
from ia_net_income (Iowa AGI minus IA deductions). For post-2023
years the 2022 IA tax reform (HF 2317) shifted Iowa's base to
federal taxable income, so the credit should compare against
ia_taxable_income_consolidated instead.

This also fixes the issue's failure: federal taxable income for the
sample HoH-age-75 household is $7,166 (correctly netting the OBBBA
$6K enhanced senior deduction), which lands in the < $10K 75%
bracket. The legacy path was returning $13,166 (missing the senior
deduction), landing in the 65% bracket, so ia_cdcc was $448.50
instead of $517.50.

Add a formula_2023 branch that switches the comparand for 2023+.
Pre-2023 behavior is preserved.

Closes #8563.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6564ef9) to head (17cda0d).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8566   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         1    -1     
  Lines           46        19   -27     
=========================================
- Hits            46        19   -27     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PavelMakarchuk PavelMakarchuk marked this pull request as ready for review June 2, 2026 14:35
@PavelMakarchuk PavelMakarchuk requested a review from hua7450 June 2, 2026 14:35
hua7450 and others added 2 commits June 2, 2026 15:27
Reduce the absolute_error_margin on the 2025 issue #8563 case from 1 to 0.4
so a wrong fraction-bracket result can no longer pass silently, and add an
explicit ia_taxable_income: 13_166 assertion so the case enforces (rather
than only comments) that the consolidated income (75% bracket) and the
legacy income (65% bracket) land in different brackets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…into add-obbba-schedule-1a-deductions-to-ia-taxable-income
Copy link
Copy Markdown
Collaborator

@hua7450 hua7450 left a comment

Choose a reason for hiding this comment

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

✅ Approving — verified correct against statute and forms

Reviewed the IA CDCC routing change against the Iowa Code and the official IA 1040 forms (multi-agent review + PDF audit). The fix is correct.

Why the change is right

  • Iowa Code §422.12C ties the CDCC percentage to "net income"; §422.7 defines 2023+ "net income" as federal taxable income under IRC §63 ± Iowa modifications — i.e. exactly IA 1040 line 4.
  • The 2023 IA 1040 (Step 4) confirms line 4 = line 2 (federal taxable income) + line 3 (net Iowa modifications), which is precisely what ia_taxable_income_consolidated computes. So routing the 2023+ fraction lookup through it is the correct comparand, and the federal Schedule 1-A / OBBBA senior deduction correctly flows into the credit base.
  • The 2023 effective boundary aligns with the broader Iowa tax-base switch (the legacy MFS path is already disabled for 2023+). Keeping the legacy ia_taxable_income for pre-2023 preserves prior behavior.
  • All 7 fraction brackets (75/65/55/50/40/30/0%) match the 2024 IA 1040 Expanded Instructions p.43 — no parameter change needed.

Test follow-ups pushed (024f9cfe45)

  • Tightened the 2025 senior-deduction case's absolute_error_margin from 10.4 so a wrong fraction bracket can no longer pass silently.
  • Added ia_taxable_income: 13_166 so the case now enforces (rather than just comments) that the consolidated income ($7,166 → 75% bracket) and the legacy income ($13,166 → 65% bracket) land in different brackets.
  • Merged current main into the branch (was 4 behind).

One thing to watch: the Full Suite - Contrib (other-shard-1) job was failing on the prior head, in a shard this PR doesn't touch — it's now re-running against current main; worth confirming it goes green before merge.

@hua7450 hua7450 merged commit 82212c6 into main Jun 2, 2026
26 checks passed
@hua7450 hua7450 deleted the add-obbba-schedule-1a-deductions-to-ia-taxable-income branch June 2, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IA taxable income missing federal Schedule 1-A senior deduction ($6,000 OBBBA) — Iowa Code § 422.7 conforms to federal taxable income

2 participants