Skip to content

Add Alabama HB527 overtime compensation deduction reform#7660

Open
DTrim99 wants to merge 4 commits intoPolicyEngine:mainfrom
DTrim99:al-hb527-overtime-deduction
Open

Add Alabama HB527 overtime compensation deduction reform#7660
DTrim99 wants to merge 4 commits intoPolicyEngine:mainfrom
DTrim99:al-hb527-overtime-deduction

Conversation

@DTrim99
Copy link
Collaborator

@DTrim99 DTrim99 commented Mar 2, 2026

Summary

  • Implements Alabama HB527 overtime compensation deduction as a contributed reform
  • Provides state income tax deduction for qualified overtime compensation
  • Caps deduction at $1,000 per taxpayer ($2,000 for joint filers)
  • Uses federal FLSA overtime premium calculation (26 U.S.C. § 225)

Bill Details

  • Bill: Alabama HB527
  • Effective dates: Tax years January 1, 2025 through December 31, 2027
  • Provision: Deduction allowed regardless of whether taxpayer itemizes

Test plan

  • Single filer with overtime exceeding cap (capped at $1,000)
  • Single filer with overtime under cap (full deduction)
  • Joint filers with overtime (capped at $2,000)
  • No overtime income (zero deduction)
  • Verify AL AGI is reduced by deduction amount

Closes #7658

🤖 Generated with Claude Code

Implements HB527 which provides an Alabama income tax deduction for
qualified overtime compensation, capped at $1,000 per taxpayer (or
$2,000 for joint filers). Uses federal FLSA overtime premium calculation.

Closes PolicyEngine#7658

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

DTrim99 commented Mar 2, 2026

Implementation Notes

Files Created

File Purpose
parameters/gov/contrib/states/al/hb527/in_effect.yaml Toggle for reform activation
parameters/gov/contrib/states/al/hb527/cap.yaml $1,000 per-taxpayer deduction cap
reforms/states/al/hb527/al_hb527_overtime_deduction.py Reform logic
tests/policy/contrib/states/al/hb527/al_hb527_overtime_deduction.yaml 5 test cases

How It Works

  1. The reform creates a new variable al_hb527_overtime_deduction that calculates the deductible amount
  2. It uses the existing fsla_overtime_premium variable which calculates overtime pay per federal FLSA rules (26 U.S.C. § 225)
  3. The deduction is capped at $1,000 per taxpayer, or $2,000 for joint filers
  4. The reform overrides al_agi to subtract this deduction from Alabama adjusted gross income

Usage

To enable the reform in a simulation:

from policyengine_us import Simulation

situation = {
    # ... household setup ...
}

# Enable via parameter
situation["gov.contrib.states.al.hb527.in_effect"] = {2025: True}

sim = Simulation(situation=situation)

Or apply the reform directly:

from policyengine_us.reforms.states.al.hb527 import al_hb527_overtime_deduction

sim = Simulation(
    situation=situation,
    reform=al_hb527_overtime_deduction
)

@DTrim99
Copy link
Collaborator Author

DTrim99 commented Mar 3, 2026

PR Review: Alabama HB527 Overtime Compensation Deduction

🔴 Critical (Must Fix)

  1. Incorrect legal citation: \ - Comment says "per 26 USC 225" but 26 USC 225 doesn't exist. FLSA overtime is in 29 USC 207. Either remove the citation or correct it.

  2. **Mixed /\ AND **: \ - The \ class has both /\ attributes AND a custom formula. Per PolicyEngine patterns, these should not be mixed as they can get out of sync. Remove the unused \ and \ attributes since the formula handles the calculation.

🟡 Should Address

  1. PDF references missing page anchors: Both \ and \ link to the bill PDF without \ anchors. Add page numbers to help reviewers verify values.

  2. Test error margin: Tests use \ - standard is \ for currency values.

  3. Test person naming: Use , \ instead of , \ per naming conventions.

  4. Missing edge case tests:

    • Head of Household filing status
    • Married Filing Separately
    • Overtime exactly at ,000 cap boundary
    • Joint filers with only one spouse having overtime

🟢 Suggestions

  1. Consider parameterizing the 2025-2027 effective dates in \ with date-ranged values instead of requiring manual enablement.

  2. Add full integration test verifying \ and \ are reduced (not just ).


Validation Summary

Check Result
Regulatory Accuracy ✅ ,000 cap and joint filer logic correct
Reference Quality ⚠️ 2 issues (missing page anchors)
Code Patterns 🔴 2 issues (wrong citation, mixed adds/formula)
Test Coverage ⚠️ 4 edge cases missing
CI Status ✅ Passing

What's Working Well

  • ✅ Cap implementation (,000 single / ,000 joint) is correct
  • ✅ Correct use of \ variable for FLSA calculation
  • ✅ Reform structure follows established patterns
  • ✅ Parameter organization under - ✅ 5 test cases covering main scenarios
  • ✅ All CI checks passing

Next Steps

To auto-fix issues:
🤖 Generated with Claude Code

@DTrim99
Copy link
Collaborator Author

DTrim99 commented Mar 3, 2026

PR Review: Alabama HB527 Overtime Compensation Deduction (Updated)

🔴 Critical (Must Fix)

  1. Incorrect legal citation: al_hb527_overtime_deduction.py:19 - Comment says "per 26 USC 225" but 26 USC 225 does not exist. FLSA overtime is in 29 USC 207. Either remove the citation or correct it.

  2. Mixed adds/subtracts AND formula: al_hb527_overtime_deduction.py:38-39 - The al_agi class has both adds/subtracts attributes AND a custom formula. Per PolicyEngine patterns, these should not be mixed as they can get out of sync. Remove the unused adds and subtracts attributes since the formula handles the calculation.

🟡 Should Address

  1. PDF references missing page anchors: Both cap.yaml:12 and in_effect.yaml:12 link to the bill PDF without #page=XX anchors. Add page numbers to help reviewers verify values.

  2. Test error margin: Tests use absolute_error_margin: 1 - standard is 0.1 for currency values.

  3. Test person naming: Use person1, person2 instead of spouse1, spouse2 per naming conventions.

  4. Missing edge case tests:

    • Head of Household filing status
    • Married Filing Separately
    • Overtime exactly at $1,000 cap boundary
    • Joint filers with only one spouse having overtime

🟢 Suggestions

  1. Consider parameterizing the 2025-2027 effective dates in in_effect.yaml with date-ranged values instead of requiring manual enablement.

  2. Add full integration test verifying al_taxable_income and al_income_tax are reduced (not just al_agi).


Validation Summary

Check Result
Regulatory Accuracy ✅ $1,000 cap and joint filer logic correct
Reference Quality ⚠️ 2 issues (missing page anchors)
Code Patterns 🔴 2 issues (wrong citation, mixed adds/formula)
Test Coverage ⚠️ 4 edge cases missing
CI Status ✅ Passing

What's Working Well

  • ✅ Cap implementation ($1,000 single / $2,000 joint) is correct
  • ✅ Correct use of fsla_overtime_premium variable for FLSA calculation
  • ✅ Reform structure follows established patterns
  • ✅ Parameter organization under /gov/contrib/states/al/hb527/
  • ✅ 5 test cases covering main scenarios
  • ✅ All CI checks passing

Next Steps

To auto-fix issues: /fix-pr 7660

🤖 Generated with Claude Code

- Fix incorrect legal citation (26 USC 225 -> 29 USC 207)
- Remove unused adds/subtracts from al_agi class (keep formula only)
- Add #page=1 anchors to PDF references
- Change test error margin from 1 to 0.1
- Rename test persons from spouse1/spouse2 to person1/person2
- Add edge case tests: Head of Household, Married Filing Separately, Joint with one spouse no overtime

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

DTrim99 commented Mar 3, 2026

Fixes Applied

🔴 Critical Issues Fixed

  • Incorrect legal citation: Changed 26 USC 225 to 29 USC 207 in al_hb527_overtime_deduction.py:19
  • Mixed adds/subtracts AND formula: Removed unused adds and subtracts attributes from al_agi class

🟡 Should-Address Issues Fixed

  • PDF page anchors: Added #page=1 to both cap.yaml and in_effect.yaml references
  • Test error margin: Changed from 1 to 0.1 across all tests
  • Test person naming: Changed spouse1/spouse2 to person1/person2
  • Missing edge case tests: Added 3 new tests:
    • Head of Household filing status
    • Married Filing Separately
    • Joint filers with one spouse having no overtime

Verification

  • ✅ All 8 tests pass locally
  • ✅ Code formatted with black

Ready for re-review.

🤖 Generated with Claude Code

Copy link
Collaborator

@PavelMakarchuk PavelMakarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per-taxpayer cap should be applied per-person, not per-return

The bill caps the deduction at "$1,000 per taxpayer." The code applies the cap at the tax-unit level:

cap = where(joint, p.cap * 2, p.cap)
return min_(total_overtime, cap)

This means a joint filer where only one spouse has overtime gets a $2,000 cap instead of $1,000. Test Case 8 ("Joint filers one spouse no overtime") expects $2,000 — likely incorrect.

Fix: cap each person's overtime individually, then sum:

person_capped = min_(person("fsla_overtime_premium", period), p.cap)
return tax_unit.sum(person_capped)

Minor items:

  • PR body cites "26 U.S.C. § 225" for FLSA overtime — FLSA is 29 U.S.C. § 207
  • Consider documenting interaction with the federal overtime exemption (One Big Beautiful Bill) — if both are active, overtime could be excluded federally and deducted at AL level

DTrim99 and others added 2 commits March 6, 2026 16:27
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.

Add Alabama HB527 overtime compensation deduction reform

2 participants