Repository navigation
Subtract Mississippi's HSA deduction once, from the account holder - #9865
Conversation
ms_agi_adjustments added the tax-unit health_savings_account_ald to a person-level sum, so policyengine-core projected it onto every member: a couple subtracted it twice, and each dependent with income once more. Mississippi excludes HSA contributions from the account holder's gross income (Miss. Code Ann. 71-9-11(3)) and Form 80-105 reports each spouse's adjustments in their own column. The new ms_health_savings_account_adjustment gives the head and spouse their own health_savings_account_ald_person amounts, reconciled to the tax unit's deduction with person_share_of_tax_unit_amount; without them the head takes it. Dependents take none (26 USC 223(b)(6)). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Roles are inputs so a drawn dependent stays one, and the test runs three Hypothesis batches and one seeded population (47 s, 1.0 GB locally). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Give the dependent case its own HSA amount and draw dependents' own amounts in the property test, so the dependent zeroing is exercised. - Pin the head default's limitation: a head with less Mississippi income than the deduction loses the excess to the AGI floor. - Drop the property test's re-implementation of the helper; keep the conservation, bounds, attribution and AGI-reduction properties. - Lead the dependent rationale with the return, cite 223(b)(6) second. - Correct the adjustments-list line comment (line 59) and a test name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hand-off to the US + core hub. Head Review (Opus 5.5,
Passed locally.
Microsim (default dataset, Axiom: TheAxiomFoundation/rulespec-us#1509, queued ( No Max decision needed. This is a bug fix that moves aggregates. Dependencies: none. It touches only Mississippi files and the new Follow-ups (not in this PR):
|
|
US + core hub merge audit, us#9865 at
|
#9865 (HSA deduction from the account holder) and #9885 (combine a negative Mississippi joint column with the other column) each passed alone; together the head's AGI column is -2,000 rather than floored at 0, and the joint tax combines it, so the whole deduction is used. Main has failed this case since #9865 landed. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… gets the whole group amount) (#9897) * Guard against person variables that add group variables policyengine-core evaluates adds/subtracts with calculate(..., map_to=<the variable's entity>), and map_result projects a group value onto every member with no split. A person variable that lists a tax unit or SPM unit variable therefore gives each member the whole group amount, and a group total counts it once per member (MT casualty loss #9888, MS HSA #9865, WV senior #9856, and OH, IL, CA Riverside and LA cases found the same day). The new code-health test scans the shared baseline system, resolving parameter-path lists across their whole history. Three boolean enrollment flags are allowed; the 10 current cases are known bugs that may only be removed. A premise test pins the projection on core's template country. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Refresh group projection registry and scope boolean exemptions to reviewed edges --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Mississippi subtracted a tax unit's health savings account deduction from every member's income.
ms_agi_adjustmentsis a Person variable whoseaddslist held the TaxUnit variablehealth_savings_account_ald, and policyengine-core maps a group value onto a person target by copying it to each member (Simulation.map_result). A couple therefore subtracted the deduction twice, and each dependent with income once more (their Mississippi net income goes to the head's AGI). Reported in #9801's hand-off as a pre-existing follow-up.The law
The change
ms_health_savings_account_adjustment(new, Person) attributes the tax unit'shealth_savings_account_aldto the head and spouse with Keep dependents' above-the-line deductions off the filer's AGI #9801'sperson_share_of_tax_unit_amount. Each gets their ownhealth_savings_account_ald_person, scaled so the shares sum to the tax unit's deduction. A dependent's share is zero, even if the dependent has their own amount: a dependent who holds an account reports it on their own return.ms_agi's zero floor. A YAML case pins this; a per-person amount on the spouse avoids it. Without the account holder's identity, a 50/50 split (the federal per-person AGI convention) is no better grounded in law.health_savings_account_ald_person(new Person input) is each account holder's own deduction. It only splits the deduction:health_savings_account_aldstays the tax-unit input the dataset supplies. Giving that variable a formula would stop core from uprating the 2024 dataset value, because core runs a formula before it uprates.ms_health_savings_account_adjustmentin place ofhealth_savings_account_ald.Tests
ms_health_savings_account_adjustment.yamlhas 9 cases:tests/core/test_ms_health_savings_account_adjustment_invariants.pyruns three Hypothesis batches of 10–40 Mississippi tax units, plus a seeded population of 200. Units are single, married filing separately, head of household, or joint with and without dependents. Dependents may have their own HSA amounts.bab1a47c60), the joint case givesms_agi_adjustments[3,000, 3,000] where [3,000, 0] is expected; the dependent case gives [3,000, 3,000, 3,000]. A main-compatible probe of the property test found the deduction counted 2 to 4 times in 120 of 200 seeded units, and total Mississippi AGI reduced by more than the deduction in 89 units (by up to $17,890). On this branch: 0 and 0. All 457 Mississippi YAML cases andtest_ald_determinism.py(9/9) pass.make test-other-python-rest-core), with no new jobs or runners. GitHub Actions has had every recent PR-workflow run queued, so there is no fresh Linux timing or memory report for that group to compare against.Invariants (for every input)
ms_health_savings_account_adjustmentsum to the tax unit'shealth_savings_account_ald, and that deduction appears exactly once in the members'ms_agi_adjustments.Impact
Real microsimulations on the default dataset (
populace_us_2024.h5@populace-us-2024-spm-20260909), one run per checkout and year under the shared heavy lock (lockrun.sh,run.py,compare.pyin~/reviews/pe-us-merge-backlog-2026-10-02/impact/), compared record by record; enum arrays are not compared. Outputs:~/reviews/pe-us-ms-hsa-qbid-2026-10-06/microsim/. Base:mainbab1a47c60; branch headd5e8301b9c.ms_agi_adjustments, persons)ms_agi)health_savings_account_aldThe removed adjustments are the extra copies of the deduction on spouses and dependents. Most of those people had too little Mississippi income for the copy to matter, because
ms_agifloors at zero, so AGI rises by much less than the adjustments fall. No household's Mississippi tax falls.Axiom
axiom: TheAxiomFoundation/rulespec-us#1509 queued
Mississippi's HSA exclusion is not encoded, and Miss. Code Title 71 ch. 9 is not in the pinned corpus. Ingesting it is the encoder blocker; signed encoder runs also need Max's approval.
🤖 Generated with Claude Code