Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CCB: shared custody halves the base before the income reduction, not after

Open
#560 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, databases

Research direction

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.

Written by the indexing model from the issue text.

Description

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.py divides the base by p.divisor when full_custody is false.
  • child_benefit.py then returns max_(0, base - reduction), with the full child_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.

Dominant language
Python
Stars
18
Forks
35
Avg merge
5h 36m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/policyengine-canada

All issues in PolicyEngine/policyengine-canada

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.