Skip to content

Fix WI CDCC to use state expense limits ($10k/individual) for 2024+#7688

Open
MaxGhenis wants to merge 1 commit intomainfrom
cdcc-fix-wi
Open

Fix WI CDCC to use state expense limits ($10k/individual) for 2024+#7688
MaxGhenis wants to merge 1 commit intomainfrom
cdcc-fix-wi

Conversation

@MaxGhenis
Copy link
Contributor

Summary

Fixes Wisconsin's child and dependent care credit (wi_childcare_expense_credit) to use the state-specific expense limit enacted by 2023 Wisconsin Act 101.

The bug: For 2024+, the WI formula used cdcc_potential * 1.0, which inherits the federal expense limits ($3,000 for one qualifying individual, $6,000 for two or more). Wisconsin Statute §71.07(9g)(c)5 sets a $10,000 per qualifying individual limit for tax years beginning after December 31, 2023.

Impact: A Wisconsin family with one child and $7,000 in childcare expenses would receive a $400 credit under the old code (federal $3,000 cap × 20% rate) vs. the correct $1,400 (WI $7,000 cap × 20% rate).

Closes #7684

Changes

  • New parameter: gov.states.wi.tax.income.credits.childcare_expense.max_expense0 for pre-2024 years (meaning use federal approach), $10,000 for 2024+
  • Updated formula: wi_childcare_expense_credit — for 2024+, recomputes relevant expenses using the WI per-individual limit, then applies the federal CDCC rate and the WI fraction (1.0 for 2024+)
  • Updated tests: Expands from 2 tests to 6, covering pre-2024 behavior and 2024+ scenarios (expenses under federal limit, between federal and WI limit, above WI limit, single and two-child cases)

Test plan

  • All 6 YAML tests pass: uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/states/wi/tax/income/wi_childcare_expense_credit.yaml -c policyengine_us
  • Pre-2024 behavior unchanged (formula falls through to cdcc_potential * fraction)
  • 2024+ with expenses > federal limit but < WI limit correctly produces higher credit
  • 2024+ with expenses > WI limit correctly caps at $10,000 * count_eligible

Legislative reference

Wisconsin Statute § 71.07(9g)(c)5 (2023 Wisconsin Act 101):

"For taxable years beginning after December 31, 2023, the amount under par. (b) is the applicable percentage under section 21 (a) (2) of the Internal Revenue Code of the employment-related expenses, as defined in section 21 (b) (2) of the Internal Revenue Code, except that the dollar limit on employment-related expenses per qualifying individual is $10,000 instead of the dollar limit under section 21 (c) of the Internal Revenue Code."

Source: https://docs.legis.wisconsin.gov/statutes/statutes/71/i/07/9g

🤖 Generated with Claude Code

Wisconsin Act 101 of 2023 (§71.07(9g)(c)5) sets a $10,000/individual
expense limit for tax years beginning after December 31, 2023, replacing
the federal IRC §21(c) limit of $3,000/$6,000. The prior formula used
cdcc_potential directly (which inherits federal limits) for all years.

Adds max_expense parameter (0 pre-2024, $10,000 for 2024+) and updates
the formula to recompute relevant expenses with the WI limit when
applicable, then apply the federal CDCC percentage rate.

Closes #7684

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (55a0045) to head (1b3dd39).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #7688      +/-   ##
===========================================
+ Coverage   97.82%   100.00%   +2.17%     
===========================================
  Files           3         1       -2     
  Lines          92        23      -69     
  Branches        2         1       -1     
===========================================
- Hits           90        23      -67     
+ Misses          1         0       -1     
+ Partials        1         0       -1     
Flag Coverage Δ
unittests 100.00% <100.00%> (+2.17%) ⬆️

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.

@MaxGhenis MaxGhenis requested a review from DTrim99 March 3, 2026 13:25
@DTrim99
Copy link
Collaborator

DTrim99 commented Mar 3, 2026

PR Review

🔴 Critical (Must Fix)

  1. Reference format error in wi_childcare_expense_credit.py:10-14 - The reference tuple is missing commas between strings, causing Python to silently concatenate all URLs into one invalid string:
    # Current (broken):
    reference = (
        "https://..."
        "https://..."  # No comma - strings concatenate!
    )
    
    # Should be:
    reference = (
        "https://...",
        "https://...",  # Comma makes it a tuple
    )

🟡 Should Address

  1. Typo in existing parameter - fraction.yaml:1 has "faction" instead of "fraction" in description
  2. PDF reference missing page number - max_expense.yaml reference to WI-2441 Instructions should include #page=X to point to specific page with the $10,000 value
  3. Parameter description format - max_expense.yaml description contains multiple sentences and embeds the specific value ($10,000); consider simplifying to one sentence

🟢 Suggestions

  1. Consider adding deeper anchor to statute URL if available (currently links to section 9g, could potentially link directly to subsection (c)5)
  2. Consider adding test for earned income limitation scenario (where min_head_spouse_earned < expenses)
  3. Consider adding boundary test for exactly $10,000 limit

Validation Summary

Check Result
Regulatory Accuracy ✅ Correct - $10,000/individual matches WI Statute §71.07(9g)(c)5
Effective Date ✅ Correct - 2024-01-01 matches "tax years beginning after Dec 31, 2023"
Reference Quality ⚠️ 1 critical issue (tuple format), 1 warning (missing page #)
Code Patterns ✅ No hard-coded values, proper vectorization
Test Coverage ✅ Good - 6 tests covering pre-2024, 2024+ scenarios
CI Status ✅ All checks passing

Regulatory Verification

The implementation correctly reflects Wisconsin Statute §71.07(9g)(c)5 as enacted by 2023 Wisconsin Act 101:

  • ✅ $10,000 per qualifying individual limit (replacing federal $3,000/$6,000)
  • ✅ Effective for tax years beginning after December 31, 2023
  • ✅ Uses federal CDCC rate per IRC §21(a)(2)
  • ✅ Applies earned income limitation per IRC §21(d)(1)
  • ✅ Correctly uses capped_count_cdcc_eligible (max 2 individuals = $20,000 cap)

Next Steps

To auto-fix issues: /fix-pr 7688

Or address manually:

  1. Add commas to the reference tuple in wi_childcare_expense_credit.py
  2. Fix "faction" → "fraction" typo in fraction.yaml (pre-existing issue)

🤖 Review generated by Claude Code

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.

WI CDCC should use $10,000/individual expense limit for 2024+ (Act 101 of 2023)

2 participants