Repository navigation
Route UK data issues to the repo that builds the run's dataset - #110
Merged
Merged
Conversation
MaxGhenis
force-pushed
the
uk-data-issue-routing
branch
from
November 8, 2026 20:30
597ab30 to
b4f7854
Compare
policyengine.py 6.16.0 defaults UK runs to Microcosm's microcosm_uk_2024_25, and policyengine-api runs only that default, yet report-logger sent every UK INVESTIGATE issue to policyengine-uk-data. It now routes US and UK data issues to PolicyEngine/microcosm, and a UK run that named an Enhanced FRS or FRS file to policyengine-uk-data, which builds those files. The archive frontmatter gains dataset_at_run, taken from the microsim result's dataset, to carry that choice. - report-logger: country-and-dataset routing in prose and in the issue bash; the issue body names the dataset and its data version. - microsim-runner: UK API and local-path guidance, an optional dataset input, and dataset and data_version in its output; /analyze-policy gains --dataset for local runs. - calibration-diagnostics: where Microcosm keeps its UK targets, and that the live calibration API lists US releases only. - policyengine and policyengine-uk skills: policyengine.py still serves the Enhanced FRS and FRS files by name, as dataset overlays, and serves no per-area file. - test_country_routing: example, property and differential tests; the differential tests run report-logger's bash against the Python reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…egment report-logger took the last path segment of dataset_at_run, so a URI whose revision contains a slash, such as enhanced_frs_2024_25.h5@refs/pr/3, routed to microcosm. It now drops any @revision first, as policyengine.py's dataset_logical_name does, then keeps the last path segment. The reference in test_country_routing.py does the same, the revision strategy now allows slashes, and a refs/pr/3 example joins the example and differential tests. microsim-runner also falls back to /{country}/metadata when a result carries no policyengine_bundle, and calibration-diagnostics names the UK default where it said "their place". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…they're gone The data skill said the old per-area H5s "no longer exist" and that policyengine-us-data's per-area files "were removed". Hugging Face's policyengine/policyengine-us-data still holds 51 state and 436 district H5 files; policyengine.py 6.16.0's bundle manifest references none of that repo's files. Both lines now say what the bundle serves, matching the policyengine skill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The routing description held "dataset: PolicyEngine/microcosm", and the colon-space made the frontmatter invalid YAML, which #107's manifest builder rejects. Reword it and commit the rebuilt dashboard manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
force-pushed
the
uk-data-issue-routing
branch
from
November 11, 2026 06:06
b4f7854 to
a65c848
Compare
…bration-diagnostics The independent review at a65c848 found that the routing tests never reached the prefix boundary: 7 of 14 mutants to report-logger's bash or the Python reference survived. Add a boundary strategy to the property and differential tests, pin near-miss names and an "@" inside the path as examples, and all 14 mutants now fail the suite. calibration-diagnostics chose between Microcosm and policyengine-uk-data files by the run's dataset but never received it; add a `dataset` input and pass it from /analyze-policy's Phase 6. Also from the review: reword the data skill's passive and four be-verb or redundant phrases, stop warning against /over/1 (the UK baseline), give the UK local path a budget source (policyengine-uk's gov_balance), and keep the workflow's log_to description covering ca. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pe.uk's default outputs leave out gov_balance, so tell microsim-runner to
pass extra_variables={"household": ["gov_balance"]} to both Simulations
before it reads the UK cost. Also name the data skill's archived repo
plainly, widen calibration-diagnostics' dataset input to any named dataset,
and describe the routing tests' near misses and edge strategy accurately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
November 11, 2026 13:48
anth-volk
added a commit
that referenced
this pull request
Nov 11, 2026
Brings in #92, #107 and #110. - Versions: keep 4.2.0 in every bundle and the marketplace template; main is at 4.1.1, and this branch adds a skill. - skills/policyengine-tools/SKILL.md: keep #92's sentences on what a data file holds, followed by this branch's ordered data-pattern checks. - dashboard/src/data/manifest.json: rebuilt with main's builder (scripts/build_manifest.py), not merged by hand; --check passes. 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.
report-logger filed every UK
INVESTIGATEdata issue inPolicyEngine/policyengine-uk-data. policyengine.py 6.16.0 loads Microcosm'smicrocosm_uk_2024_25whenever a UK caller names no dataset, and policyengine-api runs only that default. So those issues went to a repo that didn't build the run's data. report-logger now files each data issue in the repo that built the run's dataset:PolicyEngine/microcosm(unchanged)PolicyEngine/microcosmenhanced_frs_*,frs_*)PolicyEngine/policyengine-uk-dataPolicyEngine/policyengine-{country}-data(unchanged)Structural issues still go to
PolicyEngine/policyengine-{country}.What changes
report-logger.mdpicks the repo from the run's country and, for UK runs, a newdataset_at_runfrontmatter field, in both its routing prose and its issue-filing bash. Microcosm now receives data issues from both countries, so the issue body names the dataset and its data version.microsim-runner.mdadds UK guidance for the API path (regionuk, baseline policy1, nodatasetparameter) and for the local path, wherepe.uk.ensure_datasets(datasets=[dataset], years=[year])loads a named dataset. It accepts an optionaldatasetfor local runs and returnsdatasetanddata_versionwith each result./analyze-policygains--dataset, which needs--mode local, and recordsdataset_at_runin the archive. For a UK local run's cost, it points at policyengine-uk's householdgov_balance, sincepe.uk's analysis result carries no budget total. It no longer warns against/over/1, the UK current-law ID.calibration-diagnostics.mdpoints a UK hypothesis at Microcosm's UK target files, or at policyengine-uk-data when the run used one of its files. It also tells the agent that the calibration API lists only US releases. It takes the run'sdatasetas a new input, which /analyze-policy's Phase 6 now passes.policyengineskill said the pre-2026 datasets "are gone", and thepolicyengine-dataskill said the per-area files "no longer exist" and "were removed". Thepolicyengineandpolicyengine-ukskills now say that policyengine.py serves the Enhanced FRS and FRS files only when a caller names one, from the gatedpolicyengine/policyengine-uk-data-privaterepo. Thepolicyengineandpolicyengine-dataskills now say that the bundle serves no per-area file.test_country_routing.pychecks the rule with example, property and differential tests. The differential tests run report-logger's bash andresolve_issue_repo, a Python restatement of the rule, on the same inputs. Both also draw strings built around the two prefixes, and near-miss names (frs,FRS_2024_25,efrs_2024_25) pin the exact, lower-case prefixes. All 14 mutants from the independent review's mutation run fail the suite.log_todescription and target-repo comment,reform-pipeline.md,docs/structured-output-and-chaining.mdandtests/pipeline/README.mdrepeat the rule, andanalyses/README.mddocumentsdataset_at_run. The stale-reference guard's message for per-area paths now says the bundle serves no such file.Evidence
microcosm_uk_2024_25as the UK defaultmanifest.json:106dataset_overlays, inpolicyengine/policyengine-uk-data-private, and_apply_dataset_overlaysraises an error for any overlay that would shadow a certified datasetmanifest.json:261-320,provenance/manifest.py:756-788resolve_managed_dataset_referencereturns the certified default when the caller names no dataset, and the named file otherwiseprovenance/manifest.py:1357pe.uk.ensure_datasetsloads named datasets, andpe.ukexportseconomic_impact_analysisbut nocalculate_budgetary_impactuk/datasets.py:378-424,uk/__init__.py:46-61dataset="default"routes/economy_routes.py:128,:290GET /uk/economy/1/over/1?region=uk&time_period=2026&dataset=enhanced_frs_2024_25returned HTTP 400, "dataset: Extra inputs are not permitted", on 2026-11-08, and the US route answered the same wayquery_parameters.py:114-117,:152policyengine_bundlewith the model version, data version and datasetservices/economy_impact_execution.py:402/uk/metadatalists one dataset undereconomy_options.datasets:microcosm_uk_2024_25build/uk/and its UK build stages inbuild/uk_runtime/3db6515GET https://calibration-diagnostics.vercel.app/calibration/dashboard/api/microcosm/releases, 2026-11-08policyengine/policyengine-us-datastill holds 51 state and 436 district H5 files, and the bundle manifest references no file from that repomanifest.json, 2026-11-08Invariants
test_country_routing.pychecks these for any dataset string Hypothesis generates, and for strings it builds around the two prefixes:Noneor onePolicyEngine/<repo>name;INVESTIGATEandstructuralverdicts open an issue;INVESTIGATErouting ignore the dataset;INVESTIGATErouting lands in microcosm or policyengine-uk-data and reads only the dataset's name: it cuts at the last@and keeps the last path segment, as policyengine.py'sdataset_logical_namedoes before it drops the file extension, so a dataset name and itshf://URI route alike;enhanced_frs_orfrs_goes to policyengine-uk-data;resolve_issue_repoagree forusanduk.A strict xfail records the one case where the two disagree: the bash sends
catopolicyengine-ca-data, the prose sends it topolicyengine-canada-data, and neither repo exists.Not in this PR
datasetquery parameter, which policyengine-api answers with HTTP 400. Its table of advertised US datasets also lists names that/us/metadatano longer serves.model-corroborator.md:105sends the same parameter, andtests/pipeline/test_dataset_naming.pytreats the old US names as advertised and the live default as a bad name. Send no dataset to policyengine-api and read the run's dataset from its bundle #112 fixes these, along with the US local snippet'sdatasetinput, the US path'sdata_versionsource and the optionaldatasetthatskills/policyengine-api/SKILL.mddocuments.PolicyEngine/microcosmnorPolicyEngine/policyengine-uk-datahas thecalibrationorauto-filedlabel that report-logger'sgh issue create --labelpasses, andghstops before it creates an issue whose label the repo lacks (params.go:106-109).caroute, which sends data issues to repos that don't exist.Tests
uv run pytest --ignore=tests/test_skill_examples.pypasses 296 tests and xfails thecacase.uv run python scripts/build_manifest.py --checkpasses on the rebuilt dashboard manifest.scripts/build_claude_wrapper.pycopies the eight edited agents, commands and skills into the wrapper byte for byte.Before merge
~/reviews/policyengine-skills-pr110/review-r5.md), after round 1 (a65c848) asked for changes and round 2 (2811c55) approved with nits. Every Subfleet lane stayed held, so the review ran in session.🤖 Generated with Claude Code