Skip to content

Deny the DC standard deduction to a separate filer whose spouse itemizes - #10643

Merged
MaxGhenis merged 1 commit into
mainfrom
dc-standard-deduction-separate
Nov 3, 2026
Merged

MaxGhenis merged 1 commit into
mainfrom
dc-standard-deduction-separate

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

A married person filing a separate return whose spouse itemizes now gets a DC standard deduction of 0, covering both the basic and the additional amount.

Law

D.C. Code § 47-1803.03(c): "If spouses or domestic partners file separate returns, the applicable standard deduction shall be allowed to neither if the net income of one of the spouses or domestic partners is determined by itemizing deductions." That is DC's counterpart to IRC 63(c)(6)(A). I read it in the DC Council codification, publication 2026-10-28.

Defect on main

dc_standard_deduction adds basic_standard_deduction and additional_standard_deduction. Before 2025, the federal basic amount is already 0 when separate_filer_itemizes is true, but the additional amount for age or blindness was still added. From 2025, formula_2025 uses DC's own basic amount, which ignored separate_filer_itemizes entirely, so it gave $15,000 + additional.

Change

dc_standard_deduction.py: both formulas return 0 when separate_filer_itemizes is true. I added the 47-1803.03(c) reference.

Tests (dc_standard_deduction.yaml)

Case Main Head
2024 separate filer, age 66, spouse itemizes 1,550 (additional only) 0
2025 separate filer, age 66, spouse itemizes 16,600 0
2025 separate filer, age 66, spouse doesn't itemize 16,600 16,600 (15,000 + 1,600)

impact: none at baseline (separate_filer_itemizes has no formula and the population file doesn't store it, so it stays false)
axiom: TheAxiomFoundation/rulespec-us#2014 queued

🤖 Generated with Claude Code

D.C. Code 47-1803.03(c) allows the standard deduction to neither spouse
filing separately when one itemizes. dc_standard_deduction added the
additional amount for age or blindness even when the federal basic amount
was zeroed, and from 2025 DC's own basic amount ignored the rule entirely.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6JoAx1PqHmDjxg51eh
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Ready for hub review

Head: bd527d23064ff2bd3b06cec0ad1778fae53127ee

Item: standard deduction for a separate filer whose spouse itemizes

  • Check. DC's counterpart to IRC 63(c)(6)(A) is D.C. Code § 47-1803.03(c): the standard deduction "shall be allowed to neither" when spouses file separate returns and one itemizes. I read it in the DC Council codification, publication 2026-10-28.
  • Defect. Before 2025, the formula still added additional_standard_deduction after federal basic_standard_deduction had zeroed the basic amount. From 2025, formula_2025 ignored separate_filer_itemizes entirely.
  • Fix. policyengine_us/variables/gov/states/dc/tax/income/deductions/dc_standard_deduction.py:25 and :35 return 0 when separate_filer_itemizes is true. The reference is at :12-14.

Tests (one file per process)

  • dc_standard_deduction.yaml 19 passed (3 new, at lines 208, 230, 251).
  • dc_deduction_joint.yaml 2 passed; dc_deduction_indiv.yaml 2 passed.
  • code_health/test_source_conflicts.py 103 passed.
  • ruff format and ruff check are clean on the changed file.

Hand computations

Case Main Head
2024 MFS, age 66, spouse itemizes 1,550 (additional only) 0
2025 MFS, age 66, spouse itemizes 16,600 0
2025 MFS, age 66, spouse doesn't itemize 16,600 = 15,000 + 1,600 16,600

Mutants (each in its own process, file restored after)

  • main's formula: 2 fail.
  • pre-2025 guard removed: 1 fail.
  • 2025 guard removed: 1 fail.

CI

Not run: the PR is a draft.

Judgment calls

  • DC's same-return separate filing (dc_files_separately) starts from one federal return with a single itemization choice, so 47-1803.03(c) doesn't bite there. I left it alone.
  • No partner tests reference separate_filer_itemizes together with DC.

Generated by Claude Code

@MaxGhenis
MaxGhenis marked this pull request as ready for review November 2, 2026 23:37
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hub review in progress

Reviewing head bd527d23064ff2bd3b06cec0ad1778fae53127ee. Interim findings so far:

  • Law confirmed. D.C. Code § 47-1803.03(c), read from the DC Council codification on GitHub (DCCouncil/law-xml-codified): "the applicable standard deduction shall be allowed to neither if the net income of one of the spouses or domestic partners is determined by itemizing deductions." code.dccouncil.gov refused the connection from this VM. § 47-1801.04(44)(A)(iv)-(v) defines "standard deduction" as the § 63(c) amount for 2018-2024 and as the DC basic plus additional amount from 2025, so the rule reaches both formulas.
  • Defect reproduced at main (d4d39178). The PR's two new spouse-itemizes cases fail on main with 1,550 (2024) and 16,600 (2025). They pass at the head.
  • dc_standard_deduction.yaml at the head: 19 passed.

Still to do: the remaining test files, mutants, the filing-status gating question, readers, and scope.


Generated by Claude Code

@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b0a8c09) to head (bd527d2).
⚠️ Report is 144 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #10643   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           15        18    +3     
=========================================
+ Hits            15        18    +3     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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

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

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

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Ready for hub review
VERDICT: APPROVE
bd527d2
METHODOLOGY_CHOICE: no

The head is unchanged since bd527d2306. The PR applies D.C. Code § 47-1803.03(c) correctly to a federally separate filer in both formulas. I reproduced the defect at main, and every mutant the hand-off lists is killed. My findings are all P3: one design question about gating on filing status, and stale or unverifiable lines in the hand-off.

Findings

P3-1. The guard does not check filing status, and no test pins that choice

policyengine_us/variables/gov/states/dc/tax/income/deductions/dc_standard_deduction.py:25 and :35 zero the deduction whenever separate_filer_itemizes is true, whatever the filing_status. That matches main's basic_standard_deduction (the select at lines 40-48 of that file). The open federal fix #10579 doesn't gate on filing status either.

  • Failure scenario. In 2025, an inconsistent input of JOINT plus separate_filer_itemizes: true (two people aged 66) gives dc_standard_deduction 0 at the head and 33,200 at main. HEAD_OF_HOUSEHOLD with the flag gives 0 at the head and 22,500 at main. The federal basic_standard_deduction already gives 0 for both at main, so the PR only makes DC consistent with federal. It is not a new defect at baseline.
  • The hub's pending change. The brief mentions a hub change that gates the flag on SEPARATE in basic_standard_deduction. I couldn't find it on GitHub. If it lands, this guard should follow it, so DC and federal don't diverge. A mutant that adds that gate (M5 below) survives every test, so whoever lands second needs a test for a non-SEPARATE unit with the flag set.
  • Statutory wording. § 47-1803.03(c) says "spouses or domestic partners file separate returns", which is broader than IRC 63(c)(6)(A)'s "married individual filing a separate return". A gate on federal SEPARATE would drop DC domestic partners, who don't file federally as married. The model has no input for them today, so that is a follow-up, not a defect here.
  • Replacement, if the hub gates federal. In both formulas:
    filing_status = tax_unit("filing_status", period)
    denied = tax_unit("separate_filer_itemizes", period) & (
        filing_status == filing_status.possible_values.SEPARATE
    )
    return where(denied, 0, ...)
    Add a YAML case with filing_status: JOINT and separate_filer_itemizes: true that pins whichever answer the hub picks.

P3-2. The DC deduction is 0 instead of DC itemized deductions when federal itemization is understated (federal defect, follow-up)

dc_deduction_joint follows tax_unit_itemizes. At main, federal standard_deduction for a separate filer whose spouse itemizes still counts the additional amount. #10579 fixes that. So a filer whose itemized deductions are below that additional amount is modelled as not itemizing, and DC falls to the standard deduction. The PR now makes that 0.

P3-3. Hand-off and body lines to correct or treat as unverified

  • CI. The hand-off says "CI: Not run: the PR is a draft." The PR is no longer a draft, and Pull request run 41546883613 is running at this head (state below).
  • Publication date. "publication 2026-10-28": I read the same text in DCCouncil/law-xml-codified (master) but couldn't check the publication date. code.dccouncil.gov refused the connection from this VM.
  • Axiom line. axiom: (hub files pe-parity before landing) exists, as the brief asked. It is not in the CLAUDE.md form (<legal id> encoded-correct | <rulespec PR> encoded | <issue> queued | n/a), so the hub has to replace it before landing. impact: the hub will measure is present.

Checked and sound

  • Law (fetched from raw.githubusercontent.com/DCCouncil/law-xml-codified/master/.../47-1803.03.xml and .../47-1801.04.xml).

    • § 47-1803.03(c) says "the applicable standard deduction shall be allowed to neither if the net income of one of the spouses or domestic partners is determined by itemizing deductions."
    • Its history note says D.C. Law 17-231 only added domestic partners: the earlier text already said "If a husband and wife file separate returns ... allowed to neither". So the rule reaches every year either formula covers.
    • § 47-1801.04(44)(A)(iv) makes the standard deduction "the standard deduction as prescribed in section 63(c)" for 2018-2024, and (v) makes it "the sum of" the DC basic amount and the § 63(c)(3) additional amount from 2025. So "allowed to neither" removes the additional amount too, in both periods.
    • § 47-1801.04(3A)(A)(i)(I) sets $15,000 for a married individual filing separately in 2025.
  • Hand values, computed before reading the code.

    • 2024 at main: federal basic 0 (63(c)(6)(A)) plus the married additional amount $1,550 = 1,550. Correct value 0.
    • 2025 at main: 15,000 + 1,600 = 16,600. Correct value 0.
    • 2025 with the flag off: 16,600.
    • The $1,550 and $1,600 come from gov/irs/deductions/standard/aged_or_blind/amount.yaml.
  • Defect reproduced at main (d4d39178). Running the PR's test file against main's code: dc_standard_deduction@2024: [1550.] differs from 0.0 and dc_standard_deduction@2025: [16600.] differs from 0.0, so 2 failed, 17 passed.

  • The two filing routes.

    • Federally separate filer (filing_status: SEPARATE, one person per unit): both formulas now give 0. A witness with $50,000 wages and $1,000 or $5,000 of gifts itemizes federally, so DC uses dc_itemized_deductions (1,000 / 5,000), and DC tax is unchanged from main (2,785 / 2,525). The change reaches tax only when the unit does not itemize federally.
    • Same-return separate filer (dc_files_separately, one JOINT unit): the couple shares one tax_unit_itemizes, so (c)'s mixed case can't arise. The flag is false for a joint unit. Witness at the head and at main: JOINT 2025, both aged 66, dc_standard_deduction = dc_deduction_joint = 33,200 = 30,000 (§ 47-1801.04(3A)(A)(i)(III), "separate on a combined return") + 2 × 1,600, split by dc_deduction_indiv. Leaving that route alone is right.
  • Downstream readers.

    • dc_standard_deduction → dc_deduction_joint (only when not itemizing) → dc_deduction_indiv → dc_taxable_income_indiv and dc_taxable_income_joint.
    • It is also listed in gov/states/household/state_standard_deductions.yaml, summed by state_standard_deduction. No formula in the package reads that.
    • separate_filer_itemizes is a bare input with no formula, defined in every year, so it holds for every period this PR reads it.
  • Before 2025. No existing DC test sets separate_filer_itemizes. Only the three new cases in dc_standard_deduction.yaml do; the other users are ME, ID and Medicaid tests that don't read DC. So no test relied on main adding the additional amount after zeroing the basic one.

  • Tests at the head, one file per process. All pass:

    • dc_standard_deduction.yaml: 19 passed.
    • dc_deduction_joint.yaml: 2 passed.
    • dc_deduction_indiv.yaml: 2 passed.
    • dc_itemized_deductions.yaml: 2 passed.
    • dc_agi_spouse_deductions.yaml: 1 passed.

    The new cases assert the exact claim (0, not "less than"). Neither 2025 guard can be dropped without a failure: M2 and M3 below each fail one case.

  • Mutants (scratch worktree, one process each, restored, git status clean).

    • M1, pre-2025 guard removed: killed by "DC 2024 separate filer aged 66 whose spouse itemizes ..." (1550 vs 0).
    • M2, 2025 guard removed: killed by "DC 2025 separate filer aged 66 whose spouse itemizes ..." (16600 vs 0).
    • M3 (mine), 2025 guard zeroes only the basic amount: killed by the same 2025 case (1600 vs 0).
    • M4 (mine), 2025 guard inverted: 14 failed, including "DC 2025 separate filer aged 66 whose spouse does not itemize".
    • M5 (mine), 2025 guard also requires SEPARATE: survives, 19 passed. See P3-1.
  • Diff and body.

    • The body's description of main matches the code: basic_standard_deduction returns 0 under the flag, formula added additional_standard_deduction regardless, and formula_2025 never read the flag.
    • The #(c) reference URL and the changelog fragment (top-level, .fixed.md) are fine.
    • No source-conflict marker is needed, because the statute is unambiguous and nothing in the code departs from it.
  • Scope. The PR changes three files, none under .github/ or tests/policy/baseline/partners/, and no partner test file mentions separate_filer_itemizes.

  • Overlap. Open PR Zero a separate filer's whole standard deduction and exclude dependent care benefits from wages #10579 changes the federal standard_deduction for the same rule, with no file overlap. Keep ABLE contributions in the saver's credit and apply 6012(a)(1) to every 2026 filer #10590, Start Vermont's 2017 taxable income from federal taxable income (former 32 V.S.A. § 5811(21)) #10595 and Apply Arizona, Arkansas and California rules for a filer who can be claimed as a dependent #10053 appear in searches for basic_standard_deduction and separate_filer_itemizes but don't touch DC files.

  • CI at this head (run 41546883613), at the time of writing.

    • Passed: PR validation, Package and compatibility, Quick Feedback, Household API Partners, every Baseline shard, and every Python Rest shard.
    • Still in progress: Full Suite - Microsimulation and every Contrib shard.

What I couldn't check

  • Baseline impact. Whether any record in the population data sets separate_filer_itemizes. If none does, the diff moves no microsimulation output. If some do, it lowers their DC deduction when they don't itemize federally. The hub needs to measure this on data I can't reach.
  • code.dccouncil.gov and otr.cfo.dc.gov. The proxy refused both, so I didn't read the 2025 D-40 booklet the variable cites, or the official site's copy of § 47-1803.03. I used the DC Council's own GitHub codification instead.
  • CI. The final Microsimulation and Contrib results.

Generated by Claude Code

@MaxGhenis
MaxGhenis merged commit 429302f into main Nov 3, 2026
43 checks passed
@MaxGhenis
MaxGhenis deleted the dc-standard-deduction-separate branch November 3, 2026 00:43
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#10643 at bd527d23064ff2bd3b06cec0ad1778fae53127ee (squash): Deny the DC standard deduction to a separate filer whose spouse itemizes.

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