Repository navigation
Catch in-place list edits and scale metadata changes in the Budget contract's shared-parameter check - #583
Draft
MaxGhenis wants to merge 3 commits into
Draft
Catch in-place list edits and scale metadata changes in the Budget contract's shared-parameter check#583MaxGhenis wants to merge 3 commits into
MaxGhenis wants to merge 3 commits into
Conversation
GPT-6.1 Sol's round-4 P3 notes on #577: - shared_state records values as JSON text, so a list-valued parameter changed in place no longer compares equal to its own snapshot. - Node and scale metadata, and each scale's band count, are compared too (a scale's type picks its tax-scale class). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviews of #583 (GPT-6.1 Sol and Opus 5.5, both APPROVE with P3 notes): - each scale records its bands' names in order, so a reordered band (which changes what a positional reform targets) shows, as well as an added or removed one; - the root's metadata is compared too; - _frozen falls back to repr when a value cannot be JSON (non-string keys, a cycle), so the snapshot cannot crash the run; - the row's check text names what it compares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #582
Review: GPT-6.1 Sol and an independent Opus 5.5 review both approved 7226ded, each with P3 notes. Their notes are fixed in the latest commit (below). CI is next.
Follow-up to #577, the UK Budget reform contract. GPT-6.1 Sol's round-4 review approved #577 and left two P3 notes on
module_parameters_unchanged. That's the run-level check that policyengine-uk's shared parameter state is unchanged after a contract run: the module system, and the processed, statutory and projected caches. The reviewer executed both notes on fresh core trees.What this changes
shared_staterecords each timeline value as JSON text. Before, it kept the live value, so a list-valued parameter changed in place (append) compared equal to its own snapshot.metadata.typepicks its tax-scale class (single_amountormarginal_amount).scale[0].ratetargets whichever band comes first._frozenfalls back toreprwhen a value can't be JSON (non-string keys, a cycle).Tests
tests/test_uk_budget_reform_contract.pyadds four tests on a fake shared tree:Results:
🤖 Generated with Claude Code