Skip to content

Fix asset stock period handling#8298

Merged
MaxGhenis merged 8 commits into
mainfrom
fix-snap-asset-stock-period
May 14, 2026
Merged

Fix asset stock period handling#8298
MaxGhenis merged 8 commits into
mainfrom
fix-snap-asset-stock-period

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented May 14, 2026

Summary

  • Mark household asset, property value, SNAP asset, Pell asset, and selected state asset variables as stock quantities so monthly formulas do not divide balances by 12.
  • Remove an Illinois AABD vehicle-value workaround that multiplied a vehicle stock by 12.
  • Model Texas SNAP BBCE excess vehicle value in the TANF non-cash asset test and remove the stale "not modeled" note.
  • Periodize the Texas vehicle exemption at $15,000 before September 1, 2023 and $22,500 afterward, citing Texas HB 1287 and the Texas Works Handbook.
  • Add regression coverage for SNAP asset stocks and Texas BBCE vehicle assets.

Fixes #8300.

Context

PolicyBench error review found cases where SNAP categorical eligibility used monthly TANF non-cash asset tests. Because asset balances were treated as annual flows, a $15,000 asset balance appeared as $1,250 in monthly formulas and could incorrectly pass state asset tests.

The same review also surfaced a separate Texas SNAP BBCE gap: PE-US documented that excess vehicle value above the Texas vehicle exemption was not modeled for the TANF non-cash asset test used by SNAP BBCE. This PR models excess vehicle value using household vehicle value and the Texas exemption. The current Texas exemption is $22,500 for the first vehicle under HB 1287, effective September 1, 2023; $15,000 remains as the historical pre-HB 1287 value.

PolicyEngine Core already preserves stock quantities across periods when variables declare quantity_type = STOCK, so the period-handling fix is in PE-US rather than core.

Related PolicyBench prompt follow-up: PolicyEngine/policybench#19.

Tests

  • uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/hhs/tanf/non_cash/meets_tanf_non_cash_asset_test.yaml policyengine_us/tests/policy/baseline/gov/usda/snap/eligibility/snap_assets.yaml -c policyengine_us
  • uv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/hhs/tanf/non_cash policyengine_us/tests/policy/baseline/gov/usda/snap/eligibility -c policyengine_us
  • uv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/states/dc/dhs/ccsp/eligibility/dc_ccsp_asset_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/il/dhs/aabd/asset/il_aabd_asset_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/il/dhs/aabd/asset/il_aabd_countable_vehicle_value.yaml policyengine_us/tests/policy/baseline/gov/states/il/hfs/hbwd/asset/il_hbwd_countable_assets.yaml policyengine_us/tests/policy/baseline/gov/states/il/hfs/hbwd/eligibility/il_hbwd_asset_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/ma/dta/tcap/eaedc/eligibility/financial/ma_eaedc_assets_limit_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/ma/eec/ccfa/eligibility/ma_ccfa_asset_eligible.yaml -c policyengine_us
  • uv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/states/tn/dhs/ff/tn_ff_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/wa/dshs/tanf/wa_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/tx/tanf/resources/tx_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/wi/dcf/works/wi_works_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/local/ca/la/general_relief/eligible/la_general_relief_motor_vehicle_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/local/ca/riv/general_relief/ca_riv_general_relief_countable_vehicle_value.yaml policyengine_us/tests/policy/baseline/gov/states/ca/cdss/tanf/cash/eligibility/ca_tanf_vehicle_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/resources/ca_capi_countable_vehicle_value.yaml policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/resources/ca_capi_resources.yaml policyengine_us/tests/policy/baseline/gov/states/mt/dhs/tanf/eligibility/mt_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/nm/hca/nm_works/resources/nm_works_countable_non_liquid_resources.yaml policyengine_us/tests/policy/baseline/gov/states/nm/hca/nm_works/resources/nm_works_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/dc/dhs/tanf/eligibility/dc_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/in/fssa/tanf/resources/in_tanf_countable_resources.yaml -c policyengine_us
  • uv run --frozen python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/local/ca/ala/eligibility/ca_ala_general_assistance_personal_property_eligible.yaml policyengine_us/tests/policy/baseline/gov/local/ca/la/general_relief/eligible/la_general_relief_personal_property_eligible.yaml policyengine_us/tests/policy/baseline/gov/local/ca/la/general_relief/eligible/la_general_relief_home_value_eligible.yaml policyengine_us/tests/policy/baseline/gov/states/wa/dshs/tanf/wa_tanf_countable_resources.yaml policyengine_us/tests/policy/baseline/gov/states/wv/tax/income/credits/sctc/wv_sctc.yaml policyengine_us/tests/policy/baseline/gov/states/wv/tax/income/exemptions/homestead_exemption/wv_homestead_exemption.yaml policyengine_us/tests/policy/baseline/gov/irs/integration/qbid.yaml policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/qualified_business_income_deduction_person.yaml policyengine_us/tests/policy/baseline/gov/irs/tax/estate/estate_tax.yaml policyengine_us/tests/policy/baseline/gov/irs/tax/estate/estate_tax_before_credits.yaml policyengine_us/tests/policy/baseline/gov/irs/credits/estate/estate_tax_credit.yaml -c policyengine_us
  • uv run --frozen ruff format --check
  • uv run --frozen ruff check

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.56%. Comparing base (8cb60e7) to head (efc0af4).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main    #8298      +/-   ##
===========================================
- Coverage   100.00%   97.56%   -2.44%     
===========================================
  Files            3       38      +35     
  Lines           63      452     +389     
  Branches         0        3       +3     
===========================================
+ Hits            63      441     +378     
- Misses           0       10      +10     
- Partials         0        1       +1     
Flag Coverage Δ
unittests 97.56% <100.00%> (-2.44%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@MaxGhenis MaxGhenis enabled auto-merge (squash) May 14, 2026 18:21
@MaxGhenis MaxGhenis merged commit 815fe9e into main May 14, 2026
24 of 25 checks passed
@MaxGhenis MaxGhenis deleted the fix-snap-asset-stock-period branch May 14, 2026 19:07
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.

Model state SNAP vehicle asset rules where applicable

1 participant