Skip to content

fix(testing): pass read-the-parser when a loop prints the parser body - #16238

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/16012-test-plan-graders
Nov 15, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/16012-test-plan-graders

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Refs: #16012

RUN RECORD (planned before the launch, no reruns): 8 Sonnet runs of pl-branch-test-plan with the plugin on head bccbe4d4141f31056e351364d91d07b9ee6eb141 (--ablation none, judge claude-opus-5-5, the same launch flags as the host check). 7 of 8 runs score 1.00, against the issue's target of 6 of 8 and 4 of 8 on main.

Grader Main 4f2dcaaff35e This head
read-the-parser 6 of 8 8 of 8
meets-legacy-plan-1 6 of 8 8 of 8
fuzz-and-contract-rows 7 of 8 7 of 8
The other four graders 8 of 8 each 8 of 8 each
  • Result file: VALID (run-validity.py --runs 8 --scaffolded, warnings: skill fired, judge votes). Not partial, no run errored, no denied tool call. Trace greps over the 8 traces for is not a valid shim, Shell command permission check failed for pattern and command not found: 0 hits. Cost 2.32 USD.
  • The one run under 1.00 (0.857) is a reply miss: it plans canned responses for WeatherClient and never names testing:test-value, which fuzz-and-contract-rows requires (one split judge vote, PASS FAIL FAIL).
  • meets-legacy-plan-1 moved from 6 to 8 of 8 with no change to it or to the skill, so that part of the gain is run-to-run variation, not this change. read-the-parser is the grader this change corrects.
  • A first launch failed to start before any run (the run directory did not exist yet: 8 runs at 0 turns and 0 USD, kept as testing-enoent-not-started.json). The same line was launched once the directory existed; no scored run was repeated.

Summary

The host check after the first change for this issue scored the pl-branch-test-plan case (testing plugin) below target. That check ran 8 Sonnet runs on main at 4f2dcaaff35e8f9fccc6a9f4d82a5830ab17a5c5, and 4 of 8 scored 1.00 (scores 1, 0.857, 0.857, 1, 0.714, 1, 0.857, 1). Graders that missed:

  • read-the-parser: 6 of 8.
  • fuzz-and-contract-rows: 7 of 8.
  • meets-legacy-plan-1: 6 of 8, one of the misses a split vote (PASS FAIL FAIL).

read-the-parser misjudged runs 1 and 4. Both read src/duration.py with a loop, for f in duration.py ...; do ...; cat $f; done. The pattern needs cat, head or git show to come before duration.py in the command text, so it missed these even though the tool result holds the parser's body. This change corrects that grader only. On the recorded runs it moves run 1 to 1.00, giving 5 of 8. Run 4 still misses meets-legacy-plan-1.

Fix

  • graders/read-the-parser.md gets one new alternative. It passes when a tool result holds consecutive lines of the parser's body: the _UNIT = {...} line, the two blank lines after it, and def parse_duration(text): (scaffold.sh lines 55 to 58). An optional + before each line lets a diff of the file match too.
    • The match needs those lines together. A grep that prints only the _UNIT line, a traceback that quotes it, or grep -rn "=" src does not match.
    • Old: '"name":"Read","input":\{"file_path":"[^"]*duration\.py"|\+\+\+ b/src/duration\.py\\n@@ |"name":"Bash","input":\{"command":"(?:[^"\\]|\\.)*\b(?:cat|head|git show)\b(?:[^"\\|]|\\.)*duration\.py'
    • New: the old pattern plus |"type":"tool_result","content":"(?:[^"\\]|\\.)*_UNIT = \{\\"h\\": 3600, \\"m\\": 60, \\"s\\": 1\}\\n\+?\\n\+?\\n\+?def parse_duration\(text\):
  • samples/read-the-parser.json totals: 7 pass, 13 fail.
    • New pass samples: a loop that runs cat on the file, and a git diff --no-prefix of the file.
    • New fail samples: a loop that only counts lines, a reply that names _UNIT with no tool output, a --stat of the file, a Grep that lists only the file name, a content-mode Grep that prints only the _UNIT line, a traceback that quotes that line, and grep -rn "=" src.
  • .changes/testing/fix-16012-test-plan-graders-18f49962.md: a bump: none fragment. This is an eval-only change.

Known misses on main's recorded runs

The run record above meets the target. Three misses in the host check on main were not grader defects, and the issue's scope does not reach them (it puts the plan skill's text and template out of scope). They can recur, since nothing here changes them:

  • Run 2 planned canned responses for WeatherClient without naming testing:test-value. The plan skill tells the reply to name it (plugins/testing/skills/plan/SKILL.md lines 68 and 145 to 146). fuzz-and-contract-rows is correct to fail it, and it is unchanged here.
  • Runs 4 and 6 skipped /testing:run-e2e because the scaffold has a route table and no served app, so meets-legacy-plan-1 failed them (run 4 on all three judge votes, run 6 on a split vote, PASS FAIL FAIL).

The issue also lists the case's other graders as out of scope. read-the-parser changes here on the host-check record posted on the issue, which asks for the replies under 1.00 to be read against the three failing graders "to tell a grader miss from a plan that leaves the step out"; this grader's two misses are grader misses.

Verification

Each check below ran from the worktree on this head.

  • python3 -I plugins/evals/skills/validate/scripts/validate-cases.py plugins/testing/evals: exit 0, 0 FAIL. This case's only line is WARN pl-branch-test-plan/prompt.md: allowed_tools lists Bash ..., which is already on main.
    • With the old pattern, the loop-then-cat pass sample failed under both engines.
    • With the first version of the new alternative, which matched on the _UNIT line alone, the three single-line fail samples passed under both engines. The final pattern rejects them.
  • Offline replay of read-the-parser over the 8 recorded traces from the host check, using JavaScript RegExp: the old pattern passes 6 of 8 and the new pattern passes 8 of 8. Runs 1 and 4 pass only through the new alternative.
  • bash scripts/check-affected.sh --no-fetch, bash scripts/check-changelog-fragments.sh --check-required origin/main and git diff --check origin/main...HEAD all pass.

Before and after measurement:

  • Before is the host check above: 4 of 8 runs at 1.00.
  • After is the run record at the top: 7 of 8 runs at 1.00 on this head.

Related

session: GitHub Support

🤖 Generated with Claude Code

…lans

read-the-parser now also passes when the parser's body appears in a tool
result, which covers a loop that names duration.py before cat. Its samples
gain that pass shape and four negatives.

fuzz-and-contract-rows asks for canned WeatherClient responses whose
expected values come from a source independent of the client code, rather
than for the plan to name testing:test-value. Its new samples hold two
trimmed host-check replies as passes and two hand-written fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 14, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T21:29:48.909940Z 2e65390 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed bccbe4d4141f31056e351364d91d07b9ee6eb141: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #16238 (incremental, since 2e65390)

No security issues found.

This push changes only eval data in the testing plugin's pl-branch-test-plan case and a changelog fragment's wording:

  • graders/read-the-parser.md: The tool_result alternative in the regex now has to match more text. Before, it stopped at _UNIT = {"h": 3600. Now it also has to match the rest of the _UNIT line, up to three \n sequences (each optionally followed by a diff +), and def parse_duration(text):. The new tail is a literal match with a few optional characters. The leading (?:[^"\\]|\\.)* is unchanged, and its two alternatives can never match the same text, so a long trace cannot cause catastrophic backtracking (ReDoS). The pattern only scores eval traces and gates no merge, token or trust decision.
  • samples/read-the-parser.json: Static test data. One existing pass sample gets a longer tool result, and the push adds one pass sample and three fail samples. None of them contain secrets or credentials.
  • .changes/testing/fix-16012-test-plan-graders-18f49962.md: Prose-only fragment edit (bump: none unchanged).

No changed file matches a trusted-path glob. The push touches no plugin manifest, workflow, trust control, merge hold, kill switch or standing instruction. The PR description and the issue comment contain no directives aimed at this lane.

This review was blocking only: this lane already reviewed an earlier head, so it would have reported only CRITICAL and IMPORTANT findings, and it found none. All 3 files in the incremental scope were read in full.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed bccbe4d4141f31056e351364d91d07b9ee6eb141: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, 2e65390 → bccbe4d): PR #16238

No blocking findings. This lane already reviewed an earlier head, so this pass reported only blocking findings. I read every hunk of all 3 files in scope.

What changed since the last review

  • The fuzz-and-contract-rows change is gone from the pull request. Its grader and samples are no longer in the diff, and the changelog fragment now says "one grader and its samples". The changed-file count dropped from 5 to 3.
  • graders/read-the-parser.md: the tool_result alternative now needs the parser's body, not just the _UNIT line. After _UNIT = {"h": 3600, "m": 60, "s": 1} it requires three newlines, each optionally followed by a diff +, and then def parse_duration(text):.
    • I checked this against the layout in scaffold.sh:55-58: the _UNIT line, two blank lines, then def. That gives }\n\n\ndef for a plain read and }\n+\n+\n+def for a git diff of a new file. Both match the pattern.
    • This closes the gap the last review noted and did not flag: a content-mode grep that prints only the _UNIT line used to pass, and no longer does.
  • samples/read-the-parser.json: the samples cover the new pattern.
    • Pass samples: the loop-then-cat sample now includes the def line, and a new git diff --no-prefix sample covers the +-prefixed form. The --no-prefix header is not matched by the +++ b/src/duration.py alternative, so this sample does test the new branch.
    • Fail samples: a content-mode Grep of the _UNIT line, a traceback quoting it, and grep -rn of every assignment. In each, something other than \n\n\ndef follows the _UNIT line, so none of them match.

Closing issue #16012: its criteria are "/evals:validate passes on the case" and "ci-status is green". I did not run either check, so both rest only on the author's word for this head. The PR body's verification section describes the earlier two-grader version, so it does not confirm that this head passes validation.

No plugin manifest changes. No embedded instructions in the PR context.

Spend (not a hold): the planned 8 Sonnet eval runs use prepaid API credit only.

Verifier dropped 0 of 0 candidates.

…nd-contract-rows

The plan skill tells a reply to name testing:test-value for a public API's
canned responses, so fuzz-and-contract-rows goes back to main's criteria
and its samples file is removed.

read-the-parser's tool-result alternative now needs the _UNIT line, the
blank lines after it and def parse_duration(text): together, with an
optional diff + prefix. A grep or traceback that shows the _UNIT line
alone no longer passes. Its samples gain a diff pass and three fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton kyle-sexton changed the title fix(testing): stop two pl-branch-test-plan graders failing correct plans fix(testing): pass read-the-parser when a loop prints the parser body Nov 14, 2026
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 14, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 2b03f44 Nov 15, 2026
91 of 94 checks passed
@kyle-sexton
kyle-sexton deleted the fix/16012-test-plan-graders branch November 15, 2026 00:07
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant