Skip to content

Backdate TANF non-cash BBCE parameters to FY2016 and fix CO bug#7852

Merged
hua7450 merged 7 commits intoPolicyEngine:mainfrom
hua7450:backdate-snap-bbce
Mar 25, 2026
Merged

Backdate TANF non-cash BBCE parameters to FY2016 and fix CO bug#7852
hua7450 merged 7 commits intoPolicyEngine:mainfrom
hua7450:backdate-snap-bbce

Conversation

@hua7450
Copy link
Collaborator

@hua7450 hua7450 commented Mar 24, 2026

Summary

Backdates 5 TANF non-cash (BBCE) parameter files from 2020-07-01 to 2015-10-01, enabling SNAP BBCE categorical eligibility simulations for years before 2020. Also fixes bugs where Colorado was incorrectly marked as non-BBCE and Mississippi was missing from cross-file entries during its BBCE period.

Note: Many states adopted BBCE well before 2015 (some as early as 2000). This PR uses 2015-10-01 (FY2016) as the floor to align with the SNAP allotment/deduction parameter coverage from PR #7851. Further backdating to actual adoption dates is possible using the ERS SNAP Policy Database.

Data Sources

  • USDA ERS SNAP Policy Database — monthly state-by-state BBCE data 1996-2020 (download)
  • SNAP Screener data — current net income test values, cross-validated against existing YAML
  • 14th SNAP State Options Report (May 2018) — confirms BBCE adoption list
  • USDA BBCE States Chart — current BBCE status (link)

Parameters Updated (5 files)

File Changes
income_limit/gross.yaml Push back to 2015-10-01 + 8 mid-period state changes; removed redundant CO 2022-11-30 entry
asset_limit.yaml Push back to 2015-10-01 + IN, MI, LA, MS changes + CO fix; fixed broken reference URL; added missing period metadata
requires_all_for_hheod.yaml Push back + WV change (all→any Jul 2018); added missing unit/period metadata
net_applies/hheod.yaml Push back + IN (2018), LA (2020), MS (2015-2019) BBCE; added missing unit/period metadata
net_applies/non_hheod.yaml Push back + IN (2018), LA (2020), MS (2015-2019) BBCE; added missing unit/period metadata

Mid-Period State Changes (from ERS database)

State Date Change
IL Jan 2016 Gross income 130% → 165%
IN Jan 2018 Adopted BBCE (130%, $5K asset limit, net test applies)
CO Jun 2018 Gross income 130% → 200%
WV Jul 2018 Gross income 130% → 200%, requires-all → any for HHEOD
MS Jul 2019 Dropped BBCE entirely
MI Dec 2019 Asset limit $5K → $15K
LA Apr 2020 Adopted BBCE (130%, no asset limit, net test applies)
KY May 2020 Gross income 130% → 200%

Bug Fixes

  • CO was marked as -.inf (non-BBCE) at 2020-07-01 in both gross.yaml and asset_limit.yaml. ERS data shows CO had BBCE with 130% FPL gross income limit and no asset test since at least October 2015, increasing to 200% FPL in June 2018.
  • MS was missing from asset_limit.yaml, hheod.yaml, and non_hheod.yaml during its BBCE period (Oct 2015 – Jul 2019). ERS data shows MS had BBCE with no asset limit and no net income test. Added consistent entries across all files.

Cleanup

  • Removed redundant CO 2022-11-30 entries (same values as earlier dates, kept regulatory ref as comment)
  • Removed outdated "May have changed" comments for CO
  • Fixed broken asset_limit.yaml reference URL (dead .net CDN → FNS landing page)
  • Added missing unit and period metadata fields across 4 files

Test plan

  • Existing SNAP tests pass (251 passed locally)
  • Microsimulation passes
  • Spot-check: CO 2017 should have BBCE at 130% FPL
  • Spot-check: IN 2017 should NOT have BBCE; IN 2019 should have BBCE at 130%
  • Spot-check: MS 2018 should have BBCE at 130%; MS 2020 should NOT have BBCE

🤖 Generated with Claude Code

Pushes 5 TANF non-cash (BBCE) parameter start dates from 2020-07-01
back to 2015-10-01, using USDA ERS SNAP Policy Database (monthly
state-by-state data 1996-2020) and SNAP Screener data for net income
test values.

Adds 8 mid-period state changes:
- IL Jan 2016: gross income 130% → 165%
- IN Jan 2018: adopted BBCE (130%, $5K asset, net test)
- CO Jun 2018: gross income 130% → 200%
- WV Jul 2018: gross income 130% → 200%, requires-all → any
- MS Jul 2019: dropped BBCE
- MI Dec 2019: asset limit $5K → $15K
- LA Apr 2020: adopted BBCE (130%, no asset limit, net test)
- KY May 2020: gross income 130% → 200%

Fixes CO bug: was marked as non-BBCE (-.inf) at 2020-07-01 but ERS
data shows CO had BBCE with 130% since at least Oct 2015, increasing
to 200% in Jun 2018.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.46%. Comparing base (9b5a10c) to head (941b142).
⚠️ Report is 284 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##              main    #7852       +/-   ##
============================================
- Coverage   100.00%   71.46%   -28.54%     
============================================
  Files            5     4099     +4094     
  Lines           91    59132    +59041     
  Branches         3      288      +285     
============================================
+ Hits            91    42257    +42166     
- Misses           0    16869    +16869     
- Partials         0        6        +6     
Flag Coverage Δ
unittests 71.46% <ø> (-28.54%) ⬇️

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.

…adata fields

- Add MS to asset_limit (.inf during BBCE), hheod, and non_hheod (false)
- Remove redundant CO 2022-11-30 entries, keep regulatory ref as comment
- Remove outdated "May have changed" comments for CO
- Fix broken asset_limit reference URL (.net CDN → FNS landing page)
- Add missing unit/period metadata to hheod, non_hheod, requires_all_for_hheod
- Add missing period to asset_limit metadata

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hua7450 hua7450 requested a review from PavelMakarchuk March 25, 2026 03:51
hua7450 and others added 4 commits March 24, 2026 23:52
…AK entry

- Fix VA: was incorrectly marked BBCE from 2015; ERS confirms non-BBCE through
  Sep 2020, adopted around Jul 2021. Updated all 4 files.
- Fix trailing whitespace in requires_all_for_hheod.yaml
- Remove redundant ID entry with non-standard date (2024-07-02)
- Add ERS SNAP Policy Database reference to 4 files missing it
- Fix comment typo in gross.yaml ("asset limit" → "gross income limit")
- Add AK asset_limit entry for 2025-07-01 to match gross.yaml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ative

Two bugs fixed:
1. mt_regular_income_tax: only subtract LTCG from taxable income when
   net capital gains (STCG + LTCG) are positive. When STCG losses
   exceed LTCG, all income should be taxed at ordinary rates.
2. mt_capital_gains_tax_joint: convert from Person to TaxUnit entity
   to fix mismatch where LTCG and taxable income are on different
   persons in joint filing, causing both to get $0 CG tax.

Closes PolicyEngine#7859

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Integration tests:
- Positive net CG with STCG losses: confirms preferential rates still apply
- LTCG on head, wages on spouse: confirms TaxUnit aggregation works cross-person
- Both spouses with LTCG: confirms combined LTCG aggregation

Unit tests:
- Negative net CG: confirms $0 CG tax when STCG losses exceed LTCG
- Positive net CG with STCG losses: confirms full LTCG gets preferential rates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 4 gross income tests: CO BBCE at 200%, CO above limit, MS non-BBCE,
  IN BBCE at 130% — covering the CO and MS bug fixes
- Add 3 asset tests: MS non-BBCE fails, IN below/above $5K limit
- Improve ERS reference titles with specific column names across all 5 files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk marked this pull request as draft March 25, 2026 18:45
These MT changes were accidentally merged into this branch and belong
in a separate PR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk marked this pull request as ready for review March 25, 2026 18:58
@hua7450 hua7450 merged commit c503463 into PolicyEngine:main Mar 25, 2026
8 of 9 checks passed
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.

2 participants