Repository navigation
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 4 2 -2
Lines 76 30 -46
Branches 2 0 -2
=========================================
- Hits 76 30 -46
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>
This branch has not been deployed
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
ky_filing_statuson main returns Separate whenever any member of a tax unit without a spouse hasis_separatedset (tax_unit.any(person("is_separated", period))). So an unmarried parent claiming 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. Found by the 2026-10-06 invariants audit, alongside the same defect inis_tax_unit_spouse(#9932).What the law says
ky_filing_statusin the model (the tuition credit): "If the taxpayer is a married individual within the meaning of Section 7703 … the credit shall apply only if the taxpayer and the taxpayer's spouse file a joint return or file separately on a combined form. The credit shall not be allowed if the taxpayer and the taxpayer's spouse file separate returns."Change
In the model, a spouse in the tax unit means both spouses are on one Kentucky return. That is joint (Status 3) or combined-separate (Status 2), and
ky_files_separatelythen chooses between them. Separate returns (Status 4) leave the spouse out of the tax unit.ky_filing_statusnow reads:filing_statusisJOINT, or a spouse is in the tax unit. This is the same "couple" testky_files_separatelyalready uses, and it keeps a combined Kentucky return after federal separate returns.filing_statusisSEPARATEand no spouse is in the unit (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_tuition_tax_credit_eligiblegains its KRS 141.069(4) reference.SEPARATE, no spouse in unitHEAD_OF_HOUSEHOLD, separated headJOINT, no spouse in unitSEPARATE)SEPARATE)Round 2. The hub's independent review of 297037b found one P2. The round-1 mapping sent a supplied federal
SEPARATEwith both spouses in the unit to Separate, although Form 740 allows a combined return there;integration.yaml:20is that case. 591b05c restores main's Joint for any unit with a spouse. Review:~/reviews/us-hub/reviews-gen/us-9924/review-hub.md.Tests
ky_filing_status.yaml(the variable-named file), 11 cases: 3 existing (one duplicate "Joint" name corrected) and 8 new.SEPARATE, spouse in unit → Joint (combined), eligibleSEPARATE, alone → Separate, ineligibleHEAD_OF_HOUSEHOLD, separated head → Single, eligibleSURVIVING_SPOUSE→ Single, eligibleTotals: main 4 failed, 7 passed; pre-fix head 1 failed, 10 passed; this PR 11 passed.
Other Kentucky files that read
ky_filing_statusor its tuition outputs all pass on this PR, each run 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. That is 51 cases in total. No Python tests were added, and no partner contract file is touched. Logs:~/reviews/pe-us-invariants-fixes-2026-10-06/ky-filing-status/round2/test-{main,prevhead,after}.log.Invariants (stated and executed)
For every Kentucky tax unit:
ky_filing_status= Joint if federalJOINTor a spouse is in the unit; otherwise Separate if federalSEPARATE; otherwise Single.is_separatedon every member who is not the head or spouse leavesky_filing_statusunchanged.ky_tuition_tax_credit_eligible= (ky_filing_status≠ Separate).~/reviews/pe-us-invariants-fixes-2026-10-06/ky-filing-status/ky_properties.pychecks these over an exhaustive grid, then 80 Hypothesis batches of 1–12 units (derandomized; each batch one vectorizedSimulation):suppliedmode also crosses the grid with all five supplied federal statuses (2,190 grid units). This is the scenario the round-1 properties missed.is_tax_unit_spousedrops the spouse (the #9932 defect). Kentucky gives Single instead of Joint; both are tuition-eligible.is_tax_unit_spouse.py, resolved locally by keeping #9617's supplied-role branch)SINGLE→ Single, with suppliedSEPARATE→ Separate; Joint expected)It is not added to CI: the repo guide keeps policy cases in YAML and keeps model-building Python tests out of CI. Logs:
~/reviews/pe-us-invariants-fixes-2026-10-06/ky-filing-status/round2/properties-*.log.Microsimulation impact
MICROSIM_PENDING
Interaction with #9932
This PR does not depend on #9932, and the two can merge in either order. With only this PR, a couple whose spouse the
is_tax_unit_spousedefect drops moves from Kentucky Separate to Single; with both PRs, it is Joint. Single and Joint both allow the tuition credit.axiom: us-ky/statute/11/141.069 encoded-correct. In rulespec-us
us-ky/statutes/11/141/069.yaml,kentucky_education_tuition_credit_allowedtakes the taxpayer's own IRC 7703 marital status and the return type as inputs, so a dependent's separation cannot affect it. Companion testscredit_limited_to_twenty_five_percent_of_federal_credit_and_tax(unmarried → holds, credit 500) andmarried_separate_returns_block_credit(married, separate returns → not_holds) were executed with axiom-rules-engine 0.2.2 against rulespec-usorigin/main16a667719: all 4 companion cases passed. 4 ad hoc cases for this PR's scenarios also passed (unmarried parent; 7703(b) parent; married with a combined return; married with separate returns). rulespec-us CI does not run these tests itself: the module is onknown-validation-gaps.yaml(rulespec-us#782, expires 2026-12-21). Evidence:~/reviews/pe-us-invariants-fixes-2026-10-06/ky-filing-status/round2/axiom-069-cases.json.🤖 Generated with Claude Code