Book Connecticut child tax rebate in 2021 eligibility year (like RI/NM) - #9274
Book Connecticut child tax rebate in 2021 eligibility year (like RI/NM)#9274DTrim99 wants to merge 4 commits into
Conversation
PavelMakarchuk
left a comment
There was a problem hiding this comment.
The re-booking mechanics themselves check out — parameter start dates, the refundable/non-refundable list moves, the RI/NM analog pattern, no impact on the CT contrib reforms, and the full CT tax suite (136 tests) plus the cross-state income tax suite (67 tests) pass on this branch.
Requesting changes for four findings, detailed inline:
- Phase-out uses
ct_agiinstead of federal AGI (ct_child_tax_rebate.py:13) — PA 22-118 phased out on federal AGI from the 2021 return. Pre-existing line, but this PR is what books the formula into the live 2021 baseline. - Counts all dependents, not children 18 or younger (
ct_child_tax_rebate.py:25) — the program required a dependent child age 18 or younger; cf.ri_child_tax_rebate's age check. - No 2022 sunset on the rebate parameters —
ct_child_tax_rebatereturns $250/child for 2023+ when queried directly. - Stale test name — "Head of household with $170,000 AGI" vs.
ct_agi: 165_000input.
Findings 1 and 2 are the substantive ones: they change real 2021 microsim outputs, and the current unit tests mask both by injecting ct_agi and tax_unit_count_dependents directly.
Sources: CT DRS Child Tax Rebate overview, CT OLR 2026-R-0020
Generated by Claude Code
Fixes applied from @PavelMakarchuk's reviewAll four findings addressed and pushed (CT tax suite 140/140). Thanks — the substantive two were both masked by the injected-input tests, exactly as you noted. F1 — phase-out on federal AGI (fixed)Switched the phase-out income measure in F2 — count only dependent children ≤18 (fixed)Replaced F3 — 2022 sunset (fixed)Added F4 + test coverage
No 2021 parameter values changed. 🤖 Generated with Claude Code |
PR Review (follow-up)Re-reviewed head 🔴 Critical (Must Fix)None. 🟡 Should Address
🟢 Suggestions
Validation Summary
Verdict: REQUEST_CHANGES — for the phase-out formula + the two test expectations; small, self-contained fix. Everything else is ready. |
Follow-up review addressed — thanks @PavelMakarchukGood catch on the phase-out mechanics. All items from your 2026-08-18 review applied (CT tax suite 144/144). Should #1 — phase-out formula (the substantive fix) reduction_share = min_(np.ceil(excess / p.reduction.increment) * p.reduction.rate, 1)
return total_rebate * (1 - reduction_share)Updated the two expected values you flagged — single $101k / 2 children → 450 ( Should #2 — descriptions & cites Suggestions
Fixed with Claude Code assistance. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9274 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 1 -2
Lines 65 25 -40
=========================================
- Hits 65 25 -40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PavelMakarchuk
left a comment
There was a problem hiding this comment.
PR Review (complete:review-pr — re-review after 8/18 commits)
All four findings from my 8/16 review are addressed, and each fix was verified against the statute extracted mechanically (pdftotext -layout, PA 22-118 pp. 548–549):
- Phase-out base → federal AGI ✓ — §411(b)(2): "…of federal adjusted gross income over (A) one hundred thousand dollars…". The
ct_agi: 90_000vsadjusted_gross_income: 130_000test pins the switch. - Age-18 dependent gate ✓ — §411(a)(1): "'child' means an individual who is eighteen years of age or under as of December 31, 2021".
age <= 18is correctly inclusive (TSSB 2022-5 Q14 confirms an 18-year-old qualifies). - 2022 sunset ✓ —
amount/child_capzeroed at 2022-01-01 plus removal from the 2022 refundable list; 2022 and 2023 sunset tests both present. - Test name/input mismatch ✓ — now $165,000 in both.
The phase-out rewrite to a share basis is itself a real bug fix: §411(b)(2) "such amount shall be reduced ten per cent for every one thousand dollars, or fraction thereof" — corroborated by TSSB 2022-5 Q12's $110k/$170k/$210k exhaustion bands, which only work under the share reading. All 11 test expectations recompute correctly by hand; np.ceil implements "or fraction thereof"; SEPARATE ($100k) and SURVIVING_SPOUSE ($200k) thresholds match the statute clause-for-clause. CI fully green.
🟡 Should address (non-blocking; fine as a fast-follow)
age_limit.yamlOLR reference doesn't corroborate the value — OLR 2026-R-0020 never mentions the age-18 limit (grep over all 11 pages: zero hits for "eighteen"/"age 18"), and its one relevant sentence ("available only in 2022") superficially reads against the 2021 booking. The §411(a)(1) cite carries the value; suggest swapping the OLR link for TSSB 2022-5 Q15 (#page=3), which states the rule verbatim.- Age boundary untested — add
age: 18 → 250andage: 19 → 0; that's the exact statutory line and the highest-value regression guard for the new gate. Also worth one SEPARATE and one SURVIVING_SPOUSE case (both thresholds are explicit in §411(b)(2) and in the breakdown), an at-threshold case (100,000 → full), and a fractional-increment case (e.g. 100,500 → ceil to 1). child_cap.yamlmetadata —unit: currency-USDfor a count of children, and the description reads "caps the child for tax rebate at this number"; cheap drive-by fix while the file is open.
🟢 Suggestions
- PR body: state explicitly that 2021
ct_income_taxnow intentionally diverges from the CT-1040/TAXSIM (the rebate "is not a credit and may not be claimed on any Connecticut income tax return", TSSB Q5 — hence the two integration-test overrides), and that the §411(b)(3) application requirement (filed by 7/31/2022) is not modeled, so aggregates reflect full statutory eligibility rather than take-up. - The
referencetuple's TSSB link could carry a page anchor like the parameter files do.
Validation summary
| Check | Result |
|---|---|
| Regulatory accuracy | 0 issues (statute verified verbatim; 2 genuine legal errors fixed) |
| Reference quality | 1 non-corroborating secondary ref (OLR on age_limit) |
| Code patterns | Clean (vectorized, no hard-coding, RI-precedent-consistent) |
| Test coverage | 11/11 expectations recompute; age/status boundary gaps noted |
| CI | Passing (full suite) |
Emulator follow-up tracked on our side: policyengine-taxsim CT 2021 comparisons need a decision on ct_child_tax_rebate vs TAXSIM's eligibility-year rebate convention.
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Follow-up from a deeper review pass — one blocking finding that reverses my earlier approval.
system.py backdates each parameter's earliest entry to 2015-01-01 (backdate_parameters(..., first_instant="2015-01-01")), so the 2021-first-dated rebate/amount.yaml, rebate/child_cap.yaml, and credits/refundable.yaml entries leak backward: a simulated 2020 CT household with one child receives a phantom $250 ct_child_tax_rebate (verified at runtime against this branch with the pinned core 3.30.2). Pre-PR there was no exposure — the rebate only lived in the 2022 non-refundable list — so this PR introduces up to $750/family of phantom refundable credits in every 2015–2020 CT simulation year.
Fix: add 2015-01-01: 0 to amount.yaml and child_cap.yaml (and/or 2015-01-01: [ct_eitc] to refundable.yaml), plus a 2020 test asserting ct_child_tax_rebate: 0. Same class as the CT pension backward-leak fixed in #9008. (RI/NM's analogous rebates share the latent shape — worth a separate issue.)
Full review report follows in the next comment; everything else in it is non-blocking polish.
PR 9274 — CT Child Tax Rebate (PA 22-118 §411): move to 2021 refundable creditProgram ReviewProgram: Connecticut Child Tax Rebate — one-time rebate under PA 22-118 §411, moved from a 2022 non-refundable credit to a 2021 refundable credit ($250/child, max 3, 10%-per-$1,000 phase-out over $100k/$160k/$200k federal AGI, sunset to 0 in 2022). Source Documents
Note: TSSB 2022-5 cites the authority as "Section 415 of H.B. No. 5506" — the bill's section number; the enrolled act renumbers it §411 (same provision). CriticalC1 — Phantom pre-2021 rebate: backdating exposes the rebate for tax years 2015–2020 (CONFIRMED at runtime)
Code-path verified empirically against the PR snapshot with pinned core 3.30.2 (satisfying Introduced by this PR: pre-PR, the rebate was only consumed via the 2022 entry of Fix: add an explicit zero entry at or before 2015-01-01 to ShouldA1 —
|
| Category | Count |
|---|---|
| Confirmed correct (repo value = PDF) | 15 |
| Mismatches verified | 0 |
| Mismatches rejected | 0 |
| Unmodeled program features (noted, mostly standard PE abstractions) | 6 |
| Pre-existing (outside PR scope) | 0 |
Unmodeled: application/take-up (→A8), domicile (→A9), Dec-31 age date (→S7), relationship gloss (informational), §411(b)(4) interaction shields (satisfied for CT income tax; other programs out of scope), §411(b)(5) (satisfied by construction).
Validation Summary
| Validator | Result |
|---|---|
| Regulatory | PASS — 0 critical; 5 should, 7 suggestions (all consolidated above) |
| Reference | 9 page anchors verified; refundable.yaml gap → A1; OLR citation → A6 |
| Code | PASS — 0 critical; unit/metadata and backdating findings consolidated (C1, A5) |
| Formatting | PASS with nits (S3, S5; covered by code audit) |
| Tests | 11/11 expectations verified vs statute; boundary gaps → A2–A4 (downgraded per policy, variable has coverage) |
| PDF audit | 15 matches, 0 mismatches across 36 rendered pages |
| CI Passing | YES (all checks pass) |
Branch Status
The branch is 291 commits behind base (3 ahead). Rebase recommended before merge. Staleness did not affect any finding: all findings were verified against the PR snapshot at head SHA 7faa02a, and the pre-2021 backdating behavior (C1) was confirmed against the pinned core version the snapshot builds with.
Review Severity: REQUEST_CHANGES
One critical finding (C1 — confirmed phantom pre-2021 rebate introduced by this PR, one-line parameter fix). Everything else is documentation, metadata, and test-coverage polish on a substantively correct and clearly improved implementation.
Next Steps
Run the fix-pr workflow against this report: apply C1's parameter fix (2015-01-01: 0 entries and/or 2015-01-01: [ct_eitc]), then the A-items (reference, unit, comments, boundary tests), rebase on base, and re-run CI.
The Connecticut 2022 child tax rebate (PA 22-118) is determined by the 2021 return, claimed by a separate application, and paid in fall 2022 — it is not a line on the CT-1040. PolicyEngine was applying it as a 2022 non-refundable income-tax credit, reducing 2022 CT income tax and computing eligibility from 2022 data, while it books every other prior-year rebate (ri_child_tax_rebate, nm_2021_income_rebate) in the eligibility year. Move ct_child_tax_rebate to the 2021 refundable-credit list (removed in 2022) and shift its parameters to 2021, mirroring ri_child_tax_rebate. 2022 CT income tax no longer includes the rebate, matching the CT-1040. Zero ct_child_tax_rebate in the two 2021 CT integration tests (TAXSIM35 does not model it), following the ri_child_tax_rebate convention. Fixes PolicyEngine#9270. Surfaced by PolicyEngine/policyengine-taxsim#1127. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-out, age gate, sunset Booking this credit into the live 2021 baseline surfaced three formula/parameter issues: - F1: the phase-out read ct_agi; PA 22-118 phased out on FEDERAL AGI from the 2021 return. Switch the income measure to adjusted_gross_income. - F2: the count used tax_unit_count_dependents (all dependents); the program required a dependent child age 18 or younger. Count only age<=18 tax-unit dependents, RI-style, with a new ct rebate age_limit parameter (18). - F3: the rebate parameters started 2021 with no sunset, so the variable returned phantom nonzero values for 2022+. Sunset amount and child_cap to 0 at 2022-01-01 (one-time rebate). - F4/tests: the prior cases injected ct_agi and tax_unit_count_dependents, masking F1 and F2. Rewrite them to drive federal AGI + real dependents with ages (and fix the 70k/165k name mismatch), and add age-gate, federal-AGI-vs-ct_agi, and 2023-sunset cases. CT tax suite 140/140. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mechanics - Phase-out was subtracting a flat $100 per $1,000 over the income limit; PA 22-118 §411(b)(2) and DRS TSSB 2022-5 Q12 phase the REBATE out by 10% per $1,000, so every filer is fully phased out at threshold + $10,000 regardless of child count. Rewrite to reduction_share = min(ceil(excess/1000) * rate, 1); rebate * (1 - share). - Update expected values: single $101k/2 children 400 -> 450; HoH $165k/3-capped 250 -> 375. Add boundary cases (threshold + $10,000 -> 0; partial band -> 10% of rebate) and a 2021 refundable-flow case + a 2022 sunset case. - Add a reference (PA 22-118 §411, TSSB 2022-5) to ct_child_tax_rebate.py. - Fix stale parameter descriptions (federal, not state, AGI; rate = phase-out share) and correct the section cites from Sec. 410 to Sec. 411. No parameter values changed. CT tax suite 144/144. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…es, coverage (CT child tax rebate) - C1 (critical): parameter backdating re-dated the rebate's earliest entry to 2015-01-01, paying a phantom rebate for 2015-2020. Add explicit 2015-01-01: 0 to amount.yaml and child_cap.yaml (verified: a 2020 CT household with a child now gets $0; 2021 unchanged). Add a 2020 regression-guard test. - A1/A6/S2/S4/S6: add PA 22-118 §411(b)(1)/(b)(4) refs to refundable.yaml; drop the non-corroborating OLR citation on age_limit; add page anchors + booking-rationale notes. - A5: child_cap unit currency-USD -> person. A7: reword the false 'repealed' comment in 5 files to uncodified session law. A8/A9/S1: document the take-up, domicile, and dependency approximations. S3/S5: fix garbled child_cap wording/label, amount comma, .1->0.1, YAML order. - A2/A3/A4: phase-out ceil + threshold-boundary tests; age-18/19 and non-dependent-minor gates; SEPARATE/SURVIVING_SPOUSE/JOINT threshold pins; $750 HOH max; positive-EITC refundable e2e. S8: margins, newborn/negative-AGI/non-CT cases. Only new param value is the 2015-01-01: 0 sunset floor. CT child tax rebate suite 28/28. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7faa02a to
3e8aad4
Compare
Follow-up review addressed — thanks @PavelMakarchukApplied the critical fix and all A- and S-items from your 2026-08-23 review (CT child tax rebate suite 28/28, rebased on main). The only new parameter value is the 2015 sunset floor. Critical
Should
S7 (age measured at period, not Dec 31 2021) is a PE-wide limitation with Fixed with Claude Code assistance. |
Fixes #9270. Surfaced by PolicyEngine/policyengine-taxsim#1127.
Problem
The Connecticut 2022 Child Tax Rebate (PA 22-118) is $250/child (max 3), determined by the 2021 return, claimed by a separate application (June–July 2022), and paid in fall 2022 — CT DRS overview. It is not a line on the CT-1040.
PolicyEngine listed
ct_child_tax_rebateamong Connecticut's 2022 non-refundable income-tax credits, so it reduced 2022 CT income tax (e.g. a HoH with one child and CT AGI $54,934: CT income tax 2,094 → 1,844) and computed eligibility from 2022 income/dependents. TaxAct's 2022 CT-1040 shows CT income tax $2,094 with no rebate.PolicyEngine already books the directly analogous prior-year rebates in the eligibility year:
ri_child_tax_rebate(RI's $250/child, 2021-return-based, paid Oct 2022) andnm_2021_income_rebateare both in their 2021 refundable lists. Connecticut's was the outlier.Fix
Mirror
ri_child_tax_rebate:ct_child_tax_rebatefromct/tax/income/credits/non_refundable.yaml(2022).ct/tax/income/credits/refundable.yamlunder2021-01-01(removed 2022) — refundable, since the rebate is a check paid regardless of tax liability.amount,child_cap,reduction/*) from2022-01-01to2021-01-01, so eligibility is computed from 2021 income/dependents.ct_child_tax_rebateunit tests to period 2021 (amounts unchanged).ct_child_tax_rebatein the two 2021 CT integration tests (their expectedct_income_taxcomes from TAXSIM35, which does not model the rebate) — following the existingri_child_tax_rebate: 0convention in the RI integration test.Result
2022 CT income tax no longer includes the rebate ($2,094, matching the CT-1040), and Connecticut is consistent with the eligibility-year treatment PolicyEngine uses for Rhode Island and New Mexico. Full CT baseline suite passes.