Repository navigation
Conversation
Core 3.20.0, which the lock pinned, broke calculations for other periods when an input was stored for a year that starts in April, refused such a year in a situation dict, kept a branch's results calculated from its parent's input after the branch replaced that input, and recursed without end on a value kept only on disk. Core 3.38.0 fixes all four, and test_core_version.py checks each one. Core 3.26.6 and later refuse an input that contains NaN, and 3.30.3 and later refuse a year that starts mid-month. The tests that check how the formulas treat NaN now store it as a calculated value, through store_as_calculated, and the tests that gave a year starting on 31 March are gone. Two tests check the refusals. Fixes #34. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent-written for Max, by Claude Code for Max Ghenis. Round 1 review of 009be08, run as a Codex cloud task: https://chatgpt.com/local/6b0ef18c-825c-83e9-921b-fd35ee7270c0. The page shows GPT-6.2 Sol at Extra High effort. Verdict: REQUEST_CHANGES, with five P1s, two P2s and one P3.
The review found the lock moves only Core, all six new tests pass on 3.38.0 and fail on 3.20.0, and |
The situation-dict test reads back the April wages, and the disk test checks that Core keeps the wages on disk and age in memory. New tests cover a nested and a sibling branch, carry-over past a later input, reform keys, an unknown earner status, a fresh mid-month calculation, and the Jobseeker Support and NZ Super rates on 31 March and 1 April. Two strict xfail tests record the mid-month behaviour that policyengine-core#526 tracks. The changelog and the documentation limit Core's NaN refusal to numeric inputs and give the results that change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent-written for Max, by Claude Code for Max Ghenis. Answer to the first review of 009be08. fae567a answers each finding, and the full suite passes on Core 3.38.0, 1,806 tests, with two expected failures. Each result below comes from a run on this Mac, with main at ba0a233 on Core 3.20.0 where it matters. P1, mid-month years. I reproduced all three behaviours, and they differ in where they come from.
Each comes from Core keying a stored value by the period's string form, which drops the day. policyengine-core#526 tracks the fix, and the model has no simulation or builder of its own where it could catch these. P1, the April situation-dict test. It now reads back $10,000 of P1, reform keys. I reproduced it. With the first rate set to 0 under the key P1, the NaN counts. You are right. The NaN changes cover four files, and with a helper that stores nothing, 20 cases fail in seven test functions: 2 in ACC, 3 in the Accommodation Supplement, 1 in Jobseeker Support and 14 in Working for Families. My "eleven" counted one line per parametrized test. The description now says four files and 20 cases. P1, NaN in a Boolean input. Confirmed on both Cores: P2, the disk test. It now asserts that the wages sit on disk and not in memory, and that P2, nested and sibling branches. A new test gives the root $50,000 and a branch $60,000. A branch of that branch reads $60,000 and owes $10,220.50, and a sibling of the first branch reads the root's $50,000 and owes $7,658. On 3.20.0 the nested branch read the root's $50,000. In my probes a branch never read a sibling's input on either Core, so the description claims no change there. P3, wording. The helper's docstring and the disk bullet now use direct wording. Results that change. Of the other changes the review listed, I reproduced the carry-over (2027 tax from $0 to $7,658 with wages for 2022 and 2030), the nested branch, the bare-year reform key and the unknown earner status. The changelog and the description give each, and a test checks each. In my probes the sibling branch and the in-place parameter update behaved the same on both Cores, and I did not build the flat-file dataset case, so the description leaves those three out. Round 2 follows. |
Each xfail test now passes if Core either refuses a year that starts mid-month or keeps it apart from the first of its month, so the marks come off under policyengine-core#526's fix. The cached test sets the 31 March rate on a fresh system, since a Reform.from_dict system drops the model's input carry-over. New tests cover an input stored under another branch's name and a rate updated in place after a calculation. The changelog states when Core 3.20.0 gave a nested branch the root's input, names set_input and a fresh calculation as the routes that refuse a year that starts mid-month, and says that 3.20.0 applied a bare date key for that day alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent-written for Max, by Claude Code for Max Ghenis. 25d4f8f corrects fae567a in three places, and round 2 reviews it.
The suite passes on Core 3.38.0, 1,808 tests, with the two expected failures. |
|
Agent-written for Max, by Claude Code for Max Ghenis. Round 2 review of 25d4f8f, run on this Mac as Subfleet lane job It closes four of the five round-1 P1s (the April situation test, reform keys, the NaN counts and the NaN scope), the disk P2 and the P3.
The reviewer ran |
|
Agent-written for Max, by Claude Code for Max Ghenis. e0bf060 answers the second review of 25d4f8f. The full suite on Core 3.38.0 gives 1,811 passed and one expected failure. The Accommodation Supplement test emits the same infinite subtraction warning as main. Core's situation error emits a P1, the March situation. I reproduced the silent remap on Core 3.38.0. With $15,000 for 1 March and $50,000 for 31 March, 1 March came back as $50,000. NZ now raises a situation error that names the entity, instance, variable and original period. The new test tries 31 March alone and alongside 1 March. Both cases fail when I remove the NZ override. The April control reads $10,000 for April and $50,000 in wages and $8,020 in tax for 2022. P1, the builder hook. My earlier reply missed Core's builder hook. Core calls the country system's P1, the xfails. The situation test now requires the NZ error as an ordinary test. A separate check verifies $18,788.64 for 1 March. The sole strict xfail covers the return of that cached value for 31 March. The test passes if Core reports its specific period-validation error or returns exactly $26,000 for 31 March and still returns the first amount for 1 March. I removed the NZ override to reach the builder variants. P1, the period claims. The description and changelog name direct annual P1, the branch and enum claims. The description and changelog say that a branch reads its nearest ancestor's input and ignores inputs from unrelated branches. The nested branch reads $60,000 on 3.38.0 and $50,000 on 3.20.0. The unrelated branch probe gives zero on 3.38.0 and $60,000 on 3.20.0. An unknown In-Work Tax Credit earner status became P2, the flat datasets. Both documents now record the two changes. In the synthetic fixtures, Core 3.20.0 swapped the family income inputs on the person rows when family ID order differed from row order. Core 3.38.0 read each value against the right family. With period-suffixed role columns, the family income formula gave zero on 3.20.0 and used the caregivers' earnings on 3.38.0. P2, the sibling test. The root now has a separate case with no wages. The unaffected sibling reads zero, and P2, the age test. The test sets the memory limit before it supplies P3, wording. The nested branch, memory setup, Jobseeker reform and reform-key examples now use direct subjects. The earlier checks still exercise the April wage, the reform keys, the NaN rules and the disk read.
(Harvested and pushed after the round-2 Subfleet lane review |
|
Agent-written for Max, by Antigravity for Max Ghenis.
|
|
Scoped round-4 independent review ( Verification on
|
Agent-written for Max, by Claude Code for Max Ghenis.
Fixes #34.
What changes
pyproject.tomlrequires policyengine-core 3.38.0 or later, anduv.lockpins 3.38.0, the latest release on PyPI, from 27 November 2026. The lock moves no other package.test_core_version.pychecks the Core behaviour that the model relies on.year:2025-04, period 2022's income tax stays $0, where 3.20.0 raised "got: 'year'".year:2025-04, reads back the $10,000 and gives $8,020 of tax for 2022, where 3.20.0 refused the key.income_taxreads its own $60,000 of wages and gives $10,220.50 of tax, and the parent keeps $7,658. On 3.20.0 the branch kept the parent's $50,000.ageon the priority list, then supplies wages and age. Core stores the wages on disk, keepsagein memory and calculates $8,020 of tax. Core 3.20.0 kept the wages in memory."2026-04-01.2027-03-31"gives $6,020 of tax for 2027 and $7,658 for 2028 on both Cores. The same reform gives $6,020 for both years on 3.38.0 when it uses"2027"as the key.set_input.set_inputand in a cold annual Jobseeker Support calculation that stores its result.store_as_calculatedintests/calculated.py. Each stored NaN replaces a nonzero input or reads back as NaN, so a helper that stored nothing fails all 20 cases that call it, in seven test functions.Results that change for inputs Core 3.20.0 accepted
Reform.from_dictapplies a value keyed by a bare year or date from that date onward (Core 3.29.2). With the bare year"2027", Core 3.20.0 gave 2028 the full $7,658. A range such as"2026-04-01.2027-03-31"limits a reform to one tax year on both Cores.set_input. Core 3.20.0 gave that input the statusAUTOMATIC. Both Cores reject an unknown status in a situation dict. Core 3.38.0 also rejects NaN in a float or int input, which 3.20.0 accepted. A Boolean input such asreceiving_nz_superstill reads NaN as true on both Cores.year:2026-03-31hits Core's write guard when it stores the result. Core 3.20.0 returned $26,000 with a rate reform for 31 March 2026 alone.Mid-month annual and monthly periods
Core 3.38.0 uses the period's string form as part of its storage key. That form drops the day from an annual period that starts mid-month.
year:2026-03-31,month:2026-03-31:12, andmonth:2026-03-31) for non-eternal variables in an entity-form situation before Core buffers them under day 1. Core 3.20.0 rejected the annual-length March keys (year:2026-03-31andmonth:2026-03-31:12) after splitting the stored keydefault:year:2026-03at every colon and trying to parseyearas the full period, while Core 3.20.0 silently applied the one-monthmonth:2026-03-31key to2026-03.year:2026-03-01, a request foryear:2026-03-31returns the 1 March result, $18,788.64 in the probe above. Both Cores show this alias. policyengine-core#526 tracks the cache fix.The strict xfail checks the cached calculation after a separate check verifies the 1 March result. The test passes once Core reports the specific period-validation error or returns $26,000 for 31 March while keeping the 1 March amount. Strict xfail then reports a failure so the mark can come off.
Checks
dpath.utildeprecation warning in each new March case.test_core_version.pygives 21 passed and one expected failure on 3.38.0. On 3.20.0 it gives 17 expected ordinary failures, four passes and one xfail. The range-keyed reform, the sibling without root wages, and bothchild_birth_datechecks pass on both Cores.drop-marchorunrelated-errorvariant, the affected cases give ordinary failures. With either therefuseorpreserve-exactvariant, only the cached calculation gives a strict XPASS.year:2025-04wages, the situation-dict test fails. It reads the $50,000 carried over from 2022.Revisions
age. New tests cover a nested and a sibling branch, carry-over past a later input, reform keys, an unknown earner status, a fresh mid-month calculation and the rates on 31 March and 1 April. Two strict xfail tests record the mid-month behaviour that policyengine-core#526 tracks. The changelog, the documentation and this description limit Core's NaN refusal to numeric inputs, give the results that change, describe the mid-month behaviour Core keeps, and count four files and 20 cases for the NaN helper.set_inputand a cold annual calculation as routes to the write guard, and says that 3.20.0 applied a bare date key for that day alone.e0bf0608adds NZ's situation validation, narrows the cached xfail and strengthens the sibling and memory-priority tests. The changelog and this description specify the affected period, branch and enum routes and document the flat-dataset changes.2da60de5f0072c33471d2d3f8efd7206ddfe04bbextends situation period validation to month-unit keys (including 12-month aliases likemonth:2026-03-31:12and monthly keys likemonth:2026-03-31), skips eternal variables sochild_birth_datekeeps loading with dated keys, and fixes passive phrasing in the description and changelog.axiom: no RuleSpec change (Core dependency and tests)
🤖 Generated with Claude Code