Fix SNAP rounding for income limits and minimum allotment - #9162
Merged
Conversation
Compare gross and net test income against the published whole-dollar standards (130%/100% of the monthly poverty guideline, rounded up per 7 CFR 273.9(a)(3)) instead of unrounded FPG ratios, so households at the published limits (e.g. $2,888/$2,221 for size 3 in FY2026) are eligible. Round the minimum allotment (8% of the one-person maximum) to the nearest whole dollar per 7 CFR 273.10(e)(2)(ii)(C), $23.84 -> $24 in FY2026. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rewrite the net income test YAML to drive the formula through snap_net_income and snap_fpg, add round-up boundary cases at the published FY 2026 limits in a non-BBCE state (MO), and pin the nearest-dollar minimum allotment in both directions (FY 2025 $23.36 down to $23, FY 2026 $23.84 up to $24). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9162 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 49 63 +14
Branches 0 3 +3
=========================================
+ Hits 49 63 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The minimum allotment now rounds to the nearest whole dollar, so the calendar-2026 stream for a 1-person unit is 9 x $24 + 3 x $25 = $291 instead of the unrounded $288.61. Update the work-requirement Case 2 pin and the two partner edge-case pins accordingly, and rewrite the abolish_snap_net_income_test contrib test to drive the formula through snap_net_income and snap_fpg instead of the retired ratio input. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hua7450
marked this pull request as ready for review
July 28, 2026 04:12
The md in_effect guard never evaluated False in any tested period, leaving a partial branch in coverage. Pin the FY 2016 federal minimum ($15.52 rounding to $16) for a Maryland household before the state supplement took effect on 2016-10-01. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PolicyEngine compared unrounded income-to-poverty ratios against 1.3 / 1.0 and paid an unrounded minimum allotment. USDA rounds both: monthly income eligibility standards round up to the next whole dollar, and the minimum allotment rounds to the nearest whole dollar. Households at exactly the published limit therefore failed the tests in PolicyEngine and received $0 instead of a positive benefit.
Legal basis (verified against statute and regulation text)
ceil(1.3 × monthly FPG)ceil(monthly FPG)round(0.08 × one-person max)The statute (7 U.S.C. 2014(c)) contains no rounding rule for the income standards; the regulation supplies it.
Verification against USDA published values
np.roundhalf-to-even is safe here: 8% of an integer allotment always has a fractional part that is a multiple of $0.04, so an exact 50-cent tie cannot occur.Implementation notes
snap_fpgstays unrounded because rounding does not commute with the 130% multiplication andsnap_fpgalso feeds BBCE.Known limitations (documented, not fixed here)
meets_tanf_non_cash_*) still compares unrounded ratios — same class of issue, left for a follow-up.Test plan
meets_snap_net_income_test.yamlto drive the formula throughsnap_net_incomeandsnap_fpg(the ratio variable is no longer read by the formula but remains for BBCE).🤖 Generated with Claude Code