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.
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, and each test's comment says how 3.20.0 behaved.year:2025-04leave period 2022's income tax at $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.agestays in memory, and the tax stays $8,020. On 3.20.0 the limit left the wages in memory, so the test fails before it calculates."2026-04-01.2027-03-31"gives $6,020 of tax for 2027 and $7,658 for 2028, on both Cores. Keyed by"2027", the same reform gives $6,020 for both years.set_inputand in a fresh calculation.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). Keyed by"2027", the reform above gave 2028 the full $7,658 on 3.20.0. A range such as"2026-04-01.2027-03-31"limits a reform to one tax year on both Cores.receiving_nz_superstill reads NaN as true on both Cores.Mid-month years that Core 3.38.0 still accepts
Core keys a stored value by the period's string form, which drops the day of a year that starts mid-month. policyengine-core#526 tracks the fix. Until then:
year:2026-03-31underyear:2026-03without an error. Core 3.20.0 raised for this key, as it did for any key with a colon.year:2026-03-31after one foryear:2026-03-01returns the 1 March result, $18,788.64 in the probe above, as 3.20.0 also did.Each xfail test passes if Core either refuses the year or keeps it apart from the first of its month, so it fails while Core behaves this way. Once Core changes in either way, the test passes, which strict xfail reports as a failure, and the mark comes off.
Checks
test_core_version.pyfail, each where its comment says. The range-keyed reform passes, and the cached mid-month test fails at its last check, as expected.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 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.axiom: no RuleSpec change (Core dependency and tests)
🤖 Generated with Claude Code