Repository navigation
Conversation
|
Round 1 independent review of Verdict:
I'll address all 7 P1s and the P2 after PR #35 lands (since this branch shares |
39d992b to
156a89e
Compare
|
Rebased onto
Verification after the final commit
|
|
Agent-written for Max, by Claude Code for Max Ghenis. Round 2 ( Commit
We verified |
|
Agent-written for Max, by Claude Code for Max Ghenis. Round 3 ( Commit
Verification on
Scoped round 4 ( |
|
Agent-written for Max, by Claude Code for Max Ghenis. Scoped round 4 ( Commit
Verification on
Per |
Implements steps 1–5 of #20.
The model now applies the regulation 18 reduction, floors the weekly balance at zero, and rounds it up under regulation 19 before multiplying by 52. The payable YEAR variable applies the regulation 15 cash assets test and the section 67(e) pension income exclusion. The existing before-abatement variable reports 52 weeks at the unrounded Schedule 4 Part 7 rate. Keeping the unrounded weekly calculation in float64 through the regulation 19 ceiling preserves whole-dollar rounding when Core stores intermediate results in 32 bits, while branch-visible user input detection (
Holder.get_input_periods) keeps explicitaccommodation_supplement_weekly_before_abatementoverrides authoritative even when their stored float32 value equals the calculated gross or when Core skips caching derived results. Regulation 15, regulation 18, regulation 19, Schedule 4 Part 7The base-rate formula applies regulation 17 to Jobseeker Support recipients, NZ Super recipients and non-beneficiaries. It uses dated Jobseeker, NZ Super and eldest-child Family Tax Credit parameters, while checking the effective
accommodation_supplement_is_beneficiaryflag and branch-visible explicit input provenance so single and partneredNON_BENEFICIARYorFalseoverrides clear paid-benefit bases without treating uncached automatic evaluations as explicit non-beneficiaries. In a mixed[AUTOMATIC, NON_BENEFICIARY]couple where both partners have benefit grants, the explicitly unpaid partner contributes a zero addend under regulation 17(2)(d)(i) and (iii) rather than forcing the automatic partner into the unknown-partner fallback. A single beneficiary under 25 uses the age-25 rate under regulation 17(2)(a), while a single non-beneficiary uses the appropriate Jobseeker rate under regulation 17(2)(f), including clause 1(a) for an under-20 applicant living with a parent with a child. Paragraphs (b), (f) and (h)(ii) omit the words "if any" and always include the under-16 eldest-child Family Tax Credit benchmark rate whenever the applicant has a dependent child. By contrast, paragraph (d)(ii) adds it for a partnered beneficiary only if no included under-18 dependent child in the child role is aged 16 or 17 (ignoring linked members aged 18 or over, and assuming a child under 16 when a caller supplies a count without ages). The beneficiary test checks actual payments, and callers supplyjobseeker_weekly_assessable_incomeon the benefit unit to assess whether an existing Jobseeker grant pays. Regulation 17, Schedule 4 Part 1, income tax section MD 3The Accommodation Supplement uses each person's pre-tax annual employment, self-employment and investment income divided by 52 as the default weekly measure, recovering float64 cent precision across conversion and partner aggregation before applying complete-dollar flooring under regulation 18 and section 423(3) while honoring explicit
accommodation_supplement_weekly_assessable_incomeoverrides even on float32 rounding ties. Because Core stores each numeric input in 32 bits, inputs keep whole cents between-$131,072and$131,072, while larger annual inputs can lose a cent or more before recovery. Callers can supplyaccommodation_supplement_assessed_weekly_income,accommodation_supplement_assessed_weekly_base_rate, andaccommodation_supplement_beneficiary_statusto override individuals in a mixed simulation while calculated rows continue to evaluate formulas (direct sets onaccommodation_supplement_is_beneficiary,accommodation_supplement_weekly_base_rate, andaccommodation_supplement_weekly_assessable_incomealso work for single-regime runs). It aggregates the partner's assessable income through theBenefitUnitwhere the law counts it and leaves a community spouse on their own income under regulation 18(2A). Schedule 3 Part 2, Schedule 3 clause 13, section 423Regulation 18(3)(b) applies Income Test 3 to Schedule 2 sole parents, while a partnered parent assessed under Schedule 4 Part 1 clause 6 (
has_partner,is_sole_parent, and an included Schedule 4 child) remains outside Schedule 2's sole-parent definition and uses Income Test 1 under regulation 18(3)(c). Dependent children linked in the benefit unit under age 18 count alongside explicitaccommodation_supplement_dependent_childrencounts across the cash assets limit, deemed income rules and pension income limits. For Schedule 4 base rates, income levels and caps,accommodation_supplement_excluded_childrentakes precedence over automatic child flags (is_sole_parentandjobseeker_has_dependent_child), while those flags still act as consistent fallbacks when no explicit count or linked child is supplied.Section 67(e) tests the applicant's own NZ Super or veteran's pension receipt and excludes them when assessable income exceeds the applicable Schedule 5 Part 2 limit, using a float64 comparison tolerance (
rtol=1e-12) so distinguishable float32 increments above the limit trigger exclusion. The Act's 2022 transition governs clause 9A and section 67(e)(ii). Regulations 17 and 18 apply their community-spouse provisions from their own commencement. The 2026 Social Security Act consolidation confirms the April 2026 limits. The corpus also contains SL 2026/36, and its Schedule 2 confirms the five March 2026 amounts in the issue. Section 67, Schedule 5 Part 2, Schedule 1 clauses 93 and 94, SL 2026/36 Schedule 2 Part 1Coverage and open question
accommodation_supplement_beneficiary_statusandaccommodation_supplement_assessed_weekly_base_ratefor main benefits outside the model (including Sole Parent Support and Supported Living Payment) or regulations 17(2)(e) cases. The new veteran's pension input supplies receipt, and callers supply the assessed base rate.accommodation_supplement_beneficiary_status,accommodation_supplement_assessed_weekly_base_rate, and any applicable income reduction. For dates before April 2025, callers supply any applicable section 67(e) exclusion. The payable calculation assumes the applicant meets the other eligibility requirements.Tests
We rebased the branch onto
main(e2ed7592, which merged PR #35 requiringpolicyengine-core >= 3.38.0) and verified commitdc10aab0under Core 3.38.0.pytest -q) passed 1,857 tests with 1 skipped test and 1 expected failure (test_working_for_families_helpers.py:357skips whennp.longdoublehas 64 bits on Apple Silicon, andpolicyengine-core#526xfails on the cached 31 March Jobseeker calculation).47137087255passed all 11 of 11 checks acrosslint, changelog, and the Ubuntu, macOS, and Windows matrices (3.11–3.13).test_accommodation_supplement_periods.py,test_accommodation_supplement_payable.yaml,test_accommodation_supplement.yaml) passed 310 tests with 1 warning, and the policy YAML suite passed 253 tests. It covers issue cases 1–15, mixed-populationNON_BENEFICIARYoverrides including mixed-status[AUTOMATIC, NON_BENEFICIARY]couples and uncachedopt_out_cachecontrols, linked and excluded dependent children across rates, caps and partnered clause 6 paths, 18-year-old child-role FTC exclusions, offsetting annual boundary inputs in[-$131,072, $131,072], direct float32-tie weekly assessable income overrides,$740.81vs$740.81006pension exclusion, unrounded weekly gross and uncached/branch$140override provenance before regulation 19 ceiling, clause 6 Income Test 1 cut-out ($957), under-20 clause 1(a) non-beneficiary rates, and 16-year-old dependent-child FTC cases outside regulation 17(2)(d)(ii).git diff --checkandruff format --checkon the four edited Python files passed cleanly after formatting, and targeted provenance mutations (always-false,always-true,is-derived) were killed (3 of 3).