[codex] Add SNAP local proxy diagnostics scaffold#241
Conversation
1510ad5 to
3b10a40
Compare
Two fixes to the SNAP local proxy diagnostics against the rebased main:
Match calibration diagnostics to state SNAP target specs by diagnostic
name ({spec.name}@{period}), the same join _critical_target_fit_failures
uses. The positional zip it replaces silently misattributed every state
error after a skipped target.
Normalize congressional-district identifiers to the geography spine's
bare 4-digit SSDD vocabulary on both sides of the ACS join: household
spine values pass through, Census summary-level prefixed ids
(5001700US0601 / 5001900US0601) are stripped with the same parser the
CD distribution loader uses. Without this every district row flagged
missing_acs_reference in real runs. The builder's local copy of the CD
geoid column constant now imports from congressional_district_geography
instead of redeclaring it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Rebased onto current main (post #266/#277/#279/#245 — one conflict in the
Full populace-build suite passes. Remaining review note (not addressed here): Sequencing note: the |
Summary
Refs #240.
This starts the SNAP congressional-district validation path without changing calibration policy. It adds a validation-only
snap_local_proxydiagnostics helper that can compare household-level Populace SNAP receipt/support against ACS S2201 district SNAP household estimates, including support and quality flags.The release builder now recognizes an optional
snap_local_proxy.jsonartifact in the release manifest when one is present, matching the optional diagnostics pattern used fordemographics.jsonandreform_validation.json.Notes
This PR intentionally does not promote ACS S2201 to a hard target and does not run formula SNAP by congressional district. It provides the testable payload builder and manifest hook so the next slice can wire the actual source/runtime inputs once we choose the cheapest build-time path.
Validation
uv run pytest packages/populace-build/tests/test_us_snap_local_proxy.py packages/populace-build/tests/test_us_fiscal_refresh_builder.py -quv run ruff check packages/populace-build/src/populace/build/us_runtime/snap_local_proxy.py packages/populace-build/src/populace/build/us_runtime/__init__.py tools/build_us_fiscal_refresh_release.py packages/populace-build/tests/test_us_snap_local_proxy.py packages/populace-build/tests/test_us_fiscal_refresh_builder.py