Skip to content

Conversation

@policyengine
Copy link

@policyengine policyengine bot commented Dec 15, 2025

Summary

Fixes #6989 - The Arizona Family Tax Credit eligibility was using the wrong income measure. Per ARS 43-1073, the income threshold should be "Arizona adjusted gross income, plus the amount subtracted for exemptions under section 43-1023".

Changes

  1. Updated az_family_tax_credit_eligible.py:

    • Changed from using only az_agi to using az_agi + az_exemptions
    • Added reference to ARS 43-1073 in variable metadata
    • Added code comment explaining the regulatory requirement
  2. Updated test file (az_family_tax_credit_eligible.yaml):

    • Added explicit az_exemptions: 0 to all existing test cases for clarity
    • Added two new test cases demonstrating the exemptions effect:
      • Eligible case: AGI $19,900 + exemptions $2,100 = $22,000 (under limit)
      • Ineligible case: AGI $23,000 + exemptions $2,100 = $25,100 (over limit)
  3. Added changelog entry documenting the fix

Impact

This fix ensures the Family Tax Credit eligibility determination correctly follows Arizona law. The previous implementation understated income by not adding back exemptions, potentially making people eligible who shouldn't be according to statute.

Test Plan

  • All existing tests updated to explicitly set exemptions
  • New tests verify exemptions are properly included in income calculation
  • CI will run full Arizona test suite

🤖 Generated with Claude Code

Per ARS 43-1073, the income threshold for Family Tax Credit eligibility
should be "Arizona adjusted gross income, plus the amount subtracted for
exemptions under section 43-1023". This fixes the implementation to add
exemptions back to az_agi.

Changes:
- Updated az_family_tax_credit_eligible.py to use az_agi + az_exemptions
- Added reference to ARS 43-1073 in variable metadata
- Updated all test cases to explicitly set az_exemptions
- Added new test cases demonstrating exemptions affect eligibility

Fixes #6989

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #6990   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         1    -3     
  Lines           68        18   -50     
=========================================
- Hits            68        18   -50     
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 Sentry.
📢 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.

@DTrim99
Copy link
Collaborator

DTrim99 commented Dec 15, 2025

@PolicyEngine we have this test failing: =================================== FAILURES ===================================
_________________________________ test session _________________________________
/home/runner/work/policyengine-us/policyengine-us/policyengine_us/tests/policy/baseline/gov/states/az/tax/income/credits/az_family_tax_credit_eligible.yaml:
Test 'Family tax credits with exemptions - eligible case (AGI $19900 + exemptions $2100 = $22000)':
az_family_tax_credit_eligible@2023: [0.] differs from 1.0 with an absolute margin [1.] > 0.001
=========================== short test summary info ============================
FAILED policyengine_us/tests/policy/baseline/gov/states/az/tax/income/credits/az_family_tax_credit_eligible.yaml::
======================== 1 failed, 133 passed in 21.00s ======================== Please fix.

@policyengine
Copy link
Author

policyengine bot commented Dec 15, 2025

✅ Fixed! The issue was that the test cases were using SINGLE filing status with 0 dependents (income limit $10,000), but testing with $22,000 total income, which would always be ineligible.

I updated both test cases to use JOINT filing status with 2 dependents (income limit $23,600):

  • Eligible case: AGI $19,900 + exemptions $2,100 = $22,000 (under $23,600 limit) ✓
  • Ineligible case: AGI $23,000 + exemptions $2,100 = $25,100 (over $23,600 limit) ✓

This properly demonstrates how exemptions are added to AGI per ARS 43-1073. All 8 tests now pass.

Committed and pushed to the PR branch.

The previous test cases used SINGLE filing status with 0 dependents (income limit $10,000),
but tested with total income of $22,000, which would always be ineligible.

Updated both test cases to use JOINT filing status with 2 dependents (income limit $23,600):
- Eligible case: AGI $19,900 + exemptions $2,100 = $22,000 (under $23,600 limit)
- Ineligible case: AGI $23,000 + exemptions $2,100 = $25,100 (over $23,600 limit)

This properly demonstrates how exemptions are added to AGI per ARS 43-1073.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@DTrim99
Copy link
Collaborator

DTrim99 commented Dec 29, 2025

📋 PR Review - Arizona Family Tax Credit Fix

✅ Summary: APPROVE

This PR correctly fixes the Arizona Family Tax Credit income eligibility calculation per ARS 43-1073.


🟢 Validation Results

Check Result Notes
CI Status ✅ Passing All 10 checks pass
Statutory Accuracy ✅ Correct Matches ARS 43-1073 requirement
Hard-coded values ✅ None All limits from parameters
Test coverage ✅ Good 8 test cases covering exemption scenarios
Vectorization ✅ Good Proper use of select()

📜 Statutory Verification

ARS 43-1073 specifies income for this credit as:

"Arizona adjusted gross income, plus the amount subtracted for exemptions under section 43-1023 and the amount subtracted for Arizona small business gross income under section 43-1022, paragraph 28."

The fix correctly adds az_exemptions back to az_agi:

income = az_agi + exemptions

🟡 Minor Note (Not blocking)

The statute also mentions adding back "Arizona small business gross income under section 43-1022, paragraph 28", but this subtraction is not yet implemented in PolicyEngine US. When az_small_business_income_subtraction is added in the future, it should be added to this income calculation as well.


✅ Strengths

  • Adds clear reference to ARS 43-1073
  • Comment explains the statutory basis
  • New test cases explicitly test exemption addition
  • Test names are descriptive with calculation details

🚀 Ready to Merge

All tests pass and the implementation correctly reflects Arizona statute.


🤖 Automated review by Claude Code

@DTrim99 DTrim99 requested review from PavelMakarchuk and removed request for PavelMakarchuk December 29, 2025 14:56
@PavelMakarchuk PavelMakarchuk merged commit 5e7af0f into main Dec 29, 2025
10 checks passed
@PavelMakarchuk PavelMakarchuk deleted the bot/issue-6989 branch December 29, 2025 22:22
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.

Fix Arizona Family Tax Credit income calculation per ARS 43-1073

4 participants