Restore Social Security retirement input and remove reported benefit switches#8263
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8263 +/- ##
============================================
- Coverage 100.00% 70.46% -29.54%
============================================
Files 3 4723 +4720
Lines 63 68766 +68703
Branches 0 340 +340
============================================
+ Hits 63 48457 +48394
- Misses 0 20307 +20307
- Partials 0 2 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restores
social_security_retirementas the canonical microsimulation input and removessocial_security_retirement_reportedplusgov.simulation.reported_social_security_retirement.Also removes package-side reported-data switches and public reported variables where policyengine-us can calculate or users can override the canonical variable directly:
gov.simulation.reported_snap;snapalways uses the modeled SNAP formula, with microsimulation participation controlled bytakes_up_snap_if_eligible.snap_reportedandtanf_reported; WA ECEAP now uses canonicalsnap,tanf, andssivariables.is_ssi_disableddepend on modeled disability status instead ofssi_reportedreceipt.spm_unit_wic,spm_unit_pell_grant, andspm_unit_broadband_subsidywrappers; callers now aggregate canonical variables withadd, and SPM net income includes modeled ACP/EBB directly as broadband subsidies.spm_unit_capped_housing_subsidy_dataandspm_unit_energy_subsidy_data.Lower-level SSA calculation internals remain in place, but are not wired into
social_security_retirement. The data contract is: us-data supplies non-formulaic leaf inputs, policyengine-us calculates formulaic variables, and API users override canonical variables directly when needed.Root cause
PR #8040 made
social_security_retirementformula-driven by default and redirected observed data throughsocial_security_retirement_reported. Current data artifacts and downstream microsim usage expect the canonical variable to besocial_security_retirement, so the split can drop or ignore retirement Social Security inputs and distort senior SPM resources.The same audit found several package formulas using reported survey variables as model controls. Reported survey fields can be used by us-data to construct calibrated inputs, but package formulas and user-facing APIs should calculate or override canonical model variables directly.
Validation
uv run ruff check ...on touched Python filesuv run pytest policyengine_us/tests/policy/contrib/ssa/test_trustees_core_thresholds.py -quv run pytest policyengine_us/tests/core/test_run_selective_tests.py -quv run pytest policyengine_us/tests/policy/baseline/gov/fcc/test_vectorization.py -quv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/ssa/social_security --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/ssa/ssi --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/usda/snap --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/hhs/tanf --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/usda/wic --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/usda/school_meals --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/fcc --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/ed/pell_grant/pell_grant_simplified_formula_applies.yaml --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/irs/deductions/itemized/salt_and_real_estate --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/tax/income --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/household/income/household/household_state_income_tax.yaml --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/household/household_state_income_tax.yaml --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/household/income/spm_unit --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/household/expense --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/wa/dcyf/eceap --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/contrib/congress/tlaib/boost/boost_middle_class_tax_credit.yaml --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/contrib/congress/tlaib/end_child_poverty_act/integration.yaml --batches 1uv run python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/contrib/congress/tlaib/economic_dignity_for_all_agenda/edaa_end_child_poverty_act.yaml --batches 1social_security_retirement,snap,tanf,wic,pell_grant,acp, andebbremain presentgit diff --check