Repository navigation
Apply the Child Tax Credit family-element birth-date condition - #2475
Merged
Merged
Conversation
vahid-ahmadi
left a comment
Collaborator
There was a problem hiding this comment.
Looks right, fine to approve.
@juaristi22 thanks. The rule matches CTC Regulations 2002 reg 7(2)(a) as amended by SI 2017/387 reg 4(b): the family element is included only if a claimant is responsible for a child or qualifying young person born before 6 April 2017. The strict < on birth_day gets the on-the-day case right, and benunit.any gives one family element per claim. Using Refs #2050 rather than Fixes is right, since the pre-2011 baby addition and pre-2015 coverage stay open.
- nit:
parameters/gov/dwp/tax_credits/child_tax_credit/eligibility/family_element_born_before.yaml:1holds the same 20170406 date as the existingchild_tax_credit/limit/born_before. A separate lever is a fair choice for reforms, but a comment saying the two dates are the same in law, and set separately on purpose, would stop someone "tidying" them later. - nit:
family_element_born_before.yaml:9-12cites reg 7 and s.9 as amended, but not the amending SI. Adding SI 2017/387 reg 4(b) there, as in the..._condition_applies.yamlfile, would make the source of the date clear. - nit:
family_element_birth_date_condition_applies.yaml:10titles the first reference "regulations 1 and 4(b)" but links to reg 4 only, and the second entry links reg 1 again. Titling the first "regulation 4(b)" would be tidier. - nit:
docs/book/programs/gov/dwp/tax-credits.md:67-98: the new section reads more like an internal note than user docs ("override contract", "own-right-benefit approximations", "certify"). The first two paragraphs are enough for most readers. - nit (process): #2472 also edits
docs/book/programs/gov/dwp/tax-credits.md. The hunks are next to each other butgit merge-treemerges the two branches cleanly. No open PR of Vahid's touches these files.
What I checked
- Read the issue, PR body and full diff. Checked reg 7(2)(a) and (3) on legislation.gov.uk (current text, £545 family element and £3,455 child element), and SI 2017/387 reg 1 (in force 6 April 2017).
- Hand-computed the YAML cases: zero income, 2024, child element £3,455 plus family £545 gives £4,000; a child born on or after 6 April 2017 gives £3,455.
- Ran
policyengine-core test .../ctc_family_element.yaml(3 passed) andpytest test_ctc_family_element.py(20 passed) on the PR head. WithCTC_family_element.pyreverted to main, 2 of 3 YAML cases and 9 of 20 pytest cases fail. - Checked that
parameters("2017")reads the condition as true andparameters("2016")as false. ruff checkandruff format --checkon the changed Python files: clean. Hosted CI is green, including Fix evidence. The Reproducer and axiom lines are present.- Did not run the full suite or any population dataset.
🤖 Generated with Claude Code
vahid-ahmadi
approved these changes
Oct 18, 2026
vahid-ahmadi
left a comment
Collaborator
There was a problem hiding this comment.
Approving, per my review above. Nits are optional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2050.
CTC paid the £545 family element even when no responsible child or qualifying young person was born before 6 April 2017. For a continuing zero-income 2024 claim with one child born on that date, modeled Child Tax Credit was £4,000; it is now £3,455. A child born the prior day retains £4,000.
The family element now uses the existing CTC responsibility mask and DOB helper. Separate dated family-condition and cutoff parameters preserve earlier supported years and independent reforms. The flat amount, individual-element cutoff, claim and income tests, explicit amount overrides and 2025 closure are unchanged.
This is a partial resolution: #1925 already removed uprating; the pre-2011 baby addition and 2003–2014 coverage remain open under #2050. The 2015 false activation is a model-coverage anchor, not legal commencement. Existing April annual sampling, age/month fallback when DOB is missing, looked-after/own-right-benefit proxies and statutory daily award-rounding limitations remain. No historical coverage, population impact or encoded parity is certified. Draft #2057 and ready #2061 retain their separate State Pension/PC work and fixture dependencies.
Sources: CTC Regulations 2002 reg 7(2)(a), SI 2017/387 reg 4(b), commencement reg 1, and Tax Credits Act 2002 s 9(2)(a).
Reproducer: policyengine_uk/tests/policy/baseline/gov/dwp/tax_credits/ctc_family_element.yaml::A child born on the family cutoff receives no family element
Validation: natural-cash RED 2 failed/1 control passed on unchanged production (initial PyYAML/absent-source setup attempt retained separately, zero tests). One bounded focused batch passed 68 unique cases: 23 new and 45 unchanged regressions, with JUnit and per-case JSONL; 62.61s pytest/70.24s CLI. Both post-fix final CTC and aggregate tax credits match the independent cash oracles. Native HTML build passed in 10.57s with existing Node warnings/public web-asset bootstrap retained. All 2,968 protected tracked files stayed byte-identical; no old-fixture changes were needed. Publication requires passing pinned formatting and independent captured-head review, recorded in the coordinator’s review report.
Local runtime: Python3.13.14/Core3.32.27/Hypothesis6.168.2/pytest8.4.1 versus locked Core3.33.2/Hypothesis6.169.0; offline/no-sync, exact checkout imports, external caches, no private inputs or full-suite run. The original 15 background source examples are not a count of executed tests.
axiom: needed