Skip to content

Model Montana's working military retirement and survivor benefit exemption - #10713

Open
MaxGhenis wants to merge 18 commits into
mainfrom
fix-mt-military-retirement-exemption
Open

MaxGhenis wants to merge 18 commits into
mainfrom
fix-mt-military-retirement-exemption

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What was missing

PolicyEngine-US included taxable military retirement pay and survivor benefits in federal income. Montana had no dedicated Form WMRE subtraction. The shared military income inputs and Montana subtraction list documented that omission.

The law

  • MCA 15-30-2120(3)(n)(i) subtracts "a portion of military pensions or military retirement income as calculated pursuant to subsection (8)" that a retired member of the armed forces (10 U.S.C. 101), the army or air national guard or a reserve component (38 U.S.C. 101) receives. (3)(n)(ii) subtracts "up to 50% of all income received as survivor benefits for military service" of the same kinds.
  • (8)(a): the (3)(n)(i) subtraction "is equal to the lesser of: (i) the amount of Montana source wage income on the return; or (ii) 50% of the taxpayer's military pension or military retirement income." (8)(b) defines Montana source wage income as "(i) wages, salary, tips, and other compensation for services performed in the state; (ii) net income from a trade, business, profession, or occupation carried on in the state; and (iii) net income from farming activities carried on in the state."
  • (9): a person may claim either subtraction only if they became a resident after June 30, 2023 or "was a resident of the state before receiving military pension or military retirement income and remained a resident"; only "for 5 consecutive years after satisfying the provisions of subsection (9)(a)"; and not after claiming it and then becoming a nonresident. 2025 Mont. Laws ch. 586 (SB 93) changed (9)(a)(i) from "becomes a resident of the state after June 30, 2023" to "became a resident of the state on or after June 30, 2023" and repealed the 2033 termination (section 4, chapter 650, Laws of 2023), both for tax years beginning after December 31, 2025. The Form WMRE instructions name "Senate Bill 124"; the enacted bill is SB 93.
  • ARM 42.15.1501(1) lists the armed forces as the Army, Navy, Marine Corps, Air Force, Space Force and Coast Guard, plus the guard and reserve components. (2) says Montana source wage income "does not include income from any passive activity as that term is defined in 26 USC 469(c)". ARM 42.15.1510(3) gives worked examples.
  • Form WMRE (2025) Part II: line 1 takes taxable military retirement income; lines 2 to 5 take wages (Form 1040 line 1z), sole proprietorship income (Schedule 1 line 3), partnership and S corporation income, and farming income, and lines 3 to 5 each say "If zero or less, enter 0"; line 6 adds lines 2 to 5; line 7 takes half of line 1; line 8 takes the lesser of lines 6 and 7. Part III takes half of taxable military survivor benefits.
  • Start year: the 2024 Form 2 instructions (Senate Bill 104) say the exemption "can only be claimed for five years beginning with tax year 2024" for residents from before July 1, 2023, and the Revenue Interim Committee's November 2025 memo says "The partial exemption first became available in tax year 2024."

Change

For tax years beginning in 2024 or later, the head’s record carries the return’s retirement and survivor exemptions. The model nets each filer’s signed military adjustments as federal gross income does. It applies each filer’s residency and five-year window, then pools qualifying pay and survivor benefits across the head and spouse. A reported year of becoming a nonresident after claiming disqualifies that filer from that year onward. Dependents contribute neither pay nor earnings.

The retirement exemption is the lesser of half the eligible retirement pay and the return’s Montana source wage income. The survivor exemption is half the eligible survivor benefits. The wage estimate combines federal employment income and taxable employer dependent-care benefits, net Schedule C income after reported passive amounts, nonpassive partnership and S corporation income plus entered qualifying Montana rental income, and Schedule F income. It floors each return-level source at zero. A nonnegative person-level Montana compensation entry replaces that filer’s federal wage estimate. A nonnegative return-level entry replaces the entire cap for that tax year.

The annual eligibility and qualifying-payment inputs handle mixed service, part-year receipts, and streams with different residency or timing eligibility. mt_military_retirement_exemption_first_year anchors the five consecutive years. mt_military_retirement_exemption_nonresident_year_after_claim records a disqualifying departure once. The 2024 and 2025 subtraction lists carry the dedicated WMRE amount. For saved miscellaneous subtractions, report the already included WMRE amount in mt_military_retirement_exemption_in_other_subtractions or remove that portion from the saved entry.

Readings taken

Four readings go into source_conflicts/candidates.yaml (step 1 of CONTRIBUTING.md#source-conflicts; no marker until the register holds them):

Id Question PE-US follows Pinned by
us-mt:military-retirement-exemption-schedule-e-income Does the wage cap use the full Schedule 1 line 5 total referenced by WMRE line 4? The estimate subtracts reported passive partnership and S corporation income. Include qualifying nonpassive Montana rental business income through its person-level input or through the statutory return-cap override. “Rents, royalties, farm rent and estate income are not earned income”, “Passive partnership and S corporation income does not count” and “Nonpassive Montana rental business income raises the wage cap”
us-mt:military-retirement-and-survivor-exemptions-same-return WMRE has the filer mark one box and complete Part II or Part III, and joint filers who both qualify complete one form. Can one return take both subtractions? Statute: yes. (3)(n)(i) and (ii) are separate subtractions and nothing makes a filer choose. "Retirement pay and survivor benefits on one return each get their exemption"; "A retiree who is also a survivor takes both exemptions beside an ineligible spouse"
us-mt:military-retirement-exemption-business-loss-floor (8)(b) says only "net income". Does a loss in one source reduce the others? Gap-fill from WMRE lines 3 to 5: each source counts as at least 0; Schedule C income nets across proprietorships first. "A business loss does not reduce wages in the earned income limit"; "A loss in one sole proprietorship offsets income from another before the floor"
us-mt:military-retirement-exemption-wage-location Which wages and business income limit a full-year resident’s exemption when the work takes place outside Montana? MCA 15-30-2120(8)(b) governs the statutory cap. Enter $0 for Montana compensation if all employee services were outside Montana. Enter $0 for the return cap if it has no qualifying Montana wages, business income, or farm income. Omitted sourcing leaves an estimate that can count out-of-state wages. The candidate records the difference between the WMRE instructions’ federal totals and the statutory work-location rule. “A full-year resident’s wages for work outside Montana do not count”, “Only the wages for work in Montana limit the retirement exemption”, “A loss from a business outside Montana does not reduce Montana business income”, “An entry on one return leaves another return’s limit alone”, “Out-of-state wages do not count when Montana wages are zero” and “Montana business income can qualify when all employee wages are from outside Montana”

source_conflicts/sources/us-mt/form-wmre-2025.txt (pdftotext 26.09.0, pages 1 to 3, sha256 851ebc5378ce1855177456fd497a2d72333469cc2b0aad9dcd8b6e1e81607ed6) holds the 2025 Form WMRE text these readings quote, for the register's pending_texts when the readings move there. Page 1 follows the form's visual reading order, and pages 2 and 3 follow its column order with one line per paragraph or list item. Each of the eleven Form WMRE excerpts the four candidates quote appears in the capture verbatim. The capture keeps the form's text as printed, including "Senate Bill 124" and the line 5 instruction's "Schedule 1, line 11" (Schedule 1 reports farm income on line 6).

Assumptions

  • The estimate assumes full-year Montana residency and qualifying service when the relevant entries are absent. Enter the taxable qualifying amounts for mixed service and part-year receipts. If only one stream qualifies in a tax year, enter $0 for the other stream’s qualifying amount and retain both streams in the federal inputs. If the streams have different five-year windows, use their annual qualifying amounts to apply those windows. The annual eligibility input defaults to true. The model requires a first eligible year to enforce a shared window and a reported departure year or annual ineligibility to account for a prior claim followed by nonresidency.
  • The wage estimate uses annual amounts. Enter the statutory return cap for adjustments the available inputs cannot represent, such as multistate business income or passive farming. The committee memo calls the overall tax year 2024 table amount a revenue loss. The interpretation that the amounts instead measure income exempted is an inference.

Invariants

The exemption is zero before 2024, outside applicable eligibility windows, and on records other than the head’s. The retirement component is min(50% × eligible federally included retirement pay, Montana wage cap). The survivor component is 50% × eligible federally included survivor benefits. Apply qualifying-payment entries and signed adjustments before those limits. Each component is nonnegative. With the other subtractions held fixed, applying WMRE cannot raise Montana taxable income.

Tests

mt_military_retirement_exemption.yaml contains 57 cases, including saved overlap, signed payment adjustments, taxable dependent-care compensation, stream-specific qualification, disqualification after a post-claim move, and Montana wage sourcing. Other cases cover:

  • The rate, the earnings cap and survivor benefits: TY2026 $30,000 of pay and $60,000 of wages gives 15,000 and mt_subtractions 15,000; $8,000 of wages binds (8,000); no earnings gives 0; $10,000 of survivor benefits alone gives 5,000; retired pay and a spouse's survivor benefits on one return give 10,000; a retiree who is also a survivor beside an ineligible spouse with wages and pay gives 16,000.
  • Each earnings source: SSTB income ($40,000 gives 15,000), Schedule F income ($40,000 gives 15,000), partnership and S corporation income (TY2025, $9,000 gives 9,000), an SSTB loss netting against other Schedule C income before the floor (6,000), and a business loss that doesn't reduce wages (6,000).
  • The estimate gives a $0 exemption in the cases with only Schedule J farm_income, with only rents, Form 4835 farm rent and estate income, with a dependent’s retirement pay, or with only a dependent’s wages.
  • Eligibility and years: an ineligible retiree (0); an ineligible survivor (0); the spouse's pay against the head's wages (15,000); TY2024 with mt_subtractions 15,000; TY2023 (0).
  • ARM 42.15.1510(3)(a) and (b): wages of $50,000 and pay of $40,000 give 20,000; $18,000 of Schedule C income and pay of $40,000 give 18,000.
  • Work outside Montana, with the Montana source wage income entered: $40,000 of wages, all for a job in North Dakota, gives 0; $10,000 of the wages for work in Montana gives 10,000; a $20,000 Schedule C total that nets $30,000 from a Montana business against a $10,000 loss in Wyoming gives 30,000 with $80,000 of pay. Two returns in one household, where only the commuter enters 0, give 0 and 10,000; an entry of -1,000 counts as no entry (8,000 of wages gives 8,000).
  • Tax-year isolation: a 2026 entry of $0 or $1,000 applies in 2026. In 2027, an absent entry or an explicit -1 uses the $15,000 estimate. The no-entry case gives $15,000 in both years.
  • Passive income: $30,000 of partnership income with $20,000 marked passive gives 10,000; $10,000 of partnership income made of $15,000 active income and a $5,000 passive loss gives 15,000.
  • Fractional amounts: $62,500.11 of wages, $62,500.02 of Schedule C income and $7,777.77 of survivor benefits with $400,000 of pay give 128,889.015, to within $0.004.
  • End to end: a TY2026 single filer age 45 with $30,000 of pay and $50,000 of wages has Montana taxable income of 48,900 and Montana income tax of 2,311.60. That is 80,000 of AGI less the 16,100 standard deduction and the 15,000 exemption, taxed at 4.7% up to 47,500 and 5.65% on the other 1,400.

The Python cache test (tests/core/test_mt_military_retirement_exemption_cache.py) verifies that a current-year cap edit invalidates the cached exemption. At 8250611c56 and on a merge with main at 8e81d6637f, all 13 selected Montana income tax YAML files pass, and at 8250611 the five supporting Python test files pass. The suite and mutation counts below apply to the commits they cite.

Removing each new term fails at least one case:

Mutation Cases that fail at 09ed698 (of 22) Cases that fail at b1a147f (of 31)
Drop irs_employment_income from earned_income_sources 7 11
Drop total_self_employment_income 4 5
Drop the partnership and S corporation entry 1 3
Drop farm_operations_income 1 1
Read self_employment_income (non-SSTB only) instead of total_self_employment_income 2 2
Add farm_income (Schedule J) to the list 1 1
Drop the 2024 subtractions.yaml entry 1 1
Drop the filer mask on earnings 1 1
Mask survivor benefits with filer instead of eligible 1 1
Drop the per-source zero floor 1 1
Ignore the Montana wage entry n/a 4
Default the entry to 0 instead of -1 n/a 18
Count passive partnership and S corporation income n/a 2
Treat only -1, not every negative entry, as no entry n/a 1
Round the summed cap to float32 before the comparison n/a 1
Treat an entry of 0 as no entry n/a 2

At 3b127ca, removing the tax-year check fails 2 of 35 cases. The 2026 zero and positive entries carry into 2027.

At 8250611, each of four more mutations fails at least one case: removing the saved-WMRE overlap adjustment (1 case), restoring separate zero floors on signed military payments (2), dropping taxable dependent-care benefits from the wage estimate (1), and removing the post-claim departure check (1).

At 09ed698f28 (this branch, with main merged at 3386304d28), all 1,122 cases under tests/policy/baseline/gov/states/mt pass, and so do the 107 tests in tests/code_health/test_source_conflicts.py and tests/code_health/test_military_retirement_readers.py. ruff format and check pass on the changed Python files.

At e65f906ee7, which adds the first version of the capture, the 103 tests in tests/code_health/test_source_conflicts.py and the 22 cases in mt_military_retirement_exemption.yaml pass.

At ceb2f71466, which reflows the capture on top of a merge of main (538c7c8cc3), the 251 tests in tests/code_health/test_source_conflicts.py, the 4 in tests/code_health/test_military_retirement_readers.py and the 22 cases in mt_military_retirement_exemption.yaml pass, and so do all 1,229 tests under tests/policy/baseline/gov/states/mt, main's Montana changes included.

At fb6d94b071, which adds the fourth candidate, the end-to-end case and three documentation edits on top of another merge of main (87fe953dc5), then takes the Montana amount as an optional entry, leaves passive partnership and S corporation income out of the sum and adds eight cases, local runs (macOS, policyengine-core 3.37.2, one file per process) pass all 31 cases in mt_military_retirement_exemption.yaml, the 22 in the Montana income integration.yaml, the 251 tests in tests/code_health/test_source_conflicts.py, the 4 in tests/code_health/test_military_retirement_readers.py, the 32 in tests/code_health/test_reference_urls.py and the 5 in tests/core/test_input_variable_definitions.py. ruff format and check pass on the changed Python files. Each of the sixteen mutations in the table above fails at least one case at b1a147f13e; fb6d94b changes only the wage-location note after it.

Before and after

TY2026, a single filer age 55 with $30,000 of military retired pay, before this fix (2eeb5d3) and after (09ed698):

Other income Exemption before Exemption after Montana income tax before Montana income tax after
$40,000 of SSTB income 0 15,000 2,434.44 1,695.48
$40,000 of Schedule F income 0 15,000 2,434.44 1,695.48
$40,000 of Schedule J farm_income (AGI $30,000) 15,000 0 0.00 653.30

A married couple, one spouse age 45 with $30,000 of military retired pay and $60,000 of wages, TY2026, at 09ed698: Montana income tax is 2,716.60 with in_effect set to false and 2,011.60 with the 15,000 exemption. 2eeb5d3 gave the same 2,011.60. With no pension the couple owes 1,306.60, so Montana's tax on the pay falls from 1,410 to 705. A retired couple, ages 67 and 65, with $45,000 of military retired pay, $30,000 of Social Security and no earnings gets no exemption. Every 09ed698 figure in this section holds at ceb2f71466 and at fb6d94b, each from a household run.

axiom: needed

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits November 8, 2026 01:32
…ption

MCA 15-30-2120(3)(n) and (8), from tax year 2024: the lesser of half the
return's military retirement pay or its Montana earned income (Form WMRE
lines 2-5), plus half of military survivor benefits. An input records the
section (9) residency and five-year conditions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… June 30, 2023)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's #10331 drops the disability income exclusion from Montana's
subtractions for 2024 on, after SB 399 repealed it. This branch adds
the working military retirement exemption to the same lists. The
resolution keeps both: the exemption joins the 2024 and 2025 lists,
the exclusion stays out, and the references keep both changes' sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 9, 2026 16:50
@MaxGhenis
MaxGhenis requested a review from DTrim99 November 9, 2026 16:50
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

David, I'd like your read on two Montana choices here:

  1. The PR defaults mt_military_retirement_exemption_eligible to true, since no filer can use up the five consecutive years before 2028.
  2. It leaves rents and royalties out of the earnings that cap the exemption. MCA 15-30-2120(8)(b) counts "net income from a trade, business, profession, or occupation", but Form WMRE line 4 points to Schedule 1 line 5, which includes them.

If you can look by Tuesday afternoon, we can merge it before the Veterans Day post (PolicyEngine/policyengine-app-v2#1523).

@DTrim99

DTrim99 commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Model Montana's working military retirement and survivor benefit exemption

Summary

The structure follows the law. MCA 15-30-2120(3)(n)(i) and (8)(a) give a retiree "the lesser of: (i) the amount of Montana source wage income on the return; or (ii) 50% of the taxpayer's military pension or military retirement income". (3)(n)(ii) gives "up to 50% of all income received as survivor benefits", with no earnings cap. (9) adds the residency and five-year conditions. The rates (0.5 and 0.5), the 2024 start, pooling the earnings cap over the return, carrying the return's amount on the head, keeping dependents out, the zero floor on each business source, and the per-person eligibility mask all match the statute, Form WMRE (2025) and its instructions. The exemption flows through the 2024+ federal-taxable-income path (mt_taxable_income_joint.formula_2024). The PR's before/after figures reproduce: $2,716.60 to $2,011.60 for the TY2026 couple.

One critical problem remains. Two of the four earnings sources that set the cap are the wrong PolicyEngine variables:

  • self_employment_income is only non-SSTB Schedule C income, so a retiree who works as a consultant, physician or lawyer gets no cap room from that business.
  • farm_income is the Schedule J income-averaging input. It isn't in federal AGI. Schedule F income sits in farm_operations_income, which the formula never reads.

Three should items remain: the PR's two statute-over-form readings have no source-conflict candidate entries; four new terms are unpinned by tests; and one reference title carries page text.

On the two questions in the thread:

  • Rents and royalties (question 2). Leaving them out is right under the 2026-10-19 statute-first rule. (8)(b)(ii) counts only "net income from a trade, business, profession, or occupation", and WMRE line 4's own label is "Montana source partnership and S corporation income". Only the line 4 instruction points to all of Schedule 1 line 5. The reading needs a candidate entry (Should 1).
  • Defaulting eligibility to true (question 1). It's a reasonable default, with two caveats for the documentation (Suggestion 2). First, the five-year limit doesn't bind anyone until 2029, one year later than the PR body says. Second, the residency test already excludes a real group in 2024-2028 that the default can't see.

Critical (must fix)

  1. The earnings cap misses SSTB business income and Schedule F farm income, and counts a non-AGI input (mt_military_retirement_exemption.py:36-44).
    • The law counts all of them. (8)(b) defines "Montana source wage income" to include "(ii) net income from a trade, business, profession, or occupation carried on in the state; and (iii) net income from farming activities carried on in the state". The WMRE instructions (p. 3) send line 3 to "the total business income included on Form 1040, Schedule 1, line 3" (all Schedule C income). Line 5 is "farming income". The 2024 Form 2 instructions (p. 5) list "Net income from a trade or business" and "Net income from farming activities in Montana".

    • SSTB income. PolicyEngine splits Schedule C into self_employment_income ("Self-employment non-farm income") and sstb_self_employment_income (income from a specified service trade or business under IRC 199A(d)(2)). total_self_employment_income adds the two. Federal gross income, earned_income and eitc_earned_income read both. The formula reads only self_employment_income, so it drops the professions that (8)(b)(ii) names explicitly.

    • Farm income. farm_income is documented as "Income averaging for farmers and fishermen. Schedule J. Seperate from QBI and self-employment income." No federal or Montana tax formula reads it; gov/irs/gross_income/sources.yaml lists farm_operations_income ("Income from active farming operations. Schedule F") instead. The formula does the reverse: it ignores Schedule F income and counts farm_income, which isn't in AGI at all.

    • Probes on the head tree (TY2026, single, Montana, age 50 or 55, $30,000 of military retired pay):

      Earnings Law Head Montana tax at head Montana tax under the law
      $40,000 sstb_self_employment_income 15,000 0 $2,434.44 $1,695.48
      $40,000 farm_operations_income 15,000 0 $2,434.44 $1,695.48
      $40,000 farm_income (AGI stays $30,000) 0 15,000

      The first two filers overpay Montana tax by $738.95.

    • Hand check for the SSTB filer:

      • SE tax: 40,000 × 0.9235 × 0.153 = 5,651.82, so the deduction for half is 2,825.91.
      • AGI: 70,000 − 2,825.91 = 67,174.09.
      • QBI deduction: 0.2 × 37,174.09 = 7,434.82.
      • Federal taxable income: 67,174.09 − 16,100 − 7,434.82 = 43,639.27. Montana adds back the QBI deduction: 51,074.09.
      • Tax at the head: 47,500 × 4.7% + 3,574.09 × 5.65% = 2,232.50 + 201.94 = 2,434.44.
      • Tax with the 15,000 exemption: 36,074.09 × 4.7% = 1,695.48.
    • Montana is a heavily agricultural state, and consulting is a common second career for retirees, so neither case is rare.

    • Fix:

      • Replace "self_employment_income" with "total_self_employment_income" (Schedule 1 line 3 nets SSTB and non-SSTB Schedule C income, matching the combined floor) and "farm_income" with "farm_operations_income".
      • Add a TY2026 case for each: $30,000 of pay with $40,000 of SSTB income gives 15,000, and $30,000 of pay with $40,000 of Schedule F income gives 15,000.
      • farm_rent_income (Form 4835, Schedule E line 40) is a crop-share landlord's rent. Like other rents it stays out under the statute reading the PR already takes (see Should 1).
      • Update the PR body's source list and the "Earned income adds ..." sentence.

Should address

  1. Record the two statute-over-form readings as source-conflict candidates (policyengine_us/variables/gov/states/mt/tax/income/subtractions/military_retirement/mt_military_retirement_exemption.py).

    • CLAUDE.md and CONTRIBUTING.md#source-conflicts require it. Where the statute conflicts with a form or its instructions, the code follows the statute and the ruling PR adds a source_conflicts/candidates.yaml item (step 1: id, program, question, years, at least two sources, readings, pe_us with follows: statute, state). It adds no marker yet. The PR takes two such readings and records neither, though its body describes both.
    • (a) Rents, royalties, estates and trusts in the cap.
      • (8)(b)(ii) counts "net income from a trade, business, profession, or occupation".
      • The WMRE line 4 instruction (p. 3) says "Residents actively engaged in a business as an owner of a partnership or S corporation, enter the amount from Form 1040, Schedule 1, line 5". That line also carries rental real estate, royalties, estates, trusts and Form 4835 farm rent.
      • The code uses partnership_s_corp_income alone.
      • Suggested id: us-mt:military-retirement-exemption-schedule-e-income.
    • (b) Both subtractions on one return.
      • (3)(n)(i) and (ii) are separate subtractions, and the code allows both, such as one spouse's retired pay and the other's survivor annuity, or a retiree who is also a survivor.
      • Form WMRE has the filer "Mark the appropriate box" (one of two). The instructions (p. 3) say "If you mark the Military Retiree box, complete Parts I and II. If you mark the Beneficiary ... box, complete Parts I and III" and "If filing jointly and both spouses qualify for the exemption, complete only one form." So the form allows one of the two per return.
      • Case 5 pins the statute reading.
      • Suggested id: us-mt:military-retirement-and-survivor-exemptions-same-return.
    • Optional, in the same entries: the zero floor on each business source is a gap-fill from WMRE lines 3-5 ("If zero or less, enter 0"). (8)(b) says only "net income".
    • The PR adds no conflict-sounding comments, so the Tie source-conflict markers to the register shared with Axiom #10287 ratchet is unaffected either way.
  2. Pin four unpinned terms (mutation rule: deleting each fails no test).

    • The 2024 subtractions.yaml entry. No test runs TY2024. Case 1 (2026) pins only the 2025 list, which 2026 carries forward. Add a TY2024 case that checks mt_subtractions. A probe on the head tree gives 15,000 for a single 50-year-old with $30,000 of pay and $50,000 of wages.
    • partnership_s_corp_income in the source list. No case uses it. Probe: TY2025, $30,000 of pay and $9,000 of partnership_income gives 9,000.
    • The farm source. No case uses it (covered by the Critical fix's new case).
    • The filer mask on earnings and the eligibility mask on survivor benefits.
      • Case 8 gives the military pay to the dependent, so it pins only the mask on pay. Add a filer with pay and no earnings whose dependent has wages. Probe: TY2026, $30,000 of pay and a dependent with $20,000 of wages gives 0.
      • Case 9 has no survivor benefits, so replacing eligible with filer in the survivor sum fails nothing. Add an ineligible survivor (expect 0).
  3. Drop the page text from the RIC memo reference title (policyengine_us/parameters/gov/states/mt/tax/income/subtractions/military_retirement/in_effect.yaml:13).

    • The title "Montana Revenue Interim Committee, Tax Benefits for Veterans (November 2025), p. 1" ends in page text, and the href already has #page=1.
    • CLAUDE.md: "One cited page: #page=57 in the href only, no page in the title." Remove ", p. 1".

Suggestions

  1. Remove the stale Montana line from military_retirement_pay_survivors.py. The PR deletes the Montana "not yet modeled" limitation from military_retirement_pay.py. The survivor variable still says "Montana (MCA 15-30-2120(3)(n)(ii)): allows exempting up to 50% of military survivor benefits ... this deduction is not yet modeled". After this PR, that is false.

  2. Eligibility default (question 1): keep true, but document when it stops being exact.

    • Timing. The WMRE instructions (p. 2) say that for residents from before July 1, 2023 "the exemption is available for five years beginning with tax year 2024. The last year these taxpayers can claim the exemption will be tax year 2028." The form also asks for the "First tax year the exemption was taken". So (9)(b) can't bind anyone before 2029, not 2028 as the PR body says ("through 2027 ... From 2028"). The input's own documentation already says 2024 through 2028. From 2029, everyone whose eligibility began before 2024 drops out, and the default keeps them in. Say so in the input's documentation, so long-run projections carry the caveat.
    • Residency. (9)(a) already excludes, from 2024, a resident from before July 2023 whose pay began elsewhere. WMRE gives this example: "Albert ... moved to Montana in 2021 ... He began receiving his military retirement income when he was a resident of Georgia in 2020 ... he is not eligible for the exemption." Many retirees move after retiring, and service members stationed in Montana often keep another state's residency, so this group may be large.
    • Benchmark. The Revenue Interim Committee memo (p. 1) reports 1,783 claimants and $25.5 million exempted in TY2024. A microsimulation aggregate well above that would suggest the default (or the residency test) needs a takeup-style adjustment.
    • The plain-input design is right: a default formula would hide the variable from the web calculator's household builder (the Give Michigan's qualified disabled veteran exemption to every veteran with a service-connected disability #10714 lesson).
  3. Move the earnings source list to a parameter. For example, military_retirement/earned_income_sources.yaml, looped with the same per-source floor. The list then carries its own references (WMRE lines 2-5), and source changes like the Critical fix become data-only.

  4. Note the "armed forces" scope.

    • (3)(n)(i)(A) covers "the armed forces of the United States, as defined in 10 U.S.C. 101": Army, Navy, Air Force, Marine Corps, Space Force and Coast Guard.
    • military_retirement_pay covers retirees of all "uniformed services", which adds the NOAA Corps and the Public Health Service.
    • One line in the exemption's documentation would record that assumption.
  5. Bill numbers and the 2024 start (text only).

    • The PR body and rulespec-us#2075 say SB 124 (2025) repealed the 2033 termination, following the WMRE instructions. The 2025 Form 2 instructions (p. 4: "Senate Bill 93 removes the expiration date for the military retirement income and survivor's benefits subtraction") and the RIC memo (p. 2) say SB 93. The current MCA carries no termination note for (3)(n), so the code is right either way.
    • For the 2024 start, the 2024 Form 2 instructions (p. 5, "Under Senate Bill 104 ... the exemption can only be claimed for five years beginning with tax year 2024") or WMRE p. 2 would be a Department of Revenue source to add beside the memo in in_effect.yaml.

Verified correct

  • Statute (current MCA 15-30-2120, read in full).
    • (3)(n)(i)(A)-(D) and (ii) "up to 50%".
    • (8)(a)(i)-(ii) "lesser of", applied only to (3)(n)(i).
    • (8)(b)(i)-(iii).
    • (9)(a)(i) "on or after June 30, 2023", (a)(ii), (b) five consecutive years, and (c).
    • There's no termination note for (3)(n); the only termination notes are for (3)(p) and (q), in 2035.
    • The input documentation's "on or after June 30, 2023" follows the statute; WMRE says "after June 30, 2023". It's documentation only, with no computational effect.
  • Form WMRE (2025).
    • Part II: line 1 is taxable military retirement income (1099-R box 2a, code 7). Lines 2-5 are wages, business, partnership/S corporation and farm income, with lines 3-5 floored at 0. Line 6 is the sum, line 7 is 50% of line 1, and line 8 is the lesser of lines 6 and 7.
    • Part III: 50% of taxable SBP benefits. Death benefits (code 4) don't qualify, and military_retirement_pay_survivors already excludes DIC.
  • Start year. The 2024 Form 2 instructions (SB 104) and the RIC memo ("first became available in tax year 2024") support in_effect = false before 2024 and true from 2024.
  • Pooling and placement.
    • The cap uses "Montana source wage income on the return", so pooling the head's and spouse's earnings is right, and case 6 (the spouse's pay against the head's wages) is right.
    • Only eligible filers' pay and survivor benefits count.
    • The head carries the amount. mt_taxable_income_joint.formula_2024 sums mt_subtractions over the head and spouse, so placement doesn't change tax (spouse rows are 0 in cases 1, 3, 5, 6 and 8).
    • Married filing separately on the same return ended in 2024, so mt_agi_indiv isn't reached.
  • Probes on the head tree.
    • Probe 8: a retiree who also receives survivor benefits ($24,000 of pay, $8,000 of benefits), joint with a spouse who has $50,000 of wages and $10,000 of pay but is ineligible: 12,000 + 4,000 = 16,000.
    • Probe 9: an Idaho resident gets 0 and mt_income_tax 0, with no errors.
    • No state-gated int or enum key, so the NH Add New Hampshire state supplementation for 2026 #10156 pattern doesn't apply.
  • Reuse. The formula reuses military_retirement_pay, military_retirement_pay_survivors, irs_employment_income and partnership_s_corp_income. No existing variable records Montana residency history, so the new eligibility input duplicates nothing. It has no formula, so it stays a calculator input.
  • Count military SBP annuities in state benefit income lists #10317 guard. The formula reads the raw military_retirement_pay and the survivor input separately from a file under .../mt/tax/..., which is_tax_side exempts. That is correct, since (8) caps only the retiree's pay. test_military_retirement_readers.py passes on the merged tree.
  • Tie source-conflict markers to the register shared with Axiom #10287 ratchet. The PR adds no conflict-sounding comments (checked against CONFLICT_COMMENT_RE), and no touched file is in KNOWN_UNMARKED. Every repository-content check in test_source_conflicts.py passes on the merged tree (see CI status for one local-only self-test failure).
  • Other checks.
    • The changelog fragment is top-level, with type added.
    • The tests are in a variable-named YAML file.
    • No partner-test files are touched.
    • rate.yaml and survivor_rate.yaml references corroborate 0.5 (WMRE Part II line 7, Part III line 2).
  • Hand-checks (arithmetic; the PR's ten cases also pass on the head tree):
    1. Case 1 (2026): min(60,000, 0.5 × 30,000) = 15,000 on the head and 0 on the spouse. mt_subtractions is 15,000 (no old-age subtraction at ages 45/43).
    2. Case 2 (2025): min(8,000, 15,000) = 8,000.
    3. Case 3: earnings 0, so min(22,500, 0) = 0. Interest and Social Security aren't earnings.
    4. Case 4: 0.5 × 10,000 = 5,000, with no earnings needed.
    5. Case 5: min(0.5 × 20,000, 5,000) + 0.5 × 10,000 = 10,000.
    6. Case 6: min(60,000, 0.5 × 30,000) = 15,000 on the head.
    7. Case 7: 6,000 + max(0, −4,000) = 6,000, and min(15,000, 6,000) = 6,000.
    8. Case 8: the dependent's pay is masked, so 0.
    9. Case 9: the input is false, so 0.
    10. Case 10 (2023): in_effect is false, so 0. Every 2021-list subtraction is 0 for this household, so mt_subtractions is 0.
    11. PR body, TY2026 couple: federal taxable income is 90,000 − 32,200 = 57,800 (probe confirms 57,800).
      • Before: 57,800 × 4.7% = 2,716.60.
      • After: 42,800 × 4.7% = 2,011.60 (probe confirms).
      • Without the pension: 27,800 × 4.7% = 1,306.60.
    12. The SSTB filer in Critical 1: 2,434.44 at the head vs 1,695.48 under the law (both probe-confirmed).

Axiom line assessment

axiom: us-mt/statute/15-30-2120 queued (TheAxiomFoundation/rulespec-us#2075) is a valid queued line: it has a status word and links the issue.

rulespec-us#2075 is OPEN and labelled pe-parity. It is dispatch-ready:

  • module path us-mt/statutes/15-30-2120/3/n.yaml;
  • corpus citation with its sha256;
  • verbatim (3)(n), (8) and (9);
  • seven required outputs;
  • companion tests A-G, which are hand-derived from the statute and form arithmetic, not PolicyEngine output;
  • the pipeline wiring step.

It records the encoding debt (the held mt_pit_2026_has_military_retirement_subtraction branch) in the same form accepted for #2074 in this batch.

It matches the head's behavior. Its output 4 is stated at the level of the law ("net income from a trade or business and net farm income"), so the Critical fix doesn't contradict it. When the fix lands, consider adding a farm companion test, such as "$30,000 of military retirement income and $40,000 of net farm income gives output 5 = 15,000". Also consider correcting "SB 124" (Suggestion 5).

CI status

At head 2eeb5d3, 36 checks pass and 7 are skipped, with none failing or pending. The passing checks include:

  • PR validation (lock, guard tests, lint, changelog);
  • Quick Feedback;
  • Household API Partners;
  • Microsimulation;
  • all Baseline, Contrib and Python Rest shards.

The head already includes main, so CI ran the merged tree.

Locally on that tree:

Branch status

The branch is 3 commits ahead and 0 behind main. git merge-tree --write-tree gives the head's own tree, and head vs main differs only in the PR's nine files.

#10331 (merged today) edited subtractions.yaml. The PR merged main after it, and both changes are intact: #10331's disability-exclusion repeal comment and 2021 list, and this PR's 2024 and 2025 entries.

No file overlaps with the sibling military retirement PRs (#10702 UT, #10714 MI, #10715 ID, #10716 DE, #10717 ID).

Verdict: REQUEST_CHANGES

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes per the review above: 1 critical (the earnings cap reads self_employment_income and farm_income, so it drops SSTB business income and Schedule F farm income that 15-30-2120(8)(b) counts, and counts a non-AGI input; use total_self_employment_income and farm_operations_income), 3 should (record two statute-over-form readings; four unpinned terms; a reference title), 5 suggestions.

MaxGhenis and others added 2 commits November 11, 2026 12:01
MCA 15-30-2120(8)(b) counts net income from a trade, business, profession
or occupation and net farming income. The cap read self_employment_income
(non-SSTB Schedule C only) and farm_income (the Schedule J averaging input,
outside AGI). A new earned_income_sources parameter lists
irs_employment_income, total_self_employment_income,
partnership_s_corp_income and farm_operations_income, and the formula loops
over it with the per-source zero floor.

Also records three readings as source-conflict candidates (Schedule E
income, both subtractions on one return, the per-source loss floor), pins
the 2024 subtractions entry, the partnership and farm sources, the filer
mask on earnings and the eligibility mask on survivor benefits, adds the
ARM 42.15.1510(3)(a) and (b) examples, documents the armed forces scope,
passive income and when the eligibility default stops being exact, drops
page text from the RIC memo title, adds the 2024 Form 2 instructions as a
source for the 2024 start, and removes the stale Montana limitation from
military_retirement_pay_survivors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 3 commits November 13, 2026 09:24
… candidates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the source_conflicts/candidates.yaml conflict by keeping main's new entries and this PR's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pages 2 and 3 follow the form's column order, one paragraph or list item per line, and page 1 follows its visual reading order, so every quoted WMRE excerpt matches the capture verbatim.

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

Copy link
Copy Markdown
Contributor Author

Thanks for the review. 09ed698f28 makes the code, test and documentation changes below, and the later commits add the Form WMRE capture, merge main and reflow the capture.

Critical

  1. 09ed698 moves the earnings sources into earned_income_sources.yaml, which lists total_self_employment_income and farm_operations_income in place of self_employment_income and farm_income. New TY2026 cases give 15,000 for $40,000 of SSTB income and for $40,000 of Schedule F income, and 0 for $40,000 of Schedule J farm_income. Form 4835 farm_rent_income stays out: the TY2026 case "Rents, royalties, farm rent and estate income are not earned income" gives 0. The PR body's Change section and before-and-after table describe the new sources.

Should address

  1. source_conflicts/candidates.yaml now records the Schedule E reading, the same-return reading and the optional loss floor (us-mt:military-retirement-exemption-business-loss-floor), all in 09ed698. e65f906ee7 captures the 2025 Form WMRE text in source_conflicts/sources/us-mt/form-wmre-2025.txt, and ceb2f71466 reflows it so page 1 follows the form's reading order and pages 2 and 3 hold one paragraph or list item per line, so all seven WMRE excerpts the candidates quote appear in it verbatim.
  2. 09ed698 pins all four terms: a TY2024 case gives mt_subtractions 15,000, $9,000 of partnership and S corporation income gives 9,000 in TY2025, the Schedule F case covers the farm source, a dependent's $20,000 of wages gives 0, and an ineligible survivor gets 0. The body's mutation table gives how many cases each removal fails.
  3. 09ed698 drops ", p. 1" from the memo title in in_effect.yaml.

Suggestions

  1. 09ed698 removes the Montana line from military_retirement_pay_survivors.py.
  2. The documentation in mt_military_retirement_exemption_eligible.py (09ed698) now says the default overstates the exemption from 2024 for residents like WMRE's Albert and from 2029 for filers whose five years have run out. It also gives the committee memo's TY2024 claimant and dollar totals as a benchmark, and the body's assumptions say the same.
  3. earned_income_sources.yaml (09ed698) holds the list with references to (8)(b), ARM 42.15.1501(2) and WMRE lines 2 to 5, and the formula loops over it with the per-source floor.
  4. The documentation in mt_military_retirement_exemption.py (09ed698) records the 10 U.S.C. 101 scope and assumes none of the pay comes from the NOAA Corps or the Public Health Service.
  5. The body names SB 93 (2025 Mont. Laws ch. 586) and notes the form's "Senate Bill 124", which the capture keeps as printed. in_effect.yaml adds the 2024 Form 2 instructions (Senate Bill 104) beside the memo (09ed698). Encode Montana's working military retirement and survivor benefit exemption from 2024 (MCA 15-30-2120(3)(n), (8), (9)) (PE-US #10713) TheAxiomFoundation/rulespec-us#2075 also names SB 93 and adds your farm companion test as test H: $30,000 of military retirement income and $40,000 of net farm income give 15,000.

538c7c8cc3 merges main; its one conflict, in candidates.yaml, keeps both sides' new entries.

At ceb2f71, the 251 tests in test_source_conflicts.py, the 4 in test_military_retirement_readers.py and the 22 cases in mt_military_retirement_exemption.yaml pass.

@MaxGhenis
MaxGhenis requested a review from DTrim99 November 21, 2026 14:32

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Program review

Base repository: PolicyEngine/policyengine-us
PR number: 10713
Reviewed head SHA: ceb2f71
Merge base SHA: f2b6108
Mode: full, with a recheck of David's earlier review (head 2eeb5d3)
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10713-review-sources.json
Review status: COMPLETE

Source Documents

Critical

None.

Should Address

A1 — Wages and business income earned outside Montana count toward the cap with no recorded conflict or documentation (OPEN)

  • Severity: SHOULD ADDRESS (repository source-conflict requirement; PolicyEngine can't model the condition)
  • Location: policyengine_us/parameters/gov/states/mt/tax/income/subtractions/military_retirement/earned_income_sources.yaml:5,8,13; policyengine_us/variables/gov/states/mt/tax/income/subtractions/military_retirement/mt_military_retirement_exemption.py:10-23 (documentation); source_conflicts/candidates.yaml (no entry).
  • Statute vs. form:
    • MCA 15-30-2120(8)(b) limits "Montana source wage income" to "(i) wages, salary, tips, and other compensation for services performed in the state; (ii) net income from a trade, business, profession, or occupation carried on in the state; and (iii) net income from farming activities carried on in the state".
    • ARM 42.15.1501(2) adds that this definition "is not the same as the definition of Montana source income in 15-30-2101".
    • The 2025 WMRE instructions (PDF p. 3) tell residents to enter "the total wages included on Form 1040, line 1z" (line 2) and "the total business income included on Form 1040, Schedule 1, line 3" (line 3), with no work-location test.
  • What the PR does: It counts every head and spouse dollar of irs_employment_income, total_self_employment_income, partnership_s_corp_income and farm_operations_income, which is the form's reading. The PR body justifies this with "PolicyEngine-US models full-year residents, so all of the return's wages ... count as Montana source". That doesn't follow: a full-year resident can earn wages for services performed in another state.
  • Trigger: TY2026, a full-year Montana resident (eligible) with $30,000 of military retired pay and $40,000 of wages from a job physically performed in North Dakota or Wyoming (a commuter).
    • Statute: (8)(b)(i) excludes those wages, so the subtraction is 0.
    • Form and head: min(0.5 × 30,000, 40,000) = 15,000. This follows from the code: line 5's source is summed with no location input.
  • Why it matters: CLAUDE.md line 141 and CONTRIBUTING.md#source-conflicts say to record every statute/form choice as a source_conflicts/candidates.yaml item in the ruling PR. The PR records three such readings but not this one, and the variable's documentation doesn't mention it. Since PolicyEngine-US has no input for where wages are earned, following the instructions is defensible. It just needs to be recorded.
  • Fix:
    • Add a candidate, for example us-mt:military-retirement-exemption-wage-location, with sources (8)(b), ARM 42.15.1501(2) and WMRE lines 2-3 (p. 3), and follows: instructions (or gap-fill, with a note that no work-location input exists).
    • Add one sentence to the mt_military_retirement_exemption documentation.
    • No code change is needed. The affected group (residents who physically work out of state) is likely small.

Suggestions

S1 — No YAML case asserts Montana taxable income or tax for the new exemption (OPEN)

  • Severity: SUGGESTION

  • Location: policyengine_us/tests/policy/baseline/gov/states/mt/tax/income/subtractions/mt_military_retirement_exemption.yaml (22 cases; the furthest output is mt_subtractions)

  • Trigger: any eligible return, 2024+.

  • Expected vs observed: the behavior is correct, but nothing pins the step from mt_subtractions to mt_taxable_income_joint and mt_income_tax. Diagnostics (executed, pr-10713-code-diagnostics.json), single, age 45, $30,000 retired pay, $50,000 wages, eligible vs mt_military_retirement_exemption_eligible: false:

    Year MT taxable income mt_income_tax Change
    2024 50,400 vs 65,400 2,727.60 vs 3,612.60 885.00 = 15,000 × 5.9%
    2025 49,250 vs 64,250 2,652.55 vs 3,537.55 885.00 = 15,000 × 5.9%
    2026 48,900 vs 63,900 2,311.60 vs 3,159.10 847.50 = 15,000 × 5.65%

    Survivor, 2025, age 70, $20,000 benefits and $10,000 interest: tax goes from 27.73 to 0. Montana taxable income drops from 590 (taxable income 6,250 less the 5,660 old-age subtraction) to 0.

  • Remedy: add one end-to-end case, for example the 2026 row (mt_income_tax: 2_311.6).

S2 — mt_other_subtractions documentation doesn't warn against entering the newly modeled exemption (OPEN)

  • Severity: SUGGESTION
  • Location: policyengine_us/variables/gov/states/mt/tax/income/subtractions/mt_other_subtractions.py:11-16
  • Trigger: a user who, while the exemption was documented as "not yet modeled" (the limitation this PR deletes from military_retirement_pay.py), entered it in mt_other_subtractions.
  • Expected vs observed: the input's documentation lists what PolicyEngine computes separately ("Do not include interest exemptions, tuition subtractions, old age/disability exclusions, federal deductions, or state tax refunds ..."). The military retirement and survivor benefit exemption (Form 2 Schedule I Part I line 13, per Form WMRE line 8 and Part III line 2) is now computed too but isn't on the list, so such a household would subtract the amount twice.
  • Remedy: add "the military retirement and survivor benefit exemption (Form WMRE)" to that sentence.

S3 — Say what the RIC memo's $24.8 million measures (OPEN)

  • Severity: SUGGESTION
  • Location: policyengine_us/variables/gov/states/mt/tax/income/subtractions/military_retirement/mt_military_retirement_exemption_eligible.py:25-29.
  • Evidence:
    • The memo's figures match the PR's documentation: RIC memo, November 2025, PDF p. 1, table "USE OF EXEMPTION ...": 1,711 residents, $24,754,179; total ">1,783", $25,530,804.
    • But the memo's prose calls the total a "loss of revenue of $25.5 million".
    • Inference: the figures must be exempted income, not tax. As revenue, $24.8 million over 1,711 residents would mean roughly $14,500 of tax each, or about $250,000 of exempted income each at Montana's top rate. That's impossible when the exemption is at most half of a military pension.
  • Fix: Write "$24.8 million exempted" so nobody benchmarks the aggregate revenue change against it. This affects documentation only, with no computational effect.

Evidence Gaps

No material gaps reported.

Notes

  • Earlier review: every item is resolved.
  • Critical 1: the earnings cap now lists irs_employment_income, total_self_employment_income, partnership_s_corp_income and farm_operations_income, and drops the Schedule J farm_income. New cases pin SSTB (15,000), Schedule F (15,000), Schedule J (0) and loss netting (6,000).
  • Should 1: three candidates record the same-return, loss-floor and Schedule E readings. Their quotes match the WMRE and its capture.
  • Should 2: each of the four terms is pinned, and removing any one flips a case.
  • Should 3 and Suggestions 1-5 are done.
  • On policy-1: the code follows the WMRE instructions (lines 2-3 take all Form 1040 wages and Schedule 1 line 3 business income). PolicyEngine-US has no input for where wages were earned, so that is a defensible choice, but CONTRIBUTING asks the PR that takes the reading to record it. MCA 15-30-2120(8)(b) counts only "Montana source wage income": services performed in the state, and business or farming carried on in the state. ARM 42.15.1501(2) says this is not the 15-30-2101 definition. Example: a 2026 resident commuting to North Dakota with $30,000 of military pay and $40,000 of wages gets 0 under the statute and 15,000 in the model.
  • Code side: eligibility, the earnings cap, the survivor exemption and the filer masks are correct and tested. The PR merges cleanly into current main, and the changed tests and the Montana subtraction directory pass.

Validation Summary

Local tests at the reviewed head pass (the changed tests plus the Montana subtraction directory; review venv, imports from the snapshot). Sources: MCA 15-30-2120, ARM 42.15.1501, the 2025 WMRE form and instructions (sha256 matches the repo's capture), the RIC memo (November 2025), 2025 Mont. Laws ch. 586 and the 2024 Form 2 instructions, checksums validated. CI on the head: 38/38 succeeded.

Timing

policy role seconds: 351.00s; code role seconds: 689.00s; parallel review seconds: 689.00s; elapsed seconds: 800.00s

Review Severity

COMMENT. Open findings: 0 critical, 1 should address, 3 suggestions.

MaxGhenis and others added 5 commits November 29, 2026 07:31
MCA 15-30-2120(8)(b) counts only Montana-source wages and business
income, while Form WMRE takes all wages and Schedule 1 line 3 income.
Adds a source-conflict candidate and a documentation sentence, an
end-to-end 2026 case, the exemption in mt_other_subtractions' list, and
calls the committee's $24.8 million income exempted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MCA 15-30-2120(8)(b) caps the working military retiree exemption at
Montana source wage income: wages for services performed in Montana and
business or farm income from activity carried on there. The model
summed all of the return's wages and business income wherever earned,
as Form WMRE's line instructions do, and recorded that as a departure
from the statute.

The new tax-unit variable mt_military_retirement_montana_source_wage_income
holds Form WMRE line 6. Its formula keeps the previous total, which is
the statute's amount when all of the work is in Montana. A return with
work or a business outside Montana enters the Montana amount, and the
exemption follows the statute. Three cases pin that, and the
source-conflict entry now follows the statute under the statute-first
rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An override of the computed cap on one return zeroed the cap on every
other return, since Core fills omitted cells with the default. The cap
is again summed inside the exemption at full precision, and a new tax
unit input, mt_military_retirement_montana_source_wage_income_override
(default -1, negative means not entered), replaces the sum only for a
return that enters it. Partnership and S corporation income now leaves
out its passive subset (ARM 42.15.1501(2)).

The wage-location entry now says follows: conflicting-source, since the
default still counts out-of-state work. The docs describe the statutory
cap rather than Form WMRE line 6, and the eligibility docs no longer
treat the revenue memo as a benchmark. New cases cover two returns, a
negative entry, passive income and loss, and fractional cents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default sum matches the resident line instructions in counting work
outside Montana, but it also leaves out the rents and royalties that
line 4's Schedule 1 line 5 holds, and counts Schedule C income without
the material participation test of line 3. The note now says so rather
than calling the sum the line-instruction total.

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

MaxGhenis commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Agent-written for Max, by Claude Code for Max Ghenis.

A1. fb6d94b071 records the conflict and also lets a return follow the statute, since CONTRIBUTING.md's statute-first rule puts (8)(b) ahead of the line instructions. A new tax-unit input, mt_military_retirement_montana_source_wage_income_override, takes the return's Montana source wage income, and your North Dakota commuter who enters 0 gets 0. With no entry (the default is -1), the exemption keeps the sum of all the head's and spouse's wages and business income, so microsimulation still gives that commuter $15,000: no dataset records where people work. us-mt:military-retirement-exemption-wage-location therefore reads follows: conflicting-source and state: ruled, and its note gives both results. Its example gives a commuter $1,000 of Montana wages and $39,000 of North Dakota wages, since the WMRE Part II instructions say a retiree with no Montana work does "not qualify for this exemption". The documentation of mt_military_retirement_exemption and of the new input says the same. The sum now also leaves out passive_partnership_s_corp_income, as ARM 42.15.1501(2) requires. Six cases pin the entry and the passive rule: "A full-year resident's wages for work outside Montana do not count" (0), "Only the wages for work in Montana limit the retirement exemption" (10,000), "A loss from a business outside Montana does not reduce Montana business income" (30,000), "An entry on one return leaves another return's limit alone" (0 and 10,000), "A negative entry counts as no entry" (8,000) and "Passive partnership and S corporation income does not count" (10,000). At fb6d94b all 31 cases in mt_military_retirement_exemption.yaml pass, and so do the 251 tests in test_source_conflicts.py. Making the exemption ignore the entry fails 4 cases. Treating every negative entry as an amount fails "A negative entry counts as no entry".

S1. fb6d94b adds "An eligible single filer's Montana taxable income and tax" to mt_military_retirement_exemption.yaml: your TY2026 single filer, age 45, with $30,000 of retired pay and $50,000 of wages. It asserts Montana taxable income of 48,900 and mt_income_tax of 2,311.60. Both follow from the parameter files: 80,000 of AGI less the 16,100 standard deduction and the 15,000 exemption is 48,900, and 4.7% of 47,500 plus 5.65% of 1,400 is 2,311.60. The case passes at fb6d94b.

S2. fb6d94b adds "the military retirement and survivor benefit exemption (Form WMRE)" to the items that the mt_other_subtractions documentation says PolicyEngine computes separately.

S3. The mt_military_retirement_exemption_eligible documentation now gives the table's figures with the memo's own label, revenue loss, and says the roughly $14,500 per resident claimant suggests the table measures income exempted instead. Since the memo and that arithmetic disagree, the documentation no longer offers the figures as a benchmark. The description says the same.

@MaxGhenis
MaxGhenis requested a review from DTrim99 November 29, 2026 18:59
@MaxGhenis

MaxGhenis commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Agent-written for Max, by Claude Code for Max Ghenis.

In round 3 of independent review, a Codex cloud task reviewed 6e1da85 (GPT-6.2 Sol at Extra High effort; chat https://chatgpt.com/local/6b0c58bd-f974-83ea-98e8-77012cf69007) and requested changes. It found three P1s: an entry on one return set another return's cap to 0, follows: statute overstated a default that still counts wages for work outside Montana, and the cap variable's documentation called the variable Form WMRE line 6 while its sum counted passive partnership income. It also found two P2s: float32 rounding of the cap with no entry, and a negative entry that passed straight through. Its Linux container ran every test we asked for; CI runs the full suites and microsimulation.

fb6d94b071 answers all five, and a scoped round-4 review of that commit started at 18:59 UTC.

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Agent-written for Max, by Claude Code for Max Ghenis.

In round 4 of independent review, a Codex cloud task reviewed fb6d94b (GPT-6.2 Sol at Extra High effort; chat https://chatgpt.com/local/6b0c75fe-83fc-83ea-80e2-7bacde4c803b) and requested changes. It closed all nine earlier findings we asked it to check and found three new P1s and one P2, which the next comment lists. Its Linux container ran every test we asked for; CI runs the full suites and microsimulation.

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Agent-written for Max, by Claude Code for Max Ghenis.

An independent review of this head requested changes on three P1 findings and one P2, so we'll make another round of fixes.

  • CI passed all 35 checks at head fb6d94b.
  • One P1 needs a code fix: PolicyEngine-US carries inputs forward and uprates dollar amounts, so an entry of mt_military_retirement_montana_source_wage_income_override for one year also sets a later year that has no entry. Take a Montana retiree with $30,000 of military retirement pay and $60,000 of wages in 2026 and 2027. With no entry, PolicyEngine-US gives a $15,000 exemption for 2027. A 2026 entry of $0 alone makes it $0, and a 2026 entry of $1,000 alone makes it $1,031.17; an explicit 2027 entry of -1, the input's "not entered" value, restores $15,000. We reproduced all four figures in a local run at this head. The review suggests using the entry only when the input's supplied periods (holder.get_input_periods) include the current year. It also suggests a two-year case in which the second year has no entry and uses its computed cap.
  • Two P1s need documentation fixes:
    • The input's documentation calls the computed sum "the statute's amount when all of the work and activity is in Montana and none of it is passive". The sum leaves out rental_income, though a rental business in which a real estate professional materially participates can produce nonpassive income from a Montana trade or business (IRS Publication 925). The review asks us to call the sum an estimate and to tell callers to enter the statutory amount whenever the listed inputs leave out qualifying income.
    • The wage-location note in source_conflicts/candidates.yaml says the sum "differs from them in two other ways". The review found further differences. PolicyEngine-US also subtracts reported passive partnership income that can stay in an active owner's Schedule 1 line 5 total. Form WMRE line 5 points to Schedule 1 line 11, which holds educator expenses, while Schedule F income goes on Schedule 1 line 6. The review asks us to drop the count, name the passive subtraction, and describe the printed line 5 reference apart from how PolicyEngine-US uses Schedule F.
  • One P2 needs a documentation fix: the same note says "No dataset holds that amount", and we can't confirm that from the code. The review suggests "When no Montana amount is supplied, the fallback still counts a commuter's out-of-state wages."
  • At this head, the review ran the WMRE exemption file (31 cases), the Montana income integration file (22 cases), test_source_conflicts.py (251 tests), test_input_variable_definitions.py (5 tests) and ruff, and all passed.
  • The wage-location candidate in source_conflicts/candidates.yaml carries conflicting-source and state ruled. Its ruling favors MCA 15-30-2120(8)(b), and PolicyEngine-US follows that reading only when a user enters the return's Montana amount.
  • DTrim99 requested changes on 2026-11-23, and we answered his points in the reply above (Model Montana's working military retirement and survivor benefit exemption #10713 (comment)). We re-requested his review on 2026-11-29, before the independent review found the P1s above, so his review can wait for these fixes.
  • Beyond these fixes and DTrim99's review, no hold, decision or dependency blocks this PR. The review left two possible follow-ups out of scope: inputs for an active rental business and for where a person works.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Program review

Base repository: PolicyEngine/policyengine-us
PR number: 10713
Reviewed head SHA: 3b127ca
Merge base SHA: 8769cc7
Mode: incremental from ceb2f71
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10713-review-sources.json
Review status: COMPLETE

Source Documents

Critical

None.

Should Address

A1 — wages and business income earned outside Montana count toward the cap (RESOLVED)

  • Recorded conflict. The PR adds us-mt:military-retirement-exemption-wage-location to source_conflicts/candidates.yaml:8801-8865. It has follows: conflicting-source (line 8836) and state: ruled (line 8843).
    • Sources: MCA 15-30-2120(8)(a)(i) and (8)(b), ARM 42.15.1501(2), and the WMRE instructions (PDF pp. 2-3).
    • Readings: both are given, the statute reading and the line 2-5 instructions.
    • Example: a commuter with $1,000 of Montana wages and $39,000 of North Dakota wages gets $1,000 under the statute and $15,000 under the line 2 instruction.
    • Note: says what PE-US does with an entry and without one.
  • follows value. conflicting-source is one of the allowed values (test_source_conflicts.py:800; key at candidates.yaml:7-9). It correctly describes the default, which follows the line instructions against (8)(b). The four required parts of CONTRIBUTING step 1 are all present.
  • Quotes checked against the PDF fetched today (sha256 a6a5c425…, which matches the committed capture's recorded hash):
    • Line 2 "Residents enter the total wages included on Form 1040, line 1z" (p. 3)
    • Line 3 "the total business income included on Form 1040, Schedule 1, line 3", which requires material participation (p. 3)
    • Lines 4 and 5 point to Schedule 1 lines 5 and 11 (p. 3)
    • Part-year "the Montana source wages earned while working in Montana as a resident" (p. 3)
    • The Exemption section "Wages, salary, and tips from compensation performed in Montana" (p. 2)
    • Part II "…did not earn Montana source income from working a job, running a business, or operating a farm, you do not qualify for this exemption" (p. 3)
    • ARM 42.15.1501(2): "…is not the same as the definition of Montana source income in 15-30-2101, MCA". History "NEW, 2025 MAR, Notice No. 42-1088, Eff. 1/25/25", from the rules.mt.gov URL the candidate cites. That confirms "effective January 25, 2025".
    • MCA (8)(b)(i)-(iii) match the current statute text.
    • Every quote also appears in the committed capture source_conflicts/sources/us-mt/form-wmre-2025.txt.
  • Model change beyond what A1 asked for. A new TaxUnit input, mt_military_retirement_montana_source_wage_income_override (default -1), lets a return follow (8)(b). mt_military_retirement_exemption.py:56-63 uses a nonnegative entry for the tax year in place of the estimate.
  • Documentation. The mt_military_retirement_exemption and override documentation now describe the estimate and when to enter the statutory amount. No input for work location exists anywhere in PE-US (searched variables/ for other-state, work-state and source-income inputs), so the fallback still counts a commuter's out-of-state wages. The note says this openly.
  • New test expectations match (8)(b):
    • Commuter entering 0 gets 0.
    • $10,000 of Montana wages gets 10,000.
    • A Montana business netting $30,000 beside a Wyoming loss gets 30,000 with $80,000 of pay. (8)(b)(ii) "carried on in the state" leaves the Wyoming loss out.
    • Two returns in one household get 0 and 10,000.
    • An entry of -1,000 counts as no entry and gives 8,000.

Suggestions

S1 — No YAML case asserted Montana taxable income or tax for the new exemption (RESOLVED)

  • Fix: the new case "An eligible single filer's Montana taxable income and tax" (mt_military_retirement_exemption.yaml, TY2026) asserts the full chain:
    • mt_military_retirement_exemption = mt_subtractions = 15,000
    • mt_taxable_income_joint = 48,900
    • mt_income_tax = 2,311.60
  • Check: these match the round-2 executed diagnostic: 0.047 × 47,500 + 0.0565 × 1,400 = 2,311.60. The case passes locally.
  • Entry path: I also ran a diagnostic for the new input (diag-output.json, end_to_end_commuter). A commuter with an entry of 0 gets Montana taxable income of 53,900 and tax of 2,594.10. Without the entry, they get 38,900 and 1,828.30. Both match hand arithmetic.

S2 — mt_other_subtractions documentation didn't warn against entering the exemption (RESOLVED)

mt_other_subtractions.py:15 now lists "the military retirement and survivor benefit exemption (Form WMRE)" among the amounts PolicyEngine computes separately. That is the remedy round 2 proposed.

S3 — say what the RIC memo's $24.8 million measures (RESOLVED)

  • mt_military_retirement_exemption_eligible.py:25-31 no longer calls the figures a benchmark for microsimulation totals. It gives 1,711 claimants and $24.8 million (and >1,783 and $25.5 million), says the memo labels them revenue loss, and adds that "At about $14,500 per resident claimant, the amounts suggest that the table may measure income exempted rather than tax".
  • Checked against the memo (PDF p. 1):
    • The table "USE OF EXEMPTION FOR MILITARY PENSION OR RETIREMENT INCOME, 2024" shows 1,711 / $24,754,179 and >1,783 / $25,530,804.
    • The prose: "resulted in a loss of revenue of $25.5 million … 1,711 residents received a reduction of nearly $24.8 million".
    • $24,754,179 / 1,711 = $14,467.67, which supports "about $14,500".
  • Note, not a finding: strictly, the memo calls only the $25.5 million total a revenue loss and the $24.8 million "a reduction". The documentation's caution makes this harmless.

Evidence Gaps

No material gaps reported.

Notes

  • Round 3, incremental from ceb2f71. Every item from the round-2 review is resolved and the changes since then add no new findings.
  • A1 is handled the way CONTRIBUTING asks. The default estimate follows the WMRE line 2-5 instructions, and the new candidate us-mt:military-retirement-exemption-wage-location records it as conflicting-source against MCA 15-30-2120(8)(b), with both readings, a commuter example and quotes that match the 2025 WMRE PDF and ARM 42.15.1501. A return that knows its Montana-source wage income can enter it in mt_military_retirement_montana_source_wage_income_override; the entry applies only to the tax year it is entered for (an earlier year's entry can't carry forward), and a negative entry or the default -1 means no entry.
  • The nonpassive partnership and S corporation measure matches ARM 42.15.1501(2). mt_military_retirement_nonpassive_partnership_s_corp_income is partnership and S corporation income less its section 469 passive subset, so a passive loss no longer reduces active income. The departure from WMRE line 4's literal Schedule 1 line 5 total is recorded in the Schedule E candidate.
  • Mutation checks: removing the tax-year guard, the negative-entry fallback, the entry itself, or the passive subtraction each makes at least one new case fail.

Validation Summary

Local tests at the reviewed head (policyengine-core 3.37.2, imports from the snapshot): 387 passed, 0 failed across the Montana subtractions directory (all 35 exemption cases), Montana integration, income tax and taxable income tests, test_source_conflicts.py and test_input_variable_definitions.py. Sources re-fetched and checksum-validated: MCA 15-30-2120, the 2025 Form WMRE (matches the repo capture's hash), ARM 42.15.1501 and the November 2025 RIC memo. CI at 3b127ca: 35/35 succeeded.

Timing

setup seconds: 120.00s; policy role seconds: 476.00s; code role seconds: 574.00s; parallel review seconds: 782.00s; adjudication seconds: 0.00s; elapsed seconds: 1006.00s

Review Severity

APPROVE. Open findings: 0 critical, 0 should address, 0 suggestions.

MaxGhenis and others added 4 commits November 30, 2026 17:04
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lity

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Program review

Base repository: PolicyEngine/policyengine-us
PR number: 10713
Reviewed head SHA: 8d9f794
Merge base SHA: 094934a
Mode: incremental from 3b127ca
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10713-review-sources.json
Review status: COMPLETE

Source Documents

Critical

None.

Should Address

A1 — wages and business income earned outside Montana count toward the cap (RESOLVED)

  • Recorded conflict. The PR adds us-mt:military-retirement-exemption-wage-location to source_conflicts/candidates.yaml:8801-8865. It has follows: conflicting-source (line 8836) and state: ruled (line 8843).
    • Sources: MCA 15-30-2120(8)(a)(i) and (8)(b), ARM 42.15.1501(2), and the WMRE instructions (PDF pp. 2-3).
    • Readings: both are given, the statute reading and the line 2-5 instructions.
    • Example: a commuter with $1,000 of Montana wages and $39,000 of North Dakota wages gets $1,000 under the statute and $15,000 under the line 2 instruction.
    • Note: says what PE-US does with an entry and without one.
  • follows value. conflicting-source is one of the allowed values (test_source_conflicts.py:800; key at candidates.yaml:7-9). It correctly describes the default, which follows the line instructions against (8)(b). The four required parts of CONTRIBUTING step 1 are all present.
  • Quotes checked against the PDF fetched today (sha256 a6a5c425…, which matches the committed capture's recorded hash):
    • Line 2 "Residents enter the total wages included on Form 1040, line 1z" (p. 3)
    • Line 3 "the total business income included on Form 1040, Schedule 1, line 3", which requires material participation (p. 3)
    • Lines 4 and 5 point to Schedule 1 lines 5 and 11 (p. 3)
    • Part-year "the Montana source wages earned while working in Montana as a resident" (p. 3)
    • The Exemption section "Wages, salary, and tips from compensation performed in Montana" (p. 2)
    • Part II "…did not earn Montana source income from working a job, running a business, or operating a farm, you do not qualify for this exemption" (p. 3)
    • ARM 42.15.1501(2): "…is not the same as the definition of Montana source income in 15-30-2101, MCA". History "NEW, 2025 MAR, Notice No. 42-1088, Eff. 1/25/25", from the rules.mt.gov URL the candidate cites. That confirms "effective January 25, 2025".
    • MCA (8)(b)(i)-(iii) match the current statute text.
    • Every quote also appears in the committed capture source_conflicts/sources/us-mt/form-wmre-2025.txt.
  • Model change beyond what A1 asked for. A new TaxUnit input, mt_military_retirement_montana_source_wage_income_override (default -1), lets a return follow (8)(b). mt_military_retirement_exemption.py:56-63 uses a nonnegative entry for the tax year in place of the estimate.
  • Documentation. The mt_military_retirement_exemption and override documentation now describe the estimate and when to enter the statutory amount. No input for work location exists anywhere in PE-US (searched variables/ for other-state, work-state and source-income inputs), so the fallback still counts a commuter's out-of-state wages. The note says this openly.
  • New test expectations match (8)(b):
    • Commuter entering 0 gets 0.
    • $10,000 of Montana wages gets 10,000.
    • A Montana business netting $30,000 beside a Wyoming loss gets 30,000 with $80,000 of pay. (8)(b)(ii) "carried on in the state" leaves the Wyoming loss out.
    • Two returns in one household get 0 and 10,000.
    • An entry of -1,000 counts as no entry and gives 8,000.

Coordinator assessment: Still resolved at 8d9f794. The override is now read through tax_year_input, so the tax-year guard is kept, and a new person-level mt_military_retirement_montana_wages input adds a direct (8)(b)(i) route. The round-2 commuter and out-of-state cases still pass.

A2 — PR-caused red CI: in-place write into a cached array in mt_subtractions (OPEN)

  • Location: policyengine_us/variables/gov/states/mt/tax/income/subtractions/mt_subtractions.py:30 (added in 8250611):
    total_subtractions -= min_(
        max_(0, reported_wmre), max_(0, other_subtractions)
    )
  • CI: run 46590926384, job 142451429301 ("Python tests / Full Suite - Rest (Python shard 2)") at head 8d9f794: 1 failed, 2951 passed, 10 skipped. The one failure is policyengine_us/tests/code_health/test_no_in_place_writes_to_cached_arrays.py::test_formulas_do_not_write_into_cached_arrays: assert not ['policyengine_us/variables/gov/states/mt/tax/income/subtractions/mt_subtractions.py:30 in formula(): total_subtractions (augmented assignment)']. The "Check Rest Python shards" gate fails because of it. The test has been on main since #9739 (2026-10-02). The line is the PR's own, so the PR causes the failure, not main. The merges of main add nothing to it.
  • Local reproduction: the same test fails locally against the snapshot with the same message, naming only mt_subtractions.py:30 (run 2 log below). The other 255 Python tests in that invocation pass, including test_mt_military_retirement_exemption_cache.py and test_source_conflicts.py.
  • Not just a static-scan false positive: total_subtractions comes from add(person, period, p.subtractions). Core's for_each_variable returns the cached array itself when the list holds a single same-entity variable. Executed (diag2-output.json, G_alias_single_list): under a reform that sets gov.states.mt.tax.income.subtractions.subtractions to ["mt_other_subtractions"] for 2026, with mt_other_subtractions 15,000 and 5,000 reported as WMRE, mt_subtractions = 10,000. After that, mt_other_subtractions reads 10,000 instead of the input's 15,000. Every later reader in the simulation then sees the corrupted value. Baseline lists hold 4 to 7 variables, so add builds a new array and baseline results are unaffected (D0-D5 and all YAML cases are correct).
  • Fix: total_subtractions = total_subtractions - min_(max_(0, reported_wmre), max_(0, other_subtractions)).
  • Severity: should-address. It is a PR-caused red check on the head. Main has no required status checks configured (the required_status_checks API returned empty), so it is not a "failing required check" under the critical rubric. The aliasing affects only a reform with a one-variable subtraction list.

A3 — the lower bound of the five-year window, and the cap on the reported WMRE amount, have no failing test (OPEN)

  • Location: mt_military_retirement_exemption.py:46-49, (year >= first_year) & (year < first_year + p.eligibility_years), and mt_subtractions.py:30-32, min_(max_(0, reported_wmre), max_(0, other_subtractions)).
  • Mutation evidence (mut-output.json): I removed (year >= first_year) & from the formula in-process. The only YAML case with a tax year before first_year ("June 30 mover can qualify in 2026 after a 2025 denial") still passes: 2025 = 0, 2026 = 15,000. It passes because the case also enters mt_military_retirement_exemption_eligible: {2025: false}, which zeroes 2025 by itself. Without that entry, a Montana resident with first_year 2026 gets 2025 = 0 at the head and 2025 = 15,000 under the mutant. No case catches this.
  • Executed head behavior is correct: B in diag-output.json (first_year 2026, Montana every year, no annual entry) gives 2024 = 0, 2025 = 0, 2026-2030 = 15,000, 2031 = 0. A (first_year 2024) gives 15,000 for 2024-2028 and 0 for 2029-2030. C (nonresident year 2026 after a claim) gives 15,000 for 2024-2025 and 0 for 2026-2028.
  • Cap: each WMRE-reconciliation case enters a reported amount ≤ mt_other_subtractions, so dropping the min_ would not fail any case. Executed at the head (D3): 20,000 reported against 15,000 of other subtractions gives mt_subtractions 15,000 and tax 2,311.60. That is correct.
  • Remedy: two cases. One for a Montana resident in a year before first_year, with no annual eligibility entry, expecting 0. One with the reported WMRE amount larger than mt_other_subtractions, expecting the modeled exemption alone.
  • Severity: should-address (missing boundary coverage on new branches; the behavior is correct when executed).

A4 — The Schedule E conflict now says PE-US goes against the statute, but the model follows the statute (OPEN)

  • Location: source_conflicts/candidates.yaml, us-mt:military-retirement-exemption-schedule-e-income, pe_us.follows. Commit 2b57731 changed it from statute to conflicting-source.
  • What the record says:
    • The file header defines conflicting-source as "against the statute; the 2026-10-19 rule calls for a model change".
    • The candidate's other reading is the WMRE line 4 instruction. Under it, all of Schedule 1 line 5 (rents, royalties, estates and trusts, Form 4835 farm rent) counts toward the cap.
  • What the model does:
    • PE-US leaves those amounts out. The note itself says "Unclassified rents, royalties, Form 4835 rent and estate income remain outside the estimate".
    • The case "Rents, royalties, farm rent and estate income are not earned income" expects 0, where the line 4 reading gives 15,000.
    • The new rental input adds only nonpassive rental business income, which is the statute-plus-ARM 42.15.1501(2) reading.
  • Expected: follows: statute, as at the approved head.
  • Impact: no change to any computed amount. The conflict register misstates the ruling and signals a model change that is not needed. That would mislead the move of this candidate to the rulespec-us register.
  • Source: MCA 15-30-2120(8)(b); ARM 42.15.1501(2); WMRE instructions, line 4 (PDF p. 3).
  • Proposed severity: SHOULD ADDRESS (misleading source record).

A5 — The axiom line says needed, but the PR is a maintainer's and a parity issue exists (OPEN)

  • Location: PR body, axiom: needed.
  • Rule: CLAUDE.md lines 151-155 (present at both the prior and current heads) reserve needed for "an external contributor [who] cannot complete the Axiom work". Otherwise the line must read <legal id> encoded-correct | <rulespec PR> encoded | <rulespec issue> queued | n/a.
  • Observed:
    • The author is MaxGhenis.
    • TheAxiomFoundation/rulespec-us#2075, "Encode Montana's working military retirement and survivor benefit exemption from 2024 (MCA 15-30-2120(3)(n), (8), (9)) (PE-US #10713)", is OPEN and labelled pe-parity.
    • I found no recorded blocker in its body, which queued requires. It was last updated 2026-11-11, before these commits.
    • Its output 3 frames (9)(b) as "fewer than 5 earlier consecutive years" claimed. The PR now models a window that starts at first eligibility, so the issue does not describe the new eligibility behavior.
  • Expected: axiom: TheAxiomFoundation/rulespec-us#2075 queued, with the blocker recorded in the issue, or a rulespec PR marked encoded. The issue should be updated to cover the (9)(b) window and (9)(c) inputs as now modeled.
  • Impact: parity tracking only, with no change to computed amounts. The line predates these commits and was not raised in rounds 1-2.
  • Source: snapshot CLAUDE.md "Axiom Parity"; gh issue view 2075 -R TheAxiomFoundation/rulespec-us, read-only, fetched during this review.
  • Proposed severity: SHOULD ADDRESS (axiom-line problem).

Suggestions

S1 — No YAML case asserted Montana taxable income or tax for the new exemption (RESOLVED)

  • Fix: the new case "An eligible single filer's Montana taxable income and tax" (mt_military_retirement_exemption.yaml, TY2026) asserts the full chain:
    • mt_military_retirement_exemption = mt_subtractions = 15,000
    • mt_taxable_income_joint = 48,900
    • mt_income_tax = 2,311.60
  • Check: these match the round-2 executed diagnostic: 0.047 × 47,500 + 0.0565 × 1,400 = 2,311.60. The case passes locally.
  • Entry path: I also ran a diagnostic for the new input (diag-output.json, end_to_end_commuter). A commuter with an entry of 0 gets Montana taxable income of 53,900 and tax of 2,594.10. Without the entry, they get 38,900 and 1,828.30. Both match hand arithmetic.

S2 — mt_other_subtractions documentation didn't warn against entering the exemption (RESOLVED)

mt_other_subtractions.py:15 now lists "the military retirement and survivor benefit exemption (Form WMRE)" among the amounts PolicyEngine computes separately. That is the remedy round 2 proposed.

S3 — say what the RIC memo's $24.8 million measures (RESOLVED)

  • mt_military_retirement_exemption_eligible.py:25-31 no longer calls the figures a benchmark for microsimulation totals. It gives 1,711 claimants and $24.8 million (and >1,783 and $25.5 million), says the memo labels them revenue loss, and adds that "At about $14,500 per resident claimant, the amounts suggest that the table may measure income exempted rather than tax".
  • Checked against the memo (PDF p. 1):
    • The table "USE OF EXEMPTION FOR MILITARY PENSION OR RETIREMENT INCOME, 2024" shows 1,711 / $24,754,179 and >1,783 / $25,530,804.
    • The prose: "resulted in a loss of revenue of $25.5 million … 1,711 residents received a reduction of nearly $24.8 million".
    • $24,754,179 / 1,711 = $14,467.67, which supports "about $14,500".
  • Note, not a finding: strictly, the memo calls only the $25.5 million total a revenue loss and the $24.8 million "a reduction". The documentation's caution makes this harmless.

S4 — a reported WMRE amount stays in other subtractions when the exemption is switched off (OPEN)

  • Location: mt_subtractions.py:22-25. The reported amount is removed only if p.military_retirement.in_effect.
  • Trigger (diag2-output.json, E_reform_off): TY2026, single filer, 30,000 of military retirement pay, 50,000 of wages, mt_other_subtractions 15,000, of which 15,000 is reported in mt_military_retirement_exemption_in_other_subtractions. A reform sets military_retirement.in_effect to false for 2026.
  • Observed: exemption 0, mt_subtractions 15,000, mt_income_tax 2,311.60. That is identical to baseline, so the repeal shows no effect for this household.
  • Expected: the input's documentation says "PolicyEngine removes that portion of the manual entry and applies the separately calculated exemption". By that reading, mt_subtractions would be 0 and Montana taxable income 63,900 (hand arithmetic: tax 0.047 × 47,500 + 0.0565 × 16,400 = 3,159.10; not executed).
  • Scope: baseline is unaffected in every claimed year (2024 onward, in_effect is true). Before 2024 the exemption did not exist, so a reported amount there has no meaning. The issue matters only when scoring a reform that turns the exemption off for a household that uses the new reporting input. The input is not in any dataset.
  • Remedy: drop the in_effect condition and keep the "mt_other_subtractions" in p.subtractions check. Alternatively, document that the reported amount is removed only while the exemption is in effect.
  • Severity: suggestion.

S5 — mt_subtractions lost its citation for years before 2024 (OPEN)

  • Location: policyengine_us/variables/gov/states/mt/tax/income/subtractions/mt_subtractions.py:13-16. Commit 8250611 replaced the 2022 MCA 15-30-2110 (Justia) link with the current MCA 15-30-2120 link.
  • Why it matters: the variable computes subtractions from 2010 (subtractions.yaml has 2010, 2017, 2024 and 2025 lists). The pre-2024 lists follow former 15-30-2110, which, per that file's own comment, SB 399 repealed effective tax year 2024.
  • Observed: only the current statute and the 2022 Form 2 are now cited.
  • Expected: keep the 15-30-2110 link next to the new 15-30-2120 link.
  • Impact: documentation only. The 2022 Form 2 still sources the earlier years.
  • Proposed severity: SUGGESTION.

Evidence Gaps

No material gaps reported.

Notes

  • Round 3 covers the two author commits since the 11-30 approval (2b57731 and 8250611) and two merges of main. This review replaces that approval.
  • The new eligibility behavior matches the sources:
    • the five-consecutive-year window starting at first eligibility (MCA 15-30-2120(9)(b); WMRE p. 2; Form 2 p. 25);
    • loss of eligibility after moving away ((9)(c) and the WMRE Mary example);
    • taxable dependent care benefits in the wage cap (WMRE line 2);
    • passive Schedule C income left out, and nonpassive Montana rental income allowed (ARM 42.15.1501(2));
    • uncapped survivor benefits ((8)(a) and the Jim example);
    • netting a negative stream against the other, which matches irs_gross_income's per-person floor.
  • Executed at the head, all matching hand arithmetic: a first year of 2024 gives $15,000 for 2024–2028 and $0 after; a first year of 2026 gives $0 for 2024–2025 and $15,000 for 2026–2030. With $15,000 of WMRE saved inside mt_other_subtractions and reported through the new input, the result is $15,000 of subtractions and tax of $2,311.60 (unreported, it double counts to $30,000 and $1,593.30).
  • code-1 is the cause of the red checks: test_no_in_place_writes_to_cached_arrays flags mt_subtractions.py:30. Under a reform with a one-variable subtraction list, it corrupts the cached mt_other_subtractions (15,000 reads back as 10,000). Baseline results are unaffected. The fix is one line: total_subtractions = total_subtractions - ….
  • Both merges of main are clean, and candidates.yaml carries exactly the PR's change set relative to main. No main entry was lost.
  • Not audited: rulespec-us#2075's required outputs and companion tests, beyond the axiom line and its (9)(b) framing.

Validation Summary

Local tests at the reviewed head (review venv, policyengine-core 3.37.2, matching uv.lock; imports resolved to the snapshot), split into two bounded runs for the deadline: the Montana income tax YAML tree passed, and the Python run reproduced CI's single failure (test_no_in_place_writes_to_cached_arrays, naming mt_subtractions.py:30), with the other 255 tests passing, including test_mt_military_retirement_exemption_cache.py and test_source_conflicts.py. Diagnostics executed the window, nonresident, reconciliation, joint-window and reform households, and an in-process mutation of the window's lower bound. Sources: MCA 15-30-2120, ARM 42.15.1501 and 42.15.1510, the 2025 Form WMRE and Form 2 instructions, and 2025 Mont. Laws ch. 586; manifest check passed. CI at 8d9f794: 34 checks pass, 2 fail (Python Rest shard 2 and its gate; see code-1).

Timing

setup seconds: 4.00s; scope seconds: 60.00s; parallel review seconds: 980.80s; policy role seconds: 579.80s; code role seconds: 980.80s; adjudication seconds: 180.00s; consolidation cleanup seconds: 193.80s; elapsed seconds: 1423.00s

Review Severity

COMMENT. Open findings: 0 critical, 4 should address, 2 suggestions.

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.

2 participants