Skip to content

Skip SNAP student TANF checks for non-students#8763

Draft
anth-volk wants to merge 1 commit into
mainfrom
codex/snap-student-tanf-guard
Draft

Skip SNAP student TANF checks for non-students#8763
anth-volk wants to merge 1 commit into
mainfrom
codex/snap-student-tanf-guard

Conversation

@anth-volk

Copy link
Copy Markdown
Contributor

Fixes #8762

Summary

  • Add defined_for = "is_snap_higher_ed_student" to is_snap_ineligible_student.
  • Add a trace regression test proving non-higher-ed people do not request tanf_person or tanf through SNAP student ineligibility.
  • Add a changelog fragment.

Runtime impact

Before this change, a traced single-household calculation for a non-college adult returned False for is_snap_ineligible_student but still requested tanf_person once. That can pull the broader TANF tree, including county-related work, into households where the SNAP student ineligibility rule cannot apply.

After this change, is_snap_ineligible_student is only calculated for people where is_snap_higher_ed_student is true. The new trace test asserts zero tanf_person and tanf requests for a non-higher-ed person. Existing behavior for higher-ed students, including the TANF exception, is preserved.

Tests

  • ./.venv/bin/python -m pytest policyengine_us/tests/core/test_snap_student_tanf_dependency.py
  • ./.venv/bin/python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/usda/snap/eligibility/student/is_snap_ineligible_student.yaml -c policyengine_us
  • make format
  • Broader SNAP baseline run reported 315 passed, 1 warning; the command wrapper stayed attached after the pass summary, so it was interrupted after the success output.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (194d129) to head (09f823f).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #8763    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           11         1    -10     
  Lines          171        20   -151     
==========================================
- Hits           171        20   -151     
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.

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.

Avoid TANF calculation for non-students in SNAP student eligibility

1 participant