Implement childcare expense deductions and benefits#540
Implement childcare expense deductions and benefits#540PavelMakarchuk merged 10 commits intomasterfrom
Conversation
Program Review: PR #540 -- Implement Childcare Expense Deductions and BenefitsSource Documents
Critical (Must Fix)
Should Address
Suggestions
PDF Audit Summary
Breakdown by jurisdiction:
Validation Summary
Review Severity: REQUEST_CHANGESThis PR introduces 5 new child care programs with 13 critical issues that must be fixed before merge. The Ontario CARE credit has a systematically wrong rate table and a fundamentally incorrect formula. The BC CCFRI has a $400/month parameter error for preschool-age children. The Alberta subsidy uses unsourced base amounts and an incorrect phase-out model. The federal CCED is the strongest implementation but still has issues with earned income definition, claimant allocation, and non-corroborating references. Per-program assessment:
Next StepsPriority 1 -- Must fix before merge:
To auto-fix issues: |
…fs, tests Critical fixes: - Ontario CARE: fix rate table (+2pp error from duplicate 0.73 at $22,500), rewrite formula to use federal CCED (line 21400), fix income variable - BC CCFRI: fix preschool $145→$545, add kindergarten $320 category, parameterize all hard-coded ages, flatten nested where() to np.select - Alberta: replace unsourced $200/$250 with actual discrete income bracket tables (14 preschool + 10 school-age brackets), remove linear phase-out - Federal CCED: fix all 7 references to cite ITA s.63 + T778, broaden earned income to include self-employment, fix claimant allocation to use total income with deterministic tiebreaker for equal-income case Should-address fixes: - Migrate changelog to towncrier format (changelog.d/540.added.md) - Fix 30 parameter descriptions (trailing periods, active voice) - Add period metadata to 8 parameter files - Remove scope creep (armed forces deduction from deductions_from_total) - Change documentation→reference field on all variable files - Remove np.round() calls, add #page=5 to BC CCFRI PDF references Tests: 797 passing (11 new boundary/allocation tests added) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes Applied🔴 Critical Issues Fixed (13/13)
🟡 Should-Address Issues Fixed (15/17)
Verification
Files Changed Summary
Ready for re-review. |
…rences - Ontario CARE: Add 2024 rate schedule with correct income thresholds from ON479-A ($5k steps $40k-$60k, $3.6k steps $60k-$146.4k) - Alberta school-age: Correct 7 bracket amounts ($348/$311/$275/$238/$201/$165/$128) - Alberta preschool: Fix 5 brackets off by $1 ($253/$226/$213/$160/$120) - References: Add subsection detail to ON/CRA citations, BC legislation refs, Alberta regulation refs, specific PDF page anchors - Tests: Fix 9 expected values, add 8 boundary tests (age 6/7, 15/16, disabled 17+, BC $111k, AB age 5) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes Applied (Second Pass)🔴 Critical Issues Fixed
🟡 Should-Address Issues Fixed
Verification
Changes by Jurisdiction
Ready for re-review. |
- Ontario rate.yaml: Remove incorrect 2024 rate overrides at $20k-$40k (rates unchanged from 2019), fix spurious $42,500 bracket with 2024 threshold override, add 2019 ON479-A form reference - Alberta: Replace wrong AR 143/2008 (licensing reg) citations with Early Learning and Child Care Act (SA 2007, c E-0.1), fix rate_unit to amount_unit in subsidy schedules - Tests: Update 2 Ontario expected values to match corrected rates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ction guard - Ontario rate.yaml: Rewrite brackets to match ON479-A PDFs (2019 and 2024 are identical). Remove all unnecessary 2024 overrides, fix 27 wrong 2019 thresholds, remove spurious $42,500 bracket - BC ACCB: Fix B.C. Reg. 74/2018 (Gypsy Moth pest control) to correct B.C. Reg. 74/97 (Child Care Subsidy Regulation) in all 12 files - Federal: Add max_(0, ...) guard to prevent negative deduction when self-employment losses exceed employment income Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Federal CCED: Fix earned income limit to use claimant's income (not family total) per ITA s. 63(1)(e). Extract shared claimant logic into is_child_care_expense_claimant variable. - Ontario CARE: Shift all 39 bracket thresholds by +1 to match "more than $X" semantics. Fix reference to s. 103.0.3(6). - BC ACCB: Update 12 files from repealed B.C. Reg. 74/97 to 189/2024. Add period metadata, simplify phase-out formula. - BC CCFRI: Add Family/In-Home rates (group/ and family/ subfolders), new is_family_child_care input variable. Remove redundant multiplier. - Alberta: Replace Act reference with alberta.ca source, add preschool discontinuation note and school-age verification note. - Orphaned params: Document Ontario max_amount and federal child_income_limit with metadata notes. - Tests: Add 8 new edge-case and boundary tests (816 total, all pass). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes #533