Skip to content

Apply ordered aggregate capping to state nonrefundable credits#7984

Draft
PavelMakarchuk wants to merge 2 commits intomainfrom
audit/state-nonrefundable-credit-order
Draft

Apply ordered aggregate capping to state nonrefundable credits#7984
PavelMakarchuk wants to merge 2 commits intomainfrom
audit/state-nonrefundable-credit-order

Conversation

@PavelMakarchuk
Copy link
Copy Markdown
Collaborator

@PavelMakarchuk PavelMakarchuk commented Apr 12, 2026

Summary

  • apply ordered capping to state nonrefundable credit aggregates at the tax-application layer
  • add a shared helper for ordered aggregate state nonrefundable credit application
  • align state nonrefundable credit ordering metadata where the current form order was mismatched
  • fix review issues by limiting New York geothermal credit ordering to 2022+ and moving Ohio onto the ordered aggregate path

Scope

This PR does not implement the full federal-style potential and actual/applied nonrefundable credit pattern for each individual state credit.

Instead, it changes how the aggregate nonrefundable credit bucket is applied against pre-credit tax liability in the states covered here. Raw state credit variables remain their underlying potential amounts.

That means this PR is a tax-application-layer cleanup, not the final per-credit redesign.

Follow-up Needed

A follow-up refactor should add federal-style per-credit applied variables so each state nonrefundable credit can expose:

  • a potential amount
  • an actual taken amount capped by pre-credit tax minus earlier credits on the form

That is the step needed to return true form-order credit values.

Testing

  • uv run ruff check policyengine_us/variables/gov/states/tax/income/non_refundable_credit_cap.py policyengine_us/variables/gov/states/ar/tax/income/ar_non_refundable_credits.py policyengine_us/variables/gov/states/az/tax/income/az_non_refundable_credits.py policyengine_us/variables/gov/states/ct/tax/income/ct_non_refundable_credits.py policyengine_us/variables/gov/states/dc/tax/income/credits/dc_non_refundable_credits.py policyengine_us/variables/gov/states/de/tax/income/de_non_refundable_credits.py policyengine_us/variables/gov/states/ga/tax/income/ga_non_refundable_credits.py policyengine_us/variables/gov/states/hi/tax/income/hi_non_refundable_credits.py policyengine_us/variables/gov/states/id/tax/income/id_non_refundable_credits.py policyengine_us/variables/gov/states/ky/tax/income/credits/ky_non_refundable_credits.py policyengine_us/variables/gov/states/la/tax/income/la_non_refundable_credits.py policyengine_us/variables/gov/states/ma/tax/income/ma_non_refundable_credits.py policyengine_us/variables/gov/states/md/tax/income/credits/md_non_refundable_credits.py policyengine_us/variables/gov/states/me/tax/income/me_non_refundable_credits.py policyengine_us/variables/gov/states/mo/tax/income/credits/mo_non_refundable_credits.py policyengine_us/variables/gov/states/ms/tax/income/ms_non_refundable_credits.py policyengine_us/variables/gov/states/nc/tax/income/nc_non_refundable_credits.py policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py policyengine_us/variables/gov/states/oh/tax/income/oh_non_refundable_credits.py policyengine_us/variables/gov/states/ri/tax/income/ri_non_refundable_credits.py policyengine_us/variables/gov/states/sc/tax/income/sc_non_refundable_credits.py policyengine_us/variables/gov/states/ut/tax/income/credits/ut_non_refundable_credits.py policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py policyengine_us/variables/gov/states/wi/tax/income/credits/wi_non_refundable_credits.py policyengine_us/variables/gov/states/wv/tax/income/wv_non_refundable_credits.py
  • uv run ruff format --check policyengine_us/variables/gov/states/tax/income/non_refundable_credit_cap.py policyengine_us/variables/gov/states/ar/tax/income/ar_non_refundable_credits.py policyengine_us/variables/gov/states/az/tax/income/az_non_refundable_credits.py policyengine_us/variables/gov/states/ct/tax/income/ct_non_refundable_credits.py policyengine_us/variables/gov/states/dc/tax/income/credits/dc_non_refundable_credits.py policyengine_us/variables/gov/states/de/tax/income/de_non_refundable_credits.py policyengine_us/variables/gov/states/ga/tax/income/ga_non_refundable_credits.py policyengine_us/variables/gov/states/hi/tax/income/hi_non_refundable_credits.py policyengine_us/variables/gov/states/id/tax/income/id_non_refundable_credits.py policyengine_us/variables/gov/states/ky/tax/income/credits/ky_non_refundable_credits.py policyengine_us/variables/gov/states/la/tax/income/la_non_refundable_credits.py policyengine_us/variables/gov/states/ma/tax/income/ma_non_refundable_credits.py policyengine_us/variables/gov/states/md/tax/income/credits/md_non_refundable_credits.py policyengine_us/variables/gov/states/me/tax/income/me_non_refundable_credits.py policyengine_us/variables/gov/states/mo/tax/income/credits/mo_non_refundable_credits.py policyengine_us/variables/gov/states/ms/tax/income/ms_non_refundable_credits.py policyengine_us/variables/gov/states/nc/tax/income/nc_non_refundable_credits.py policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py policyengine_us/variables/gov/states/oh/tax/income/oh_non_refundable_credits.py policyengine_us/variables/gov/states/ri/tax/income/ri_non_refundable_credits.py policyengine_us/variables/gov/states/sc/tax/income/sc_non_refundable_credits.py policyengine_us/variables/gov/states/ut/tax/income/credits/ut_non_refundable_credits.py policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py policyengine_us/variables/gov/states/wi/tax/income/credits/wi_non_refundable_credits.py policyengine_us/variables/gov/states/wv/tax/income/wv_non_refundable_credits.py
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/az/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ct/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/il/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ky/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ar/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ga/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/md/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ny/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/oh/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/wi/tax/income --batches 1
  • python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/wv/tax/income --batches 1

@PavelMakarchuk PavelMakarchuk changed the title Cap state nonrefundable credits in filing order Apply ordered aggregate capping to state nonrefundable credits Apr 12, 2026
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.

1 participant