Skip to content

Merge four held US SOI target corrections (#1224, #1036, #1040, #1030) on the current feed - #1733

Merged
juaristi22 merged 41 commits into
mainfrom
claude/us-soi-target-corrections
Nov 25, 2026
Merged

juaristi22 merged 41 commits into
mainfrom
claude/us-soi-target-corrections

Conversation

@juaristi22

@juaristi22 juaristi22 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1728. Closes #1035. Closes #1038.

This PR is PR 0 of the #1728 plan. It merges four of Max's PRs, each one unchanged. It adds the changes that their merge with main needs, and it re-pins their values on the feed that main pins (41b2fb2). It changes target values in the national and the local build.

Rulings

The four PRs were held for Max's rulings. María, who leads the US data work, ruled on them herself on 25 November 2026. This PR body is the record of those rulings. Max has not commented on them yet.

Decision PR Ruling
d462, d464 #1030 Yes. Correct all five restamped packages inside microcosm until the feed is re-pinned onto a Chronicle commit that stamps them truthfully.
d468 #1036 Yes. The matching national measure (Table 1.4) is the control, and the Historic Table 2 state rows are shares of it.
d539 #1040 Yes. District capital gains are shares of the national control.

#1224 needs no ruling: its body calls it a bug fix.

María also asked that district rows nest within their state targets.

  • The ACS local state_cd surface already does this. In all 43 states with district rows, the district capital-gains rows sum exactly to the Historic Table 2 state row.
  • On the national full surface, district rows sum to the district file's own state rows instead. Those differ from the Historic Table 2 rows (capital-gains amounts: median +1.8%, Montana −27%). No production build uses full.
  • One nesting rule for every district family goes to the district-targets work (US local build: district targets that exist but are not in the fit #1731), not to this PR.

Commits

Commit What it does
c7b5ff9ff Merges #1224 at 47b590f38: drop district SALT and PTC facts read from the wrong IRS column
c134ca0e4 Merges #1036 at 4e86ec358: choose the capital-gains control by concept and period
2c92f2d30 Merges #1040 at d3a625350: district capital gains as shares of the Table 1.4 control
b4157efbe Merges #1030 at 03ceca6ad: read restamped facts at their data year before aging
a86a7af10 Aligns the four with main's #1244 district guards
79a3c3e9e Re-pins every value on the 41b2fb2 feed and updates three docs
00b4f60e1 Merges main (#1697, #1690)
006afbedc Lists us_runtime.source_vintage among the modules the gate bindings reach

Each merge commit message lists its conflicts and how they were resolved. #1244 merged after these PRs were last updated. Three items did not show as text conflicts:

Effect on targets

Compiled as the release does (target period 2024, aging, the district crosswalk, the Medicaid substitution) on the 41b2fb2 feed. Main is cac12ab01.

Surface Main This PR Values that move
national_state 6,102 (c698e70d33ce) 6,102 (4dfe25b1238a) 52
Release compile (full) 33,250 (bf021cdc9749) 31,748 (4cc4cfb7a147) see below
ACS local state 4,380 4,380 51
ACS local state_cd 26,425 26,425 478 capital-gains rows; 6,042 others by less than 1e-12
ACS local totals (SOI rows) 607 102 —
ACS local full (SOI rows) 31,321 29,824 —
  • The 51 Historic Table 2 state net-capital-gains return counts move ×0.415203. Their sum was 29,599,604, which is 2.39 times the national Table 1.4 target of 12,392,020. It is now 12,289,836. These rows are in both builds.
  • The W-2 Box 7 tips amount moves from $28,280,884,269 to $34,287,530,779 (+21.2%). It is TY2020 data that the feed labels TY2023: IRS has published no W-2 table after TY2020 (Stamp the W-2 item facts with Tax Year 2020; the 2024 tips target moves from $28.28B to $34.29B #1192 checked this on 10 October). It used to age one year, on the CBO wage ratio for 2024 over 2023 (×1.056). It now ages from 2020: SOI Table 1.4 wages for 2023 over 2020, then the same CBO ratio (×1.280).
    • No IRS figure for 2024 exists to check it against. CRS (IF12728, updated 29 May 2025) cites IRS data of about $38 billion of tips on the W-2s of 6 million returns for TY2018, without naming the box. The TY2020 Box 7 total is $26.8 billion. So $34.3 billion for 2024 is not high against that history.
  • No other national_state value moves. 102 Historic Table 2 capital-gains rows gain soi_share_total_source_record_id.

36 rows that the PRs' pins did not show. #1224 and #1040 pinned 31,786 and 31,784 compiled targets. Their last commits run the column exclusion before the district crosswalk. The crosswalk copies a state row to an at-large district only for a measure that the district file carries. So the 36 Historic Table 2 SALT and premium-tax-credit rows that it copied to the nine at-large districts no longer compile. Each repeated its state row, and only full, totals and the local full mode held them. The feed-gated tests skip in CI, so those pins were not re-run then. They are re-run now.

Tests

  • The pinned feed was rebuilt with tools/build_us_chronicle_feed.py from Chronicle 41b2fb2b: 40,642 rows, facts_sha256 1d45a89c…, the same as the pin.
  • With the feed present and MICROCOSM_US_CHRONICLE_FACTS set, 1,296 tests pass in 11 touched and feed-gated files, none skipped:
    • test_us_fiscal_targets.py, test_us_acs_local_release_tool.py, test_us_acs_local_sparse_cd.py, test_release_target_parity.py;
    • test_us_soi_congressional_district_vintage.py, test_us_source_vintage.py, test_us_spine_blindness.py, test_us_chronicle_feed.py;
    • test_us_eitc_table_2_5_irs_reconciliation.py, test_us_soi_state_agi_bands.py, test_us_acs_local_cd_properties.py.
  • ruff check . and tools/ci_test_plan.py verify pass.
  • CI's first engine-free run failed on one module-count test, which 006afbedc corrects. Before that push, with main merged in, 16,992 US and shared engine-free tests passed locally (218 skipped, 3 expected failures).
  • Not run locally: the rest of the engine-free suite and the engine jobs. CI runs them.

How to merge

Builds

This PR changes target values, so a build must measure it:

After this PR

🤖 Generated with Claude Code

MaxGhenis and others added 30 commits September 25, 2026 18:10
The pinned US Chronicle feed (c5e5bf8) stamps five packages' pinned files
as ty2023: the TY2020 W-2 table and the TY2022 congressional-district,
state and IRA tables, 26,893 facts (PolicyEngine/chronicle#117). Target
aging started from the stamp, so the route-A W-2 Box 7 tips amount aged
2023->2024 on the direct CBO ratio ($28.28B) instead of 2020->2024 on the
chained SOI wages bridge ($34.29B), and the full-surface
congressional-district dollar targets aged one link short.

source_vintage detects an observation fact whose raw_r2_key artifact year
precedes its period, requires a reviewed US_RESTAMPED_SOURCE_PACKAGES
entry for it (the compile refuses otherwise), and moves source_period,
and uprating_to_period for specs rebased onto a restamped control, to the
data year before aging. Values, names and vintage selection are
unchanged. On the pinned feed national_state keeps 5,695 targets
(registry 386fac439e77 -> a3547c5322da) and only the tips amount moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aging

# Conflicts:
#	packages/microcosm-build/tests/test_us_fiscal_targets.py
… the stamp

Round-1 review of #1030 (correctness and claims lenses):

- Detect a registered restamp by its file sha256 as well as by the
  raw_r2_key year, so a storage-key layout change cannot hide it, and add a
  reviewed exemption register for truthful later observations (a multi-year
  release keyed by its publication year).
- Refuse a restamp that would outrank a truthful fact dated after its data
  year in latest-vintage selection, and one that sits in an aging growth
  index; both still read the stamp.
- Fail closed where the correction cannot vouch for a spec: a comparable
  period that differs from the stamp, a multi-fact spec with a restamped
  member.
- Re-pin after merging #1029: national_state keeps 5,694 targets and moves
  from d315c75804ef to 884bc45ef335; only the tips amount value moves.
- Correct the docs and changelog: #117 covers the CD file only, most restamps
  predate the 2026-09-18 re-pin, and the full-surface moves are relative to
  data-year aging under the current series policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pin that the CD-crosswalk-translated specs carry the correction (23,980
  translated, 11,772 of them chained dollar targets; 26,791 direct and 60
  rebased corrections on the pinned feed).
- Test the compile's aging-index check (it runs only when aging), the CBO
  projection branch, an exemption's period bound, and the shadow guard's
  stamp-year bound.
- The shadow guard now reads each candidate's own period key and considers
  only candidates eligible at the target period, so it cannot refuse a
  compile over facts selection would drop anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed order

Historic Table 2 and congressional-district N01000 count Form 1040 line 7
returns (gain, loss-limited loss or distributions only); Table 1.4 col 37,
the population capital_gains_gross measures, counts Schedule D gain returns
only. The rebase control is now the latest Table 1.4 fact not after the build
period, CD and HT2 rows never qualify, a tie between matched records refuses
the compile, and a line-7 row without a usable control is dropped instead of
shipping as a level. Rebased rows declare the bridge in soi_source_concept /
soi_control_concept.

On the pinned feed the 51 national_state HT2 state return counts go from
29,599,604 (2.39x the national 12,392,020 target) back to Build P's
12,289,836; amounts keep their values. national_state registry
d315c75804ef -> 65e4dde11c83 (microcosm#1035).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…review)

The chooser now treats one record id carrying two values or period labels at
the winning period as ambiguous too, so no feed order can pick the value.
Tests cover that, an equivalent period label, and a tie at a superseded period.
The model-concept comment scopes "no loss returns" to the Build P release
data, and the doc's AGI-mix median is the median absolute change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…abeled CD columns (#1038)

On the full target surface the congressional-district file's capital-gains
rows compiled as Form 1040 line-7 levels onto capital_gains_gross (Schedule D
gain): its states and districts each summed to 29,845,710 returns, 2.41x the
Table 1.4 target, and $1,522.2B, 1.198x. They now enter as shares of the
file's own US row scaled to the Table 1.4 control, as Historic Table 2 rows do
since #1036; the US row retires and every share row names its denominator in
soi_share_total_source_record_id.

The same package reads N18425/A18425 (state and local income taxes) as the
limited SALT deduction and N85530/A85530 (additional Medicare tax) as the
premium tax credit. US_FISCAL_TARGET_SOURCE_COLUMN_EXCLUSIONS drops facts by
(measure id, IRS column), replaces the hard-coded CD PTC-amount check, and is
listed in the exclusion receipt and the release coverage report.

On the pinned feed: 31,376 compiled targets (was 32,842), no CD-file family
past its national target on full (was 3), national_state values and
membership unchanged (version moves only for the new provenance key).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s and totals (#1040 review)

The congressional-district package reads interest_paid_deduction_* from
N19300/A19300, Schedule A line 8a mortgage interest, while interest_deduction
is the line 10 total; add both to US_FISCAL_TARGET_SOURCE_COLUMN_EXCLUSIONS.
A congressional-district fact of a listed measure with no
layout.source_column_id now refuses (MissingSoiSourceColumnError) instead of
compiling unchecked, and a capital-gains share row that has a control but no
national total of its own family refuses
(MissingSoiCapitalGainsShareTotalError) instead of dropping silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-concept

# Conflicts:
#	packages/microcosm-build/tests/engine_free/us/test_us_fiscal_targets.py
…-concept

# Conflicts:
#	packages/microcosm-build/tests/engine_free/us/test_us_fiscal_targets.py
main re-pinned the US Chronicle feed to 51aa40f (#940), whose capital-gains
cells are identical to c5e5bf8's. Compiled there, this change still moves the
same 60 Historic Table 2 return counts by 0.415202720927 and adds the concept
keys to the 60 amount specs; national_state goes from e1f9906bf0e0 to
882f4764a248 at 6,102 targets (full f5bd921d6b21 to f09571684885).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…S column (#1038)

Chronicle's congressional_district_2022 package reads
limited_state_local_taxes_* from N18425/A18425 (state and local income taxes,
Schedule A line 5a) and premium_tax_credit_* from N85530/A85530 (additional
Medicare tax, Form 8959 line 24); Historic Table 2 reads N18460/A18460 and
N85770/A85770. A reviewed register keyed by (measure id, IRS column),
US_FISCAL_TARGET_SOURCE_COLUMN_EXCLUSIONS, drops those facts at every
geography and vintage, refuses a listed district fact that names no column,
and is listed in the exclusion receipt and the release coverage report. It
replaces the hard-coded district PTC-amount check.

On the pinned 51aa40f feed: 1,464 district specs leave the full surface
(976 SALT, which summed to 1.98x the national target, and 488 PTC returns);
national_state is byte-identical (e1f9906bf0e0); full f5bd921d6b21 ->
f38dbd749180.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n exclusions with #1224

Review (review-1040.md) follow-ups:
- Interest paid stays out of US_FISCAL_TARGET_SOURCE_COLUMN_EXCLUSIONS: N19300
  (line 8a mortgage interest) is a component of the line 10 deduction, not
  another concept, and it feeds state_cd's itemized bridge; its share-or-drop
  decision is a separate chip. The register comment, docs and claims now say
  50 of the package's 56 measures have a Historic Table 2 twin.
- A share row with no national row of its own family is dropped, as the
  established rule and test_stale_soi_capital_gains_without_source_total_is_dropped
  require; the pinned invariant is now two-sided (every compared district
  family keeps its state and district rows and sits in (0.85, 1] of its
  national target), so a vanished or partial family fails.
- The CD-vs-HT2 tilt (0.8% returns, 2.1% amounts) is stated plainly; the
  amount agreement is reported on the demeaned comparison with the worst
  states named.
- The Hypothesis property draws Historic Table 2 rows alongside and checks
  each family divides by, and names, its own US row; comments on CD boundary
  vintages sharing a family and on a corrected PTC package.

The SALT/PTC column exclusions are now #1224 (a bug fix that lands on its
own); this branch carries them byte-identical until it merges. Pins on the
51aa40f feed: 31,784 compiled (full 6e1ac91262bc), national_state 6,102 at
84504a7afd57.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-concept

# Conflicts:
#	packages/microcosm-build/tests/engine_free/us/test_us_fiscal_targets.py
Measured with state_admin_specs on the pinned 51aa40f feed: --soi-mode totals
keeps 120 SOI specs (the Historic Table 2 premium-tax-credit rows only) and
full 29,860, as docs/us-acs-local-soi-target-surface.md states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… under the share rebase

The ACS-local contract test pins totals at 120 SOI specs and full at 29,860
(identical to #1224). With the district file's capital-gains rows as shares of
the Table 1.4 control, state_cd's capital-gains amount rebase factors move from
0.77-1.00 to 0.93-1.20 (median 0.98); its counts and factor-band verdicts are
unchanged (measured on the pinned 51aa40f feed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves three conflicts:
- fiscal_targets.py: the selection docstring keeps main's state AGI-band
  vintage note (microcosm#940) and #1030's restamp-shadow note.
- test_us_fiscal_targets.py: the pinned-feed fixtures now live in
  test_support (main, #998); #1030's pinned_feed_facts fixture moves there
  and the national_state surface fixture builds on it. The surface pins take
  main's values here and are re-pinned on the 51aa40f feed in a later commit.

test_us_source_vintage.py moves to tests/engine_free/us/ (#998 layout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d total

apply_source_vintage_corrections refused every restamped fact that carried
uprating_factor. A congressional-district capital-gains row rebased as a share
of the same package's US row times the Table 1.4 control (microcosm#1040) is
such a fact, so #1030 plus #1040 refused every pinned compile.

A rebased restamp is now admitted only when the total its rebase names in
soi_share_total_source_record_id is a restamp of the same package, stamp and
data year, and its uprating_from_period is the stamp or the data year. The
stamp then cancels in the share and the level is the control's: source_period
and uprating_from_period move to the data year, and uprating_to_period, where
aging starts, stays at the control's period. Moving it would age the
control's data-year-to-control-period change twice (x0.761 for CD capital
gains). A missing, truthful or mixed-vintage total still refuses.

The module docstring no longer says the CD row wins the capital-gains control
tie: a restamped control keeps the selection its stamp won, which holds
whichever rule picks the control.

Tests: an admitted same-package share (and its idempotence), seven refusals
(no total, truthful total, another package, stamp or data year, another
reading period, no reading period), and the Hypothesis property now draws
uprating_factor, uprating_from_period and share totals across packages and
vintages, with the exact refusal oracle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…free

On the 51aa40f feed (main since #940) main + #1030 compiles 33,250 targets,
6,102 on national_state at 61f5cac06310 (main: e1f9906bf0e0). Every other
#1030 figure is unchanged from c5e5bf8: one national_state value moves (the
W-2 tips amount, $28,280,884,269 -> $34,287,530,779), 53 specs change
metadata only, 13,176 CD-file dollar targets age from TY2022, the corrected
spec counter is 11,772/12,208/1,404/1,404/2/1 and 60 specs carry a control
correction.

test_pinned_feed_capital_gains_returns_control_reads_its_data_year named the
CD US row as the control, which microcosm#1036 makes impossible. It becomes
test_pinned_feed_rebased_specs_read_restamped_inputs_at_their_data_year: every
spec rebased onto a restamped control reads its data year, and every rebased
restamp is a same-package share whose aging still starts at the control's
period, whichever control the compile picks. The counter test also pins that
main compiles no restamped share.

Docs and changelog: the share reading, the new hashes, chronicle#292's merge,
and #1036 as the open control question (d468).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The extended generator drew each correction's vintage independently, so a
same-package, same-stamp, same-data-year share total was rare and almost
every call with a rebased restamp refused: 13 admitted shares in 500
examples. Each case now draws a small vintage pool, and half the cases are
well-formed (every rebased restamp is a valid share), which leaves the other
half to exercise the exact refusal oracle. Measured over 500 examples: 100
admitted shares (plus their idempotent second pass), 34 refused calls, 122
control corrections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Differential at the value level, inside #1030: one congressional-district
capital-gains share built from the package stamped ty2023 (then corrected)
and from the package stamped truthfully at 2022 ages to the same value, from
the control's 2023 period on the direct CBO 2024/2023 ratio, and passes the
period contract. Starting the aging at the data year instead multiplies by
the Table 1.4 TY2022-to-TY2023 ratio a second time; the test pins that
contrast. Before this, the aging start was checked only through metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every fixed vintage in the generator had data year 2022, so a mutant that
stopped comparing the share total's data year survived the property and was
caught only by the parametrized refusal. The pool gains ("pkg_a", 2023,
2020), so each kind of near miss (package, stamp, data year) is common.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A total that differs from the row's vintage in exactly one of package, stamp
and data year was reachable only in the free mode and rarely alone in its
call, so mutants that dropped one of those comparisons survived the property
(the parametrized refusals still caught them). The generator now has three
modes: free, well-formed (every rebased restamp is a valid share) and
near-miss (each rebased restamp names a one-component near miss).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a local merge of #1040, the 487 congressional-district capital-gains
amount shares are admitted and aged from the control's 2023 period, and
aging records that start in source_period. The counter test's "every
corrected CD spec reads 2022" now allows exactly that case (a rebased spec
whose source_period is its uprating_to_period), so a later merge re-pins only
counts. Measured on #1040 + this branch: all 974 shares keep #1040's values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ear-miss modes

Hypothesis favours one-vintage pools, so a well-formed or near-miss partner
often did not exist and the admitted-share count swung from 13 to 64 per
500 examples between runs; two mutants (stamp not compared, missing total
admitted) survived the property alone. Each rebased restamp in those modes
now gets a total of its own: at the row's vintage (well-formed) or one
component off (near-miss). Two runs: 55 and 124 admitted shares, 64 and 44
refused calls, 129 and 116 control corrections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1040 re-review nits

From the #1224 review (P2/P3), carried here byte-identical: the
congressional-district crosswalk sums source districts under the first
contributor's layout, so US_FISCAL_TARGET_SOURCE_COLUMN_EXCLUSIONS and the
missing-column refusal now run on each source fact before translation, in the
compile and the receipt (which therefore lists 4 x 480 source ids); tests
cover mixed-column merges in both orders, every missing-column order, and a
corrected A85770 PTC amount.

From the #1040 re-review (APPROVE WITH NITS): the doc says the return counts
agree among the tightest pairs (ninth of 45 by median gap) and that the
CD-over-HT2 tilt holds in aggregate (Montana's amount is 0.73x); the
congressional-district parity-manifest note names the capital-gains shares,
the retired US row and the column exclusions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 11 commits October 12, 2026 12:38
A rebased restamp with a valid total but a reading period that is neither the
stamp nor the data year (or none) arose only in the free mode, so a mutant
that skipped that check was caught by the property in one sweep run and not
in another. The near-miss mode now draws exactly one defect among package,
stamp, data year and reading period.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uard

Round-3 review (GPT-6.1 Sol) noted a dormant gap from the merge with #940:
a state AGI band's selection key ends in its period, and one whole vintage is
then kept per state and measure, so the shadow guard, which compared
candidates per key, could not see a restamped band vintage displacing a
truthful band vintage of another period or other bounds. The guard now
compares flagged bands at the grain selection uses. No restamped package on
the pinned feed carries band rows, so no compile changes; the new unit test
fails on the previous guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…districts (#1224 review)

The congressional-district vintage crosswalk sums several source districts
into one current district under the first contributor's layout, so a check
after translation could see an excluded contribution under a corrected
column, or a missing column hidden behind a present one. The source-column
exclusion and the missing-column refusal now run on each fact as the feed
carries it, before translation, in the compile and in the receipt, which
therefore lists source ids (4 x 480 on the pinned feed). Tests cover
mixed-column merges in both orders and every missing-column order (the old
post-crosswalk check fails four of the six), and a corrected A85770 PTC
amount, which must compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the wrong IRS column

Merge Max's branch us-cd-source-column-exclusions at 47b590f, unchanged.

Conflicts, all in test_us_fiscal_targets.py:
- The fence test's docstring: keep main's version history and add #1224's
  sentence. A later commit of this branch re-pins every value on the
  41b2fb2 feed.
- main's two pinned-feed tests (one label per dimension value, EITC child
  totals) and #1224's excluded-column test were added at the same place.
  Keep all three.

main's test_us_soi_congressional_district_vintage.py (#1244) still calls
_is_soi_cd_premium_tax_credit_amount_conflict, which #1224 deletes. A later
commit of this branch moves those tests to the column exclusion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eriod, not feed order

Merge Max's branch us-cg-returns-control-concept at 4e86ec3, unchanged.

Conflicts, all in test_us_fiscal_targets.py:
- The fence test's docstring and national_state version: keep main's
  version and history, and add #1036's sentence. A later commit of this
  branch re-pins every value on the 41b2fb2 feed.
- The pinned-feed tests of main and #1224 and #1036's two capital-gains
  tests were added at the same place. Keep all of them.

#1036 adds a second copy of _soi_record_set_family, which main has had since
#1244. A later commit of this branch removes the copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge Max's branch us-cd-capital-gains-concept at d3a6253, unchanged. It
contains #1036, merged above, and the same code changes as #1224.

Conflicts:
- fiscal_targets.py: #1040 keeps the old body of
  _is_soi_congressional_district_record_set. Keep main's family-matched
  body from #1244.
- docs/us-acs-local-soi-target-surface.md: take #1040's paragraph, which
  names #1224 and the move of the capital-gains rebase factors.
- test_us_fiscal_targets.py: the fence test. Keep main's version history and
  add #1040's sentence. A later commit of this branch re-pins every value on
  the 41b2fb2 feed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… aging

Merge Max's branch us-w2-source-vintage-aging at 03ceca6, unchanged.

Conflicts:
- fiscal_targets.py: main's FSA student-loan imports and plan (#1074) and
  #1030's source-vintage imports and restamp check sit at the same place.
  Keep both. The restamp check runs after the student-loan plan, on the
  same facts.
- test_us_fiscal_targets.py: the fence test. Keep main's version history
  and add #1030's sentence. A later commit of this branch re-pins every
  value on the 41b2fb2 feed. The pinned-feed tests of main, #1224, #1036
  and #1040 and #1030's four restamp tests were added at the same place.
  Keep all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1244 merged after these PRs were last updated, and made every district
guard match the record-set family at any data vintage. Three items did not
show as text conflicts:

- fiscal_targets.py: remove #1036's second copy of _soi_record_set_family.
  main has had the same function, byte for byte, since #1244.
- fiscal_targets.py: the column register's missing-column refusal (#1224)
  now finds a district fact by family, as every other district guard does,
  instead of by the ".congressional_district_" substring.
- test_us_soi_congressional_district_vintage.py: #1224 and #1040 delete
  _is_soi_cd_premium_tax_credit_amount_conflict, which #1244's tests
  called. The tests now check the column register: a district PTC amount
  must name its IRS column, the A85530 column is dropped at any vintage,
  and A85770 is kept. The compile test gives its PTC facts the A85530
  column, as the pinned feed does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The four PRs were pinned on the 51aa40f feed. On the 41b2fb2 feed that main
pins, compiled as the release does:

- Compile: 31,748 targets (full 4cc4cfb7a147), from 33,250 (bf021cdc9749).
- national_state: 6,102 targets at 4dfe25b1238a, from c698e70d33ce. 52
  values move. The 51 Historic Table 2 state net-capital-gains return counts
  move x0.415203: their sum goes from 29,599,604 to 12,289,836, against the
  national Table 1.4 target of 12,392,020. The W-2 Box 7 tips amount moves
  from $28,280,884,269 to $34,287,530,779.
- ACS local state: the same 4,380 specs, and the same 51 return counts move.
  state_cd: the same 26,425 specs; its contract test passes unchanged.
- ACS local totals: 102 SOI specs, from 607. full: 29,824, from 31,321.

#1224 and #1040 pinned 31,786 and 31,784 compiled targets, and 120 and
29,860 local SOI specs. Their last commits run the column exclusion before
the district crosswalk, and the crosswalk copies a state row to an at-large
district only for a measure that the district file carries. So the 36
Historic Table 2 SALT and premium-tax-credit rows copied to the nine
at-large districts no longer compile (18 of them in totals). Each repeated
its state row, and no production surface uses them. The pins and docs now
say so.

#1030's counter takes the values that its PR body gives for a merge with
#1040: 10,900 / 11,772 / 1,300 / 1,350 / 2 / 1. No spec is rebased onto a
restamped control, and the 974 district capital-gains shares are admitted
restamped shares.

Docs: the 41b2fb2 measurement in us-chronicle-feed-repin.md,
us-acs-local-soi-target-surface.md and us-soi-capital-gains-concepts.md.
The parity manifest's ed_fsa evidence now says 31,748 targets, regenerated
with tools/build_us_target_parity_manifest.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Takes #1697 (free release-tool objects after their last use) and #1690 (UK
SPI stage-1 reference forests), so the engine-free job tests the same tree
as main plus this branch. No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
engine-free failed at 79a3c3e:
test_the_batterys_binding_identity_adds_only_the_leaf_and_its_imports
counted 249 modules, not 248. #1030 makes us_runtime.fiscal_targets import
us_runtime.source_vintage, so the gate bindings reach one more module. Add
it to BINDING_MODULES_ADDED_AFTER_BASE with its reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vahid-ahmadi vahid-ahmadi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 006afbedc. This is a careful integration, and I found nothing that blocks it. I read the two commits that are new here (a86a7af10, 79a3c3e9e), the merge of main and the CI fix, rather than re-reviewing the four PRs. Notes below.

What I checked

  • a86a7af10. The removed _soi_record_set_family is the duplicate of #1244's copy. The missing-column refusal now uses _is_soi_congressional_district_record_set, the same family match as the other district guards. That's the right fix: the old ".congressional_district_" substring would have missed a district record set named some other way.
  • The capital-gains numbers add up. 12,289,836 / 29,599,604 = 0.415203, as stated. The remaining 0.8% gap to the 12,392,020 control is the "other areas" row (territories, APO/FPO, foreign), which Historic Table 2 doesn't carry. us-soi-capital-gains-concepts.md explains this, so the states should sum to about 99.2% of the control, not 100%.
  • The totals drop from 607 to 102 is explained. #1038 already took it to 120, and the 18 at-large SALT and PTC copies take it to 102. The doc tracks each step.
  • Tests. test_us_source_vintage.py and test_us_soi_congressional_district_vintage.py pass locally at the head: 80 passed, 1 feed-gated skip. I didn't rebuild the feed, so I haven't reproduced the 1,296 feed-gated runs. CI at the head: the UK engines, integration-uk, lint, installed-emitter and wheels pass; engine-free and engine-us are still running.

Points

  1. The tips change deserves a line in the PR body, not only the doc. It's the only non-capital-gains value that moves, and it moves +21.2% ($28.28B to $34.29B). us-chronicle-feed-repin.md gives the reason: the "ty2023" tips row is TY2020 data restamped. It used to age on the CBO ratio from 2023; now it ages from its real data year, 2020. One sentence in the body's "Effect on targets" would save the next reader from searching the doc. If there's an outside figure for 2024 Box 7 tips, a sanity check against it would help, since a 21% move in a single target is large.
  2. The rulings. The table says these decisions were held for Max's rulings and that you ruled on 25 November. If Max has handed these over, or agreed, it would help to say so in the table or link where it happened. Then the record for d462, d464, d468 and d539 is clear to anyone who traces them later.
  3. The merge method. "Merge commit, not squash" is right for keeping the four heads intact, and the repo allows merge commits. If the PR goes through the merge queue, check that the queue's merge method is set to merge commit as well. Otherwise the queue may squash it anyway, and GitHub won't mark #1224, #1036, #1040 and #1030 as merged.
  4. The #1038 closing keyword. You already flagged it. I'd decide before merging: #1040 covers district capital gains, but if #1038 also tracks the SALT and PTC column work, it may need to stay open until #1731.

Not covered: the four PRs' own logic, which was reviewed on each PR; the feed rebuild; and the full suite.

Review drafted with AI assistance and checked against the code at 006afbedc.

@juaristi22

Copy link
Copy Markdown
Collaborator Author

Thanks, Vahid. The PR body now covers all four points.

  1. Tips. "Effect on targets" gives the reason for the +21.2% move. The row is TY2020 data that the feed labels TY2023, so it now ages from 2020 (×1.280) instead of one year (×1.056). IRS has published no W-2 table after TY2020, so no 2024 figure exists to check against. The only outside anchor I found: CRS IF12728 cites IRS data of about $38 billion of tips on W-2s for TY2018 (the box is not named), against $26.8 billion of Box 7 tips for TY2020. Against that history, $34.3 billion for 2024 is not high.
  2. Rulings. The rulings are María's own, made on 25 November as the lead of the US data work. The PR body is their record. Max has not commented on them yet.
  3. Merge method. Main has no merge queue. Its branch rules allow merge, squash and rebase, so the method is picked at merge time. The body now says to choose "Create a merge commit".
  4. Congressional-district capital-gains, SALT and PTC targets on the full surface cross IRS concepts #1038. US local build: district targets that exist but are not in the fit #1731 records that Congressional-district capital-gains, SALT and PTC targets on the full surface cross IRS concepts #1038 covers only the three district families on full, which Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040 and Drop congressional-district SALT and PTC facts read from the wrong IRS column #1224 correct. The state_cd SALT and PTC rows are tracked in US local build: district targets that exist but are not in the fit #1731 and US district facts for Microcosm's local-area fit: SOI district AGI classes and more columns, ACS district tables, county SNAP chronicle#447. Whether Congressional-district capital-gains, SALT and PTC targets on the full surface cross IRS concepts #1038 closes with this PR is decided before the merge.

Drafted with AI assistance.

@juaristi22
juaristi22 marked this pull request as ready for review November 25, 2026 16:52
@juaristi22
juaristi22 merged commit 0f963ac into main Nov 25, 2026
12 checks passed
juaristi22 added a commit that referenced this pull request Nov 26, 2026
…ions and the SIPP 2023 donor tag (#931)

Main took two pull requests since 8c51b6e: #1733 (four held US SOI
target corrections on the current feed) and #1753 (the SIPP 2023 donors
fetched from the retired data repository's 1.115.5 tag, with the same
bytes). Both are US-only and touch no UK module, so the UK spine's code
is unchanged. No feed or engine pin moves, so no file is re-pinned.

Four files conflicted, all pins that both sides moved: the US spec-engine
seed map and seed protocol, the loader's golden spec vector, the US spec
pin of the multispine pool test, and the US F0 coverage report. Each is
computed on the merged tree, with both sides' comments kept, and the
coverage report is regenerated (--check passes; 42,404/42,404
configuration fields and 41/41 inventory checks).

Checks: the loader tests (10), the coverage-tool and field-usage tests
(21), and main's changed tests with the shared evidence-kernel test
(1,498 passed, 3 skipped). The multispine pool test needs
policyengine-us, which this machine lacks, so its pin is the merged
tree's load_bundle("us") spec binding, the method of the last two merges.

Co-Authored-By: Claude Opus 5.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

3 participants