Skip to content

Use W-2 box 1 wages in the dependent standard deduction worksheet and Medicaid filing test - #10272

Merged
MaxGhenis merged 9 commits into
mainfrom
dependent-worksheet-w2-wages
Oct 23, 2026
Merged

MaxGhenis merged 9 commits into
mainfrom
dependent-worksheet-w2-wages

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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

  • 26 USC 63(c)(5): the basic standard deduction of an individual whom another taxpayer can claim "shall not exceed the greater of— (A) $500, or (B) the sum of $250 and such individual's earned income." The section does not define earned income.
  • Form 1040 instructions (2024, PDF pages 23, 25 and 34; 2025, PDF pages 23, 25 and 35):
    • Line 1a: "Enter the total amount from Form(s) W-2, box 1."
    • Elective deferrals: "It isn't included as income in box 1 of your Form W-2."
    • Standard Deduction Worksheet for Dependents, footnote: "Generally, your earned income is the total of the amount(s) you reported on Form 1040 or 1040-SR, line 1z, and Schedule 1, lines 3, 6, 8r, 8t, and 8u minus the amount, if any, on Schedule 1, line 15."
  • Pub. 501, Table 2 (2024 and 2025, PDF page 4): a single dependent must file if gross income is more than the larger of $1,350 or earned income (up to $15,300) plus $450 (2025 amounts). Gross income is the total of earned and unearned income. Its wage component uses W-2 box 1; taxable disability pensions before minimum retirement age also count as earned income.
  • Oregon: Publication OR-17 (2025), PDF pages 95-96, defines earned income the same way for its dependent worksheets. The model's comment already said "figured as in the federal worksheet".
  • Hawaii: N-11 instructions (2025), PDF page 20: "your earned income is the total of the amounts you reported on federal Form 1040 or Form 1040-SR, line 1 (wages), federal Schedule 1 … lines 3 (business income) and 6 (farming income), minus the amount, if any, on federal Schedule 1 … line 15."
  • Medicaid: 42 CFR 435.603(d)(2)(i) uses whether the individual "is not expected to be required to file a tax return under section 6012(a)(1)", which Table 2 implements.

Change

  • New standard_deduction_worksheet_earned_income_person (Person): the existing gov.irs.income.filing_requirement.dependent.earned_income_sources list (irs_employment_income, the model's W-2 box 1/line 1a wages after pretax payroll deductions; Schedule C; Schedule F), plus earned_disability_benefits (line 1h, added in the merge with Count taxable employment disability benefits in federal gross income (IRC 105(a)) #10185), minus self_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 in tax_unit_is_required_to_file, which separately splits earned disability out of taxable disability. No new box 1 helper was needed: irs_employment_income supplies the wage component.
  • New 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_deduction and hi_deductions read the new variable instead of repeating tax_unit_earned_income − self_employment_tax_ald.
  • medicaid_person_is_required_to_file uses 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.
  • Main's netting is kept: a business or farm loss reduces worksheet earned income, and Medicaid's unearned income still subtracts only positive earned amounts. As on main, line 15 includes the SE tax on partnership earnings, while partnership income (Schedule 1 line 5) is not earned income. That follows the footnote literally. The merge retains Count taxable employment disability benefits in federal gross income (IRC 105(a)) #10185's earned disability rule through the shared helper; scholarship treatment is unchanged.
  • The Medicaid test now subtracts line 15, as the federal worksheet does (review finding). Main's Medicaid test told a dependent with $15,000 of Schedule C profit that no return was required. The worksheet gives $15,000 − $1,059.72 + $450 = $14,390.28, below gross income, so a return is required, as the federal test already found. The Medicaid and federal tests now agree for every single claimable filer (property 6 below).
  • Also fixed, same worksheet line: farm income (Schedule 1 line 6) was missing from the worksheet, and the Medicaid test counted it as unearned income. Both the federal footnote and Hawaii's N-11 list line 6, and the parameter already included it.
  • The parameter's description, label and references now cover both uses. Five Oregon cases and ten Hawaii cases that fed tax_unit_earned_income as a tax-unit input now feed standard_deduction_worksheet_earned_income, the amount those formulas actually used.

Before and after

Each new case run against main at f9b55fc4dd and this branch:

Case (2025, claimed filer) Variable Main This PR Form
$10,000 wages, $6,000 401(k), $600 interest (review's case) basic_standard_deduction / tax_unit_is_required_to_file 10,450 / false 4,450 / true 4,450 / true
same medicaid_person_is_required_to_file false true true
$4,000 wages, no deferral, $600 interest (control) all three 4,450 / true / true 4,450 / true / true same
$17,000 wages, $3,000 401(k) basic_standard_deduction / Medicaid test 15,750 / true 14,450 / false 14,450 / false
$3,000 farm profit basic_standard_deduction 1,350 3,238.06 3,238.06
$2,000 farm profit Medicaid test true false false: limit $2,308.70 (6012(a)(1); the 6017 SE rule is not part of 435.603)
$15,000 farm profit Medicaid test true (farm treated as unearned) true true: limit $14,390.28 after line 15
$15,000 Schedule C profit Medicaid test false true true: limit $14,390.28 after line 15
Joint, claimable head: $8,000 wages with $3,000 401(k); spouse $8,000 basic_standard_deduction 16,450 13,450 13,450
Oregon: $3,000 wages, $2,000 401(k) or_standard_deduction 2,835 1,450 1,450
Hawaii: $3,000 wages, $2,000 401(k) hi_deductions 3,000 1,000 1,000

With 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) of 59dc4330d7: 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 in f661fc916b and 8c213d2036.

  • Delta review (Opus 5.5) of 8c213d2036: APPROVE, no methodology choice. Its checks:

    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)

  • YAML: standard_deduction_worksheet_earned_income_person 3/3 (new), standard_deduction_worksheet_earned_income 9/9 (new), basic_standard_deduction 21/21, medicaid_person_is_required_to_file 14/14, or_standard_deduction 18/18, hi_deductions 16/16; tax_unit_is_required_to_file 38, tax_unit_is_required_to_file_dependents 49, dependent_gross_income 15.
  • Folders via 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 HI tax/income folders. All passed.
  • Python: tests/core filing-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:

  1. Deferral invariance: wages W with deferral D give the same worksheet earned income, federal, Oregon and Hawaii deductions, federal filing requirement and Medicaid filing requirement as wages max(W − D, 0) with no deferral, provided line 15 is the same for both. Deferrals are still Social Security wages, so near the wage base they change self-employment tax and line 15. That is intended. The drawn range stays far below the base.
  2. Bounds: for a unit whose head or spouse can be claimed, the section 63(c)(5)(A) amount ≤ basic standard deduction ≤ the regular basic standard deduction; for any other unit it equals the regular amount. Hawaii's limited deduction ≤ Hawaii's regular deduction.
  3. Monotonicity: $1,000 more wages never lowers worksheet earned income or any of the three deductions; a deferral $1,000 larger out of the same wages never raises them.
  4. Reference: for wage-only units, worksheet earned income = Σ max(W − D, 0) over head and spouse, and the claimable unit's deduction = min(regular, max(floor, earned + addition)).
  5. Table 2 differential (2025): for single claimable filers with wages, deferrals and interest, both tax_unit_is_required_to_file and medicaid_person_is_required_to_file equal Table 2 computed with box 1 wages.
  6. Federal and Medicaid agree (2025): for every drawn single claimable filer, self-employment and farm income or loss included, the two filing tests give the same answer.

Mutation checks:

  • Putting main's wages before deferrals back into the worksheet, or into the Medicaid test alone, fails property 1 on a minimal batch.
  • Run against the previous head (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

  • Fixed here (same worksheet): Oregon (or_standard_deduction.py, main line 26) and Hawaii (hi_deductions.py, main line 36).
  • Already on box 1: tax_unit_is_required_to_file (unearned test, via the same parameter), eitc_earned_income, filer_adjusted_earnings (subtracts wages outside irs_employment_income).
  • Listed, not fixed: va_standard_deduction.py:30-31 limits a claimable filer's Virginia deduction to earned_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_income itself 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/main at f19877374ac943756c15734e063fc259bff74b2c (including #10185) into dependent-worksheet-w2-wages with a merge commit; no rebase.

  • Dependent worksheet (basic_standard_deduction.py): retain this PR's shared worksheet helper. Add earned_disability_benefits once in standard_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 filer test (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.yaml and medicaid_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 its false expectation stays correct.
  • Disability filing properties from main: update the independent reference to use box 1 wages and subtract Schedule 1 line 15 for Medicaid as well as the federal worksheet. Draw elective deferrals together with disability splits, capped at $23,000 so they stay within the annual elective-deferral limit in every tested year (2024–2026), and retain all original anchors. Add fixed anchors for the combined regression and a disability/business-profit case whose filing requirement turns on line 15: $901 profit + $1,000 disability − ($901 × 0.9235 × 15.3% ÷ 2) + $450 = $2,287.35, below gross $2,351.

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_benefits and disability_benefits_before_minimum_retirement_age are 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):

Scope Files Passing cases/tests
Federal standard deduction folder 3 38
Dependent/general federal filing and dependent gross income 3 110 (55 + 39 + 16)
Medicaid income folder, including both deeming subfolders 15 168
Oregon and Hawaii deduction callers 2 34 (18 + 16)
Python property/invariant files 5 14 (1 + 1 + 5 + 2 + 5)

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 used pytest -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 f19877374a against this PR's head 6d892f14cf, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.

Output 2025 change 2026 change 2025 records changed (weighted) 2026 records changed (weighted)
basic_standard_deduction +0 +0 0 (0) 0 (0)
standard_deduction +0 +0 0 (0) 0 (0)
medicaid_person_is_required_to_file +2.84M +2.73M 941 (3,200,183) 961 (3,216,752)
hi_deductions +0 +0 0 (0) 0 (0)
or_standard_deduction +0 +0 0 (0) 0 (0)
income_tax +0 +0 0 (0) 0 (0)
state_income_tax +0 +0 0 (0) 0 (0)
household_net_income +0 +0 0 (0) 0 (0)
household_benefits +0 +0 0 (0) 0 (0)

Comparison 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.yaml and us/policies/irs/rev-proc-2025-32/standard-deduction.yaml take earned_income as an opaque input, and nothing composes it from W-2 box 1. The issue is dispatch-ready: verbatim worksheet and line 1a text from corpus us/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

… 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>
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 19, 2026 13:00
MaxGhenis and others added 3 commits October 19, 2026 09:37
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>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hand-off to the US + core hub at head 2b1fc7a39f0e1d9ebd78d7e566ed4d994e509b95.

Reviews

  • First review, GPT-6.1 Sol at 59dc4330d7: REQUEST_CHANGES (two P2s and a P3). All three were fixed in f661fc916b, 8c213d2036 and 2b1fc7a39f.
  • Delta review, Opus 5.5, because the disk pause holds new Subfleet jobs: APPROVE at 8c213d2036, re-confirmed APPROVE at 2b1fc7a39f with no findings and no methodology choice.
  • Files on the hub host: ~/reviews/us-hub/reviews-gen/us-10272/ (review.md, review-delta.md, first-review-artifacts/, delta-review-scripts/).

Passed locally (one process each, thread caps 4)

  • Every touched YAML file.
  • Folders gov/irs/deductions, gov/irs/income, the whole of gov/hhs/medicaid, and the DC, NE, UT, OR and HI tax/income folders. These ran before the disk pause.
  • The related tests/core property tests.
  • The selected code-health tests.

Pending

  • CI at 2b1fc7a39f. At 8c213d2036 it was 26 passing and 1 still running when the head moved.
  • The hub's impact run. The queue line is in the PR body. No impact numbers are stated in the PR.

Dependencies. This conflicts textually with #10185 in basic_standard_deduction.py and medicaid_person_is_required_to_file.py. The resolution is in the PR body: add earned_disability_benefits once, to standard_deduction_worksheet_earned_income_person, and keep #10185's earned_gross_income addition in the Medicaid split. The delta reviewer verified this against #10185 at c10ffcad60.

Holds and decisions: none.

Axiom: TheAxiomFoundation/rulespec-us#1813 queued (pe-parity).

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 tax_unit_earned_income. These are out of scope here and listed in the PR body.

🤖 Generated with Claude Code

MaxGhenis and others added 4 commits October 19, 2026 17:45
@DTrim99

DTrim99 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Use W-2 box 1 wages in the dependent standard deduction worksheet and Medicaid filing test

Summary

This 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 irs_employment_income, which is employment_income minus pre_tax_contributions. Main fed the worksheet wages before those deductions, through tax_unit_earned_income. The PR adds one per-person helper (standard_deduction_worksheet_earned_income_person) and one tax-unit helper, and routes four readers through them: the federal limited deduction, Oregon, Hawaii and the Medicaid filing test. It also adds farm income, which the footnote lists, and the line 15 subtraction to the Medicaid test, so Medicaid and federal now agree for every claimable single filer.

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 pe-parity, dispatch-ready and records its blockers. 0 critical, 0 should, 7 suggestions.

Critical (must fix)

None.

Should address

None.

Suggestions

  1. Partnership self-employment earnings: line 15 is subtracted but the earnings are not added. This is pre-existing on the federal side; the PR extends the subtraction to Medicaid. See standard_deduction_worksheet_earned_income_person.py:40-45 and earned_income_sources.yaml.

    • self_employment_tax_ald_person includes SE tax on partnership_self_employment_net_earnings, since taxable_self_employment_income lists it. The sources list leaves those earnings out.
    • That follows the footnote's line list literally (2025 Form 1040 instructions, PDF p. 35): "Generally, your earned income is the total of the amount(s) you reported on Form 1040 or 1040-SR, line 1z, and Schedule 1, lines 3, 6, 8r, 8t, and 8u minus the amount, if any, on Schedule 1, line 15."
    • The same footnote opens with "Earned income includes wages, salaries, tips, professional fees, and other compensation received for personal services you performed." The model's own eitc_earned_income counts K-1 box 14 earnings as earned income.
    • Example (2025): a claimable single filer has $5,000 of wages and $1,000 of general-partner SE earnings. The literal reading gives a limit of $5,000 − $70.65 + $450 = $5,379.35 against $6,000 of gross income, so a return is required. Counting the earnings gives $6,379.35, so none is required.
    • Section 63(c)(5) is silent, so the literal reading is a permitted gap-fill, and the PR body discloses it. The cases are rare.
    • Recommendation: settle it in the backlog candidate us:dependent-deduction-worksheet-earned-income, whose note already says "partnership-related line 15 deductions still needing verification". Either count partnership_self_employment_net_earnings as earned, splitting it out of the unearned test the way earned disability is split, or record the literal reading as the gap-fill.
  2. Oregon and Hawaii now inherit earned disability, but no Oregon or Hawaii case pins it, and two descriptions omit it. Through the shared helper, or_standard_deduction and hi_deductions now add line 1h disability pensions (from Count taxable employment disability benefits in federal gross income (IRC 105(a)) #10185), which main did not do for these states.

    • That is defensible. Hawaii's N-11 points to federal "line 1 (wages)" (N-11 instructions 2025, PDF p. 20). Oregon's comment says the amount is "figured as in the federal worksheet".
    • The composition itself is pinned: the combined basic_standard_deduction case gives standard_deduction_worksheet_earned_income = 15,000 including disability. The state-level effect is not.
    • Suggested fixes:
      • Add one Oregon and one Hawaii claimable-filer case with disability_benefits_before_minimum_retirement_age.
      • Add "earned disability benefits" to the or_standard_deduction.py:24-26 comment ("W-2 box 1 wages, business and farm income, net of …").
      • Mention the Oregon and Hawaii disability effect in the changelog fragment.
  3. Source-conflict backlog housekeeping at merge. On main, source_conflicts/candidates.yaml entry us:dependent-deduction-worksheet-earned-income has code: [], follows: unknown and the note "Code not yet on main: standard_deduction_worksheet_earned_income_person, …". The ratchet doesn't require an update, but the entry goes stale once this merges. Fill in code: with the six touched variable files, and set follows: gap-fill if that's the ruling.

  4. The parameter description runs to two sentences (earned_income_sources.yaml:1). The first sentence follows the template. The second ("The earned portion of taxable disability benefits is counted separately; other gross income is unearned income.") could move into a comment, or fold into the first sentence.

  5. Cite a source in the pre-tax premium/HSA test (standard_deduction_worksheet_earned_income.yaml:20). The comment gives only the arithmetic. The 2025 General Instructions for Forms W-2 and W-3 support it:

    • PDF p. 17, box 1: "Show the total taxable wages, tips, and other compensation … do not include elective deferrals (such as employee contributions to a section 401(k) or 403(b) plan)".
    • PDF p. 18: "do not include employee contributions to an HSA that were made through a cafeteria plan."
  6. Optional equality boundary in YAML. The Python properties and the $901 fixed unit cover the line 15 boundary. No YAML case sits exactly at a deferral limit. Example (2025): $10,000 of wages, a $6,000 deferral and $450 of interest. Gross income of $4,450 equals the $4,450 limit, so tax_unit_is_required_to_file and medicaid_person_is_required_to_file should both be false, because Table 2 says "more than".

  7. Track the follow-ups.

    • The author's hand-off lists the Virginia claimable-filer deduction and the other tax_unit_earned_income readers as "proposed (not started)". A tracking issue would keep that list from getting lost.
    • rulespec-us#1813's one-line summary of the PE composition predates the Count taxable employment disability benefits in federal gross income (IRC 105(a)) #10185 merge and leaves out line 1h. Its required output, the whole of lines 1a–1h, already covers it.

Verified correct

Law (each quote checked against the PDF page cited).

  • 26 USC 63(c)(5): "shall not exceed the greater of— (A) $500, or (B) the sum of $250 and such individual's earned income." Section 63 doesn't define earned income, so the worksheet definition fills a gap.
  • 2025 Form 1040 instructions:
    • PDF p. 23, line 1a: "Enter the total amount from Form(s) W-2, box 1."
    • PDF p. 25: "You can't deduct the amount deferred. It isn't included as income in box 1 of your Form W-2."
    • PDF p. 35: the worksheet (line 2: "Is your earned income* more than $900? Yes. Add $450 …; No. Enter $1,350"; line 3: $15,750 single, $31,500 joint) and the footnote quoted above.
    • The 2024 edition matches on PDF pp. 23, 25 and 34.
  • Pub. 501 (2025):
    • PDF p. 4, Table 2: unearned income over $1,350, earned income over $15,750, or gross income over the larger of $1,350 or earned income (up to $15,300) plus $450.
    • PDF p. 26, Table 8, line 1: "Enter your earned income (defined below). If none, enter -0-."
  • 42 CFR 435.603(d)(2)(i)–(ii): the income of a child, or of a tax dependent, "who is not expected to be required to file a tax return under section 6012(a)(1)" is left out of household income. The test is therefore section 6012(a)(1): gross income against the 63(c)(5) limited deduction.
    • Box 1 is the right wage measure for both sides, because gross income excludes section 402(e)(3) deferrals and section 125 salary reductions.
    • Leaving out the section 6017 SE-tax filing duty (Case 12) is correct.
  • Oregon (OR-17 2025, PDF pp. 95–96): earned income is "salaries, wages, tips, professional fees, or other amounts received as pay for work you actually perform". The worksheet uses $450 and $1,350, with a $2,835 single cap; repo parameters for 2025 are $450 and $1,350.
  • Hawaii (N-11 2025, PDF p. 20): "line 1 (wages), federal Schedule 1 … lines 3 (business income) and 6 (farming income), minus … line 15".

Box 1 composition matches in every claimed year.

  • irs_employment_income = max(0, employment_income − pre_tax_contributions). The list is traditional_401k_contributions, traditional_403b_contributions, pre_tax_health_insurance_premiums and health_savings_account_payroll_contributions.
  • pre_tax_health_insurance_premiums is the Document disjoint health premium inputs and correct consumer treatment #10046 variable. It is separate from health_insurance_premiums_without_medicare_part_b, and the PR's test uses the right one.
  • Designated Roth deferrals stay in box 1, as the Roth test shows.
  • Deferrals are capped at the section 402(g) limit (elective_deferral_contribution_scale). A desired excess therefore stays in wages, consistent with the excess going on line 1h.
  • None of these rules changes between 2024 and 2026.

No double subtraction. The worksheet adds irs_employment_income once, plus Schedule C, SSTB and Schedule F income. It adds earned_disability_benefits once, which is not part of irs_employment_income, and subtracts self_employment_tax_ald_person once. The Medicaid side reads the same box 1 amount in three places: gross income (medicaid_irs_gross_income), the earned/unearned split and worksheet earned income. Nothing subtracts deferrals or premiums again.

Federal and Medicaid consistency.

  • tax_unit_is_required_to_file gets its gross income test from standard_deduction, which reads basic_standard_deduction, which reads the new tax-unit helper. Its unearned income test uses the same earned_income_sources parameter.
  • The Medicaid formula uses the per-person helper floored at 0, and the parameter in place of its old local constant. That constant had left out farm income and has no other importers.
  • Medicaid test 2 (earned income over the regular amount) never decides alone: positive earnings above the regular amount already exceed the limited deduction.
  • Property 6 checks that federal and Medicaid agree for single claimable filers, losses included.

Callers.

  • At the head, the new helpers are read by basic_standard_deduction, or_standard_deduction, hi_deductions and medicaid_person_is_required_to_file. tax_unit_is_required_to_file reads the tax-unit helper indirectly through basic_standard_deduction.
  • No YAML test feeds tax_unit_earned_income as an input for a claimable filer, so no existing case now silently bypasses the formula.
  • California has no dependent limit in the model. Virginia and the other tax_unit_earned_income readers are disclosed as out of scope.

Code.

  • Vectorized throughout (add, max_, tax_unit_non_dep_sum), with Person and TaxUnit entities used correctly.
  • The out-of-place addition at the head avoids mutating the cached array that add returns.
  • No hard-coded values: all amounts come from parameters.
  • No state-gated key variable is involved (the NH Add New Hampshire state supplementation for 2026 #10156 pattern doesn't apply).
  • References follow CLAUDE.md:
    • one entry per document;
    • quoted #page 23,25,35 title with the href on the first page;
    • # PDF pages … comments above multi-page variable hrefs.
  • The changelog is a top-level changelog.d/dependent-worksheet-w2-wages.fixed.md.
  • No partner contract files are touched.

Hand-checks (2025 parameters; SE tax = profit × 0.9235 × 15.3%, half deductible).

# Case Expected Check
1 Worksheet: $10,000 wages, $6,000 401(k) 4,000 10,000 − 6,000 ✓
2 Worksheet: $10,000 wages, $1,000 pre-tax premiums, $500 HSA payroll 8,500 10,000 − 1,500 ✓
3 Worksheet: $10,000 wages, $2,000 Roth 401(k) 10,000 Roth stays in box 1 ✓
4 Worksheet: $3,000 Schedule C 2,788.06 3,000 − 211.94 ✓
5 Person: $15,000 farm 13,940.28 15,000 − 1,059.72 ✓
6 Person: $1,000 wages, −$5,000 Schedule C −4,000 no SE tax on a loss ✓; tax unit floors at 0 ✓
7 Tax unit, joint: $8,000 − $3,000 and $8,000; child's $2,000 13,000 dependent excluded ✓
8 Federal: the review case ($10,000 wages, $6,000 401(k), $600 interest) 4,450 / must file max(1,350, 4,450); gross 4,600 > 4,450 ✓
9 Federal: $17,000 wages, $3,000 401(k) 14,450 / no return 14,000 + 450 < 15,750; gross 14,000 ✓
10 Federal, joint, claimable head: $8,000 − $3,000 and $8,000 13,450 13,000 + 450 < 31,500 ✓
11 Medicaid Case 12: $2,000 farm false limit 1,858.70 + 450 = 2,308.70 > 2,000; farm not unearned ✓
12 Medicaid Cases 13/14: $15,000 farm or Schedule C true limit 14,390.28 < 15,000 ✓
13 Medicaid combined: $18,000 wages, $6,000 401(k), $3,000 earned disability false; worksheet 15,000 limit min(15,750, 15,450); gross 15,000 ✓
14 Medicaid H3b (corrected comment) false 1,500 + 5,000 + 450 = 6,950 > 6,500 ✓
15 Oregon: $3,000 wages, $2,000 401(k) 1,450 max(1,350, 1,000 + 450) ≤ 2,835 ✓
16 Python fixed unit: $901 farm + $450 interest must file line 15 $63.65; limit = floor 1,350 < 1,351; without line 15 the limit would be 1,351 ✓

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.

  • The new Hypothesis file checks invariants (deferral invariance, bounds, monotonicity, Table 2 reference, federal = Medicaid) that YAML can't express. It reuses the read-only system and builds one batched simulation per example.
  • Linux CI at the head: the call took 5.38 s. The core group peaked at 10.52 GB RSS (53:33 wall), against 10.32 GB (40:47) on a main run at 1f678c7.
  • The longer wall time is runner-wide: heavy-a, heavy-b and policy were each about 30% slower in the PR run. The memory difference is within noise and well under the runner limit.
  • The PR body's figures are local macOS measurements and are labelled as such.

Population effect (reasoned; no microsimulation run).

  • Affected: units whose head or spouse can be claimed and who have pre-tax payroll deductions, farm income or earned disability (Oregon and Hawaii); and Medicaid dependents with those sources or with self-employment income.
  • For a wage-only dependent, federal taxable income doesn't change: the limited deduction stays at least box 1 wages.
    • Tax rises only with unearned income over about $450, where taxable income goes from U − D − 450 to U − 450, or when wages reach the cap.
    • More such units must file, which feeds tax_unit_is_filer. DC, NE and UT inherit the change through basic_standard_deduction.
  • Medicaid moves both ways:
    • Dependents with deferrals plus unearned income, and SE dependents with profit above about $6,365 in 2025 (0.0707 × S > $450), now must file, so their income counts.
    • Dependents whose pre-deferral wages exceed the regular amount but whose box 1 wages don't, and farm-income dependents below the adjusted limit, no longer must file.
  • Every change moves toward the governing law, and the populations are small: few claimed dependents hold 401(k) deferrals or large SE or farm income. I see no population bias that warrants a SHOULD. The remaining gaps (partnership earnings, unmodelled lines 1b–1g, 8r, 8t and 8u, and scholarships, which are absent from gross income altogether) all predate this PR.

Source-conflict ratchet (#10287). CI ran before #10287 merged.

  • Static check of test_source_conflicts.py's CONFLICT_COMMENT_RE against all seven scanned files the PR touches: 0 matching comment lines at the head and 0 on main, so no count rises or drops.
  • None of the seven files is in KNOWN_UNMARKED.
  • git merge-tree with main is clean, and none of the 28 newer main commits touches these files.
  • The register has no entry citing them, and the backlog's code: [] passes the path check.

Axiom line assessment

axiom: us/statute/26/63 (c)(5) earned income TheAxiomFoundation/rulespec-us#1813 queued. The line is valid.

  • rulespec-us#1813 is OPEN and labelled pe-parity (last updated 2026-10-19).
  • It is dispatch-ready:
    • module paths: us/statutes/26/63/c/5.yaml, us/policies/irs/rev-proc-2025-32/standard-deduction.yaml, and a proposed us/policies/irs/form-1040-instructions/… module;
    • corpus citations: us/statute/26/63 and us/form/irs/ty2025/i1040gi;
    • verbatim law, whose quotes I matched to PDF pp. 23, 25 and 35;
    • required outputs (the whole of line 1z, lines 1a–1h, with Roth deferrals kept in);
    • a review_finding;
    • TY2026 companion tests T1–T9 drawn from the IRS worksheet and Rev. Proc. 2025-32, not from PolicyEngine output.
  • Blockers are recorded: a corpus re-pin (the form scope isn't in the pinned release) and End SNAP EAs in GA and NV #1554 stage 1 (§402(e)(3)). It coordinates with Update Missouri income tax code #1748 for the Count taxable employment disability benefits in federal gross income (IRC 105(a)) #10185 input.
  • It matches the head: the head's composition (box 1 + line 1h + Schedule 1 lines 3 and 6 − line 15) is a subset of the issue's line 1z target. See suggestion 7 for the stale one-line summary.
  • No separate Medicaid encoding is needed. rulespec-us us/regulations/42-cfr/435/603/d.yaml takes expected_required_to_file_return_under_6012_a_1 as an input, so the 63(c)(5) composition carries through.

CI status

gh pr checks 10272 (re-checked): 27/27 passing at head 6d892f1, none pending. The run predates #10287 (merged 2026-10-20 22:02 UTC). The merged-tree ratchet is verified statically above. Both new and changed Python property files passed in the Rest Python core group.

Branch status

9 commits ahead and 28 behind main. git merge-tree --write-tree PolicyEngine/main 6d892f14cf merges cleanly (tree c6da2172), and none of main's 28 newer commits touches a file in this PR. The PR is mergeable and is waiting only for review.

Verdict: APPROVE

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@MaxGhenis
MaxGhenis merged commit 8986e05 into main Oct 23, 2026
27 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#10272 at 6d892f14cf5442df49cc62a69167301f25e644cf (squash): Use W-2 box 1 wages in the dependent standard deduction worksheet and Medicaid filing test.

  • Review: GPT-6.1 Sol shell-backed review APPROVE at 6d892f1 (reviews-gen/us-10272/review-p2fix-g.md): the prior P2 (an in-place += on an add() result at standard_deduction_worksheet_earned_income_person.py:43) is fixed, and all six formulas were audited for the same pattern. Earlier shell-backed reviews covered the worksheet and Medicaid filing test. DTrim99 APPROVED.
  • Gates checked live at merge:
    • gh pr checks exits 0;
    • the latest Pull request run at the head concluded success;
    • MERGEABLE;
    • not a draft;
    • no reviewer's latest review requests changes;
    • the semantic-overlap guard;
    • head pinned.
  • Impact: Default dataset at this head vs base f198773: medicaid_person_is_required_to_file +2.84M (2025) and +2.73M (2026) weighted people (941/961 records); no tax, benefit or net-income total changes (in the body).
  • Axiom: us/statute/26/63 (c)(5) earned income Compose 63(c)(5) earned income from W-2 box 1 wages per the Form 1040 dependent worksheet (PE #10272) TheAxiomFoundation/rulespec-us#1813 queued. us/statutes/26/63/c/5.yaml and us/policies/irs/rev-proc-2025-32/standard-deduction.yaml take earned_income as an opaque input, and nothing composes it from W-2 box 1. The issue is dispatch-ready: verbatim worksheet and line 1a text from corpus us/form/irs/ty2025/i1040gi, required outputs (the whole of line 1z

@MaxGhenis
MaxGhenis deleted the dependent-worksheet-w2-wages branch October 23, 2026 19:59
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.

2 participants