Skip to content

Fix miscellaneous accuracy issues (CA AMT, AZ PTC, LA FITAP, NV TANF)#8925

Merged
MaxGhenis merged 4 commits into
PolicyEngine:mainfrom
MaxGhenis:codex/misc-accuracy
Jul 6, 2026
Merged

Fix miscellaneous accuracy issues (CA AMT, AZ PTC, LA FITAP, NV TANF)#8925
MaxGhenis merged 4 commits into
PolicyEngine:mainfrom
MaxGhenis:codex/misc-accuracy

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Fixes four miscellaneous accuracy issues where PolicyEngine-US computed a wrong answer for law that is already encoded. Each fix changes code only where current behavior contradicted a primary source read directly, with page-anchored citations in parameter/variable metadata and YAML tests (including each issue's reported household).

Local tests (worktree venv, policyengine-core test ... -c policyengine_us): CA income tree 151 passed, AZ credits tree 92 passed, LA dcfs tree 34 passed, NV dwss tree 182 passed. No regressions.

California AMT — Fixes #8742

ca_pre_exemption_amti added the full ca_itemized_deductions_pre_limitation on top of ca_taxable_income + ca_amti_adjustments. This double-counted AMT-disallowed itemized deductions (property taxes are added back once in ca_amti_adjustments and again inside the full itemized deductions) and incorrectly added back deductions AMT still allows (charity, acquisition mortgage interest). The result: increasing property taxes inflated CA AMTI and pushed up CA ordinary tax under the AMT floor.

Per Schedule P (540) Part I (2024 form, verified line-by-line): AMTI (line 19/21) = regular taxable income (line 15) + total adjustments and preferences (line 14) − restored itemized deductions limitation (line 18). For an itemizer, line 1 contributes nothing (the form says "go to line 2"), and lines 2–5 add back only the specific disallowed items — never the full itemized deductions.

  • Removed the erroneous full-deduction add from ca_pre_exemption_amti.
  • Added ca_itemized_deductions_limitation (Schedule P line 18 = pre-limitation − post-limitation itemized deductions) and subtracted it.
  • On the issue's reproduction household, AMTI is now flat at $199,500 (= AGI) regardless of property tax, and CA tax caps at the AMT floor instead of rising. The high-AGI limitation-restoration path is verified against a hand computation (AGI − pre-limitation itemized + AMT adjustments).

Source: 2024 Schedule P (540) and 2024 Schedule P (540) instructions.

Arizona property tax credit — Fixes #8897

ARS 43-1072(A)(3)(b) applies the higher Table 2 (B)(2) credit schedule to any claimant who "lived with a spouse or one or more persons"; (A)(3)(a) applies Table 1 (B)(1) only to a claimant who "did not live with a spouse or any other persons." The prior logic keyed only off cohabitating_spouses | tax_unit_married, so a single or head-of-household claimant living with a non-spouse (adult child, sibling, roommate) was understated on Table 1 (e.g. $78 vs $323 at ~$3,638 income).

  • Broadened the Table 2 condition to also trigger when the claimant's household has more than one person, while retaining the existing spouse/marriage signals (keeps Fix AZ property tax credit table selection for married couples #8874 and all prior tests intact).
  • Regression tests: single claimant living with an adult child → Table 2 ($323); same claimant living alone → Table 1 ($78).

Note (not implemented, out of scope): ARS 43-1072 subsection G limits the credit to "only one claimant per household per year." PolicyEngine's per-tax-unit snapshot does not enforce that mutual exclusion across tax units in a shared household; this is a separate modeling question the issue did not raise.

Source: ARS 43-1072.

Louisiana FITAP — Fixes #8770

DCFS Economic Stability Manual B-641-1-FITAP: "the deficit rounded down, if $10 or more, is the grant amount. If deficit is less than $10, the assistance unit is FITAP eligible but no grant is paid." la_fitap previously returned the unrounded deficit with no minimum-payment floor.

  • Round the deficit down to a whole dollar and suppress payments below the new gov.states.la.dcfs.fitap.minimum_payment parameter ($10). Eligibility (la_fitap_eligible) is unchanged; only the paid grant is suppressed.
  • Matches the issue's examples: $244 grant − $235.50 income → $0; $484 grant − $450.75 income → $33. Boundary tests at exactly $10 and $9.99 added.

Source: Louisiana DCFS Manual B-640/B-641-1-FITAP (effective 2023-01-01); LAC 67:III.1229.

Nevada TANF — Fixes #8771

Nevada Eligibility and Payments Manual A-660.12: "A benefit is always a whole dollar amount. Round all amounts down to the nearest dollar. The minimum benefit amount is $10. Benefits of less than $10 are issued only for supplemental payments [or] payments made after an overpayment recoupment." nv_tanf previously returned the unrounded deficit with no minimum-issuance floor.

  • Round the benefit down to a whole dollar and suppress regular benefits below the new gov.states.nv.dwss.tanf.minimum_payment parameter ($10). Boundary tests added.

Employment Retention Payment — deliberately not implemented (feature, not a wrong-answer bug). A-660.12 also provides a $50/month, six-month ERP to households terminating for excess income with at least $1 of earned income. This is a distinct transitional benefit paid to households that are no longer TANF-eligible, and modeling it requires prior-eligibility and month-since-termination state that PolicyEngine's static monthly snapshot does not represent. It should be added as a new program rather than folded into nv_tanf. Flagging for a separate feature issue; the rest of #8771 (rounding + minimum issuance) is fixed here.

Source: NV DWSS E&P Manual, Chapter A-600 Budgeting, A-660.12.

🤖 Generated with Claude Code

MaxGhenis and others added 4 commits July 6, 2026 09:02
…#8742)

ca_pre_exemption_amti added the full ca_itemized_deductions_pre_limitation
on top of ca_taxable_income + ca_amti_adjustments, double-counting property
taxes (once in ca_amti_adjustments, once in the full itemized deductions)
and incorrectly adding back AMT-allowed deductions like charity and
acquisition mortgage interest. This made CA AMTI (and thus CA ordinary tax
under the AMT floor) rise with property taxes.

Per Schedule P (540) Part I, AMTI (line 19/21) = regular taxable income
(line 15) + total adjustments and preferences (line 14) - restored itemized
deductions limitation (line 18). Removed the erroneous full-deduction add
and added ca_itemized_deductions_limitation (line 18 = pre - post limitation)
as a subtraction. Added YAML tests including the issue's reported household.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…PolicyEngine#8897)

ARS 43-1072(A)(3)(b) applies the higher Table 2 (B)(2) credit schedule to any
claimant who "lived with a spouse or one or more persons," while (A)(3)(a)
applies Table 1 (B)(1) only to a claimant who "did not live with a spouse or
any other persons." The previous logic keyed only off cohabitating_spouses
and tax_unit_married, so a single or head-of-household claimant living with a
non-spouse (adult child, sibling, roommate) was understated on Table 1.

Broadened the Table 2 condition to also trigger when the claimant's household
has more than one person. Added regression tests for a single claimant living
with an adult child (Table 2, $323) versus living alone (Table 1, $78).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cyEngine#8770)

Louisiana DCFS manual B-641-1-FITAP: "the deficit rounded down, if $10 or
more, is the grant amount. If deficit is less than $10, the assistance unit
is FITAP eligible but no grant is paid." The formula previously returned the
unrounded deficit with no minimum-payment floor.

Round the deficit down to a whole dollar and suppress payments below the new
la.dcfs.fitap.minimum_payment parameter ($10). Eligibility (la_fitap_eligible)
is unchanged; only the paid grant is suppressed. Added tests for the issue's
reported households and the $10 boundary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…PolicyEngine#8771)

Nevada E&P Manual A-660.12: "A benefit is always a whole dollar amount.
Round all amounts down to the nearest dollar. The minimum benefit amount is
$10. Benefits of less than $10 are issued only for supplemental payments [or]
payments made after an overpayment recoupment." The nv_tanf formula
previously returned the unrounded deficit with no minimum-issuance floor.

Round the benefit down to a whole dollar and suppress regular benefits below
the new nv.dwss.tanf.minimum_payment parameter ($10). Added A-660.12 boundary
tests.

The A-660.12 Employment Retention Payment ($50/month for six months to
households terminating for excess income with at least $1 of earned income)
is out of scope here: it is a distinct six-month transitional benefit paid to
households that are no longer TANF-eligible, requiring prior-eligibility and
month-since-termination state that PolicyEngine's static monthly snapshot
does not represent. It should be modeled as a new program, not folded into
nv_tanf.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Lead review: all four fixes verified against their primary sources; the Schedule P algebra reproduces exactly (regular TI + disallowed items − restored limitation = AGI − pre-limitation deductions + disallowed items), and the hand-computed line-18 case (350,867.81 + 10,000 − 8,867.82 = 352,000) checks out.

Statewide impact of the CA AMT correction (2026, certified default data): $1.90B → $0.34B (−$1.56B/yr). The old figure was inflated by double-adding every itemizer's full pre-limitation deductions; the corrected estimate sits below FTB's ~$1–1.5B actuals as expected, since CPS-based data underrepresents the concentrated preference items (ISOs, private-activity bond interest) that drive real-world AMT.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f9e58e7) to head (792e4f3).
⚠️ Report is 146 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8925   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         5    +2     
  Lines           55        75   +20     
=========================================
+ Hits            55        75   +20     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MaxGhenis MaxGhenis marked this pull request as ready for review July 6, 2026 13:49
@MaxGhenis MaxGhenis merged commit d11f711 into PolicyEngine:main Jul 6, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment