Repository navigation
Kentucky filing status follows the filer's own marital status - #9924
Merged
Merged
Conversation
ky_filing_status marked a tax unit SEPARATE when any member had is_separated set, so an unmarried parent with a separated 18-year-old dependent lost the Kentucky tuition tax credit (Form 8863-K bars only Filing Status 4). KRS 141.066(1)(c)-(d) reads marital status under IRC 7703, which concerns the filer's own marriage, and the Form 740 instructions put federal head of household and qualifying surviving spouse filers in Filing Status 1 (Single). Map Kentucky status from the federal filing status, as az_filing_status and ma_filing_status already do: JOINT -> Joint, SEPARATE -> Separate, everything else -> Single. The federal formula already limits separation to the head or spouse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The credit is limited only when the taxpayer is a married individual under IRC 7703 and files a separate return, which is the rule the filing status fix restores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9924 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 2 +1
Lines 24 30 +6
=========================================
+ Hits 24 30 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kentucky lets spouses who filed separate federal returns file separately on a combined Kentucky return (Form 740 instructions, Filing Status 2), and KRS 141.069(4) allows the tuition credit on that return. With both spouses in one tax unit, a supplied federal SEPARATE status now gives Kentucky Joint again, as on main, instead of Filing Status 4. Separate returns still map to Separate when the spouse is not in the tax unit. Adds supplied-status cases: federal SEPARATE with and without a spouse in the unit, and supplied head of household and surviving spouse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the federal-JOINT branch of ky_filing_status directly: a one-person unit with a supplied federal JOINT status is Kentucky Joint. Without the federal-JOINT condition this case fails and the other 11 still pass (review r2 P3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
November 18, 2026 17:41
…pendent Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Handing off to the US + core hub at
|
Contributor
Author
|
US + core hub merge audit, us#9924 at
🤖 Generated with Claude Code |
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.
Defect
On main,
ky_filing_statusreturns Separate whenever any member of a tax unit without a spouse hasis_separatedset (tax_unit.any(person("is_separated", period))). So an unmarried parent who claims a separated 18-year-old dependent lands in Kentucky Filing Status 4 (married filing separate returns), the one status barred from the Kentucky tuition tax credit. The same formula puts a separated parent who files federal head of household under IRC 7703(b) in Status 4, and it ignores a supplied federal filing status.is_tax_unit_spouseread every member's separation the same way until #9932 fixed it.What the law says
ky_tuition_tax_credit_eligibleapplies as the model's only reader ofky_filing_status. A married individual under IRC 7703 gets the credit "only if the taxpayer and the taxpayer's spouse file a joint return or file separately on a combined form", and gets none on separate returns.Change
The model reads a spouse in the tax unit as both spouses on one Kentucky return: joint (Status 3) or combined-separate (Status 2), and
ky_files_separatelythen chooses between those two. A married filer on a separate return (Status 4) has no spouse in the tax unit.ky_filing_statusnow returns:filing_statusequalsJOINTor the tax unit has a spouse (tax_unit_married).ky_files_separatelyalready uses this couple test, and the test keeps a combined Kentucky return after federal separate returns.filing_statusequalsSEPARATEand the unit has no spouse (Status 4).The federal formula already counts separation only for the head or spouse (
filing_status.py) and handles the 7703(b) head-of-household path (head_of_household_eligible.py).ky_filing_statusnow cites KRS 141.066 on the Legislature's site in place of a FindLaw copy and adds the 2024 Form 740 packet.ky_tuition_tax_credit_eligiblegains its KRS 141.069(4) reference.SEPARATE, no spouse in unitHEAD_OF_HOUSEHOLD, separated headJOINT, no spouse in unitSEPARATE(combined return)SINGLE,HEAD_OF_HOUSEHOLDorSURVIVING_SPOUSESEPARATE)Input precedence when the inputs disagree
A computed federal status always agrees with the unit, since a spouse in the unit makes federal status
JOINT. The two can disagree only when a user suppliesfiling_status:JOINTwith no spouse in the unit, which gives Joint, or a non-joint status with a spouse in the unit. Form 740 would put a federal head-of-household filer in Filing Status 1. A taxpayer with a living spouse can still file as head of household. The IRS considers a taxpayer with a nonresident alien spouse unmarried for that status unless they elect to treat the spouse as a resident (IRS Pub. 501).For a supplied
SINGLE,HEAD_OF_HOUSEHOLDorSURVIVING_SPOUSEwith a spouse in the unit, main gives the spouse priority, and this PR keeps that order and returns Joint. The order settles contradictory inputs and makes no claim about the law. A suppliedSEPARATEwith a spouse in the unit also gives Joint, here the combined return that Form 740 allows after federal separate returns when both spouses had income.ky_files_separatelyuses the same couple test (is_joint | has_spouse), so a change would have to reconcile both variables.Reversing the order in
ky_filing_statusalone would change its value for those three inputs, from Joint to Single, but no tuition or tax result: its only reader,ky_tuition_tax_credit_eligible, treats Single and Joint alike. Reversing it inky_files_separatelyas well would take the Filing Status 2 election from those units, and that can raise their Kentucky income tax. The default dataset supplies no federal filing status: main defines nofiling_status_inputvariable, so no model variable reads the dataset'sfiling_status_inputcolumn. This PR keeps main's spouse-first order, and maintainers can reverse it in both variables.Tests
ky_filing_status.yamlholds 13 cases: 3 existing, with one duplicate "Joint" name corrected, and 10 new. The table covers the first 12, and a later paragraph describes the thirteenth.SEPARATE, spouse in unit → Joint (combined), eligibleSEPARATE, alone → Separate, ineligibleHEAD_OF_HOUSEHOLD, separated head → Single, eligibleSURVIVING_SPOUSE→ Single, eligibleJOINT, alone → Joint, eligibleOn the first 11 cases, main failed 4 and passed 7, and the pre-fix head failed 1 and passed 10. This PR passed all 12 at 215f0c9.
* The twelfth case came after those runs. Main returns Single there, because only a spouse in the unit gives Joint, and main's supplied-status property run logged this input as its first counterexample. The pre-fix head mapped federal
JOINTto Joint.With the federal-
JOINTcondition removed from the formula, the twelfth case fails and the other 11 still pass.Five of the other Kentucky test files that set or check the tuition credit variables or the Kentucky filing choice passed at 591b05c on 2026-10-11. Each ran in its own process:
ky_tuition_tax_credit_eligible.yaml2,integration.yaml25 (unchanged),ky_files_separately.yaml9,ky_cdcc.yaml3,ky_non_refundable_credit_order.yaml1. 591b05c and 215f0c9 share their model code, since 215f0c9 adds the twelfth YAML case and changes no other file, so with the 12 cases above those runs cover 52 cases. The PR adds no Python test and edits no partner contract file.Those runs used main at f2dac92. 61b3b5b then merged main at 1d9f074 without a conflict. Main had made
ky_tuition_tax_credit_eligiblea boolean in #10105, and the merge keeps that change beside this PR's reference and comment.e664175 adds the thirteenth case, a couple with a separated 18-year-old dependent. The case supplies the couple's marital unit and each member's dependent flag but no head or spouse role, so the model infers both. The couple files federal and Kentucky Joint and keeps the tuition credit (potential 25% × 2,000 = 500). The case pins, for Kentucky, the spouse inference main adopted in #9932, and main's own formula also returns Joint for it. Before #9932, the dependent's separation removed the spouse, and this PR alone gave Single. No local run covered the case.
At
e664175950, CI passed all 35 jobs with this PR merged into main atfa8c98f4cf(run 46161682801).Invariants (stated and executed)
For every Kentucky tax unit:
ky_filing_status= Joint if federalJOINTor the unit has a spouse; otherwise Separate if federalSEPARATE; otherwise Single.is_separatedon every member other than the head and spouse leavesky_filing_statusunchanged.is_separatedset.ky_tuition_tax_credit_eligible= (ky_filing_status≠ Separate).A property script kept outside the repository checks these over an exhaustive grid, then 80 derandomized Hypothesis batches of 1–12 units. Each batch builds two vectorized
Simulations, one with the inputs as given and one with dependents'is_separatedcleared (for I2), and a run stops at its first counterexample:suppliedmode also crosses the grid with all five supplied federal statuses (2,190 grid units).is_tax_unit_spousedrops the spouse (the #9932 defect), so Kentucky gives Single, and Joint once the property clears the separation. Both allow the tuition credit. The run stops there, so it does not show whether other shapes fail; with #9932's rule (next row) every unit passes.is_tax_unit_spouse.pyby keeping #9617's supplied-role branch. #9932 has since merged (32d8c19, 2026-11-14) with its own resolution, and we haven't rerun this check on main as merged.SINGLE→ Single, where the property expects Joint. The YAML run shows the same for suppliedSEPARATE.JOINT→ SingleThe script stays out of CI. The repository guide puts policy cases in YAML and allows a Python test only where YAML can't exercise the behaviour, and every property here covers a household calculation. The YAML file asserts each scenario class deterministically: separated dependent, 7703(b), separate returns with and without a spouse, and four supplied statuses (
SEPARATE,HEAD_OF_HOUSEHOLD,SURVIVING_SPOUSE,JOINT). No case inky_filing_status.yamlsuppliesSINGLE, or a spouse in the unit with a suppliedSINGLE,HEAD_OF_HOUSEHOLDorSURVIVING_SPOUSE, and the property grid covers both. The script builds about 160 simulations per run, two per batch.Interaction with #9932
This PR doesn't depend on #9932, which merged on 2026-11-14. Before #9932, when the model inferred roles, the
is_tax_unit_spousedefect dropped the spouse of a couple with a separated dependent, and this PR alone moved that couple from Kentucky Separate to Single. On main, which includes #9932, the couple files Joint, and the thirteenth case pins it. Single and Joint both allow the tuition credit.Microsimulation impact
On the default dataset, we estimate about 9,700 Kentucky tax units (4 records) in each of 2025 and 2026 no longer file Kentucky Separate, so they become eligible for the tuition tax credit. No unit moves into Separate. None of the 4 records has a potential tuition credit, so we estimate no change in the credit, Kentucky income tax, state or federal income tax, or household net income in either year. We compared this PR at e664175 with main at the merge base, 1d9f074.
axiom: us-ky/statute/11/141.069 encoded-correct (
kentucky_education_tuition_credit_allowedinus-ky/statutes/11/141/069.yamltakes the taxpayer's own IRC 7703 marital status and the return type as inputs, so a dependent's separation can't affect it; companion testscredit_limited_to_twenty_five_percent_of_federal_credit_and_taxandmarried_separate_returns_block_creditinus-ky/statutes/11/141/069.test.yaml). The module hasn't changed since 2026-07-09 (rulespec-us main475bff3308, 2026-11-28). rulespec-us CI skips its companion tests while it sits onknown-validation-gaps.yaml(TheAxiomFoundation/rulespec-us#782); a run on 2026-10-11 passed all four, plus four more cases for this PR's scenarios.🤖 Generated with Claude Code