Skip to content

Apply New Mexico's rules for a filer who can be claimed as a dependent - #10088

Merged
MaxGhenis merged 30 commits into
mainfrom
claimable-filer-nm
Oct 16, 2026
Merged

MaxGhenis merged 30 commits into
mainfrom
claimable-filer-nm

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

New Mexico bars "a dependent of another individual" from several credits and exemptions, and counts as dependents only those allowed under IRC 152, which leaves a return with a claimable filer none (IRC 152(b)(1)). The model applied none of these, and two 65+ provisions counted a dependent's age as if it were a filer's. On a joint return, TRD's PIT-RC instructions say a spouse who is not a dependent "may still qualify to claim rebates or credits" (2025 PIT-RC p.2), so those credits stay for that spouse.

Which fact each rule reads (#10024 separates them): the "not a dependent of another individual" rules (child income tax credit, medical care credit, property tax rebate, centenarian exemption) read whether a filer can be claimed; the rules that need dependents (child care credit child, certain-dependents deduction) and the childless EITC read whether a filer can be claimed and the filing exception does not apply (Pub. 501, Pub. 596).

Stacked on the federal claimable-filer PR (which corrects exemptions_count and with it the low-income comprehensive tax rebate and the low- and middle-income exemption) and on #10024.

Formula Rule now Source
nm_ctc Needs a filer who cannot be claimed; the child count is not changed here (it still reads eitc_child_count, which #10047 replaces with a 152(c) count) NMSA 7-2-18.34(A): "a taxpayer who is a resident and is not a dependent of another individual"; (J)(2) imports 152(c), not 152(b)(1); PIT-RC p.10
nm_medical_expense_credit A filer who is both 65 or older and not claimable; a dependent's age no longer counts NMSA 7-2-18.13(A): "a taxpayer ... who is sixty-five years of age or older and who is not a dependent of another taxpayer"; PIT-RC line 23: "If you or your spouse are 65 years of age or older"
nm_medical_expense_exemption A filer 65 or older; no dependency bar NMSA 7-2-5.9(A): "Any individual sixty-five years of age or older"; PIT-ADJ line 18: "If you or your spouse are 65"
nm_eitc_demographic_eligible Childless route needs no filer who can be claimed outside the filing exception (either spouse bars, as federally) and a filer of eligible age. The child route needs a qualifying child under IRC 32(c)(3) before the identification rule: a dependent under 19, a student under 24, or permanently and totally disabled. It counted any member under 18, a filer included, and missed qualifying children aged 18 or over NMSA 7-2-18.15 imports federal eligibility apart from age and ID; IRC 32(c)(1)(A)(ii)(II)-(III), 32(c)(3); Pub. 596 Rule 12
nm_property_tax_rebate_eligible A filer who is both 65 or older and not claimable NMSA 7-2-18: "a dependent of another individual"
nm_hundred_year_exemption Each spouse 100 or older qualifies only if not claimable NMSA 7-2-5.7; PIT-ADJ: another person "cannot claim the centenarian as a dependent"
nm_cdcc_eligible_child No eligible child when either filer can be claimed and the filing exception does not apply NMSA 7-2-18.1 counts IRC 152 dependents; 152(b)(1)
nm_deduction_for_certain_dependents No dependents to count when either filer can be claimed and the filing exception does not apply NMSA 7-2-39 defines dependent by IRC 152; 152(b)(1)

Readings for Max (queue via the US + core hub)

  1. Medical care credit, mixed ages. NMSA 7-2-18.13(A) puts the age and dependency tests on the same taxpayer, so a joint return whose only 65+ spouse can be claimed gets $0. The form-literal alternative (either spouse 65+, any spouse not claimable) gives $2,800. Make rules for a filer claimed elsewhere independent of which spouse is labelled head #10024 uses the same-filer reading only when a filer can be claimed; this PR also drops a dependent's age in every case.
  2. Child income tax credit, mixed joint. A spouse who cannot be claimed keeps the credit and the 152(c) children (recommended); importing 152(b)(1) too would give $0.
  3. Low-income rebate age and blind extras (in the federal PR): the claimable spouse's age-65 and blind exemptions still count under 7-2-14(C)'s "each individual ... included in the return"; dropping them is the alternative.

Not changed: the centenarian exemption still treats all of a couple's income as community income (half each), which predates this PR; an independent centenarian with $10,000 of separate income and a younger spouse gets $5,000 exempted, not $10,000. Also not changed: the medical expense exemption's threshold. The code and the PIT-ADJ instructions use "$28,000 or more"; NMSA 7-2-5.9(A) says expenses that "exceed" $28,000. #10047 documents that conflict.

Invariants

  1. Swap invariance of every changed output under either head/spouse labelling.
  2. Monotonicity. Marking another filer as claimed never raises any changed output.
  3. Unchanged when no filer can be claimed (a filer who can be claimed but is not claimed does trigger these rules), except three intended changes: the 65+ tests and the EITC age test now look only at filers (so a dependent's age no longer qualifies a return), and the EITC child route needs a qualifying child under IRC 32(c)(3): it now counts one aged 18 or over (before, such a return usually qualified through the child's own age) and no longer counts a filer under 18 or a child who is not a qualifying child.

Tests

  • YAML: variable-named cases for every changed formula. Each joint case with exactly one claimable spouse, and each control whose spouses differ, appears under both head/spouse labellings. Run locally at 81f0f97d1b: the changed YAML files and the test folders next to every changed variable (18 files): 164 passed, 0 failed.
  • Property test policyengine_us/tests/core/test_claimable_filer_nm_invariants.py for 2023, 2025 and 2026. Hypothesis batches check invariant 1; a seeded New Mexico population and crafted centenarian couples check 1 and 2. 4 tests passed, 0 failed, in 35 s with a peak memory footprint of 1.8 GB (/usr/bin/time -l).

Hub microsimulation impact (current head)

A real microsimulation on the default dataset, main at the merge base f5d7ffdea5 against this PR's head 147205c38e, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.

Output 2025 change 2026 change 2025 records changed (weighted) 2026 records changed (weighted)
nm_income_tax +162,227 +169,023 4 (3,212) 4 (3,235)
nm_eitc -162,227 -169,023 4 (3,212) 4 (3,235)
nm_ctc +0 +0 0 (0) 0 (0)
nm_medical_expense_credit +0 +0 0 (0) 0 (0)
nm_medical_expense_exemption +0 +0 0 (0) 0 (0)
state_income_tax +162,227 +169,023 4 (3,212) 4 (3,235)
income_tax +0 +0 0 (0) 0 (0)
household_net_income -162,244 -169,013 3 (3,212) 3 (3,235)
household_benefits +0 +0 0 (0) 0 (0)

The whole change is in the New Mexico EITC. It falls on 4 records (3,212 weighted) in 2025, and NM income tax rises by exactly that amount. The PR changes the NM EITC rule so the child route opens only for an EITC qualifying child, and the age test applies only to the filers. Its claimability condition can't fire on the default dataset, which has no claimed_as_dependent_on_another_return input. So the loss comes from those two rule changes. The PR's other NM changes move none of the measured outputs.

Comparison files are in fixes/10088-impact/ on the hub host.

Microsimulation impact

Real microsimulations on the default dataset (hf://datasets/policyengine/populace-us/populace_us_2024.h5@populace-us-2024-spm-20260909) for 2025 and 2026, compared record by record. In that dataset no person can be claimed as a dependent on another return (claimable_as_dependent_on_another_return is true for 0 of 166,321 people), so every rule gated on it is inactive there; the runs check that nothing else moves.

This stack's federal branch (35a2cbcbb9) against a local merge of the four state branches onto it (13d24ac157). Each state branch changes only its own state's variables, so the comparison is split by state.

  • 2025:
Variable (weighted total) Base This change Difference Records changed (weighted)
household_net_income (New Mexico households) n/a n/a -191,795 3 (3,212)
nm_eitc_demographic_eligible 825,945 tax units 806,211 tax units -19,734 tax units 22 (19,734)
nm_eitc $147,865,111 $147,673,317 -191,794 4 (3,212)
  • 2026:
Variable (weighted total) Base This change Difference Records changed (weighted)
household_net_income (New Mexico households) n/a n/a -199,836 3 (3,235)
nm_eitc_demographic_eligible 831,843 tax units 811,968 tax units -19,875 tax units 22 (19,875)
nm_eitc $149,969,937 $149,770,108 -199,828 4 (3,235)

What changes (22 records each year, all with federal EITC $0): 16 are one-person tax units of a filer aged 3 to 17. Before, tax_unit_children counted that filer as the return's own child, which opened the child route; four of them got a New Mexico EITC of $11 to $62. Now the child route needs a qualifying child, and they are below New Mexico's minimum childless age. The other six are returns whose filers are all 67 or older, where only an adult dependent met the age range; their New Mexico EITC was already $0. Household net income changes in the three households that hold the four tax units.

Axiom parity

axiom: us-nm/statutes/7-2-18/34 queued (NM1: TheAxiomFoundation/rulespec-us#1687) | us-nm/statutes/7-2-18/13 queued (NM1: TheAxiomFoundation/rulespec-us#1687) | us-nm/statutes/7-2-5/9 queued (NM1: TheAxiomFoundation/rulespec-us#1687) | us-nm/statutes/7-2-18/15 queued (NM1: TheAxiomFoundation/rulespec-us#1687) | us-nm/statutes/7-2-39 queued (NM1: TheAxiomFoundation/rulespec-us#1687) | us-nm/statutes/7-2-18 queued (NM1: TheAxiomFoundation/rulespec-us#1687) | us-nm/statutes/7-2-18/1 queued (NM1: TheAxiomFoundation/rulespec-us#1687) | us-nm/statutes/7-2-5/7 queued (NM1: TheAxiomFoundation/rulespec-us#1687)

Every queued item is a pe-parity issue filed in TheAxiomFoundation/rulespec-us on 2026-10-12 (verbatim law, required outputs, review finding, companion tests).

🤖 Generated with Claude Code

Merge with main after #10087

Merged main at f5d7ffdea5a03705695ac51b1cdf9bfd678c0198 after #10087 was squash-merged.

  • nm_medical_expense_credit.py: kept main's reviewed federal behavior and gross-medical-expense/premium-restoration calculation and documentation, then reapplied this PR's same-filer age and claimability eligibility rule.
  • nm_medical_expense_exemption.py: kept main's gross-medical-expense/premium-restoration calculation and documentation, then reapplied this PR's filer-only age rule and reference.
  • nm_medical_expense_credit.yaml and nm_medical_expense_exemption.yaml: retained all main cases and appended this PR's older-dependent and spouse-order cases unchanged.
  • ca_cdcc_relevant_expenses.yaml: took main verbatim; this PR had not changed it from its federal base.

Kept unrelated main changes, including New Mexico premium assistance and capital gains, and main's removal of already-consumed federal/head-swap changelog fragments. The final diff against main has the same 18 files and identical added/deleted lines as the original 35a2cbcbb9 to 81f0f97d1b diff. The nm_eitc_demographic_eligible child route needed by #10047 is unchanged.

Validation at 147205c38e6cca67225b4c599948d5cf43966157: all 104 YAML cases in the eight changed YAML files and all four New Mexico invariant tests passed, with one file per process and the requested thread caps. Ruff 0.15.5 format --check and check passed on all nine changed Python files; make format passed without edits.

MaxGhenis and others added 29 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>
- Child and dependent care: childcare expenses do not count on a return with a
  claimable filer unless a child under 13 still qualifies (IRC 21(b)(2)(A)(ii)).
- Tuition and fees deduction: not allowed to a filer who can be claimed (IRC
  222(c)(3)), so the education credit bar no longer makes such a filer eligible.
- Recovery rebates: the Armed Forces exception waives the identification rule
  only, not the exclusion of a spouse who is another taxpayer's dependent.
- Georgia: the contributed refundable credit and SB 520 reforms count the same
  children as ga_ctc_potential through a new ga_ctc_eligible_child.
- Education credits and student loan interest read the claimed input directly,
  since IRC 25A(g)(3) and 221(c) turn on an actual claim.
- One reference per source document; quote IRC 24(h)(4)(A) exactly.
- Tests: mixed-recipient care, tuition deduction, military rebates, Georgia
  refund cap, and the swapped New Mexico rebate case; the property test now
  covers the state readers of the exemption count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- EITC: the child route counts qualifying children under IRC 32(c)(3) (a
  dependent under 19, a student under 24, or permanently and totally disabled)
  instead of members under 18, so the filer-only age test and the dependent
  test no longer deny a return with an older qualifying child.
- Property tax rebate reference opens the page with the qualifications.
- Tests: older qualifying children, swapped unclaimed controls, and centenarian
  cases in the property test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing children

The child route still counts members under 18 (so abstract fixtures and
head-less units behave as before) and adds qualifying children under IRC
32(c)(3) aged 18 or over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	policyengine_us/tests/policy/baseline/gov/states/oh/tax/income/exemptions/personal/oh_personal_exemptions_eligible.yaml
#10024 now separates three facts: is claimed, can be claimed, and the would-be
claimant's filing exception.

- IRC 152(b)(1) gates (child tax credit, credit for other dependents, under-13
  care child and its expenses, dependents in exemptions_count, ARPA dependents,
  Ohio dependents, the Hawaii and Wisconsin reforms) read
  head_or_spouse_is_dependent_elsewhere_without_filing_exception, so a filer
  within the Publication 501 exception keeps their dependents.
- Own exemptions, recovery rebates and the tuition deduction read claimability.
- Education credits and student loan interest keep reading the claimed input.
- Tests: the filing exception and a filer who can be claimed but is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py
Dependent rules (child care credit child, certain-dependents deduction) and the
childless EITC read the claimable-and-not-within-the-filing-exception helper;
the "not a dependent of another individual" rules read claimability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#10024's food/excise credit, Act 115 rebate and renters credit took claimable
filers off exemptions_count themselves. exemptions_count now leaves them out
(and, outside the filing exception, the return's dependents), so those credits
read it as it is; the filing-exception cases were one exemption short.

The renters credit also leaves out a dependent who can be claimed by another
taxpayer (Schedule X counts only people who cannot be), as the food/excise
credit already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Education credits: a dependent student is not eligible on a return whose
  filer can be claimed outside the filing exception (IRC 25A(f)(1)(A)(iii),
  152(b)(1)); the filer's own eligibility still turns on an actual claim.
- Recovery rebates: no credit when every filer is a dependent of another
  taxpayer (IRC 6428B(a)); the CARES and CAA child prerequisite is a spouse
  with a valid SSN, whether or not that spouse is an eligible individual.
- Child and dependent care: cdcc_qualifying_childcare_expenses holds the
  expense rule, and the single-parent work requirement reform and California's
  expenses read it.
- References: Georgia HB 136 page 3; one entry per recovery rebate statute;
  quote IRC 24(h)(4)(A) exactly in the test comment.
- Tests: dependent students, the two rebate cases, the reform and California
  expenses, and the Hawaii, Wisconsin and Treasury reforms with a claimable
  filer under both labellings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A spouse or head under 18 made a childless joint return look as if it had a
child, which bypassed the dependent test. The child route now needs a member
under 18 who is not a filer, or an older qualifying child.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Education credits: is_barred_from_education_credits_by_dependency holds the
  claimed-filer and dependent-student rules; both eligibility formulas and the
  reconciliation SSN reform's Lifetime Learning Credit read it, so the reform
  no longer turns a barred student's tuition into that credit.
- Child and dependent care: childcare counts when any child under 18 is still a
  qualifying individual, so an incapacitated child aged 13 to 17 keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A member under 18 who is not a qualifying child under IRC 32(c)(3) no longer
makes the return look as if it had a child, which bypassed the dependent test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setting meets_eitc_identification_requirements on one person made it an input
for every person, so the other spouse lost their SSN too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hand-off to the US + core hub

Pending (not mine to do):

Follow-ups: listed in #10087 under "Follow-ups"; the hub holds the regional state PRs stacked on the federal branch.

Session local_0143a3e8-4ab1-4492-8aab-9140b74e67e5 is closing; the hub owns this PR from here.

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

#10223 (the NM, NJ and OK state follow-up to #9131) covers nm_eitc_demographic_eligible. This PR masks the age test with is_tax_unit_head_or_spouse. #9132 used ~person("is_tax_unit_dependent", period) instead, because head/spouse roles can be age-ranked; #10043 does the same for NJ and OK.

On main a2f63c1, a 17-year-old filer with an is_tax_unit_dependent: true 30-year-old computes the 30-year-old as is_tax_unit_head, so a head-or-spouse mask would admit the dependent's age. In that household NM's child route is also true, so the credit does not flip by itself. Consider the ~is_tax_unit_dependent mask here too, plus the #10223 regression: a single 65-year-old with a 30-year-old dependent should be ineligible; main pays $153.

Base automatically changed from claimable-filer-federal to main October 16, 2026 06:10
@MaxGhenis MaxGhenis closed this Oct 16, 2026
@MaxGhenis MaxGhenis reopened this Oct 16, 2026
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 16, 2026 12:16
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (147205c).
⚠️ Report is 509 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main    #10088   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         8    +4     
  Lines           76       159   +83     
  Branches         2         0    -2     
=========================================
+ Hits            76       159   +83     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MaxGhenis
MaxGhenis merged commit ecf2aca into main Oct 16, 2026
43 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#10088 at 147205c38e6cca67225b4c599948d5cf43966157 (squash): Apply New Mexico's rules for a filer who can be claimed as a dependent.

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