Repository navigation
Match the SOI congressional-district file by family, at any vintage - #1244
Merged
Merged
Conversation
Every check that asked "is this the IRS congressional-district file?" matched the pinned package literally (`.congressional_district_2022.` or the family id `irs_soi.congressional_district_2022`). The next IRS district release would arrive as a new package, e.g. `irs_soi.ty2024.congressional_district_2024.all_returns`, and pass straight through the guards: a ty2024-stamped district US aggregate would out-date the ty2023 Table 4.3 control and become the taxable-interest rebase control (#489), and its PTC amount would compile. - fiscal_targets: `_is_soi_congressional_district_record_set` keys on `_soi_record_set_family(...) == "congressional_district"` (the helper #1036/#1040 add, mirrored verbatim). - release_target_parity: the red-line entry is the vintage-free `irs_soi.congressional_district`; every declared vintage must compile and at least one must be declared. New `us_target_family_vintage_free_id`. - tools/build_us_target_parity_manifest.py: the one-surface note is keyed by vintage-free family id. The exact pins stay exact on purpose and are now tied to the pinned feed scope: SOI_CONGRESSIONAL_DISTRICT_RECORD_SET_ID (household CD sampling reads one district file) and the soi-congressional-district-2022 coverage alias. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 12, 2026 18:42
This was referenced Oct 12, 2026
Contributor
Author
|
Merged at head
Executed evidence is in the PR body: byte-identical compile fingerprints on feeds None of the 63 commits main gained after CI ran touch the changed or dependent files, and the branch merges into current main without conflicts. |
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.
Every check that asks "is this the IRS SOI congressional-district file?" matched the pinned package literally:
".congressional_district_2022." in record_set_id, or the family idirs_soi.congressional_district_2022. The next IRS district release will arrive as a new package, e.g.irs_soi.ty2024.congressional_district_2024.all_returns, and it would pass straight through the guards:test_district_taxable_interest_never_controls_the_rebase[hypothetical-cd-2024]fails on main's predicate. It rebases the Historic Table 2 band onto the district row instead of Table 4.3.assigned_aca_ptcmeasures, would compile as a target.No target value and no registry version moves. Evidence is below.
Changes
fiscal_targets._is_soi_congressional_district_record_set(gates_soi_taxable_interest_control_key_from_factand_is_soi_cd_premium_tax_credit_amount_conflict, its only callers)".congressional_district_2022." in record_set_id_soi_record_set_family(record_set_id) == "congressional_district". The helper is copied verbatim from #1036/#1040, which are not merged.release_target_parity.RED_LINE_COMPILED_FAMILIES"irs_soi.congressional_district_2022", looked up by exact manifest key"irs_soi.congressional_district". At least one district family must be declared and every declared vintage must compile. New publicus_target_family_vintage_free_id.tools/build_us_target_parity_manifest.py_COMPILED_FAMILY_NOTESirs_soi.congressional_district_2022Left exact on purpose, and now tied to the pinned feed scope so a repin fails loudly at them:
SOI_CONGRESSIONAL_DISTRICT_RECORD_SET_ID. The household CD sampling distribution (tools/build_us_puf_support_base.py) must read exactly one district file. A 2024-only feed raisesNo SOI congressional-district return-count facts. A two-vintage feed reads only the pinned file and never mixes rows; a vintage-free match there would raise on duplicate geoids.soi-congressional-district-2022source-coverage alias (source_coverage.py;CONGRESSIONAL_DISTRICT_SOURCE_ALIASESandREVIEWED_EXCLUDED_ALIASESin the release builder). These are package registries, not family checks.chronicle_feed_scope.json,target_parity_manifest.json,target_parity_feed_families.json). It describes the pinned feed and regenerates byte-for-byte;TestRegenerationpasses locally with the feed present.Already vintage-free, unchanged:
us_critical_targets.is_congressional_district_target(.congressional_district_);irs_soi.congressional_district_spec prefix intools/build_us_acs_local_release.pyandtools/us_acs_local_cd_surface.py.Invariants (property-tested)
test_us_soi_congressional_district_vintage.py::test_district_guards_hold_at_every_vintagegenerates 400 record-set ids. Period tokens are none,ty/cy/fy, a bare year,monthYYYY_MMorYYYY_MM; district data vintages run 1990–2099; any trailing segments are allowed. It checks:.congressional_district_2022.matched still matches, and the two agree on every non-district id.irs_soi.congressional_district_prefix;us_critical_targetsclassifies the target as a district one.Example tests:
Evidence (executed locally)
Full compile fingerprint, main
7253402fbvs this branch. Each run replicates thepinned_feed_national_state_surfacefixture: compile at 2024 with the canonical CD crosswalk and age targets, apply Medicaid substitutions, selectnational_state, and build the exclusion receipt. Every per-spec line is byte-identical.national_statesurface51aa40f(pinned)f5bd921d6b21, identicale1f9906bf0e0, identicalc5e5bf80f3f81d9dd28, identical07f5c476b41d, identicalcf9ece2,f98acf4The only district record set on any of these feeds is
irs_soi.ty2023.congressional_district_2022.all_returns. Peak RSS was 3.0 GB.Mutation. Running the new tests in-process with main's guards patched back in:
The pinned 2022 cases pass under all three mutants.
Tests. The new file plus
test_release_target_parity.pygave 88 passed locally with the feed-dependent tests running.Scripts and outputs:
~/PolicyEngine/_reviews/cd-vintage-free-20261012/(pinned_feed_fingerprint.py,fp_*,feed_fact_equivalence.py,mutation_old_guards.py).Interaction with open PRs
_soi_record_set_familyelsewhere infiscal_targets.py. Whichever lands second gets ruff F811 on the duplicate; delete one copy. Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040 also deletes_is_soi_cd_premium_tax_credit_amount_conflict; that hunk is two unchanged lines below this PR's, so it merges without a conflict, and Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040 then drops this PR's PTC-conflict assertions with the function..congressional_district_substring, which is also vintage-free. Once Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040 and Rebase congressional-district taxable interest onto Table 4.3 as shares of the district file's US row #1229 both land,_is_soi_congressional_district_record_sethas no callers and can go.axiom: n/a: microsim target-compilation guard; no policy rule changes.
🤖 Generated with Claude Code