Conversation
… rounding Build the gross and net income standards for households larger than eight from the eight-person standard plus a separately rounded-up per-person increment, per 7 CFR 273.9(a)(3), matching the USDA FNS tables. Previously the model rounded up the whole product, leaving the standards $1-$3 low for households of nine or more. Round SNAP net income to cents before the half-up step so single-precision error cannot round an exact 50-cent amount down (7 CFR 273.10(e)(1)(ii)(A)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9587 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 6 +2
Lines 76 95 +19
Branches 2 1 -1
=========================================
+ Hits 76 95 +19
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:
|
Both cases have net income of exactly $X.50 in January-September 2026 ($686.50 and $540.50). The pins recorded the single-precision artifact that rounded these down; with half-up rounding they round up, the 30 percent contribution rises by $1, and the annual SNAP total falls by $9. Updated with user confirmation after team and partner notification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
amplifi_2026_case_b has net income of exactly $X.50 in January-September 2026. With half-up rounding it rounds up, the 30 percent contribution rises by $1, and the annual SNAP total falls by $9 ($1,940.17 to $1,931.17). Updated with user confirmation after team and Amplifi notification. The full partner test folder passes locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hangelog bullet Move the size-9-and-up SNAP gross and net income test cases off Missouri so each case uses a different contiguous state (MO, TX, IL, CO, KS, WA, NC; the TANF non-cash case stays in CA, the only one of these states that applies the net test). Add a twelve-person net case $1 above the limit and a twelve-person gross case at the $8,251 limit. Drop the leading "- " from the changelog fragment so towncrier does not render a double bullet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into fix-snap-income-standard-rounding
This branch has not been deployed
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
Fixes two SNAP rounding errors found while auditing the model's rounding against 7 CFR 273.9 and 273.10:
snap_net_incomeapplies half-up rounding withnp.floor(x + 0.5), but single-precision error stores some exact $X.50 amounts as $X.4999, which then rounded down.Legal basis
The statute (7 U.S.C. 2014(c)) sets the standards at the poverty line and 130 percent of it without a monthly conversion or rounding rule; the regulation fills that gap, and the published FNS tables follow it.
Changes
snap_income_standard_helpers.pywith:snap_monthly_fpg_amounts: the October 1 poverty-guideline lookup, moved out ofsnap_fpg(behavior unchanged).snap_monthly_income_standard: the 7 CFR 273.9(a)(3) standard. It still readssnap_fpg, so inputs that overridesnap_fpgkeep setting the standard.gov.usda.snap.income.limit.increment_household_size_threshold(8).meets_snap_gross_income_test,meets_snap_net_income_test, andmeets_tanf_non_cash_net_income_testuse the shared standard.snap_net_incomerounds to cents before the half-up step, matching the guardsnap_expected_contributionalready uses.FY 2026 standards (before → after)
Impact
Tests
New YAML cases. The large-household cases each use a different state; every one of these states uses the 48-state guideline, so the limits are the same in all of them.
meets_snap_net_income_test:meets_snap_gross_income_test:meets_tanf_non_cash_net_income_test: nine-person household at $4,972 passes (CA). The case stays in California because it is the only one of these states that applies the TANF non-cash net income test in 2026.snap_net_income: $1,305.50 rounds to $1,306; $1,305.49 rounds to $1,305.Every passing large-household case would fail on
main, whose limits are $1 to $3 lower.Partner contract tests (updated with approval)
Three SNAP pins under
tests/policy/baseline/partners/had net income of exactly $X.50 in January–September 2026. The two analytics-coverage comments recorded the single-precision artifact ("686.4998 unrounded, so it rounds to 686"). With half-up rounding, net income rounds up, the 30 percent contribution rises by $1, and each annual total falls by $9:analytics_coverage/edge_cases/federal/nutrition/snap/federal.yamlsnap_limited_utility_allowance_two_utilitiesanalytics_coverage/edge_cases/federal/nutrition/snap/il.yamlsnap_il_sua_shelter_deduction_20kamplifi/2026.yamlamplifi_2026_case_bThe team and each affected API partner, including Amplifi, were notified before these pins were updated. The full partner test folder (
make test-yaml-no-structural-other-partners, 620 tests) passes locally on this branch.Test plan
ruff formatandruff checkpass🤖 Generated with Claude Code