Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1f0cd1b
Make head_is_dependent_elsewhere consumers independent of the head label
MaxGhenis Oct 8, 2026
3ecc675
Keep tax units without a filer eligible where only claimed filers are…
MaxGhenis Oct 9, 2026
8da8312
Address review: Hawaii worksheet earnings, NM same-filer age, childle…
MaxGhenis Oct 9, 2026
e838623
Allow a cent of rounding in the Hawaii self-employed joint pair
MaxGhenis Oct 9, 2026
41fb4a5
Address review round 2: worksheet earnings, minors' own status, input…
MaxGhenis Oct 9, 2026
527d47f
Merge remote-tracking branch 'upstream/main' into head-dependent-else…
MaxGhenis Oct 9, 2026
436805e
Merge the Hawaii deductions references after syncing main
MaxGhenis Oct 9, 2026
23c6229
Apply the federal rules for a filer who can be claimed as a dependent
MaxGhenis Oct 9, 2026
c1ee379
Apply Colorado, Connecticut, Illinois and Indiana rules for a filer w…
MaxGhenis Oct 10, 2026
342f417
Let either unclaimed Illinois spouse keep the 2022 rebate; add the pr…
MaxGhenis Oct 10, 2026
c8e5e48
Project the claimable-filer flag to members before combining with ages
MaxGhenis Oct 10, 2026
64d2c47
Point the Illinois dependent exemption at the live 35 ILCS 5/204 text
MaxGhenis Oct 10, 2026
2949a41
Address review: carry the bar into the IL and IN exemption reforms; I…
MaxGhenis Oct 10, 2026
4597c55
Address the federal claimable-filer review
MaxGhenis Oct 10, 2026
e4b8f36
Separate dependency facts and fix Hawaii qualified-person counts
MaxGhenis Oct 10, 2026
c7f969f
Clarify claimability outside the current tax unit
MaxGhenis Oct 10, 2026
4c8ed81
Merge commit 'c7f969f872' into claimable-filer-federal
MaxGhenis Oct 10, 2026
3f88702
Read the split dependency inputs from #10024
MaxGhenis Oct 10, 2026
b2771d2
Follow the corrected exemption count in three Hawaii credits
MaxGhenis Oct 10, 2026
163fcd4
Address the second federal claimable-filer review
MaxGhenis Oct 10, 2026
3d0864f
Address the third federal claimable-filer review
MaxGhenis Oct 10, 2026
35a2cbc
Give the spouse without an SSN a card type in the recovery rebate test
MaxGhenis Oct 10, 2026
8ff78ec
Merge remote-tracking branch 'upstream/claimable-filer-federal' into …
MaxGhenis Oct 11, 2026
3ebbde6
Read the split claimable / claimed inputs from the settled federal br…
MaxGhenis Oct 11, 2026
29a702c
Merge main into claimable-filer-co-ct-il-in after #10087
MaxGhenis Oct 16, 2026
034486c
Merge main into claimable-filer-co-ct-il-in before review fixes
MaxGhenis Oct 18, 2026
aecdf86
Strengthen claimable-filer invariants and address review wording
MaxGhenis Oct 18, 2026
feca5b2
Merge main into claimable-filer-co-ct-il-in before statute-first fixes
MaxGhenis Oct 20, 2026
6785319
Follow Colorado statutory qualifying-child definitions from 2024
MaxGhenis Oct 20, 2026
69e5923
Require independent dependency for Colorado low-income care credit
MaxGhenis Oct 20, 2026
d53509b
Use actual dependent claims for Illinois personal exemptions
MaxGhenis Oct 20, 2026
8be1d64
Match Illinois vector fixtures to their population sizes
MaxGhenis Oct 21, 2026
196c7c7
Use independent Illinois boundary and AGI control cases
MaxGhenis Oct 21, 2026
ab044c7
Merge main into claimable-filer-co-ct-il-in
claude Nov 3, 2026
29ebbdb
Compare Illinois joint exemption statuses as a tax-unit vector
claude Nov 3, 2026
d212e00
Merge main into claimable-filer-co-ct-il-in
MaxGhenis Nov 30, 2026
5597095
Compare a joint Illinois return with one claimed spouse against one b…
MaxGhenis Nov 30, 2026
a703d8e
Point six source-conflict candidates at the code that decides them
MaxGhenis Nov 30, 2026
29577dc
Correct state tax eligibility and age boundaries
MaxGhenis Nov 30, 2026
07c3ed1
Honor state EITC start dates and filer eligibility rules
MaxGhenis Dec 1, 2026
b399dc7
Merge branch 'main' into claimable-filer-co-ct-il-in
MaxGhenis Dec 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/claimable-filer-co-ct-il-in.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Corrected filer dependency and eligibility rules in Colorado, Connecticut, Illinois, and Indiana, including Colorado’s EITC expansion dates and Indiana’s separate-filer spouse exemption.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Colorado waives the work-valid Social Security number requirement for the Earned Income Tax Credit if this is true.
values:
2015-01-01: false
2020-01-01: true
metadata:
unit: bool
period: year
label: Colorado EITC identification waiver in effect
reference:
- title: C.R.S. 39-22-123.5(2.5)(a)(I)
href: https://leg.colorado.gov/sites/default/files/2023a_1112_signed.pdf#page=2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Colorado extends the Earned Income Tax Credit to certain filers under 25 without qualifying children if this is true.
values:
2015-01-01: false
2022-01-01: true
metadata:
unit: bool
period: year
label: Colorado EITC younger-filer expansion in effect
reference:
- title: C.R.S. 39-22-123.5(2.7)(a)
href: https://leg.colorado.gov/sites/default/files/2021a_1311_signed.pdf#page=9
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
description: Connecticut limits its property tax credit to filers at or above this age.
values:
2015-01-01: 0
2017-01-01: 65
2022-01-01: 0
metadata:
Expand All @@ -9,6 +10,8 @@ metadata:
reference:
- title: Connecticut General Statutes, Chapter 229, Sec. 12-704c, (b) (2)
href: https://www.cga.ct.gov/current/pub/chap_229.htm#sec_12-704c
- title: Connecticut Department of Revenue Services, 2022 Legislative Summary, Property tax credit
href: https://portal.ct.gov/drs/legislative-summaries/2022-legislative-updates/legislative-summary
- title: 2025 Form CT-1040 Connecticut Resident Income Tax Return Instructions
href: https://portal.ct.gov/-/media/drs/forms/2025/income/2025-ct-1040-instructions_1225.pdf#page=26
- title: 2024 Form CT-1040 Connecticut Resident Income Tax Return Instructions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ class il_dependent_exemption(Variable):
def formula(tax_unit, period, parameters):
p = parameters(period).gov.contrib.states.il.dependent_exemption
person = tax_unit.members
is_dependent = person("is_tax_unit_dependent", period)
# A return on which the filer (or, if joint, either spouse) can be
# claimed as a dependent has no dependents (IRC 152(b)(1)), as in
# the baseline formula.
filer_is_dependent = person.tax_unit(
"head_or_spouse_is_dependent_elsewhere_without_filing_exception", period
)
is_dependent = person("is_tax_unit_dependent", period) & ~filer_is_dependent
# Age gate: when in effect, restrict the exemption to dependents
# under the chosen age; otherwise every dependent qualifies,
# matching the baseline tax_unit_dependents count.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ def formula(tax_unit, period, parameters):

person = tax_unit.members
age = person("age", period)
is_dependent = person("is_tax_unit_dependent", period)
# A return on which the filer (or, if joint, either spouse) can be
# claimed as a dependent has no dependents (IRC 152(b)(1)), as in
# the baseline formula.
filer_is_dependent = person.tax_unit(
"head_or_spouse_is_dependent_elsewhere_without_filing_exception", period
)
is_dependent = (
person("is_tax_unit_dependent", period)
& ~filer_is_dependent
& ~person("in_is_exempt_separate_spouse", period)
)

# Apply age limit if in effect
if p.age_limit.in_effect:
Expand Down Expand Up @@ -49,7 +59,16 @@ class in_older_dependents_count(Variable):

def formula(tax_unit, period, parameters):
person = tax_unit.members
is_dependent = person("is_tax_unit_dependent", period)
# Dependents barred by a claimable filer are not moved into the
# personal portion either.
filer_is_dependent = person.tax_unit(
"head_or_spouse_is_dependent_elsewhere_without_filing_exception", period
)
is_dependent = (
person("is_tax_unit_dependent", period)
& ~filer_is_dependent
& ~person("in_is_exempt_separate_spouse", period)
)
total_dependents = tax_unit.sum(is_dependent)
eligible_dependent_exemptions = tax_unit(
"in_eligible_dependents_count", period
Expand All @@ -71,7 +90,10 @@ def formula(tax_unit, period, parameters):
tax_unit_size = tax_unit("tax_unit_size", period)
dependents = tax_unit("tax_unit_dependents", period)
older_dependents = tax_unit("in_older_dependents_count", period)
personal_count = tax_unit_size - dependents + older_dependents
spouse_allowances = add(tax_unit, period, ["in_is_exempt_separate_spouse"])
personal_count = (
tax_unit_size - dependents + spouse_allowances + older_dependents
)
personal_exemption_amount = personal_count * p_base.base.amount

# Add separated dependent exemption.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
"""Colorado, Connecticut, Illinois and Indiana rules for a filer who can be
claimed as a dependent.

A return on which the filer, or on a joint return either spouse, can be claimed
as a dependent without the filing exception has no dependents (IRC 152(b)(1)),
so it gets no state dependent exemption or child-based deduction, and a
childless filer who can be claimed gets no state EITC through the ITIN or age
extensions (IRC 32(c)(1)(A)(ii)(III)). Colorado's child credit before 2024 also
requires allowable dependents; from 2024 its child and family credits follow
IRC 152(c) qualifying-child status. Indiana keeps each filer's own $1,000
exemption; Illinois' child tax credit follows the IRC 152 qualifying child.

For couples drawn by Hypothesis and a seeded population in these states, with
either, both or neither spouse claimed, claimability drawn separately from
actual claims, and the filing exception:

1. Swap invariance: each output is the same under either head/spouse
labelling.
2. Monotonicity: marking another filer as claimed never raises the outputs in
MONOTONE (amounts not capped by a tax liability that the claim can raise).
3. Identities: when
`head_or_spouse_is_dependent_elsewhere_without_filing_exception` is true,
the return has no Illinois dependent exemption or Indiana additional
exemption, and its Indiana base exemptions are $1,000 per filer. Colorado's
child tax credit is also zero before 2024; from 2024 qualifying children
remain eligible. Otherwise Illinois and Indiana also count the dependents.
Illinois rebate eligibility follows actual claims, even when both spouses
are claimable.

Hypothesis batches check 1 and 3; the seeded population checks 1, 2 and 3.
"""

import numpy as np
import pytest
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st

from policyengine_us.tests.core.test_claimable_filer_federal_invariants import (
check_monotone,
check_swap,
)
from policyengine_us.tests.core.test_dependent_elsewhere_head_spouse_swap_invariance import (
CLAIM_PATTERNS,
_calc,
_crafted_cases,
_seeded_couples,
adults,
dependents,
)

STATES = ["CO", "CT", "IL", "IN"]
YEARS = [2021, 2023, 2025, 2026]
MONOTONE = [
"co_eitc",
"co_ctc",
"co_low_income_cdcc",
"ct_property_tax_credit_eligible",
"ct_child_tax_rebate",
"il_dependent_exemption",
"il_personal_exemption",
"il_eitc",
"il_ctc",
"il_income_tax_rebate",
"il_income_tax_rebate_eligible",
"in_base_exemptions",
"in_additional_exemptions",
"in_adoption_exemption",
]
OUTPUTS = MONOTONE + ["co_refundable_credits"]


@st.composite
def couples(draw):
claimable = draw(st.sampled_from(CLAIM_PATTERNS))
claimed = tuple(can_claim and draw(st.booleans()) for can_claim in claimable)
return {
"state": draw(st.sampled_from(STATES)),
"adults": [draw(adults()), draw(adults())],
"dependents": draw(st.lists(dependents(), max_size=2)),
"claimed": claimed,
"claimable": claimable,
"exception": tuple(
not is_claimed and draw(st.booleans()) for is_claimed in claimed
),
}


def _claimability_cases():
# Distinguish claimability from actual claims, and guarantee exception
# coverage without relying on Hypothesis to draw a child in IL or IN.
return [
{
"state": state,
"adults": [{"age": 26, "employment_income": 1_000}, {"age": 30}],
"dependents": [{"age": 5}],
"claimed": claimed,
"claimable": (True, True),
"exception": exception,
}
for state in STATES
for claimed, exception in (
((False, False), (False, False)),
((False, False), (True, True)),
((True, True), (False, False)),
)
]


def _identities(units):
states = np.array([unit["state"] for unit in units])

def check(sim, year):
blocked_filer = (
_calc(
sim,
"head_or_spouse_is_dependent_elsewhere_without_filing_exception",
year,
)
> 0
)
# Each unit is simulated as consecutive copies (labellings or claim
# patterns), in the order of the units.
state = np.repeat(states, len(blocked_filer) // len(units))
dependent_outputs = (
"il_dependent_exemption",
"in_additional_exemptions",
)
if year < 2024:
dependent_outputs += ("co_ctc",)
for name in dependent_outputs:
assert not _calc(sim, name, year)[blocked_filer].any(), (
f"{name} in {year} is positive on a return with a claimable "
"filer without the filing exception"
)
dependents_count = _calc(sim, "tax_unit_dependents", year)
allowed_dependents = np.where(blocked_filer, 0, dependents_count)
p = sim.tax_benefit_system.parameters(year).gov.states
mask = state == "IL"
np.testing.assert_array_equal(
_calc(sim, "il_dependent_exemption", year)[mask],
p.il.tax.income.exemption.dependent * allowed_dependents[mask],
err_msg="Illinois must restore dependents under the filing exception",
)
filers = _calc(sim, "tax_unit_size", year) - dependents_count
mask = state == "IN"
np.testing.assert_array_equal(
_calc(sim, "in_base_exemptions", year)[mask],
p["in"].tax.income.exemptions.base.amount
* (filers + allowed_dependents)[mask],
err_msg="Indiana must restore dependents under the filing exception",
)
# All generated joint returns have AGI below $400,000. Section
# 212.1(a) excludes actual claims, rather than claimability, and keeps
# the joint return eligible while either spouse is not claimed.
person_is_filer = _calc(sim, "is_tax_unit_head_or_spouse", year) > 0
actually_claimed = (
_calc(sim, "claimed_as_dependent_on_another_return", year) > 0
)
eligible_filers = sim.populations["tax_unit"].sum(
person_is_filer & ~actually_claimed
)
mask = state == "IL"
np.testing.assert_array_equal(
_calc(sim, "il_income_tax_rebate_eligible", year)[mask],
eligible_filers[mask] > 0,
err_msg="Illinois rebate eligibility must follow actual claims",
)

return check


@settings(
max_examples=2,
deadline=None,
derandomize=True,
suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large],
)
@given(st.sampled_from(YEARS), st.lists(couples(), min_size=6, max_size=12))
def test_co_ct_il_in_claimable_filer_rules_are_label_free(year, units):
check_swap(units, year, OUTPUTS, _identities(units))


@pytest.mark.parametrize("year", YEARS)
def test_co_ct_il_in_claimable_filer_rules_seeded_population(year):
units = _seeded_couples(STATES, per_state=3) + _crafted_cases(STATES)
# Inputs are simulation-wide: make the legacy cases' fallback explicit
# before batching them with the distinct-claimability cases.
swap_units = [
{**unit, "claimable": unit["claimed"], "exception": (False, False)}
for unit in units
] + _claimability_cases()
check_swap(swap_units, year, OUTPUTS, _identities(swap_units))
check_monotone(units, year, MONOTONE, _identities(units))
Loading
Loading