Skip to content

Elect Kentucky combined-separate filing on tax after non-refundable credits - #9349

Open
DTrim99 wants to merge 2 commits into
PolicyEngine:mainfrom
DTrim99:fix/ky-files-separately-post-credit
Open

Elect Kentucky combined-separate filing on tax after non-refundable credits#9349
DTrim99 wants to merge 2 commits into
PolicyEngine:mainfrom
DTrim99:fix/ky-files-separately-post-credit

Conversation

@DTrim99

@DTrim99 DTrim99 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Kentucky's combined-separate election (ky_files_separately) compared income tax before non-refundable credits, electing combined-separate whenever it lowered pre-credit tax by any amount. But under combined-separate each spouse's personal tax credits offset only their own column's tax (Form 740 lines 16–18), so a credit is wasted when a column's tax is too low to absorb it. A couple could elect combined-separate for a tiny pre-credit saving and then forfeit a larger credit.

Concrete case (taxsim #1149): a couple where the 65-year-old spouse has only retirement income and the other spouse has wages. Combined-separate saves ~$0.18 of pre-credit tax but strands the over-65 spouse's $40 age-65 personal credit against their $0 column tax. PE elected combined-separate and reported $1,433; the TaxAct return files jointly and applies the $40, landing at $1,393.

Change

Elect on liability after non-refundable credits, mirroring Delaware (#7931):

  • Two new path-specific variables — ky_income_tax_before_refundable_credits_if_separate and …_if_joint — compute Kentucky tax after the four ordered non-refundable credits (personal, family size, tuition, dependent care) for each path, without reading ky_files_separately (avoiding a circular dependency). A shared helper (ky_combined_separate.py) applies the Form 740 credit ordering.
  • ky_files_separately now picks the cheaper post-credit path and is gated to married couples (combined-separate, filing status 3, is only available to them).
  • The final tax chain is unchanged — once the election resolves, ky_income_tax_before_refundable_credits computes as before.

Testing

  • Issue household (KY joint 2022, head 65 no earned income, spouse 61 with $31,429 wages, one dependent): now files jointly, ky_income_tax = 1,392.95 (was 1,432.95), preserving the $40 credit and matching TaxAct. Added as a regression test.
  • Rewrote the ky_files_separately unit test for the post-credit, spouse-gated logic.
  • Full Kentucky baseline suite passes (504 tests), including all TAXSIM integration records — no election-flip regressions.

Found via PolicyEngine-TAXSIM discrepancy #1149, reported by @feenberg.

Fixes #9342.

🤖 Generated with Claude Code

…redits

Kentucky's combined-separate election (ky_files_separately) compared income
tax BEFORE non-refundable credits, choosing combined-separate whenever it
lowered pre-credit tax by any amount. But under combined-separate each spouse's
personal tax credits offset only their own column's tax (Form 740 lines 16-18),
so a credit can be wasted when a column's tax is too low to absorb it. A couple
could elect combined-separate for a tiny pre-credit saving and then forfeit a
larger credit -- e.g. an over-65 spouse with only retirement income loses the
$40 age-65 personal credit because their column tax is $0.

Elect on liability after non-refundable credits instead, matching Delaware
(issue PolicyEngine#7931). Two path-specific variables compute Kentucky income tax after
the four ordered non-refundable credits for the combined-separate and joint
paths without reading ky_files_separately (avoiding a circular dependency), and
the election picks the cheaper path. Combined-separate is also now gated to
married couples.

Verified on the issue household (KY joint 2022, head 65 with no earned income,
spouse 61 with $31,429 wages, one dependent): the couple now files jointly and
ky_income_tax is 1,392.95 (was 1,432.95), preserving the $40 credit and matching
the TaxAct return. Full Kentucky baseline suite passes.

Fixes PolicyEngine#9342.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ECQhxDkVchXm1RNVyqwnx
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (724e795) to head (18a7b93).
⚠️ Report is 29 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #9349   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         4    +3     
  Lines           35        60   +25     
  Branches         2         0    -2     
=========================================
+ Hits            35        60   +25     
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.

… hb13 test

- Use a changelog.d fragment instead of changelog_entry.yaml (the fragment
  format CI requires).
- Gate the combined-separate election on a married couple identified by EITHER
  a spouse in the tax unit OR a joint filing status. Test and microdata inputs
  represent a couple with different conventions (some set is_tax_unit_spouse
  with a separate filing status, others set filing_status JOINT without a spouse
  flag), so accept either. This keeps the two "files separately" baseline
  integration tests electing combined-separate while excluding single filers.
- The KY HB 13 "chooses separate filing" reform test supplies income directly
  as Kentucky taxable income, leaving modelled gross income at $0, which gives a
  spurious 100% family-size credit rate that zeroes both filing paths. Set
  ky_family_size_tax_credit_rate to 0 for that high-income couple so the
  after-credit election reflects the intended scenario.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ECQhxDkVchXm1RNVyqwnx
@DTrim99
DTrim99 requested a review from PavelMakarchuk August 26, 2026 18:21
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.

Kentucky combined-separate election ignores personal tax credits, wasting the age-65 credit

1 participant