Repository navigation
Conversation
…es (#1038) The congressional-district file (22incd.csv, TY2022 data stamped ty2023) was barred from being a taxable-interest control but still shipped its rows as TY2022 levels, and its US row compiled as a second national target. On the pinned 51aa40f feed's full surface its US row, states and districts each summed to $134.6B against Table 4.3's $340.4B (0.395x) and 48.5M against 54.2M returns (0.896x). The interest rebase now treats Historic Table 2 and the district file as share families: each row is its share of its own family's national all-AGI row times the Pub 1304 control (one factor per family, quantity and period), each family's US row retires, and each share row names its denominator in soi_share_total_source_record_id. Conflicting family totals refuse; equal ones name the smaller id. A share row with no family total is dropped beside an eligible control, as capital gains already does. Pinned feed: 974 district-file values move by x2.52943 (amounts) and x1.11577 (returns); the two district-file US rows retire (33,250 -> 33,248); 1,052 HT2 interest rows gain the denominator key, so national_state moves e1f9906bf0e0 -> 1b318eafb174 with no value change. state_cd values, counts and band verdicts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stamp differential now compiles Historic Table 2's TY2022 interest rows beside the district package. Stamped truthfully at 2022, the two families' US rows share a period, universe and status, so only the family in the denominator key keeps each on its own US row; a family-agnostic key fails this test (mutation run). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ding, doc numbers - The Hypothesis property now draws the district stamp (2022 or 2023) and an equal-valued twin US row on either side of "us", so its own-denominator and order-free clauses can fail (a family-blind key or a feed-order denominator breaks it), and checks that every rebased row's control is a compiled target. - Docstrings: "_2022" in congressional_district_2022 is the data year, not a boundary vintage; state the stamp <= control-period precondition and the pre-existing per-row-control vs per-pair-retirement corner (main has it for Historic Table 2 too; no current feed carries Table 1.4 interest). - Historic Table 2's states sit at 0.984 of the control for amounts and 0.992 for returns; the state_cd doc gives interest's new factor range (0.93-1.07, 0.981-1.001) and why it sits below 1. - _soi_bridged_quantity says it is the interest comparison key, not the materializer's full key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Heads-up from #1244, which makes the SOI congressional-district guards vintage-free. #1244 changes That test asserts main's semantics:
This PR retires the US row and drops uncontrolled shares, so those two assertions need updating when the second of the two lands. The controlled case (the band rebases onto Table 4.3, never onto a later-stamped district row) should still hold. Once this PR and #1040 both land, |
|
#1244 has merged ( |
#1250 review) From the in-session Opus review (review-opus.md): - F3: state_cd district blocks read their rows through cd_file_level, so state_cd_cd_file_value, state_cd_cd_file_state_sum and the rebase factor record the district file's own values again and the receipt's rebase factors match #1247's base. Bound values are unchanged. - F2: re-aging a share sibling like the bridged row refuses when the two age on different series, and the sibling's band median is re-aged with it, so its recorded ratio matches the unrebased case. - F4: AGI slices of the district file take the measure's one factor, as #1229 and #1040 rebase district slices, and the column guard checks them; tests pin the guard's eligibility rule and the slice rebase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #1038 (follow-up from the 2026-09-27 congressional-district concept sweep, lane D). Independent of #1036, #1040 and #1224; it builds on main.
Summary
The congressional-district file (
22incd.csv) is TY2022 data that the feed stamps ty2023 (Chronicle#117). Its taxable-interest rows (A00300/N00300) shipped on the defaultfullsurface as TY2022 levels.Historic Table 2's TY2022 interest rows have been rebased onto the latest Pub 1304 control since #518 (#489 adjudication): taxable interest grew x2.35 from TY2022 to TY2023, while interest dollar targets age on the CBO AGI default (x1.12). #518 barred the district file from being a control but left its own rows as levels.
On the pinned feed (
51aa40f), after aging:The district US row and Table 4.3 materialize the same unfiltered
taxable_interest_incomesum. On main the surface therefore asked for one quantity at two values 2.53x apart: the contradiction #489 removed for Historic Table 2. #1030's stamp correction moves these levels only about +3%.What changes (
fiscal_targets.py)Share families. The interest rebase now treats every stale photo as a share family (
_SOI_TAXABLE_INTEREST_SHARE_FAMILIES): Historic Table 2, and the district file of any data year (22incd.csv's record sets readcongressional_district_2022, the data year).soi_share_total_source_record_id. This is the key Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040 uses for capital gains.Denominators (
_soi_taxable_interest_share_national_totals).AmbiguousSoiTaxableInterestShareTotalError). Equal totals name the smaller record id, whatever the feed order.Controls are unchanged. The Table 4.3 control, reached through the declared
all_returns -> returns_excluding_dependentsuniverse bridge, applies to the district rows exactly as it does to Historic Table 2's. A share family still never anchors the control; the bar now covers any district file, where main matched only.congressional_district_2022..Hierarchy. One factor scales a family's states and its districts alike. So the
congressional_district_children_scale_to_state_parentrule that runs next reconciles all 872 district interest rows with factor 1.Stamp-invariance. A share divides the district rows by the district US row of the same restamped package, so the period stamp cancels. The value lands at the control's period (2023) and ages from there on the same link as the Table 4.3 row. This holds while the stamp is no later than the control's period. A family stamped after every control keeps its levels and its US row, as on main; the next district file under the same +1 stamp error would do this, and #1030's restamp prevents it. Tracked in #1236.
One behaviour change in a corner (both families)
A full-range row whose own family has no national total is now dropped when a control is eligible. On main it stayed as a stale TY2022 level beside the control.
test_stale_soi_taxable_interest_period_selection_lawspinned the old behaviour and is rewritten.Effect on the pinned feed
Release compile on
51aa40f: target period 2024, aging, packaged CD crosswalk, Medicaid substitution. A diff of every compiled spec against main (51a263726):full)f5bd921d6b21)5bdfa798ad97)national_statee1f9906bf0e0)1b318eafb174)soi_share_total_source_record_id. 1,034 of them are onnational_state, which is that surface's whole change: nonational_statevalue or membership moves.1.The tilt. Historic Table 2's US row includes Puerto Rico and other areas, so its rebased states sum to 0.984 of the control for amounts and 0.992 for returns. The district file has no other-area rows, so its states sum to exactly the control. In aggregate each district-file state target therefore sits about 1.7% (amounts) and 0.8% (returns) above the matching HT2 state share; per state the amount ratio runs from 0.80 (Wyoming) to 1.075 (Rhode Island, Delaware, DC), a spread typical of the CD-vs-HT2 pairs
fullalready carries.ACS-local (
tools/build_us_acs_local_release.pyon the same feed, main vs this PR):state_cd: all 26,425 spec values are identical (max relative difference 4.3e-16). Its counts, the factor band's out-of-band blocks, its drops and its internal-consistency check are all unchanged.state_cdalready used district interest rows only as within-state shares of Historic Table 2, so a national factor cancels.docs/us-acs-local-soi-target-surface.mdand a comment intools/us_acs_local_cd_surface.pyare updated.state/totals/full:irs_soicounts unchanged at 4,227 / 607 / 31,321. Onfull, the district interest values move as above.Invariants
us.soi_return_universe_bridge) as the control's universe and drops the materializer's no-opallledger filters (_is_noop_ledger_filter_value), so all-returns rows compare with the excluding-dependents Table 4.3 row.Tests
Run locally on the engine-free venv; the pinned-feed tests read
~/PolicyEngine/_buildh-runtime/inputs/consumer_facts_us_51aa40f.jsonl. CI has no feed and skips them.engine_free/us/test_us_fiscal_targets.py: 182 passed, plus the 3 pinned-feed tests (the receipt, the fences re-pinned at 33,248 /1b318eafb174, and the new district interest check).Neighbouring suites at
2b7164e15, 280 passed with none skipped:test_us_acs_local_sparse_cd.py, including the pinned-feedstate_cdcontract test;test_us_congressional_district_vintage.py;test_us_soi_state_agi_bands.py;shared/test_release_target_parity.py;test_us_release_gate_preflight.py;test_us_chronicle_feed.py;test_us_acs_local_release_tool.py.test_us_fiscal_refresh_builder.py: 327 passed, 6 skipped (they need the US engine extra).Mutation run. Each mutant of
fiscal_targets.pyran against the interest tests; two also ran against the pinned check. All 8 were killed (failing tests in brackets):4602d939dadds Historic Table 2 rows to the stamp differential to pin it. Since8bf49c35ethe property also draws that case.The mutants and log are in the evidence folder.
ruff checkandruff format --checkclean;tools/ci_test_plan.py verifypasses.8bf49c35ewas pushed during a host hold. It holds the property rewrite plus docstring and doc edits; CI's engine-free jobs cover it, and the interest and pinned suites re-run locally once the hold lifts.New tests:
Interplay
_soi_record_set_familyand Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040's_SoiShareTotal.congressional_district, this PR the substring.congressional_district_.90ad595a6merged into this PR, pinned compile): source files merge clean and no taxable-interest row moves. Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040's raw-key invariant still compares 35 of 52 families, none out of band.source_variableandtaxable_only, so it needs those before covering every measure.bab55cb97), which admits a rebased restamp whosesoi_share_total_source_record_idis a restamp of the same package and stamp.Overlay check (Read restamped Chronicle facts at their data year before aging #1030 head
c04a81ebamerged into this PR, pinned compile): no refusal; 33,248 targets and 6,102national_stateat24fdeda1f948.All 974 district interest rows are admitted:
uprating_from_period2023→2022,uprating_to_periodstays 2023, aging factor unchanged. No interest value moves.Owed by whichever lands second (pinned tests skip in CI, so CI will not catch either):
24fdeda1f948;test_pinned_feed_corrects_the_translated_congressional_district_specs. Its counts become 11,336 / 12,644 / 1,352 / 1,454, because the 487 interest amount rows stop aging on the chained TY2022 bridge and the 2 district US interest rows retire. Its "no restamped share" assertion must allow exactly the 974 district taxable-interest shares.The Read restamped Chronicle facts at their data year before aging #1030 session has the details.
Why this lands without a ruling
full.cos note-decisionon d539 and d1428 records that, so a ruling against the district-US-row denominator, or for dropping district-file rows, gets applied to these rows too.Review
In-session executed review. Three Opus 5.5 reviewers took distinct lenses: rebase logic, downstream and interplay, and method, tests and claims. An adversarial verifier re-checked each P1/P2 finding. Reports are
inhouse-review-*.mdandinhouse-verify-*.mdin the evidence folder. There was no P1.F1 (P2, confirmed). This body's Read restamped Chronicle facts at their data year before aging #1030 section was stale. It is fixed above, and the merged-state obligations are listed.
F-P2-a (P2, verified down to P3). The tilt cited Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040's unruled P2-3 as precedent, and the body did not say why Congressional-district capital-gains, SALT and PTC targets on the full surface cross IRS concepts #1038's ruling line does not bind. Both are fixed above, and
cosnotes are on d539 and d1428.P3s fixed in
8bf49c35e:state_cddoc's interest factors;P3s tracked in Taxable-interest rebase: per-row control choice and per-pair bridge retirement can disagree #1236:
Neither occurs on the pinned feed.
Checked fine (executed):
4602d939dthat is byte-identical to the dump;irs_interest_distributioncoverage requirement (1,016 → 1,015 matches); the parity manifest; target loss weights; the release-gate preflight;Methodology: all three reviewers judge this a bug fix under Taxable-interest HT2 national row exceeds its AGI-bin partition by 9.8%: HT2-vs-CD-table source discrepancy #489/Rebase stale HT2 taxable-interest rows onto the Pub 1304 national actual (#489 adjudication) #518, not a new modelling choice.
Independent GPT-6.1 Sol review (Subfleet
20261012-103246-review-1229, at2b7164e15): pending.Evidence (compile dumps, diff script, state_cd receipts, mutant log):
~/PolicyEngine/_reviews/cd-taxable-interest-20261012/.axiom: n/a: microsim target compilation, no policy rule changes.
🤖 Generated with Claude Code