Skip to content

Use the SNAP standard deduction in effect for Virginia TANF earnings - #10247

Open
PavelMakarchuk wants to merge 2 commits into
mainfrom
fix-9986-va-tanf-snap-standard-deduction
Open

PavelMakarchuk wants to merge 2 commits into
mainfrom
fix-9986-va-tanf-snap-standard-deduction

Conversation

@PavelMakarchuk

Copy link
Copy Markdown
Collaborator

Summary

va_tanf_countable_earned_income subtracted gov.states.va.dss.tanf.income.deductions.earned.flat: $167 (1-3 people), $178 (4), $209 (5), $240 (6+), dated 2016-01-01. Those are SNAP's fiscal year 2020 standard deductions, copied from the 11/20 manual's table.

Virginia's TANF standard deduction is the SNAP one. Virginia TANF Manual, Chapter 300, 305.1 A.2.b (page dated 10/23): "All AUs will be allowed the following deductions from earned income: The standard deduction*, the same amount used in the standard deduction for the SNAP program, and 20% of the remainder is deducted from the gross earnings." Its table now shows SNAP's FY2024 amounts ($198 / $208 / $244 / $279). 305.3 B.3 (page 52) subtracts it from the assistance unit's gross earned income and leaves people outside the unit out of the size.

This PR:

  • reads the standard deduction from gov.usda.snap.income.deductions.standard (household state group, assistance unit size capped at six, as SNAP's table does), so it follows SNAP each October;
  • removes the now unused gov.states.va.dss.tanf.income.deductions.earned.flat parameter;
  • points the variable's reference to the current manual (the old tanfx2fview paths now return 404; the manual is under tanfview).

Example (the issue's repro, three people, $500 a month of earnings, January 2025): 0.8 x (500 - 204) = $236.80 instead of 0.8 x (500 - 167) = $266.40.

Tests

  • va_tanf_countable_earned_income.yaml: five new monthly cases (January 2025 at 3 and 4 members, January 2026 at 3 members, a 7-member unit at the six-or-more amount, and a control below the deduction), each with the arithmetic in a comment. The new cases fail on main except the control.
  • The existing 2023 cases now use SNAP's 2023 amounts ($193 / $193 / $225 / $258 from January to September, $198 / $208 / $244 / $279 from October); their expected values and comments are recomputed by hand.
  • policyengine-core test policyengine_us/tests/policy/baseline/gov/states/va/dss/tanf: 111 passed.

Note: #9987 (TANF-UP standards) and #9985 (minimum payment) also change Virginia TANF; their diffs touch other files, so the three PRs do not conflict.

Fixes #9986

🤖 Generated with Claude Code

Virginia's TANF standard deduction is the SNAP standard deduction for the
assistance unit's size (TANF Manual 305.1 A.2.b). PE deducted SNAP's FY2020
amounts dated 2016; it now reads the SNAP parameter in effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (39339e7).
⚠️ Report is 622 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #10247   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         1    -3     
  Lines           76        21   -55     
  Branches         2         0    -2     
=========================================
- Hits            76        21   -55     
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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DTrim99

DTrim99 commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Use the SNAP standard deduction in effect for Virginia TANF earnings

Summary

The PR replaces Virginia TANF's frozen earned income "flat" deduction ($167 / $178 / $209 / $240, dated 2016-01-01, which are SNAP's FY2020 standard deductions) with a lookup of gov.usda.snap.income.deductions.standard by the household's state group and the unit size capped at six. Because the variable is monthly and reads parameters(period), the deduction now changes each October 1 with SNAP's. The PR deletes the unused deductions/earned/flat.yaml, moves the variable's reference to the live manual path, rewrites the 2023 expectations with the split-year SNAP amounts, and adds five monthly 2025–2026 cases.

  • Law. The fix matches the regulation and the manual. 22VAC40-295-50(C) disregards "An amount equal to the standard deduction used in the Food Stamp program" and "Twenty percent of the remainder", and TANF Manual 305.1 A.2.b says "the same amount used in the standard deduction for the SNAP program". The rule has been in force since September 1, 2004, so tying it to SNAP's value in effect is right for every year the model covers, including the October 1 changes.
  • Order of operations. Standard deduction, then 20% of the remainder, then the care disregard, then unearned income are added. That matches Manual 305.3 B and Appendix 3, Step 2 (a)–(e).
  • Code. The lookup copies snap_standard_deduction (same parameter, same state_group_str, same clip(…, 1, 6)), so it's vectorized. No state-gated key is used (NH Add New Hampshire state supplementation for 2026 #10156 doesn't apply). No other file reads the deleted parameter.
  • Tests. I hand-checked all 14 expectations in the file; all are correct.
  • Problems. Only the missing axiom: line needs fixing. Suggestions cover the duplicate-document reference, the stale percentage.yaml description, the regulation citation and the unit-size comment.

Critical (must fix)

None.

Should address

1. Add the axiom: line to the PR body.

The body has no axiom line in any form, and Pavel is staff, so the line is required and axiom: needed isn't available. rulespec-us has no Virginia TANF module or issue: us-va/ holds only income tax (58.1) and CMS policies, and searches for "Virginia TANF" and "22VAC40-295" return nothing.

Recommended line. File a dispatch-ready pe-parity issue and use axiom: rulespec-us#<n> queued. The issue should have:

  • a module path such as us-va/regulations/22vac40-295/50 (no Virginia regulation is in the corpus yet, so record adding 22VAC40-295-50 as the corpus prerequisite);
  • the verbatim text of 22VAC40-295-50(C)(1)–(2) and Manual 305.1 A.2.b;
  • required outputs: the monthly standard deduction by assistance unit size (imported from the SNAP standard deduction under 7 CFR 273.9(d)(1), which us/regulations/7-cfr/273 covers) and countable earned income after the 20% disregard;
  • companion cases from the manual's own table (305.1, page dated 10/23: $198 / $208 / $244 / $279), for example a 3-person unit earning $500 in a month after October 2023: 0.8 × (500 − 198) = 241.60, and a 5-person unit: 0.8 × (500 − 244) = 204.80.

Suggestions

  1. One reference entry per document. va_tanf_countable_earned_income.py:11-16 lists the same Chapter 300 PDF twice, differing only by #page=32 and #page=52. CLAUDE.md treats those as one source and says to put a page comment above a single href. Keep …#page=32 with a # PDF pages 32, 52 comment (305.1 A.2.b and 305.3 B.3–B.4).
  2. Cite the regulation. The manual's footnote ("22 VAC 40-295-60", 305.1 page 2 and 305.3 page 16) is out of date: 22VAC40-295-60 is now "Beginning date of assistance and application processing". The disregard is in 22VAC40-295-50(C). Consider adding that URL to the variable's reference.
  3. Stale percentage.yaml. parameters/gov/states/va/dss/tanf/income/deductions/earned/percentage.yaml still says "after a flat deduction", and its only reference is the archived 11/20 manual. Now that the flat parameter is gone, say "after the standard deduction" and point the reference at the live 305.1 page (tanfview/…/Chapter-300…pdf#page=32, "20% of the remainder").
  4. Unit size comment. The new comment says "the SNAP standard deduction for the assistance unit's size", and the body quotes 305.3 B.3 ("Individuals not included in the AU will not be considered"). The code uses spm_unit_size, as every other VA TANF variable does. That's a pre-existing simplification, not a regression, but consider saying "SPM unit size (used as the assistance unit)" so the comment matches the code.
  5. Other dead links. va_tanf.py, va_tanf_countable_income.py, va_tanf_grant_standard.py, va_tanf_income_eligibility.py, va_tanf_childcare_deduction.py and dependent_care/full_time.yaml still cite the tanfx2fview path, which returns 404 (the tanfview path returns 200). A follow-up could move them, as this PR did for its own variable.

Verified correct

  • Regulation. 22VAC40-295-50(C), eff. September 1, 2004: "When determining initial eligibility, or ongoing eligibility for non-VIEW participants, the following is disregarded from the monthly earned income of the assistance unit: 1. An amount equal to the standard deduction used in the Food Stamp program; and 2. Twenty percent of the remainder." The manual's current page says "All AUs will be allowed the following deductions", so the model's treatment of every unit the same way follows the manual.
  • Manual. TANF Manual 305.1 A.2.b (page dated 10/23): "The standard deduction*, the same amount used in the standard deduction for the SNAP program, and 20% of the remainder is deducted from the gross earnings." The table shows $198 / $208 / $244 / $279, which are SNAP's FY2024 (October 2023) amounts, so the manual updates on SNAP's October 1 cycle. 305.3 B.3–B.4: "A standard deduction is subtracted from the gross earned income for the assistance unit" and "After applying the disregards in items 1-3, deduct 20% of the remaining earned income".
  • Order of operations. Appendix 3, Step 2 (PDF p. 88): (b) deduct the standard deduction, (c) "Deduct 20% of the remainder", (d) deduct care expenses, (e) "Add any unearned income". The formula and va_tanf_countable_income follow that order.
  • The old values. $167 / $178 / $209 / $240 are SNAP's 2019-10-01 values in standard.yaml, as the body says.
  • Timing. parameters(period) on a MONTH variable reads the instant at the start of each month, so October 1 switches are applied month by month. The 2023 annual cases split January–September (FY2023: 193 / 193 / 225 / 258) from October–December (FY2024: 198 / 208 / 244 / 279). All new monthly cases use January, so the non-January month-period issue doesn't arise, and tanf_gross_earned_income is a MONTH variable.
  • Hand-checked expectations (14).
    • Zero earnings → 0. 2023, $1,500 a year: 125 a month < 193 and 198 → 0.
    • 2023, size 3, $5,004: 0.8 × (5,004 − 9 × 193 − 3 × 198) = 0.8 × 2,673 = 2,138.40.
    • 2023, size 6, $8,880: 0.8 × (8,880 − 9 × 258 − 3 × 279) = 0.8 × 5,721 = 4,576.80.
    • 2023, size 4, $5,136: 0.8 × (5,136 − 9 × 193 − 3 × 208) = 0.8 × 2,775 = 2,220.
    • 2023, size 5, $5,508: 0.8 × (5,508 − 9 × 225 − 3 × 244) = 0.8 × 2,751 = 2,200.80.
    • 2023, size 1, $2,316: 193 a month, exactly the deduction in January–September and below 198 in October–December → 0.
    • 2023, size 2, $3,004 with a 1-year-old and $2,400 of care: after the deduction and 20%, 45.87 and 41.87 a month; the care disregard is min(200, 200) = 200 for a child under 2 → 0.
    • 2023, size 3, $10,000 from two earners: 0.8 × (10,000 − 1,737 − 594) = 0.8 × 7,669 = 6,135.20.
    • January 2025, size 3, $500: 0.8 × (500 − 204) = 236.80. January 2026: 0.8 × (500 − 209) = 232.80.
    • January 2025, size 4: 0.8 × (500 − 217) = 226.40. Size 7 (capped at 6): 0.8 × (500 − 291) = 167.20.
    • January 2025, size 2, $150 < 204 → 0.
  • Callers. No file at the head or on main reads gov.states.va.dss.tanf.income.deductions.earned.flat. programs.yaml's gov.states.va.dss.tanf prefix still resolves.
  • Changelog. changelog.d/fix-9986-va-tanf-snap-standard-deduction.fixed.md is a top-level fragment with the fixed type.
  • Source-conflict ratchet (Tie source-conflict markers to the register shared with Axiom #10287). The added comments ("The SNAP table stops at six members.", the step comments and the test arithmetic) match neither CONFLICT_COMMENT_RE nor ATTEMPT_RE, and the run started 2026-10-23, after Tie source-conflict markers to the register shared with Axiom #10287 and Count the FL and SD LIHEAP comments in the source-conflict ratchet baseline #10334. The PR validation job is green.
  • Partner tests. No files under tests/policy/baseline/partners/** are touched, and Household API Partners passes.

Axiom line assessment

There is no axiom: line (checked in every format), which is a SHOULD (Should 1). rulespec-us has no Virginia TANF module or issue, so encoded-correct isn't available. The recommended line is a new dispatch-ready pe-parity issue for 22VAC40-295-50(C), marked queued, recording the corpus prerequisite.

CI status

All 29 checks pass at 39339e7975 (gh pr checks 10247), including the four Baseline states shards, Quick Feedback and both codecov checks. None is pending or failing.

Branch status

The branch is 2 commits ahead of main (one change and a merge of main on 2026-10-23) and 7 behind. git merge-tree --write-tree PolicyEngine/main 39339e7975 merges cleanly. Main hasn't changed any Virginia TANF file or the SNAP standard deduction parameter since the merge base. The body notes that #9987 and #9985 also edit Virginia TANF in other files.

Verdict: REQUEST_CHANGES

@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.

The change is correct: 22VAC40-295-50(C) ties the disregard to the SNAP standard deduction, plus 20% of the remainder, the Appendix 3 order matches, and the October 1 switch works in every year; all 14 expectations hand-check. One should-address item: there's no axiom line, and rulespec-us has no VA TANF module, so please file a dispatch-ready pe-parity issue for 22VAC40-295-50(C) and mark it queued. Five suggestions (reference consolidation, citations, wording). Full report in the comment above.

This branch has not been deployed

No deployments
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.

Virginia TANF: va_tanf_countable_earned_income deducts SNAP's FY2020 standard deduction; Virginia uses the SNAP standard deduction in effect

2 participants