Skip to content

Count New Mexico child credit children under IRC 152(c); do not halve the 65+ medical exemption for separate filers - #10047

Draft
MaxGhenis wants to merge 10 commits into
mainfrom
nm-ctc-152c-medical-exemption
Draft

MaxGhenis wants to merge 10 commits into
mainfrom
nm-ctc-152c-medical-exemption

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR fixes two New Mexico problems found while auditing the claimable-filer rules (research: nm.out.md sections 2 and 4).

  1. Child income tax credit (NMSA 7-2-18.34). nm_ctc counted children with the federal eitc_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 new nm_ctc_qualifying_children counts 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.
  2. 65+ medical care expense exemption (NMSA 7-2-5.9). The formula halved the $3,000 for married filing separately. Neither the statute nor the 2025 PIT-ADJ line 18 instructions ("enter $3,000 on line 18") provide for halving. The halving sentence on that PIT-ADJ page belongs to the organ donation deduction on line 19, which mirrors 7-2-36(B). Where the Legislature wants halving it says so: 7-2-18.13(B) does it for the companion medical care credit, and 7-2-36(B) does it for organ donation. This PR removes the halving.

This PR is stacked on claimable-filer-nm (not yet opened as a PR), which stacks on claimable-filer-federal and #10024. That branch adds the claimant test ("not a dependent of another individual") to nm_ctc and the filer-only age test to the exemption. Both are kept here.

Variable Before After Source
nm_ctc_qualifying_children (new) none Counts children who pass 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. NMSA 7-2-18.34(J)(2); IRC 152(c); 2025 PIT-RC p.10
nm_ctc Per-child amount × eitc_child_count Per-child amount × nm_ctc_qualifying_children. The claimant test and the one-half for married filing separately are unchanged. 7-2-18.34(A), (B), (G), (J)(2)
nm_medical_expense_exemption $3,000, or $1,500 for married filing separately $3,000 for every filing status NMSA 7-2-5.9(A); PIT-ADJ line 18

Decisions taken from the sources

  • No SSN requirement for the NM count. The statute is explicit. The 2025 PIT-RC worksheet asks only for the "total number of qualifying children".
  • No halving for married filing separately. The statute and the instructions agree.
  • The threshold stays at >= $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)

  1. Medical exemption at exactly $28,000. NMSA 7-2-5.9(A) requires expenses that "exceed twenty-eight thousand dollars ($28,000)". PIT-ADJ line 18 says "of $28,000 or more", and TRD tells filers who qualify for the 7-2-18.13 credit (which uses "equal ... or more") that they also qualify for this exemption.
    • Instruction reading (current model, kept): $3,000 at exactly $28,000.
    • Statute reading: $0 at exactly $28,000.
    • Microsim records at exactly $28,000: none, in 2025 or 2026.
  2. Two spouses who are both 65 or older, on one joint return. "Any individual sixty-five years of age or older may claim an additional exemption" could allow $3,000 per qualifying spouse when each paid more than $28,000. PIT-ADJ has one line ("enter $3,000").
    • Kept: $3,000 per return.
    • Alternative: up to $6,000.
  3. A child with neither an SSN nor an ITIN (child income tax credit). 152(c) has no identification requirement, so the model counts such a child. PIT-1 asks for "your dependent's ... correct SSN or ... the correct ITIN" for each dependent listed on line 8.
    • Kept: the child counts.
    • Alternative: require an SSN or ITIN (has_tin).
    • The default dataset has no has_tin or has_itin column, so has_tin is 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.py for 2023-2026:

  1. Reference count. nm_ctc_qualifying_children equals 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.
  2. Superset. In New Mexico, on a return where every dependent is younger than the older filer, nm_ctc_qualifying_children >= eitc_child_count. The federal helper lacks the relative-age rule, so the two counts are not ordered otherwise.
  3. Identification invariance. Giving every dependent a Social Security number changes neither the count nor nm_ctc.
  4. Label invariance. Exchanging the head and spouse labels changes neither the count, nm_ctc nor nm_medical_expense_exemption.
  5. Separate filing. For a single adult, nm_ctc(SEPARATE) = nm_ctc / 2 (7-2-18.34(G)) and nm_medical_expense_exemption(SEPARATE) = nm_medical_expense_exemption.
  6. Reference exemption. nm_medical_expense_exemption is $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).

  • SSN rule (& 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.
  • MFS halving. Caught by invariant 5. A single 65-year-old with exactly $28,000 got $1,500 when filing separately.
  • No relative-age test. Caught by invariant 1 on the crafted unit of a 20-year-old filer with a 22-year-old student sibling, which counted 1 against a reference of 0.

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 in policyengine_us/tests/core/, beside the existing claimable-filer invariant tests, so it runs in the same CI group and adds no job.

Tests

  • YAML.
    • nm_ctc.yaml: the ITIN child of an independent filer with AGI $20,000 in 2025 gets $637 (eitc_child_count 0); an SSN control also gets $637; MFS gets $318.50. The 2023 amount cases now input nm_ctc_qualifying_children.
    • New nm_ctc_qualifying_children.yaml:
      • an ITIN child, and a child with no SSN card;
      • the 152(c)(3) age edges: 18, 19, a 23- and a 24-year-old student, and a disabled 30-year-old;
      • a dependent parent (relationship test);
      • the relative-age rule: an older student sibling and a same-age student sibling both give 0; an older disabled sibling gives 1; a child younger than only one spouse gives 1 under both labellings;
      • the mixed-joint return under both labellings, and a non-NM household.
    • 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.
  • Results at 9a27b36406, run locally through the shared heavy-lock runner:
    • All 73 New Mexico YAML files, plus the five other files with New Mexico cases (salt_refund_integration, alternative_minimum_tax, state_itemized_deductions, healthcare_benefit_value, household_health_benefits): 748 cases passed (357 + 391), 0 failed.
    • New invariants: 5 passed.
    • test_dependent_elsewhere_head_spouse_swap_invariance.py and the base branch's test_claimable_filer_nm_invariants.py: 12 passed.
    • CI does not run yet: pr.yaml runs only for PRs into main, and draft PRs skip it.

Independent review

  • Round 1 (GPT-6.1 Sol, at 7c2b1b7232): REQUEST_CHANGES.
    • Blocking: the count missed 152(c)(3)(A)'s rule that the child be "younger than the taxpayer claiming such individual". Fixed.
    • Nit: the $28,000 comment presented TRD practice as verified. Reworded.
    • The reviewer confirmed the ITIN reading, the MFS removal and the arithmetic.
  • Round 2 (GPT-6.1 Sol, at 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 the claimable-filer-nm model code. The runs used 11473a319d, whose variables and parameters are identical to the current base 4b0709e55f; the two differ only in tests and the changelog. Comparisons are record by record.

2025 2026
nm_ctc, base $167.18M $163.18M
nm_ctc, this PR $167.18M $163.18M
Weighted change +$3.11 +$3.13
Tax-unit records changed 8 (all up, at most $848) 8 (all up, at most $867)
Combined weight of those records 0.006 tax units 0.006 tax units
nm_medical_expense_exemption records changed 0 0
  • Child income tax credit. In New Mexico, the new count exceeds eitc_child_count only 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.
  • Medical exemption. 10 New Mexico records (6,835 weighted tax units) have the exemption in 2025, and 15 records (10,862) in 2026. None files separately, so removing the halving changes nothing in the data. It changes the result for separate filers who enter their own households.
  • Downstream. nm_refundable_credits, nm_income_tax, state_income_tax and household_net_income move in the same 8 records and by the same amounts. Federal income_tax and 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

MaxGhenis and others added 10 commits October 8, 2026 11:03
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>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Handing off to the US + core hub.

  • Head: 9a27b3640625778ef04da406fa81dd247c2d0548. It is stacked on claimable-filer-nm at 4b0709e55f, which stacks on claimable-filer-federal (23c6229b20) and Make rules for a filer claimed elsewhere independent of which spouse is labelled head #10024. Neither stacked branch has a PR yet; the owner session is "Apply unmodeled rules for filers claimed elsewhere".
  • Independent review: two rounds of GPT-6.1 Sol.
    • Round 1, Subfleet job 20261009-122618-nmctc-152c-review: REQUEST_CHANGES (the 152(c)(3)(A) relative-age rule and a wording nit). Both fixed.
    • Round 2, at this head, job 20261010-055342-nmctc-152c-review-r2: APPROVE.
    • Verdicts are in ~/reviews/us-hub/nm-ctc-152c-medical-exemption/review/.
  • Passed locally at this head through the heavy-lock runner:
    • all 748 New Mexico YAML cases;
    • the new invariants (5 passed);
    • the swap and NM claimable-filer invariants (12 passed);
    • a mutation check in which all 3 mutations were killed.
    • Real microsims for 2025 and 2026, base vs PR: nm_ctc +$3.11 and +$3.13; no change to the medical exemption.
  • CI has not run, and cannot yet. pr.yaml runs only on PRs into main, and drafts skip CI. That is why the PR is still a draft. Once claimable-filer-nm merges:
    1. retarget to main;
    2. rebase this single commit, with git rebase --onto upstream/main <old nm head> after a squash merge;
    3. mark ready;
    4. land on green CI.
  • Axiom: Encode NMSA 7-2-18.34 (NM child income tax credit, IRC 152(c) count) and 7-2-5.9 (65+ medical care expense exemption) TheAxiomFoundation/rulespec-us#1628, queued (pe-parity, dispatch-ready). The billed-encode approval is d1235 and does not block this merge.
  • Readings for the hub to queue for Max. Each keeps a default and none blocks the merge; details are in the PR body.
    1. Medical exemption at exactly $28,000: statute "exceed" or PIT-ADJ "or more". Kept: or more. No microsim records sit at $28,000.
    2. Two 65+ spouses on one joint return: $3,000 per return (kept) or per spouse.
    3. A child with neither an SSN nor an ITIN: counted (kept), or require has_tin. There is no microsim effect.
  • Follow-ups owed. No chips, per Fleet ops; full text is in ~/reviews/us-hub/nm-ctc-152c-medical-exemption/STATE.md.
    • The federal is_eitc_qualifying_child lacks the same relative-age rule. It affects the federal EITC and the CA, CO, DC, IL, MN and WA EITCs.
    • nm_eitc sizes the credit with SSN-only children, but NMSA 7-2-18.15(A) waives the federal identification requirement.

Nothing else is pending from the opening session. The worktree ~/PolicyEngine/_worktrees/nm-ctc-152c-medical-exemption is clean and pushed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant