Repository navigation
Give the Social Security state backend the names Core 3.33.13 needs - #10504
Merged
hua7450 merged 1 commit intoOct 27, 2026
Merged
Conversation
policyengine-core 3.33.13 calls operator.index in build_default_simulation and _restore_count in restore_simulation. The state-machine backend runs those installed source bodies in namespaces it builds, which had neither, so test_social_security_input_state_machine failed with NameError on main. Add the operator module, and stub _restore_count beside the existing _restore_entity stub for the one-person fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Program ReviewSource Documents
Critical (Must Fix)None.
Should AddressNone. The test review left one item open, and it is now closed. Rest Python shard 3 (job 122378770311) logged Suggestions
Validation Summary
Review Severity: APPROVENext StepsTo auto-fix issues: No fixes are required.
|
DTrim99
approved these changes
Oct 27, 2026
DTrim99
left a comment
Collaborator
There was a problem hiding this comment.
Approved after /review-program: 0 critical, 0 should-address, 5 suggestions (see the review comment). The fix supplies both globals Core 3.33.13 newly reads (operator, _restore_count), and Rest shard 3 ran the state-machine test on Core 3.33.13 and passed.
hua7450
added a commit
that referenced
this pull request
Oct 27, 2026
Brings in the Social Security state backend fix for Core 3.33.13 (#10504). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hua7450
added a commit
to hua7450/policyengine-us
that referenced
this pull request
Oct 27, 2026
Brings in the Social Security state backend fix for Core 3.33.13 (PolicyEngine#10504). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 4 tasks
MaxGhenis
added a commit
that referenced
this pull request
Oct 28, 2026
#10400 was squash-merged as 9969420, so Git's merge base is the pre-#10400 commit d453360 and every file #10400 added and this branch then changed shows as an add/add conflict. Each was resolved against #10400's head a6dcc92: - The four social_security_*_pia_ratio_factor.py variables, Makefile and tests/code_health/test_rest_python_groups.py: main's copy equals #10400's head, so this branch's filled version (built on that head) is kept. - tests/core/_social_security_state_backend.py: this branch's copy equals #10400's head and main changed it afterwards (#10504, Core 3.33.13 names), so main's version is kept. - changelog.d/ss-benefit-levers.added.md: main's release compiled and removed it; removed here too. A merge-tree run with a6dcc92 as the base gives the same tree apart from the version files (CHANGELOG.md, pyproject.toml, uv.lock), which this merge takes from main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What and why
Main's release runs fail
Full Suite - Rest (Python shard 3)oncore/test_social_security_input_state_machine.py(run 40544965026):The test's backend (
core/_social_security_state_backend.py, from #10400) runs Core's installedSimulationBuilder,Simulation, holder and dumper source in namespaces it builds itself. policyengine-core 3.33.13 (released 2026-10-27 16:43 UTC; CI installs the latest Core on every run) gave those functions two new globals the namespaces lack:build_default_simulationnow checks its count withoperator.index. The builder namespace now gets theoperatormodule.restore_simulationnow calls_restore_countfor each population after restoring the entities. The backend already stubs_dump_entityand_restore_entityfor its one-person fixture, so_restore_countgets a no-op stub beside them. Without it the test fails next withNameError: name '_restore_count' is not defined.The earlier failures on main today were a different test:
core/test_mt_state_agi_invariants.py, which #10496 fixed. Runs that include #10496 fail only on this test.To find every name Core's executed functions need, I listed the global names each function reads that neither its namespace nor builtins define. Core 3.33.13 adds exactly these two names to the list. The other seven (
psutil,tools,EnumArray,SimulationMacroCache,Reform,pdandSituationParsingError) were missing under 3.33.12 too and sit on branches the fixture never runs: reforms, datasets, the macro cache and error paths.Test plan
make formatchangelog.d/test_social_security_input_state_machine.pylocally: fails with theoperatorNameErroron Core 3.33.13 before the change; passes on Core 3.33.13 and 3.33.12 after it._restore_countstub, Core 3.33.13 fails the test withNameError: name '_restore_count' is not defined.axiom: n/a: test fixture change only, no policy change.
🤖 Generated with Claude Code