Skip to content

Implement childcare expense deductions and benefits#540

Open
vahid-ahmadi wants to merge 6 commits intomasterfrom
childcare-expense-deductions
Open

Implement childcare expense deductions and benefits#540
vahid-ahmadi wants to merge 6 commits intomasterfrom
childcare-expense-deductions

Conversation

@vahid-ahmadi
Copy link
Contributor

Fixes #533

@vahid-ahmadi vahid-ahmadi self-assigned this Nov 12, 2025
@PavelMakarchuk
Copy link
Collaborator

Program Review: PR #540 -- Implement Childcare Expense Deductions and Benefits

Source Documents


Critical (Must Fix)

  1. Ontario CARE rate table: duplicate 0.73 at $22,500 causes systematic +2pp error across 36 brackets.
    All rate brackets from $22,500 through $150,000 are 2 percentage points too high. Root cause: rate.yaml lines 14-17 assign 0.73 to the $22,500 threshold instead of the correct 0.71, creating a duplicate of the $20,000 bracket. Code-path verified: on_child_care_tax_credit.formula() -> p.rate.calc(income) -> SingleAmountTaxScale.calc() -> numpy.digitize returns the wrong rate for 131,064 integer income values between $22,501 and $153,599. Every Ontario household with adjusted income above $22,500 receives an overstated credit.

    • File: policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/rate.yaml, lines 14-17
    • PDF citation: ON479-A Schedule (PDF 4, page 2), rate table
  2. Ontario CARE credit formula uses raw childcare expenses with Ontario-specific caps instead of federal CCED (line 21400).
    The ON479-A form (lines 6-8) defines the credit as rate x federal_CCED_amount (line 21400). The code instead applies the rate to min(raw_childcare_expenses, ON_max_amounts) per child, using Ontario max_amount parameters ($6,000/$3,750/$8,250) that are informational values, not legislative caps. This fundamentally changes the credit calculation. Example: parent with child under 7, $8,000 childcare, $30k income -- correct credit approximately $5,360 vs. PR calculates approximately $4,020 (underpayment of $1,340).

    • File: policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py, lines 26-46
    • PDF citation: ON479-A Schedule (PDF 4, page 1), lines 6-8
  3. Ontario CARE credit uses wrong income variable for rate lookup and eligibility.
    ON479-A defines "adjusted income" as net income (line 23600) + child care deduction (line 21400) + social benefits repayment (line 23500). The code uses adjusted_family_net_income which equals family_net_income - UCCB - RDSP. These are fundamentally different calculations: the CARE credit adds back the child care deduction, while the repo variable does not. Code-path confirmed: line 16 of on_child_care_tax_credit.py unconditionally calls the wrong income variable for all years.

    • File: policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py, line 16
    • PDF citation: ON479-A Schedule (PDF 4, page 2), adjusted income worksheet
  4. BC CCFRI preschool fee reduction is $145/month instead of the correct $545/month for "3 Years to Kindergarten" group care.
    The CCFRI PDF Table 1 (p5) defines three distinct categories: "3 Years to Kindergarten" at $545/month, "Kindergarten" at $320/month, and "Preschool (part-day)" at $95/month. The repo collapses all three into a single "preschool" parameter at $145/month. Code-path confirmed: bc_child_care_fee_reduction.formula() -> age < 5 branch -> p.max_reduction.preschool = $145. Underpayment of $400/month ($4,800/year) per child in full-time "3 Years to Kindergarten" care.

    • File: policyengine_canada/parameters/gov/provinces/bc/benefits/child_care_fee_reduction/max_reduction/preschool.yaml
    • PDF citation: CCFRI Funding Guidelines 2024-25 (PDF 1, page 5), Table 1
  5. BC CCFRI missing kindergarten category ($320/month).
    Kindergarten children should receive $320/month fee reduction (Group Child Care). The code's age categories jump from "preschool" (age < 5) to "school age" (age <= 12), so a 5-year-old in kindergarten gets $115/month instead of $320/month -- an underpayment of $205/month ($2,460/year).

    • File: policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.py, lines 30-36
    • PDF citation: CCFRI Funding Guidelines 2024-25 (PDF 1, page 5), Table 1
  6. Alberta base subsidy amounts ($200/month preschool, $250/month school-age) do not match any official rate.
    Code-path confirmed: both values are actively used in the formula. The actual program uses discrete income brackets: preschool max is $266/month (income $0-$119,999); school-age Grades 1-6 max is $366/month (income $0-$49,999); kindergarten facility-based max is $644/month. Neither $200 nor $250 appears in any official source. The parameter descriptions call them "representative amounts" but they match no published figure, average, or midpoint.

    • Files: policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/preschool.yaml ($200), policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/base_subsidy/school_age.yaml ($250)
    • Web source: alberta.ca/child-care-subsidy, income bracket tables
  7. Alberta phase-out model is structurally wrong (linear 50% fraction vs. discrete income brackets).
    Code-path confirmed: phase_out_start_fraction = 0.5 is used at line 45 of the variable. The real program uses discrete income brackets with specific dollar amounts at each bracket (13 brackets for preschool, 9 for school-age). There is no continuous linear phase-out. Even as an approximation, 0.5 is wrong: preschool subsidies start declining at approximately 67% of the limit ($120k/$180k), not 50% ($90k). School-age starts at approximately 56% ($50k/$90k), not 50% ($45k).

    • File: policyengine_canada/parameters/gov/provinces/ab/benefits/child_care/phase_out_start_fraction.yaml, policyengine_canada/variables/gov/provinces/ab/benefits/child_care/ab_child_care_subsidy.py, line 45
    • Web source: alberta.ca/child-care-subsidy
  8. All 7 federal CCED parameter files cite a CRA navigation page that does not contain the parameter values.
    Every file references the CRA Line 21400 overview page -- a hub page with links to other pages. The specific values ($8,000, $5,000, $11,000, age 16, age 7, 2/3 fraction, $15,705) do not appear on this page. The values themselves ARE correct per ITA s. 63 and CRA T778, but the references are non-corroborating.

  9. Hard-coded age thresholds in BC and Alberta variable files (10 instances across 3 files).
    Policy values (age boundaries 1.583, 3, 5, 12, 13 and base family size 2) are hard-coded in Python formulas instead of being stored in parameter YAML files. This violates the PolicyEngine principle that all policy values must be parameterized.

    • bc_affordable_child_care_benefit.py: lines 22, 39, 42, 45, 48 (values: 2, 1.583, 3, 5, 13)
    • bc_child_care_fee_reduction.py: lines 30, 33 (values: 3, 5; also line 36 duplicates max_age)
    • ab_child_care_subsidy.py: lines 26, 27 (values: 5, 5, 12)
  10. Potential double-counting bug in child_care_expense_deduction_person.py when two parents have equal employment income.
    When employment_income == min_employment_income is true for multiple people (equal incomes), is_claimant is True for ALL of them. Each person receives the full household_deduction via where(is_claimant, household_deduction, 0), potentially doubling the person-level deduction. Also, if all members have zero employment income, min(inf) = inf and no one matches, so the deduction is lost.

    • File: policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_person.py, lines 23-30
  11. Federal CCED earned income definition is too narrow.
    The T778 form defines "earned income" as employment income PLUS net self-employment income, taxable scholarships, CPP/QPP disability benefits, training allowances, and more (page 2). The code uses family_employment_income which only includes employment income. Families with self-employment income but no employment income would get $0 CCED.

    • File: policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction.py
    • PDF citation: T778 (PDF 2, page 2), "Earned income" section
  12. Federal CCED lower-income spouse allocation uses employment income instead of net income.
    ITA s. 63(2) requires the lower NET INCOME spouse to claim the deduction (line 23600). The code uses employment_income to determine the claimant. In households where the lower-employment-income spouse is not the lower-net-income spouse (e.g., significant investment/pension income), the deduction is allocated to the wrong person.

    • File: policyengine_canada/variables/gov/cra/deductions/child_care_expense/child_care_expense_deduction_person.py, lines 21-28
  13. Ontario CARE rate.yaml has spurious bracket at $153,600 and misclassified rate at $150,000.
    The official ON479-A shows "more than $150,000: 0%". The repo has 1% at $150,000 and 0% at $153,600. While the income_limit gate ($150,000) masks the impact above $150k, the parameter data is incorrect and the $153,600 bracket does not exist in any official source. This is a direct artifact of the +2pp shift error in item 1. The correct encoding: 0.01 at threshold $146,400 and 0.00 at threshold $150,000.

    • File: policyengine_canada/parameters/gov/provinces/on/tax/income/credits/child_care/rate.yaml, lines 164-171
    • PDF citation: ON479-A Schedule (PDF 4, page 2)

Should Address

  1. np.round() usage in 2 files is non-standard.
    No other variable in this codebase uses np.round(). The framework handles precision.

    • bc_affordable_child_care_benefit.py, line 78
    • ab_child_care_subsidy.py, line 66
  2. Changelog fragment uses old changelog_entry.yaml format instead of towncrier changelog.d/ directory.
    The repository has migrated to towncrier (commit 0e411c81). The old format will not be picked up by the release tooling.

    • File: changelog_entry.yaml -- should be changelog.d/540.added.md
  3. Variable/parameter path mismatch for BC Fee Reduction.
    The variable is in variables/gov/provinces/bc/benefits/child_care/ but parameters are in parameters/gov/provinces/bc/benefits/child_care_fee_reduction/. These should have parallel directory structures.

    • File: policyengine_canada/variables/gov/provinces/bc/benefits/child_care/bc_child_care_fee_reduction.py
  4. Orphaned parameter: child_income_limit.yaml is defined but never used.
    The parameter exists with correct values ($15,000 for 2023, $15,705 for 2024) but no variable references it. A comment in is_eligible_child_for_child_care_expense_deduction.py explains this avoids circular dependency, but the unused parameter is dead code.

    • File: policyengine_canada/parameters/gov/cra/deductions/child_care_expense/child_income_limit.yaml
  5. All 30 parameter files have non-compliant description format.
    Descriptions lack trailing periods, do not use the required "this X" placeholder pattern, use acronyms (CCFRI, CARE), and include parenthetical asides.

    • Files: All 30 parameter YAML files across all 5 directories
  6. 13 parameter files missing period metadata field.
    Missing period: year on files including age_limit.yaml, child_income_limit.yaml, earned_income_fraction.yaml, limit/age_threshold.yaml, various ON/BC/AB parameter files.

  7. documentation field used on all 9 new variable files instead of the standard reference field.
    In this codebase, 87 files use reference while only 5 older files use documentation. New variables should not introduce documentation.

  8. Missing critical test: 2/3 earned income limit never actually binds in existing test suite.
    Test Canada main federal tax rates #4 has income $15,000 where 2/3 = $10,000, but the per-child cap ($8,000) binds first. No test exercises the 2/3 rule as the binding constraint. Needed: income $9,000, expenses $8,000, expected deduction $6,000.

    • File: policyengine_canada/tests/gov/cra/deductions/child_care_expense/child_care_expense_deduction.yaml
  9. No two-parent household test for federal CCED person-level allocation.
    All 5 existing CRA tests use single-parent households. The lower-income spouse allocation logic (and the equal-income double-counting bug) is completely untested.

  10. Ontario test file uses singular household: key; all others use households: format.

    • File: policyengine_canada/tests/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.yaml
  11. BC CCFRI PDF references missing #page=5 anchors (3 files).
    PDF links should include page number to direct readers to Table 1.

    • max_reduction/infant_toddler.yaml, max_reduction/preschool.yaml, max_reduction/school_age.yaml
  12. BC CCFRI effective dates are 3 months early (2024-01-01 vs. correct 2024-04-01).
    The CCFRI funding period runs April 1 to March 31. Code-path confirmed: the variable uses annual definition_period, so even if corrected to 2024-04-01, the formula would need restructuring to handle mid-year transitions.

    • Files: max_reduction/infant_toddler.yaml, max_reduction/school_age.yaml
  13. Ontario CARE credit does not filter by child age (under 16) or child income ($15,705).
    The ON479-A form requires the child to be "under 16 years of age" and have net income of "$15,705 or less." The variable applies the credit to any household member with childcare expenses regardless of age.

    • File: policyengine_canada/variables/gov/provinces/on/tax/income/credits/child_care/on_child_care_tax_credit.py
  14. Deeply nested where() expressions in 3 files (3-4 levels).
    PolicyEngine style recommends breaking complex expressions into named intermediate boolean variables.

    • bc_affordable_child_care_benefit.py (4 levels), bc_child_care_fee_reduction.py (3 levels), child_care_expense_deduction_max_per_child.py (3 levels)
  15. Unrelated canadian_armed_forces_and_personnel_deduction added in same change.
    The modification to deductions_from_total_to_net_income.py adds both the child care deduction and an unrelated armed forces deduction. This is scope creep.

    • File: policyengine_canada/variables/gov/cra/deductions/deductions_from_total_to_net_income.py
  16. No boundary-condition tests across all programs.
    Systematic gap: no test places income or age at exact threshold values. Missing tests at: age 6/7 (CRA), age 15/16 (CRA), income $150,000 (ON), income $111,000/$45,000 (BC ACCB), income $180,000/$90,000 (AB), age 4/5 (BC/AB).

  17. Comments in code reference specific dollar amounts that will become stale.
    child_care_expense_deduction_max_per_child.py lines 22-24 mention "$11,000", "$8,000", "$5,000". Should reference parameter names instead.


Suggestions

  1. Federal CCED child_income_limit.yaml missing historical values 2015-2022.
    Only has 2023 and 2024 entries. Values for 2015-2022 are absent, which may affect historical simulations.

  2. 0.6667 precision for 2/3 fraction.
    The statutory fraction is exactly 2/3 (0.666666...). Consider 0.666667 or more decimal places.

    • File: policyengine_canada/parameters/gov/cra/deductions/child_care_expense/earned_income_fraction.yaml
  3. Ontario CARE rate.yaml cites TaxTips.ca (third-party) as reference source.
    Should be replaced with the official CRA ON479-A schedule or Ontario Taxation Act citation.

  4. Ontario CARE files lack statutory reference to Ontario Taxation Act, 2007, s. 103.0.3.
    All 6 Ontario parameter files reference the ontario.ca overview page but not the underlying legislation.

  5. All reference titles across all jurisdictions are too vague.
    Federal: "Line 21400 - Child care expenses." Alberta: "Alberta Child Care Subsidy." Titles should include specific section numbers or page identifiers.

  6. BC CCFRI 2018 historical values cite 2024-25 guidelines document.
    The 2024-25 CCFRI PDF cannot corroborate 2018 launch amounts ($350, $100, $100). A separate 2018-19 reference is needed.

  7. Federal CRA parameter labels missing jurisdiction prefix.
    Labels like "Child care expense deduction age limit" should include "CRA" prefix for multi-jurisdiction clarity.

  8. BC integer age prevents correct 0-18 month vs. 19-36 month distinction.
    The ACCB uses age < 1.583 on an integer age variable, making it equivalent to age < 2. A 19-month-old (integer age 1) gets $1,250 instead of $1,060. This is an inherent platform limitation.

  9. Neither bc_child_care_fee_reduction nor ab_child_care_subsidy is included in their province's benefits aggregation list.
    These variables are standalone and do not flow into total benefit calculations.

  10. No integration test combining federal CCED with provincial child care programs.
    The existing integration.yaml has 3 tests, none covering child care.

  11. Squash 3 debug commits before merge.
    Branch has commits e71f8174 debug again, 2476c4a6 debug, 15c6f5d3 debug.

  12. Ontario 2021 20% top-up encoded by inflating max_amount parameters.
    The top-up should be a multiplier on the final credit. If the formula is corrected to use line 21400, the top-up encoding also needs rework.

  13. BC CCFRI and Alberta subsidy models do not differentiate by care type.
    Only Group Child Care rates are modeled. Family/In-Home, Kin Care, etc. are absent.

  14. Alberta age boundaries use age 5 instead of Grade 1 enrollment.
    The real program distinguishes by school enrollment, not a fixed age threshold.

  15. * 12 monthly-to-annual conversion in 3 files is unconventional.
    No other variable in the codebase uses * 12. Consider definition_period = MONTH or documenting the conversion.


PDF Audit Summary

Category Count
Confirmed correct 21
Mismatches (code-path confirmed) 9
Mismatches rejected (code-path cleared) 0
Unmodeled items 21

Breakdown by jurisdiction:

Source Matches Mismatches Unmodeled
Federal T778 (PDF 2) 7 0 9
Ontario ON479-A (PDF 4) 7 2 (rate table +2pp across 36 brackets, spurious $153,600 bracket) 4
BC CCFRI Guidelines (PDF 1) 5 4 (preschool $145 vs $545, effective dates x2, age boundary) 8
Alberta Subsidy Rates (PDF 3 + web) 2 3 (base preschool, base school-age, phase-out fraction) 8

Validation Summary

Check Result
Regulatory Accuracy 5 critical discrepancies (ON formula, ON rate table, BC CCFRI preschool, AB base amounts, AB phase-out)
Reference Quality 7 federal refs non-corroborating, 4 AB refs unsourced, 3 BC PDF refs missing page anchors
Code Patterns 10 hard-coded values, 2 np.round() usages, 1 path mismatch, 30 non-compliant descriptions, 13 missing period fields
Test Coverage 0 boundary tests, 0 two-parent tests, 0 integration tests, misleading 2/3 income test
PDF Value Audit 9 mismatches (all code-path confirmed) / 21 values confirmed correct
CI Status Unknown (not derivable from PR diff alone)

Review Severity: REQUEST_CHANGES

This 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:

  • Federal CCED: 7/10 -- core structure correct, per-child limits verified, gaps in earned income definition and claimant logic
  • Ontario CARE: 2/10 -- fundamentally flawed formula, rate table with systematic errors, wrong income variable
  • BC ACCB: 6/10 -- all parameter values correct, reasonable structure, integer-age limitation is inherent
  • BC CCFRI: 3/10 -- critical parameter error ($145 vs $545), missing kindergarten category, correct structure otherwise
  • Alberta Subsidy: 1/10 -- multiple unsourced parameters, wrong modeling approach, needs complete rewrite

Next Steps

Priority 1 -- Must fix before merge:

  1. Fix Ontario CARE rate table: correct duplicate 0.73 at $22,500 to 0.71; remove spurious $153,600 bracket; set $150,000 threshold to 0.00
  2. Rewrite Ontario CARE formula to use child_care_expense_deduction (federal line 21400) as base instead of raw expenses with Ontario caps
  3. Create Ontario CARE-specific adjusted income variable (net income + CCED + social benefits repayment)
  4. Fix BC CCFRI preschool parameter to $545; add kindergarten category at $320
  5. Replace Alberta base subsidy amounts with actual published rate tables (ideally implement full discrete income brackets)
  6. Remove or correct Alberta phase-out fraction (implement discrete brackets instead)
  7. Fix all 7 federal CCED references to cite ITA s. 63 and/or CRA T778 with page numbers
  8. Parameterize all 10 hard-coded age thresholds and family size values
  9. Fix the claimant allocation edge cases (equal income, zero income)
  10. Add tests where the 2/3 earned income limit is the binding constraint and for two-parent households

To auto-fix issues: /fix-pr 540

…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>
@PavelMakarchuk
Copy link
Collaborator

Fixes Applied

🔴 Critical Issues Fixed (13/13)

  1. Ontario CARE rate table: Fixed duplicate 0.73 at $22,500 → 0.71; corrected all 38 brackets to match ON479-A; removed spurious $153,600 bracket; fixed $150,000 to 0.00
  2. Ontario CARE formula: Rewrote to use child_care_expense_deduction (federal line 21400) as base, matching ON479-A definition
  3. Ontario CARE income variable: Changed from adjusted_family_net_income to family_net_income + child_care_expense_deduction, matching ON479-A adjusted income
  4. BC CCFRI preschool: Fixed $145 → $545/month for "3 Years to Kindergarten" group care
  5. BC CCFRI kindergarten: Added new $320/month category with separate parameter and age bracket
  6. Alberta base subsidies: Replaced unsourced $200/$250 with actual discrete income bracket tables (14 preschool brackets, 10 school-age brackets) using .calc() lookup
  7. Alberta phase-out: Removed incorrect linear 0.5 fraction; now uses discrete bracket tables matching alberta.ca
  8. Federal CCED references: All 7 parameter files now cite ITA s. 63 + CRA T778 with #page= anchors
  9. Hard-coded ages: Parameterized all 10 instances across BC/AB (13 new parameter files)
  10. Double-counting bug: Fixed claimant allocation with deterministic person_index tiebreaker
  11. Earned income definition: Broadened to include self_employment_income per ITA s. 63(3)
  12. Claimant allocation: Changed from employment_income to total_individual_pre_tax_income per ITA s. 63(2)
  13. Ontario spurious bracket: Removed $153,600; fixed $150,000 rate to 0.00

🟡 Should-Address Issues Fixed (15/17)

  • ✅ Changelog migrated to towncrier format (changelog.d/540.added.md)
  • ✅ 30 parameter descriptions fixed (trailing periods, active voice)
  • ✅ 8 parameter files: added missing period metadata
  • ✅ Removed scope creep (armed forces deduction from deductions_from_total_to_net_income.py)
  • documentationreference field on all variable files
  • ✅ Removed np.round() calls (2 files)
  • ✅ Added #page=5 to BC CCFRI PDF references (3 files)
  • ✅ Nested where()np.select in BC variable files
  • ✅ Ontario references updated to cite Ontario Taxation Act s. 103.0.3 + CRA ON479-A
  • ✅ Stale dollar comments replaced with parameter references
  • ✅ Added 11 new tests: 2/3 earned income binding, two-parent allocation, boundary conditions (ON/BC/AB)

Verification

  • ✅ All 797 tests pass (11 new + 786 existing)
  • ✅ Code formatted with black
  • ✅ 59 files changed, 860 insertions, 432 deletions

Files Changed Summary

Category Count
Parameters modified 24
Parameters created 16
Parameters deleted 5
Variables modified 9
Tests modified/created 5
Other (changelog, model_api) 2

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>
@PavelMakarchuk
Copy link
Collaborator

Fixes Applied (Second Pass)

🔴 Critical Issues Fixed

  • C1 — Ontario CARE rate thresholds: Added 2024-01-01 bracket entries with correct income thresholds from ON479-A schedule ($5,000 steps $40k-$60k, $3,600 steps $60k-$146.4k). All 28 divergent thresholds corrected. 2019 historical values preserved.
  • C2 — Alberta school-age subsidy: Corrected 7 intermediate bracket amounts ($348/$311/$275/$238/$201/$165/$128) matching official 2024 Alberta.ca rates.
  • C3 — Alberta preschool subsidy: Fixed 5 brackets off by $1 each ($253/$226/$213/$160/$120).
  • C4 — Alberta references: Added Alberta Child Care Licensing Regulation (AR 143/2008) citations alongside specific rate table references.

🟡 Should-Address Issues Fixed

  • S1 — Ontario statute citations: Added subsection detail (s. 103.0.3(4)(a-c), s. 103.0.3(7))
  • S2 — BC ACCB references: Added specific titles + Child Care Subsidy Regulation (B.C. Reg. 74/2018)
  • S3 — BC CCFRI max_age: Fixed reference to CCFRI Guidelines PDF page 5, Table 1
  • S4 — Alberta references: Added regulation citations to all 4 files
  • S5 — CRA child_income_limit: Added 2023 T778 reference for $15,000 value
  • S6 — Ontario ON479-A titles: Made specific with year and section (e.g., "(2024) — CARE credit rate table")
  • S7 — CRA statute titles: Added subsection suffixes (e.g., "s. 63(1) — Definition of eligible child")
  • S9-S13 — Added 8 boundary tests: CRA age 6/7, age 15/16, disabled age 17+, BC ACCB $111k, Alberta age 5

Verification

  • ✅ All 805 tests pass locally
  • ✅ Code formatted (black + linecheck)
  • ✅ 34 files changed, 360 insertions, 76 deletions

Changes by Jurisdiction

Jurisdiction Parameter Fixes Reference Fixes Test Fixes
Federal CRA 7 files improved +5 boundary tests
Ontario CARE 28 thresholds corrected 6 files improved 4 expected values fixed
BC ACCB/CCFRI 13 files improved +2 boundary tests
Alberta 12 bracket amounts fixed 4 files improved 5 expected values fixed, +1 boundary test

Ready for re-review.

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.

Implement childcare expense deductions and benefits

2 participants