Harden state nonrefundable credit guardrails#7992
Merged
PavelMakarchuk merged 3 commits intoPolicyEngine:mainfrom Apr 14, 2026
Merged
Harden state nonrefundable credit guardrails#7992PavelMakarchuk merged 3 commits intoPolicyEngine:mainfrom
PavelMakarchuk merged 3 commits intoPolicyEngine:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7992 +/- ##
===========================================
- Coverage 100.00% 96.00% -4.00%
===========================================
Files 4 1 -3
Lines 72 25 -47
Branches 0 3 +3
===========================================
- Hits 72 24 -48
- Partials 0 1 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PavelMakarchuk
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
*_potentialvs applied-credit convention for ordered state nonrefundable creditsWhy
PR #7984 split several state credits into potential and applied forms. The Maryland refundable CDCC regression showed that downstream formulas can silently read the applied amount when a form or worksheet really refers to the pre-ordering amount. This PR makes that distinction explicit and adds tests around the specific bug class.
Impact
This does not change any state credit amounts directly. It hardens the shared helper semantics and adds regression coverage so future split-credit refactors are less likely to reintroduce Maryland-style downstream-consumer bugs.
Validation
pytest policyengine_us/tests/core/test_non_refundable_credit_cap.py policyengine_us/tests/code_health/test_non_refundable_credit_downstream_consumers.py -qpython -m policyengine_core.scripts.policyengine_command test -c policyengine_us policyengine_us/tests/policy/baseline/gov/states/md/tax/income/credits/md_refundable_cdcc.yaml policyengine_us/tests/policy/baseline/gov/states/de/tax/income/credits/eitc/de_eitc.yaml policyengine_us/tests/policy/baseline/gov/states/de/tax/income/credits/eitc/refundability_calculation/de_income_tax_if_claiming_non_refundable_eitc.yaml policyengine_us/tests/policy/baseline/gov/states/ky/tax/income/credits/family_size_tax_credit/ky_family_size_tax_credit.yaml policyengine_us/tests/policy/baseline/gov/states/la/tax/income/credits/child_care_expense_credit/la_school_readiness_tax_credit.yaml policyengine_us/tests/policy/baseline/gov/states/ny/tax/income/credits/ny_eitc.yaml policyengine_us/tests/policy/baseline/gov/states/va/tax/income/credits/eitc/va_eitc.yaml policyengine_us/tests/policy/baseline/gov/states/va/tax/income/credits/eitc/va_eitc_person.yaml policyengine_us/tests/policy/baseline/gov/states/va/tax/income/credits/eitc/refundability_calculation/va_income_tax_if_claiming_non-refundable_eitc.yamlCloses #7991.