Skip to content

Drop congressional-district SALT and PTC facts read from the wrong IRS column - #1224

Draft
MaxGhenis wants to merge 3 commits into
mainfrom
us-cd-source-column-exclusions
Draft

MaxGhenis wants to merge 3 commits into
mainfrom
us-cd-source-column-exclusions

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1038. Split out of #1040 so this bug fix can land on its own; #1040 keeps the congressional-district capital-gains share change, which needs Max's ruling.

Summary

Chronicle's congressional_district_2022 package (22incd.csv) reads two measure pairs from IRS columns that mean something else. The IRS documentation guide (22incddocguide.docx) is the reference.

Measure id Column the package reads What the guide says it is Column the measure id means
limited_state_local_taxes_returns / _amount N18425 / A18425 State and local income taxes (Schedule A line 5a), before the $10,000 limit N18460 / A18460, limited state and local taxes (line 5e), which Historic Table 2 reads and salt_deduction measures
premium_tax_credit_returns / _amount N85530 / A85530 Additional Medicare tax (Form 8959 line 24) N85770 / A85770, total premium tax credit, which Historic Table 2 reads and assigned_aca_ptc measures

TY2022 US values in the file itself:

  • A18425 is $250.4B against $121.2B for A18460.
  • N85530 is 6,848,330 returns and $14.2B, against 7,713,000 returns and $53.1B for N85770.

On the default full target surface:

  • The district SALT amount rows summed to 1.98x the national target.
  • The PTC return rows counted additional-Medicare-tax payers as PTC recipients.
  • The PTC amount was already dropped, by a hard-coded check whose comment called A85530 "not the same gross annual PTC control"; it is not PTC at all.

Of the package's 56 measures, 50 have a twin in a Historic Table 2 package, and these four are the only ones that read a different column from their twin.

What changes

  • US_FISCAL_TARGET_SOURCE_COLUMN_EXCLUSIONS (fiscal_targets.py): a reviewed register keyed by (measure id, layout.source_column_id). It drops every SOI fact read from a listed column, at every geography and vintage, before selection.
    • The IRS column is the definition, so a package corrected to read N18460/N85770 passes untouched. A chip is filed for the Chronicle remap.
    • A congressional-district fact of a listed measure that names no column refuses the compile (MissingSoiSourceColumnError), so a feed schema change cannot quietly lift the exclusion.
    • Each entry's reason quotes the guide definitions and the file's values.
  • Receipt. us_fiscal_target_exclusion_receipt gains a source_column_concept_exclusion rule, which the release's us_source_coverage.json carries. The coverage report also lists the register (fiscal_target_source_column_exclusions).
  • Removed: _is_soi_cd_premium_tax_credit_amount_conflict, now covered by the register with the right reason.
  • state_cd. Its STATE_CD_DEFECTIVE_CD_FILE_MEASURES stays as a second fence; the comment now says the compiler drops these first.
  • Docs:
    • docs/us-fact-to-target.md: when to use the column register, and when a component column needs a share-or-drop decision instead.
    • docs/us-acs-local-soi-target-surface.md: the ACS-local mode counts.
    • The changelog fragment.

Not in the register: interest paid. interest_paid_deduction_* in the same package reads N19300/A19300, line 8a mortgage interest. That is a component of the line-10 deduction the measure id means, not another concept, so it needs a share-or-drop decision of its own; a chip is filed. It also feeds state_cd's itemized bridge.

Effect on the pinned feed

Release compile on 51aa40f: target period 2024, aging, packaged CD crosswalk, Medicaid substitution.

main (123927679) this PR
Compiled targets, all on full 33,250 (f5bd921d6b21) 31,786 (f38dbd749180)
national_state 6,102 (e1f9906bf0e0) 6,102 (e1f9906bf0e0), byte-identical
District SALT amount, sum on full $272.3B (1.98x the national $137.4B) none
  • Removed: 1,464 specs, all congressional-district, all on full:
    • 976 SALT (US row, 51 states and 436 districts per measure);
    • 488 PTC returns.
  • Nothing else changes: no spec is added, and no value or metadata moves.

ACS local release:

  • state and state_cd are unchanged. (state_cd already dropped these rows itself.)
  • --soi-mode totals goes from 607 to 120 SOI specs, losing the 487 district PTC-return rows.
  • --soi-mode full goes from 31,321 to 29,860.

Invariants

  • Exact. A fact is dropped if and only if its (measure id, IRS column) is registered. The same measure read from the right column compiles. Unit tests cover district and state rows, both directions.
  • Receipt completeness. For any sub-feed of the synthetic five-rule feed, each receipt rule lists exactly the facts it drops or allows. This is the existing Hypothesis property, extended to the new rule.
  • Fail closed. A listed congressional-district fact with no column refuses the compile and the receipt. The Historic Table 2 US package, which publishes no column ids, still compiles.
  • Pinned.
    • No district SALT or PTC target compiles; the Historic Table 2 rows of those measures still do.
    • The receipt lists exactly 4 × 488 ids.
    • national_state is byte-identical (e1f9906bf0e0).

Tests

These runs were local, on the pinned 51aa40f feed, run sequentially with peak RSS 3.3 GB. CI has no feed and skips the pinned-feed tests.

  • engine_free/us/test_us_fiscal_targets.py: 172 passed, none skipped. That includes three pinned-feed tests: the exclusion receipt (4 × 488 ids), the fences (31,786 / f38dbd749180 / e1f9906bf0e0) and the new "no district target reads an excluded column".
  • The ACS-local release tool, the state_cd sparse surface (its feed-gated contract test included), source coverage, release target parity, the Chronicle feed and the fiscal refresh builder, run with MICROCOSM_US_CHRONICLE_FACTS set: 495 passed, none skipped.
  • The ACS-local contract test now pins totals at 120 SOI specs (Historic Table 2 PTC only) and full at 29,860. These were measured with state_admin_specs on the pinned feed.
  • tools/ci_test_plan.py verify passes. ruff check and ruff format --check are clean on the touched files.

New tests:

  • the exact drop (district and state rows; the corrected N85770/A18460 facts compile);
  • every register reason names both its column and the right column;
  • the missing-column refusal, in the compile and in the receipt, with the Historic Table 2 US package without columns still compiling;
  • the receipt rule added to the five-rule synthetic feed and its Hypothesis completeness property;
  • the pinned checks above.

axiom: n/a: microsim target compilation, no policy rule changes.

🤖 Generated with Claude Code

…S column (#1038)

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 12, 2026
…n exclusions with #1224

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured with state_admin_specs on the pinned 51aa40f feed: --soi-mode totals
keeps 120 SOI specs (the Historic Table 2 premium-tax-credit rows only) and
full 29,860, as docs/us-acs-local-soi-target-surface.md states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 12, 2026
… under the share rebase

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

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 12, 2026
…1040 re-review nits

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

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

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant