Repository navigation
Use W-2 box 1 wages in the dependent standard deduction worksheet and Medicaid filing test - #10272
Conversation
… Medicaid filing test The Form 1040 Standard Deduction Worksheet for Dependents starts earned income from line 1z, and line 1a is W-2 box 1, which leaves out elective deferrals. The model used wages before deferrals, so a claimed dependent with $10,000 of wages, a $6,000 401(k) deferral and $600 of interest got a $10,450 deduction and no filing requirement instead of $4,450 and a required return. Add standard_deduction_worksheet_earned_income, built from the existing gov.irs.income.filing_requirement.dependent.earned_income_sources list (W-2 box 1 wages, Schedule 1 lines 3 and 6) minus Schedule 1 line 15, and use it in the federal, Oregon and Hawaii dependent worksheets. The Medicaid dependent filing test reads the same source list for both its earned income and its unearned income split. Farm income (Schedule 1 line 6), which the worksheet counts, is now earned income in all four. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hypothesis draws single and joint tax units in Oregon, Hawaii and Texas and checks, for 2025 and 2026: deferral invariance (only W-2 box 1 wages matter), the 63(c)(5) bounds, monotonicity in box 1 wages and in the deferral, a hand reference for wage-only units, and Publication 501 Table 2 on box 1 wages for both the federal and Medicaid filing tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #10272: once farm income counted as earned income, the Medicaid test, which never subtracted the deductible part of self-employment tax, told a dependent with $15,000 of farm profit that no return was required. The worksheet's earned income is $13,940.28, so the limit is $14,390.28 and a return is required, as the federal test finds. The same gap applied to Schedule C income on main. Add Person standard_deduction_worksheet_earned_income_person (W-2 box 1 wages plus Schedule C and F, minus self_employment_tax_ald_person, not floored), sum it for the head and spouse in the tax-unit variable, and use it, floored at zero, in the Medicaid test. Add a property that the Medicaid and federal tests agree for every single claimable filer in 2025, and qualify deferral invariance to an unchanged line 15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delta review of #10272 (P3): property 6 caught the previous head's Medicaid regression on only some seeds. A claimed single filer with $901 of farm profit and $450 of interest must file only because of the line 15 subtraction, so adding that unit to every batch makes the property fail on the old code for every seed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the US + core hub at head Reviews
Passed locally (one process each, thread caps 4)
Pending
Dependencies. This conflicts textually with #10185 in Holds and decisions: none. Axiom: TheAxiomFoundation/rulespec-us#1813 queued ( Follow-ups owed: a proposed (not started) audit of the other readers of pre-deferral wages: Virginia's claimable-filer deduction, and the other readers of 🤖 Generated with Claude Code |
PR Review: Use W-2 box 1 wages in the dependent standard deduction worksheet and Medicaid filing testSummaryThis is a correct, well-scoped fix. The Form 1040 Standard Deduction Worksheet for Dependents builds earned income from line 1z, and line 1z starts from W-2 box 1. Box 1 already leaves out elective deferrals, section 125 premiums and HSA contributions made through a cafeteria plan. The model already holds that amount as I checked every legal claim against the source PDFs and hand-checked 16 expectations. I found no wrong result in a claimed year and no double subtraction. The source-conflict ratchet passes statically on the tree merged with current main. rulespec-us#1813 is open, labelled Critical (must fix)None. Should addressNone. Suggestions
Verified correctLaw (each quote checked against the PDF page cited).
Box 1 composition matches in every claimed year.
No double subtraction. The worksheet adds Federal and Medicaid consistency.
Callers.
Code.
Hand-checks (2025 parameters; SE tax = profit × 0.9235 × 15.3%, half deductible).
The Hawaii case (max($500, $1,000) = $1,000) also checks. The disability anchor ($901 Schedule C + $1,000 disability + $450 interest) gives a limit of $2,287.35 against $2,351 of gross income, so a return is required ✓. Tests and cost.
Population effect (reasoned; no microsimulation run).
Source-conflict ratchet (#10287). CI ran before #10287 merged.
Axiom line assessment
CI status
Branch status9 commits ahead and 28 behind main. Verdict: APPROVE |
DTrim99
left a comment
There was a problem hiding this comment.
Box 1 wages are built correctly: employment income minus 401(k)/403(b) deferrals, pre-tax health premiums (#10046) and HSA payroll, with Roth left in and no double subtraction. The dependent worksheet and the 435.603(d)(2) Medicaid filing test now agree. 16 expectations hand-check, and the merged tree passes the ratchet. Seven suggestions, including Oregon and Hawaii cases now that they inherit earned disability. Full report in the comment above.
|
US + core hub merge audit, us#10272 at
|
What
The dependent standard deduction worksheet and the Medicaid dependent filing test counted wages before elective deferrals. Form 1040 starts the worksheet's earned income from line 1z, and line 1a is W-2 box 1, which leaves out 401(k)-type deferrals. Example (2025): a claimed dependent with $10,000 of wages, a $6,000 401(k) deferral and $600 of interest got a $10,450 standard deduction and no filing requirement. The form gives earned income of $4,000, a deduction of $4,450 and, with gross income of $4,600, a required return.
Found by the US + core hub's merge review of #10185 (finding P3-4). The defect predates #10185 and is outside its scope.
Law
Change
standard_deduction_worksheet_earned_income_person(Person): the existinggov.irs.income.filing_requirement.dependent.earned_income_sourceslist (irs_employment_income, the model's W-2 box 1/line 1a wages after pretax payroll deductions; Schedule C; Schedule F), plusearned_disability_benefits(line 1h, added in the merge with Count taxable employment disability benefits in federal gross income (IRC 105(a)) #10185), minusself_employment_tax_ald_person(Schedule 1 line 15). It isn't floored, so a joint return can net one spouse's loss against the other's earnings. The source list also drives the unearned income test intax_unit_is_required_to_file, which separately splits earned disability out of taxable disability. No new box 1 helper was needed:irs_employment_incomesupplies the wage component.standard_deduction_worksheet_earned_income(TaxUnit): the head's and spouse's sum of the person amount, floored at 0.basic_standard_deduction,or_standard_deductionandhi_deductionsread the new variable instead of repeatingtax_unit_earned_income − self_employment_tax_ald.medicaid_person_is_required_to_fileuses the person amount, floored at 0, for its earned income. It uses the same source list, in place of a local constant, for its earned/unearned split.tax_unit_earned_incomeas a tax-unit input now feedstandard_deduction_worksheet_earned_income, the amount those formulas actually used.Before and after
Each new case run against main at
f9b55fc4ddand this branch:basic_standard_deduction/tax_unit_is_required_to_filemedicaid_person_is_required_to_filebasic_standard_deduction/ Medicaid testbasic_standard_deductionbasic_standard_deductionor_standard_deductionhi_deductionsWith main's code, 10 of the 15 cases added to the four existing YAML files fail. The 5 that pass are the 4 controls and the $15,000 farm case, which main gets right only because it counted farm income as unearned. The new variables' own cases can't run on main. On this branch all pass. The deferral cases give the same values in TY2026.
Review
First review (GPT-6.1 Sol, Subfleet
--task review --tier hard) of59dc4330d7: REQUEST_CHANGES with two P2s and a P3, no methodology choice. The findings were: subtract line 15 in the Medicaid test; require all of line 1z in rulespec-us#1813; qualify deferral invariance. All three are fixed inf661fc916band8c213d2036.Delta review (Opus 5.5) of
8c213d2036: APPROVE, no methodology choice. Its checks:59dc4330d7;It ran on Opus rather than Sol because a host disk pause holds new Subfleet jobs. Its one P3, making property 6 bite on every seed, is fixed in
2b1fc7a39f. That commit changes only the test file.The review files are in
~/reviews/us-hub/reviews-gen/us-10272/on the hub host.Tests run locally before this merge (head
41316d5b21e, one process each, thread caps 4)standard_deduction_worksheet_earned_income_person3/3 (new),standard_deduction_worksheet_earned_income9/9 (new),basic_standard_deduction21/21,medicaid_person_is_required_to_file14/14,or_standard_deduction18/18,hi_deductions16/16;tax_unit_is_required_to_file38,tax_unit_is_required_to_file_dependents49,dependent_gross_income15.test_batched.py --mode per-subdir --workers 1:gov/irs/deductions,gov/irs/income,gov/hhs/medicaid(whole folder, after the line 15 change), and the DC, NE, UT, OR and HItax/incomefolders. All passed.tests/corefiling-requirement, Medicaid household income, head/spouse swap, parent-links invariants, all passed. The selected code-health tests (reference URLs, parameter keys, entity sums, Python groups) passed, 195 tests.Invariants
Stated, and tested by
tests/core/test_dependent_worksheet_earned_income_invariants.py. Hypothesis runs 40 batches of single and joint units in OR, HI and TX, each unit in four variants, for 2025 and 2026. Every batch also includes four fixed units: the review's case in each state, and a claimed filer with $901 of farm profit and $450 of interest, whose filing requirement turns on line 15 alone:tax_unit_is_required_to_fileandmedicaid_person_is_required_to_fileequal Table 2 computed with box 1 wages.Mutation checks:
59dc4330d7, Medicaid without line 15), property 6 fails on every seed tried (2, 3, 5 and 7), on the fixed $901 farm unit. Before that unit was added it failed on only some seeds (delta review P3).Cost: about 5 s of test time, 17 s wall with imports, about 1.05 GB peak (local macOS; CI "core" REST Python group, default routing).
Other readers of dependent earned income
or_standard_deduction.py, main line 26) and Hawaii (hi_deductions.py, main line 36).tax_unit_is_required_to_file(unearned test, via the same parameter),eitc_earned_income,filer_adjusted_earnings(subtracts wages outsideirs_employment_income).va_standard_deduction.py:30-31limits a claimable filer's Virginia deduction toearned_income(wages before deferrals), floored per filer. Virginia's rule is its own: no floor or add-on, and it relies on 23VAC10-110-143's definition. It is not the federal worksheet, so the box 1 question there needs Virginia's sources.tax_unit_earned_incomeitself still sums wages before deferrals. Its other readers (CO refundable CTC, DC EITC without a qualifying child, WV low-income exclusion, CA SCC general assistance, MT reforms, CTC phase-in reforms, UBI phase-in) are not this worksheet and are out of scope.Merge with main after #10185
Merged
upstream/mainatf19877374ac943756c15734e063fc259bff74b2c(including #10185) intodependent-worksheet-w2-wageswith a merge commit; no rebase.basic_standard_deduction.py): retain this PR's shared worksheet helper. Addearned_disability_benefitsonce instandard_deduction_worksheet_earned_income_person, alongside W-2 box 1 wages after elective deferrals, business and farm income, before subtracting Schedule 1 line 15. The tax-unit helper sums head and spouse before flooring at zero. Oregon and Hawaii inherit the same earned disability treatment through the shared helper.medicaid_person_is_required_to_file.py): use that same per-person worksheet earned income, floored at zero. Keep Count taxable employment disability benefits in federal gross income (IRC 105(a)) #10185's separate addition of earned disability to positive earned gross income so that only the remaining taxable disability is unearned. Keep main's federal filing split of taxable disability minus earned disability.basic_standard_deduction.yamlandmedicaid_person_is_required_to_file.yaml: preserve every case from both sides, with unchanged inputs and numerical expectations: 25 inherited basic deduction cases and 19 inherited Medicaid filing cases, plus one new combined regression in each file. No inherited case required an additional input. Correct H3b's explanatory deduction from $9,450 to $6,950: $4,000 wages − $2,500 deferral + $5,000 earned disability + $450; gross $6,500 remains below the limit, so itsfalseexpectation stays correct.Hand calculation for the combined 2025 regression: a single, claimable, 30-year-old filer has $18,000 wages, a $6,000 traditional 401(k) deferral and a $3,000 taxable disability pension before minimum retirement age. Both
disability_benefitsanddisability_benefits_before_minimum_retirement_ageare supplied at $3,000. Form 1040 line 1a is $12,000, line 1h is $3,000 and line 1z is $15,000. The dependent worksheet has no age/blindness boxes on line 1; line 2 is $15,000 + $450 = $15,450; line 3 is $15,750; and line 4a is $15,450. See the 2025 Form 1040 instructions, p. 25 for deferrals and line 1h pensions, and p. 35 for the worksheet.Under Pub. 501 (2025), Table 2, p. 4, unearned income is $0; earned income $15,000 is below $15,750; and gross income $15,000 is below max($1,350, min($15,000, $15,300) + $450) = $15,450. Both federal and Medicaid filing results are false. Omitting the pension from worksheet earnings would wrongly require filing; counting wages before deferrals would wrongly require Medicaid filing and give the wrong federal deduction.
Post-merge validation at
864b917313ff6131dbd422954d3c4be763f07f8c(one file per foreground process, serial execution, all thread caps 4):The two conflicted YAML files also passed their separate initial runs: 26/26 basic standard deduction and 20/20 Medicaid filing, before being run again with their folders. The table counts each file's cases once: 350 YAML cases + 14 Python tests. All YAML checks used the prescribed
policyengine_core.scripts.policyengine_command test <file> -c policyengine_us; Python checks usedpytest -q <file>, one worker.make format(Ruff format and check) passed before both commits.Cache-guard follow-up (
6d892f14cf): out-of-place worksheet addition; all six changed formulas audited; guard 4/4 passed. The first Medicaid YAML reported 4 passes but stalled during process shutdown; remaining serial checks are pending.Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
f19877374aagainst this PR's head6d892f14cf, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.basic_standard_deductionstandard_deductionmedicaid_person_is_required_to_filehi_deductionsor_standard_deductionincome_taxstate_income_taxhousehold_net_incomehousehold_benefitsComparison files are in
fixes/10272-impact/on the hub host.Impact note for the hub
Affected cases include units whose head or spouse can be claimed as a dependent (
head_or_spouse_is_dependent_elsewhere) and that have pretax payroll deductions or farm income; Oregon and Hawaii claimable filers with earned disability; and Medicaid households with dependents affected by those sources or the self-employment tax deduction. Directions:Pretax deductions lower the limited deduction, so federal taxable income and tax rise and more units must file. DC, NE and UT read
basic_standard_deduction; Oregon and Hawaii read the new variable.Positive farm income can raise the limited deduction; business and farm losses reduce worksheet earned income.
Earned disability now contributes to the shared worksheet amount used by Oregon and Hawaii, so it can raise their limited deductions.
The Medicaid test feeds
medicaid_household_income. Post-deferral earnings can make filing required or no longer required, depending on which Table 2 test binds (both directions appear in the examples above). When a dependent must file, their income counts in household income and can lower Medicaid/CHIP eligibility.The line 15 subtraction in the Medicaid test makes more self-employed dependents required to file, so their income counts in household income.
Suggested queue line:
10272|2025 2026|standard_deduction_worksheet_earned_income basic_standard_deduction standard_deduction tax_unit_is_required_to_file medicaid_person_is_required_to_file medicaid or_income_tax hi_income_tax. No impact numbers are stated here; they should come from the hub's full-file run at the final head.Axiom
axiom: us/statute/26/63 (c)(5) earned income TheAxiomFoundation/rulespec-us#1813 queued.
us/statutes/26/63/c/5.yamlandus/policies/irs/rev-proc-2025-32/standard-deduction.yamltakeearned_incomeas an opaque input, and nothing composes it from W-2 box 1. The issue is dispatch-ready: verbatim worksheet and line 1a text from corpusus/form/irs/ty2025/i1040gi, required outputs (the whole of line 1z, lines 1a–1h, per the review),review_finding, and TY2026 companion tests T1–T9 from the same IRS ground truth. It is blocked on a corpus re-pin (the form is not in the pinned release) and on #1554 stage 1 (§402(e)(3)). It coordinates with #1748, which handles the same input for #10185.🤖 Generated with Claude Code