Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Minimize Montana's separate-column tax when a capital gain credit exhausts one column's liability. Keep joint filing when separate savings fall within one cent plus float32 roundoff, and apply that comparison to the 2021 rebate base and tax before refundable credits.
Spouses may choose joint or separate Montana filing. Couples who file jointly federally may allocate jointly paid expenses not attributable to one spouse in any proportion (2022 Form 2 instructions, PDF page 11). Residents may claim a nonrefundable credit equal to 2% of net capital gains (page 43).
The medical chooser adds two closed-form candidates: the shares where each spouse exhausts their capital gain credit. It inverts the existing rate schedule and accounts for the existing dependent-exemption allocation, without a numerical search or simulation branches. Zero-credit columns add no eligible candidate. The new zero-credit YAML case preserves the former balancing share when both columns owe zero.
For example, in 2022 the head earns $10,000 of wages and $10,000 of long-term gains, the spouse earns $20,000, and their child has $25,000 of medical bills. The former candidate set chooses the equal split and combined line 20 of $65.70. A 10,001-share calculation reaches $3.70 at 0.2632, a $62.00 gap. The new candidate reaches that point: head taxable income $9,500 uses the $200 credit, while the spouse pays 1% of $370.
Invariants and validation
max(sum(abs(columns)), abs(joint)). The rebate base and tax before refundable credits use the same comparison.test_mt_medical_credit_split_properties.pychecks the grid, accounting at the chosen share, label swaps, and added bills. Its deterministic witnesses cover 2021–2023 and credit thresholds below and above the last rate bracket.test_mt_filing_choice_invariants.pychecks filing ties, label swaps, rebate-base accounting and the 2024 cutoff. Its helper properties check nominal cent ties through $100,000 per column, including negative columns, and distinguish $0.009 from $0.011 savings through $2,000 per column. The YAML files cover worked households, both sides of credit exhaustion, offsetting columns at cent ties, an unmarried filer, and the 2021 rebate cap.Local single-file checks passed: 7 medical-share YAML cases, 13 filing YAML cases, 3 rebate YAML cases, 6 income-tax YAML cases, 6 existing split-property tests, 4 new credit-property tests and 3 new filing-property tests.
make formatpassed.Eight mutants failed targeted assertions across the staged checks:
After restoration, all 4 credit-property tests and all 3 filing-property tests passed again. The final property and mutant runs used 4 GB and 900-second caps. Draft PR CI jobs remain skipped.
Microsimulation impact
To be measured before merge.
Methodology choices
Overlap with open work
Companion draft PR #10847 addresses the other #10276 follow-ups. The two PRs edit separate files and can merge independently.
#10002 and #9888 change Montana itemized deductions. This PR touches neither their files nor
mt_non_medical_itemized_deductions_indiv. Their component-list edits still need to move into that variable when they merge main.The credit-aware split reduces some historical liabilities before refundable credits; net 2021 tax can rise or fall through the rebate cap. The filing tolerance changes near-tie elections in 2022–2023 and can change the 2021 rebate. The #10276 audit records that the default dataset starts in 2024, so it cannot estimate the affected 2017–2023 population.
axiom: extend TheAxiomFoundation/rulespec-us#1520 with credit-exhaustion and filing-tie companion cases.
🤖 Generated with Claude Code