Repository navigation
Conversation
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>
This was referenced Sep 27, 2026
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>
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>
This branch has not been deployed
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.
Waiting on Max's ruling (d462; d464 is the same call). This moves published target values. Do not merge without that ruling.
Adopted 2026-10-12. The owner session ended, so this PR was taken over and brought up to date:
origin/main, which re-pinned the US feed to51aa40f(Bind state × AGI-band SOI targets and re-pin the US feed for TY2023 state bands (#940) #1102, issue State top-tail income mass is uncalibrated: CO M+ AGI at 24% of SOI in buildp-acs-local (fails progressive-bracket scoring) #940) and split tests by environment (Refactor CI test execution and wheel inspection #998);The original change is unchanged. Details are under Adoption.
Summary
The pinned US Chronicle feed (
51aa40f) stamps five source packages' pinned files as ty2023. That is 26,893 facts from the TY2020 W-2 table and the TY2022 congressional-district, state and IRA tables.51aa40fisc5e5bf8plus one package, so it carries the same restamps. Target aging starts from the stamp.On the route-A
national_statesurface, this puts the W-2 Box 7 tips amount target at $28.28B. Aged from its data year, the same fact gives $34.29B; the stamp makes it 17.5% lower.This PR reads restamped facts at their data year for aging and the period contract. PolicyEngine/chronicle#292 (merged 2026-09-28) refuses these builds at the source. This PR stays correct after the feed is re-pinned onto it.
The restamp
Mechanism (Chronicle
source_package.pyatc5e5bf8):artifact_yearpins which manifest file a package reads.{year}label (period, record ids, vintage, legal vintage) renders from--year.us/chronicle_feed_scope.jsonbuilds these five packages with--year 2023.soi-congressional-district-202222incd.csvsoi-w2-statistics-202020in04w2all.xlsxsoi-state-202222in54us.xlsxsoi-ira-roth-contributions-202222in06ira.xlsxsoi-ira-traditional-contributions-202222in05ira.xlsxEvidence for the data years:
amount,return_countandtaxpayer_countequal their ty2020 twins cell for cell, with the same sha256 and values.Chronicle#117 reported the CD case in July; the other four came out of this investigation. As of 2026-09-25, IRS had published no W-2 table newer than TY2020 and no CD file newer than TY2022.
When it started. The pin before 2026-09-18 already carried 26,891 of these facts. The 2026-09-18 re-pin added the ty2023 tips amount and return count. Before that, the only tips amount was the ty2020 row, which the code would have aged on the chained SOI wages bridge. That older pin cannot compile on main, so this is read from the code, not observed. The restamped row won latest-vintage selection and aged on the direct 2023 CBO ratio instead.
Which layer owns it
Chronicle "records every fact's publisher reference period" (Chronicle
AGENTS.md). PolicyEngine/chronicle#292 refuses a pinned build whose--yearchanges labels but not what is read. At Chronicle main, the ten scoped pairs these packages fed produce no row, so a re-pin there needs its own decisions (docs/us-chronicle-feed-repin.md, "The 2026-10-04 re-pin").Microcosm. It is pinned to
51aa40funtil that re-pin. This PR is the consumer-side correction for the feed microcosm uses today.What changes
us_runtime/source_vintage.py(new).Detection (
detect_restamped_facts). Either rule flags a fact:source.source_sha256is a registered file and its period is after that file's data year;source.raw_r2_keyyear is earlier than its period.Publisher projections are exempt.
US_LATER_PERIOD_OBSERVATION_EXEMPTIONS(empty) admits truthful later observations, for example a multi-year release keyed by its publication year (BEA's 2024-keyedSAINC.ziphas a 2025 column).Register (
US_RESTAMPED_SOURCE_PACKAGES). One entry per package: data year, stamped periods, file, sha256 and evidence.source_vintage_correctionsrefuses any detected restamp without a matching entry (UnreviewedRestampError).Guards on the readings that still see the stamp:
RestampShadowsNewerVintageError).RestampedAgingIndexError).Correction (
apply_source_vintage_corrections). Values are never changed. The stamp is kept insource_vintage_stamped_period.source_periodbecomes the data year.uprating_to_period.soi_share_total_source_record_id) also getsuprating_from_periodat the data year. Itsuprating_to_period, where its aging starts, stays at the control's period (below).Compile.
compile_us_fiscal_target_registrycomputes the corrections once, checks the aging indexes, passes the corrections to selection, and applies them after the target profile, before aging and the period contract.Docs. Comments in
fiscal_targets.pyandtarget_aging.py, a "Restamped packages" section indocs/us-chronicle-feed-repin.md, and a changelog fragment.Effect on the pinned feed
This is the release compile:
target_period=2024,age_targets=True, the packaged CD crosswalk, then Medicaid substitution. Main is at51a263726and the feed at51aa40f. The dumps and the diff script are in~/PolicyEngine/_reviews/w2-source-vintage-1030-20261012/compile/(analyze_main_vs_pr1030.txt).national_statetargetsnational_stateregistrye1f9906bf0e061f5cac06310national_state)national_state: one value moves, the tips amount, by +21.2%. No spec enters or leaves the surface. 53 specs change metadata only:state_2022counts. Counts do not age.Full surface: 13,176 CD-file dollar targets age from TY2022. The moves below are relative to aging from the data year under the current series policy.
With no SOI bridge for qualified dividends, Schedule C or partnership income, aging falls back to the AGI chain from 2022.
13,614 count specs change metadata only, and so do 9 rebased counts that are CD-classified and full-surface only.
Every figure except the hashes and the two target counts is the same as on the old
c5e5bf8feed (5,694 targets,d315c75804ef→884bc45ef335).Merge order with #1036, #1040 and #1224
#1036 chooses the capital-gains control by concept. #1040 (stacked on #1036 and carrying #1224's commits) makes the CD capital-gains rows shares of the CD US row times the Table 1.4 control. Both wait on Max (d468, d539). Each order was compiled on a local merge of this branch:
national_state882f4764a2489ce9c3ff865f84504a7afd57d29c1e6d43e3fullf09571684885b71c84f418216e1ac91262bcde2f83baa9b7With #1036 alone, every value and counter matches main + #1030. The 51 Historic Table 2 counts rebase onto Table 1.4, so the 60 control corrections, and the 51 metadata-only
national_statechanges, are gone.With #1040, all 974 CD capital-gains shares are admitted and keep exactly #1040's values. The CD state capital-gains amounts sum to $1,270.86B either way. The −23.9% net-capital-gains line above disappears, and 12,200 CD dollar targets move, the same AGI-series and series-switch moves as above. The 51 Historic Table 2 counts no longer change, because their control is Table 1.4.
Without the narrowing, #1030 refuses every compile that carries #1040's shares. On the local merge, #1040's
test_congressional_district_capital_gains_ignore_the_package_stamppasses with the narrowing and fails with #1030's original blanket refusal ("…and was rebased; review the rebase…").On the local #1040 + #1030 merge, the pinned-feed run of
test_us_fiscal_targets.pyandtest_us_source_vintage.pygives 246 passed and 2 failed. The two failures are pure pin values, thefullversion and the counter below. The order-free test, the register test, the tips test and #1040's own pinned tests all pass.Whichever lands second must re-pin these #1030 pinned values; the order-free tests need no change:
national_stateversion and docstring intest_pinned_feed_national_state_surface_restores_the_fences;test_pinned_feed_corrects_the_translated_congressional_district_specs:10,900 / 11,772 / 1,300 / 1,350 / 2 / 1, in the test's key order (from11,772 / 12,208 / 1,404 / 1,404 / 2 / 1);Adoption (2026-10-12)
origin/main(610 commits). Three conflicts:_latest_dynamic_target_referencesdocstring now carries both State top-tail income mass is uncalibrated: CO M+ AGI at 24% of SOI in buildp-acs-local (fails progressive-bracket scoring) #940's per-vintage state AGI bands and the restamp-shadow guard.test_support/microcosm_build/us_fiscal_targets.py.pinned_feed_factslives there now and the surface fixture builds on it.test_us_source_vintage.pymoved totests/engine_free/us/.tools/ci_test_plan.py verifypasses.bab55cb97), adapted from the reviewed patch in~/PolicyEngine/_reviews/cd-cg-concept-20260927/lane-a/:uprating_factor, so Read restamped Chronicle facts at their data year before aging #1030 as written refused every pinned compile (P1 in Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040's review).uprating_to_period(2023). Starting it at 2022 would apply the Table 1.4 2022-to-2023 fall twice (×0.761).03ceca6ad, from the round-3 review). A state AGI band's selection key ends in its period, and State top-tail income mass is uncalibrated: CO M+ AGI at 24% of SOI in buildp-acs-local (fails progressive-bracket scoring) #940 then keeps one whole vintage per state and measure. The guard compared candidates per key, so it could not see a restamped band vintage displacing a truthful vintage of another period or other bounds. It now compares flagged bands per state and measure. No restamped package on the feed carries band rows (checked), so no compile changes. The new test fails on the previous guard.51aa40f.test_pinned_feed_capital_gains_returns_control_reads_its_data_yearnamed the CD US row as the control. It becomestest_pinned_feed_rebased_specs_read_restamped_inputs_at_their_data_year, which holds whichever control the compile picks:Invariants
uprating_from_periodis the stamp or the data year. Otherwise the compile refuses (exact oracle in the property).uprating_from_periodmoves only for an admitted share.uprating_to_periodmoves only for a restamped control, never for a share (property).Tests
Run locally with the pinned feed present, at the heads noted. CI has no feed and skips the pinned-feed tests. Logs are in
~/PolicyEngine/_reviews/w2-source-vintage-1030-20261012/tests/.test_us_fiscal_targets.py,test_us_source_vintage.py,test_us_spine_blindness.py(at03ceca6ad, the head)MICROCOSM_US_CHRONICLE_FACTSset and theusextra installed (at the head):test_release_target_parity.py,test_us_acs_local_release_tool.py,test_us_acs_local_sparse_cd.py,test_us_chronicle_feed.py,test_us_fiscal_refresh_builder.py(both whole-registry pinned-feed compiles included),test_us_modal_stage_puf_support_base.py,test_us_release_gate_preflight.py,test_us_soi_state_agi_bands.py,test_us_congressional_district_{vintage,geography,vintage_crosswalk}.pyruff check,ruff format --check,tools/ci_test_plan.py verifyNew tests in this round (
test_us_source_vintage.py):an admitted same-package share and its idempotence;
seven parametrized refusals: no total, a truthful total, another package, another stamp, another data year, another reading period, no reading period;
a value-level differential: one share stamped ty2023 then corrected, and the same share stamped truthfully at 2022, both aged to 2024. The aging start at the data year is pinned as a ×(T1.4 2023/2022) error;
the Hypothesis property now draws
uprating_factor,uprating_from_periodand share totals in three modes. Free draws them at random. Well-formed gives each rebased restamp its own same-vintage total. Near miss gives it exactly one defect among package, stamp, data year and reading period. Two runs of 500 examples at the head gave:The counts are in
tests/property_coverage.txt.test_restamp_shadow_guard_compares_state_agi_bands_per_state_and_measure(test_us_fiscal_targets.py).Mutation sweep (executed). Ten mutants of the narrowing, run against this PR's unit tests plus #1040's stamp test on the local merge (
mutants/report.md):The sweep ran at local-merge head
c50c08663, which carries this branch at4bcf9cc1c. The two files it mutates and runs,source_vintage.pyandtest_us_source_vintage.py, are byte-identical at the head03ceca6ad. M2, M9 and M10 also fail #1040's stamp test and the new aging differential. M10 is #1030's original blanket refusal.Not changed here
SOI_CONGRESSIONAL_DISTRICT_RECORD_SET_IDnames thety2023record set, so it must change at a re-pin onto Chronicle main.bea_regional.state_wages_salariesis a deferred parity family. Activating it before a re-pin would calibrate 2024 wages as cy2023.Review
94f055a6d.f87844fa8(review-sol.mdin the evidence folder). APPROVE WITH NITS, no P0-P2. Its findings:03ceca6ad.f87844fa8..03ceca6ad: the guard fix, test-only changes and one docs line): APPROVE, no P0-P3 (review-sol-delta.md). It confirmed that the coarser band key cannot cause a false refusal on main, Choose the capital-gains rebase control by concept and period, not feed order #1036 or Rebase congressional-district capital gains onto Table 1.4 and drop mislabeled CD SALT and PTC columns on the full surface #1040, that (state, measure) is the selector's competition grain, that each near miss changes exactly one admission condition, and that the relaxed CD assertion keeps main's check.axiom: n/a: microcosm target-compile infrastructure (fact vintages and aging), not a policy rule
🤖 Generated with Claude Code