Repository navigation
Conversation
The federal standard deduction and 17 state formulas read only whether the tax-unit head is claimed elsewhere, so a joint return where one spouse can be claimed was taxed differently depending on which spouse was labelled head. Each formula now applies its jurisdiction's rule for that case (either spouse, single filers only, per spouse, or only when every filer is claimed), using two new label-independent helpers. Adds swap-pair YAML cases and a Hypothesis property test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… barred The New Mexico, Maine and Hawaii renters gates counted filers who are not claimed elsewhere, so a tax unit with neither a head nor a spouse (252 in the default dataset) looked like one whose every filer was claimed. A new helper, every_filer_is_dependent_elsewhere, requires a claimed filer and no unclaimed one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ss EITC - Hawaii's dependent standard deduction uses earned income net of the deductible part of self-employment tax, as the N-11 worksheet does. - New Mexico's medical care credit needs a filer who is both 65 or older and not a dependent when a filer is a dependent elsewhere (NMSA 7-2-18.13). - The federal EITC without a qualifying child requires that no filer can be claimed as a dependent (IRC 32(c)(1)(A)(ii)(III), Publication 596), so Missouri's working family credit no longer reaches such a couple. - Hawaii's food/excise credit keeps minor children receiving public support (HRS 235-55.85(c)) on a joint return where one spouse can be claimed. - Comments label the readings the law does not settle, and the property test covers the EITC and the food/excise exemption amount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… meaning - The federal and Oregon dependent worksheets use earned income net of the deductible part of self-employment tax, as Hawaii's now does. - Hawaii's food/excise minor-child count excludes children who can be claimed by another taxpayer and the filers themselves (Form N-311 line 3). - claimed_as_dependent_on_another_return documents what it stands for: a §151 deduction for the person is allowable to another taxpayer, so a person whose would-be claimer files only for a refund is not one (Publications 501 and 596); rules on actually being claimed read it too. - Hawaii's renters comment labels the mixed joint reading as an inference; the Hawaii dependent threshold cites HRS 235-2.4(a)(3) on its page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A filer who can be claimed on another return is treated as having no dependents (IRC 152(b)(1); on a joint return either spouse counts) and has no personal exemption (IRC 151(d)(2)); one who is claimed gets no education credits (25A(g)(3)), student loan interest deduction (221(c)) or recovery rebate (6428(d)(2), 6428A(d)(2), 6428B(c)(2)). The model read none of these. Now the child tax credit and credit for other dependents, the under-13 child and dependent care qualifying person, exemptions_count and its RI, DE, OH, OR, WI, HI and NM readers, the recovery rebates, the education credits and the student loan interest deduction apply them symmetrically for joint returns. Georgia keeps its own counts; the HI, WI and Treasury exemption reforms follow the corrected count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NMSA chapter 7 article 2 bars "a dependent of another individual" from several credits and exemptions that the model gave anyway, and counts as dependents only those allowed under IRC 152, which leaves a return with a claimable filer none (IRC 152(b)(1)). Now: - the child income tax credit (7-2-18.34) needs a filer who cannot be claimed; - the 65+ medical care credit (7-2-18.13) needs a filer who is both 65+ and not claimable, and it and the 65+ medical exemption (7-2-5.9) no longer count a dependent's age; - the elderly property tax rebate (7-2-18) and the 100+ exemption (7-2-5.7) apply per filer; - the working families credit (7-2-18.15) applies the federal childless-filer dependent test and the filer-only age test; - the child day care credit (7-2-18.1) and the deduction for certain dependents (7-2-39) count no dependents when a filer can be claimed. On a joint return, a spouse who cannot be claimed keeps the credits that TRD's PIT-RC instructions say "your spouse may still qualify to claim". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the 65+ medical exemption for separate filers NMSA 7-2-18.34(J)(2) defines the child income tax credit's "qualifying child" by IRC 152(c), which has no identification number requirement, but nm_ctc counted eitc_child_count, which applies the EITC's Social Security number rule (IRC 32(c)(3)(D)). The new nm_ctc_qualifying_children counts 152(c) children whatever their Social Security number status, so a child with an ITIN now gets the credit. It also applies 152(c)(3)(A)'s rule that a child who is not disabled be younger than the filer (or either spouse on a joint return), which the shared EITC helper does not. NMSA 7-2-5.9 and the PIT-ADJ line 18 instructions give the $3,000 65+ medical care expense exemption with no halving for married filing separately; the halving sentence on PIT-ADJ belongs to the organ donation deduction on the next line (7-2-36(B)). The threshold stays at the PIT-ADJ "$28,000 or more"; the statute says expenses that "exceed" $28,000, a reading left for review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 10, 2026
Contributor
Author
|
Handing off to the US + core hub.
Nothing else is pending from the opening session. The worktree |
This was referenced Oct 11, 2026
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.
Summary
This PR fixes two New Mexico problems found while auditing the claimable-filer rules (research:
nm.out.mdsections 2 and 4).nm_ctccounted children with the federaleitc_child_count. That count applies the EITC's Social Security number rule (IRC 32(c)(3)(D)). Section 7-2-18.34(J)(2) instead defines "qualifying child" as "'qualifying child' as defined by Section 152(c) of the Internal Revenue Code", plus a public-assistance support proviso, and IRC 152(c) has no identification number requirement. The newnm_ctc_qualifying_childrencounts 152(c) children whatever their Social Security number status. An otherwise-qualifying child with an ITIN, of an independent filer with AGI $20,000, now gets $637 in 2025 (it was $0). The count also applies 152(c)(3)(A)'s rule that a child who is not disabled must be "younger than the taxpayer claiming such individual as a qualifying child" (on a joint return, younger than either spouse; Publication 596). The shared EITC helper does not apply this rule, so before this PR a 22-year-old student sibling of a 20-year-old filer counted.This PR is stacked on
claimable-filer-nm(not yet opened as a PR), which stacks onclaimable-filer-federaland #10024. That branch adds the claimant test ("not a dependent of another individual") tonm_ctcand the filer-only age test to the exemption. Both are kept here.nm_ctc_qualifying_children(new)is_eitc_qualifying_child, the model's 152(c) test before any identification rule (relationship, and age under 19, a full-time student under 24, or permanent and total disability), and who are also younger than the older filer or disabled (152(c)(3)). No 152(b)(1) zeroing, because the section counts qualifying children, not dependents.nm_ctceitc_child_countnm_ctc_qualifying_children. The claimant test and the one-half for married filing separately are unchanged.nm_medical_expense_exemptionDecisions taken from the sources
>= $28,000(instruction reading) until Max rules (reading 1). The model already did this, so the change moves no number.Readings for Max (for the US + core hub to queue)
has_tin).has_tinorhas_itincolumn, sohas_tinis True for everyone and the two readings give the same microsim numbers.Out of scope: the claimable-filer readings (mixed-joint child credit, medical credit ages, LICTR extras) belong to
claimable-filer-nm.Invariants
These hold for every input, and Hypothesis and a seeded population check them in
policyengine_us/tests/core/test_nm_ctc_children_medical_exemption_invariants.pyfor 2023-2026:nm_ctc_qualifying_childrenequals an independent count of the 152(c) tests: a dependent who is the filer's child (not a parent or grandparent) and is either permanently and totally disabled, or younger than the older filer and under 19 or a full-time student under 24. It is 0 outside New Mexico.nm_ctc_qualifying_children >= eitc_child_count. The federal helper lacks the relative-age rule, so the two counts are not ordered otherwise.nm_ctc.nm_ctcnornm_medical_expense_exemption.nm_ctc(SEPARATE) = nm_ctc / 2(7-2-18.34(G)) andnm_medical_expense_exemption(SEPARATE) = nm_medical_expense_exemption.nm_medical_expense_exemptionis $3,000 exactly when a filer (not a dependent) is 65 or older and expenses are at least $28,000, and 0 otherwise.The seeded test adds crafted units: an older or same-age student sibling, an older disabled sibling, a child younger than only one spouse, an elderly dependent parent, and a 65+ filer at exactly $28,000. It also asserts that the population reaches the cases the invariants are about: a counted child without an SSN who gets a positive credit, a child who fails the relative-age rule, single filers with a credit and with the exemption, and a return whose only 65+ person is a dependent.
Mutation check. At
9a27b36406, each fixed bug was put back in turn and the property test was run. It failed every time, and it passed on the unmutated code (5 passed).& meets_eitc_identification_requirements). Caught by invariant 1. Minimal case: an 18-year-old NM filer with a newborn who has an ITIN counted 0 against a reference of 1.Cost. The two tests add about 1.3 s of test time (Hypothesis 0.98 s, plus 0.07–0.09 s for each seeded year). The whole pytest process, including the model import, took 35.7 s wall time with a 1.09 GB peak resident set, measured locally on macOS with
/usr/bin/time -l(not Linux CI). The file sits inpolicyengine_us/tests/core/, beside the existing claimable-filer invariant tests, so it runs in the same CI group and adds no job.Tests
nm_ctc.yaml: the ITIN child of an independent filer with AGI $20,000 in 2025 gets $637 (eitc_child_count0); an SSN control also gets $637; MFS gets $318.50. The 2023 amount cases now inputnm_ctc_qualifying_children.nm_ctc_qualifying_children.yaml:nm_medical_expense_exemption.yaml: MFS gets $3,000 in 2023 and 2025; $28,000 exactly gives $3,000 (instruction reading); $27,999 gives $0.9a27b36406, run locally through the shared heavy-lock runner:salt_refund_integration,alternative_minimum_tax,state_itemized_deductions,healthcare_benefit_value,household_health_benefits): 748 cases passed (357 + 391), 0 failed.test_dependent_elsewhere_head_spouse_swap_invariance.pyand the base branch'stest_claimable_filer_nm_invariants.py: 12 passed.pr.yamlruns only for PRs intomain, and draft PRs skip it.Independent review
7c2b1b7232): REQUEST_CHANGES.9a27b36406): APPROVE, no new findings.Microsimulation impact
Four real microsimulation runs on the default dataset (
populace_us_2024.h5@populace-us-2024-spm-20260909): 2025 and 2026, each with the base and this PR. The base is theclaimable-filer-nmmodel code. The runs used11473a319d, whose variables and parameters are identical to the current base4b0709e55f; the two differ only in tests and the changelog. Comparisons are record by record.nm_ctc, basenm_ctc, this PRnm_medical_expense_exemptionrecords changedeitc_child_countonly in the 8 records whose qualifying children have no SSN-type card, and those records carry almost no weight in this calibration. No New Mexico record has a counted EITC child who fails the relative-age rule. Weighted New Mexico qualifying children are 529,712 under both counts in 2025.nm_refundable_credits,nm_income_tax,state_income_taxandhousehold_net_incomemove in the same 8 records and by the same amounts. Federalincome_taxand the New Mexico exemptions, taxable income and pre-credit tax do not change.axiom: us-nm/statute/7-2-18.34 TheAxiomFoundation/rulespec-us#1628 queued | us-nm/statute/7-2-5.9 TheAxiomFoundation/rulespec-us#1628 queued (no module exists; the signed encode is OpenAI-billed and needs Max's approval, d1235)
🤖 Generated with Claude Code