Repository navigation
Conversation
MCA 15-30-2120(3)(b)(i) subtracts interest from obligations of the United States government from federal taxable income. The model's 2024 and 2025 subtraction lists omitted us_govt_interest_person, so from 2024 it taxed that interest (2024 Form 2 Schedule I, Part I, line 11; 2025 line 9). Restore it in both lists and correct the 2024 expectation in mt_us_govt_bond_interest.yaml, which recorded the bug. Add mt_taxable_income.yaml: end-to-end Form 2 cases for 2024-2026, hand computed from the forms and the revised Worksheet A / Worksheet B, run from household inputs through the federal model. Add test_mt_us_govt_interest_subtraction.py, a Hypothesis test of three invariants for 2024-2026: Montana taxable income falls by exactly min(u, taxable income before the subtraction) when the head or spouse holds the bonds and not at all when a dependent does; Montana tax does not rise; Montana taxable income stays nonnegative. Fixes #9707. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9707.
What was wrong
MCA 15-30-2120(3)(b)(i) subtracts "interest from obligations of the United States government and exempt-interest dividends attributable to that interest" from federal taxable income. Form 2 reports the subtraction on Schedule I, Part I: line 11 in 2024 (instructions, PDF p. 25) and line 9 in 2025 (instructions, PDF p. 23). The 2024 and 2025 entries of
gov.states.mt.tax.income.subtractions.subtractionsleft outus_govt_interest_person, so from 2024 the model taxed that interest. The 2024 case inmt_us_govt_bond_interest.yamlexpected 0, so the suite recorded the bug.Each row below comes from a
Simulationrun on main (61d9e85) and on this branch:Changes
subtractions.yaml: addus_govt_interest_personto the 2024 and 2025 lists (2026 uses the 2025 list), with the statute and form line in comments, and cite MCA 15-30-2120(3)(b)(i).mt_us_govt_bond_interest.yaml: the 2024 case now expects 5,000; a new 2025 case also expects 5,000.mt_taxable_income.yaml: 14 Form 2 cases for 2024–2026. Each starts from household inputs (wages, medical expenses, mortgage interest, taxes paid, interest) and runs through the federal model, so it also checks which federal amounts Montana reads. Comments carry the worksheet and Form 2 arithmetic.test_mt_us_govt_interest_subtraction.py: a Hypothesis test of the invariants below.The rest of the 2024+ base
The task was to check Montana's whole 2024+ base. #10038 (merged 2026-11-07) rebuilt it from federal taxable income, with the QBI add-back (MCA 15-30-2120(2)(i)) and the capped state income tax add-back ((2)(j)). Its 2024+ cases, like main's other Montana cases, mostly enter federal amounts (
adjusted_gross_income,itemized_taxable_income_deductions,tax_unit_itemizes,salt_deduction,standard_deduction) as inputs. This PR's cases start from household inputs instead, with values hand computed from the 2024 and 2025 Form 2, the revised 2024 Worksheet A and the 2025 Worksheet B (instructions, PDF p. 22). On main:I also checked three things in the code:
mt_taxable_income_joint.formula_2024sumsmt_additionsandmt_subtractionsover the head and spouse only. That matches federal AGI:irs_gross_incomezeroes every income source of a tax-unit dependent, so a dependent's interest never reaches the return.mt_interest_exemption_personis 0 from 2024, becausegov.states.mt.tax.income.exemptions.appliesis false from 2024.mt_subtractions.mt_agi_joint,mt_agi_indivand the two taxable Social Security helpers also read it, so for a household with US government interest the legacymt_aginow nets that interest too. None of them reaches 2024+ Montana tax:formula_2024reads none of them;mt_income_tax_before_refundable_credits_unittakes the joint computation, andmt_agi_indivapplies only wheremarried_filing_separately_on_same_return_allowedholds; that parameter turns false in 2024;mt_agi_jointreturn 0 or the federal amounts from 2024 (state_specific_deduction_appliesand the child care deduction'sin_effectturn false in 2024;misc_floor_appliesturned false in 2018);taxsim_state_agi, and its aliasstate_agi, report federal AGI for Montana from 2024 (states_using_federal_agi).Not in this PR
formula_2024reads none of them, so gating them changes no 2024+ tax.state_standard_deductionandstate_itemized_deductionsstill read them; Harmonize state_standard_deduction and state_itemized_deductions coverage #8275 and Montana: obsolete *_for_federal_itemization copies put a state-withholding proxy and the repealed federal-tax deduction into state_itemized_deductions (TAXSIM v35) #9806 track that.mt_additionsholds onlymt_other_additions, an input, so the model leaves out, for example, interest on other states' bonds (MCA 15-30-2120(2)(a)). That needs its own issue.Tests
mt_taxable_income.yamland 3 inmt_us_govt_bond_interest.yaml.test_mt_us_govt_interest_subtraction.pypasses: a worked test, then 10 derandomized Hypothesis examples plus a pinned set.Invariants
For every household and each year from 2024 to 2026, let u be the US government interest and TI₀ Montana taxable income without the subtraction:
The committed test pins the cases that matter: the zero floor binds, a dependent holds the bonds, and interior cuts, single and joint. A wider local run also passed: 104 households a year (12 random draws of 8 households plus the 8 pinned ones). In 2024, 2025 and 2026 the floor bound 2, 3 and 5 times, dependents held bonds 18, 23 and 26 times, and interior cuts occurred 10, 10 and 12 times.
Microsimulation impact
Pending: 2025 and 2026, default dataset, main against this branch.
us_govt_interest_personhas no formula, and the certified default dataset (populace_us_2024.h5, sha2566496cc43…, which matchesDEFAULT_DATASET_SHA256) has no column for it among its 378, so every record's subtraction stays at 0. I'll replace this section with the measured results.Coordination
#10713 (Montana military retirement) and #10696 (railroad retirement) also edit
subtractions.yaml, in hunks apart from this one.Axiom
axiom: MCA 15-30-2120(3)(b)(i) encoded-correct for TY2026 (rulespec-us
us-mt/policies/income_tax/resident_core_liability_pipeline.yaml, companiondirect title 15 modifications and state tax addback) | TheAxiomFoundation/rulespec-us#2148 queued for TY2024–2025🤖 Generated with Claude Code