diff --git a/changelog.d/1343-us-feed-one-label-per-value.fixed.md b/changelog.d/1343-us-feed-one-label-per-value.fixed.md new file mode 100644 index 0000000000..e5f0ae50b2 --- /dev/null +++ b/changelog.d/1343-us-feed-one-label-per-value.fixed.md @@ -0,0 +1 @@ +The US Chronicle feed is re-pinned to Chronicle `a9026cc` (tag `microcosm-us-feed-1343-v1`: the previous pin `cf9ece2` plus label-only package changes), so the compiled US targets give each dimension value one label (#1343): adjusted gross income `under_1` is "No adjusted gross income", `all` is "All returns, total", and age `85_plus` is "Age 85 plus". No target value, key or count changes; 50 targets change label, and the registry and `national_state` surface versions move because they hash the labels. diff --git a/docs/us-chronicle-feed-repin.md b/docs/us-chronicle-feed-repin.md index 713d43b640..5083a0488b 100644 --- a/docs/us-chronicle-feed-repin.md +++ b/docs/us-chronicle-feed-repin.md @@ -13,6 +13,87 @@ any other feed, and `test_us_chronicle_feed.py` fails if the parity resources, the generator and the pin disagree, or if the scope file changes without a new pin. +## The 2026-10-27 re-pin: one label per dimension value (microcosm#1343) + +The `cf9ece2` feed labelled three dimension values two ways, so compiled +targets that select the same value id showed it under two names. Each value +now carries the one wording microcosm#1343 chose: + +| Dimension = value | Before (package) | After | +|---|---|---| +| `us:statutes/26/62#adjusted_gross_income` = `under_1` | "No adjusted gross income and deficit" (`soi-filing-season-week47-2024-eitc-total`, the IRS column header); "No adjusted gross income" (seven other IRS SOI packages) | "No adjusted gross income" | +| `us:statutes/26/62#adjusted_gross_income` = `all` | "All returns" (`soi-historic-table-2`, `soi-table-1-1`); "All returns, total" (`soi-table-1-2`, `-1-4`, `-2-1`, `-4-3`) | "All returns, total" | +| `age` = `85_plus` | "Age 85 and over" (`census-pep-2024-national-age-sex`); "Age 85 plus" (`census-pep-2024-state-age-sex`) | "Age 85 plus" | + +The pin moved from `cf9ece2` to `a9026cc`, a commit that is `cf9ece2` plus +three label-only commits (Chronicle branch `feed/us-cf9ece2-agi-age-labels`, +tag `microcosm-us-feed-1343-v1`), not Chronicle main. The three commits were +first written on `51aa40f` (branch `feed/us-51aa40f-agi-age-labels`, head +`9b91e8b`, never pinned on main); after microcosm#1189 moved the pin to +`cf9ece2`, they were cherry-picked onto it without conflicts, since they and +`cf9ece2`'s two commits change different files: + +- the week-47 change of PolicyEngine/chronicle#377 (`6d74e42`), without the + `build-bundle` label check that PR adds; +- `soi-historic-table-2` and `soi-table-1-1` relabel their `all` rows. Table + 1.1's row had no `expected_row_header`, so its row-header check compared the + label with the IRS text in cell A10; the row now names that text + ("All returns") explicitly, so the check is unchanged. Chronicle's tests + that pin Table 1.1's `record_set_spec_hash`, the checked-in consumer fact + sample built from its first rows, and that sample's pinned digest move + with it; at `a9026cc` they pass unchanged from the `51aa40f` branch; +- `census-pep-2024-national-age-sex` relabels its `85_plus` row. + +Every package's checks of the publisher's text (row and column headers, +guard cells, the single-year age sequence) are unchanged. +`soi-historic-table-2-state-broad-2022` keeps "All returns" for `state` = +`all` (chronicle#267): that is the `state` dimension, which no other feed +package labels. The feed still labels `age` = `age_20` and `age_21` two ways +(Census population projections and ACS B01001), but no compiled target +selects those values; they are outside this change. + +Built at `a9026cc` from the same 640 scope pairs (only the scope's +`source_commit` changes), and compared with the `cf9ece2` feed by +`experiments/us-feed-agi-age-labels/compare_feeds.py` (report in +`compare.json`): + +- the feed keeps the same 40,181 `aggregate_fact_key`s and every value, + key and constraint, including the three B4923C facts. 816 rows change, in + six record sets, and only in label fields and `layout.record_set_spec_hash`, + which covers row labels: the value label and `layout.groupby_value_label` + on 66 rows (2 `under_1`, 63 `all`, 1 `85_plus`), and the hash on every row + of the six record sets; +- compiled at 2024 as the release does (packaged CD crosswalk, age targets, + Medicaid substitutions), both feeds give the same 33,250 targets in the + same order with the same values. 50 targets change, each only in its + hierarchy dimension's `value_label` and its + `metadata["ledger_layout_groupby_value_label"]`: 2 `under_1`, 47 `all`, + 1 `85_plus`. The registry version moves from `dde00e855af8` to + `b8d571e91c22` and the `national_state` surface (6,102 targets) from + `3fad14f85468` to `3aa2a0830e7d`, because the version hashes the + hierarchy labels; +- no dimension value in the compiled targets carries two labels any more; +- the parity resources change in the feed name and digest, and the + feed-family inventory gains `dimension_value_label_variants`: every + dimension value the feed labels more than one way, with its labels. On + this feed that is only `age` = `age_20` and `age_21`. The generator writes + it from the feed, and `test_us_chronicle_feed.py` checks the committed + listing in CI, where the label test above skips for want of the feed. A + later re-pin built on a Chronicle commit without the three label commits + lists those values again and fails there. The family counts are unchanged: + 32 compiled, 53 reviewed exclusions, 82 feed families; +- the same tool, run at `cf9ece2` with that commit's scope file, reproduced + its `054e5684…` byte for byte. + +These are the same row and target changes the label commits made on the +`51aa40f` feed (`965a29ac…` to `e477e04a…`, 21 October 2026). + +Chronicle main (`272c987`, 25 October 2026) still has all three old +labels in these packages. PolicyEngine/chronicle#377 gives the three values +the same wording on main through its label register +(`chronicle/dimension_values/canonical_labels.json`); until it merges, a +re-pin onto main (#1030) must carry these labels or lose them. + ## The 2026-10-11 re-pin: BEA private group health insurance (microcosm#454) Decision d1317 made BEA NIPA Table 7.8 line 17 (series B4923C) the scale @@ -101,22 +182,26 @@ the first labelled US export. | Field | Value | |---|---| -| Chronicle commit | `cf9ece2e7be11158c21fdc4dd38b44d92db552f6` (`51aa40f` plus the digit-text guard and the B4923C package; tag `microcosm-us-feed-454-v1`) | -| Feed file | `consumer_facts_us_cf9ece2.jsonl`, 40,181 rows, 169,055,585 bytes | -| `facts_sha256` | `054e5684005a7b143dcb84eabac634135ce9b2b33bb57b540602e474a4ba7c57` | +| Chronicle commit | `a9026cc8f80307af0c4527fdb3779fab32ffad9f` (`cf9ece2` plus three label-only commits; branch `feed/us-cf9ece2-agi-age-labels`, tag `microcosm-us-feed-1343-v1`) | +| Feed file | `consumer_facts_us_a9026cc.jsonl`, 40,181 rows, 169,056,411 bytes | +| `facts_sha256` | `4d89e4a498ffd73a407821d9ce2c45837072901e0a29acf3206160d1fafd7c14` | | Consumer fact schema | `chronicle.consumer_fact.v3`, schema file sha256 `bdb51e2a…` (unchanged from the UK pin) | | Scope | 640 (record set, period) pairs; 66 package runs over build years 2020 to 2029 | | Consumer artifact | none: refused at this commit, see below | -The previous pins were `51aa40fd28e2ca81937752515e773d123fecfb71` -(`consumer_facts_us_51aa40f.jsonl`, 40,178 rows, `facts_sha256` -`965a29ac…`, 637 pairs, 63 runs) and, before it, +The previous pins were `cf9ece2e7be11158c21fdc4dd38b44d92db552f6` +(`consumer_facts_us_cf9ece2.jsonl`, 40,181 rows, 169,055,585 bytes, +`facts_sha256` `054e5684…`, the same 640 pairs and 66 runs; tag +`microcosm-us-feed-454-v1`), `51aa40fd28e2ca81937752515e773d123fecfb71` +(`consumer_facts_us_51aa40f.jsonl`, 40,178 rows, 169,038,757 bytes, +`facts_sha256` `965a29ac…`, 637 pairs, 63 runs; tag +`microcosm-us-feed-940-v1`) and, before it, `c5e5bf8aa84960c1a200ee47303b19c953092d0f` (`consumer_facts_us_c5e5bf8.jsonl`, -39,158 rows, `facts_sha256` `b8543739…`, 586 pairs, 62 runs); the rest of this -document describes the 2026-09-18 rebuild unless it says otherwise. +39,158 rows, `facts_sha256` `b8543739…`, 586 pairs, 62 runs); the rest of +this document describes the 2026-09-18 rebuild unless it says otherwise. The feed is too large for the repository. Its home on the build machine is -`~/PolicyEngine/_buildh-runtime/inputs/consumer_facts_us_cf9ece2.jsonl`, +`~/PolicyEngine/_buildh-runtime/inputs/consumer_facts_us_a9026cc.jsonl`, beside the previous pins; `tools/build_us_target_parity_manifest.py` reads it there by default. A holder of the Chronicle commit regenerates it byte for byte with the commands below. diff --git a/experiments/us-feed-agi-age-labels/compare.json b/experiments/us-feed-agi-age-labels/compare.json new file mode 100644 index 0000000000..25004eba39 --- /dev/null +++ b/experiments/us-feed-agi-age-labels/compare.json @@ -0,0 +1,1696 @@ +{ + "feeds": { + "old": { + "name": "consumer_facts_us_cf9ece2.jsonl", + "sha256": "054e5684005a7b143dcb84eabac634135ce9b2b33bb57b540602e474a4ba7c57" + }, + "new": { + "name": "consumer_facts_us_a9026cc.jsonl", + "sha256": "4d89e4a498ffd73a407821d9ce2c45837072901e0a29acf3206160d1fafd7c14" + } + }, + "rows": { + "old_rows": 40181, + "new_rows": 40181, + "keys_only_in_old": [], + "keys_only_in_new": [], + "changed_rows": 816, + "changed_fields": { + "dimension_value_labels/age/85_plus": { + "rows": 1, + "by_record_set": { + "census_pep.cy2024.national_resident_population_age": 1 + } + }, + "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all": { + "rows": 63, + "by_record_set": { + "irs_soi.ty2022.historic_table_2.us": 55, + "irs_soi.ty2022.table_1_1": 4, + "irs_soi.ty2023.table_1_1": 4 + } + }, + "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/under_1": { + "rows": 2, + "by_record_set": { + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.amount": 1, + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.count": 1 + } + }, + "layout/groupby_value_label": { + "rows": 66, + "by_record_set": { + "census_pep.cy2024.national_resident_population_age": 1, + "irs_soi.ty2022.historic_table_2.us": 55, + "irs_soi.ty2022.table_1_1": 4, + "irs_soi.ty2023.table_1_1": 4, + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.amount": 1, + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.count": 1 + } + }, + "layout/record_set_spec_hash": { + "rows": 816, + "by_record_set": { + "census_pep.cy2024.national_resident_population_age": 19, + "irs_soi.ty2022.historic_table_2.us": 605, + "irs_soi.ty2022.table_1_1": 80, + "irs_soi.ty2023.table_1_1": 80, + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.amount": 16, + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.count": 16 + } + } + }, + "label_and_other_changes": [ + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.eitc_claims", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.eitc_claims", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.total_income_tax", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.total_income_tax", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.return_count", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.return_count", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.net_capital_gains_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.net_capital_gains_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.return_count", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.return_count", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.net_capital_gains_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.net_capital_gains_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.income_tax_after_credits_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.income_tax_after_credits_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.itemized_deductions_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.itemized_deductions_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.itemized_deductions_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.itemized_deductions_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.adjusted_gross_income", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2023.table_1_1", + "source_record_id": "irs_soi.ty2023.table_1_1.all.adjusted_gross_income", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qbi_claims", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qbi_claims", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.tax_filer_individual_count", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.tax_filer_individual_count", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.total_income_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.total_income_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_interest_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_interest_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_claims", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_claims", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.adjusted_gross_income", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.adjusted_gross_income", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "census_pep.cy2024.national_resident_population_age", + "source_record_id": "census_pep.cy2024.national_resident_population_age.85_plus.population", + "field": "dimension_value_labels/age/85_plus", + "old": "Age 85 and over", + "new": "Age 85 plus" + }, + { + "record_set_id": "census_pep.cy2024.national_resident_population_age", + "source_record_id": "census_pep.cy2024.national_resident_population_age.85_plus.population", + "field": "layout/groupby_value_label", + "old": "Age 85 and over", + "new": "Age 85 plus" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.actc_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.actc_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ctc_claims", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ctc_claims", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.actc_claims", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.actc_claims", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.total_income_tax", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.total_income_tax", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.total_income_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.total_income_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.income_tax_after_credits_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.table_1_1", + "source_record_id": "irs_soi.ty2022.table_1_1.all.income_tax_after_credits_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ctc_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.ctc_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_interest_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.taxable_interest_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.amount", + "source_record_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/under_1", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + }, + { + "record_set_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.amount", + "source_record_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_amount", + "field": "layout/groupby_value_label", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qbi_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.qbi_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.eitc_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.eitc_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.return_count", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.return_count", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.adjusted_gross_income", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.adjusted_gross_income", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.count", + "source_record_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/under_1", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + }, + { + "record_set_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.count", + "source_record_id": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_returns", + "field": "layout/groupby_value_label", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_returns", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_returns", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_amount", + "field": "dimension_value_labels/us:statutes/26/62#adjusted_gross_income/all", + "old": "All returns", + "new": "All returns, total" + }, + { + "record_set_id": "irs_soi.ty2022.historic_table_2.us", + "source_record_id": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_amount", + "field": "layout/groupby_value_label", + "old": "All returns", + "new": "All returns, total" + } + ], + "record_set_spec_hash_changes": { + "census_pep.cy2024.national_resident_population_age": { + "old": "59905afe30f1ce5453cc739c", + "new": "d8f61d7a253d35f07fa4d9b5" + }, + "irs_soi.ty2022.historic_table_2.us": { + "old": "1fc31fee739bee69eeee5597", + "new": "252c5fd5a5d970ec9ab379ed" + }, + "irs_soi.ty2022.table_1_1": { + "old": "414721aacbfe4686c1dfbfdd", + "new": "a5c9e77ec0817b6d51600f8a" + }, + "irs_soi.ty2023.table_1_1": { + "old": "a1ecc4d67a3d281548a4660e", + "new": "34a421f665dc61864f21c060" + }, + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.amount": { + "old": "164f9b82a4305158d1a57b85", + "new": "36e05f9664a6140b656ea3ac" + }, + "irs_soi.ty2024.filing_season_week47.eitc_by_agi.count": { + "old": "5baf962c82f213018a03f6c3", + "new": "77f6db8c345c2d153b870242" + } + } + }, + "feed_label_variants": { + "old": { + "age=85_plus": { + "Age 85 and over": 1, + "Age 85 plus": 51 + }, + "age=age_20": { + "Age 20": 1, + "Female 20 years": 52 + }, + "age=age_21": { + "Age 21": 1, + "Female 21 years": 52 + }, + "us:statutes/26/62#adjusted_gross_income=all": { + "All returns": 63, + "All returns, total": 180 + }, + "us:statutes/26/62#adjusted_gross_income=under_1": { + "No adjusted gross income": 501, + "No adjusted gross income and deficit": 2 + } + }, + "new": { + "age=age_20": { + "Age 20": 1, + "Female 20 years": 52 + }, + "age=age_21": { + "Age 21": 1, + "Female 21 years": 52 + } + } + }, + "targets": { + "old_count": 33250, + "new_count": 33250, + "same_order": true, + "names_only_in_old": [], + "names_only_in_new": [], + "changed_targets": 50, + "changed_field_counts": { + "hierarchy/dimensions/age/value_label": 1, + "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label": 49, + "metadata/ledger_layout_groupby_value_label": 50 + }, + "differences": [ + { + "name": "census_pep.cy2024.national_resident_population_age.85_plus.population", + "field": "hierarchy/dimensions/age/value_label", + "old": "Age 85 and over", + "new": "Age 85 plus" + }, + { + "name": "census_pep.cy2024.national_resident_population_age.85_plus.population", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "Age 85 and over", + "new": "Age 85 plus" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.actc_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.actc_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.actc_claims", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.actc_claims", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.adjusted_gross_income", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.adjusted_gross_income", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ctc_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ctc_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ctc_claims", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ctc_claims", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.eitc_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.eitc_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.eitc_claims", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.eitc_claims", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_before_credits_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.income_tax_liability_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.itemized_deductions_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.itemized_deductions_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.limited_state_local_taxes_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.medical_dental_expense_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.ordinary_dividends_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.partnership_scorp_income_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.premium_tax_credit_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.qualified_dividends_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_claims", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.real_estate_taxes_claims", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.rental_royalty_income_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.return_count", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.return_count", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.schedule_c_income_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.tax_exempt_interest_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_income_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_ira_distributions_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_pension_income_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.taxable_social_security_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.unemployment_compensation_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2022.historic_table_2.us.all.wages_salaries_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2023.table_1_1.all.adjusted_gross_income", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2023.table_1_1.all.adjusted_gross_income", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2023.table_1_1.all.return_count", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2023.table_1_1.all.return_count", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "All returns", + "new": "All returns, total" + }, + { + "name": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_amount", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + }, + { + "name": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_amount", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + }, + { + "name": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_returns", + "field": "hierarchy/dimensions/us:statutes/26/62#adjusted_gross_income/value_label", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + }, + { + "name": "irs_soi.ty2024.filing_season_week47.eitc_by_agi.under_1.total_earned_income_credit_returns", + "field": "metadata/ledger_layout_groupby_value_label", + "old": "No adjusted gross income and deficit", + "new": "No adjusted gross income" + } + ] + }, + "registry_version": { + "old": "dde00e855af8", + "new": "b8d571e91c22" + }, + "national_state_surface": { + "old": { + "targets": 6102, + "version": "3fad14f85468" + }, + "new": { + "targets": 6102, + "version": "3aa2a0830e7d" + } + }, + "target_label_variants": { + "old": { + "age=85_plus": { + "Age 85 and over": 1, + "Age 85 plus": 51 + }, + "us:statutes/26/62#adjusted_gross_income=all": { + "All returns": 47, + "All returns, total": 53 + }, + "us:statutes/26/62#adjusted_gross_income=under_1": { + "No adjusted gross income": 106, + "No adjusted gross income and deficit": 2 + } + }, + "new": {} + } +} diff --git a/experiments/us-feed-agi-age-labels/compare_feeds.py b/experiments/us-feed-agi-age-labels/compare_feeds.py new file mode 100644 index 0000000000..c138f4bf0d --- /dev/null +++ b/experiments/us-feed-agi-age-labels/compare_feeds.py @@ -0,0 +1,278 @@ +"""What the label-only US Chronicle feed re-pin changes, row by row and target by target. + +Usage: + uv run python experiments/us-feed-agi-age-labels/compare_feeds.py \\ + + +1. Rows, joined on ``aggregate_fact_key``: both feeds must hold the same keys. + For every shared row, every changed leaf field is counted per record set; + every changed label is listed in full, and every ``record_set_spec_hash`` + change once per record set. +2. Feed labels: every (dimension, value) that carries more than one label in + either feed, with its labels. +3. Compile both feeds as the release does (target period 2024, packaged + congressional-district crosswalk, age targets, Medicaid substitutions) and + compare every target's full ``TargetSpec.to_dict()`` by name: names added or + removed, and every changed field of every shared target, listed in full. + Also the registry version and the ``national_state`` surface the release + calibrates to. +4. Compiled labels: every (dimension, value) whose targets carry more than one + value label, in either registry. +""" + +from __future__ import annotations + +import collections +import hashlib +import importlib.util +import json +import sys +from pathlib import Path + +from microcosm.build.ledger_artifact import load_ledger_consumer_artifact +from microcosm.build.us_runtime import ( + apply_us_medicaid_enrollment_substitutions, + compile_us_fiscal_target_registry, + default_congressional_district_vintage_crosswalk_path, + load_congressional_district_vintage_crosswalk, +) +from microcosm.calibrate import TargetRegistry + +REPOSITORY = Path(__file__).resolve().parents[2] +LABEL_FIELDS = ("dimension_value_labels/", "layout/groupby_value_label") + + +def load_release_tool(): + path = REPOSITORY / "tools" / "build_us_fiscal_refresh_release.py" + spec = importlib.util.spec_from_file_location( + "build_us_fiscal_refresh_release", path + ) + module = importlib.util.module_from_spec(spec) + assert spec.loader is not None + spec.loader.exec_module(module) + return module + + +def file_sha256(path): + digest = hashlib.sha256() + with open(path, "rb") as stream: + for chunk in iter(lambda: stream.read(8 * 1024 * 1024), b""): + digest.update(chunk) + return digest.hexdigest() + + +def flatten(value, prefix=""): + """Leaf paths of a JSON value; hierarchy dimensions are keyed by their id.""" + + if isinstance(value, dict): + if not value: + yield prefix, {} + for key, child in value.items(): + yield from flatten(child, f"{prefix}/{key}" if prefix else str(key)) + elif isinstance(value, (list, tuple)) and prefix.endswith("hierarchy/dimensions"): + for dimension in value: + yield from flatten(dimension, f"{prefix}/{dimension['id']}") + else: + yield prefix, value + + +def changed_leaves(old, new): + old_leaves, new_leaves = dict(flatten(old)), dict(flatten(new)) + return { + path: (old_leaves.get(path, ""), new_leaves.get(path, "")) + for path in sorted(set(old_leaves) | set(new_leaves)) + if old_leaves.get(path, "") != new_leaves.get(path, "") + } + + +def load_rows(path): + rows = {} + for line in open(path, "rb"): + if line.strip(): + row = json.loads(line) + rows[row["aggregate_fact_key"]] = row + return rows + + +def feed_label_variants(rows): + labels = collections.defaultdict(collections.Counter) + for row in rows.values(): + for dimension, values in (row.get("dimension_value_labels") or {}).items(): + for value_id, label in values.items(): + labels[f"{dimension}={value_id}"][label] += 1 + return { + key: dict(sorted(counter.items())) + for key, counter in sorted(labels.items()) + if len(counter) > 1 + } + + +def compare_rows(old_rows, new_rows): + path_counts = collections.defaultdict(collections.Counter) + label_changes = [] + spec_hash_changes = {} + for key in sorted(set(old_rows) & set(new_rows)): + old_row, new_row = old_rows[key], new_rows[key] + record_set = old_row["layout"]["record_set_id"] + for path, (old_value, new_value) in changed_leaves(old_row, new_row).items(): + path_counts[path][record_set] += 1 + if path.startswith(LABEL_FIELDS): + label_changes.append( + { + "record_set_id": record_set, + "source_record_id": old_row["lineage"]["source_record_id"], + "field": path, + "old": old_value, + "new": new_value, + } + ) + elif path == "layout/record_set_spec_hash": + spec_hash_changes[record_set] = {"old": old_value, "new": new_value} + else: + label_changes.append( + { + "record_set_id": record_set, + "source_record_id": old_row["lineage"]["source_record_id"], + "field": path, + "old": old_value, + "new": new_value, + "unexpected": True, + } + ) + return { + "old_rows": len(old_rows), + "new_rows": len(new_rows), + "keys_only_in_old": sorted(set(old_rows) - set(new_rows)), + "keys_only_in_new": sorted(set(new_rows) - set(old_rows)), + "changed_rows": len( + { + key + for key in set(old_rows) & set(new_rows) + if old_rows[key] != new_rows[key] + } + ), + "changed_fields": { + path: { + "rows": sum(counts.values()), + "by_record_set": dict(sorted(counts.items())), + } + for path, counts in sorted(path_counts.items()) + }, + "label_and_other_changes": label_changes, + "record_set_spec_hash_changes": dict(sorted(spec_hash_changes.items())), + } + + +def compile_registry(path, crosswalk, release_tool): + facts = load_ledger_consumer_artifact(path).facts + registry = compile_us_fiscal_target_registry( + facts, + target_period=2024, + congressional_district_vintage_crosswalk=crosswalk, + age_targets=True, + ) + registry, _ = apply_us_medicaid_enrollment_substitutions(registry) + surface_specs, _ = release_tool._select_target_surface( + registry.specs, "national_state" + ) + return registry, TargetRegistry(surface_specs, country="us") + + +def target_label_variants(registry): + labels = collections.defaultdict(collections.Counter) + for spec in registry.specs: + if spec.hierarchy is None: + continue + for dimension in spec.hierarchy.dimensions: + labels[f"{dimension.id}={dimension.value_id}"][dimension.value_label] += 1 + return { + key: dict(sorted(counter.items())) + for key, counter in sorted(labels.items()) + if len(counter) > 1 + } + + +def compare_targets(old_registry, new_registry): + old_specs = {spec.name: spec.to_dict() for spec in old_registry.specs} + new_specs = {spec.name: spec.to_dict() for spec in new_registry.specs} + differences = [] + path_counts = collections.Counter() + for name in sorted(set(old_specs) & set(new_specs)): + for path, (old_value, new_value) in changed_leaves( + old_specs[name], new_specs[name] + ).items(): + path_counts[path] += 1 + differences.append( + {"name": name, "field": path, "old": old_value, "new": new_value} + ) + return { + "old_count": len(old_specs), + "new_count": len(new_specs), + "same_order": [spec.name for spec in old_registry.specs] + == [spec.name for spec in new_registry.specs], + "names_only_in_old": sorted(set(old_specs) - set(new_specs)), + "names_only_in_new": sorted(set(new_specs) - set(old_specs)), + "changed_targets": len({difference["name"] for difference in differences}), + "changed_field_counts": dict(sorted(path_counts.items())), + "differences": differences, + } + + +def main() -> int: + old_path, new_path, out_path = sys.argv[1:4] + old_rows, new_rows = load_rows(old_path), load_rows(new_path) + crosswalk = load_congressional_district_vintage_crosswalk( + default_congressional_district_vintage_crosswalk_path() + ) + release_tool = load_release_tool() + old_registry, old_surface = compile_registry(old_path, crosswalk, release_tool) + new_registry, new_surface = compile_registry(new_path, crosswalk, release_tool) + report = { + "feeds": { + "old": {"name": Path(old_path).name, "sha256": file_sha256(old_path)}, + "new": {"name": Path(new_path).name, "sha256": file_sha256(new_path)}, + }, + "rows": compare_rows(old_rows, new_rows), + "feed_label_variants": { + "old": feed_label_variants(old_rows), + "new": feed_label_variants(new_rows), + }, + "targets": compare_targets(old_registry, new_registry), + "registry_version": {"old": old_registry.version, "new": new_registry.version}, + "national_state_surface": { + "old": {"targets": len(old_surface.specs), "version": old_surface.version}, + "new": {"targets": len(new_surface.specs), "version": new_surface.version}, + }, + "target_label_variants": { + "old": target_label_variants(old_registry), + "new": target_label_variants(new_registry), + }, + } + Path(out_path).write_text(json.dumps(report, indent=1, default=str) + "\n") + summary = { + "rows": { + key: value + for key, value in report["rows"].items() + if key not in {"label_and_other_changes", "record_set_spec_hash_changes"} + }, + "unexpected_row_changes": [ + change + for change in report["rows"]["label_and_other_changes"] + if change.get("unexpected") + ], + "feed_label_variants": report["feed_label_variants"], + "targets": { + key: value + for key, value in report["targets"].items() + if key != "differences" + }, + "registry_version": report["registry_version"], + "national_state_surface": report["national_state_surface"], + "target_label_variants": report["target_label_variants"], + } + print(json.dumps(summary, indent=1, default=str)) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/packages/microcosm-build/src/microcosm/build/us/chronicle_feed.json b/packages/microcosm-build/src/microcosm/build/us/chronicle_feed.json index 0aa420db00..399971cc74 100644 --- a/packages/microcosm-build/src/microcosm/build/us/chronicle_feed.json +++ b/packages/microcosm-build/src/microcosm/build/us/chronicle_feed.json @@ -3,15 +3,15 @@ "country": "us", "scope": "us_fiscal_targets", "source_repo": "PolicyEngine/chronicle", - "source_commit": "cf9ece2e7be11158c21fdc4dd38b44d92db552f6", - "build": "tools/build_us_chronicle_feed.py --skip-artifact: one `chronicle build-bundle --year Y --source ` per build year in chronicle_feed_scope.json, rows kept for exactly the scope's (record set, period) pairs and sorted by aggregate_fact_key. The commit is c5e5bf8 plus the TY2023 Historic Table 2 state AGI-band package (51aa40f, tag microcosm-us-feed-940-v1, chronicle#291), the digit-text guard match from chronicle main's aa3e4de3, and the BEA NIPA Table 7.8 line 17 (B4923C) package as chronicle#331 merged it (branch feed/us-51aa40f-esi-b4923c, tag microcosm-us-feed-454-v1, microcosm#454). Bare feed: `chronicle build-consumer-artifact` refuses it at this commit; see docs/us-chronicle-feed-repin.md.", + "source_commit": "a9026cc8f80307af0c4527fdb3779fab32ffad9f", + "build": "tools/build_us_chronicle_feed.py --skip-artifact: one `chronicle build-bundle --year Y --source ` per build year in chronicle_feed_scope.json, rows kept for exactly the scope's (record set, period) pairs and sorted by aggregate_fact_key. The commit is c5e5bf8 plus the TY2023 Historic Table 2 state AGI-band package (51aa40f, tag microcosm-us-feed-940-v1, chronicle#291), the digit-text guard match from chronicle main's aa3e4de3, the BEA NIPA Table 7.8 line 17 (B4923C) package as chronicle#331 merged it (cf9ece2, branch feed/us-51aa40f-esi-b4923c, tag microcosm-us-feed-454-v1, microcosm#454), and three label-only commits that give adjusted gross income under_1 and all and age 85_plus one label each (branch feed/us-cf9ece2-agi-age-labels, tag microcosm-us-feed-1343-v1, microcosm#1343). Bare feed: `chronicle build-consumer-artifact` refuses it at this commit; see docs/us-chronicle-feed-repin.md.", "artifact_schema_version": null, "consumer_fact_schema_versions": [ "chronicle.consumer_fact.v3" ], "consumer_fact_schema_sha256": "bdb51e2a8115634633ba7448c4005930fd9c0bfbade5e1b079b6bc24da485d3d", "fact_row_count": 40181, - "facts_sha256": "054e5684005a7b143dcb84eabac634135ce9b2b33bb57b540602e474a4ba7c57", + "facts_sha256": "4d89e4a498ffd73a407821d9ce2c45837072901e0a29acf3206160d1fafd7c14", "manifest_sha256": null, - "scope_sha256": "f4a218fc3be534f3e447f25bf1ec4064d9f3db6b72a55874ed5db4823c922239" + "scope_sha256": "04460f39e5c2b79011724ce33cac4ccf3b0f42812bc7179b6b532773483fe04e" } diff --git a/packages/microcosm-build/src/microcosm/build/us/chronicle_feed_scope.json b/packages/microcosm-build/src/microcosm/build/us/chronicle_feed_scope.json index 596954435f..f552c265c2 100644 --- a/packages/microcosm-build/src/microcosm/build/us/chronicle_feed_scope.json +++ b/packages/microcosm-build/src/microcosm/build/us/chronicle_feed_scope.json @@ -2,7 +2,7 @@ "version": 1, "country": "us", "source_repo": "PolicyEngine/chronicle", - "source_commit": "cf9ece2e7be11158c21fdc4dd38b44d92db552f6", + "source_commit": "a9026cc8f80307af0c4527fdb3779fab32ffad9f", "rule": "The (record_set_id, period) pairs of the pinned feed consumer_facts_buildn_v9_4.jsonl, plus the 51 TY2023 Historic Table 2 state AGI-band record sets (irs_soi.ty2023.historic_table_2.state_agi., microcosm#940), plus the three BEA NIPA Table 7.8 line 17 (B4923C) record sets (bea_nipa.cy.private_group_health_insurance, 2023 to 2025, microcosm#454); each built from the named package with `chronicle build-bundle --year --source `.", "pair_count": 640, "runs": { diff --git a/packages/microcosm-build/src/microcosm/build/us/target_parity_feed_families.json b/packages/microcosm-build/src/microcosm/build/us/target_parity_feed_families.json index 870197d07e..19cf45d912 100644 --- a/packages/microcosm-build/src/microcosm/build/us/target_parity_feed_families.json +++ b/packages/microcosm-build/src/microcosm/build/us/target_parity_feed_families.json @@ -1,6 +1,6 @@ { - "feed": "consumer_facts_us_cf9ece2.jsonl", - "feed_sha256": "054e5684005a7b143dcb84eabac634135ce9b2b33bb57b540602e474a4ba7c57", + "feed": "consumer_facts_us_a9026cc.jsonl", + "feed_sha256": "4d89e4a498ffd73a407821d9ce2c45837072901e0a29acf3206160d1fafd7c14", "families": { "bea_nipa.business_current_transfer_receipts": 1, "bea_nipa.defined_contribution_actual_contributions": 1, @@ -84,5 +84,17 @@ "usda_snap.state_average_monthly_households": 53, "usda_snap.state_average_monthly_persons": 106, "usda_snap.state_benefits": 53 + }, + "dimension_value_label_variants": { + "age": { + "age_20": [ + "Age 20", + "Female 20 years" + ], + "age_21": [ + "Age 21", + "Female 21 years" + ] + } } } diff --git a/packages/microcosm-build/src/microcosm/build/us/target_parity_manifest.json b/packages/microcosm-build/src/microcosm/build/us/target_parity_manifest.json index 449ba98bea..8f67f16675 100644 --- a/packages/microcosm-build/src/microcosm/build/us/target_parity_manifest.json +++ b/packages/microcosm-build/src/microcosm/build/us/target_parity_manifest.json @@ -1,8 +1,8 @@ { "schema_version": 1, "reference": { - "feed": "consumer_facts_us_cf9ece2.jsonl", - "feed_sha256": "054e5684005a7b143dcb84eabac634135ce9b2b33bb57b540602e474a4ba7c57", + "feed": "consumer_facts_us_a9026cc.jsonl", + "feed_sha256": "4d89e4a498ffd73a407821d9ce2c45837072901e0a29acf3206160d1fafd7c14", "target_period": "2024", "registry_compile": "compile_us_fiscal_target_registry(age_targets=True, canonical CD vintage crosswalk) + apply_us_medicaid_enrollment_substitutions; one national + state + congressional-district surface for every artifact (microcosm#449)", "us_data_source": "retired us-data pipeline (archived): utils/loss.py (eCPS loss matrix), db/etl_national_targets.py, db/etl_*.py, utils/national_target_parity.py", diff --git a/packages/microcosm-build/tests/engine_free/shared/test_release_target_parity.py b/packages/microcosm-build/tests/engine_free/shared/test_release_target_parity.py index 0a69664aac..537e0157b0 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_release_target_parity.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_release_target_parity.py @@ -488,6 +488,46 @@ def test_build_manifest_adjudicates_an_injected_obbba_fact(self) -> None: assert feed_families["families"]["jct.obbba_title_vii"] == 1 +class TestFeedLabelVariants: + """microcosm#1343: the inventory records every dimension value the feed + labels more than one way, so CI sees a label regression without the feed.""" + + def test_generator_lists_values_with_two_labels_from_either_field(self) -> None: + generator = _load_generator() + agi = "us:statutes/26/62#adjusted_gross_income" + rows = [ + { + "dimension_value_labels": {agi: {"all": "All returns"}}, + "layout": { + "groupby_dimension": agi, + "groupby_value_id": "all", + "groupby_value_label": "All returns", + }, + }, + { + "dimension_value_labels": { + agi: {"all": "All returns, total"}, + "filing_status": {"all": "All filing statuses"}, + }, + "layout": {}, + }, + { + "dimension_value_labels": {"age": {"85_plus": "Age 85 plus"}}, + "layout": { + "groupby_dimension": "age", + "groupby_value_id": "85_plus", + "groupby_value_label": "Age 85 and over", + }, + }, + {"dimension_value_labels": {"age": {"age_20": "Age 20"}}}, + ] + + assert generator._dimension_value_label_variants(rows) == { + "age": {"85_plus": ["Age 85 and over", "Age 85 plus"]}, + agi: {"all": ["All returns", "All returns, total"]}, + } + + class TestRegeneration: """Feed-dependent reproduction — guarded on the pinned feed being present.""" diff --git a/packages/microcosm-build/tests/engine_free/us/test_us_chronicle_feed.py b/packages/microcosm-build/tests/engine_free/us/test_us_chronicle_feed.py index 74eaa50043..f9bdf52743 100644 --- a/packages/microcosm-build/tests/engine_free/us/test_us_chronicle_feed.py +++ b/packages/microcosm-build/tests/engine_free/us/test_us_chronicle_feed.py @@ -32,8 +32,8 @@ _TEST_PATHS = paths_for("microcosm-build") _ROOT = _TEST_PATHS.repository -_CHRONICLE_COMMIT = "cf9ece2e7be11158c21fdc4dd38b44d92db552f6" -_FACTS_SHA256 = "054e5684005a7b143dcb84eabac634135ce9b2b33bb57b540602e474a4ba7c57" +_CHRONICLE_COMMIT = "a9026cc8f80307af0c4527fdb3779fab32ffad9f" +_FACTS_SHA256 = "4d89e4a498ffd73a407821d9ce2c45837072901e0a29acf3206160d1fafd7c14" _SCHEMA_SHA256 = "bdb51e2a8115634633ba7448c4005930fd9c0bfbade5e1b079b6bc24da485d3d" @@ -132,6 +132,36 @@ def test_parity_resources_and_generator_restate_the_pin() -> None: assert manifest["reference"]["reviewed_exclusions"] == "53" +#: The dimension values the pinned feed labels more than one way, as the +#: generator records them in the feed-family inventory. microcosm#1343 gave +#: adjusted gross income ``under_1`` and ``all`` and age ``85_plus`` one label +#: each; the age_20 and age_21 pairs (Census projections against ACS B01001) +#: select no compiled target and were left as they are. +_REVIEWED_FEED_LABEL_VARIANTS = { + "age": { + "age_20": ["Age 20", "Female 20 years"], + "age_21": ["Age 21", "Female 21 years"], + } +} + + +def test_feed_inventory_lists_only_the_reviewed_label_variants() -> None: + """Runs in CI without the feed. A re-pin regenerates the inventory from its + feed (the inventory restates the pinned digest), so a re-pin built on a + Chronicle commit without the microcosm#1343 label commits lists those + values here again and fails, and so does any new dimension value with two + labels until it is reviewed.""" + feed_families = _us_resource("target_parity_feed_families.json") + variants = feed_families["dimension_value_label_variants"] + for dimension_id, value_id in ( + ("us:statutes/26/62#adjusted_gross_income", "under_1"), + ("us:statutes/26/62#adjusted_gross_income", "all"), + ("age", "85_plus"), + ): + assert value_id not in variants.get(dimension_id, {}) + assert variants == _REVIEWED_FEED_LABEL_VARIANTS + + def test_scope_names_every_pinned_pair_once() -> None: builder = _load_tool("build_us_chronicle_feed") scope_path = builder.default_scope_path() diff --git a/packages/microcosm-build/tests/engine_free/us/test_us_esi_premiums.py b/packages/microcosm-build/tests/engine_free/us/test_us_esi_premiums.py index 24623916ae..6cf1ea04c7 100644 --- a/packages/microcosm-build/tests/engine_free/us/test_us_esi_premiums.py +++ b/packages/microcosm-build/tests/engine_free/us/test_us_esi_premiums.py @@ -1100,6 +1100,23 @@ def test_a_raw_source_frame_that_carries_the_outputs_is_refused(self) -> None: assert_operator_free_source_frame(_run(_realistic_rows(40)), label="raw") +#: Committed reports of the re-pins after microcosm#454 that kept every row of +#: the feed before them, oldest first. Together they carry the three banked +#: B4923C facts from the #454 feed to the pinned one. A re-pin that keeps the +#: rows adds its report here; one that adds or changes rows needs its own check. +_LATER_ROW_KEEPING_REPIN_REPORTS = ( + # microcosm#1343: three dimension values relabelled, nothing else. + "experiments/us-feed-agi-age-labels/compare.json", +) +#: The row fields those re-pins may change: labels, and the record-set hash +#: that covers the labels. +_LABEL_AND_HASH_FIELDS = ( + "dimension_value_labels/", + "layout/groupby_value_label", + "layout/record_set_spec_hash", +) + + class TestAnchorFeedCheck: @staticmethod def _facts(values: dict[int, object]) -> list[dict]: @@ -1129,9 +1146,13 @@ def test_the_committed_feed_pin_banks_the_anchor(self) -> None: """The pinned feed's three added facts are the stage's anchor values. The feed itself is too large for the repository, so this reads the - committed row-by-row report of the re-pin. Changing the anchor without - re-pinning the feed, or the reverse, fails here and not only at a - release preflight. + committed row-by-row report of the re-pin that added them, then the + committed report of every later re-pin that kept the feed's rows + (``_LATER_ROW_KEEPING_REPIN_REPORTS``). Each later report must start + from the feed before it, keep every key, change no value and leave + the three B4923C record sets alone, and the last must end at the pin. + Changing the anchor without re-pinning the feed, or the reverse, fails + here and not only at a release preflight. """ report = json.loads( @@ -1142,8 +1163,6 @@ def test_the_committed_feed_pin_banks_the_anchor(self) -> None: pin = json.loads( files("microcosm.build.us").joinpath("chronicle_feed.json").read_text() ) - assert report["new"]["sha256"] == pin["facts_sha256"] - assert report["new"]["rows"] == pin["fact_row_count"] assert report["previous_rows_missing"] == 0 assert report["previous_rows_changed"] == 0 added = report["rows_added"] @@ -1152,9 +1171,28 @@ def test_the_committed_feed_pin_banks_the_anchor(self) -> None: esi.EMPLOYER_PREMIUM_ANCHOR["values"] ) template = esi.EMPLOYER_PREMIUM_ANCHOR["feed_record_set"] - assert {row["record_set_id"] for row in added} == { + anchor_record_sets = { template.format(year=year) for year in esi.EMPLOYER_PREMIUM_ANCHOR["values"] } + assert {row["record_set_id"] for row in added} == anchor_record_sets + + feed_sha256 = report["new"]["sha256"] + feed_rows = report["new"]["rows"] + for report_path in _LATER_ROW_KEEPING_REPIN_REPORTS: + later = json.loads((_REPOSITORY_ROOT / report_path).read_text()) + rows = later["rows"] + assert later["feeds"]["old"]["sha256"] == feed_sha256, report_path + assert rows["old_rows"] == rows["new_rows"] == feed_rows, report_path + assert rows["keys_only_in_old"] == rows["keys_only_in_new"] == [] + for field, counts in rows["changed_fields"].items(): + assert field.startswith(_LABEL_AND_HASH_FIELDS), (report_path, field) + assert anchor_record_sets.isdisjoint(counts["by_record_set"]), ( + report_path, + field, + ) + feed_sha256 = later["feeds"]["new"]["sha256"] + assert feed_sha256 == pin["facts_sha256"] + assert feed_rows == pin["fact_row_count"] assert {row["source_sha256"] for row in added} == { esi.EMPLOYER_PREMIUM_ANCHOR["sha256"] } diff --git a/packages/microcosm-build/tests/engine_free/us/test_us_fiscal_targets.py b/packages/microcosm-build/tests/engine_free/us/test_us_fiscal_targets.py index aa84057ec2..58d794ce66 100644 --- a/packages/microcosm-build/tests/engine_free/us/test_us_fiscal_targets.py +++ b/packages/microcosm-build/tests/engine_free/us/test_us_fiscal_targets.py @@ -895,13 +895,15 @@ def test_pinned_feed_national_state_surface_restores_the_fences( ) -> None: """The release surface on the pinned feed: 33,250 compiled targets after Medicaid substitution, 6,102 national_state targets at registry - 3fad14f85468, 32 CHIP rows none of them for an M-CHIP state, no - other-income row and no tips return count. microcosm#1227 moved the - version from e1f9906bf0e0 by doubling the eight Table 2.5 EITC child - total rows, whose uprating source sum had counted each split twice; - microcosm#1206 moved it from f96be9f41781 by binding the Part B premium - target to gross_medicare_part_b_premium_if_enrolled. Neither changed - the counts. + 3aa2a0830e7d, 32 CHIP rows none of them for an M-CHIP state, no + other-income row and no tips return count. microcosm#1343 moved the + version from 3fad14f85468 by re-pinning to a feed that gives three + dimension values one label each (the version hashes hierarchy labels); + microcosm#1227 moved it from e1f9906bf0e0 by doubling the eight Table + 2.5 EITC child total rows, whose uprating source sum had counted each + split twice; microcosm#1206 moved it from f96be9f41781 by binding the + Part B premium target to gross_medicare_part_b_premium_if_enrolled. + None of the three changed the counts. The 408 state AGI-band rows of microcosm#940 (51 states x 4 bands x 2 measures) took it from 32,842 / 5,694 at d315c75804ef on the c5e5bf8 feed; before microcosm#956 it was @@ -911,7 +913,7 @@ def test_pinned_feed_national_state_surface_restores_the_fences( registry, surface, _ = pinned_feed_national_state_surface assert len(registry.specs) == 33_250 assert len(surface.specs) == 6_102 - assert surface.version == "3fad14f85468" + assert surface.version == "3aa2a0830e7d" chip = [ spec for spec in surface.specs @@ -938,6 +940,43 @@ def test_pinned_feed_national_state_surface_restores_the_fences( ) +@pytest.mark.parametrize( + ("dimension_id", "value_id", "value_label"), + [ + ( + "us:statutes/26/62#adjusted_gross_income", + "under_1", + "No adjusted gross income", + ), + ("us:statutes/26/62#adjusted_gross_income", "all", "All returns, total"), + ("age", "85_plus", "Age 85 plus"), + ], +) +def test_pinned_feed_targets_give_each_reviewed_value_one_label( + pinned_feed_national_state_surface, dimension_id, value_id, value_label +) -> None: + """Every compiled target that selects one of these dimension values shows + it under the one wording microcosm#1343 chose. The feed before this re-pin, + built at Chronicle cf9ece2 (and before that at 51aa40f), labelled each two + ways: under_1 "No adjusted gross income and deficit" in the + week-47 filing-season package, all "All returns" in Historic Table 2 and + Table 1.1, and 85_plus "Age 85 and over" in the national Census PEP + package.""" + registry, _, _ = pinned_feed_national_state_surface + labels_by_target = { + spec.name: dimension.value_label + for spec in registry.specs + if spec.hierarchy is not None + for dimension in spec.hierarchy.dimensions + if (dimension.id, dimension.value_id) == (dimension_id, value_id) + } + + assert labels_by_target + assert { + name: label for name, label in labels_by_target.items() if label != value_label + } == {} + + _EITC_CHILD_SPLITS = ( "no_qualifying_children", "one_qualifying_child", diff --git a/tools/build_us_target_parity_manifest.py b/tools/build_us_target_parity_manifest.py index f98c06cec8..1cdd5004b4 100644 --- a/tools/build_us_target_parity_manifest.py +++ b/tools/build_us_target_parity_manifest.py @@ -19,7 +19,11 @@ Derivation (from the sha-pinned feed + the deterministic registry compile): - **Feed-family inventory** = every ``namespace.concept`` family id the feed - carries, with fact counts (``target_parity_feed_families.json``). + carries, with fact counts (``target_parity_feed_families.json``), and every + dimension value the feed labels more than one way, with its labels + (``dimension_value_label_variants``; microcosm#1343). CI reads the + committed listing, so a re-pin that brings back a second label fails there + without the feed. - **Compiled families** = the families the one-surface registry compiles today (``compile_us_fiscal_target_registry(age_targets=True)`` + the reviewed CMS Medicaid enrollment substitution). Status ``compiled``. @@ -62,7 +66,7 @@ MANIFEST_PATH = US_PACKAGE_DIR / "target_parity_manifest.json" FEED_FAMILIES_PATH = US_PACKAGE_DIR / "target_parity_feed_families.json" -DEFAULT_FEED_NAME = "consumer_facts_us_cf9ece2.jsonl" +DEFAULT_FEED_NAME = "consumer_facts_us_a9026cc.jsonl" DEFAULT_FEED_PATH = ( Path.home() / "PolicyEngine" / "_buildh-runtime" / "inputs" / DEFAULT_FEED_NAME ) @@ -692,6 +696,43 @@ def _feed_family_counts(facts: list[dict]) -> Counter[str]: return counts +def _dimension_value_label_variants( + facts: list[dict], +) -> dict[str, dict[str, list[str]]]: + """Every (dimension, value id) the feed labels more than one way. + + Labels come from each row's ``dimension_value_labels`` and, for the row's + group-by value, ``layout.groupby_value_label``, stripped as the ledger + compiler strips them. Returned as {dimension: {value id: sorted labels}}. + """ + labels_by_value: dict[tuple[str, str], set[str]] = {} + + def record(dimension_id: object, value_id: object, label: object) -> None: + text = str(label).strip() if label is not None else "" + if dimension_id and value_id is not None and text: + key = (str(dimension_id), str(value_id)) + labels_by_value.setdefault(key, set()).add(text) + + for fact in facts: + for dimension_id, value_labels in ( + fact.get("dimension_value_labels") or {} + ).items(): + for value_id, label in (value_labels or {}).items(): + record(dimension_id, value_id, label) + layout = fact.get("layout") or {} + record( + layout.get("groupby_dimension"), + layout.get("groupby_value_id"), + layout.get("groupby_value_label"), + ) + + variants: dict[str, dict[str, list[str]]] = {} + for (dimension_id, value_id), labels in sorted(labels_by_value.items()): + if len(labels) > 1: + variants.setdefault(dimension_id, {})[value_id] = sorted(labels) + return variants + + def _compiled_families(facts: list[dict]) -> set[str]: # Parity is declared against the one registry every calibrated artifact # compiles, using the canonical source-to-current CD vintage translation. @@ -805,6 +846,7 @@ def build_manifest( "feed": feed_name, "feed_sha256": feed_sha256, "families": dict(sorted(feed_counts.items())), + "dimension_value_label_variants": _dimension_value_label_variants(facts), } return manifest, feed_families