Repository navigation
Conversation
Replace the 20%-of-state-amount approximation in local_sales_tax with the State and Local General Sales Tax Deduction Worksheet: the Optional Local Sales Tax Tables (with the selector's named counties and cities) in the line-2 states and the ratio method elsewhere, with line 3 the combined rate above the state table heading rate. Combined rates come only from official state files: the Streamlined Sales Tax rate and boundary files, New York Publication 718 and 718-A, and Virginia Tax's rates by locality, weighted to Census 2020 places. Where no official file exists the combined rate defaults to the heading rate, so the local amount is 0 unless the user enters a combined or local rate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne 3 Address the independent review of #9879: - Recode SST place codes that match no Census place or county subdivision of their county by the records' postal city, or by the code the same ZIP codes carry after the records end. This fixes the DeKalb County part of Atlanta (Georgia code 05000; 8.0% before, 8.9% now) and Vermont's 2022 town taxes (older town codes, and town-wide taxes under CDP codes). In Vermont codes resolve to towns. The build logs every recoding and every code left unmatched. - Write each covered state's general sales tax rate (state_rates.csv) and take worksheet line 3 as the combined rate less it, so rounded or averaged headings (Minnesota 6.88%, South Dakota 2023 4.35%) no longer shift line 3. California and Nevada keep the IRS rule: the combined rate above the heading. - List New York City's five counties as Table A counties. - Accept 7-digit place GEOIDs; document the county_fips/place_fips keys, the pre-2022 backdating and the remaining limits (Iowa, Vermont towns outside places, a few Utah codes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tax years 2015-2021 used the 2022 Optional Local Sales Tax Tables, table selector and state table heading rates through parameter backdating. Add each year's own values from that year's Instructions for Schedule A (Form 1040): Local Tables A-D, worksheet line 2's states, the selector's state defaults, counties and cities (2020 Census FIPS codes), and every state's heading rate. Every cell was extracted by two independent parsers (poppler -layout and MuPDF word boxes) and the selector by two independent mappers; they agree everywhere. New York City's five counties take the city's table (Table A in every year), as from 2022. 2022 and later values are unchanged. Extend the worksheet invariants (I1, I4, I6-I9) and the selector check (L7) to 2015-2025, add 2015-2021 YAML cases, and say in local_sales_tax's documentation that only the locality and official state rates still extend back from 2022. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aa9604b to
ac7d08d
Compare
- Cover the default path in official-rate states whose state rate changed before 2022: South Dakota and Kansas 2015 county areas with no local tax in the 2022 files keep line 3 at 0. - Replace the California 2015 no-input case, which could not fail before, with California at its 7.5% heading. - Say in local_sales_tax_rate's documentation that California's line 3 threshold is 7.5% in 2015 and 2016. - Cite the 2015-2019 line 6 instruction pages in local_sales_tax. - Keep about four Hypothesis examples per checked year. - Quote Georgia's 2021 and 2022 other-locality rows exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Say in local_sales_tax_rate's documentation that the official state rates' 2022 values also apply before 2022. - Cite p5 of the 2016 instructions, where the Nevada and in-year rate change parts of the line 3 instructions are. - Describe the 2015-2021 local_state_tax cases' inputs accurately and reflow a long test comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hand-off to the US + core hubHead: Base: stacked on #9879 ( Merge order:
Review: independent Opus reviews, all approving at the current head. Verdicts and findings are in
Passed locally on this head (host rule
Pending: CI after the retarget; #9879's own review and merge. Follow-ups:
Axiom: Work files: extractions, parsers, comparison and build scripts, and run logs are in |
Summary
#9879 models the IRS local general sales tax worksheet with parameters that start in 2022. PolicyEngine backdates parameters to 2015, so tax years 2015-2021 use the 2022 local tables, selector and heading rates. This PR adds each year's own values from that year's Instructions for Schedule A (Form 1040):
Updated after #9879 merged as
d08051cdd440174d287d0601c9bfe1ee10b7ed78. This PR merged main (0e7ced1747bae8f802a627c6f90d4d0ee4ba9c31) at836562da1a9b55890b0ce58ecc409eb23f5c4ef7by replaying only its own three commits (ac7d08d4c4,c75adad230,92830f26d1), without rewriting the published branch. Main’s final formulas, NONE semantics, geography fallbacks, documentation and 2022+ values are preserved.Sources
https://www.irs.gov/pub/irs-prior/i1040sca--YYYY.pdf, retrieved 2026-10-06:d9cc7dc4531d45f7caa2e8d09825f28227c9ad368badddceee084742dcecbb18a4729a800558051d10a477b3937f97d20ac9600f6738271afc40c5d79dfede690721ad42ce2903543e9519394a4f28633e83de3f029c5c4304233338279c1991dda49498ced026d1e815a697b76517693210de38cf12af5258b7f90929a58e13ac7dec07f0f7aead76b8078a707bc905b0ec9ce6a68ce9122ff52e970dbaa94091768eb9011042963ab33acad31ecf73ca243e9154f7a1f20e5142b6843ef2f9dabdcc727779b89caa2969cc5274b716ce7588855e1d8605bd81e195a6ef333dThese are the same files #9631 and #9651 used. The 2017, 2018 and 2019 files are revised printings. TheAxiomFoundation/rulespec-us#1402 records that the earliest archived edition of each prints the same local tables; the revisions concern other deductions. For 2017 every extraction here also ran on the original January 2018 printing (sha256
e8e3f45e4199afc611205184c364ac87b727fb972b0fef9aea147d172e147e24, as #9651 found). It prints the same local tables, selector, headings and worksheet.The worksheet, 2015-2021
The 2015-2021 worksheets have the same lines 1-8 as 2022:
tax_unit_size, as it already does for the state tables (Add the IRS Optional State Sales Tax Tables for 2015-2017 #9651).What changes
Parameters (
gov/irs/deductions/itemized/salt_and_real_estate/):local_sales_tax_table/tax.yaml: 2015-2021 values for every cell; 2015-2021 references; notes on the exemptions columns, the 2019 caption, and Table D.local_sales_tax_table/states.yaml: the list starts in 2015. The 2015-2022 worksheets list the same states, so the separate 2022 entry is dropped; values in force are unchanged.local_sales_tax_table/default_table/,county/,place/(13 files): 2015-2021 entries with references and notes on the readings below.none.yamlstarts Mississippi at 2015, retaining its explicit 2022 value; A/B no longer default Mississippi to a named city's table. New York City's five counties are Table A counties in every year, since the city is Table A in every year; Model the IRS local sales tax worksheet with official locality rates #9879 does the same from 2022.state_sales_tax_table/rate.yaml: 2015-2021 heading rates for all 46 states with a table, plus Alaska at 0. Notes quote the California footnote (7.50% in 2015 and 2016) and the averaged-rate footnotes.Variables: No formula changes.
local_sales_tax,local_sales_tax_rateandlocal_sales_tax_table, and a comment on the exemptions columns.local_sales_tax's documentation now says that only the locality and official state rates still extend back from 2022.local_sales_tax_rate's documentation now gives California's 7.5% threshold for 2015 and 2016, and says that the official state rates' 2022 values apply before 2022.Verification
Two independent parsers on every cell. Each was written blind to the other:
pdftotext -layout, cross-checked within the script bypdftotext -raw.Results:
Local tables: P1 and P2 agree on all 4,104 cells (7 years plus the 2017 original printing and the 2022 control, 456 each).
Earlier parsers: they also agree with the three parsers the state-table PRs ran, which had emitted local tables too: 0 differences over 2015-2022.
Headings: they agree on every heading rate and footnote marker, 46 states × 9 editions. P2's word boxes also reproduce
main's state tables (5,244 of 5,244 cells per year, 2015-2022).Controls: both reproduce the 2022 local tables and heading rates in the repo exactly. 2017 equals the 2017 original printing.
Visual check: a reviewer, blind to both parsers' output, transcribed all 3,192 cells and the 322 heading rates (46 states × 7 years) from 200-dpi page images. Every value equals the YAML.
Round trip: the YAML, read back through the parameter system, equals P2 and S2 on every 2015-2021 value:
After the merge and Mississippi correction, a fresh comparison against main (
0e7ced1747bae8f802a627c6f90d4d0ee4ba9c31) confirms zero 2022+ differences across 16 parameter files: 517 dated leaves and 2051 effective-value comparisons at all timeline boundaries from 2022 onward. The historical parser counts above describe the original extraction; the Mississippi default interpretation is corrected below.Two independent selector mappers. S1 worked from poppler text and S2 from MuPDF word boxes. Each confirmed row-to-table alignment on rendered page images and coded names against the 2020 Census national county and place files. At the original PR head they agreed on every county list, place list and state default in every year. The Mississippi state-default interpretation is corrected here using the worksheet’s absent-table instruction; county/place lists and all printed table cells are unchanged. Every code exists in the Census files and lies in its row's state. Both reproduce #9879's 2022 lists as of
082ee8c9c1exactly. #9879 has since listed New York City's five counties under Table A, and this PR applies that rule to 2015-2021.Independent review. Two further Opus reviewers, blind to the extractions, also checked the data:
Readings
Each is documented in the YAML:
NONE) outside Jackson and Tupelo in 2015-2021, as Model the IRS local sales tax worksheet with official locality rates #9879 does from 2022: "If there is no table for your locality, the table amount is considered to be zero" (line 2 instructions: 2015-2017 PDF p. 4; 2018-2021 PDF p. 6). Named-place lists are unchanged: Jackson B in 2015 and A in 2016-2021; Tupelo B in 2015-2018 and C in 2019-2021. The seven PDFs were fetched again on 2026-10-26; every sha256 matches the Sources table, and each contains that line 2 sentence.Heading rates
Most are unchanged from 2022, with these exceptions:
Line 3 before 2022
#9879 takes line 3 as the combined rate less the state's general rate: the official rate from
state_rates.csvin the official-rate states other than Nevada, else the heading. Its first value, dated 2022-01-01, also covers 2015-2021.This PR keeps #9879's rule:
#9914 tracks a follow-up: entered rates before the state files begin would use the year's state rate (the heading), while the default path keeps its 2022 local rate.
Invariants
Each is tested; (H) marks Hypothesis.
{MS}in every year. The 2015-2021 footnote 1 and 2 sets equal 2022's.local_sales_taxequals a pure-Python worksheet built from the raw YAML for every state, family size 1-8, income row, table and five rates, in each year 2015-2026 and 2030.Tests
Verification for
73b2ad4355bd22caa33ef501f5cdd2fc4ccaad25, against main0e7ced1747bae8f802a627c6f90d4d0ee4ba9c31. Full-file runs used the identical model at9c47c15a1468d7c00ed62e0c640a17e449a04b5e; the final test-only change declares the same one-cent tolerance as main for the two rounded Mississippi ratio expectations, and the bounded local-amount cases were reverified with that tolerance. Every test process runs in the foreground with the six requested thread caps andrun_capped.py --rss-gb 4 --timeout 1800. No full microsimulation or impact run was performed.local_sales_tax_rate.yamllocal_state_tax.yamllocal_sales_tax_table.yamlRequested full-file runs:
local_state_tax.yamlcombined_sales_tax_rate.yamllocal_sales_tax_rate.yamllocal_sales_tax_table.yamlsalt_deduction.yamlstate_sales_tax.yamlstate_sales_tax_income_bracket.yamltest_local_sales_tax_worksheet.pytest_locality_sales_tax_rates.pytest_state_sales_tax_table.pytest_local_sales_tax_county_carryover.pytest_local_sales_tax_rate_build.pytest_source_conflicts.pytest_no_group_variables_in_person_adds.pySix complete YAML files pass (287 cases), as do six complete Python files (248 tests). The full
local_state_tax.yamlandtest_state_sales_tax_table.pyruns reached the 4 GB RSS cap and are left to CI; the 21 new local-amount cases pass in bounded runs. The carryover test uses its existing three-household synthetic fixture; no population microsimulation was run. The source-conflict guard passes all 103 tests with zero flags; noKNOWN_UNMARKEDallowance was added. Previous authorship runs of other YAML files are historical evidence, not current-head pass claims.Impact
Only tax years 2015-2021 change. The round trip above shows every parameter value in force from 2022 on is unchanged, so 2022+ household and microsimulation results are unchanged. For 2015-2021,
local_sales_taxnow uses that year's table instead of the 2022 one. It moves only where a local amount is computed: in the local-table states, and in ratio states with an entered or official combined rate.The hub reruns the impact assessment at the head that lands. Mississippi outside Jackson and Tupelo now uses the ratio method in 2015-2021 instead of a named city’s local table.
axiom: TheAxiomFoundation/rulespec-us#1402 queued
#1402 is the pe-parity item for 26 USC 164(b)(5)(H), TY2015-2025. It covers the Optional Local Sales Tax Tables and the selector. A comment on #1402 adds this PR's 2015-2021 companion cases. TY2015-2020 still need a corpus ingest, as #1402 records, before they can be encoded.
🤖 Generated with Claude Code