Repository navigation
Keep report-logger's data issues from failing on missing labels, and file none for Canada - #111
Merged
Merged
Conversation
MaxGhenis
force-pushed
the
uk-data-issue-routing
branch
from
November 8, 2026 20:30
597ab30 to
b4f7854
Compare
MaxGhenis
force-pushed
the
report-logger-labels-ca
branch
from
November 8, 2026 20:38
3175ce7 to
c3a5ffc
Compare
MaxGhenis
force-pushed
the
uk-data-issue-routing
branch
from
November 11, 2026 06:06
b4f7854 to
a65c848
Compare
MaxGhenis
force-pushed
the
report-logger-labels-ca
branch
from
November 11, 2026 06:14
97fa083 to
4fea952
Compare
…file none for Canada
gh looks up every --label name among the target repo's labels before it
creates an issue, and stops without creating one when a name is missing
(cli/cli pkg/cmd/pr/shared/params.go, api/queries_repo.go). report-logger
passed --label "calibration,auto-filed", and on 2026-11-08 neither
PolicyEngine/microcosm nor PolicyEngine/policyengine-uk-data had either
label, so every auto-filed data issue failed. The block now lists the
repo's labels and passes only the ones it has. It compares names in lower
case, because gh ignores case when it matches them.
The block sent ca data issues to policyengine-ca-data and the prose to
policyengine-canada-data, and neither repo exists. PolicyEngine has no
Canada microdata: policyengine.py's bundle holds data for us and uk only,
and policyengine-canada's one dataset is a three-person template. So
report-logger files no data issue for ca, and the archive keeps the
report. The prose now names policyengine-canada for structural ca issues,
since policyengine-{country} gave policyengine-ca, which doesn't exist
either.
test_country_routing's differential tests now run the whole issue-filing
block, under bash and zsh, with a stand-in gh that records its calls, and
compare the issue's repo and labels with the Python reference. The strict
xfail for ca goes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne's Canada data route
reform-pipeline still sent other countries' data issues to
policyengine-{country}-data, which gives policyengine-canada-data for ca, a
repo that doesn't exist. It now says report-logger files none for ca.
report-logger's block already files the issue without labels when
`gh label list` fails; report-logger.md now says so, and a property test
fails the stand-in's label lookup for any country, dataset and label set
and checks that the block still files the reference's issue.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/build_manifest.py reads each agent's description and text, so report-logger's new label and Canada wording changes its description and its overlap scores. build_manifest.py --check passes on the result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…block can't route report-logger's block passed the body as --body "$(cat <<'EOF' ...)". bash 3.2, macOS's /bin/bash, can't parse a quoted heredoc inside "$(...)" when the body holds an odd number of apostrophes, so a body with "CBO's" or "doesn't" made the whole block a syntax error and filed nothing. The title sat in double quotes, so the shell expanded "$40B" and backticks in it. gh now reads the body on standard input (--body-file -) from a quoted heredoc, and `read -r` takes the title from another. The block now sets country and dataset from placeholders, and prints an error for any country but us, uk and ca instead of skipping it silently. analyze-policy's --open-issue names policyengine-canada for ca, since policyengine-ca doesn't exist. The tests fill the title and body with apostrophes, $ amounts, backticks and parentheses, and check that gh gets them as written, under bash and zsh, for fixed cases and any text Hypothesis draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
force-pushed
the
report-logger-labels-ca
branch
from
November 11, 2026 14:14
4fea952 to
7daffd2
Compare
- Tell the agent to check that no title or body line matches a heredoc's closing word, to write an apostrophe in a filled value as '\'', and to run the block without set -e or set -u. - Move the country and dataset comments off their assignment lines. - Call `command grep`, so Claude Code's grep function (ugrep) can't match a label that ends in CR. - Tell the agent to give a structural or issue:<repo> issue only labels the repo has, and never `calibration` on a structural one. - Add tab-led lines to the test body, so a <<- heredoc fails the suite, and two tests that fill the country and dataset as the agent does. - Install zsh in CI, and fail the zsh runs there when zsh is missing. - Rebuild the dashboard manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on in the tests - Tell the agent to file a structural or issue:<repo> issue with the block from `if [ -n "$DATA_REPO" ]` on, with DATA_REPO set to that repo, so it gets the same heredocs and label check, and to loop over `auto-filed` alone for a structural issue. - Define a trap grep function ahead of the block in the tests, as Claude Code defines one, so a block that drops `command` fails. - Drop the apostrophe from the country comment. - Rebuild the dashboard manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
November 11, 2026 19:58
anth-volk
added a commit
that referenced
this pull request
Nov 12, 2026
Brings in #111. The only conflict was the generated dashboard/src/data/manifest.json, rebuilt with scripts/build_manifest.py; --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 files each US and UK data issue in
PolicyEngine/microcosmorPolicyEngine/policyengine-uk-data, and its issue-filing bash passed--label "calibration,auto-filed"togh issue create. On 2026-11-08 neither repo had either label. gh looks up each label name before it creates an issue and stops when the repo lacks one, so every auto-filed data issue failed. The bash also sentcadata issues topolicyengine-ca-data, the prose sent them topolicyengine-canada-data, and neither repo exists. And the shell broke the issue's text: macOS's/bin/bash3.2 stopped on a body holding an odd number of apostrophes, and every shell expanded$40Band backticks in the title.report-logger now passes only the labels the target repo has, files no data issue for Canada, and hands gh the title and body as written:
PolicyEngine/microcosmPolicyEngine/policyengine-uk-dataLabels
The block asks gh for the repo's labels and passes
--labelfor each ofcalibrationandauto-filedthat it finds. It compares names in lower case, because gh matches them regardless of case. It callscommand grep, which skips thegrepshell function Claude Code defines. That function runs ugrep, which reads a trailing CR as a line end. It would match a repo labelcalibration\r, and gh would then reject--label calibration. If gh can't list the labels, the block files the issue without them. Creating the two labels in microcosm and policyengine-uk-data would also unblock filing, but it would change two other teams' repos. If either repo adds one, report-logger applies it from then on. Dropping--labelaltogether would unblock filing too, but it would also losecalibrationwhere a repo has it.policyengine-usandpolicyengine-ukboth do, and an analyst can send an issue to either with--log-to issue:<repo>.Canada
PolicyEngine has no Canada microdata. policyengine.py's 6.16.0 bundle lists
ukandusas its only countries, policyengine-canada's one dataset holds three people, and microsim-runner supports only household calculations for Canada. No repo builds the data a Canada issue would concern, so report-logger files none and the archive keeps the report. An analyst can still file one with--log-to issue:<repo>. report-logger andanalyze-policy's--open-issuenow namePolicyEngine/policyengine-canadafor structural Canada issues, because fillingpolicyengine-{country}withcagivespolicyengine-ca, which doesn't exist either.Title and body
The block passed the body as
--body "$(cat <<'EOF' … EOF)". bash 3.2 can't parse a quoted heredoc inside"$(...)"when the heredoc holds an odd number of apostrophes. A body line such asCBO's scoremade the whole block a syntax error, and it filed nothing. zsh parses it. The title sat in double quotes, so the shell read$4in$40Bas an empty parameter and ran anything in backticks.The block now reads the title with
IFS= read -rfrom one quoted heredoc and pipes the body togh issue create --body-file -from another, so no shell expands either one. A heredoc still ends at the first line that matches its closing word, and the shell runs the lines after it. report-logger.md tells the agent to check that the title isn'tEND_TITLEand that no body line isEND_BODY. The old form had the same hole, with the likelier wordEOF. Writing the body to a file with the Write tool would close it, but the suite couldn't then run the agent's path end to end.The block also sets
countryanddatasetfrom placeholders, and printsreport-logger: no data repo for country '<value>'for any country butus,ukandca. report-logger.md tells the agent to write an apostrophe in either value as'\'', to report the unknown-country message undererrors, and to run the block withoutset -eorset -u.What changes
report-logger.md, the issue-filing bash leavesDATA_REPOempty forcaand calls gh not at all. Forusandukit runsgh label list --repo "$DATA_REPO" --limit 1000 --json name --jq '.[].name | ascii_downcase'and passes--labelfor each wanted name in the output. It takes the title and body through quoted heredocs, as above. The routing prose, the shortlist and verdict-default tables and the frontmatter description say the same, and tell the agent to list a Canada data issue underskippedin its output.test_country_routing.pyrun the whole block with a stand-inghthat records each call and the body it reads. They check the issue's repo, labels, title and body against the Python reference. They run under bash and, when the machine has it, zsh, since Claude Code on a Mac can run the agent's shell commands in zsh. Each run fills the title and body with apostrophes,$amounts, backticks, parentheses and tab-led lines. Two tests write the country and dataset into the block as the agent does, quoted as report-logger.md says, apostrophes included. One property test makes the stand-in failgh label listand checks that the block still files the issue. A trapgrepfunction stands in for the one Claude Code defines: a block that calls it loses its labels, so the label tests fail. The strict xfail forcagoes.issue:<repo>issue with the same block, pointed at that repo, so that issue gets the same heredocs and label check. For a structural issue the agent loops overauto-filedalone, since policyengine-us and policyengine-uk usecalibrationfor calibration work.test.ymlnow installs zsh before the tests, and in CI a missing zsh fails those runs instead of skipping them.log_todescription,reform-pipeline.md,analyze-policy.md,docs/structured-output-and-chaining.mdandtests/pipeline/README.mdrepeat the new routes.scripts/build_manifest.pywrites report-logger's new description and overlap scores intodashboard/src/data/manifest.json.create-pr.mdandcreate-new-component.mdpass bodies through the same"$(cat <<'EOF' …)"form, andaudit-seo.mdpasses--label "seo,audit".structural-implementer.md,implement-structural.md,reform-pipeline.md's/implement-structuralline,calibration-diagnostics.md,parameter-locator.mdanddocs/structured-output-and-chaining.md'suv pip installline still fillpolicyengine-{country}, which givespolicyengine-cafor Canada. This PR leaves them for follow-ups.Evidence
--labelnames inLabelsToIDs, which compares them withstrings.EqualFoldand returns'<name>' not foundfor a missing one, andAddMetadataToIssueParamswraps that error ascould not add labelparams.go:106-109,queries_repo.go:809-823gh issue createreturns on that error before it callsapi.IssueCreatecreate.go:451-474--labelas a pflag string slice and splits each value at commascreate.go:186, pflag v1.0.10string_slice.go:22-29gh label listfetches 30 labels unless--limitsays otherwise, andpolicyengine-ushas 113label/list.go:74;gh label list --repo PolicyEngine/policyengine-us --limit 1000, 2026-11-08calibrationand notauto-filedGET /repos/PolicyEngine/<repo>/labels, 2026-11-08 and 2026-11-11calibrationandauto-filed,strings.EqualFoldmatches nothing beyond its ASCII upper and lower case, so a lower-case comparison of ASCII names agrees with ghkandsmatch more, U+212A and U+017F)gh issue create --body-file -reads the body from standard input, and gh uploads files only for--attachcreate.go:137-142,file_input.go:9-13,create.go:299-301/bin/bash3.2.57 stops onx="$(cat <<'EOF'with a body lineCBO's score(unexpected EOF while looking for matching), zsh 5.9 prints it, and bash 3.2 runs the new formPolicyEngine/policyengine-ca-data,policyengine-canada-dataandpolicyengine-careturn 404, andpolicyengine-canadaexistsukandusas its only countriesmanifest.json:9-16CountryTemplateDataset, holds three people in two householdscountry_template_dataset.pymicrosim-runner.md:310Invariants
test_country_routing.pychecks these for any dataset string, any set of repo labels, and any title and body that Hypothesis generates:Noneor onePolicyEngine/<repo>name;INVESTIGATEandstructuralverdicts open an issue, andINVESTIGATEopens one only forusanduk;INVESTIGATErouting ignore the dataset;INVESTIGATErouting lands in microcosm or policyengine-uk-data, and reads only the last path segment left after it cuts at the last@;ca;gh label listfails, the block still files the issue, without labels;us,ukandca, the block files nothing and names the country on stderr;Each of these edits to the block makes the tests fail:
--label "calibration,auto-filed";caroute;ascii_downcase, or grep's-x;"${LABEL_ARGS[*]}";--limit 1000, thefrs_*pattern or the@revisionstrip;gh label listfails;$ISSUE_TITLEunquoted, or droppingread's-rorIFS=;"$(cat <<'EOF' …)"again;<<-, which strips leading tabs;set -ebefore the block;grepin place ofcommand grep.Adding grep's
-ipasses, since jq has lowered the names and the edit changes nothing.Tests
uv run pytest --ignore=tests/test_skill_examples.pypasses all 415 tests in CI, with none skipped now that CI installs zsh. On main the same command passes 296 and xfails thecacase.scripts/build_manifest.py --checkpasses on the rebuilt manifest, andscripts/build_claude_wrapper.pycopiesreport-logger.mdinto the wrapper byte for byte.Before merge
🤖 Generated with Claude Code