CCB: shared custody halves the base before the income reduction, not after
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Read child_benefit_base_person.py and child_benefit.py to trace where the shared-custody divisor is applied relative to the reduction. Add a regression test using the one-child, age-4, income-50,000 example, then run the relevant child benefit tests. Done means the shared-custody amount is 3,560.545 per year and the no-reduction controls still match.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
For a shared-custody parent, child_benefit takes half of the base amount and then subtracts the full income reduction. ITA 122.61(1.1) works the other way: it calculates the full benefit (base minus reduction) and then takes half of it. Above the first income threshold, the model pays shared-custody parents too little.
Where in the code
child_benefit_base_person.pydivides the base byp.divisorwhenfull_custodyis false.child_benefit.pythen returnsmax_(0, base - reduction), with the fullchild_benefit_reduction.
So the model computes B/2 − R. The Act gives (B − R)/2.
Example (benefit year July 2025 – June 2026, base tax year 2024)
One child aged 4, shared custody, adjusted family net income 50,000 CAD.
- Base B = 7,997
- Reduction R = (50,000 − 37,487) × 7% = 875.91
- Expected (ITA 122.61(1.1)): (7,997 − 875.91) / 2 = 3,560.545 per year
- PolicyEngine Canada 0.99.1: 3,122.59 per year
- Difference: −437.95 per year (about −36.50 per month)
The CRA Child and Family Benefits Calculator, run on 21 October 2026 with the same facts, shows 296.71 CAD per month for the CCB. PolicyEngine annual / 12 is 260.22.
Controls
- Full custody, same income: PolicyEngine 7,121.09 — matches the Act.
- Shared custody at income 30,000 and 37,487 (no reduction): 3,998.50 — matches.
- Shared custody at 37,488: 3,998.465 expected, 3,998.43 from the model — the gap starts as soon as the reduction starts.
- Property check: for one child, shared custody should give exactly half of full custody. At 50,000 the model gives 3,122.59, while half of its own full-custody result is 3,560.54.
Suggested fix
Apply the custody share after the reduction. For example, compute the base and reduction per child at the full rate, take max_(0, base − reduction), and only then apply the shared-custody divisor. A test with the example above (expected 3,560.545) would catch a regression.
How this was checked
We ran the unmodified PolicyEngine Canada 0.99.1 wheel from PyPI (SHA-256 2941641ef6e1c7e428f4717d194ac7e27332dc6e3423ce1936f9c379d0fcb79d, same code as master 029687260d) in a clean environment and compared it with an independent model of ITA 122.6 and 122.61. The CRA calculator run is saved with its request and response. We are happy to share the inputs and the scripts.
This is separate from #557: that issue is about updating parameters to 2026–27. This bug is in the formula and shows up with the current 2025–26 parameters.
Found with Arxo (arxo.io) during a review of open benefit models against the statute.
- Lingua principale
- Python
- Stelle
- 18
- Fork
- 35
- Merge medio
- 5h 36m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine-canada
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 61/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
Tutte le issue di PolicyEngine/policyengine-canada
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sylvainmetayer/homelab#851 ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Add `ty-pre-commit` hookAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubeflow/docs-agent#279 ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Qiskit/qiskit-ibm-runtime#3523 ·
I maintainer di solito rispondono entro 1 giorno