From 92febe7d9b1fdb6046570f9f31640fa43482d5bd Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 13 Nov 2026 08:23:58 -0500 Subject: [PATCH 1/7] Correct school meal countable income Co-Authored-By: Claude Opus 5.5 --- .../school-meal-countable-income.fixed.md | 1 + .../ca/calepa/carb/cvrp/income/sources.yaml | 32 + .../states/tx/dta/csfp/income/sources.yaml | 32 + .../gov/usda/csfp/income/sources.yaml | 32 + .../school_meals/income/business_sources.yaml | 15 + .../gov/usda/school_meals/income/sources.yaml | 21 +- .../income/state_supplement_sources.yaml | 57 + .../core/test_school_meal_countable_income.py | 171 +++ .../is_ca_cvrp_increased_rebate_eligible.yaml | 12 +- .../gov/states/ks/dcf/csfp/integration.yaml | 64 +- .../ks_dcf_csfp_categorically_eligible.yaml | 3 +- .../or_ssp_countable_for_school_meals.yaml | 72 + .../dta/csfp/tx_dta_csfp_income_eligible.yaml | 6 +- .../commodity_supplemental_food_program.yaml | 18 +- ...ty_supplemental_food_program_eligible.yaml | 84 +- .../gov/usda/csfp/csfp_countable_income.yaml | 97 ++ .../school_meal_countable_income.yaml | 1206 +++++++++++++++++ .../carb/cvrp/ca_cvrp_countable_income.py | 16 + .../is_ca_cvrp_increased_rebate_eligible.py | 4 +- .../ssp/or_ssp_countable_for_school_meals.py | 32 + .../dta/csfp/tx_dta_csfp_countable_income.py | 16 + .../dta/csfp/tx_dta_csfp_income_eligible.py | 3 +- ...dity_supplemental_food_program_eligible.py | 5 +- .../gov/usda/csfp/csfp_countable_income.py | 16 + .../school_meal_countable_income.py | 14 +- source_conflicts/candidates.yaml | 38 + 26 files changed, 1995 insertions(+), 72 deletions(-) create mode 100644 changelog.d/school-meal-countable-income.fixed.md create mode 100644 policyengine_us/parameters/gov/states/ca/calepa/carb/cvrp/income/sources.yaml create mode 100644 policyengine_us/parameters/gov/states/tx/dta/csfp/income/sources.yaml create mode 100644 policyengine_us/parameters/gov/usda/csfp/income/sources.yaml create mode 100644 policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml create mode 100644 policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml create mode 100644 policyengine_us/tests/core/test_school_meal_countable_income.py create mode 100644 policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml create mode 100644 policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/ca_cvrp_countable_income.py create mode 100644 policyengine_us/variables/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.py create mode 100644 policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_countable_income.py create mode 100644 policyengine_us/variables/gov/usda/csfp/csfp_countable_income.py diff --git a/changelog.d/school-meal-countable-income.fixed.md b/changelog.d/school-meal-countable-income.fixed.md new file mode 100644 index 00000000000..06ae1a569d7 --- /dev/null +++ b/changelog.d/school-meal-countable-income.fixed.md @@ -0,0 +1 @@ +Corrected school meal income exclusions, business loss floors, and recurring state cash supplements while separating CSFP and CVRP income calculations. diff --git a/policyengine_us/parameters/gov/states/ca/calepa/carb/cvrp/income/sources.yaml b/policyengine_us/parameters/gov/states/ca/calepa/carb/cvrp/income/sources.yaml new file mode 100644 index 00000000000..abe9c96c1e8 --- /dev/null +++ b/policyengine_us/parameters/gov/states/ca/calepa/carb/cvrp/income/sources.yaml @@ -0,0 +1,32 @@ +description: >- + Income sources the model includes in its California CVRP approximation pending a + separate review of program income rules. + +values: + 2009-01-01: + - employment_income + - self_employment_income + - sstb_self_employment_income + - dividend_income + - interest_income + - gi_cash_assistance + - child_support_received + - social_security + - ssi + - tanf + - general_assistance + - pension_income + - survivor_benefits + - financial_assistance + - miscellaneous_income + - veterans_benefits + - total_unemployment_compensation + - strike_benefits + - rental_income + - retirement_distributions + - educational_assistance + +metadata: + reference: + - title: CVRP Implementation Manual, pages 12-15 and 38 + href: https://cleanvehiclerebate.org/sites/default/files/docs/nav/transportation/cvrp/documents/CVRP-Implementation-Manual.pdf#page=12 diff --git a/policyengine_us/parameters/gov/states/tx/dta/csfp/income/sources.yaml b/policyengine_us/parameters/gov/states/tx/dta/csfp/income/sources.yaml new file mode 100644 index 00000000000..8b963a39814 --- /dev/null +++ b/policyengine_us/parameters/gov/states/tx/dta/csfp/income/sources.yaml @@ -0,0 +1,32 @@ +description: >- + Income sources the model includes in its Texas CSFP approximation pending a + separate review of program exclusions. + +values: + 2009-01-01: + - employment_income + - self_employment_income + - sstb_self_employment_income + - dividend_income + - interest_income + - gi_cash_assistance + - child_support_received + - social_security + - ssi + - tanf + - general_assistance + - pension_income + - survivor_benefits + - financial_assistance + - miscellaneous_income + - veterans_benefits + - total_unemployment_compensation + - strike_benefits + - rental_income + - retirement_distributions + - educational_assistance + +metadata: + reference: + - title: Texas CSFP Handbook, Section 3, pages 14-15 + href: https://squaremeals.org/Portals/8/FND%20Forms/Program%20Handbooks/CSFP_Section_3_Managing_Program_V700_260410.pdf#page=14 diff --git a/policyengine_us/parameters/gov/usda/csfp/income/sources.yaml b/policyengine_us/parameters/gov/usda/csfp/income/sources.yaml new file mode 100644 index 00000000000..8fa47fa8b90 --- /dev/null +++ b/policyengine_us/parameters/gov/usda/csfp/income/sources.yaml @@ -0,0 +1,32 @@ +description: >- + Income sources the model includes in its CSFP approximation pending a + separate review of program exclusions. + +values: + 2009-01-01: + - employment_income + - self_employment_income + - sstb_self_employment_income + - dividend_income + - interest_income + - gi_cash_assistance + - child_support_received + - social_security + - ssi + - tanf + - general_assistance + - pension_income + - survivor_benefits + - financial_assistance + - miscellaneous_income + - veterans_benefits + - total_unemployment_compensation + - strike_benefits + - rental_income + - retirement_distributions + - educational_assistance + +metadata: + reference: + - title: 7 CFR 247.9(d) + href: https://www.govinfo.gov/content/pkg/CFR-2026-title7-vol4/pdf/CFR-2026-title7-vol4-sec247-9.pdf#page=2 diff --git a/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml b/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml new file mode 100644 index 00000000000..452fe079d51 --- /dev/null +++ b/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml @@ -0,0 +1,15 @@ +description: USDA counts these business and rental income sources for school meals after treating each person's losses as zero. +values: + 2009-01-01: + - self_employment_income + - sstb_self_employment_income + - rental_income + - farm_operations_income + - farm_rent_income + - partnership_s_corp_income +metadata: + reference: + - title: "USDA Eligibility Manual for School Meals #page 27-29" + href: https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf#page=27 + - title: USDA Child Nutrition Programs income eligibility guidelines, 91 FR 17932 + href: https://www.govinfo.gov/content/pkg/FR-2026-04-09/html/2026-06842.htm diff --git a/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml b/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml index 9ac98a6a27a..c4532c25a95 100644 --- a/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml +++ b/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml @@ -3,8 +3,6 @@ description: Income sources that count as income for school meal subsidies. values: 2009-01-01: - employment_income - - self_employment_income - - sstb_self_employment_income - dividend_income - interest_income - gi_cash_assistance @@ -21,15 +19,20 @@ values: - veterans_benefits - total_unemployment_compensation - strike_benefits - - rental_income - retirement_distributions - - educational_assistance + - alimony_income + - workers_compensation + - disability_benefits + - military_retirement_income + - estate_income metadata: reference: - title: Code of Federal Regulations, 7 CFR 245.6(a)(5)(ii) - href: https://www.law.cornell.edu/cfr/text/7/245.6#a_5_ii - - title: Code of Federal Regulations, 7 CFR 273.9(b) - href: https://www.law.cornell.edu/cfr/text/7/273.9#b - - title: Code of Federal Regulations, 7 CFR 247.9(d)(1) - href: https://www.ecfr.gov/current/title-7/part-247/section-247.9#p-247.9(d)(1) + href: https://www.ecfr.gov/current/title-7/section-245.6#p-245.6(a)(5)(ii) + - title: "USDA Eligibility Manual for School Meals #page 27,31-32" + href: https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf#page=27 + - title: USDA Child Nutrition Programs income eligibility guidelines, 91 FR 17932 + href: https://www.govinfo.gov/content/pkg/FR-2026-04-09/html/2026-06842.htm + - title: 20 U.S.C. 1087uu, Disregard of student aid in other programs + href: https://uscode.house.gov/us/usc/t20/s1087uu/ diff --git a/policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml b/policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml new file mode 100644 index 00000000000..14204ef6ec9 --- /dev/null +++ b/policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml @@ -0,0 +1,57 @@ +description: USDA counts these recurring state cash assistance totals for school meals. +values: + 2009-01-01: + - ak_ssp + - al_ssp + - ca_state_supplement + - co_oap + - co_state_supplement + - ct_ssp + - dc_ossp + - de_ssp + - fl_oss + - ga_ssp + - hi_oss + - ia_ssa + - id_aabd + - il_aabd + - in_ssp + - ks_sspp + - ky_ssp + - la_oss + - ma_state_supplement + - md_paa + - me_ssp + - mi_ssp + - mn_msa + - mo_ssp + - mt_ssp + - nc_sa + - ne_aabd + - nh_ssp + - nj_ssp + - nm_ssi_state_supplement + - nv_oss + - ny_ssp + - oh_rss + - ok_ssp + - or_ssp_countable_for_school_meals + - pa_ssp + - ri_ssp + - sc_ssi_state_supplement + - sd_ssp + - tx_ssi_state_supplement + - ut_ssp + - va_ag + - vt_aabd + - wa_ssp + - wi_ssp + - wy_ssp +metadata: + reference: + - title: Code of Federal Regulations, 7 CFR 245.6(a)(5)(ii) + href: https://www.ecfr.gov/current/title-7/section-245.6#p-245.6(a)(5)(ii) + - title: "USDA Eligibility Manual for School Meals #page 27,31" + href: https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf#page=27 + - title: USDA Child Nutrition Programs income eligibility guidelines, 91 FR 17932 + href: https://www.govinfo.gov/content/pkg/FR-2026-04-09/html/2026-06842.htm diff --git a/policyengine_us/tests/core/test_school_meal_countable_income.py b/policyengine_us/tests/core/test_school_meal_countable_income.py new file mode 100644 index 00000000000..e2ae1172339 --- /dev/null +++ b/policyengine_us/tests/core/test_school_meal_countable_income.py @@ -0,0 +1,171 @@ +"""Check school meal income with generated households and model calculations.""" + +import numpy as np +from hypothesis import HealthCheck, given, settings +from hypothesis import strategies as st + +from policyengine_us import Simulation + + +YEAR = 2026 +BUSINESS_SOURCES = ( + "self_employment_income", + "sstb_self_employment_income", + "rental_income", + "farm_operations_income", + "farm_rent_income", + "partnership_s_corp_income", +) +ADDED_CASH_SOURCES = ( + "alimony_income", + "workers_compensation", + "disability_benefits", + "military_retirement_pay", + "military_retirement_pay_survivors", + "estate_income", +) +LEGACY_PERSON_SOURCES = ( + "employment_income", + "self_employment_income", + "sstb_self_employment_income", + "dividend_income", + "interest_income", + "gi_cash_assistance", + "child_support_received", + "social_security", + "ssi", + "general_assistance", + "pension_income", + "survivor_benefits", + "financial_assistance", + "miscellaneous_income", + "veterans_benefits", + "total_unemployment_compensation", + "strike_benefits", + "rental_income", + "retirement_distributions", +) +SETTINGS = dict( + max_examples=6, + deadline=None, + derandomize=True, + suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large], +) + + +def _income(units): + people = {} + groups = { + "families": {}, + "tax_units": {}, + "spm_units": {}, + "marital_units": {}, + "households": {}, + } + for unit_index, unit in enumerate(units): + members = [] + for person_index, inputs in enumerate(unit["people"]): + name = f"person_{unit_index}_{person_index}" + members.append(name) + values = {"age": 35, "ssi": 0, **inputs} + people[name] = {source: {YEAR: value} for source, value in values.items()} + groups["marital_units"][name] = {"members": [name]} + for entity in ("families", "tax_units"): + groups[entity][str(unit_index)] = {"members": members} + groups["spm_units"][str(unit_index)] = { + "members": members, + "tanf": {YEAR: unit.get("tanf", 0)}, + } + groups["households"][str(unit_index)] = { + "members": members, + "state_code": {YEAR: "TN"}, + } + simulation = Simulation(situation={"people": people, **groups}) + return np.asarray( + simulation.calculate("school_meal_countable_income", YEAR), dtype=float + ) + + +amounts = st.integers(0, 20_000) +business_people = st.fixed_dictionaries( + { + "employment_income": amounts, + **{source: st.integers(-20_000, 20_000) for source in BUSINESS_SOURCES}, + } +) + + +@settings(**SETTINGS) +@given( + st.lists(st.lists(business_people, min_size=1, max_size=3), min_size=1, max_size=4) +) +def test_business_losses_cannot_offset_any_person_or_income_source(households): + actual = _income([{"people": people} for people in households]) + wages = np.array( + [sum(person["employment_income"] for person in people) for people in households] + ) + business = np.array( + [ + sum( + max(person[source], 0) + for person in people + for source in BUSINESS_SOURCES + ) + for people in households + ] + ) + np.testing.assert_allclose(actual, wages + business, atol=0.01) + assert np.all(actual >= wages) + + +@settings(**SETTINGS) +@given( + source=st.sampled_from(ADDED_CASH_SOURCES), + wages=amounts, + initial=amounts, + increase=st.integers(1, 20_000), +) +def test_increasing_included_cash_increases_income_by_the_same_amount( + source, wages, initial, increase +): + actual = _income( + [ + {"people": [{"employment_income": wages, source: initial}]}, + {"people": [{"employment_income": wages, source: initial + increase}]}, + ] + ) + np.testing.assert_allclose(actual, [wages + initial, wages + initial + increase]) + assert actual[1] - actual[0] == increase + + +@settings(**SETTINGS) +@given( + st.lists( + st.fixed_dictionaries( + {"employment_income": amounts, "educational_assistance": amounts} + ), + min_size=1, + max_size=4, + ) +) +def test_educational_assistance_does_not_change_school_meal_income(people): + without_aid = [{**person, "educational_assistance": 0} for person in people] + actual = _income([{"people": without_aid}, {"people": people}]) + expected = sum(person["employment_income"] for person in people) + np.testing.assert_allclose(actual, [expected, expected], atol=0.01) + + +@settings(**SETTINGS) +@given( + people=st.lists( + st.fixed_dictionaries({source: amounts for source in LEGACY_PERSON_SOURCES}), + min_size=1, + max_size=3, + ), + tanf=amounts, +) +def test_unchanged_sources_keep_the_income_sum_from_main(people, tanf): + # Sum the original person sources and add the SPM unit's TANF grant once. + expected = sum(sum(person.values()) for person in people) + tanf + actual = _income([{"people": people, "tanf": tanf}]) + np.testing.assert_allclose(actual, [expected], atol=0.01) diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml index 3b9d429a904..bc014f906df 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml @@ -1,7 +1,8 @@ - name: Threshold is 400% of FPL. period: 2022 input: - school_meal_fpg_ratio: 4 + ca_cvrp_countable_income: 40_000 + spm_unit_fpg: 10_000 medicaid_enrolled: false output: is_ca_cvrp_increased_rebate_eligible: true @@ -9,7 +10,8 @@ - name: Threshold is 400% of FPL. period: 2022 input: - school_meal_fpg_ratio: 4.01 + ca_cvrp_countable_income: 40_100 + spm_unit_fpg: 10_000 medicaid_enrolled: false output: is_ca_cvrp_increased_rebate_eligible: false @@ -17,7 +19,8 @@ - name: Can also qualify via SSI. period: 2022 input: - school_meal_fpg_ratio: 4.01 + ca_cvrp_countable_income: 40_100 + spm_unit_fpg: 10_000 medicaid_enrolled: false ssi: 1 output: @@ -26,7 +29,8 @@ - name: Reported SSI receipt with a zero modeled payment also qualifies above the income threshold. period: 2022 input: - school_meal_fpg_ratio: 4.01 + ca_cvrp_countable_income: 40_100 + spm_unit_fpg: 10_000 medicaid_enrolled: false ssi: 0 receives_ssi: true diff --git a/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/integration.yaml b/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/integration.yaml index a217c0a9ef9..5387166c446 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/integration.yaml @@ -31,13 +31,15 @@ spm_units: unit1: members: [person1, person2, person3] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 unit2: members: [person4] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 @@ -78,13 +80,15 @@ spm_units: unit1: members: [person1, person2, person3] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 unit2: members: [person4] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 @@ -125,13 +129,15 @@ spm_units: unit1: members: [person1, person2, person3] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 1_200 receives_snap: false fdpir: 0 unit2: members: [person4] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 @@ -172,13 +178,15 @@ spm_units: unit1: members: [person1, person2, person3] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: true fdpir: 0 unit2: members: [person4] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 @@ -219,13 +227,15 @@ spm_units: unit1: members: [person1, person2, person3] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 1_200 unit2: members: [person4] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 @@ -266,13 +276,15 @@ spm_units: unit1: members: [person1, person2, person3] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 unit2: members: [person4] - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 snap: 0 receives_snap: false fdpir: 0 @@ -290,7 +302,8 @@ period: 2026 input: age: 60 - school_meal_fpg_ratio: 1.5 + csfp_countable_income: 15_000 + spm_unit_fpg: 10_000 state_code: KS county_str: SEDGWICK_COUNTY_KS ssi: 0 @@ -307,7 +320,8 @@ period: 2026 input: age: 68 - school_meal_fpg_ratio: 1.51 + csfp_countable_income: 15_100 + spm_unit_fpg: 10_000 state_code: KS county_str: SEDGWICK_COUNTY_KS ssi: 0 @@ -324,7 +338,8 @@ period: 2026 input: age: 68 - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 state_code: KS county_str: ALLEN_COUNTY_KS ssi: 0 @@ -341,7 +356,8 @@ period: 2026 input: age: 59 - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 state_code: KS county_str: SEDGWICK_COUNTY_KS ssi: 0 @@ -358,7 +374,8 @@ period: 2026 input: age: 68 - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 state_code: MO county_str: JACKSON_COUNTY_MO ssi: 0 @@ -375,7 +392,8 @@ period: 2024 input: age: 68 - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 state_code: KS county_str: SEDGWICK_COUNTY_KS ssi: 0 @@ -392,7 +410,8 @@ period: 2025 input: age: 68 - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 state_code: KS county_str: SEDGWICK_COUNTY_KS ssi: 0 @@ -432,7 +451,7 @@ state_code: KS county_str: SEDGWICK_COUNTY_KS output: - school_meal_countable_income: 43_800 + csfp_countable_income: 43_800 ks_dcf_csfp_categorically_eligible: [true, false] commodity_supplemental_food_program_eligible: [true, false] commodity_supplemental_food_program: [651, 0] @@ -471,7 +490,7 @@ # 2026 SSI federal benefit rate: 994 * 12 = 11,928. ssi: [11_928, 0] # 33,000 wages + 11,928 SSI. - school_meal_countable_income: 44_928 + csfp_countable_income: 44_928 ks_dcf_csfp_categorically_eligible: [true, false] commodity_supplemental_food_program_eligible: [true, false] commodity_supplemental_food_program: [651, 0] @@ -480,7 +499,8 @@ period: 2026 input: age: 68 - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 state_code: KS county_str: SEDGWICK_COUNTY_KS ssi: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/ks_dcf_csfp_categorically_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/ks_dcf_csfp_categorically_eligible.yaml index c96ed0320bd..775ae18561b 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/ks_dcf_csfp_categorically_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ks/dcf/csfp/ks_dcf_csfp_categorically_eligible.yaml @@ -25,7 +25,8 @@ state_code: KS county_str: SEDGWICK_COUNTY_KS age: 68 - school_meal_fpg_ratio: 2 + csfp_countable_income: 20_000 + spm_unit_fpg: 10_000 ssi: 0 receives_ssi: 2026-01: true diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml new file mode 100644 index 00000000000..d3d96d0607b --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml @@ -0,0 +1,72 @@ +- name: Oregon counts recurring supplemental cash assistance for school meals. + period: 2026-01 + input: + state_code: + 2026: OR + or_ssp_category: + - IN_HOME + - COMMUNITY_CARE + - DISABILITY_INTERIM + - SSI_RESTORATION + - VA_RESTORATION + - NATURALIZATION + - SUSPENDED_SSI + - SPOUSAL_DIVERSION + - NONE + or_ssp: [100, 100, 100, 100, 100, 100, 100, 100, 100] + output: + # Each recipient has $100 of recurring cash: $100 - $0 excluded = $100. + # NONE retains the recurring nursing-facility allowance in or_ssp. + or_ssp_countable_for_school_meals: [100, 100, 100, 100, 100, 100, 100, 100, 100] + +- name: Oregon excludes initial room and board from school meal income. + period: 2026-01 + input: + state_code: + 2026: OR + or_ssp_category: INITIAL_ROOM_BOARD + or_ssp: 100 + output: + # The entire $100 pays an initial placement: $100 - $100 = $0. + or_ssp_countable_for_school_meals: 0 + +- name: Oregon excludes facility payments during absence from school meal income. + period: 2026-01 + input: + state_code: + 2026: OR + or_ssp_category: ROOM_BOARD_ABSENCE + or_ssp: 100 + output: + # The entire $100 pays the facility: $100 - $100 = $0. + or_ssp_countable_for_school_meals: 0 + +- name: Oregon excludes incapacity placement payments from school meal income. + period: 2026-01 + input: + state_code: + 2026: OR + or_ssp_category: ROOM_BOARD_INCAPACITY + or_ssp: 100 + output: + # The entire $100 secures a placement: $100 - $100 = $0. + or_ssp_countable_for_school_meals: 0 + +- name: Oregon counts no supplement when no payment applies. + period: 2026-01 + input: + state_code: + 2026: OR + output: + # No approved special need or facility allowance gives $0 cash income. + or_ssp_countable_for_school_meals: 0 + +- name: Oregon's school meal income measure applies only in Oregon. + period: 2026-01 + input: + state_code: + 2026: WA + or_ssp_category: IN_HOME + or_ssp: 100 + output: + or_ssp_countable_for_school_meals: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml index 5a974d2b439..2d48be96c1d 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml @@ -2,7 +2,8 @@ period: 2025 input: state_code: TX - school_meal_fpg_ratio: 1.3 + tx_dta_csfp_countable_income: 13_000 + spm_unit_fpg: 10_000 output: tx_dta_csfp_income_eligible: true @@ -10,6 +11,7 @@ period: 2025 input: state_code: TX - school_meal_fpg_ratio: 1.31 + tx_dta_csfp_countable_income: 13_100 + spm_unit_fpg: 10_000 output: tx_dta_csfp_income_eligible: false diff --git a/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program.yaml b/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program.yaml index 83a70af38a5..fd3457115e1 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program.yaml @@ -1,7 +1,8 @@ - name: Age ineligible period: 2019 input: - school_meal_fpg_ratio: 1.3 + csfp_countable_income: 13_000 + spm_unit_fpg: 10_000 age: 59 output: commodity_supplemental_food_program: 0 @@ -9,7 +10,8 @@ - name: Income ineligible period: 2019 input: - school_meal_fpg_ratio: 1.31 + csfp_countable_income: 13_100 + spm_unit_fpg: 10_000 age: 60 output: commodity_supplemental_food_program: 0 @@ -17,7 +19,8 @@ - name: Eligible period: 2019 input: - school_meal_fpg_ratio: 1.30 + csfp_countable_income: 13_000 + spm_unit_fpg: 10_000 age: 60 output: commodity_supplemental_food_program: 330 @@ -25,7 +28,8 @@ - name: Case 4, eligible in 2024. period: 2024 input: - school_meal_fpg_ratio: 1.30 + csfp_countable_income: 13_000 + spm_unit_fpg: 10_000 age: 60 output: commodity_supplemental_food_program: 531 @@ -33,7 +37,8 @@ - name: Case 5, eligible in 2025 with updated amount. period: 2025 input: - school_meal_fpg_ratio: 1.50 + csfp_countable_income: 15_000 + spm_unit_fpg: 10_000 age: 60 output: commodity_supplemental_food_program: 601 @@ -41,7 +46,8 @@ - name: Case 6, eligible in 2026 with updated amount. period: 2026 input: - school_meal_fpg_ratio: 1.50 + csfp_countable_income: 15_000 + spm_unit_fpg: 10_000 age: 60 output: commodity_supplemental_food_program: 651 diff --git a/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml index 47e0f3e758c..54051176202 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml @@ -9,7 +9,9 @@ spm_units: spm_unit: members: [person, spouse] - school_meal_fpg_ratio: 1.0 # Below the 130% limit + csfp_countable_income: 10_000 # Below the 130% limit + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 10_000 output: commodity_supplemental_food_program_eligible: [false, true] @@ -22,7 +24,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.2 # Below the 130% limit + csfp_countable_income: 12_000 # Below the 130% limit + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 12_000 output: commodity_supplemental_food_program_eligible: true @@ -35,7 +39,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.3 # Exactly at the limit + csfp_countable_income: 13_000 # Exactly at the limit + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 13_000 output: commodity_supplemental_food_program_eligible: true @@ -48,7 +54,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.31 # Just above the limit + csfp_countable_income: 13_100 # Just above the limit + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 13_100 output: commodity_supplemental_food_program_eligible: false @@ -67,7 +75,9 @@ spm_units: spm_unit: members: [child, adult, senior1, senior2] - school_meal_fpg_ratio: 1.2 # Below the 130% limit + csfp_countable_income: 12_000 # Below the 130% limit + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 12_000 output: commodity_supplemental_food_program_eligible: [false, false, true, true] @@ -80,7 +90,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.45 # Between 130% and 150% + csfp_countable_income: 14_500 # Between 130% and 150% + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 14_500 output: commodity_supplemental_food_program_eligible: true @@ -93,7 +105,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.51 # Just above the 150% limit + csfp_countable_income: 15_100 # Just above the 150% limit + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 15_100 output: commodity_supplemental_food_program_eligible: false @@ -106,7 +120,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.0 + csfp_countable_income: 10_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 10_000 output: commodity_supplemental_food_program_eligible: true @@ -119,7 +135,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 2.5 # Well above the 130% limit + csfp_countable_income: 25_000 # Well above the 130% limit + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 25_000 output: commodity_supplemental_food_program_eligible: false @@ -132,7 +150,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 0.5 # Very low income + csfp_countable_income: 5_000 # Very low income + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 5_000 output: commodity_supplemental_food_program_eligible: false @@ -145,7 +165,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.4 + csfp_countable_income: 14_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 14_000 households: household: members: [person] @@ -162,7 +184,9 @@ spm_units: spm_unit: members: [person] - school_meal_fpg_ratio: 1.3 + csfp_countable_income: 13_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 13_000 households: household: members: [person] @@ -179,7 +203,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.4 + csfp_countable_income: 14_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 14_000 households: household: members: [person1] @@ -197,7 +223,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.0 + csfp_countable_income: 10_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 10_000 households: household: members: [person1] @@ -215,7 +243,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.4 + csfp_countable_income: 14_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 14_000 households: household: members: [person1] @@ -233,7 +263,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.3 + csfp_countable_income: 13_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 13_000 households: household: members: [person1] @@ -251,7 +283,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.4 + csfp_countable_income: 14_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 14_000 households: household: members: [person1] @@ -269,7 +303,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.0 + csfp_countable_income: 10_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 10_000 households: household: members: [person1] @@ -287,7 +323,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.4 + csfp_countable_income: 14_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 14_000 households: household: members: [person1] @@ -305,7 +343,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 1.4 + csfp_countable_income: 14_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 14_000 households: household: members: [person1] @@ -323,7 +363,9 @@ spm_units: spm_unit: members: [person1] - school_meal_fpg_ratio: 2.5 + csfp_countable_income: 25_000 + spm_unit_fpg: 10_000 + tx_dta_csfp_countable_income: 25_000 households: household: members: [person1] diff --git a/policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml new file mode 100644 index 00000000000..827fd7d6c63 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml @@ -0,0 +1,97 @@ +- name: The independent income approximations include educational assistance. + period: 2026 + input: + age: 35 + state_code: TN + employment_income: 36_000 + educational_assistance: 7_000 + output: + # Preserve the existing approximation: 36,000 + 7,000 = 43,000. + csfp_countable_income: 43_000 + tx_dta_csfp_countable_income: 43_000 + ca_cvrp_countable_income: 43_000 + +- name: The independent income approximations retain self-employment losses. + period: 2026 + input: + age: 35 + state_code: TN + employment_income: 45_000 + self_employment_income: -20_000 + output: + # Preserve the existing approximation: 45,000 - 20,000 = 25,000. + csfp_countable_income: 25_000 + tx_dta_csfp_countable_income: 25_000 + ca_cvrp_countable_income: 25_000 + +- name: The independent income approximations retain SSTB losses. + period: 2026 + input: + age: 35 + state_code: TN + employment_income: 45_000 + sstb_self_employment_income: -20_000 + output: + # Preserve the existing approximation: 45,000 - 20,000 = 25,000. + csfp_countable_income: 25_000 + tx_dta_csfp_countable_income: 25_000 + ca_cvrp_countable_income: 25_000 + +- name: The independent income approximations retain rental losses. + period: 2026 + input: + age: 35 + state_code: TN + employment_income: 45_000 + rental_income: -20_000 + output: + # Preserve the existing approximation: 45,000 - 20,000 = 25,000. + csfp_countable_income: 25_000 + tx_dta_csfp_countable_income: 25_000 + ca_cvrp_countable_income: 25_000 + +- name: The independent income approximations retain their existing alimony omission. + period: 2026 + input: + age: 35 + state_code: TN + employment_income: 30_000 + alimony_income: 60_000 + output: + # Preserve the existing approximation: only 30,000 wages enter the sum. + csfp_countable_income: 30_000 + tx_dta_csfp_countable_income: 30_000 + ca_cvrp_countable_income: 30_000 + +- name: The independent income approximations retain their existing state supplement omission. + period: 2026 + absolute_error_margin: 0.1 + input: + people: + parent: + age: 45 + employment_income: 38_114 + adult_child: + age: 19 + is_ssi_disabled: true + child: + age: 10 + marital_units: + parent_unit: + members: [parent] + adult_child_unit: + members: [adult_child] + child_unit: + members: [child] + spm_units: + spm_unit: + members: [parent, adult_child, child] + households: + household: + members: [parent, adult_child, child] + state_code: WI + output: + # Preserve the existing approximation: 38,114 wages + 11,928 federal SSI. + csfp_countable_income: 50_042 + tx_dta_csfp_countable_income: 50_042 + ca_cvrp_countable_income: 50_042 diff --git a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml index 2aa2a9ce3db..13aad691026 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml @@ -55,3 +55,1209 @@ general_assistance: 0 output: school_meal_countable_income: 10_000 + +# 36,000 of wages count; 28,132 < 36,000 < 40,034. +- name: A Tennessee parent earns 36,000 and the child receives reduced-price meals. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 36_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 36_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: REDUCED + +# 36,000 wages + 0 excluded educational assistance = 36,000. +- name: A Tennessee parent receives educational aid and the child keeps reduced-price meals. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 36_000 + educational_assistance: 7_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 36_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: REDUCED + +# 45,000 of wages exceed the two-person reduced-price limit of 40,034. +- name: A Tennessee parent earns 45,000 and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 45,000 wages + max(-20,000 self_employment_income, 0) = 45,000. +- name: A Tennessee parent reports a self_employment_income loss and the child keeps the paid tier. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + self_employment_income: -20_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 45,000 wages + max(-20,000 sstb_self_employment_income, 0) = 45,000. +- name: A Tennessee parent reports a sstb_self_employment_income loss and the child keeps the paid tier. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + sstb_self_employment_income: -20_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 45,000 wages + max(-20,000 rental_income, 0) = 45,000. +- name: A Tennessee parent reports a rental_income loss and the child keeps the paid tier. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + rental_income: -20_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 0 wages + 60,000 alimony = 60,000, above the 40,034 limit. +- name: A Tennessee parent receives 60,000 of alimony and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + alimony_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 60_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 28,132 < 30,000 of wages < 40,034. +- name: A Tennessee parent earns 30,000 and the child receives reduced-price meals. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 30_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: REDUCED + +# 30,000 wages + 60,000 child_support_received = 90,000. +- name: A Tennessee parent receives child_support_received and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + child_support_received: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 alimony_income = 90,000. +- name: A Tennessee parent receives alimony_income and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + alimony_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 workers_compensation = 90,000. +- name: A Tennessee parent receives workers_compensation and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + workers_compensation: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 disability_benefits = 90,000. +- name: A Tennessee parent receives disability_benefits and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + disability_benefits: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 military_retirement_pay = 90,000. +- name: A Tennessee parent receives military_retirement_pay and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + military_retirement_pay: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 military_retirement_pay_survivors = 90,000. +- name: A Tennessee parent receives military_retirement_pay_survivors and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + military_retirement_pay_survivors: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 farm_operations_income = 90,000. +- name: A Tennessee parent receives farm_operations_income and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + farm_operations_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 farm_rent_income = 90,000. +- name: A Tennessee parent receives farm_rent_income and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + farm_rent_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 estate_income = 90,000. +- name: A Tennessee parent receives estate_income and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + estate_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 partnership_income = 90,000. +- name: A Tennessee parent receives partnership_income and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + partnership_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 s_corp_income = 90,000. +- name: A Tennessee parent receives s_corp_income and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + s_corp_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 aggregate military_retirement_income = 90,000. +- name: A Tennessee parent enters military_retirement_income directly and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + military_retirement_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 30,000 wages + 60,000 aggregate partnership_s_corp_income = 90,000. +- name: A Tennessee parent enters partnership_s_corp_income directly and the child pays full price. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 30_000 + partnership_s_corp_income: 60_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 90_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 45,000 wages + 6 * max(-1, 0) = 45,000. +- name: A parent reports -1 in each business source and schools floor each source. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + self_employment_income: -1 + sstb_self_employment_income: -1 + rental_income: -1 + farm_operations_income: -1 + farm_rent_income: -1 + partnership_s_corp_income: -1 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_000 + +# 45,000 wages + 6 * max(0, 0) = 45,000. +- name: A parent reports 0 in each business source and schools floor each source. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + self_employment_income: 0 + sstb_self_employment_income: 0 + rental_income: 0 + farm_operations_income: 0 + farm_rent_income: 0 + partnership_s_corp_income: 0 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_000 + +# 45,000 wages + 6 * max(1, 0) = 45,006. +- name: A parent reports 1 in each business source and schools floor each source. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + self_employment_income: 1 + sstb_self_employment_income: 1 + rental_income: 1 + farm_operations_income: 1 + farm_rent_income: 1 + partnership_s_corp_income: 1 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_006 + +# 45,000 wages + 6 * (max(-100, 0) + max(40, 0)) = 45,240. +- name: A parent has losses and another adult has gains in the same business sources. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + self_employment_income: -100 + sstb_self_employment_income: -100 + rental_income: -100 + farm_operations_income: -100 + farm_rent_income: -100 + partnership_s_corp_income: -100 + child: + age: 10 + other_adult: + age: 40 + self_employment_income: 40 + sstb_self_employment_income: 40 + rental_income: 40 + farm_operations_income: 40 + farm_rent_income: 40 + partnership_s_corp_income: 40 + spm_units: + spm_unit: + members: [parent, child, other_adult] + households: + household: + members: [parent, child, other_adult] + state_code: TN + output: + school_meal_countable_income: 45_240 + +# Each adult contributes 3 * 40; 45,000 wages + 2 * 3 * 40 = 45,240. +- name: Two adults have gains and losses in different business sources. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + self_employment_income: -100 + sstb_self_employment_income: 40 + rental_income: -100 + farm_operations_income: 40 + farm_rent_income: -100 + partnership_s_corp_income: 40 + child: + age: 10 + other_adult: + age: 40 + self_employment_income: 40 + sstb_self_employment_income: -100 + rental_income: 40 + farm_operations_income: -100 + farm_rent_income: 40 + partnership_s_corp_income: -100 + spm_units: + spm_unit: + members: [parent, child, other_adult] + households: + household: + members: [parent, child, other_adult] + state_code: TN + output: + school_meal_countable_income: 45_240 + +# Federal SSI = 12 * 994 = 11,928. +# Wisconsin SSP = 4 * 83.78 + 8 * 92.16 = 1,072.40. +# 38,114 wages + 11,928 SSI + 1,072.40 SSP = 51,114.40 > 50,542. +- name: A Wisconsin parent lives with an adult SSI recipient and a younger child who pays full price. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 45 + employment_income: 38_114 + adult_child: + age: 19 + is_ssi_disabled: true + child: + age: 10 + families: + family: + members: [parent, adult_child, child] + tax_units: + tax_unit: + members: [parent, adult_child, child] + spm_units: + spm_unit: + members: [parent, adult_child, child] + marital_units: + parent_unit: + members: [parent] + adult_child_unit: + members: [adult_child] + child_unit: + members: [child] + households: + household: + members: [parent, adult_child, child] + state_code: WI + output: + ssi: [0, 11_928, 0] + wi_ssp: [0, 1_072.4, 0] + spm_unit_fpg: 27_320 + school_meal_countable_income: 51_114.4 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# Each household receives 100 annually from one modeled supplement. +# Six SPM-unit supplements count once across their two-person households. +- name: Recipients count each state SSI supplement once in school meal income. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + ak_ssp_recipient: + age: 35 + ssi: 0 + ak_ssp: 100 + al_ssp_recipient: + age: 35 + ssi: 0 + al_ssp: 100 + ca_state_supplement_recipient: + age: 35 + ssi: 0 + ca_state_supplement_other: + age: 35 + ssi: 0 + co_oap_recipient: + age: 35 + ssi: 0 + co_oap: 100 + co_state_supplement_recipient: + age: 35 + ssi: 0 + co_state_supplement: 100 + ct_ssp_recipient: + age: 35 + ssi: 0 + ct_ssp_other: + age: 35 + ssi: 0 + dc_ossp_recipient: + age: 35 + ssi: 0 + dc_ossp: 100 + de_ssp_recipient: + age: 35 + ssi: 0 + de_ssp: 100 + fl_oss_recipient: + age: 35 + ssi: 0 + fl_oss: 100 + ga_ssp_recipient: + age: 35 + ssi: 0 + ga_ssp_other: + age: 35 + ssi: 0 + hi_oss_recipient: + age: 35 + ssi: 0 + hi_oss: 100 + ia_ssa_recipient: + age: 35 + ssi: 0 + ia_ssa: 100 + id_aabd_recipient: + age: 35 + ssi: 0 + id_aabd: 100 + il_aabd_recipient: + age: 35 + ssi: 0 + il_aabd_other: + age: 35 + ssi: 0 + in_ssp_recipient: + age: 35 + ssi: 0 + in_ssp: 100 + ks_sspp_recipient: + age: 35 + ssi: 0 + ks_sspp: 100 + ky_ssp_recipient: + age: 35 + ssi: 0 + ky_ssp: 100 + la_oss_recipient: + age: 35 + ssi: 0 + la_oss: 100 + ma_state_supplement_recipient: + age: 35 + ssi: 0 + ma_state_supplement: 100 + md_paa_recipient: + age: 35 + ssi: 0 + md_paa: 100 + me_ssp_recipient: + age: 35 + ssi: 0 + me_ssp: 100 + mi_ssp_recipient: + age: 35 + ssi: 0 + mi_ssp_other: + age: 35 + ssi: 0 + mn_msa_recipient: + age: 35 + ssi: 0 + mn_msa_other: + age: 35 + ssi: 0 + mo_ssp_recipient: + age: 35 + ssi: 0 + mo_ssp: 100 + mt_ssp_recipient: + age: 35 + ssi: 0 + mt_ssp: 100 + nc_sa_recipient: + age: 35 + ssi: 0 + nc_sa: 100 + ne_aabd_recipient: + age: 35 + ssi: 0 + ne_aabd: 100 + nh_ssp_recipient: + age: 35 + ssi: 0 + nh_ssp: 100 + nj_ssp_recipient: + age: 35 + ssi: 0 + nj_ssp: 100 + nm_ssi_state_supplement_recipient: + age: 35 + ssi: 0 + nm_ssi_state_supplement: 100 + nv_oss_recipient: + age: 35 + ssi: 0 + nv_oss: 100 + ny_ssp_recipient: + age: 35 + ssi: 0 + ny_ssp: 100 + oh_rss_recipient: + age: 35 + ssi: 0 + oh_rss: 100 + ok_ssp_recipient: + age: 35 + ssi: 0 + ok_ssp: 100 + or_ssp_recipient: + age: 35 + ssi: 0 + or_ssp: 100 + or_ssp_category: IN_HOME + pa_ssp_recipient: + age: 35 + ssi: 0 + pa_ssp: 100 + ri_ssp_recipient: + age: 35 + ssi: 0 + ri_ssp: 100 + sc_ssi_state_supplement_recipient: + age: 35 + ssi: 0 + sc_ssi_state_supplement: 100 + sd_ssp_recipient: + age: 35 + ssi: 0 + sd_ssp: 100 + tx_ssi_state_supplement_recipient: + age: 35 + ssi: 0 + tx_ssi_state_supplement: 100 + ut_ssp_recipient: + age: 35 + ssi: 0 + ut_ssp: 100 + va_ag_recipient: + age: 35 + ssi: 0 + va_ag: 100 + vt_aabd_recipient: + age: 35 + ssi: 0 + vt_aabd: 100 + wa_ssp_recipient: + age: 35 + ssi: 0 + wa_ssp: 100 + wi_ssp_recipient: + age: 35 + ssi: 0 + wi_ssp: 100 + wy_ssp_recipient: + age: 35 + ssi: 0 + wy_ssp: 100 + spm_units: + ak_ssp_unit: + members: [ak_ssp_recipient] + tanf: 0 + al_ssp_unit: + members: [al_ssp_recipient] + tanf: 0 + ca_state_supplement_unit: + members: [ca_state_supplement_recipient, ca_state_supplement_other] + tanf: 0 + ca_state_supplement: 100 + co_oap_unit: + members: [co_oap_recipient] + tanf: 0 + co_state_supplement_unit: + members: [co_state_supplement_recipient] + tanf: 0 + ct_ssp_unit: + members: [ct_ssp_recipient, ct_ssp_other] + tanf: 0 + ct_ssp: 100 + dc_ossp_unit: + members: [dc_ossp_recipient] + tanf: 0 + de_ssp_unit: + members: [de_ssp_recipient] + tanf: 0 + fl_oss_unit: + members: [fl_oss_recipient] + tanf: 0 + ga_ssp_unit: + members: [ga_ssp_recipient, ga_ssp_other] + tanf: 0 + ga_ssp: 100 + hi_oss_unit: + members: [hi_oss_recipient] + tanf: 0 + ia_ssa_unit: + members: [ia_ssa_recipient] + tanf: 0 + id_aabd_unit: + members: [id_aabd_recipient] + tanf: 0 + il_aabd_unit: + members: [il_aabd_recipient, il_aabd_other] + tanf: 0 + il_aabd: 100 + in_ssp_unit: + members: [in_ssp_recipient] + tanf: 0 + ks_sspp_unit: + members: [ks_sspp_recipient] + tanf: 0 + ky_ssp_unit: + members: [ky_ssp_recipient] + tanf: 0 + la_oss_unit: + members: [la_oss_recipient] + tanf: 0 + ma_state_supplement_unit: + members: [ma_state_supplement_recipient] + tanf: 0 + md_paa_unit: + members: [md_paa_recipient] + tanf: 0 + me_ssp_unit: + members: [me_ssp_recipient] + tanf: 0 + mi_ssp_unit: + members: [mi_ssp_recipient, mi_ssp_other] + tanf: 0 + mi_ssp: 100 + mn_msa_unit: + members: [mn_msa_recipient, mn_msa_other] + tanf: 0 + mn_msa: 100 + mo_ssp_unit: + members: [mo_ssp_recipient] + tanf: 0 + mt_ssp_unit: + members: [mt_ssp_recipient] + tanf: 0 + nc_sa_unit: + members: [nc_sa_recipient] + tanf: 0 + ne_aabd_unit: + members: [ne_aabd_recipient] + tanf: 0 + nh_ssp_unit: + members: [nh_ssp_recipient] + tanf: 0 + nj_ssp_unit: + members: [nj_ssp_recipient] + tanf: 0 + nm_ssi_state_supplement_unit: + members: [nm_ssi_state_supplement_recipient] + tanf: 0 + nv_oss_unit: + members: [nv_oss_recipient] + tanf: 0 + ny_ssp_unit: + members: [ny_ssp_recipient] + tanf: 0 + oh_rss_unit: + members: [oh_rss_recipient] + tanf: 0 + ok_ssp_unit: + members: [ok_ssp_recipient] + tanf: 0 + or_ssp_unit: + members: [or_ssp_recipient] + tanf: 0 + pa_ssp_unit: + members: [pa_ssp_recipient] + tanf: 0 + ri_ssp_unit: + members: [ri_ssp_recipient] + tanf: 0 + sc_ssi_state_supplement_unit: + members: [sc_ssi_state_supplement_recipient] + tanf: 0 + sd_ssp_unit: + members: [sd_ssp_recipient] + tanf: 0 + tx_ssi_state_supplement_unit: + members: [tx_ssi_state_supplement_recipient] + tanf: 0 + ut_ssp_unit: + members: [ut_ssp_recipient] + tanf: 0 + va_ag_unit: + members: [va_ag_recipient] + tanf: 0 + vt_aabd_unit: + members: [vt_aabd_recipient] + tanf: 0 + wa_ssp_unit: + members: [wa_ssp_recipient] + tanf: 0 + wi_ssp_unit: + members: [wi_ssp_recipient] + tanf: 0 + wy_ssp_unit: + members: [wy_ssp_recipient] + tanf: 0 + households: + ak_ssp_household: + members: [ak_ssp_recipient] + state_code: AK + al_ssp_household: + members: [al_ssp_recipient] + state_code: AL + ca_state_supplement_household: + members: [ca_state_supplement_recipient, ca_state_supplement_other] + state_code: CA + co_oap_household: + members: [co_oap_recipient] + state_code: CO + co_state_supplement_household: + members: [co_state_supplement_recipient] + state_code: CO + ct_ssp_household: + members: [ct_ssp_recipient, ct_ssp_other] + state_code: CT + dc_ossp_household: + members: [dc_ossp_recipient] + state_code: DC + de_ssp_household: + members: [de_ssp_recipient] + state_code: DE + fl_oss_household: + members: [fl_oss_recipient] + state_code: FL + ga_ssp_household: + members: [ga_ssp_recipient, ga_ssp_other] + state_code: GA + hi_oss_household: + members: [hi_oss_recipient] + state_code: HI + ia_ssa_household: + members: [ia_ssa_recipient] + state_code: IA + id_aabd_household: + members: [id_aabd_recipient] + state_code: ID + il_aabd_household: + members: [il_aabd_recipient, il_aabd_other] + state_code: IL + in_ssp_household: + members: [in_ssp_recipient] + state_code: IN + ks_sspp_household: + members: [ks_sspp_recipient] + state_code: KS + ky_ssp_household: + members: [ky_ssp_recipient] + state_code: KY + la_oss_household: + members: [la_oss_recipient] + state_code: LA + ma_state_supplement_household: + members: [ma_state_supplement_recipient] + state_code: MA + md_paa_household: + members: [md_paa_recipient] + state_code: MD + me_ssp_household: + members: [me_ssp_recipient] + state_code: ME + mi_ssp_household: + members: [mi_ssp_recipient, mi_ssp_other] + state_code: MI + mn_msa_household: + members: [mn_msa_recipient, mn_msa_other] + state_code: MN + mo_ssp_household: + members: [mo_ssp_recipient] + state_code: MO + mt_ssp_household: + members: [mt_ssp_recipient] + state_code: MT + nc_sa_household: + members: [nc_sa_recipient] + state_code: NC + ne_aabd_household: + members: [ne_aabd_recipient] + state_code: NE + nh_ssp_household: + members: [nh_ssp_recipient] + state_code: NH + nj_ssp_household: + members: [nj_ssp_recipient] + state_code: NJ + nm_ssi_state_supplement_household: + members: [nm_ssi_state_supplement_recipient] + state_code: NM + nv_oss_household: + members: [nv_oss_recipient] + state_code: NV + ny_ssp_household: + members: [ny_ssp_recipient] + state_code: NY + oh_rss_household: + members: [oh_rss_recipient] + state_code: OH + ok_ssp_household: + members: [ok_ssp_recipient] + state_code: OK + or_ssp_household: + members: [or_ssp_recipient] + state_code: OR + pa_ssp_household: + members: [pa_ssp_recipient] + state_code: PA + ri_ssp_household: + members: [ri_ssp_recipient] + state_code: RI + sc_ssi_state_supplement_household: + members: [sc_ssi_state_supplement_recipient] + state_code: SC + sd_ssp_household: + members: [sd_ssp_recipient] + state_code: SD + tx_ssi_state_supplement_household: + members: [tx_ssi_state_supplement_recipient] + state_code: TX + ut_ssp_household: + members: [ut_ssp_recipient] + state_code: UT + va_ag_household: + members: [va_ag_recipient] + state_code: VA + vt_aabd_household: + members: [vt_aabd_recipient] + state_code: VT + wa_ssp_household: + members: [wa_ssp_recipient] + state_code: WA + wi_ssp_household: + members: [wi_ssp_recipient] + state_code: WI + wy_ssp_household: + members: [wy_ssp_recipient] + state_code: WY + output: + school_meal_countable_income: + - 100 # ak_ssp + - 100 # al_ssp + - 100 # ca_state_supplement + - 100 # co_oap + - 100 # co_state_supplement + - 100 # ct_ssp + - 100 # dc_ossp + - 100 # de_ssp + - 100 # fl_oss + - 100 # ga_ssp + - 100 # hi_oss + - 100 # ia_ssa + - 100 # id_aabd + - 100 # il_aabd + - 100 # in_ssp + - 100 # ks_sspp + - 100 # ky_ssp + - 100 # la_oss + - 100 # ma_state_supplement + - 100 # md_paa + - 100 # me_ssp + - 100 # mi_ssp + - 100 # mn_msa + - 100 # mo_ssp + - 100 # mt_ssp + - 100 # nc_sa + - 100 # ne_aabd + - 100 # nh_ssp + - 100 # nj_ssp + - 100 # nm_ssi_state_supplement + - 100 # nv_oss + - 100 # ny_ssp + - 100 # oh_rss + - 100 # ok_ssp + - 100 # or_ssp + - 100 # pa_ssp + - 100 # ri_ssp + - 100 # sc_ssi_state_supplement + - 100 # sd_ssp + - 100 # tx_ssi_state_supplement + - 100 # ut_ssp + - 100 # va_ag + - 100 # vt_aabd + - 100 # wa_ssp + - 100 # wi_ssp + - 100 # wy_ssp diff --git a/policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/ca_cvrp_countable_income.py b/policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/ca_cvrp_countable_income.py new file mode 100644 index 00000000000..3e246a280ff --- /dev/null +++ b/policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/ca_cvrp_countable_income.py @@ -0,0 +1,16 @@ +from policyengine_us.model_api import * + + +class ca_cvrp_countable_income(Variable): + value_type = float + entity = SPMUnit + definition_period = YEAR + unit = USD + label = "Income used for California CVRP direct eligibility" + documentation = ( + "SPM unit income for California CVRP direct eligibility. The model retains its " + "existing approximation pending a separate review of program income rules." + ) + reference = "https://cleanvehiclerebate.org/sites/default/files/docs/nav/transportation/cvrp/documents/CVRP-Implementation-Manual.pdf#page=12" + + adds = "gov.states.ca.calepa.carb.cvrp.income.sources" diff --git a/policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.py b/policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.py index c9f2cf047dc..0306511ea09 100644 --- a/policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.py +++ b/policyengine_us/variables/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.py @@ -11,9 +11,9 @@ class is_ca_cvrp_increased_rebate_eligible(Variable): defined_for = StateCode.CA def formula(person, period, parameters): - # Use school meal FPG ratio. spm_unit = person.spm_unit - fpg_ratio = spm_unit("school_meal_fpg_ratio", period) + income = spm_unit("ca_cvrp_countable_income", period) + fpg_ratio = income / spm_unit("spm_unit_fpg", period) p = parameters(period).gov.states.ca.calepa.carb.cvrp.increased_rebate income_eligible = fpg_ratio <= p.fpl_limit categorically_eligible = add(spm_unit, period, p.categorical_eligibility) > 0 diff --git a/policyengine_us/variables/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.py b/policyengine_us/variables/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.py new file mode 100644 index 00000000000..1483c6767da --- /dev/null +++ b/policyengine_us/variables/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.py @@ -0,0 +1,32 @@ +from policyengine_us.model_api import * + + +class or_ssp_countable_for_school_meals(Variable): + value_type = float + entity = Person + label = "Oregon state supplement counted for school meals" + definition_period = MONTH + unit = USD + default_value = 0 + defined_for = StateCode.OR + documentation = ( + "Oregon supplemental cash assistance counted for school meals, excluding " + "initial placement and room and board payments during absence or incapacity." + ) + reference = ( + "https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf#page=34", + "https://ch461rules.odhs.oregon.gov/rules/461-155-0500.pdf", + "https://ch461rules.odhs.oregon.gov/rules/461-155-0575.pdf", + "https://ch461rules.odhs.oregon.gov/rules/461-155-0630.pdf", + "https://ch461rules.odhs.oregon.gov/rules/461-155-0700.pdf", + ) + + def formula(person, period, parameters): + category = person("or_ssp_category", period) + c = category.possible_values + excluded = ( + (category == c.INITIAL_ROOM_BOARD) + | (category == c.ROOM_BOARD_ABSENCE) + | (category == c.ROOM_BOARD_INCAPACITY) + ) + return where(excluded, 0, person("or_ssp", period)) diff --git a/policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_countable_income.py b/policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_countable_income.py new file mode 100644 index 00000000000..9dea4df2d52 --- /dev/null +++ b/policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_countable_income.py @@ -0,0 +1,16 @@ +from policyengine_us.model_api import * + + +class tx_dta_csfp_countable_income(Variable): + value_type = float + entity = SPMUnit + definition_period = YEAR + unit = USD + label = "Income used for Texas CSFP direct eligibility" + documentation = ( + "SPM unit income for Texas CSFP direct eligibility. The model retains its " + "existing approximation pending a separate review of program exclusions." + ) + reference = "https://squaremeals.org/Portals/8/FND%20Forms/Program%20Handbooks/CSFP_Section_3_Managing_Program_V700_260410.pdf#page=14" + + adds = "gov.states.tx.dta.csfp.income.sources" diff --git a/policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.py b/policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.py index 50230e1b92e..bd40ee6eebd 100644 --- a/policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.py +++ b/policyengine_us/variables/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.py @@ -10,5 +10,6 @@ class tx_dta_csfp_income_eligible(Variable): def formula(person, period, parameters): p = parameters(period).gov.states.tx.dta.csfp - fpg = person.spm_unit("school_meal_fpg_ratio", period) + income = person.spm_unit("tx_dta_csfp_countable_income", period) + fpg = income / person.spm_unit("spm_unit_fpg", period) return fpg <= p.fpg_limit diff --git a/policyengine_us/variables/gov/usda/csfp/commodity_supplemental_food_program_eligible.py b/policyengine_us/variables/gov/usda/csfp/commodity_supplemental_food_program_eligible.py index 648a4eacd3b..5e0b5bbdf75 100644 --- a/policyengine_us/variables/gov/usda/csfp/commodity_supplemental_food_program_eligible.py +++ b/policyengine_us/variables/gov/usda/csfp/commodity_supplemental_food_program_eligible.py @@ -9,9 +9,8 @@ class commodity_supplemental_food_program_eligible(Variable): def formula(person, period, parameters): p = parameters(period).gov.usda.csfp - # CFR defines CSFP income similarly to WIC income. - # Assume resources are counted at the SPM unit level. - fpg = person.spm_unit("school_meal_fpg_ratio", period) + income = person.spm_unit("csfp_countable_income", period) + fpg = income / person.spm_unit("spm_unit_fpg", period) age = person("age", period) age_eligible = age >= p.min_age diff --git a/policyengine_us/variables/gov/usda/csfp/csfp_countable_income.py b/policyengine_us/variables/gov/usda/csfp/csfp_countable_income.py new file mode 100644 index 00000000000..cdd251141fd --- /dev/null +++ b/policyengine_us/variables/gov/usda/csfp/csfp_countable_income.py @@ -0,0 +1,16 @@ +from policyengine_us.model_api import * + + +class csfp_countable_income(Variable): + value_type = float + entity = SPMUnit + definition_period = YEAR + unit = USD + label = "Income used for CSFP direct eligibility" + documentation = ( + "SPM unit income for CSFP direct eligibility. The model retains its " + "existing approximation pending a separate review of program exclusions." + ) + reference = "https://www.govinfo.gov/content/pkg/CFR-2026-title7-vol4/pdf/CFR-2026-title7-vol4-sec247-9.pdf#page=2" + + adds = "gov.usda.csfp.income.sources" diff --git a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py index cd35e880cf2..0398d49778f 100644 --- a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py +++ b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py @@ -8,5 +8,17 @@ class school_meal_countable_income(Variable): unit = USD label = "Countable income for school meals" documentation = "SPM unit's countable income for school meal program" + reference = ( + "https://www.ecfr.gov/current/title-7/section-245.6#p-245.6(a)(5)(ii)", + # PDF pages 27-29, 31-32. + "https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf#page=27", + ) - adds = "gov.usda.school_meals.income.sources" + def formula(spm_unit, period, parameters): + p = parameters(period).gov.usda.school_meals.income + income = add(spm_unit, period, p.sources) + income += add(spm_unit, period, p.state_supplement_sources) + # USDA counts each person's business and rental losses as zero. + for source in p.business_sources: + income += spm_unit.sum(max_(spm_unit.members(source, period), 0)) + return income diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 0dffa25d573..2298639ebdd 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -15046,3 +15046,41 @@ candidates: - https://github.com/PolicyEngine/policyengine-us/pull/10053 state: ruled note: Neither source prescribes a fallback when residence data are missing. Keep the existing false default. +- id: us:school-meal-state-ssi-supplements + program: school-meals + years: + from: 2009 + type: calendar + question: Should school meal income include state SSI supplements despite USDA's adoption of Social Security Act income exclusions? + sources: + - kind: statute + citation: 42 U.S.C. 1382a(a), (b)(6), (b)(9) and (b)(23) + url: https://www.govinfo.gov/content/pkg/USCODE-2024-title42/html/USCODE-2024-title42-chap7-subchapXVI-partA-sec1382a.htm + - kind: regulation + citation: 7 CFR 245.6(a)(5)(ii) + url: https://www.ecfr.gov/current/title-7/section-245.6#p-245.6(a)(5)(ii) + - kind: guidance + citation: 91 FR 17932, 17933, Definition of Income + url: https://www.govinfo.gov/content/pkg/FR-2026-04-09/html/2026-06842.htm + - kind: manual + citation: USDA Eligibility Manual for School Meals, June 29, 2017, pages 26, 29 and 30 + url: https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf + readings: + statute: Congress limits section 1382a's income definition to SSI's statutory subchapter. Section 1382a(b)(6) excludes + need-based state assistance for SSI without directing school meal administrators to exclude it. School meal + administrators count welfare and other cash income under 7 CFR 245.6(a)(5)(ii). + other: Read the Manual's page 30 adoption of Social Security Act exclusions as importing section 1382a(b)(6) into + school meals. Under that reading, administrators exclude need-based state SSI supplements. Page 26's regular state + cash assistance category can cover payments that do not depend on need. + pe_us: + follows: gap-fill + code: + - policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml + - policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py + prs: [] + state: ruled + note: PolicyEngine counts modeled state SSI supplements under the school meal regulation, USDA's current public + assistance definition and the Manual's page 26 state cash assistance category. The page 30 wording leaves a competing + exclusion reading. Congress also excludes some dividends, interest and child support for SSI under section + 1382a(b)(9) and (23), while USDA specifically counts those sources for school meals. PolicyEngine therefore does not + import every SSI exclusion into school meals. The reviewed USDA sources do not name state SSI supplements. From a42a18aaefb17e7fcb4162a157a6e3394018fec8 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 13 Nov 2026 08:38:56 -0500 Subject: [PATCH 2/7] Prevent estate losses from offsetting school meal income Floor estate and trust pass-through income before adding it to household income. Check that ancillary income measures retain their original sums with generated households. Co-Authored-By: Claude Opus 5.5 --- .../school_meals/income/business_sources.yaml | 9 +++- .../gov/usda/school_meals/income/sources.yaml | 1 - .../core/test_school_meal_countable_income.py | 42 +++++++++++++++-- .../school_meal_countable_income.yaml | 47 +++++++++++++++---- .../school_meal_countable_income.py | 2 +- source_conflicts/candidates.yaml | 3 +- 6 files changed, 87 insertions(+), 17 deletions(-) diff --git a/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml b/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml index 452fe079d51..9cb4a4e93b8 100644 --- a/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml +++ b/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml @@ -1,4 +1,8 @@ -description: USDA counts these business and rental income sources for school meals after treating each person's losses as zero. +description: >- + USDA counts these business, rental and pass-through income sources for school + meals after treating each person's losses as zero. PolicyEngine retains + component netting within each person's partnership/S-corporation and + estate/trust aggregate. values: 2009-01-01: - self_employment_income @@ -7,9 +11,12 @@ values: - farm_operations_income - farm_rent_income - partnership_s_corp_income + - estate_income metadata: reference: - title: "USDA Eligibility Manual for School Meals #page 27-29" href: https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf#page=27 - title: USDA Child Nutrition Programs income eligibility guidelines, 91 FR 17932 href: https://www.govinfo.gov/content/pkg/FR-2026-04-09/html/2026-06842.htm + - title: IRS 2024 Schedule K-1 (Form 1041) beneficiary instructions, boxes 5 through 8 + href: https://www.irs.gov/pub/irs-prior/i1041sk1--2024.pdf#page=2 diff --git a/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml b/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml index c4532c25a95..3c3f9ff0604 100644 --- a/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml +++ b/policyengine_us/parameters/gov/usda/school_meals/income/sources.yaml @@ -24,7 +24,6 @@ values: - workers_compensation - disability_benefits - military_retirement_income - - estate_income metadata: reference: diff --git a/policyengine_us/tests/core/test_school_meal_countable_income.py b/policyengine_us/tests/core/test_school_meal_countable_income.py index e2ae1172339..6cb89158ac9 100644 --- a/policyengine_us/tests/core/test_school_meal_countable_income.py +++ b/policyengine_us/tests/core/test_school_meal_countable_income.py @@ -15,6 +15,7 @@ "farm_operations_income", "farm_rent_income", "partnership_s_corp_income", + "estate_income", ) ADDED_CASH_SOURCES = ( "alimony_income", @@ -22,7 +23,6 @@ "disability_benefits", "military_retirement_pay", "military_retirement_pay_survivors", - "estate_income", ) LEGACY_PERSON_SOURCES = ( "employment_income", @@ -53,7 +53,7 @@ ) -def _income(units): +def _income(units, variable="school_meal_countable_income"): people = {} groups = { "families": {}, @@ -81,9 +81,7 @@ def _income(units): "state_code": {YEAR: "TN"}, } simulation = Simulation(situation={"people": people, **groups}) - return np.asarray( - simulation.calculate("school_meal_countable_income", YEAR), dtype=float - ) + return np.asarray(simulation.calculate(variable, YEAR), dtype=float) amounts = st.integers(0, 20_000) @@ -169,3 +167,37 @@ def test_unchanged_sources_keep_the_income_sum_from_main(people, tanf): expected = sum(sum(person.values()) for person in people) + tanf actual = _income([{"people": people, "tanf": tanf}]) np.testing.assert_allclose(actual, [expected], atol=0.01) + + +@settings(**SETTINGS) +@given( + people=st.lists( + st.fixed_dictionaries( + { + **{source: amounts for source in LEGACY_PERSON_SOURCES}, + "educational_assistance": amounts, + **{source: st.integers(-20_000, 20_000) for source in BUSINESS_SOURCES}, + **{source: amounts for source in ADDED_CASH_SOURCES}, + } + ), + min_size=1, + max_size=3, + ), + tanf=amounts, +) +def test_ancillary_income_measures_keep_the_original_source_sum(people, tanf): + expected = ( + sum( + sum(person[source] for source in LEGACY_PERSON_SOURCES) + + person["educational_assistance"] + for person in people + ) + + tanf + ) + for variable in ( + "csfp_countable_income", + "tx_dta_csfp_countable_income", + "ca_cvrp_countable_income", + ): + actual = _income([{"people": people, "tanf": tanf}], variable) + np.testing.assert_allclose(actual, [expected], atol=0.01) diff --git a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml index 13aad691026..c1f09707cc0 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml @@ -535,7 +535,30 @@ meets_school_meal_categorical_eligibility: false school_meal_tier: PAID -# 45,000 wages + 6 * max(-1, 0) = 45,000. +# 45,000 wages + max(-20,000 estate income, 0) = 45,000. +- name: A Tennessee parent reports an estate loss and the child keeps the paid tier. + period: 2026 + input: + people: + parent: + age: 35 + employment_income: 45_000 + estate_income: -20_000 + child: + age: 10 + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 45_000 + meets_school_meal_categorical_eligibility: false + school_meal_tier: PAID + +# 45,000 wages + 7 * max(-1, 0) = 45,000. - name: A parent reports -1 in each business source and schools floor each source. period: 2026 input: @@ -549,6 +572,7 @@ farm_operations_income: -1 farm_rent_income: -1 partnership_s_corp_income: -1 + estate_income: -1 child: age: 10 spm_units: @@ -561,7 +585,7 @@ output: school_meal_countable_income: 45_000 -# 45,000 wages + 6 * max(0, 0) = 45,000. +# 45,000 wages + 7 * max(0, 0) = 45,000. - name: A parent reports 0 in each business source and schools floor each source. period: 2026 input: @@ -575,6 +599,7 @@ farm_operations_income: 0 farm_rent_income: 0 partnership_s_corp_income: 0 + estate_income: 0 child: age: 10 spm_units: @@ -587,7 +612,7 @@ output: school_meal_countable_income: 45_000 -# 45,000 wages + 6 * max(1, 0) = 45,006. +# 45,000 wages + 7 * max(1, 0) = 45,007. - name: A parent reports 1 in each business source and schools floor each source. period: 2026 input: @@ -601,6 +626,7 @@ farm_operations_income: 1 farm_rent_income: 1 partnership_s_corp_income: 1 + estate_income: 1 child: age: 10 spm_units: @@ -611,9 +637,9 @@ members: [parent, child] state_code: TN output: - school_meal_countable_income: 45_006 + school_meal_countable_income: 45_007 -# 45,000 wages + 6 * (max(-100, 0) + max(40, 0)) = 45,240. +# 45,000 wages + 7 * (max(-100, 0) + max(40, 0)) = 45,280. - name: A parent has losses and another adult has gains in the same business sources. period: 2026 input: @@ -627,6 +653,7 @@ farm_operations_income: -100 farm_rent_income: -100 partnership_s_corp_income: -100 + estate_income: -100 child: age: 10 other_adult: @@ -637,6 +664,7 @@ farm_operations_income: 40 farm_rent_income: 40 partnership_s_corp_income: 40 + estate_income: 40 spm_units: spm_unit: members: [parent, child, other_adult] @@ -645,9 +673,10 @@ members: [parent, child, other_adult] state_code: TN output: - school_meal_countable_income: 45_240 + school_meal_countable_income: 45_280 -# Each adult contributes 3 * 40; 45,000 wages + 2 * 3 * 40 = 45,240. +# The parent contributes 3 * 40; the other adult contributes 4 * 40. +# 45,000 wages + (3 + 4) * 40 = 45,280. - name: Two adults have gains and losses in different business sources. period: 2026 input: @@ -661,6 +690,7 @@ farm_operations_income: 40 farm_rent_income: -100 partnership_s_corp_income: 40 + estate_income: -100 child: age: 10 other_adult: @@ -671,6 +701,7 @@ farm_operations_income: -100 farm_rent_income: 40 partnership_s_corp_income: -100 + estate_income: 40 spm_units: spm_unit: members: [parent, child, other_adult] @@ -679,7 +710,7 @@ members: [parent, child, other_adult] state_code: TN output: - school_meal_countable_income: 45_240 + school_meal_countable_income: 45_280 # Federal SSI = 12 * 994 = 11,928. # Wisconsin SSP = 4 * 83.78 + 8 * 92.16 = 1,072.40. diff --git a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py index 0398d49778f..673ada3124f 100644 --- a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py +++ b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py @@ -18,7 +18,7 @@ def formula(spm_unit, period, parameters): p = parameters(period).gov.usda.school_meals.income income = add(spm_unit, period, p.sources) income += add(spm_unit, period, p.state_supplement_sources) - # USDA counts each person's business and rental losses as zero. + # Treat each person's business, rental and pass-through losses as zero. for source in p.business_sources: income += spm_unit.sum(max_(spm_unit.members(source, period), 0)) return income diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 2298639ebdd..998eb248d98 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -15077,7 +15077,8 @@ candidates: code: - policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml - policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py - prs: [] + prs: + - https://github.com/PolicyEngine/policyengine-us/pull/10873 state: ruled note: PolicyEngine counts modeled state SSI supplements under the school meal regulation, USDA's current public assistance definition and the Manual's page 26 state cash assistance category. The page 30 wording leaves a competing From cbc5ce87dd130dbb33f50571b217d8ea7ed12864 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 13 Nov 2026 10:14:23 -0500 Subject: [PATCH 3/7] Align school meal regression households with earnings inputs Use earnings before labor supply responses and explicit household groups in the issue cases. Check Oregon exclusions through the annual income sum and reuse one simulation for ancillary income assertions. Co-Authored-By: Claude Opus 5.5 --- .../core/test_school_meal_countable_income.py | 11 +- .../or_ssp_countable_for_school_meals.yaml | 17 + .../gov/usda/csfp/csfp_countable_income.yaml | 23 +- .../school_meal_countable_income.yaml | 388 ++++++++++++++++-- 4 files changed, 385 insertions(+), 54 deletions(-) diff --git a/policyengine_us/tests/core/test_school_meal_countable_income.py b/policyengine_us/tests/core/test_school_meal_countable_income.py index 6cb89158ac9..d56cae7cc1e 100644 --- a/policyengine_us/tests/core/test_school_meal_countable_income.py +++ b/policyengine_us/tests/core/test_school_meal_countable_income.py @@ -53,7 +53,7 @@ ) -def _income(units, variable="school_meal_countable_income"): +def _simulation(units): people = {} groups = { "families": {}, @@ -80,7 +80,11 @@ def _income(units, variable="school_meal_countable_income"): "members": members, "state_code": {YEAR: "TN"}, } - simulation = Simulation(situation={"people": people, **groups}) + return Simulation(situation={"people": people, **groups}) + + +def _income(units, variable="school_meal_countable_income"): + simulation = _simulation(units) return np.asarray(simulation.calculate(variable, YEAR), dtype=float) @@ -194,10 +198,11 @@ def test_ancillary_income_measures_keep_the_original_source_sum(people, tanf): ) + tanf ) + simulation = _simulation([{"people": people, "tanf": tanf}]) for variable in ( "csfp_countable_income", "tx_dta_csfp_countable_income", "ca_cvrp_countable_income", ): - actual = _income([{"people": people, "tanf": tanf}], variable) + actual = np.asarray(simulation.calculate(variable, YEAR), dtype=float) np.testing.assert_allclose(actual, [expected], atol=0.01) diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml index d3d96d0607b..9035db82b5f 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml @@ -70,3 +70,20 @@ or_ssp: 100 output: or_ssp_countable_for_school_meals: 0 + +- name: School meal income uses Oregon's exclusions through the annual income sum. + period: 2026 + input: + age: [35, 35, 35, 35] + state_code: [OR, OR, OR, OR] + ssi: [0, 0, 0, 0] + tanf: [0, 0, 0, 0] + or_ssp_category: + - INITIAL_ROOM_BOARD + - ROOM_BOARD_ABSENCE + - ROOM_BOARD_INCAPACITY + - IN_HOME + or_ssp: [1_200, 1_200, 1_200, 1_200] + output: + # Annual payments are 12 * $100; only recurring in-home cash counts. + school_meal_countable_income: [0, 0, 0, 1_200] diff --git a/policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml index 827fd7d6c63..73b31f96bef 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/csfp/csfp_countable_income.yaml @@ -1,9 +1,10 @@ +# Supply pre-response earnings to match US Simulation input normalization. - name: The independent income approximations include educational assistance. period: 2026 input: age: 35 state_code: TN - employment_income: 36_000 + employment_income_before_lsr: 36_000 educational_assistance: 7_000 output: # Preserve the existing approximation: 36,000 + 7,000 = 43,000. @@ -16,8 +17,8 @@ input: age: 35 state_code: TN - employment_income: 45_000 - self_employment_income: -20_000 + employment_income_before_lsr: 45_000 + self_employment_income_before_lsr: -20_000 output: # Preserve the existing approximation: 45,000 - 20,000 = 25,000. csfp_countable_income: 25_000 @@ -29,8 +30,8 @@ input: age: 35 state_code: TN - employment_income: 45_000 - sstb_self_employment_income: -20_000 + employment_income_before_lsr: 45_000 + sstb_self_employment_income_before_lsr: -20_000 output: # Preserve the existing approximation: 45,000 - 20,000 = 25,000. csfp_countable_income: 25_000 @@ -42,7 +43,7 @@ input: age: 35 state_code: TN - employment_income: 45_000 + employment_income_before_lsr: 45_000 rental_income: -20_000 output: # Preserve the existing approximation: 45,000 - 20,000 = 25,000. @@ -55,7 +56,7 @@ input: age: 35 state_code: TN - employment_income: 30_000 + employment_income_before_lsr: 30_000 alimony_income: 60_000 output: # Preserve the existing approximation: only 30,000 wages enter the sum. @@ -70,12 +71,18 @@ people: parent: age: 45 - employment_income: 38_114 + employment_income_before_lsr: 38_114 adult_child: age: 19 is_ssi_disabled: true child: age: 10 + families: + family: + members: [parent, adult_child, child] + tax_units: + tax_unit: + members: [parent, adult_child, child] marital_units: parent_unit: members: [parent] diff --git a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml index c1f09707cc0..c70b96b6fba 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml @@ -56,6 +56,7 @@ output: school_meal_countable_income: 10_000 +# Supply pre-response earnings to match US Simulation input normalization. # 36,000 of wages count; 28,132 < 36,000 < 40,034. - name: A Tennessee parent earns 36,000 and the child receives reduced-price meals. period: 2026 @@ -63,9 +64,20 @@ people: parent: age: 35 - employment_income: 36_000 + employment_income_before_lsr: 36_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -85,10 +97,21 @@ people: parent: age: 35 - employment_income: 36_000 + employment_income_before_lsr: 36_000 educational_assistance: 7_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -108,9 +131,20 @@ people: parent: age: 35 - employment_income: 45_000 + employment_income_before_lsr: 45_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -130,10 +164,21 @@ people: parent: age: 35 - employment_income: 45_000 - self_employment_income: -20_000 + employment_income_before_lsr: 45_000 + self_employment_income_before_lsr: -20_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -153,10 +198,21 @@ people: parent: age: 35 - employment_income: 45_000 - sstb_self_employment_income: -20_000 + employment_income_before_lsr: 45_000 + sstb_self_employment_income_before_lsr: -20_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -176,10 +232,21 @@ people: parent: age: 35 - employment_income: 45_000 + employment_income_before_lsr: 45_000 rental_income: -20_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -202,6 +269,17 @@ alimony_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -221,9 +299,20 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -243,10 +332,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 child_support_received: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -266,10 +366,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 alimony_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -289,10 +400,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 workers_compensation: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -312,10 +434,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 disability_benefits: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -335,10 +468,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 military_retirement_pay: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -358,10 +502,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 military_retirement_pay_survivors: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -381,10 +536,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 farm_operations_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -404,10 +570,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 farm_rent_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -427,10 +604,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 estate_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -450,10 +638,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 partnership_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -473,10 +672,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 s_corp_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -496,10 +706,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 military_retirement_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -519,10 +740,21 @@ people: parent: age: 35 - employment_income: 30_000 + employment_income_before_lsr: 30_000 partnership_s_corp_income: 60_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -542,10 +774,21 @@ people: parent: age: 35 - employment_income: 45_000 + employment_income_before_lsr: 45_000 estate_income: -20_000 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -565,9 +808,9 @@ people: parent: age: 35 - employment_income: 45_000 - self_employment_income: -1 - sstb_self_employment_income: -1 + employment_income_before_lsr: 45_000 + self_employment_income_before_lsr: -1 + sstb_self_employment_income_before_lsr: -1 rental_income: -1 farm_operations_income: -1 farm_rent_income: -1 @@ -575,6 +818,17 @@ estate_income: -1 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -592,9 +846,9 @@ people: parent: age: 35 - employment_income: 45_000 - self_employment_income: 0 - sstb_self_employment_income: 0 + employment_income_before_lsr: 45_000 + self_employment_income_before_lsr: 0 + sstb_self_employment_income_before_lsr: 0 rental_income: 0 farm_operations_income: 0 farm_rent_income: 0 @@ -602,6 +856,17 @@ estate_income: 0 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -619,9 +884,9 @@ people: parent: age: 35 - employment_income: 45_000 - self_employment_income: 1 - sstb_self_employment_income: 1 + employment_income_before_lsr: 45_000 + self_employment_income_before_lsr: 1 + sstb_self_employment_income_before_lsr: 1 rental_income: 1 farm_operations_income: 1 farm_rent_income: 1 @@ -629,6 +894,17 @@ estate_income: 1 child: age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] spm_units: spm_unit: members: [parent, child] @@ -646,9 +922,9 @@ people: parent: age: 35 - employment_income: 45_000 - self_employment_income: -100 - sstb_self_employment_income: -100 + employment_income_before_lsr: 45_000 + self_employment_income_before_lsr: -100 + sstb_self_employment_income_before_lsr: -100 rental_income: -100 farm_operations_income: -100 farm_rent_income: -100 @@ -658,13 +934,26 @@ age: 10 other_adult: age: 40 - self_employment_income: 40 - sstb_self_employment_income: 40 + self_employment_income_before_lsr: 40 + sstb_self_employment_income_before_lsr: 40 rental_income: 40 farm_operations_income: 40 farm_rent_income: 40 partnership_s_corp_income: 40 estate_income: 40 + families: + family: + members: [parent, child, other_adult] + tax_units: + tax_unit: + members: [parent, child, other_adult] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + other_adult_unit: + members: [other_adult] spm_units: spm_unit: members: [parent, child, other_adult] @@ -683,9 +972,9 @@ people: parent: age: 35 - employment_income: 45_000 - self_employment_income: -100 - sstb_self_employment_income: 40 + employment_income_before_lsr: 45_000 + self_employment_income_before_lsr: -100 + sstb_self_employment_income_before_lsr: 40 rental_income: -100 farm_operations_income: 40 farm_rent_income: -100 @@ -695,13 +984,26 @@ age: 10 other_adult: age: 40 - self_employment_income: 40 - sstb_self_employment_income: -100 + self_employment_income_before_lsr: 40 + sstb_self_employment_income_before_lsr: -100 rental_income: 40 farm_operations_income: -100 farm_rent_income: 40 partnership_s_corp_income: -100 estate_income: 40 + families: + family: + members: [parent, child, other_adult] + tax_units: + tax_unit: + members: [parent, child, other_adult] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + other_adult_unit: + members: [other_adult] spm_units: spm_unit: members: [parent, child, other_adult] @@ -722,7 +1024,7 @@ people: parent: age: 45 - employment_income: 38_114 + employment_income_before_lsr: 38_114 adult_child: age: 19 is_ssi_disabled: true From a590e468d8c31ea81079a1041e939c5f3dfcc0d7 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 13 Nov 2026 12:47:53 -0500 Subject: [PATCH 4/7] Strengthen school income regression fixtures Build generated households with Core's entity builder and canonical earnings inputs. Set independent school meal inputs in the CSFP and CVRP fixtures. Match Oregon's state vector to nine recipients. Co-Authored-By: Claude Opus 5.5 --- .../core/test_school_meal_countable_income.py | 24 ++++++++++++++++--- .../is_ca_cvrp_increased_rebate_eligible.yaml | 2 ++ .../or_ssp_countable_for_school_meals.yaml | 2 +- .../dta/csfp/tx_dta_csfp_income_eligible.yaml | 2 ++ ...ty_supplemental_food_program_eligible.yaml | 2 ++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/policyengine_us/tests/core/test_school_meal_countable_income.py b/policyengine_us/tests/core/test_school_meal_countable_income.py index d56cae7cc1e..a7c645ff859 100644 --- a/policyengine_us/tests/core/test_school_meal_countable_income.py +++ b/policyengine_us/tests/core/test_school_meal_countable_income.py @@ -4,7 +4,9 @@ from hypothesis import HealthCheck, given, settings from hypothesis import strategies as st -from policyengine_us import Simulation +from policyengine_core.simulations import SimulationBuilder +from policyengine_us.spm import share_spm_policy +from policyengine_us.system import system YEAR = 2026 @@ -53,6 +55,13 @@ ) +CANONICAL_INPUTS = { + "employment_income": "employment_income_before_lsr", + "self_employment_income": "self_employment_income_before_lsr", + "sstb_self_employment_income": "sstb_self_employment_income_before_lsr", +} + + def _simulation(units): people = {} groups = { @@ -68,7 +77,10 @@ def _simulation(units): name = f"person_{unit_index}_{person_index}" members.append(name) values = {"age": 35, "ssi": 0, **inputs} - people[name] = {source: {YEAR: value} for source, value in values.items()} + people[name] = { + CANONICAL_INPUTS.get(source, source): {YEAR: value} + for source, value in values.items() + } groups["marital_units"][name] = {"members": [name]} for entity in ("families", "tax_units"): groups[entity][str(unit_index)] = {"members": members} @@ -80,7 +92,13 @@ def _simulation(units): "members": members, "state_code": {YEAR: "TN"}, } - return Simulation(situation={"people": people, **groups}) + builder = SimulationBuilder() + builder.set_default_period(str(YEAR)) + simulation = builder.build_from_dict( + share_spm_policy(system), {"people": people, **groups} + ) + simulation.default_calculation_period = YEAR + return simulation def _income(units, variable="school_meal_countable_income"): diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml index bc014f906df..6b272f27858 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/calepa/carb/cvrp/is_ca_cvrp_increased_rebate_eligible.yaml @@ -11,6 +11,8 @@ period: 2022 input: ca_cvrp_countable_income: 40_100 + # Keep school meal income below the limit to check the separate measure. + school_meal_countable_income: 0 spm_unit_fpg: 10_000 medicaid_enrolled: false output: diff --git a/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml b/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml index 9035db82b5f..cdd0052ef54 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/or/odhs/ssp/or_ssp_countable_for_school_meals.yaml @@ -2,7 +2,7 @@ period: 2026-01 input: state_code: - 2026: OR + 2026: [OR, OR, OR, OR, OR, OR, OR, OR, OR] or_ssp_category: - IN_HOME - COMMUNITY_CARE diff --git a/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml index 2d48be96c1d..fb92448ac9d 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/tx/dta/csfp/tx_dta_csfp_income_eligible.yaml @@ -12,6 +12,8 @@ input: state_code: TX tx_dta_csfp_countable_income: 13_100 + # Keep school meal income below the limit to check the separate measure. + school_meal_countable_income: 0 spm_unit_fpg: 10_000 output: tx_dta_csfp_income_eligible: false diff --git a/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml index 54051176202..6768ff58557 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/csfp/commodity_supplemental_food_program_eligible.yaml @@ -55,6 +55,8 @@ spm_unit: members: [person] csfp_countable_income: 13_100 # Just above the limit + # Keep school meal income below the limit to check the separate measure. + school_meal_countable_income: 0 spm_unit_fpg: 10_000 tx_dta_csfp_countable_income: 13_100 output: From 1530b2d6abc4d45a1820c42d11924ea977a3d798 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 14:54:44 -0500 Subject: [PATCH 5/7] Net each person's business income within a category before the school meal floor USDA's income definition lists net income from nonfarm self-employment and net rental income as single items, and its Manual credits the self-employed with net income. PolicyEngine now floors each person's Schedule C and SSTB income once, through total_self_employment_income, and nets rental income with farm rent in school_meal_net_rental_income before the floor. Two new cases cover a same-person SSTB loss and a same-person rental loss, and the property test groups its expectation the same way. Co-Authored-By: Claude Opus 5.5 --- .../school_meals/income/business_sources.yaml | 14 ++- .../core/test_school_meal_countable_income.py | 15 ++- .../school_meal_countable_income.yaml | 97 +++++++++++++++++-- .../school_meal_countable_income.py | 3 +- .../school_meal_net_rental_income.py | 20 ++++ 5 files changed, 127 insertions(+), 22 deletions(-) create mode 100644 policyengine_us/variables/gov/usda/school_meals/school_meal_net_rental_income.py diff --git a/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml b/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml index 9cb4a4e93b8..8c6fec376f3 100644 --- a/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml +++ b/policyengine_us/parameters/gov/usda/school_meals/income/business_sources.yaml @@ -1,15 +1,13 @@ description: >- - USDA counts these business, rental and pass-through income sources for school - meals after treating each person's losses as zero. PolicyEngine retains - component netting within each person's partnership/S-corporation and - estate/trust aggregate. + PolicyEngine counts each person's net income from these business, rental and + pass-through sources for school meals, and treats a person's net loss in any + one source as zero. The nonfarm self-employment total combines both kinds of + Schedule C income, and net rental income combines property and farm rent. values: 2009-01-01: - - self_employment_income - - sstb_self_employment_income - - rental_income + - total_self_employment_income + - school_meal_net_rental_income - farm_operations_income - - farm_rent_income - partnership_s_corp_income - estate_income metadata: diff --git a/policyengine_us/tests/core/test_school_meal_countable_income.py b/policyengine_us/tests/core/test_school_meal_countable_income.py index a7c645ff859..72ab90010fb 100644 --- a/policyengine_us/tests/core/test_school_meal_countable_income.py +++ b/policyengine_us/tests/core/test_school_meal_countable_income.py @@ -19,6 +19,14 @@ "partnership_s_corp_income", "estate_income", ) +# Each person's sources net within these income categories before the floor. +NET_INCOME_CATEGORIES = ( + ("self_employment_income", "sstb_self_employment_income"), + ("rental_income", "farm_rent_income"), + ("farm_operations_income",), + ("partnership_s_corp_income",), + ("estate_income",), +) ADDED_CASH_SOURCES = ( "alimony_income", "workers_compensation", @@ -119,7 +127,8 @@ def _income(units, variable="school_meal_countable_income"): @given( st.lists(st.lists(business_people, min_size=1, max_size=3), min_size=1, max_size=4) ) -def test_business_losses_cannot_offset_any_person_or_income_source(households): +def test_business_losses_cannot_offset_another_category_or_person(households): + assert sorted(sum(NET_INCOME_CATEGORIES, ())) == sorted(BUSINESS_SOURCES) actual = _income([{"people": people} for people in households]) wages = np.array( [sum(person["employment_income"] for person in people) for people in households] @@ -127,9 +136,9 @@ def test_business_losses_cannot_offset_any_person_or_income_source(households): business = np.array( [ sum( - max(person[source], 0) + max(sum(person[source] for source in category), 0) for person in people - for source in BUSINESS_SOURCES + for category in NET_INCOME_CATEGORIES ) for people in households ] diff --git a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml index c70b96b6fba..733d6500b44 100644 --- a/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/usda/school_meals/school_meal_countable_income.yaml @@ -801,8 +801,10 @@ meets_school_meal_categorical_eligibility: false school_meal_tier: PAID -# 45,000 wages + 7 * max(-1, 0) = 45,000. -- name: A parent reports -1 in each business source and schools floor each source. +# Five groups: nonfarm self-employment (Schedule C and SSTB), rental (property +# and farm rent), farm operations, partnership/S-corporation and estate. +# 45,000 wages + max(-1 - 1, 0) + max(-1 - 1, 0) + 3 * max(-1, 0) = 45,000. +- name: A parent reports a 1-dollar loss in each business source and no business income counts. period: 2026 input: people: @@ -839,8 +841,8 @@ output: school_meal_countable_income: 45_000 -# 45,000 wages + 7 * max(0, 0) = 45,000. -- name: A parent reports 0 in each business source and schools floor each source. +# 45,000 wages + max(0 + 0, 0) + max(0 + 0, 0) + 3 * max(0, 0) = 45,000. +- name: A parent reports zero in each business source and no business income counts. period: 2026 input: people: @@ -877,8 +879,8 @@ output: school_meal_countable_income: 45_000 -# 45,000 wages + 7 * max(1, 0) = 45,007. -- name: A parent reports 1 in each business source and schools floor each source. +# 45,000 wages + max(1 + 1, 0) + max(1 + 1, 0) + 3 * max(1, 0) = 45,007. +- name: A parent reports 1 dollar in each business source and schools count 7 dollars. period: 2026 input: people: @@ -915,7 +917,9 @@ output: school_meal_countable_income: 45_007 -# 45,000 wages + 7 * (max(-100, 0) + max(40, 0)) = 45,280. +# Parent: max(-100 - 100, 0) + max(-100 - 100, 0) + 3 * max(-100, 0) = 0. +# Other adult: max(40 + 40, 0) + max(40 + 40, 0) + 3 * max(40, 0) = 280. +# 45,000 wages + 0 + 280 = 45,280. - name: A parent has losses and another adult has gains in the same business sources. period: 2026 input: @@ -964,8 +968,11 @@ output: school_meal_countable_income: 45_280 -# The parent contributes 3 * 40; the other adult contributes 4 * 40. -# 45,000 wages + (3 + 4) * 40 = 45,280. +# Parent: max(-100 + 40, 0) self-employment + max(-100 - 100, 0) rental +# + 40 farm operations + 40 partnership + max(-100, 0) estate = 80. +# Other adult: max(40 - 100, 0) self-employment + max(40 + 40, 0) rental +# + max(-100, 0) farm operations + max(-100, 0) partnership + 40 estate = 120. +# 45,000 wages + 80 + 120 = 45,200. - name: Two adults have gains and losses in different business sources. period: 2026 input: @@ -1012,7 +1019,77 @@ members: [parent, child, other_adult] state_code: TN output: - school_meal_countable_income: 45_280 + school_meal_countable_income: 45_200 + +# One person's two kinds of nonfarm self-employment income net before the floor. +# 30,000 wages + max(10,000 - 10,000, 0) = 30,000. +# 30,000 / 21,640 = 1.386, below the 40,034 reduced-price limit. +- name: A parent's SSTB loss offsets their other nonfarm self-employment gain. + period: 2026 + input: + people: + parent: + age: 35 + employment_income_before_lsr: 30_000 + self_employment_income_before_lsr: 10_000 + sstb_self_employment_income_before_lsr: -10_000 + child: + age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 30_000 + school_meal_tier: REDUCED + +# One person's property rental loss offsets their farm rent before the floor. +# 30,000 wages + max(-4,000 + 6,000, 0) = 32,000. +- name: A parent's rental loss offsets their farm rent. + period: 2026 + input: + people: + parent: + age: 35 + employment_income_before_lsr: 30_000 + rental_income: -4_000 + farm_rent_income: 6_000 + child: + age: 10 + families: + family: + members: [parent, child] + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + spm_units: + spm_unit: + members: [parent, child] + households: + household: + members: [parent, child] + state_code: TN + output: + school_meal_countable_income: 32_000 # Federal SSI = 12 * 994 = 11,928. # Wisconsin SSP = 4 * 83.78 + 8 * 92.16 = 1,072.40. diff --git a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py index 673ada3124f..861f5078d71 100644 --- a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py +++ b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py @@ -18,7 +18,8 @@ def formula(spm_unit, period, parameters): p = parameters(period).gov.usda.school_meals.income income = add(spm_unit, period, p.sources) income += add(spm_unit, period, p.state_supplement_sources) - # Treat each person's business, rental and pass-through losses as zero. + # Treat each person's net loss in each business, rental or + # pass-through source as zero. for source in p.business_sources: income += spm_unit.sum(max_(spm_unit.members(source, period), 0)) return income diff --git a/policyengine_us/variables/gov/usda/school_meals/school_meal_net_rental_income.py b/policyengine_us/variables/gov/usda/school_meals/school_meal_net_rental_income.py new file mode 100644 index 00000000000..617bd35c7ee --- /dev/null +++ b/policyengine_us/variables/gov/usda/school_meals/school_meal_net_rental_income.py @@ -0,0 +1,20 @@ +from policyengine_us.model_api import * + + +class school_meal_net_rental_income(Variable): + value_type = float + entity = Person + definition_period = YEAR + unit = USD + label = "Net rental income for school meals" + documentation = ( + "A person's rental income plus their farm rental income. PolicyEngine " + "nets the two as one net rental income category before school meal " + "income treats a net loss as zero." + ) + reference = ( + "https://www.govinfo.gov/content/pkg/FR-2026-04-09/html/2026-06842.htm", + # PDF pages 27, 29. + "https://opi.mt.gov/Portals/182/Page%20Files/School%20Nutrition/Meal%20Eligibility/Forms%20and%20Policy/2017eligibilitymanual.pdf#page=27", + ) + adds = ["rental_income", "farm_rent_income"] From bef34c0691c87778b0315fd7abc2f2fa66f7a282 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 14:54:44 -0500 Subject: [PATCH 6/7] Describe school meal source lists as PolicyEngine's reading and reopen the supplement candidate USDA names no state supplement, so the source list now says PolicyEngine counts these totals as regular cash assistance from State or local governments. The state SSI supplement candidate returns to open, and its note states what the code counts. Co-Authored-By: Claude Opus 5.5 --- .../income/state_supplement_sources.yaml | 4 +++- source_conflicts/candidates.yaml | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml b/policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml index 14204ef6ec9..3da5318da9e 100644 --- a/policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml +++ b/policyengine_us/parameters/gov/usda/school_meals/income/state_supplement_sources.yaml @@ -1,4 +1,6 @@ -description: USDA counts these recurring state cash assistance totals for school meals. +description: >- + PolicyEngine counts these state cash assistance totals for school meals as + regular cash assistance from State or local governments. values: 2009-01-01: - ak_ssp diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index d9e0b92e6a0..764a1dab46f 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -15487,9 +15487,9 @@ candidates: - policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py prs: - https://github.com/PolicyEngine/policyengine-us/pull/10873 - state: ruled - note: PolicyEngine counts modeled state SSI supplements under the school meal regulation, USDA's current public - assistance definition and the Manual's page 26 state cash assistance category. The page 30 wording leaves a competing - exclusion reading. Congress also excludes some dividends, interest and child support for SSI under section - 1382a(b)(9) and (23), while USDA specifically counts those sources for school meals. PolicyEngine therefore does not - import every SSI exclusion into school meals. The reviewed USDA sources do not name state SSI supplements. + state: open + note: PolicyEngine counts each modeled state SSI supplement as regular cash assistance from State or local + governments, a category on page 26 of the Manual. Page 30's adoption of Social Security Act exclusions supports a + competing reading that excludes need-based supplements under section 1382a(b)(6). Congress also excludes some + dividends, interest and child support for SSI under section 1382a(b)(9) and (23), and the code counts those sources + for school meals, as USDA does. The USDA sources name no state SSI supplement. From c19c796174a46ce8902daab6601e4286b4869fb1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 18:51:05 -0500 Subject: [PATCH 7/7] Build new arrays in the school meal income formula The formula bound `income` to the array `add()` returns and then wrote into it with `+=` twice. `add()` returns its first variable's array unchanged when a source list holds one variable on the same entity, and the code-health guard `test_no_in_place_writes_to_cached_arrays` fails on both lines. Sum the two source lists in one expression and rebind `income` in the loop, so the formula builds new arrays. No expected value changes. Co-Authored-By: Claude Fable 5.2 --- .../gov/usda/school_meals/school_meal_countable_income.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py index 861f5078d71..7912cf34553 100644 --- a/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py +++ b/policyengine_us/variables/gov/usda/school_meals/school_meal_countable_income.py @@ -16,10 +16,11 @@ class school_meal_countable_income(Variable): def formula(spm_unit, period, parameters): p = parameters(period).gov.usda.school_meals.income - income = add(spm_unit, period, p.sources) - income += add(spm_unit, period, p.state_supplement_sources) + income = add(spm_unit, period, p.sources) + add( + spm_unit, period, p.state_supplement_sources + ) # Treat each person's net loss in each business, rental or # pass-through source as zero. for source in p.business_sources: - income += spm_unit.sum(max_(spm_unit.members(source, period), 0)) + income = income + spm_unit.sum(max_(spm_unit.members(source, period), 0)) return income