Repository navigation
Conversation
Fourteen SOI families bound a TY2022 Historic Table 2 US row beside a newer Pub 1304 Table 1.x row of the same model quantity on national_state, 0.3% to 12.2% apart. Each HT2 column counts the same Form 1040 line as its control (doc guides and same-year identities, TY2020-TY2023), so the gap is vintage. HT2 state rows now enter as shares of the latest registered control, and the HT2-lineage national rows of each rebased quantity retire. The state AGI bands read a rebased total's landing period, so they keep summing to their share after aging. The capital-gains chooser and the new one share one tie-refusing helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New engine-free tests: the register binds each HT2 column and its control to the same model quantity; all 14 columns rebase as shares; HT2's US workbook retires only with its own quantity; rows keep their level without an eligible control; tie refusal; Hypothesis properties for the chooser (order-free, latest, registered family only) and over compiles (shares conserved, states within the control, one national level, order-free). Nine source mutations each fail at least one test. - The #940 band test now covers a state total rebased onto Table 1.1, and the pinned Colorado top-tail check reads the rebased total. - Pinned feed: the invariant test bounds each state family by the smaller national target and requires one national value per quantity; a new test pins the 14 controls, factors and post-aging shares; the surface moves to 33,235 / 6,087 at 0e899cd7f893. - docs/us-soi-national-controls.md records the concept evidence, the gap decomposition and the effect on the pinned feed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6367e5c to
9c28954
Compare
…als (#1247 review) Addresses the GPT-6.1 Sol review of 9c28954: - Major: retirement matched by quantity alone, so with mixed HT2 vintages a newer HT2 US row could retire beside an older control. A lineage row now retires only if the control is at or after its own data year; the US workbook's data year comes from `state_<year>`, not its stamp. - Major: two HT2 US records for one key overwrote each other, letting feed order pick the rebase denominator. They now raise AmbiguousSoiNationalControlError; one record seen twice is fine. - Minor: the same-year HT2 / Pub 1304 difference is no longer attributed to HT2's processing year (both cover the same processing year; Pub 1304 "Domain of Study", HT2 guide endnote 1). Its cause is left open. New tests: the reviewer's mixed-vintage case, the workbook's data year, conflicting denominators in both orders, and a Hypothesis property over compiles for per-row retirement. The compile property's workbook now takes the HT2 vintage. On the pinned feed all 33,235 specs are identical to the previous head; 12 source mutations each fail at least one test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e_cd The state_cd level bridges lift charitable, interest-paid and QBI district levels by a sibling's Historic Table 2 / district-file ratio. Their siblings (itemized deductions, return count, AGI) are now national shares, so the ratio is read from the sibling's file level (cd_file_level), re-aged like the bridged row. Without this, the bridged amounts fell 9.07% (charitable and interest paid), 5.63% (QBI) and the counts 2.65% on the pinned feed; with it every state_cd value matches the #1247 base within 4.2e-15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Stacking note: #1250 is stacked on this branch at 🤖 Generated with Claude Code |
#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>
|
Queued Max's ruling for this PR as d1449; it closes when this PR merges or closes. This PR's session had stopped after round 2 (GPT-6.1 Sol APPROVE at 🤖 Generated with Claude Code |
|
A note for this PR's HT2 → Table 1.x control choice, from #1261 (#1258). #1261 gives the PUF donor separate Once chronicle#180 lands, there is an exact constraint conflict at national level, not a near-duplicate:
For TY2022, Table 1.4 gives $487.1B − $175.6B + $812.7B − $93.0B = $1,031.2B. HT2 gives $1,033.3B. If the national A26270 control and the four entity legs both bind, the solve is asked for two values of the same sum. Whichever family this PR's control selection treats as the national line-32 control should exclude the other at national level, or rebase one onto the other, as this PR does for the state rows. 🤖 Generated with Claude Code |
Fixes #1243. Stacked on #1036 (base
us-cg-returns-control-concept); this PR's two commits sit directly on #1036's head4e86ec358.Summary
On the pinned feed (
51aa40f), the route-Anational_statesurface binds two different national all-AGI targets for 14 SOI quantities. One is the stale Historic Table 2 (HT2) US row (TY2022); the other is a newer Pub 1304 Table 1.x row (TY2023). They are 0.3% to 12.2% apart, and two state families already sum past the smaller one (ira_distributionssum 1.019x,taxable_pension_incomecount 1.009x).This PR applies to all 14 the doctrine the taxable-interest (#489/#518) and capital-gains (#1035/#1036) families already use:
After it, every compared quantity has one national value and no state family exceeds it. The PR moves published target values, so it waits on Max's ruling (decision to be queued after review) and on #1036 (d468).
Per-family decision
All 14 columns rebase. Each one passed both checks for TY2020-TY2023:
20incmdocguide.docto23incmdocguide.doc) define the HT2 column at the same Form 1040 line as the Table 1.4 column.By contrast, the capital-gains columns differ by 2.36x because they count different populations. Both rows of each pair below already bind the same model variable and measure mode, and a new test enforces this.
Where the gaps came from. Each gap is a vintage factor times that small same-year difference; neither is a concept difference.
docs/us-soi-national-controls.mdhas the full decomposition table.Fourth national row. The return count had another national row: HT2's own US workbook (
22in54us.xlsx, "Historic Table 2 state data, United States total"), packaged asirs_soi.ty2023.state_2022.us. It holds TY2022 data stamped ty2023 and is retired with the HT2 US row.What changes (
fiscal_targets.py)_SOI_HT2_NATIONAL_CONTROLS: a reviewed register mapping each of the 14 HT2 measure ids to a control table and column, plus the Form 1040 line both report._rebase_stale_soi_ht2_distributionsruns after the capital-gains rebase and before the State top-tail income mass is uncalibrated: CO M+ AGI at 24% of SOI in buildp-acs-local (fails progressive-bracket scoring) #940 bands.value x control / HT2 US, landing at the control's period, withuprating_*receipts andsoi_source_concept/soi_control_concept.state_<year>.us) of each rebased model quantity retire, each only if the control is at or after its own data year. The workbook's data year comes fromstate_<year>, not its stamp. Matching is by quantity, so the workbook's EITC row, which shares measure idreturn_count, stays.AmbiguousSoiNationalControlErrorrather than letting feed order pick the denominator._latest_unambiguous_soi_controls: Choose the capital-gains rebase control by concept and period, not feed order #1036's tie-refusing chooser, extracted and now shared by both passes, with unchanged behavior. A tie at the winning period raisesAmbiguousSoiNationalControlError._soi_state_agi_band_controls(State top-tail income mass is uncalibrated: CO M+ AGI at 24% of SOI in buildp-acs-local (fails progressive-bracket scoring) #940) reads a rebased total'suprating_to_period, the period_age_specages it from. Without this, AGI bands would age from TY2022 while their total ages from TY2023 and overshoot by 3.05%; mutation M2 below confirms it.Effect on the pinned feed
Release compile:
target_period=2024,age_targets=True, packaged CD crosswalk, Medicaid substitution. Before =main+ #1036.national_statetargetsnational_stateregistry882f4764a2480e899cd7f893f095716848850bbbad9b22d1national_state;full;22in55cmcsv.csv, within 4e-16, and each band stays its recorded share within 6e-16.state/totals/fullSOI counts are unchanged (4,227 / 607 / 31,321), but the same state rows and bands carry the new values.state_cddistrict blocks re-reconcile to the rebased HT2 parents; its feed-gated suite passes.Invariants
national_state, each of the 63 compared SOI families sums to at most the smallest national target of its quantity, and the national targets of each quantity agree on one value.test_pinned_feed_no_soi_state_family_sums_past_its_national_targetis tightened frommaxtominand adds the one-value check. Table 1.2's copies of Table 1.1's count and AGI are equal and stay.Tests
test_us_soi_ht2_national_controls.py(40 tests):0e899cd7f893.490b67181): fiscal targets, bands, this file, release parity, ACS-local release tool, ACS-local sparse CD, Chronicle feed and source coverage, 424 passed;main+ Choose the capital-gains rebase control by concept and period, not feed order #1036 + the first revision (6367e5cff): the whole engine-free tree, 13,148 passed, 72 skipped, 1 failed. The failure istest_telemetry_emitter.py::test_subprocess_exchanges_ambient_token_and_delivers_events, whose local service did not become ready on a saturated host; it touches no code here;The review fixes compile the pinned feed to byte-identical specs (all 33,235). The 24
maincommits Choose the capital-gains rebase control by concept and period, not feed order #1036 lacks touch no file on the US target-compile path (UK, NZ, source-manifest, data-contract and lockfile changes).main; it will run when Choose the capital-gains rebase control by concept and period, not feed order #1036 merges and this PR retargets.ruff checkandruff format --checkare clean on the touched files.Evidence:
~/PolicyEngine/_reviews/soi-national-controls-20261012/. It holdsidentities.py/identities.json, the doc-guide text,before/andafter/compiles,diff.json,scripts/andmutations.log. The IRS workbooks for Table 1.4 TY2020-TY2023 and HT2 TY2022/TY2023 are sha256-identical to the feed's sources.Interactions
mainwhen Choose the capital-gains rebase control by concept and period, not feed order #1036 merges.state_2022.us. Retirement matches by quantity, not stamp, so the row retires either way. Whichever lands second re-pins the surface digest.fiscal_targets.py._soi_record_set_familyhelper tomain. Whichever of it and Choose the capital-gains rebase control by concept and period, not feed order #1036 merges second keeps one copy; this PR only calls the helper.state_2023.usmatches the lineage rule.Not changed here
full. The district file's US row is still a second national level for 11 of the quantities (Table 1.x / CD US = 1.001 to 1.169). A follow-up task is filed, in line with Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040, Rebase congressional-district taxable interest onto Table 4.3 as shares of the district file's US row #1229 and Bind congressional-district interest paid as mortgage interest shares #1231.employment_income; the engine taxesirs_employment_income#1191). Both rows bind grossemployment_income, unchanged.Review
Round 1 (independent GPT-6.1 Sol,
review-1247.md): REQUEST CHANGES, two majors and one minor, all fixed in490b67181(see the commit message). Round 2 (delta re-review, Subfleet job20261012-155332-pr1247-review-r2): pending.axiom: n/a: calibration-target compilation (no tax-benefit rule changes)
🤖 Generated with Claude Code