Repository navigation
Explain Head Start and school meals without SNAP on the cliff chart - #48
Merged
Merged
Conversation
…ead Start and school meals policyengine-us makes a family categorically eligible for Head Start, Early Head Start and free school meals for the whole year once it gets SNAP in any month, so CliffWatch counts a full year of each, including the months before the family's SNAP starts. The chart now says so when a household gets SNAP and one of these programs at the same earnings level. The note stays until CliffWatch runs a policyengine-us release with PolicyEngine/policyengine-us#10766, which counts these programs from the first month of SNAP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/api/series and buildSeriesDataFromResponse both put each program's annual value under its own key on the point (point.snap, point.head_start), the way chartModel reads them. The note looked under point.programs, which neither returns, so it never showed. The tests now build points in that shape, include two points from a real Georgia series, and feed the note a series from buildSeriesDataFromResponse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
/api/series now lists each point's months of SNAP (snap_months) and the programs the household gets for the whole year only through those months (part_year_snap_programs). A program counts at a point with SNAP in 1 to 11 months and no TANF or SSI, where the household would miss it without categorical eligibility: a child fails Head Start's income test, or the household's income exceeds the free-meal limit in a state without universal free meals. The chart note now names those wages and programs, and says when the household's SNAP starts. For a Georgia single parent of a 4-year-old in ZIP 30303, SNAP starts in October from $27,500 to $28,000, beside $13,086 of Head Start, and the chart reads January's SNAP, so it shows Head Start without SNAP there. tests/test_part_year_snap.py pins that window on policyengine-us 1.755.5 and checks each mark against the engine rerun with categorical eligibility turned off, for five households. The note's tests use a series captured from this branch and a fast-check property. The README explains the January read, and the builder test in policyengineApi.test.js goes, since the app reads /api/series. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The part-year SNAP marks copied the engine's other eligibility routes by hand and missed two of them. A child eligible for Head Start makes the household categorically eligible for free school meals, and SSI gives no categorical eligibility for school meals. When some point gets SNAP in 1 to 11 months, calculate_income_series now reruns the series with SNAP take-up off and marks a program only where it falls. The test compares every mark with that SNAP-off run and adds four households: a parent on SSDI, an 8-year-old on SSI, a 4-year-old on SSI, and a Georgia parent of a 7-year-old. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rerun adds most of a second to a series call. A program the user left off the chart shows no mark, and free school meals can't fall where state_has_universal_free_school_meals holds, so a series whose only candidates are those now skips it. tests/test_part_year_snap_rerun.py pins the marks, the rerun's situation and the skips on a stub engine. New engine tests cover a deselected program, a California series and, in each universal-meal state, free meals that SNAP doesn't move. The SSI test comment and module docstring take review r3's wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 of 11 tasks
_part_year_snap_by_point's only caller passes included_programs, so the argument loses a default that no code or test used. The stub test now compares the rerun's situation with the caller's plus SNAP take-up off, instead of checking two of its keys. The California test's docstring names the two programs the household doesn't get. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
November 13, 2026 22:34
This branch was successfully 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.
If a household gets SNAP in any month, policyengine-us treats it as categorically eligible for Head Start, Early Head Start and free school meals for the whole year.
is_head_start_categorically_eligibleandmeets_school_meal_categorical_eligibilityboth add up SNAP over the year, in 1.755.5, which production runs, and in 2.2.1, which #45 moves to. CliffWatch charts January's SNAP for all twelve months, and USDA updates SNAP's income limits and benefits each October. So just past SNAP's January limits, a household can get SNAP from October and a full year of these programs, with no SNAP on the chart. In PolicyEngine/policyengine-us#10766, we propose counting these programs from a household's first month of SNAP.Until CliffWatch charts SNAP's annual sum or runs a policyengine-us release with that change, it adds a note under the cliff chart at those wages. For example, a Georgia single parent of a 4-year-old in ZIP 30303 sees this note:
snapMonthNotenames the wages and programs that/api/seriesmarks for that household. When SNAP starts in another month, the note leaves out the USDA clause. When the household gets SNAP in January, the note says only that it gets SNAP in part of the year.Changes
/api/seriespoint lists the months the household gets SNAP (snap_months) and the programs it gets for the whole year only through those months (part_year_snap_programs).calculate_income_seriesmarks a program at a point where the household gets it and gets SNAP in 1 to 11 months. It then turns SNAP off, reruns the engine and keeps the mark only where the program falls. In that run, policyengine-us still applies every other route into these programs, such as their income tests, TANF, SSI and a child's Head Start eligibility.frontend/src/utils/snapMonthNote.jsbuilds the note from those fields, andResultsPanelrenders it with the chart's other notes.With #45
#45 moves CliffWatch to
pe.us.calculate_household, which returns yearly values only. There,point.snapholds SNAP's annual sum, and CliffWatch can't read SNAP by month, so it can't fillsnap_monthsorpart_year_snap_programs. For the household above, #45's chart shows $759.84 of SNAP beside $13,086 of Head Start at $27,500.tests/test_part_year_snap.pyfails on #45 until we rework or drop the note.Tests
tests/test_part_year_snap.pypins the household above from $26,500 to $29,000 on policyengine-us 1.755.5. The household gets SNAP all year at $27,000, SNAP from October with $13,086 of Head Start at $27,500 and $28,000, and neither from $28,500.tests/test_part_year_snap_rerun.pyruns_part_year_snap_by_pointon a stub engine, so it needs no policyengine-us release. It pins a mark at one month of SNAP and at eleven, and at a fall of 50 cents, but not at a fall under a cent. It also checks that the rerun changes nothing in the situation but SNAP take-up, leaves the caller's copy alone, and runs only where a program on the chart could fall. We made ten small changes to the function's month bounds, tolerance, take-up year, copy of the situation and skips, and each one fails at least one of these tests.snapMonthNote.test.jschecks the note against a series we captured for the household above, and against hand-built series for each program and for several wage ranges and patterns of SNAP months. A fast-check property confirms that the note appears if and only if some point marks a program it carries. It also confirms that the note:bunx vitest run: 109 passed, 4 skipped.pytest tests/test_part_year_snap.py tests/test_part_year_snap_rerun.py: 28 passed. CI at this head ran 315 Python tests and 109 frontend tests, and all passed.axiom: n/a: a UI note and API fields that change no policy rule
🤖 Generated with Claude Code