Conversation
…ITC facts Three packages mirror their TY2022 twins on 23in55cmcsv.csv, with literal TY2023 labels: soi-historic-table-2-2023 (605 facts), soi-historic-table-2-state-broad-2023 (2,703) and soi-historic-table-2-state-eitc-2023 (510). The TY2023 file inserts two columns at DP, so every column from DP on moves two places right; each measure is remapped by its CSV variable and guards that header. The TY2023 state AGI package also gains the TY2022 package's taxable interest measures (N00300, A00300; 1,020 facts), which chronicle#291 left for when the TY2023 national table was packaged. Tests read the publisher CSV with the standard library: every fact is one cell, the declarations equal the TY2022 twins' up to year labels and column moves, and the published accounting identities hold on the facts (AGI bands and state totals add up, EITC child counts partition the total). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…023 HT2 The TY2022 national and state broad packages bind qbi_claims/qbi_amount to N03270/A03270, which both IRS documentation guides define as the self-employment health insurance deduction. The TY2023 packages now read N04475/A04475 (columns CT/CU), the qualified business income deduction: US all returns 26,391,030 returns and $213,733,168,000 instead of 3,578,530 and $31,114,668,000. Tests now also check each measure against the variable the documentation names (not only against the variable its package names), and the mirror test states the QBI correction explicitly. Found by the #295 judge review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ledger-source-fidelity: FAIL
Overall recommendation: REQUEST_CHANGES. I independently rebuilt all four packages and checked 5,858 facts, including the 4,838 added by this PR, against the local publisher CSV. Every value equals its declared cell times the correct scale; that mechanical agreement does not resolve the QBI semantic error. I verified the CSV’s SHA-256 ( Direct checks covered all column/header bindings, selected STATE/AGI_STUB rows, state FIPS, source-row and cell lineage, filters, AGI bounds, EITC child constraints, and literal TY2023 identifiers and vintages. The column shift is handled correctly. The documentation comparison covered all 63 selected variables, including the ACTC rename; the workbook confirms the EITC “three or more” category. All 102 added interest measure declarations match TY2022 apart from the added numeric/header guards. I made 19 explicit spot-checks; 16 are shown below. Amount variables (
The boundary verdict is PASS: the diff adds publisher-cell declarations and registrations, without reconciliation, aging, imputation, support-aware activation or solver construction. Builds at alternative years retain TY2023 facts. I found no arithmetic or candidate-selection problem in the bundle delta. Independently scanning registered packages and sequentially rebuilding all 17 relevant packages reproduced +4,838 facts, +605 US facts, +83 California facts and +1,650 semantic-duplicate keys. The latter comprise 1,553 congressional-district overlaps and 97 Publication 1304 overlaps. These support the snapshot:139 totals of 356,751 facts and 2,117 duplicate keys, conditional on #291’s baseline. Validation limits: 24 selected tests passed, and all four package and consumer-contract validations passed. I excluded four artifact-writing tests and did not run the full default bundle, independently confirm its unchanged warning count, verify remote CI, or fetch fresh IRS/R2 copies. Commands ran sequentially; peak measured RSS was 693 MiB. The checkout remains clean at |
|
Main session's response to the judge review above (independent Opus 5.5 via Subfleet):
🤖 Generated with Claude Code |
…exactly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ledger-source-fidelity: PASS Recommendation: APPROVE. The P1 and P2 findings are fixed. I could not run the tests or What I couldn't do: this session had only file-read and search tools, with no shell. So I did not run 1. P1 (QBI reading the wrong variable): fixed
2. P2 (tests couldn't catch a wrong binding): fixed
Two non-blocking notes (P3), both inherited from TY2022. Neither is a wrong binding:
A small optional hardening: assert that the union of measure IDs across the three packages equals 3. Tests: not runSee above: step 3 is the one outstanding check. 4. Snapshot counts: unaffected
BoundaryThe diff still only declares publisher cells and their header guards. It adds no reconciliation, aging, imputation or solver logic. APPROVE, once step 3 passes. |
|
Heads-up: this PR's two TY2023 capital-gains measures need a relabel before it merges (chronicle#304).
The TY2023 IRS guide ( #304 relabels TY2022 Historic Table 2 and the congressional-district file to
The patch (8 lines in 2 files; diff --git a/packages/irs_soi/historic_table_2_2023/source_package.yaml b/packages/irs_soi/historic_table_2_2023/source_package.yaml
index 2d4d1ca..c3f8ddb 100644
--- a/packages/irs_soi/historic_table_2_2023/source_package.yaml
+++ b/packages/irs_soi/historic_table_2_2023/source_package.yaml
@@ -611,11 +611,11 @@ record_sets:
value_scale: 1000
- measure_id: net_capital_gains_returns
- label: Returns with taxable net capital gains
+ label: Returns with net capital gain (less loss)
ordinal: 27
column: AK
source_column_id: N01000
- concept: irs_soi.returns_with_taxable_net_capital_gains
+ concept: irs_soi.returns_with_form_1040_capital_gain_or_loss
unit: count
aggregation: sum
expected_cell_type: number
@@ -623,11 +623,11 @@ record_sets:
expected_column_header: N01000
- measure_id: net_capital_gains_amount
- label: Taxable net capital gains
+ label: Net capital gain (less loss)
ordinal: 28
column: AL
source_column_id: A01000
- concept: irs_soi.taxable_net_capital_gains
+ concept: irs_soi.form_1040_capital_gain_or_loss
unit: usd
aggregation: sum
expected_cell_type: number
diff --git a/packages/irs_soi/historic_table_2_state_broad_2023/source_package.yaml b/packages/irs_soi/historic_table_2_state_broad_2023/source_package.yaml
index 912cb84..f67577a 100644
--- a/packages/irs_soi/historic_table_2_state_broad_2023/source_package.yaml
+++ b/packages/irs_soi/historic_table_2_state_broad_2023/source_package.yaml
@@ -368,22 +368,22 @@ record_sets:
expected_column_header: A00900
value_scale: 1000
- measure_id: net_capital_gains_returns
- label: Returns with taxable net capital gains
+ label: Returns with net capital gain (less loss)
ordinal: 17
column: AK
source_column_id: N01000
- concept: irs_soi.returns_with_taxable_net_capital_gains
+ concept: irs_soi.returns_with_form_1040_capital_gain_or_loss
unit: count
aggregation: sum
expected_cell_type: number
expected_column_header_row: 1
expected_column_header: N01000
- measure_id: net_capital_gains_amount
- label: Taxable net capital gains
+ label: Net capital gain (less loss)
ordinal: 18
column: AL
source_column_id: A01000
- concept: irs_soi.taxable_net_capital_gains
+ concept: irs_soi.form_1040_capital_gain_or_loss
unit: usd
aggregation: sum
expected_cell_type: numberRe-running Snapshot. Once relabelled, the TY2023 HT2 US capital-gains rows stop sharing a semantic key with Table 1.4's TY2023 row. That should take 2 off this PR's Table 1.4 overlap count when you re-pin. I haven't verified that number; CI will confirm it. |
|
chronicle#304 is merged to main ( |
Summary
Adds IRS SOI Historic Table 2 for tax year 2023 at the national and state level, mirroring the TY2022 packages:
soi-historic-table-2-2023(US, 11 AGI stubs x 55 measures)soi-historic-table-2soi-historic-table-2-state-broad-2023(51 states x 53 measures)soi-historic-table-2-state-broad-2022soi-historic-table-2-state-eitc-2023(51 states x 10 measures)soi-historic-table-2-state-eitc-2022soi-historic-table-2-state-agi-2023: adds taxable interest (N00300, A00300)Every fact is a single published cell of
23in55cmcsv.csv(shad1f7c890…, registered by #291). Every label is literal TY2023: period, record ids, vintage andlegal_vintage. The packages are therefore already clean under the artifact-year restamp guard in #292. This addresses #117 item 3 ("Ingest HT2 TY2023"), and it adds the state interest measures #291 deferred until the TY2023 national table was packaged.Stacked on #291 (base
soi-ty2023-state-agi-bands). Merge after #291, and preferably after #292 (see "Semantic duplicates").What changes
N07262/A07262/N07265/A07265replaceN07260/A07260at DP, so every column from DP on sits two places right. This moves 8 national/broad measures (premium tax credit, EITC, ACTC and income tax) and all 10 EITC measures. Each measure is remapped by its CSV variable name. Every measure now guards its header (source_column_idplusexpected_column_headeron row 1), so a future shift fails the build instead of reading a neighbouring variable. The TY2022 national package guarded only some measures.23incmdocguide.docand22incmdocguide.docdescribe every variable these packages read with the same text, exceptN11070/A11070. That pair was renamed from "Refundable child tax credit or additional child tax credit" to "Additional child tax credit", which matches the existingirs_soi.additional_child_tax_creditconcept.git diff --no-index <2022> <2023>shows only year labels, column letters and added guards. An independent dict-level derivation of the same mapping must agree with it, and it does. The same equivalence is tested intest_packages_mirror_their_2022_twins.N03270/A03270. Both IRS guides define that pair as the self-employment health insurance deduction. The TY2023 packages readN04475/A04475(CT/CU), the qualified business income deduction: US all returns are 26,391,030 returns and $213.7B, against the 3.58M and $31.1B the inherited binding would give.DOCUMENTED_VARIABLEpins all 63 measures to their documented variables. The TY2022 packages get a separate fix.record_set_spec_id,source_table, concepts, units, scales, rows, filters and constraints are the TY2022 values, so the two vintages form one source series.SOURCE_PACKAGE_ALIASES, in theirs_soi_filer_income_tax_creditscoverage family and indocs/pe-calibration-targets.md.Chronicle governance
ledger-source-ingestor.chronicle validate-package <id> --year 2023: all four packages are valid. Counts are 605, 2,703, 510 and 2,040 source records.chronicle build-bundle --year 2023over the four packages is valid: 5,858 facts, 0 errors, 0 warnings, 0 duplicate keys. Lineage coverage is 1.0 for each package, with 0 agent-acceptance errors. The only acceptance warnings are the standardconcept_alignment_validation_skipped/no_concept_alignments.ruff checkpasses.ledger-source-fidelity: PASS after re-review. The first independent Opus 5.5 review (Subfleet) caught the QBI mis-binding, which is fixed in 73cb3b9. The re-review checked 38 documented variables and the CT/CU binding and approved. Both reviews are posted below.ledger-contract: no schema or consumer-contract change.ledger-boundary: PASS (independent Opus 5.5 review via Subfleet).Invariants (tested in
tests/test_chronicle_soi_ht2_2023.pyandtests/test_chronicle_soi_state_agi_2023.py)source_column_idin the TY2023 header, and the package guards it.Default-bundle snapshot and semantic duplicates
A full
build-bundle --year 2023needs more disk than the build machine had free. The re-pin intests/test_chronicle_bundle.pyinstead comes from in-memory builds of the new packages plus every package that declares one of their concepts:tax_year:2023andtax_unit, from 3 more packages;soi-congressional-district-2022, which main builds at 2023 and stamps as ty2023 (CD record sets stamp 22incd.csv as ty2023 — a tax-year vintage error; add Table 1.4 taxable-interest facts (populace#489) #117 item 1). They are TY2022 values carrying the same semantic key as the true TY2023 state and US totals. Refuse pinned-artifact builds that only relabel another year (#117) #292 fixes that stamp, after which these duplicates move to TY2022 and stop contradicting TY2023.CI confirms the re-pin. Whichever of this PR and #292 merges second re-pins the snapshot.
Consumers
Facts are inert until Microcosm re-pins its Chronicle feed. That re-pin is queued separately as a decision for Max.
🤖 Generated with Claude Code