Repository navigation
Cap Kentucky qualified residence interest at principal-residence interest from 2026 - #10003
Conversation
Adds two Person-level leaf inputs, home_mortgage_points and mortgage_insurance_premiums, so datasets no longer need to route them through investment_interest_expense (d1054). - Points join the home mortgage interest pool and take the same qualified-loan-limit fraction (Pub. 936, Table 1, line 13). - Premiums are deducted under 26 U.S.C. 163(h)(3)(E) with the AGI phase-out, for 2007-2021 and again from 2026 (P.L. 119-21, sec. 70108), and flow into interest_deduction. Empty inputs leave every output unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cover mortgage loan caps, person allocation, premium availability and AGI phase-out boundaries, and itemized taxable-income integration with hand-calculated IRS worksheet amounts. Co-Authored-By: GPT-6.1 Sol (subfleet lane) <noreply@openai.com>
Use one simulation for 360 tax units in 2021, 2025, and 2026 to check conservation, bounds, interest-points transfers, an independent integer-cents premiums worksheet, AGI monotonicity, and zero-input compatibility. Reuse read-only calculation arrays instead of constructing models per property. Co-Authored-By: GPT-6.1 Sol (subfleet lane) <noreply@openai.com>
…e from 2026 KRS 141.019(2)(j), added by 2026 Ky. Acts ch. 161 (HB 757) sec. 7 and amended by ch. 198 (HB 869) sec. 48, limits the section 163(h)(3) deduction from TY2026 to interest on the principal residence and bars claiming it for more than one qualified residence. Kentucky itemized deductions inherit the federal interest deduction, which pools a second residence. Add three Person leaf inputs, disjoint from the principal-residence inputs: second_residence_mortgage_interest, second_residence_mortgage_points and second_residence_mortgage_insurance_premiums. They join the federal pool (interest and points under the acquisition-debt share, premiums under the AGI phase-out), so federal results do not depend on the split. second_residence_interest_deduction attributes the federal deduction to the second residence, and Kentucky subtracts it from 2026. Empty inputs change nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
P.L. 119-21 inserted the passenger-vehicle loan interest rule as section 163(h)(4), so the qualified residence and qualified mortgage insurance definitions are now in 163(h)(5)(A) and (E). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rest Review found that a pro-rata second-residence share understates Kentucky's deduction whenever combined debt exceeds the federal limit. KRS 141.019(2)(j) limits the federal deduction "to the amount of interest paid or accrued ... on the ... indebtedness of the principal residence", which is a ceiling. Kentucky now allows the lesser of the federal deductible interest and points and the principal residence's interest and points. It still drops second-residence premiums after the federal phase-out. With equal loan rates this matches a recomputation on the principal residence alone, and a property test checks that against the statutory limit. The deprecated structured interest inputs now stand in for principal-residence interest only, and second-residence interest is always added. Previously, reporting any second-residence interest dropped the structured amount. Drop the pro-rata second_residence_interest_deduction. Move the federal pooling cases to interest_deduction, home_mortgage_interest_tax_unit and home_mortgage_interest_share. Add Kentucky cases for a joint return, spouses filing separately, the structured fallback, and debt above the limit. Fix the Pub 936 page anchors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cap equals a principal-residence-only recomputation when combined debt is within the federal limit, or when both loans carry the same rate, fall under the same debt limit and carry points in proportion to their debt. Equal rates alone are not enough. Restore the YAML case with legacy structured interest and second-residence points but no second-residence interest, which was lost when the federal cases moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also add a Kentucky case with debt over the federal limit that shows legacy structured interest counting toward the principal-residence cap: the federal 6,000 stays within the structured 8,000, so nothing is disallowed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the US + core hub (session
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Admin-merged by the US + core hub at
|
Resolve the five conflicts with #10003 (Kentucky cap plus premium inputs): - Alabama adds deductible_mortgage_interest, investment interest and the federal premium deduction; #10003's Form 40 references keep their pages, with comments above their hrefs. - Hawaii adds hi_mortgage_interest_deduction with #10003's premium deduction, and keeps the single 2022 N-11 entry and Announcement 2021-01. - North Carolina line 1 reads deductible_mortgage_interest, then #10003's premium block; one SL 2026-31 reference covers the $750,000 limit and the premium restoration. - Both YAML files keep both sides. #10003's case "Restored premiums share North Carolina's 20000 mortgage and tax cap" now enters home_mortgage_interest, since line 1 no longer reads the uncapped mortgage_interest: $19,000 + $2,000 = $21,000, capped at $20,000. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge upstream main at 86d3ae6. Keep California's federal section 1341 deduction carryover and $11,000 regression alongside main's mortgage insurance premium exclusion cases. Keep Wisconsin's repayment in the itemized deduction credit base under Wis. Stat. 71.07(5)(a)6-7, while excluding federally deductible mortgage insurance premiums as introduced by upstream commit 7545b2c (#10003). Preserve both sets of references and regression cases without changing either parent's expected values.
Conflicts in the two Montana joint itemized deduction variables (mt_itemized_deductions_joint and mt_itemized_deductions_for_federal_itemization_joint). Main's #10003 added the federal mortgage insurance premium deduction to the head's interest total; this branch pools both spouses' mortgage and investment interest, excluding dependents. The resolution keeps both: the head's interest total is the pooled filers' interest plus the tax unit's premium deduction, once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main moved the files this PR edits: the 2020 non-itemizer charitable allowance left the federal itemized list (#10186), California's limitation now leaves out its FTB 3526 investment interest and Minnesota's leaves out investment interest (#10645), Kentucky subtracts second-residence interest from 2026 (#10003), Wisconsin's credit builds from named Schedule A components (#10311), Mississippi counts the miscellaneous deduction once (#10096), and the Michigan, Iowa and Pennsylvania source lists gained other subtractions and additions, military retirement and disability benefits (#10302, #10354, #10182, #10185). Each resolution keeps main's change and reapplies this PR's wagering-loss treatment on top. Wisconsin's component list already leaves out wagering losses, so its subtraction is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…41) and North Carolina's rules that depend on it (#10038) * Add North Carolina's claim of right repayment itemized deduction G.S. 105-153.5(a)(2)d, added by S.L. 2016-5 for 2014 and later, lets North Carolina itemizers deduct repayments of income included in AGI in an earlier year under a claim of right (Form D-400 Schedule A line 8). Repayments above $3,000 are deductible in full; smaller ones are reduced by 2% of federal AGI less other miscellaneous itemized deductions, which the 2016 and 2025 NCDOR worksheets both reproduce. PE had no input for these repayments, so it adds claim_of_right_repayment (person level; only the head's and spouse's count) and moves North Carolina's uncapped itemized items into a parameter list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * From 2026 limit North Carolina's claim of right deduction to income NC taxed Review r1 (subfleet 20261009-090558-nc-itemized-review): - S.L. 2026-31 section 1.8 rewrites G.S. 105-153.5(a)(2)d for taxable years beginning on or after January 1, 2026: the repaid amount must have been included in AGI "as modified in G.S. 105-153.5 and G.S. 105-153.6" in the earlier year. New person input nc_claim_of_right_repayment_excluded_from_income (the part NC deducted when received, such as repaid Social Security) and a dated parameter apply it. - Count only the head's and spouse's other miscellaneous expenses against the pre-2018 floor; a dependent's are on the dependent's return. - The property grid now varies property taxes (so the $20,000 cap binds) and adds a 2026 grid for the excluded part. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Model the section 1341 claim of right deduction and credit; wire North Carolina's 1341(a)(5) bar and G.S. 105-266.2 payment (WIP) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the federal claim of right deduction and credit out of state rules that exclude them (AZ, KS, WI, MO, OR, VA); property tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Document the unmodeled pre-2018 small repayment deduction; changelog fragment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix the federal method in the North Carolina worksheet property test to keep it at two seconds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove a stray empty log file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Address review: isolate the method branches, compare to the cent, return-level prior-year inputs, California and Montana flows - The branches that fix the claim of right method start from inputs only, and the itemization branches settle the method in the parent first, so a tax liability calculated before the method is known cannot leak into them. - Ties are compared to the cent, so a one-cent difference picks the credit. - The prior-year federal decrease and NC increase are return-level inputs defined on chapter 1 and Article 4 tax. - California leaves out the federal deduction (Schedule CA Part II line 16); Montana deducts it through 2023 (Form 2 itemized line 18). - Section 67(g) is now 67(h); document the Arizona and NC coverage limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the simulation's claim of right method in the itemizing branches Review r2 found that with itemization branching off, tax_liability_if_not_itemizing used the parent's method when calculated first but chose its own after income_tax. The itemizing branches now take the method as an input. A branch keeps its parent's cache when an override equals the value the parent already holds, so ordinary simulations still share it. Adds the review's Texas household as an order test under both itemization settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into North Carolina claim of right deduction * Merge PR 10028's branch (with main) into the section 1341 branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Restore conservative branch invalidation; fix the method in itemizing branches only when someone qualifies Review r3 showed that keeping a parent's cache when an override equals the parent's current value can reuse tax calculated before another input changed. Branches again drop inherited values whenever the parent knows an overridden variable. The itemizing branches add the claim of right method as an override only when some tax unit repays more than $3,000, so simulations without a qualifying repayment keep sharing the parent's cache. Adds the review's stale-parent sequence as a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into the section 1341 branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test both NC contrib credits stacked on the claim of right payment with use tax Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into the section 1341 branch Resolves the add/add conflicts with #10028's squash (557b539) by keeping this branch's 26 U.S.C. 1341(a)(5) bar on the North Carolina deduction, its added NC cases and the method fixture in the NC property grid, and keeps both sides' Arizona itemized deduction cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Carry the claim of right deduction into Montana itemized deductions from 2024 From 2024 Montana Form 2 line 2 takes the federal itemized deductions (2024 instructions, Worksheet A line 1: Form 1040 line 12), which include Schedule A line 16. The miscellaneous list was empty from 2024, so a Montana itemizer lost the federal claim of right deduction. Review r5b (P3-1) found it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into the section 1341 branch Resolves the period_branch.py conflict with #9913 (5c51e0d) by taking main's _input_keys docstring, which no longer says whether Core's clone copies or shares the input-key set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Give every itemizing branch the simulation's claim of right method From 2026 tax_unit_itemizes opens the itemizing branch for the section 68 limitation (#10136) with only tax_unit_itemizes overridden. From policyengine-core 3.33 (#560), set_input on a branch drops the values stored after the overridden variable was first stored anywhere in the simulation, so that branch lost the inherited section 1341 method and chose its own as a filer forced to itemize. Its itemized deductions then decided itemization on a liability tie, or always with itemization branching off: CI failed two 2026 grid points, and a 2026 household with branching off came out at $4,988 instead of $4,100. get_itemization_branch builds the itemizing and non-itemizing branches for all three callers, adding the method as an input whenever someone qualifies, so they share one branch and none chooses a method. A 2026 test covers that household in every calculation order under both itemization settings; it fails before this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop #10028's merged changelog fragment; date period_branch's set_input note main compiled the North Carolina claim of right fragment into CHANGELOG.md when #10028 merged, so the copy left on this branch would print it again. The period_branch module docstring said set_input on a branch clears nothing, which policyengine-core 3.33 changed (review r8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Clarify federal claim of right input documentation * Keep claim of right threshold references specific to its value * Explain Wisconsin claim of right worksheet interpretation * Carry the federal claim of right deduction into California itemized deductions * Require section 1341 eligibility for North Carolina repayment relief * Merge remote-tracking branch 'gh/main' into federal-claim-of-right-1341 * Align NC refundable claim-of-right accounting with state tax invariants * Apply statute-first claim-of-right treatment in AL MO OR WI and VA * Complete Montana repayment deductions and federal taxable income base * Preserve Alabama federal deduction credit treatment before 2021 * Document Alabama credit-list verification boundary * Correct entities in Montana repayment regression fixtures * Remove duplicate household inputs from Montana fixtures * Merge remote-tracking branch 'gh/main' into federal-claim-of-right-1341 * Fix Montana state-tax adjustment before taxable-income floor * Correct tax-unit inputs in Montana property test * Merge main into federal-claim-of-right-1341 Merge upstream main at 86d3ae6. Keep California's federal section 1341 deduction carryover and $11,000 regression alongside main's mortgage insurance premium exclusion cases. Keep Wisconsin's repayment in the itemized deduction credit base under Wis. Stat. 71.07(5)(a)6-7, while excluding federally deductible mortgage insurance premiums as introduced by upstream commit 7545b2c (#10003). Preserve both sets of references and regression cases without changing either parent's expected values. * Merge main into federal-claim-of-right-1341 Preserve the 2020 above-the-line charitable deduction and 2021 non-itemizer treatment while retaining section 1341 method-aware itemization branches. Keep the single Schedule A parameter block with the claim-of-right deduction. Add six hand-calculated 2020/2021 regressions combining charitable deductions and both section 1341 methods, including comparisons with itemization branching disabled. * Merge current main into federal-claim-of-right-1341 * Merge main into federal-claim-of-right-1341 Conflicts resolved: - Wisconsin itemized deduction credit: keep main's explicit Schedule 1 component list (#10311) and add claim_of_right_deduction to it, so the section 1341 repayment stays in the credit base as this PR intends under Wis. Stat. 71.07(5)(a)6-7. - Alabama and Wisconsin YAML tests: keep both sides' cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Montana: add the state-income-tax addback after the line 3 floor from 2025 The 2024 Form 2 Worksheet A reduces the federal deduction by the capped state-income-tax addback before line 3's zero floor. The 2025 form stops adjusting line 2 and reports the addback on Schedule I line 4, a Montana addition after the floor, as MCA 15-30-2120(1) treats the (2)(j) item alongside the other additions. A new boolean parameter is true in 2024 and false from 2025 (2026 follows the 2025 form by convention), and both mt_taxable_income_joint and mt_federal_deductions read it. Adds 2025 and 2026 YAML witnesses (the review's AGI 10,000 / itemized 20,000 household gives 4,250 in 2025), keeps the 2024 pre-floor witnesses, limits the property test to 2024, and points the misc_deductions comment at mt_taxable_income_joint, which is what reads the federal base. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Alabama: apply the regulation's payment-credit list from 2015 Ala. Admin. Code r. 810-3-15-.20(1)(d)2 subtracts all credits shown as payments on the federal return, and its current text dates from a 2010 amendment, so it governs every year the parameter covers, not only 2021 on. The legacy pre-2021 list (total AOC, no section 1341 credit or net PTC) is dropped, and the 2020 case that pinned it now expects 5,000 - 1,000 - 1,500 - 1,000 - 750 = 750. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update the four source-conflict candidates this PR resolves main's backlog still described the code before this PR: AL, MO and WI as following the worksheets and OR as unknown. The head follows the statute or regulation in all four, so set pe_us.follows to statute and state to ruled, replace the notes that said a model change was still needed, start AL's years in 2015 (the corrected credit list now applies from the parameter's first year), and cite ORS 316.685(1)(b), the EITC-only disregard the OR code follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Replace two dead Montana references The 2017 Montana Form 2 with Legal References now 404s at its original address; cite the Wayback Machine copy of 2024-01-07, whose PDF p. 6 Schedule III lines 25, 26 and 28 the reviewer confirmed. Drop the "2023 HB 109" reference: its URL mixes HB0199 and HB0109, returns 404, and what it was meant to support could not be confirmed; MCA 15-30-2120 is already cited for the deduction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Rebuild the Missouri and Oregon section 1341 witnesses from a repayment Both cases set claim_of_right_credit as an input that neither formula reads, so they only checked that income_tax passes through. They now use the federal integration case 4 household (2025, $40,000 wages, $10,000 repayment, $2,200 prior-year decrease), where the credit method wins and flows through income_tax: 2,671.50 - 2,200 = 471.50. Missouri deducts 25% x 471.50 = 117.875 and Oregon subtracts 471.50. Adding the credit back in either formula fails its case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Run the section 1341 property grid in 2020 too main's #10186 made the 2020 itemization choice compare two branches with different AGI (the 2020 above-the-line charitable deduction), and no invariant in this file ran on that path. Add 2020 to YEARS (last, so the tests that read YEARS[0] and YEARS[1] keep 2025 and 2026) and run the calculation-order test in 2020 as well. Every existing assertion is kept; all 58 tests pass. Locally the file went from 182 s to 220 s and its peak RSS from 3.2 GB to 3.5 GB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Changelog: state the Montana and Alabama scope for every filer The claim-of-right fragment described the Montana work as repayment treatment, but from 2024 every Montana filer's taxable income now starts from the federal base (all six mt_taxable_income_joint cases changed), and every Alabama AOC claimant now subtracts only the refundable part. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge remote-tracking branch 'origin/main' into federal-claim-of-right-1341 * Pin Montana's QBI add-back before the zero floor with a reachable 2026 case The old 2025 case supplied a positive QBI deduction at a binding floor, which the model can't produce before 2026. From 2026 the 199A(i) $400 minimum can exceed taxable income, so a derived household now pins the order: MCA 15-30-2101(22) and 15-30-2120(2)(i) add the deduction back to federal taxable income before Form 2's line 7 floor, giving 0, not 400. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Pin aca_ptc to 0 in Oregon's section 1341 witness Once #10093 nets the premium tax credit in Oregon's subtraction, this household's modeled credit would zero the subtraction. Pinning it keeps the case isolating the section 1341 credit at 471.50. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Drop the unreachable 2025 branches from the Montana property test YEARS is (2024,), so the Schedule 1-A draw and the year >= 2025 branches never ran; YAML cases cover 2025 and 2026. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Document mt_federal_deductions as display-only mt_taxable_income_joint computes its own deduction term from taxable_income_deductions, which also holds the QBI deduction and the Schedule 1-A deductions, so the two differ (e.g. 15,750 against 21,750 in the 2025 tip case) and the formula can't read this variable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Start the Alabama credit-list item at 2018, the first worksheet compared The code applies the regulation's list from 2015, but worksheets before 2018 went unchecked, so the item can't claim a conflict for 2015-2017. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Explain Montana's QBI add-back order from Form 2, not section 63 The comment argued from federal taxable income having no floor, which would also remove the line 3 floor the code keeps for Montana's other additions. The order follows the form: line 2 leaves the QBI deduction out, and line 3 floors line 1 minus line 2 at zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main Main removed gov.household.household_refundable_credits and gov.household.household_tax_before_refundable_credits, which no formula read after it dropped the abolish-tax structural reforms. This branch had added North Carolina to both. The merge keeps the removal; this branch's North Carolina entries stay in gov.household.household_refundable_state_credits and the gov.states.household lists. Main's new North Carolina use tax case under the payroll tax repeal enters nc_income_tax, which this branch's state list no longer reads: the list now counts North Carolina tax before refundable credits. The case now enters nc_income_tax_before_refundable_credits, and its totals stay at 1,020. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into federal-claim-of-right-1341 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into federal-claim-of-right-1341 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Merge main into federal-claim-of-right-1341 #10094 also adds an entry to source_conflicts/candidates.yaml. Git merges the two cleanly, and the merged register keeps unique ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
From TY2026, Kentucky caps the qualified residence interest deduction at the interest paid on the principal residence. PolicyEngine-US inherited the federal interest deduction, which pools a second home's mortgage interest, points and (from 2026) mortgage insurance premiums. This PR adds leaf inputs for those second-residence amounts and applies Kentucky's cap from 2026. Empty inputs change nothing.
The law
KRS 141.019(2)(j) is the codified text. In full: "For taxable years beginning on or after January 1, 2026, any deduction allowed by 26 U.S.C. sec. 163(h)(3) as qualified residence interest shall be limited to the amount of interest paid or accrued during the taxable year on the acquisition and home equity indebtedness of the principal residence of the taxpayer and shall not be claimed for more than one (1) qualified residence".
2026 Ky. Acts ch. 161 (HB 757), sec. 7 added it with "acquisition indebtedness". The act was vetoed in part, and the veto was overridden April 14, 2026.
2026 Ky. Acts ch. 198 (HB 869), sec. 48 amended it to "acquisition and home equity indebtedness". The LRC codified the two together, effective July 15, 2026.
The LRC fiscal note describes the provision as decoupling from the "Deduction for interest paid on mortgage & home equity loans for more than the primary residence".
Federal home equity interest has been disallowed since 2018. P.L. 119-21 sec. 70108 made 26 U.S.C. 163(h)(3)(F)(i)(I) permanent. The federal deduction Kentucky starts from therefore already excludes home equity interest, and HB 869's wording changes nothing here. The binding rule is principal residence only.
Points are prepaid interest. Premiums are "treated ... as interest which is qualified residence interest" (163(h)(3)(E)). So Kentucky keeps principal-residence points and premiums (premiums after the federal phase-out) and drops second-residence ones. Max confirmed this treatment in decision d1070 on October 8: keep principal-residence mortgage-insurance premiums in the Kentucky deduction.
KRS 141.010(21) adopts the IRC in effect December 31, 2025 for TY2026. KRS 141.019(2) starts from federal deductions; (2)(j) adds the 2026 principal-residence ceiling and specifies no separate dollar or loan-vintage limit. The federal debt limits remain the starting point.
Design
Loan structure.
first_/second_home_mortgage_*balances and origination years describe two loans, not two residences: a second mortgage can sit on the main home. Main has merged #9605, removing the deprecated per-loan interest inputs; this PR uses only person-level interest, points, and premiums. Main's #10025 supplies_debt_by_vintageand_qualified_loan_limitfor the federal debt limits.Inputs. Three new Person inputs, disjoint from the existing ones. This follows the leaf-input rule: inputs are the granular facts, and the model derives the totals.
second_residence_mortgage_interesthome_mortgage_interestsecond_residence_mortgage_pointshome_mortgage_pointssecond_residence_mortgage_insurance_premiumsmortgage_insurance_premiumsAmounts whose residence is unknown stay in the existing inputs and count as principal-residence amounts. Datasets and API callers that don't split them get exactly today's results, in Kentucky too.
Federal. 163(h)(5)(A) pools both qualified residences, so the new inputs join the federal pool:
home_mortgage_interest_tax_unit;deductible_andnon_deductible_mortgage_interest_tax_unit;home_mortgage_interest_share;deductible_mortgage_insurance_premiums.The person-level principal- and second-residence interest inputs are summed directly; no deprecated structured-interest fallback remains.
Kentucky.
gov.states.ky.tax.income.deductions.itemized.principal_residence_interest_onlyis false before 2026 and true from 2026.ky_disallowed_second_residence_interestis the sum of two parts:ky_itemized_deductions_unit'ssubtracts, so it reaches both the joint and combined-separate paths.Accuracy. The cap equals a recomputation on the principal residence alone in either of these cases:
A property test checks the second case against the statutory limit. Otherwise it can differ in either direction, because the model doesn't record which loan secures which residence.
Also fixed: P.L. 119-21 inserted the vehicle-loan rule as 163(h)(4), so the qualified residence and qualified mortgage insurance definitions now sit in (h)(5)(A) and (E). The citations follow.
Invariants
These are stated and executed in
tests/core/test_second_residence_mortgage_properties.py. The test uses seeded draws over 48 Kentucky tax units, 5 paired scenarios, and TY2025 and TY2026.interest_deduction,itemized_deductions_less_saltand each person's allocation unchanged.interest_deduction.These mutations were run and caught:
Cost. I measured locally on macOS under host load, not on CI, running the points-branch property file and the uprating test with and without this file, twice each:
The file lands in the existing
coreRest group, and no runner was added.Tests before the merge
The following records describe verification before merging main. Current per-file results and migrated coverage are recorded in "Merge with main" below.
itemizing/interest_deduction.yaml, 4 cases:household/expense/tax_unit/home_mortgage_interest_tax_unit.yaml, 3 cases on pooling and the structured fallback.household/expense/person/home_mortgage_interest_share.yaml, 1 case on spouse allocation.ky_disallowed_second_residence_interest.yaml, 8 cases:ky_itemized_deductions_unit.yaml, 6 new cases:ky_itemized_deductions_indiv.yaml, 1 new case: spouses filing separately.test_uprating_series.pyregisters the three CPI-U inputs.test_batched.py;cf2d1f2338: the ceiling reading, citations, the fallback, test gaps, and anchors. Round 2 approved, served by GPT-6.1 Sol through Subfleet because the Claude lanes were closed. It recomputed all 27 YAML cases and found no blocker or major issue. Its four minor items are addressed: the qualified equality claim, the restored fallback case, cost before and after, and an anchor. An Opus check of those two follow-up commits (c42e0e7bf8,f734479be8) approved them at the current head.Microsimulation (2026, default dataset)
These figures describe
cf2d1f2338. The hub reran the impact at this PR's head,6f9480b4a8(basef9b55fc4dd, 2026, default dataset), with the same result: all 14 Kentucky and mortgage-interest variables it compared are unchanged on every record.I ran two real microsimulations for 2026 on the default dataset,
populace_us_2024.h5@populace-us-2024-spm-20260909, throughlockrun.sh:07227ea252, which wasmainwhen the points branch was cut;cf2d1f2338.I compared them record by record with
compare.py. Every compared variable is unchanged on every record, and the maximum absolute change is 0:income_tax($2.590T);state_income_tax($580.0B);household_net_income;ky_income_tax($5.097B);ky_itemized_deductions_unit($5.656B);ky_taxable_income_jointand_indiv;ky_tax_unit_itemizes;interest_deduction;itemized_deductions_less_saltanditemized_taxable_income_deductions;home_mortgage_interest_tax_unit;deductible_,non_deductible_and plainmortgage_interest;home_mortgage_interest_share;tax_unit_itemizes.On the branch,
ky_disallowed_second_residence_interestanddeductible_mortgage_insurance_premiumsare 0 for all 79,729 tax units: the dataset supplies none of the new inputs. Each run took about 4.5 minutes, with a 14 GB peak footprint.Related
Merge with main
Merged
gh/mainf9b55fc4dd05f1bed921a4dd06cb8c81f6ceb2c7in merge commit3adfb231812004be356ff7a0d8c575a6ed218e1b; the separate helper-migration commit is1453ef98f2a2f53af9d600fb98984cab8ad70c34. The original PR head wasf734479be8cb754353256c5dccb48f86c9fa231a; no commits were rebased or rewritten. The points/MIP input commits9b76c8b,869c0bf, andfe25c52are part of this PR and land with it.Conflict resolutions
variables/household/expense/tax_unit/mortgage_interest_structure.py: kept main's Apply federal mortgage debt limits by loan vintage, including grandfathered pre-1987 debt #10025 vintage grouping, qualified-loan-limit computation, origination-year conventions, and citations; kept this PR's points and second-residence pooling. Kept Remove the deprecated structured mortgage-interest inputs #9605's removal of per-loan interest inputs and replaced the fallback formula with the sum of the canonical person-level principal- and second-residence interest inputs. This preserves both main's corrected federal debt treatment and the PR's residence split.variables/household/expense/person/home_mortgage_interest_share.py: combined the documentation for main's filer-only allocation and dependent-only equal-share fallback with this PR's interest and points on both residences. The merged formula masks the combined reported amounts to head/spouse before allocating, preserving conservation and keeping dependent allocations at zero.tests/policy/baseline/gov/irs/income/taxable_income/deductions/deductible_mortgage_interest.yaml: kept all main cases and outputs, including spouse/dependent allocation and debt limits, plus all five points cases from the PR. The file now has 16 passing cases.The associated #9605 compatibility updates remove the obsolete legacy fixture scenario and removed tax-unit interest inputs from both property files. Three Kentucky fallback examples now supply canonical principal-residence interest, preserving their economic assertions. The pooling YAML now tests second-residence-only interest and spouse aggregation. The Kentucky variable documentation no longer claims that removed inputs are accepted.
Helper migration and Kentucky treatment
Every use of
_mortgage_balance_capand_limited_mortgage_balancehas been migrated. The points/premiums property fixture now groups both loans with_debt_by_vintage, then calls_qualified_loan_limitwith the grandfathered, pre-TCJA and post-TCJA debt totals and the corresponding federal filing-status limits. Its zero-balance share remains one. Seeded draws now cover unknown years and the 1987/1988 and 2017/2018 boundaries; the reference share is namedbaseline_deductible_share.Kentucky's parameter and principal-residence ceiling remain unchanged: the restriction starts in TY2026. KRS 141.019(2)(j) supplies no independent dollar or loan-vintage limit; its federal starting point follows the IRC conformity in KRS 141.010(21). New Kentucky cases pin uncapped pre-1987 interest/points and mixed-vintage federal limits before the residence ceiling.
Decision d1070 is preserved. Existing YAML already retains principal-residence mortgage-insurance premiums. The phase-out case now additionally asserts
ky_itemized_deductions_unit: 810: $900 principal premiums × 90%, after removing only the second residence's $270 deduction from the $1,080 federal premium deduction.Verification at the merged head
265 tests passed across 15 distinct files: 143 Python tests and 122 YAML cases. This covers every added/changed PR test file, every #10025 test file on main, and all four Kentucky mortgage-related YAML files found with
rgundertests/policy/baseline/gov/states/ky/tax/income/(deduplicated in the table).Each file ran separately, sequentially, in the foreground, with this checkout on
PYTHONPATHandOMP_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 MKL_NUM_THREADS=4 VECLIB_MAXIMUM_THREADS=4 NUMEXPR_NUM_THREADS=4 OMP_WAIT_POLICY=PASSIVE. YAML files usedpython -m policyengine_core.scripts.policyengine_command test <file> -c policyengine_us; Python files usedpython -m pytest -q <file>.policyengine_us/tests/core/test_mortgage_points_and_premiums_properties.pypolicyengine_us/tests/core/test_second_residence_mortgage_properties.pypolicyengine_us/tests/core/test_uprating_series.pypolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/deductible_mortgage_interest.yamlpolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/deductible_mortgage_insurance_premiums.yamlpolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/interest_deduction.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/deductions/ky_disallowed_second_residence_interest.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/deductions/ky_itemized_deductions_indiv.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/deductions/ky_itemized_deductions_unit.yamlpolicyengine_us/tests/policy/baseline/household/expense/person/home_mortgage_interest_share.yamlpolicyengine_us/tests/policy/baseline/household/expense/tax_unit/home_mortgage_interest_tax_unit.yamlpolicyengine_us/tests/core/test_mortgage_debt_limit_invariants.pypolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/deductible_mortgage_interest_tax_unit.yamlpolicyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_joint.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/integration.yamlmake formatpassed before both commits; the final run left 7,326 files unchanged and all lint checks passed. The hub reran the impact at the head (see Microsimulation).Review r1: responses
Confirmed the reviewed branch head
1453ef98f2a2f53af9d600fb98984cab8ad70c34.gh/mainremainsf9b55fc4dd05f1bed921a4dd06cb8c81f6ceb2c7;git merge gh/mainreported “Already up to date,” so this round has no new merge resolutions. The earlier main-merge resolutions and the Kentucky cap remain intact.The audit follows every direct federal interest reader, aggregate itemized reader, parameter source list, dynamic state route, and federal-taxable-income reader. It covers 32 affected jurisdictions, including DC and Vermont's indirect capital-gain cap. The other 19 states have no affected reader. Existing Louisiana medical-only treatment from 2022 and South Carolina's removal of federal itemization from 2026 already prevent premiums from entering those deductions.
New YAML examples use both residences, phased-out premiums, payer allocation, relevant year boundaries, and North Carolina's overall cap. All corrections have recorded failures against the reviewed source before applying the fixes. Iowa's fixtures explicitly suppress unrelated computed SALT. The initial case-sensitive Montana filter selected no cases; corrected runs reproduced both new failures in every sibling formula.
Methodology
Decision d1693 (2026-10-19) accepted all four open readings as built: the three in this table, and New York's continued exclusion of 2026 premiums (an inference, since New York has no 2026 forms yet; see the notes below). New York gets rechecked when its 2026 IT-196 is published.
Decision d1070 settled the premiums question: keep principal-residence premiums after the federal phase-out; remove the second residence's share. The phase-out witness retains $810. Equal rates establish equivalence only with the same federal debt-limit regime and debt-proportional points (or no points); fully deductible combined debt is the other equivalence case.
Refreshed the rulespec methodology in rulespec-us#1543.
State premium audit
Qualified federal premiums are deductible through 2021, zero in 2022–2025, and restored from 2026. Retained amounts are after the federal phase-out and remain subject to state limits. Hawaii uses its own AGI phase-out.
al_interest_deductionseparate calculationar_itemized_deductions_joint/ar_itemized_deductions_indivuse source lists containinginterest_deductionaz_itemized_deductionsdynamically sums federal itemized components, retaininginterest_deductionca_itemized_deductions_pre_limitationsums federal components, includinginterest_deductionco_taxable_incomestarts from federaltaxable_income;co_federal_deduction_addbackalso reads federal itemized amountdc_itemized_deductionsreadsitemized_deductions_less_saltde_itemized_deductions_unitsource list containsinterest_deduction; separate-filing formula allocates componentsga_deductionsreads federalitemized_taxable_income_deductions; sharedstate_itemized_deductionsfederal branchhi_interest_deductionseparate calculationia_itemized_deductions_unit: pre 2023itemized_deductions_less_salt; from 2023 sum federal components; consolidated taxable-income route also uses federal taxable incomeid_itemized_deductionsreads claimed/total federal itemized deductionsks_itemized_deductionsreadsitemized_deductions_less_saltky_itemized_deductions_unitstartsitemized_deductions_less_saltand principal-residence interest capla_itemized_deductionssource list containsitemized_taxable_income_deductionsthrough 2021; medical-only list from 2022md_itemized_deductionsreadsitemized_deductions_less_saltme_itemized_deductions_pre_phaseoutreadsitemized_deductions_less_saltmn_itemized_deductionsreadsitemized_deductions_less_saltbefore state reductionmo_itemized_deductionsparameter startsitemized_taxable_income_deductions; additional indirect federal-taxable-income cap inmo_qualified_health_insurance_premiumsms_itemized_deductions_unitreadsitemized_deductions_less_saltnc_mortgage_and_property_tax_before_limitationseparate mortgage-interest calculationnd_taxable_incomeuses federaltaxable_income_deductions; shared federal state-itemized branchne_itemized_deductionsreadsitemized_deductions_less_saltnm_itemized_deductionsreadstotal_itemized_taxable_income_deductions;nm_salt_add_backuses less-SALT totalny_itemized_deductions_maxdirectly addsinterest_deductionok_itemized_deductionsreadsitemized_deductions_less_saltor_itemized_deductionsreadsitemized_deductions_less_saltsc_taxable_incomefederal taxable income through 2025;sc_state_tax_addbackalso reads federal itemized amountsciad.in_effecttrue from 2026 andsc_taxable_incomestarts from AGI. No premium deduction or new adjustment needed 2026.ut_federal_deductions_for_taxpayer_creditreads federal claimed/derived itemized totals; shared state-itemized branchva_itemized_deductionsreadsitemized_deductions_less_salt;va_reduced_itemized_deductionssumsinterest_deductionvia parameter listvt_capital_gains_exclusioncaps exclusion usingtaxable_incomewi_itemized_deduction_credit_potentialreadsitemized_deductions_less_saltThe NC 2026 conclusion follows enacted law; its 2026 forms are not yet published. NM/ND 2026 carry-through is a conformity inference from their federal bases. NY’s continued 2026 exclusion is also an inference from the restoration’s placement in §163(h)(3)(F) and the state’s pre-TCJA computation, pending 2026 forms. The archived Utah 2021 and Montana 2021 instructions were checked through official indexed text where PDF endpoints were unavailable; current Utah law independently confirms the credit base. Vermont's current statute separately states the federal-income cap for pre-2026 and 2026 periods.
Verification
Verified the final source at
b5ab1fb4cb3a3b0d04fe1e861b5db7ef57836064: 401 tests passed across 30 distinct files: 143 Python tests and 258 YAML cases. This includes every changed test file and the complete main-merge report table, deduplicated. The changes add 62 YAML cases. Targeted fail-before runs at1453ef98f2produced 36 expected failures and 28 passes across 15 files. The table distinguishes targeted before runs from full-file after runs.Every test ran separately, sequentially, in the foreground, using the prescribed interpreter with this checkout on
PYTHONPATHandOMP_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 MKL_NUM_THREADS=4 VECLIB_MAXIMUM_THREADS=4 NUMEXPR_NUM_THREADS=4 OMP_WAIT_POLICY=PASSIVE. Python files used-m pytest -q -p no:cacheprovider; YAML files used-m policyengine_core.scripts.policyengine_command test <file> -c policyengine_us.policyengine_us/tests/core/test_mortgage_points_and_premiums_properties.pypolicyengine_us/tests/core/test_second_residence_mortgage_properties.pypolicyengine_us/tests/core/test_uprating_series.pypolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/deductible_mortgage_interest.yamlpolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/deductible_mortgage_insurance_premiums.yamlpolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/interest_deduction.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/deductions/ky_disallowed_second_residence_interest.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/deductions/ky_itemized_deductions_indiv.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/deductions/ky_itemized_deductions_unit.yamlpolicyengine_us/tests/policy/baseline/household/expense/person/home_mortgage_interest_share.yamlpolicyengine_us/tests/policy/baseline/household/expense/tax_unit/home_mortgage_interest_tax_unit.yamlpolicyengine_us/tests/core/test_mortgage_debt_limit_invariants.pypolicyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/deductible_mortgage_interest_tax_unit.yamlpolicyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_joint.yamlpolicyengine_us/tests/policy/baseline/gov/states/ky/tax/income/integration.yamlpolicyengine_us/tests/policy/baseline/gov/states/ar/tax/income/deductions/itemized/ar_itemized_deductions_indiv.yamlpolicyengine_us/tests/policy/baseline/gov/states/ar/tax/income/deductions/itemized/ar_itemized_deductions_joint.yamlpolicyengine_us/tests/policy/baseline/gov/states/ca/tax/income/deductions/itemized/ca_itemized_deductions_pre_limitation.yamlpolicyengine_us/tests/policy/baseline/gov/states/de/tax/income/deductions/itemized/de_itemized_deductions_indv.yamlpolicyengine_us/tests/policy/baseline/gov/states/ia/tax/income/ia_itemized_deductions_unit.yamlpolicyengine_us/tests/policy/baseline/gov/states/mn/tax/income/mn_itemized_deductions.yamlpolicyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.yamlpolicyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/federal_itemization/mt_itemized_deductions_for_federal_itemization_joint.yamlpolicyengine_us/tests/policy/baseline/gov/states/mt/tax/income/deductions/itemized/mt_itemized_deductions_indiv.yamlpolicyengine_us/tests/policy/baseline/gov/states/wi/tax/income/wi_itemized_deduction_credit.yamlpolicyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/itemized/al_interest_deduction.yamlpolicyengine_us/tests/policy/baseline/gov/states/hi/tax/income/deductions/itemized/hi_interest_deduction.yamlpolicyengine_us/tests/policy/baseline/gov/states/ny/tax/income/taxable_income/deductions/itemized/ny_itemized_deductions_max.yamlpolicyengine_us/tests/policy/baseline/household/expense/person/deductible_mortgage_insurance_premiums_indiv.yamlpolicyengine_us/tests/policy/baseline/gov/states/nc/tax/income/deductions/nc_mortgage_and_property_tax_before_limitation.yamlFull-file verification also caught Core's empty-list
add()result in Iowa; empty dated exclusion lists now skip subtraction in Iowa, Arkansas, and Minnesota. Iowa's ordinary conforming-year cases and all changed state files pass.make formatpassed before each of the three commits; the final run left 7,331 files unchanged and lint passed.git diff --checkpassed. No microsimulation was run in this sandbox; the impact rerun remains with the hub.Round 2 follow-up verification at
6f9480b4a8efdad21cbe1f3a4a85125988d9b843: 35 YAML cases passed across five files (NY 5; AR individual 8 and joint 9; WI 6; HI 7). Each file ran separately, sequentially, in the foreground with this checkout onPYTHONPATHandOMP_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 MKL_NUM_THREADS=4 VECLIB_MAXIMUM_THREADS=4 NUMEXPR_NUM_THREADS=4 OMP_WAIT_POLICY=PASSIVE.make formatpassed (7,331 files unchanged; lint passed), andgit diff --checkpassed.The existing uncapped
mortgage_interestcalculations inal_investment_interest.py,nc_mortgage_and_property_tax_before_limitation.py, andhi_interest_deduction.pypredate this PR and remain for a separate follow-up PR.Axiom
axiom: TheAxiomFoundation/rulespec-us#1543 queued. The signed encoder run is OpenAI-billed and needs its own approval, and nothing encodes §163(h)(3) to import yet. The issue is dispatch-ready: it has the corpus citation
us-ky/statute/krs/141.019/document-1, the verbatim law, the required outputs, areview_finding, and companion tests matching this PR's YAML.🤖 Generated with Claude Code