Skip to content

Fail the eCPS parity gate on stale exemptions; remove four rotted entries#337

Open
daphnehanse11 wants to merge 1 commit into
mainfrom
claude/distracted-cori-d88f21
Open

Fail the eCPS parity gate on stale exemptions; remove four rotted entries#337
daphnehanse11 wants to merge 1 commit into
mainfrom
claude/distracted-cori-d88f21

Conversation

@daphnehanse11

Copy link
Copy Markdown
Collaborator

Summary

parity_gate skipped names in the known-gaps exemption register (ecps_parity_known_gaps.json) unconditionally, with no staleness check — unlike its two sibling gates, which both fail on stale reviewed exclusions (default_valued_columns_gate at gates.py:707, source_stage_input_coverage_gate at gates.py:1499). That let register entries rot silently once the candidate started producing the exempted layer, which is exactly what happened to takes_up_medicaid_if_eligible when PR #334 started materializing the column.

Gate change

  • parity_gate now fails on any stale exemption — a known_gaps name whose candidate nonzero share is positive — with a message to remove or re-reason it.
  • Exemptions for layers the reference never populates are classified dormant and only reported (different reference vintages populate different layers), matching the sibling gates' treatment.
  • Details gain stale_exemptions and dormant_exemptions, flowing into the release manifest through _ecps_parity_gate unchanged.

Register audit: four entries removed

Checked every exemption against the current release pipeline. The parity gate runs on the base frame after with_us_immigration_inputs and with_us_take_up_inputs (build_us_fiscal_refresh_release.py), and the upstream immigration and take-up gates hard-fail unless these columns are present and non-constant — so four exempted layers are deterministically populated at parity-gate time (all four confirmed in PolicyEngineUSEngine().variables(), so they are measured):

Entry Produced by
takes_up_tanf_if_eligible contract-seeded take-up (#315)
takes_up_eitc contract-seeded take-up (#315)
ssn_card_type immigration stage (#266)
immigration_status_str immigration stage (#266)

The register was seeded (#316) from a parity run of an artifact predating that wiring, so these were stale on arrival. The remaining entries are safe: the other source stages declaring exempted outputs (SCF wealth, ORG wages, SIPP tips, …) are manifest declarations no tool currently executes.

Interaction with #334

#334 deletes the takes_up_medicaid_if_eligible exemption from the same register when it materializes Medicaid take-up. The hunks are disjoint, so the two PRs merge cleanly in either order, and they compose consistently: on this branch the candidate does not yet produce that column (treatment rate_unsourced), so the entry stays; once #334 lands, its own deletion is exactly what the new enforcement would demand. The medicaid case is the motivating example for this change. Closes the follow-up from the #334 review.

Tests

  • Five new TestParityGate cases: stale fails and names the variable; stale fails even when the reference lacks the layer; dormant passes but is reported; a stale exemption does not mask real gaps; clean-exemption details stay empty.
  • New register guard in test_us_parity_reference.py asserting no register entry names an immigration output or contract-seeded take-up flag, catching stale-on-arrival entries at test time rather than first at release-build time.
  • test_gates.py, test_us_parity_reference.py, and test_us_nonzero_shares.py pass (141 tests); ruff check/format clean.

Note: the runtime enforcement means the next release build fails if any exemption not statically verifiable here turns out to be populated on the real base H5 — that failure names exactly which entry to remove or re-reason, which is the intended behavior.

🤖 Generated with Claude Code

…ries

parity_gate skipped known-gap names unconditionally, unlike its sibling
gates (default_valued_columns_gate at gates.py:707 and
source_stage_input_coverage_gate at gates.py:1499), which both fail on
stale reviewed exclusions. That let register entries rot silently once
the candidate started producing the exempted layer (the
takes_up_medicaid_if_eligible case surfaced in PR #334).

The gate now fails on any exemption whose candidate nonzero share is
positive, reports exemptions the reference never populates as dormant,
and records both in the gate details. Auditing the register against the
current release pipeline found four entries stale on arrival — the
pipeline deterministically materializes them before the gate runs:
takes_up_tanf_if_eligible and takes_up_eitc (contract-seeded take-up,
PR #315), ssn_card_type and immigration_status_str (immigration stage,
#266). A new register test pins that statically-knowable subset so a
stale entry is caught at test time, not first at release-build time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant