Repository navigation
Sort the AB2025 registry's name searches - #251
Conversation
policyengine-core adds variables in glob order, which differs by filesystem, so build_ab2025_registry.py --check failed on a filesystem whose order differed from the one that wrote the registry. ns() now sorts the matching variables. Regenerated at policyengine-uk 2.89.2 with policyengine-core 3.34.5, the registry matches 640bdd3's copy byte for byte, and --check and --resolve pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6JAsQ5xLsK6aNQd6E8
scorecard_db.export_populations, run against a fresh build_db at main's built date, reorders the variable lists in 212 AB2025 pe_gap rows' annotations. 62 of those rows now name a different six variables; the printed totals, values, verdicts, keys and row order stay the same. data/populations-pmd/ does not move. app/public/data carries the same copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6JAsQ5xLsK6aNQd6E8
tests/test_uk_replay_legacy.py compares the registry with this fixture, so the regenerated registry's sha256 replaces main's. No replay seal or receipt pins these bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6JAsQ5xLsK6aNQd6E8
The builder calls policyengine-uk at import, so ns() now delegates to pipeline/name_search.py, which takes the parameter paths and variable names as arguments. A Hypothesis test checks that every permutation of the variable list gives the same text, and a second test pins the sorted first six. Both fail with the sort removed. The builder still reproduces the registry byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6JAsQ5xLsK6aNQd6E8
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Ready for hub review Head: We built the registry in a venv with policyengine-uk 2.89.2 and policyengine-core 3.34.5. The builder pins only policyengine-uk, at 2.89.2, through Our row-diff script compares each regenerated file with main's copy and asserts that only the variable list inside a name search moves. It reports:
The grep found main's sha256 ( Test results:
We didn't run CI's We found three things outside this change and left them alone:
Generated by Claude Code |
|
Merged at
We land #231, #247, #246 and #249 after this, each with |
pipeline/build_ab2025_registry.pynow sorts the variables each name search matches before it prints their count and the first six. policyengine-core adds variables in glob order, which differs by filesystem, so--checkfailed wherever that order differed from the one that wrotedata/uk/ab2025_measures.json. In our Linux build container, main's builder fails--checkand the new builder passes it. We held the sort out of #247, and #230 tracks it.The builder now takes its name-search text from
pipeline/name_search.py, a pure function of the pattern, the parameter paths, the variable names and the engine pin, so CI tests it without policyengine-uk installed. A Hypothesis test intests/test_name_search.pychecks that every permutation of the variable list gives the same text. A second test pins the sorted first six, and both tests fail when we remove thesorted.We regenerated the registry with policyengine-uk 2.89.2 and policyengine-core 3.34.5, and the new file matches
640bdd3f's copy byte for byte. The builder rewrites the name searches of 37 of its 161 measures: it names a different six variables for 19, reorders the six for 18, and prints every count unchanged.--checkandvalidate_budget_2026_registry.py --resolveboth pass, with 83 parameter paths resolved.We rebuilt
data/scorecard.dbwithscorecard_db.build_dband reranscorecard_db.export_populationswith main'sbuiltdate. The export rewrote the annotation text of 212 AB2025pe_gaprows indata/populations.jsonand its copy inapp/public/data. In 62 of those rows the search now names a different six variables, and in the other 150 it reorders them. No value, verdict, count, key or row order moves, anddata/populations-pmd/anddata/lanes.jsonstay as main has them.tests/fixtures/uk_replay_ab2025_hashes.jsonnow pins the registry's new sha256,a37e8a73c5f0664bb7ade2a90df841ed058f57357a61e179aecd4c62485f228b, fortests/test_uk_replay_legacy.py. We searched the repository for the old sha256, its 8- and 12-character prefixes and the file's git blob id, and found no other pin, in a replay seal, a receipt or anywhere else.uvx ruff format --check be nz scorecard_db tests pipelinepasses, and we ran the fullpytest tests/suite with CI's dependencies on four workers: 3,114 tests pass, 17 skip, and one fails. That test fails because the Modal factory refuses any interpreter but Python 3.12, and we ran the suite on 3.13; it fails the same way on main under 3.13 and passes here under 3.12..github/scripts/uk_replay_regenerate.shverifies every replay seal and regenerates every namespace unchanged, and the suite and the export leave the tree clean.🤖 Generated with Claude Code