Repository navigation
Expand Montana medical and standard deduction tests - #10875
Conversation
Adds YAML cases for the companion tests in TheAxiomFoundation/rulespec-us#1520 that had no PolicyEngine test after #9903 merged: - a dependent child's U.S. Treasury interest stays off the parents' Montana AGI, for both the medical floor (6,250) and the standard deduction (10,000); - the joint 2021 maximum (9,660) and the single 2023 maximum (5,540), from the Form 2 Standard Deduction Worksheet; - a status 2a column on its own Montana AGI (5,500); - the 2026 federal floor (3,500), the case in rulespec-us us/statutes/26/213. Tests only; no model change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Review: Test Montana's joint-return deductions on the companion cases in rulespec-us#1520SummaryThis PR (head 6788f20) adds tests only: six YAML cases in three variable-named files, plus a changelog fragment. It changes no variable, parameter or tool file. All eight new assertions match my hand trace from the external sources:
The two dependent cases pin the head-and-spouse mask that #9585 added to The problem is how the cases map to rulespec-us#1520. There are two should-address findings:
Basis: reading the code at the head, hand traces, the Montana PDFs (read directly), the rulespec-us issue and test file, and CI logs. I did not run Python locally. CriticalNone. Should addressS1. The dependent-interest case is not a rulespec-us#1520 companion case, but the PR body numbers it as one.
S2. Two #1520 expectations that the PR says it covers are still missing. The body says these cases "had no PolicyEngine test" and that "This PR adds them". Two are only half added.
# mt_medical_expense_deduction_joint.yaml
- name: Joint return in 2021 floors medical expenses on the return's Montana AGI
period: 2021
absolute_error_margin: 1
input:
people:
person1:
is_tax_unit_head: true
other_medical_expenses: 10_000
person2:
is_tax_unit_spouse: true
tax_units:
tax_unit:
members: [person1, person2]
mt_agi_joint: 80_000
households:
household:
members: [person1, person2]
state_code: MT
output:
# 2021 Itemized Deductions Schedule line 1: 10,000 - 7.5% x 80,000 = 4,000.
mt_medical_expense_deduction_joint: [4_000, 0]# mt_medical_expense_deduction_indiv.yaml (replaces the one-person case)
- name: Status 2a return with column A above its floor and column B without expenses
period: 2022
absolute_error_margin: 0.01
input:
people:
head:
age: 40
is_tax_unit_head: true
other_medical_expenses: 10_000
mt_agi_indiv: 60_000
spouse:
age: 40
is_tax_unit_spouse: true
mt_agi_indiv: 0
tax_units:
tax_unit:
members: [head, spouse]
households:
household:
members: [head, spouse]
state_code: MT
output:
# Itemized Deductions Schedule line 1, each column on its own line 14.
# A: 10,000 - 7.5% x 60,000 = 5,500. B: no expenses, 0.
mt_medical_expense_deduction_indiv: [5_500, 0]SuggestionsG1. The 2026 case's name claims more than the case tests (
G2. The dependent cases' comments rest on an unstated assumption (both files).
Verified correctScope
Form values, read from the PDFs Standard Deduction Worksheet (page 7), maximum on line 3 and minimum on line 5:
Hand checks (all eight assertions)
Formula lines each case reaches (read at the head)
What the dependent cases pin (by reading)
Other checks
Axiom line assessment
CI status
Branch status
Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
Requesting changes: 0 critical, 2 should address, 2 suggestions (details in the report above). All eight new assertions match hand traces from the Montana forms. The two items are about the claimed correspondence with TheAxiomFoundation/rulespec-us#1520:
- The description counts seven companion cases there and calls the dependent Treasury-interest case "#1520 case 7". The issue's table has six cases, its case 7 (in the 10/19 comment) is a status 2a equal-division case, and no dependent-interest row exists.
- Two of #1520's cases aren't covered one to one: case 3's TY2021 medical half, and case 5's two-column status 2a return.
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
|
Agent-written for Max, by Claude Code for Max Ghenis. Review record for
|
Agent-written for Max, by Claude Code for Max Ghenis. Both requested changes are addressed at f4a833d: the description now matches rulespec-us#1520's cases, and new cases cover case 3's 2021 medical half and both columns of case 5. Review record: #10875 (comment)
|
Agent-written for Max, by Claude Code for Max Ghenis. Merge record for
|
Summary
#9903 uses the return's Montana AGI for Montana's 2021–2023 standard deduction and medical expense floor. TheAxiomFoundation/rulespec-us#1520 lists six original companion cases. Its October 19 comment adds cases 7–10. This PR fills test gaps for cases 3–5 and adds case 7's agreed equal allocation. It also covers a PolicyEngine dependent Treasury-interest regression and uses net expenses from the separate federal § 213 companion in a 2026 Schedule A fixture.
mt_standard_deduction_joint.yamlmt_medical_expense_deduction_indiv.yamlmt_medical_expense_deduction_indiv.yamlmt_medical_expense_deduction_joint.yamlThe Treasury-interest regression exercises the direct head-and-spouse adjustment from #9585 in a household with no Social Security benefits. The parents make no federal Form 8814 election. The child's interest adds $0 to their federal AGI and $0 to their Montana Treasury-interest subtraction. Both joint deduction fixtures assert the parents' $50,000 federal and Montana AGI.
Tests
Linux runs used Python 3.14.7 and policyengine-core 3.34.2 from the locked environment. Each YAML file ran in a separate process.
deductions/standard/mt_standard_deduction_joint.yaml— 12 passed in 87 s.deductions/itemized/mt_medical_expense_deduction_joint.yaml— 32 passed in 94 s.deductions/itemized/mt_medical_expense_deduction_indiv.yaml— 15 passed in 158 s.YAML cases only; no new Python tests, CI jobs or selectors.
An independent review of
f4a833d1approved the change (review record). CI passed atf4a833d1(run 46333073644).axiom: n/a: Test coverage only. The Montana companion coverage is for TheAxiomFoundation/rulespec-us#1520 cases 3–5 and 7. The 2026 fixture uses the net expense amount from the separate federal § 213 companion.
🤖 Generated with Claude Code