Repository navigation
Let Utah military retirees claim the military retirement credit when no retirement credit applies - #10702
Let Utah military retirees claim the military retirement credit when no retirement credit applies#10702MaxGhenis wants to merge 6 commits into
Conversation
…no retirement credit applies ut_claims_retirement_credit returned True whenever the retirement credit (59-10-1019) was at least the Social Security benefits credit (59-10-1042), including when both were zero. Because ut_military_retirement_credit_eligible requires ~ut_claims_retirement_credit, every military retiree born after 1952 without a Social Security credit lost the military retirement credit (59-10-1043): a 45-year-old with $30,000 of military retired pay paid $1,350 too much Utah tax in 2025. 59-10-1019(3)(b) bars the retirement credit when a 1042 or 1043 credit is claimed, and 1042(3)(b) and 1043(3)(b) bar those credits only alongside 1019, so a filer chooses between the retirement credit alone and the other two together. The choice now compares the retirement credit with the sum of the Social Security and military retirement credits, and a retirement credit worth nothing is never claimed. A new ut_military_retirement_credit_max holds the unconditional amount so the comparison has no cycle. The credit rate is zero before 2021, when 59-10-1043 took effect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59-10-1043(2)(a) sets the credit at the percentage listed in 59-10-104(2). The separate military_retirement/rate parameter copied that rate through 2025 but not the 4.45% rate for 2026, so the 2026 credit used 4.5%. The credit now reads gov.states.ut.tax.income.rate, as the Social Security benefits credit already does, gated by a new in_effect parameter that starts in 2021. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry retirement credit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ice-date inputs, and run on 2.105.1 plus the Utah and Montana fixes The 45-year-old served 2001 to 2020 and the 67-year-old 1977 to 1996. In the military scenario the script sets retired_from_federal_government and Kentucky's months of service before 1998, and Oregon's subtraction for the share of service before October 1, 1991. The outputs come from a local PolicyEngine-US checkout (bfeef52eb9): 2.105.1 plus PolicyEngine/policyengine-us#10702 and #10713. The README documents the households, data coverage and limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
David, can you check how the PR picks between Utah's retirement credits? Utah lets a filer claim either the retirement credit or the Social Security and military retirement credits together (59-10-1019(3)(b)). The PR picks the retirement credit when it's positive and at least the other two combined. It also reads the military credit's rate off the income tax rate, 4.45% in 2026 under SB 60, so I'd like your eye on that too. If you can look by Tuesday afternoon, we can merge it before the Veterans Day post (PolicyEngine/policyengine-app-v2#1523). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10702 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 3 +2
Lines 37 38 +1
=========================================
+ Hits 37 38 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR Review: Let Utah military retirees claim the military retirement credit when no retirement credit appliesSummaryThe PR fixes three real problems with Utah's military retirement credit (Utah Code 59-10-1043):
The new election claims the retirement credit only when it is positive and at least the Social Security and military credits combined. That matches 59-10-1019(3)(b), 59-10-1042(3)(b) and 59-10-1043(3)(b), and the TC-40 instructions for 2021 through 2025. Every TY2024–2026 household I traced comes out right. One critical problem remains in TY2021–2023, years the PR claims ( Critical1. TY2021–2023: the election picks the military credit, which is never applied, so the PR raises tax for older military retirees. File:
Should address1. Reference rule: one source is cited twice.
Suggestions
Verified correct
Hand checks
Axiom line assessment
CI status
Branch status
Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
Requesting changes per the review above: 1 critical (for 2021-2023 the new election drops the retirement credit, but the military retirement credit isn't in the non-refundable list until 2024, so those filers pay more than on main and than the law requires), 1 should (duplicate same-document reference), 4 suggestions. 2024-2026 results are correct.
…irement-credit-choice
…erans with TRICARE - The post leads with how many states exempt military retired pay, adds a table of the 13 states' rules, and lists the credits the retired couple loses. - The runs set is_veteran for the retiree (PolicyEngine-US infers it from VA payments, which these couples lack) and TRICARE coverage for both spouses, so no household claims the premium tax credit. - Results come from PolicyEngine-US main (3386304d28) plus the open Utah and Montana fixes (PolicyEngine/policyengine-us#10702, #10713); they stay preliminary until those merge. - render_post.py fails when a run moves a state into or out of the sets the prose names. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2021 S.B. 11, Section 4, gives the credit retrospective operation for taxable years beginning on or after January 1, 2021, and the 2021-2023 TC-40 instructions list it among the line 24 nonrefundable credits. The 2021 and 2022 nonrefundable lists omitted it, so the election that now weighs the military credit dropped the retirement credit without applying the military one. Add it to both lists, with TC-40-line household cases for 2021, 2022 and 2023. Also cite S.B. 11 for the 2021 start, cite the 2025 instructions once in ut_claims_retirement_credit, add a removed fragment for the deleted rate parameter, and document the active-duty survivor limitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Critical 1: I added Should 1: Suggestions: |
DTrim99
left a comment
There was a problem hiding this comment.
Program review
Base repository: PolicyEngine/policyengine-us
PR number: 10702
Reviewed head SHA: 6bd30a7
Merge base SHA: 3386304
Mode: full, with a recheck of David's earlier review (head a3bf81b)
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10702-review-sources.json
Review status: COMPLETE
Source Documents
- C59-10-S1043_2022032320220323.html — cached original.
- C59-10-S1019_2022032320220323.html — cached original.
- C59-10-S1042_2026010120250507.html — cached original.
- C59-10-S1036_2021050520210505.html — cached original.
- s1043.html — cached original.
- s1019.html — cached original.
- s1042.html — cached original.
- s1036.html — cached original.
- sb11-2021.htm — cached original.
- sb48-2022.htm — cached original.
- sb60-2026.pdf — cached original.
- tc40inst-2021.pdf — cached original.
- tc40inst-2022.pdf — cached original.
- tc40inst-2023.pdf — cached original.
- tc40inst-2024.pdf — cached original.
- tc40inst-2025.pdf — cached original.
- mil-ret-page.html — cached original.
Critical
None.
Should Address
None.
Suggestions
S1 — Dependents born in 1952 or earlier inflate the retirement credit, which can now win the election over the military credit (predates this PR) (OPEN)
- Severity: suggestion. The defect is real but out of the PR's scope, and no household is worse off at head than on main. Recommend a follow-up issue.
- File:
policyengine_us/variables/gov/states/ut/tax/income/credits/retirement_credit/ut_retirement_credit_max.py:20-23.tax_unit.sum(meets_age_conditions)counts every tax-unit member, dependents included.ut_claims_retirement_credit.py:29-38, changed in this PR, compares that amount with the military credit. - Trigger (executed at head): 2025, Utah. Filer aged 50 with $4,000 military retired pay and $36,000 wages. Dependent parent aged 80 (
is_tax_unit_dependent: true) with no income. - Observed:
ut_retirement_credit_max250,ut_military_retirement_credit_max180,ut_claims_retirement_credittrue, retirement credit 250, military credit 0,ut_income_tax170.68. - Expected:
- The dependent is not a claimant, so the retirement credit is 0.
- The military credit is 180, so
ut_income_taxis 420.68 − 180 = 240.68. The model over-credits by $70. - The same filer without the dependent gets the military credit of 180, which is correct.
- A lower-income variant ($25,000 wages, $8,000 military pay) also flips the election, with no dollar effect: liability is 14.68.
- Why it predates the PR: on main the election compared the retirement credit with the Social Security credit alone (250 ≥ 0). Main therefore also claims the $250 retirement credit and blocks the military credit, giving the same tax by code trace (main not executed). The PR does not worsen any case: whenever the head claims the retirement credit, main also did.
- Source:
- 59-10-1019(1)(a): "Eligible claimant" means "a claimant ... who was born on or before December 31, 1952".
- 59-10-1019(2): "each eligible claimant may claim a nonrefundable tax credit of $450".
- 2025 TC-40 instructions, code 18, https://files.tax.utah.gov/tax/forms/2025/tc-40inst.pdf#page=21: "If only you or only your spouse is taking this credit, enter 450. If both you and your spouse are taking this credit, enter 900."
- Evidence:
/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10702-policy-diag/diag-b.log(with diag-b.json and diag10702b.py), and the lower-income variant indiag.log. - Remedy (untested): count only the head and spouse in
ut_retirement_credit_max, for example withis_tax_unit_head_or_spouse.
S2 — ut_claims_retirement_credit is a boolean but declares unit = USD (OPEN)
- Severity: SUGGESTION (metadata only, no output effect; this line was already on main)
- Location:
policyengine_us/variables/gov/states/ut/tax/income/credits/retirement_credit/ut_claims_retirement_credit.py:8 - Trigger: any metadata or API consumer that reads the variable's unit, in any year.
- Expected vs observed: a
value_type = boolelection flag should have no currency unit. Observed:unit = USD. It was already there at the merge base, and the PR rewrites thedocumentationandreferencelines right next to it. - Evidence: read from the code (
git show 3386304d:…/ut_claims_retirement_credit.py, line 8). Optional fix: delete the line while the file is already being edited.
No defects found in correctness, entity, period or vectorization, or in hard-coded values. Details are in the validation notes below.
Evidence Gaps
No material gaps reported.
Notes
- Earlier review: every item is resolved.
- Critical 1 (the 2021-2023 credit never applied, so the election raised tax):
non_refundable.yamlnow listsut_military_retirement_creditin its 2021 and 2022 entries, the 2022 entry covering 2023. Newut_income_taxcases for 2021, 2022 and 2023 re-derive by hand: 2021 tax 0; 2022 3,576.752 - 1,455 = 2,121.752; 2023 tax 0, where the earlier probe gave 625.35. Removing either list entry fails its case. - Should-address 1 (the 2025 instructions cited twice): now one href,
#page=21, under a "PDF pages 21, 23" comment. - Suggestions 1-4: the S.B. 11 citation, the
.removed.mdfragment, the active-duty survivor limitation and the PR body are all done. - The election matches Utah law for 2021-2026. 59-10-1019(3)(b) bars the retirement credit when a 1042 or 1043 credit is claimed, and 1042(3)(b) and 1043(3)(b) bar each of those when a 1019 credit is claimed. 2022 S.B. 48 Section 8 makes these bars apply from 2021. The amount is the 59-10-104(2) rate times military retirement pay in AGI, which matches each year's worksheet: .0495, .0485, .0465, .0455, .045, and 4.45% for 2026 under 2026 S.B. 60.
- The branch is 473 commits behind main, but it merges cleanly, and main changed none of its 13 files. On the merged tree the Utah suite (159) and the military-retirement, dependent-retirement and source-conflict guards all pass.
Validation Summary
Local tests at the reviewed head pass (the changed tests plus the Utah credit directory; review venv, imports from the snapshot). On a merged-with-main tree the Utah suite passes (159). Sources: 17 originals (Utah Code 59-10-1019/1042/1043/104, S.B. 11, S.B. 48, 2026 S.B. 60, TC-40 instructions for 2021-2025), checksums validated. CI on the head: 37 checks succeeded.
Timing
policy role seconds: 481.00s; code role seconds: 660.00s; parallel review seconds: 660.00s; elapsed seconds: 760.00s
Review Severity
APPROVE. Open findings: 0 critical, 0 should address, 2 suggestions.
What was wrong
ut_claims_retirement_creditweighed the retirement credit (Utah Code 59-10-1019) against the Social Security benefits credit (59-10-1042) alone, and returnedTruewhenever the retirement credit was at least that amount.ut_military_retirement_credit_eligiblerequires~ut_claims_retirement_credit, so main blocked the military retirement credit (59-10-1043) in two cases:Existing military-credit tests passed because they set
ut_claims_retirement_creditas an input.The nonrefundable credit list carried
ut_military_retirement_creditonly from 2024. The credit applies from TY2021, so for 2021 through 2023 it never reduced Utah tax.The credit had its own rate parameter,
military_retirement/rate.yaml, which copied the income tax rate through 2025 and stopped there, so PolicyEngine-US applied 2025's 4.5% in 2026. 59-10-1043(2)(a) uses "the percentage listed in Subsection 59-10-104(2)", which SB 60 (2026) sets at 4.45%.That parameter's first value (2021) also extended backward, so PolicyEngine-US computed the credit for 2020 and earlier. The 2020 TC-40 instructions have no military retirement credit; the 2021 instructions introduce it (code AJ, at 4.95%).
The law
Change
ut_military_retirement_credit_max: the 59-10-1043(2) amount,gov.states.ut.tax.income.ratetimes the filer's and spouse's military retirement income. Only the newin_effectparameter gates it, so the election can read it without a cycle.ut_military_retirement_credit_potentialnow adds it under the existing eligibility gate.ut_claims_retirement_credit=retirement_credit_max > 0andretirement_credit_max >= ss_benefits_credit_max + military_retirement_credit_max. A positive retirement credit still wins ties.non_refundable.yamladdsut_military_retirement_creditto the 2021 and 2022 lists (the 2022 list covers 2023). Its position changes only how the model attributes credits, because the liability cap applies to the total.military_retirement/rate.yaml; the newmilitary_retirement/in_effect.yamlreads false before 2021 and true from 2021, and cites S.B. 11 Section 4. Aremovedchangelog fragment names the deleted path and its replacement,gov.states.ut.tax.income.rate; the two held the same values for 2021 through 2025.ut_claims_retirement_creditcites the 2025 instructions once, with a# PDF pages 21, 23comment.Readings taken
ut_military_retirement_credit_max: the instructions (2021 page 22, 2025 page 23) send a survivor of a member who died on active duty or in training to the military survivor benefits credit (59-10-1036, code AA) instead of code AJ. No input separates those survivors, so their benefits count toward this credit. Both credits apply the 59-10-104(2) percentage, but 59-10-1036 carries no bar against the retirement credit.These are model choices, not conflicts between sources, so the source-conflict register needs no entry.
Invariants (for every input)
The YAML tests cover each boundary. I added no Hypothesis test, following this repo's YAML-first test policy.
Tests
ut_claims_retirement_credit.yaml: test 4 (0 vs 0) now expectsfalse; three new cases weigh the military credit (alone, combined with the Social Security credit, and outweighed by the retirement credit).ut_military_retirement_credit_max.yaml: the TY2025 amount (1,350), survivor benefits (450), no credit in 2020, and the TY2026 amount at 4.45% (1,335).ut_military_retirement_credit.yaml: two integration cases with nout_claims_retirement_creditinput (a 45-year-old gets the credit; a 76-year-old with $4,000 of military pay takes the $450 retirement credit instead).ut_non_refundable_credits.yaml: three cases worked from the TC-40 lines for their year. A single 75-year-old with $30,000 of military pay owes $0 in 2021 and 2023, because the military credit (1,485 and 1,395) exceeds the tax (823.77 and 625.35). A 2022 working couple takes the full 1,455 against 3,576.75 of tax.tests/core/test_dependent_retirement_income_state_invariants.py: its Utah comment now describes the new election; its 4 cases pass unchanged.tests/policy/baseline/gov/states/utpass, andtests/code_health/test_military_retirement_readers.py,tests/code_health/test_source_conflicts.pyand the invariants file pass (111 tests).Before and after
Utah income tax from real runs of
ut_income_tax, main at 3386304 against this branch:On this branch the single filer's military credit (1,485 in 2021, falling to 1,335 in 2026) exceeds the tax every year, so tax is 0, as the law gives. The couple's credit comes off in full: 1,485, 1,455, 1,395, 1,365, 1,350 and, in 2026, 1,335 (4.45% of $30,000). Two 2026 households owe the same on both versions. With a $30,000 private pension in place of the military pay, the working couple owes 2,758.73. A retired couple, ages 67 and 65, with $45,000 of military retired pay and $30,000 of Social Security owes 0: its $872.20 Social Security credit already beat its $0 retirement credit on main, so it claimed the military credit there too, and the two credits absorb its $1,100.23 liability.
axiom: us-ut/statute/59-10-1043 queued (TheAxiomFoundation/rulespec-us#2074)
🤖 Generated with Claude Code