Repository navigation
Count only taxable wages in the child and dependent care credit's earned income limit - #10520
Conversation
adjusted_earnings, which feeds head_earned, spouse_earned and min_head_spouse_earned, started from gross employment_income, so a spouse's traditional 401(k)/403(b) deferrals, pre-tax health premiums and payroll HSA contributions raised the IRC 21(d)(1) expense limit and the IRC 129(b) exclusion limit. Treas. Reg. 1.21-2(b)(3) and IRC 129(e)(2) use the IRC 32(c)(2) definition, which counts employee pay only if includible in gross income, and Form 2441 starts from Form 1040 line 1z. - adjusted_earnings subtracts employment_income - irs_employment_income, as filer_adjusted_earnings did since #10030; earned_income stays gross. - filer_adjusted_earnings sums adjusted_earnings over non-dependents again (same values). - The pre-2018 AMT child cap (IRC 59(j), 911(d)(2)) follows: the 2017 Form 8615 instructions read the same definition as Form 1040 line 7 wages. The #10030 test that pinned the gross cap now expects 15,500. - New York's 2026 credit adds the excluded wages back, because Tax Law 606(c-2)(2)(C) has no gross-income inclusion test. Fixes #4007 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
California taxes payroll HSA contributions (Schedule CA (540) line 1h, column C), so with taxable federal adjusted_earnings the California CDCC limit under R&TC 17052.6(d)(2) dropped them. - ca_head_earned / ca_spouse_earned add ca_taxable_wages minus irs_employment_income (the payroll HSA amount) to head_earned / spouse_earned. - ca_cdcc_min_head_spouse_earned applies the IRC 21(d)(2) deeming (FTB 3506 line 5) to them through lesser_head_spouse_earned, a helper split out of min_head_spouse_earned with no change to federal results. - ca_cdcc_relevant_expenses, ca_dependent_care_assistance_exclusion and the ca_amt_exemption child worksheet (Schedule P line 8) use the California amounts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@hua7450 — could you review this one when you have a moment? CI is green. It fixes #4007 for the child and dependent care credit chain only (Treas. Reg. 1.21-2(b)(3) and IRC 32(c)(2): earned income is pay "includible in gross income"), and leaves 🤖 Posted by Claude Code |
hua7450
left a comment
There was a problem hiding this comment.
Requesting changes for two confirmed California calculation defects. The main federal taxable-wage correction and pre-2018 AMT wage treatment are supported by the reviewed regulation and IRS instructions.
Reviewed commit: 0623f5606f61ffcce2b38cc8c393e99a0ce8a4cc.
Review status: PARTIAL because the New York 2026 interpretation remains unresolved. The two California findings below are confirmed.
Must fix
C1 — Route the final California CDCC through the California earnings calculation (OPEN)
CRITICAL (Must Fix), confirmed. Location: policyengine_us/variables/gov/states/ca/tax/income/credits/ca_cdcc_relevant_expenses.py:54-56 and its final consumer, ca_cdcc.py:18-21; the unchanged parameters/gov/states/ca/tax/income/credits/child_dependent_care/input.yaml selects federal cdcc again from 2022. Consequently the newly corrected California expense calculation never reaches the final credit in TY2025. A joint California household with head wages $90,000, spouse wages $4,000 including a $1,000 payroll HSA contribution, two qualifying children aged 5 and 3, and $9,000 of qualifying care has $4,000 of California spouse earnings. The PR calculates that correctly, and ca_federal_capped_cdcc is $800, but final ca_cdcc uses the federal $3,000 earnings cap and returns $204 rather than $272. California income tax is $571.38 rather than $503.38, a $68 overcharge; captured merge-base formulas return $272 and $503.38. The legal calculation is min($9,000, $6,000, $90,000, $4,000) × 20% × 34% = $272 under FTB Form 3506, 2025, Side 1, with California taxable compensation under its line 4 instructions and the HSA addition under Schedule CA line 1h. This diff introduces the lower federal cap, so the existing final-consumer routing now defeats the intended California protection. Wire the California computation into the final state credit for the affected years, with a final ca_cdcc/tax assertion.
C2 — Add California HSA wages before flooring the person's net earnings (OPEN)
CRITICAL (Must Fix), confirmed. Location: policyengine_us/variables/gov/states/ca/tax/income/ca_spouse_earned.py:35-36, mirrored in ca_head_earned.py:35-36. spouse_earned has already floored federal earnings at zero; adding California HSA wages afterward revives earnings that a business loss should offset. For TY2021, take the same joint household and qualifying care as C1, but give the spouse a $4,000 self-employment loss. California wages are $4,000 and net California earned income is $0 = max($4,000 − $4,000, 0). The new formula instead calculates max($3,000 − $4,000, 0) + $1,000 = $1,000. In 2021 the final state credit does consume this state computation: the PR awards ca_cdcc = $68 rather than $0 and reduces California income tax to $1,231.18 rather than $1,299.18. Captured merge-base formulas return the correct zero credit. IRC 21(d)'s earned-income limit, incorporated by California R&TC 17052.6(d)(2), requires net earned income; the Treasury definition and the FTB line 4 computation count wages together with net self-employment earnings. Restore the person's California wages before applying the zero floor, then aggregate the appropriate head or spouse; test a loss that offsets all California wages. The new addition can also incorrectly raise the reported state dependent-care exclusion. The 2021 example uses the existing 2021 state-credit path and the unchanged earned-income condition: the cached regulation dates from 2007 and the 2021 credit amendments did not replace section 21(d). The cached FTB Pub. 1005 HSA discussion identifies California's nonconformity with federal HSA legislation effective in 2004. No claim is made that a separate 2021 manual was downloaded or inspected.
Should address
A1 — New California AMT test codifies a federal amount instead of the published state amount (OPEN)
SHOULD ADDRESS; OPEN. At policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/alternative_minimum_tax/ca_amt_exemption.yaml:100-102, the new TY2025 case states that California's child minimum is $9,550 and expects $18,550 after stipulated California earnings of $9,000. The official 2025 Schedule P (540) instructions, Part II line22, Exemption Worksheet lines7–10 specify a $9,750 child minimum, so conditional on those stipulated earnings, the worksheet gives min(92,749, 9,750 + 9,000) = 18,750. The formula's use of the federal child parameter already existed; this PR adds an incorrect policy oracle that locks it in. Correct the expected amount/source treatment rather than describing this as an introduced $200 tax error. The new test also stipulates dependent-child and payroll-HSA inputs; lawful HSA eligibility for that combination was not established in this review, so the example is not offered as a demonstrated lawful household's tax liability.
New York 2026 evidence gap
Tax Law 606(c-2)(2)(C)-(D) omits the federal taxable-inclusion clause, while section 607(a) supplies comparable federal meanings. The available official evidence did not resolve how the new definition treats payroll deferrals and business losses. A final-output change was reproduced, but it is not counted as a confirmed legal defect. This interpretation needs resolution before claiming complete legal alignment.
Validation
380 targeted tests passed, covering the changed YAML cases and relevant federal, California, Virginia and New York calculations plus two Python invariant files. Ten diagnostic calculations (five current/control pairs) completed with zero setup/calculation errors. Controls used captured merge-base formulas in memory; no source files or partner tests were edited. Source review covered 24 sources, including 7 PDFs and 2 form pages visually inspected at 300 DPI.
Please address C1 and C2 and add final ca_cdcc/California income-tax regression assertions for both demonstrated cases.
- From 2021, ca_cdcc reads ca_federal_capped_cdcc (FTB 3506 lines 3-10) in every year, so California earned income reaches the final credit; ca_cdcc_rate is the federal rate outside 2021. - ca_adjusted_earnings nets a business loss against California wages before the zero floor; ca_head_earned and ca_spouse_earned sum it. - The California AMT child exemption uses California's own minimum (Schedule P (540) worksheet line 7; $9,750 for 2025). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@hua7450, thank you for the review of C1: the final California credit now uses the California computation
C2: California wages are restored before the zero floor
A1: California's own child minimum
New York 2026Agreed: this is an open interpretation, not a confirmed defect, and I made no change. Tax Law 606(c-2)(2)(C) omits IRC 32(c)(2)(A)(i)'s gross-income clause, and section 607(a) can be read to import the federal meaning. Checks
Not changed here (pre-existing, for follow-up)
I re-requested your review. |
Resolve ca_amt_exemption with #10501: keep California's phase-out rate (line 5) from main and this branch's California child minimum and California wages (lines 7-8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hua7450
left a comment
There was a problem hiding this comment.
Thanks, Pavel. I re-reviewed at e3bb2ad. C1, C2 and A1 are fixed:
- C1.
ca_cdccreadsca_federal_capped_cdccfrom 2021. The TY2025 household now givesca_cdcc272 andca_income_tax503.38. - C2.
ca_adjusted_earningsnets a loss against California wages before the floor. The TY2021 household givesca_cdcc0 andca_income_tax1,299.18. - A1. The new California child amounts match the 2021 to 2025 Schedule P (540) instructions, line 7.
The rest of your reply checks out:
- The California credit cap equals
cdcc_credit_limit. ca_cdcc_rategives the same values as before for 2022 to 2025.- Ordinary California households (no deferrals, HSA, losses or employer benefits) get the same 2022+ result as main's federal
cdccpath. - Main's five newer commits touch nothing this PR reads.
I recomputed every new and changed case in the full diff, and they match.
One thing is left before I can approve.
New York 2026: the add-back goes on after the zero floor
ny_cdcc_qualifying_expenses.py:34-42 adds employment_income - irs_employment_income back onto head_earned and spouse_earned, which are already floored at zero. When a self-employment loss wipes out a person's taxable wages, the deferred wages come back on top of the zero. This is the C2 pattern, still in place for New York.
TY2026, NY, joint return. The head has $90,000 of wages. The spouse has $4,000 of wages with a $1,000 traditional 401(k) deferral and a $4,000 Schedule C loss. Two children aged 5 and 3, and $9,000 of care:
- At head: spouse earned = max(3,000 − 4,000, 0) + 1,000 = 1,000, so qualifying expenses are 1,000 and the refundable
ny_cdccis about $365. - On main: max(4,000 − 4,000, 0) = 0, so the credit is 0.
This doesn't depend on how the open 606(c-2)(2)(C) question is settled. Netting the loss against gross wages, the reading the PR adopts to keep main's results, gives 0. The federal 32(c)(2) measure also gives 0. A literal "items of gross income" reading gives at least 4,000. No reading gives 1,000. The PR body lists this under known gaps, but the inputs exist and main handled this household.
The helper you added for C2 fixes it directly. Per person, use max_(0, earnings_before_zero_floor(person, period, parameters, person("employment_income", period))). With gross wages as the wage base, excluded_wages is 0 and the loss offsets the wages before the floor. Then sum by head and spouse, as ca_head_earned and ca_spouse_earned do. Please add a 2026 case to ny_cdcc_qualifying_expenses.yaml with a spouse whose loss offsets all taxable wages (expected 0, margin 0.01), and drop the add-back bullet from the known gaps.
Nits, none blocking
- 2026 California rate. This isn't a gap. R&TC 17052.6(a)(1) ties the credit to section 21 "as applicable for federal income tax purposes for the taxable year". That specific provision overrides 17024.5's January 1, 2025 specified date, so the federal 2026
cdcc_rateis right. Please drop it from the known gaps, and cite 17052.6(a)(1) in theca_cdcc_ratecomment, which now says only that the FTB has not published a 2026 table. A 2026ca_cdcc_ratecase would also pin the second phase-out you added. For example, head of household, AGI $80,000: max(.50 − .33, .35) − .03 = 0.32. - Employer benefits from 2022. From 2022 the California credit reaches FTB 3506 Part IV. For a household with employer dependent care benefits and expenses below the dollar limit, it now nets the benefits through federal Form 2441 line 31, so the result moves off main. That matches the form, but no case pins it, and the body says results change only for payroll-deduction filers.
- PR body.
- Line 27 should also mention California child-AMT filers (A1, every year) and the employer-benefit change above.
- The 10501 rebase note and the new-case count are out of date.
- The state table leaves out AZ (2026+), MD and SC, which read
cdcc_relevant_expensesand also change. - The Minnesota row quotes the pre-2023 text of 290.067 subd. 1. Subd. 1a(d) now imports 21(d).
- The 2017 Form 6251 instructions share Form 8615's "personal services" sentence, but only Form 8615 points to Form 1040 line 7.
- The
cdcc_single_parent_work_requirementreform no longer flows into the California credit from 2022, because California now usesca_cdcc_relevant_expenses. A sentence would record that.
- Tests.
ca_cdcc.yaml: the 2021 and 2022 blocks are now one class, and theircdcc: 0input feeds nothing.ca_amt_exemption.yaml: seven existing cases (lines 11, 30, 48, 66, 90, 113, 134) still inputhead_earned, which the formula no longer reads.ca_cdcc_relevant_expenses.yamlrenamed the same kind of input toca_cdcc_min_head_spouse_earned.- The new CA AMT case gives a dependent 17-year-old payroll HSA contributions and asserts federal
head_earned8,000. Under Pub. 969 a dependent can't receive tax-free HSA contributions. A 401(k)-only child would test the line 8 arithmetic without that question.ca_adjusted_earnings.yamlalready covers HSA with an adult. - The edited section 129 case in
ca_cdcc_relevant_expenses.yamlinputs onlyca_cdcc_min_head_spouse_earned. The California exclusion it describes is therefore 0, not 5,000; 1,000 still passes for another reason. Addingmin_head_spouse_earned: 50_000, or realdependent_care_employer_benefits, plus an exclusion assertion, would test it. - One new comment still describes the round-1 post-floor HSA addition.
test_eitc_elective_deferral_invariants.pynow checksamt_exemption, but at YEAR 2026 the child cap is off, so that assertion can't fail.
- Code.
max_(ca_taxable_wages, irs_employment_income)never binds, sinceca_taxable_wagessubtracts a subset of the federal pre-tax list. Useca_taxable_wagesdirectly, or keep it with a NOTE.ca_dependent_care_assistance_exclusionworks out to min(benefits, dollar cap,ca_cdcc_min_head_spouse_earned), so it could say that directly, as FTB 3506 lines 21 to 26 do.- The federal
amt/exemption/child/in_effect.yamlcomment still says California reads the federal child amount. - The new parameter's label could follow the source: "minimum exemption amount for certain children".
- Uprating it after 2025 gives unrounded amounts, while the published ones are multiples of $50 (59(j)(2)).
child_dependent_care/input.yamlstill selects federalcdccbefore 2021. California tax runs for backfilled years, so those keep the C1 behavior. Either start the California entry earlier, or say the routing covers 2021 on.
Follow-ups for separate PRs (all the same on main)
ca_federal_capped_cdccstill caps the base at federal tax. R&TC 17052.6(a)(2) applies California's percentage "without taking into account whether there is a federal tax liability".ca_cdcccallsp.rate.calc(agi)on band-top thresholds withoutright=True. AGI of exactly $40,000, $70,000 or $100,000 drops a band (for example, $100,000 gets 0 instead of .34).- Federal
cdcc_relevant_expensesskips Form 2441 line 30, which subtracts excluded benefits. The federal exclusion is also not limited to qualified expenses (lines 16 and 17). mn_cdccdoes not reduce its dollar limit by the section 129 exclusion.
New York 2026: measure each person's earned income on gross wages with earnings_before_zero_floor, so a business loss offsets the wages before the zero floor instead of the deferrals being added back after it. Add full and partial loss cases. California: route ca_cdcc through ca_federal_capped_cdcc in every year (R&TC 17052.6(a)(1)), cite (a)(1) for the 2026 rate and pin it, pin the FTB 3506 Part IV employer benefit path, and use ca_taxable_wages directly. Clean up test inputs, the CA AMT child case, the section 129 case, stale comments, the AMT parameter label and the vacuous AMT check in the invariant test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@hua7450, thank you for the re-review of New York 2026: the loss now offsets the wages before the floor
Nits1. 2026 California rate. Done.
2. Employer benefits. Done. 3. PR body. All six points are done:
4. Tests. Done:
5. Code.
Follow-ups for separate PRs (the same on main)These four items are now in the known gaps of the PR body:
Checks on
|
hua7450
left a comment
There was a problem hiding this comment.
Approving at 9959a00. Thanks, Pavel.
The round-2 blocker is fixed. ny_cdcc_qualifying_expenses now nets the loss against gross wages before the floor, so the example household gives 0 and the $3,500 loss case gives 500, the same as main. I recomputed every new and changed case in this round, and they match, including the 2026 ca_cdcc_rate of 0.32 and the employer-benefit ca_cdcc of 43 (500 × .20 × .43). The move of the California entry to 2012 is right: your 2020 example gives 272 by hand.
Before merging: please merge main. The branch is 103 commits behind. I compared the trees and found no textual conflict, and no test on main that this should break, but that was by reading, not running. The one failed check, Contrib tests (other-shard-1), was cancelled at the 60-minute limit, and PR 10556 on main addresses that timeout.
Of your two declined items, leaving ca_dependent_care_assistance_exclusion as it is holds: the values are equal, and your reason about the federal lines 16 and 17 follow-up is sound. The rounding reason doesn't hold; see nit 2.
Nits, none blocking:
- Child AMT amount before 2021.
amt/exemption/child/amount.yamlstarts in 2021, so 7,850 backfills to 2015-2020. FTB's Schedule P worksheet line 7 prints 7,400, 7,400, 7,500, 7,600, 7,750 and 7,950 for those years. Main's federal amount matched 2015-2019 and was $50 low for 2020, so this PR moves those years off the published amounts. I'm not treating it as a gap because the child branch needsis_qualifying_child_dependentset on a head by hand, and the other California AMT parameters also backfill flat from 2021. Adding the six dated values would fix it, and would make the body's "in every year" true for line 7. The effect is at most $31.50 of AMT (2015 and 2016). - Child AMT amount from 2026. You're right that California CPI doesn't produce the series, but there's no California CPI step to find: R&TC 17062(b)(7) reaches the paragraph (5) and (6) amounts, and the child limit comes through 17062(b)(1) from IRC 59(j). The 2022-2025 amounts match 59(j)(2) on unchained CPI-U, rounded to the nearest $50, which would give 10,000 for 2026.
uprating: gov.states.ca.cpiis therefore the wrong index, though the effect is only about $2 of tax. Either use CPI-U with $50 rounding, or wait for FTB's figure and correct the reason. ca_cdcc.yaml, 2021 and 2022 blocks. The 2021 rate branch you kept them for is inca_cdcc_rate, and these eight cases inputca_federal_capped_cdcc, so they never reach it.ca_cdcchas no year branch, so lines 37-72 repeat lines 1-36.- Employer-benefit comment,
ca_cdcc.yaml:192-195and:218. Lines 29, 30 and 31 at 1,000, 500 and 500 are Form 2441 lines. On FTB 3506 they are 2,000, 1,000 and 2,500, then line 32 is 500 and line 33 is 500. The expected value is right. - Untested paths. No
ca_cdcccase runs before 2021, so nothing pins the new 2012 route; the 2020 household at 272 would. Nothing reaches the deemed-income branch ofca_cdcc_min_head_spouse_earnedeither. For example, TY2025, head wages $60,000, full-time student spouse with no wages, one child, $4,000 of care: deemed 3,000,ca_cdcc258. - Comments and descriptions.
input.yamlstill ends "based on year", though it now has one value.ny_cdcc_qualifying_expenses.py:37bindsearnedto a person array, and line 45 rebinds it to a tax-unit array.person_earnedwould be clearer (rename the reads on lines 43 and 44 too).- The
ca_cdcc_ratecomment explains 2026 but not why 2021 differs. R&TC 17052.6(f), and FTB's section 70405 entry for 2026, would cover both. test_eitc_elective_deferral_invariants.py:218loops over a one-item tuple.
- PR body.
- The AMT paragraph still says the AMT variables can "add back the excluded wages the way New York does below". New York no longer adds back;
earnings_before_zero_flooron gross wages is the pattern now. - The Minnesota row cites subd. 1a, which applies only from TY2026. Earlier years rest on subd. 1 ("pursuant to the provisions of section 21"). My round-2 "pre-2023" was wrong on that.
- The Arizona row says "Correct", but A.R.S. 43-1022(34) doesn't state the 21(c) and (d) limits. The Maryland row's wording fits better: it reads
cdcc_relevant_expensesand keeps those limits, as on main. - The Form 8615 sentence you quote follows "In that case", for business income from personal services. 2017 Pub. 929 states the same rule without that qualifier.
- California's "care provided in this state" limit (R&TC 17052.6(d)(1); FTB 3506 line 2(e)) isn't modeled, and there's no input for it. It belongs in the known gaps now that the body describes this path as California's own limits.
- The AMT paragraph still says the AMT variables can "add back the excluded wages the way New York does below". New York no longer adds back;
Follow-up, outside this PR: filer_adjusted_earnings has no formula reader left on head or main, and wa_working_families_tax_credit.yaml still inputs it, so WA Case 3 passes through earnings > 0 rather than the ceiling.
Not verified: I didn't read the pre-2025 wording of R&TC 17052.6, and nothing here was run.
The property from main drew employment_income as the earned income limit. With line 12 benefits inside employment_income and #10520's taxable-wage measure, Form 2441 line 18 earned income is employment_income less the benefits, so the fixtures now draw box 1 wages and add the benefits on top. California's FTB 3506 measure still reads ca_taxable_wages, which keeps the benefits; the oracle follows that and California law is unchecked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6Kf74Cjc6K5FnP9RGX
…t care benefits from wages (#10579) * Zero a separate filer's whole standard deduction and exclude DCAP from wages IRC 63(c)(6)(A) makes the standard deduction zero for a married individual filing separately whose spouse itemizes. The model zeroed only the basic amount, so the 63(f) aged and blind amount still applied. Employer dependent care benefits (W-2 box 10) never reduced income tax or payroll wages. IRC 129(a)(1) excludes them from gross income and 3121(a)(18) and 3306(b)(13) from FICA and FUTA wages. They now leave box 1 and FICA wages, and the part above the filer's own exclusion returns as Form 1040 line 1e income. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Count dependent care benefits inside employment_income in older DCAP tests This PR treats dependent_care_employer_benefits as a pre-tax payroll deduction inside employment_income, like pre_tax_health_insurance_premiums. Four tests from #10078 entered box 1 wages as employment_income, so their box 1 wages fell by the benefits. Raise employment_income by the benefits so box 1 wages and every expected value stay as they were, and correct CA and NY comments that still stated AGI before the exclusion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main to pick up the net-of-benefits 129(b) earned income limit (#10520) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Count line 1e as EITC earned income, gate 63(c)(6) on separate status, pin the 129(b) limit - eitc_earned_income adds taxable_dependent_care_benefits: the excess over the IRC 129 exclusion is includible in gross income, so it is earned income under 32(c)(2)(A)(i). No cycle runs through this path. - standard_deduction and basic_standard_deduction zero the deduction only for a SEPARATE unit whose spouse itemizes, as 63(c)(6)(A) says. - The joint YAML case now expects the net-of-benefits 129(b) limit that main uses since #10520; add the part-time regression and EITC cases. - The wage property now asserts exclusion <= wages - benefits, which the wage identity alone cannot detect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Measure the 129(b) limit from box 1 wages in the exclusion property The property from main drew employment_income as the earned income limit. With line 12 benefits inside employment_income and #10520's taxable-wage measure, Form 2441 line 18 earned income is employment_income less the benefits, so the fixtures now draw box 1 wages and add the benefits on top. California's FTB 3506 measure still reads ca_taxable_wages, which keeps the benefits; the oracle follows that and California law is unchecked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge origin/main into fix-separate-filer-standard-deduction-and-dcap-wages Brings in #10587's Alabama cases and later main commits before the round-3 fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Count line 1e as earned income for claimable filers Line 1e is part of Form 1040 line 1z, which the 2025 instructions use as earned income on the dependent standard deduction worksheet. Leaving it off the dependent earned income list made the filing tests treat it as unearned income and cut the 63(c)(5) deduction. The new witness covers all three readers. The existing cases now carry care expenses at least equal to their benefits, so they stay true once the Form 2441 line 16-17 limit lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Count line 1e as IRA compensation Treas. Reg. 1.219-1(c)(1) counts includible pay for services, so the taxable part of dependent care benefits is compensation. A helper keeps the dependent's own IRA limit without line 1e, which would need the filer's filing status and close a cycle through dependent_gross_income. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Bound the exclusion from below and fix stale docs The wage property checked only upper bounds, so a zero exclusion passed it. adjusted_earnings now says it is the 129(b) measure, not 32(c)(2) earned income. Test comments now show the net-of-benefit earned income, and duplicate references share one entry per source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add California's addition for the federal exclusion above its cap California kept its $5,000 cap when the federal cap rose for 2021 and from 2026, so federal AGI left out more than California allows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * List the dependent care addition in ca_additions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge origin/main into fix-separate-filer-standard-deduction-and-dcap-wages Brings in #10590, whose filing-test case pins the unconditional separate_filer_itemizes rule that this PR gates on SEPARATE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep ira_compensation's formula self-contained and honor supplied input The IRA differential test runs the formula body on its own, so the formula repeats the sum with line 1e instead of calling a module helper. The dependent path now uses a supplied ira_compensation as given, as it did before, and otherwise leaves out the dependent's own line 1e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pin the dependent IRA helper's sum and set care expenses in the EITC cases The helper's copy of the IRC 219(f)(1) sum had no test: dropping the SE tax deduction or disability pay from it alone passed every IRA file. A dependent case with disability pay and SE income now pins it. The helper always left line 1e out, so it drops the dead include_line_1e branch and says so in its name. The three EITC cases this PR adds set benefits with no care expenses, so the Form 2441 line 16-17 limit would move them. Each now sets $5,000 of expenses, which moves no expected value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main (0315452) into fix-separate-filer-standard-deduction-and-dcap-wages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Lower the stack-depth floor in test_guard_adds_no_frames_per_dependency to 200 This PR's changes shorten the deepest stack that computing income tax reaches. On CI, merged with main, the test measured an unguarded depth of 282 and failed its floor of 300, while main passes it. The floor checks that the measurement reaches the dependency chain, where each variable costs several frames. On a 200-frame chain, a guard that adds one frame per variable still adds more than the 3 frames the test allows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pin the dependent IRA helper to the formula on every term ira_compensation_without_line_1e repeats the formula's sum without Form 1040 line 1e. Add a test that compiles both from source and compares them on each of the nine terms with line 1e at zero, so dropping alimony or the self-employed pension subtraction from either copy now fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
The child and dependent care credit (CDCC) limits creditable expenses to the taxpayer's earned income, or to the lower earner's on a joint return.
head_earnedandspouse_earnedreadadjusted_earnings, which started fromearned_income. That variable addsemployment_income, the wages before pre-tax payroll deductions. A spouse who defers part of the pay into a traditional 401(k) or 403(b) therefore had a limit that was too high by the deferral.Repro (TY2025, TX, from the issue): married couple, head $56,000 of wages, spouse $4,000 of wages with a $1,000 traditional 401(k) deferral, two children, $9,103 of childcare.
irs_employment_income(spouse)adjusted_earnings(spouse)cdcc_relevant_expensescdcc(20% rate, AGI $59,000)adjusted_earningsnow subtracts the wages that are not includible in gross income (employment_income − irs_employment_income), the same wayfiler_adjusted_earningshas done since #10030.earned_incomedoes not change: about 18 formulas read it directly, and some benefit programs count wages before these deductions (the scope question that closed #4066). #10030 already moved the EITC and ACTC to taxable wages.The law
What changes, and for whom
head_earned,spouse_earned,min_head_spouse_earned→cdcc_relevant_expensesdependent_care_assistance_exclusion(also feedscdcc_limitunder 21(c))amt_exemption, child cap before 2018filer_adjusted_earningsadjusted_earningsover non-dependents. Same values; the formula is no longer duplicated.va_child_dependent_care_expense_deductionma_dependent_care_credit(to 2022)mn_cdccaz_dependent_care_expense_subtraction(from 2026)md_dependent_care_subtractioncdcc_relevant_expenses, so it keeps the federal earned income limit, as on main.sc_cdcc_potentialco_low_income_cdccca_cdcc_relevant_expenses,ca_dependent_care_assistance_exclusionca_amt_exemption, childar_federal_cdccny_cdcc_max(606(c), to 2025)ny_cdcc_qualifying_expenses(606(c-2), from 2026)id_household_and_dependent_care_expense_deductionor_cdcc_relevant_expenseswi_childcare_expense_subtraction,wi_childcare_expense_credit_potentialStates that take a percentage of the federal credit inherit the change through
cdcc. Theindividual_eitc(Winship) reform also readsadjusted_earnings; it now uses the same taxable wages as the baseline EITC.cdcc_single_parent_work_requirementand the Minnesota HF 1938 reform read the CDCC earnings and follow the federal rule. The single-parent reform overrides federalcdcc_relevant_expenses, so it no longer reaches the California credit, which now usesca_cdcc_relevant_expensesin every year (on main it reached California outside 2021).AMT child cap (before 2018). #10030 kept this cap on gross earnings. IRC 59(j)(1)(A) uses earned income "as defined in section 911(d)(2)", which has no gross-income inclusion clause. But 911(d)(2)(A) counts "amounts received as compensation for personal services", and 402(e)(3) says an elective deferral is not made available to the employee. The 2017 Form 8615 instructions apply the same 911(d)(2) definition (through IRC 1(g)(4)) to the same children, and say earned income "is generally the total of the amounts reported on Form 1040, lines 7, 12, and 18". Line 7 is taxable wages. The 2017 Form 6251 instructions (worksheet line 8) use the same "personal services" sentence, but only the Form 8615 instructions point to Form 1040 line 7. So the cap now follows
adjusted_earnings. It applies only before 2018 (IRC 55(d)(4)(A)(iii)), and California's Schedule P uses the same wording. If reviewers prefer to keep #10030's reading,amt_exemptionandca_amt_exemptioncan add back the excluded wages the way New York does below.California. California excludes traditional 401(k)/403(b) deferrals and pre-tax health premiums, but it taxes payroll HSA contributions: the Schedule CA (540) instructions, line 1h, add the W-2 box 12 code W amount in column C (also FTB Pub. 1005;
ca_hsa_addition). #10030 addedca_taxable_wages(W-2 box 16) for this. With the federal change alone, California's CDCC limit would have dropped the HSA amounts. This PR therefore adds:ca_adjusted_earnings(Person):adjusted_earningsmeasured on California wages (ca_taxable_wages), which keep the payroll HSA contribution.ca_taxable_wagessubtracts a subset of the federal pre-tax list, so it is never belowirs_employment_income. A business loss offsets these wages before the zero floor (earnings_before_zero_floor, now shared withadjusted_earnings).ca_head_earnedandca_spouse_earnedsum it for the head or the spouse.ca_cdcc_min_head_spouse_earned: the lesser of the two, with the same deemed income for a student or disabled spouse (FTB 3506 line 5: $250 or $500 a month). The deeming logic ofmin_head_spouse_earnedmoved into a helper,lesser_head_spouse_earned, that both variables call. The federal results do not change.ca_cdcc_relevant_expensescaps expenses atca_cdcc_min_head_spouse_earned.ca_dependent_care_assistance_exclusionraises the federal exclusion by the amount that California earned income exceeds federal earned income, up to the benefits. That equals the lesser of the benefits, the California cap and California earned income, because the federal cap is at least California's.ca_amt_exemption(Schedule P worksheet line 8) usesca_head_earned.child_dependent_care/input.yamlnow selectsca_federal_capped_cdcc(FTB 3506 lines 3-10) in every year from 2012, instead of the federalcdccoutside 2021, so California's own expense, employer benefit and earned income limits reachca_cdcc. R&TC 17052.6(a)(1) has applied this computation since 2000, and the model runs California tax for years before 2021 on backfilled parameters.ca_cdcc_rateis the federalcdcc_rateoutside 2021: 17052.6(a)(1) uses IRC 21 "as applicable for federal income tax purposes for the taxable year", which overrides the R&TC 17024.5 specified date, so 2026 takes the P.L. 119-21 schedule. The cap at federal tax before credits less the foreign tax credit is the same as federalcdcc_credit_limit.ca_amt_exemptionworksheet line 7 reads a new California parameter,amt.exemption.child.amount(Schedule P (540) instructions: 7,850, 8,300, 8,950, 9,450 and 9,750 for 2021-2025), instead of the federal IRC 59(j) amount.No other California formula reads
adjusted_earnings,head_earned,spouse_earnedormin_head_spouse_earned. CalEITC and the YCTC already useca_taxable_wages.New York from 2026. Tax Law 606(c-2)(2)(C) (L. 2026, ch. 59, Part A, § 2) defines earned income as "the wages, salaries, tips and other employee compensation, and those items of gross income which are includible in the computation of net earnings from self-employment". It leaves out IRC 32(c)(2)(A)(i)'s "only if such amounts are includible in gross income".
ny_cdcc_qualifying_expensestherefore measures each person's earned income on gross wages withearnings_before_zero_floor(employment_incomeas the wage base), so a business loss offsets the wages before the zero floor, and sums it for the head and the spouse. This equalsadjusted_earningson main, so the results stay as on main. DTF has not published the 2026 IT-216 instructions. Revisit this if they start the line from federal wages.Known gaps, not changed here (the same on main; follow-ups for separate PRs):
ca_federal_capped_cdccand federalcdcccap the base at federal tax before credits, but R&TC 17052.6(a)(2) applies California's percentage "without taking into account whether there is a federal tax liability".ca_cdcccallsp.rate.calc(agi)withoutright=True, so AGI of exactly $40,000, $70,000 or $100,000 drops a band.cdcc_relevant_expensesskips Form 2441 line 30, and the federal exclusion is not limited to qualified expenses (lines 16 and 17).mn_cdccdoes not reduce its dollar limit by the section 129 exclusion (290.067, subd. 1a(c)).hi_cdcc_min_head_spouse_earnedreads grossearned_incomedirectly and does not use this chain.or_cdcc_relevant_expensesuses the federal deemed income for a student or disabled spouse. ORS 315.264(5)(a) deems $1,000 a month ($2,000 for two or more qualifying individuals) for students only.ar_federal_cdccdoes not leave out active-duty military pay, which Arkansas exempts (AR2441 line 4 starts from AR1000F line 8).Tests
New cases, run against main (
bf2ec882ba) and this branch:adjusted_earningsadjusted_earningsadjusted_earningsadjusted_earningscdccdependent_care_assistance_exclusionva_child_dependent_care_expense_deductionny_cdcc_qualifying_expensesca_cdcc_relevant_expensesca_dependent_care_assistance_exclusionca_amt_exemptionca_amt_exemptionca_cdcc/ca_income_taxca_cdcc/ca_income_taxca_spouse_earned/ca_cdccca_dependent_care_assistance_exclusionca_cdccca_cdcc_rateny_cdcc_qualifying_expensesny_cdcc_qualifying_expensesEach row was run against main (
bf2ec882ba). Bold values differ from main, and each expected value has its arithmetic in a comment. The rows without bold values, including the self-employment loss control, match main because main counted gross wages. For the same reason the California exclusion of 4,000 matches main; that case fails on main at the federal exclusion (4,000, expected 3,000). In hua7450's reviews, the first California revision of this PR (0623f5606f) gave 204 / 571.38, 68 / 1,231.18, 1,000 / 0 and 1,000 for the four California household rows, ande3bb2ad416gave 1,000 for both New York loss rows. The 2026ca_cdcc_rateof 0.35 on main did not reach the credit, because main used the federalcdccfrom 2022.ca_cdcc_relevant_expenses.yamlsetmin_head_spouse_earnedas an input in 7 places; those inputs are nowca_cdcc_min_head_spouse_earned, the variable the formula reads. Its section 129 case now also setsmin_head_spouse_earnedand checks the California exclusion (5,000). For the same reason, the 7head_earnedinputs inca_amt_exemption.yamlare nowca_head_earned, and New York cases 1-6 setemployment_incomeinstead ofhead_earned. The 2021 and 2022ca_cdcccases no longer setcdcc, which feeds nothing.Changed:
eitc_earned_income.yamlcase "AMT kiddie-tax exemption retains its pre-2018 gross earnings cap" (from #10030) is now "... caps at taxable earnings before 2018". It expects 15,500 = (10,000 − 2,000 deferral) + 7,500 instead of 17,500. Its 2018 companion case only loses "gross" from its name.tests/core/test_eitc_elective_deferral_invariants.pyasserted thatadjusted_earningsandamt_exemptiondo not depend on payroll deductions. It now asserts thathead_earned,spouse_earnedandmin_head_spouse_earnedmatch a run with the same W-2 box 1 wages and no deductions, and keeps the check that grossearned_incomedoes not depend on them. It no longer checksamt_exemption: at 2026 the child cap is off, so that assertion could not fail. Theeitc_earned_income.yamlcase above covers the pre-2018 cap.Local results (PolicyEngine-Core test runner and pytest, Python 3.11):
gov/irs/credits/cdcc,gov/irs/income,gov/irs/tax/federal_income/alternative_minimum_tax,gov/irs/credits/earned_income,gov/irs/credits/ctc, the VA, MA, MN, CO, CA, AR, NY, NYC, ID, OR, WI and HI credit folders,ca/tax/income/alternative_minimum_tax,reform/winship.yaml,reform/cdcc_single_parent_work_requirement.yaml,contrib/states/ny/a06774,contrib/states/mn/walzandcontrib/taxsim: 3,176 passed. The one failure was the Exclude pretax payroll deductions from EITC and ACTC earnings #10030 AMT case above; after the update,eitc_earned_income.yamland the AMT folder pass (135).tests/policy/baseline/partners: 623 passed.test_source_conflicts.py::test_unscannable_files_fail_closed, also fails on main in this environment.4a1a3cdeb7: the CDCC, AMT, EITC earned income, NY credit and VA deduction folders (612) and the two invariant files (7) pass.ec4438cb78):gov/states/ca/tax295,gov/irs/credits/cdccwithadjusted_earnings.yamlandeitc_earned_income.yaml155,tests/policy/baseline/partners623, other CA-reading tests and the federal AMT folder 161, and the invariant and code-health files 260, all passed.gov/states/ca/taxandgov/irs/credits/cdcc, 424 passed;tests/policy/baseline/partners, 623 passed; the two invariant files and the reference URL and source-conflict code-health files, 235 passed and the same 1 environment failure.9959a00e7e, Python 3.14):gov/states/ca/tax312,gov/states/ny/tax441,gov/irs/credits732,tests/policy/baseline/partners623 (no partner file changed),adjusted_earnings.yamlwith the federal AMT folder,reform/cdcc_single_parent_work_requirement.yaml,contrib/states/ny/a06774andcontrib/states/ca/prop3168, and the invariant file with seven code-health files 260, all passed.ruff format --checkandruff checkpass on the changed Python files.Note: #10501 merged first;
e3bb2ad416merges main and keeps both changes inca_amt_exemption. #10308 touches the federal AMT child exemption tests, but no file in this PR.Fixes #4007
axiom: n/a:
us/statutes/26/21.yamlin rulespec-us takes the taxpayer's and spouse's earned income as inputs (taxpayer_earned_income_for_cdcc,spouse_earned_income_for_cdcc); this PR changes only how PolicyEngine measures those inputs (Treas. Reg. 1.21-2(b)(3), IRC 32(c)(2)), not the section 21 rule🤖 Generated with Claude Code