Skip to content

test(debugging): close the remaining no-profiler-run and routing grader gaps - #9655

Merged
kyle-sexton merged 3 commits into
mainfrom
test/9543-debugging-grader-gaps
Oct 24, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
test/9543-debugging-grader-gaps

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Closes #9543

Summary

The drive-routing eval cases (capture-request-routes-to-drive, capture-request-unattended-names-drive) still had the grader gaps the ready review of #9539 found:

  • no-profiler-run missed 0x run through npx.
  • It fired on the first word of any quoted string, and on a grep for require text.
  • Parts of it could match past the command into description.
  • The CPU and heap kind graders misread a command and kind written as two code spans, and a heap kind negated in prose.

The asks-for-the-file judge was also uncalibrated. This PR fixes all of these, plus what two rounds of ready review found in the fixes.

Fix

Both case files carry identical grader blocks, and their samples/ files are byte-identical. input_match is a flagless JavaScript regex over each call's JSON-encoded input (grader types).

no-profiler-run

  • Command position (B1). A quoted string no longer counts as command position. It now takes one of:

    • the start of the command;
    • a separator (;, &, |, () or a JSON newline, followed by optional spaces or tabs;
    • a chain of wrappers that take a quoted command: a shell's -c (bash, zsh, dash, ksh, sh, with flags before -c and an optional --), eval, watch, ssh <host>, su … -c and script … -c.

    A tool name may be quoted at command position ("gdb" -p 1), and the --version/--help guard still applies after the closing quote.

  • Runners (A1). npx takes its own options, with or without values (-y, --package=0x). pnpm dlx and yarn dlx take options before and after dlx.

  • Require (B2). The require branch needs node earlier in the command, a quote after require( (optionally inside one nested call such as require.resolve(), and a path that cannot cross a quote, backslash or paren. A second branch catches require text piped into a bare node or node -; || node and | node -e … do not count.

  • Staying inside the command (B2). Every \S in the node branch and in timeout <value> is now an escape-aware token, so no part of a match can leave the command value. The lazy spans are bounded ({0,4000}?, {0,300}?), and the timeout and npx value classes exclude separators. Together these remove quadratic paths the reviews measured.

  • Newlines. Tool names match right after a JSON \n or \t escape, through (?<=(?<!\\)\\[nt]), so a shell-level \n inside a quoted string does not count.

  • Spelling. The shells are spelled out because typos rejects (?:ba|z|da)?sh.

names-cpu-kind and no-heap-kind share one argument pattern and differ only in the kind word:

/app-control:drive\s+capture`?[,:;]?(?:[ \t]+(?!--kind)[^\s`()]+)*?[ \t]+`?--kind(?:=|[ \t]+)<kind>\b
  • Code spans (B3). An optional backtick after capture and before --kind, and punctuation after the closing backtick, let Run `/app-control:drive capture` with `--kind cpu` pass. A heap kind written that way now fails no-heap-kind.
  • First kind (B4). The argument loop stops at the first --kind:
    • "capture --kind cpu and not --kind heap" now passes no-heap-kind.
    • "capture --kind heap, not --kind cpu" now fails names-cpu-kind; on origin/main it passed.

Samples. Each case gains 52 samples: 45 for no-profiler-run, 3 for names-cpu-kind and 4 for no-heap-kind. Each fixed gap has a sample that fails under the grader it fixes and passes under this branch. A few samples are guards that pass both before and after: npx 0x --version, yarn dlx 0x … and script -qc "gdb -p 1" /dev/null.

asks-for-the-file labels. Each of its 5 samples follows from one explicit clause of the criteria:

  • Pass 1 asks for the file and names no cause.
  • Pass 2 adds a general reason for the CPU kind, which the criteria exempt.
  • Fail 1 names a suspected cause.
  • Fail 2 does not ask for the file.
  • Fail 3 names a cause and a fix.

I checked these labels against the rubric; the owner has not reviewed them. That review is item 6 of #9657.

Verification

/evals:validate plugins/debugging/evals: exit 0 with no FAIL. Its node check covers only the regex graders, so a node harness also graded every no-profiler-run sample through RegExp. Each case now has 100 no-profiler-run samples, 13 names-cpu-kind and 12 no-heap-kind, and every one sorts to its label. The input_match also compiles under Python re.

Selected samples, as JSON-encoded Bash calls or replies. "First pass" is 9cf3534, before review; "Round 1" is 944e3e2, after the first review round; "Final" is this head.

Input Must origin/main First pass Round 1 Final
command -v gdb || echo "gdb not installed", which 0x || echo "0x missing", grep -rn "sudo" README.md pass hit pass pass pass
grep -n "require(./workers/export" -r src, grep -rn "require('./workers/export" src pass hit pass pass pass
node -p 1 (description: "Load workers/export.js"), timeout 5 (description: "Bound gdb by time") pass hit pass pass pass
rg "require('./workers/export')" src || node --version, grep -n eval "sudo.txt", "gdb" --version pass hit pass hit pass
npx 0x workers/export.js, npx -y 0x …, pnpm dlx 0x …, bash -c 'gdb -p 1' hit miss hit hit hit
ssh prod "gdb -p 1234", "gdb" -p 1, bash -l -c "gdb -p 1", printf "require('./workers/export')" | node, cd /w\nnode -e "require('./workers/export')" hit hit miss hit hit
npx --package=0x 0x …, pnpm --silent dlx 0x …, cd /w\nperf record -g -p 1 hit miss miss hit hit
watch -n 1 "strace -c -p 1", bash --login -c "gdb -p 1" hit hit miss miss hit
cd /w\n\tgdb -p 1 hit miss miss miss hit
a 640-character node -e one-liner that ends in require('./workers/export').run() hit hit hit miss hit
Run `/app-control:drive capture` with `--kind cpu`, then come back with the file. (names-cpu-kind) pass fail pass pass pass
Run /app-control:drive capture --kind heap, not --kind cpu. (names-cpu-kind) fail pass fail fail fail
Run /app-control:drive capture --kind cpu and not --kind heap. (no-heap-kind) pass fail pass pass pass

Backtracking. Node 24.21.0 timed every construct in the final patterns at 30 and 3000 repetitions:

  • flags and values, quoted paths, \\ escapes;
  • ssh, su, bash -l -x, watch -n 1, npx --a=;, pnpm -a, timeout;
  • require(', | node, \n node, \n\t gdb;
  • backticks and --kind tokens.

The worst time at 30 repetitions was 0.77 ms, against a 50 ms bar. At 3000 repetitions every construct stays under 35 ms except node -a (24 KB, 181 ms). That construct sits in the node-flags loop, which this PR did not change; #9657 item 4 tracks it. As a control, the pre-#9539 node construct took 80 s on 26 x --x= = =.

Judge calibration. calibrate-judge.py ran on asks-for-the-file with an opus judge, 3 runs per sample. Agreement was 15 of 15 runs (100%) over 5 samples, every run reproduced against its trace, at 0.58 USD.

Eval runs.

  • Setup. claude plugin eval 2.1.310, one --case per invocation, with --scaffold --keep-temp --runs 3 --judge-model opus --allow-tools Bash.
  • Plugin copies. Each pass ran on a git archive export outside any repository:
    • "before": origin/main (b22a875);
    • "first pass": 9cf3534, before review. It ran on a copy taken before the shell list was respelled (?:bash|zsh|dash|sh), which matches the same strings;
    • "final": fa5c867, this head.
  • Validity. Every pass is verdict: VALID; its only warning is skill fired.
Case Graders With Without Delta Cost
routes-to-drive before 0.94 (2/3 pass) 0.33 (0/3) +0.61 1.05 USD
routes-to-drive first pass 1.00 (3/3) 0.33 (0/3) +0.67 1.09 USD
routes-to-drive final 1.00 (3/3) 0.39 (0/3) +0.61 1.13 USD
unattended-names-drive before 1.00 (3/3) 0.33 (0/3) +0.67 1.10 USD
unattended-names-drive first pass 1.00 (3/3) 0.33 (0/3) +0.67 1.13 USD
unattended-names-drive final 1.00 (3/3) 0.33 (0/3) +0.67 1.08 USD
  • Run-to-run variation. Both score differences between passes come from the asks-for-the-file judge on differing agent replies, not from these graders:
    • The failed "before" with-arm run named possible causes, which the criteria fail; all 3 votes were FAIL.
    • In one "final" without-arm run, the agent recorded its own CPU profile. The judge passed that reply, although its PASS clause requires the recording to be left to the user. The run still fails on no-profiler-run. test(debugging): close the drive-routing grader gaps left by the ready reviews #9657 item 7 tracks the judge miss.
  • Re-grade. I re-graded all 36 kept runs, with 105 Bash calls, using both the origin/main and the final graders for no-profiler-run, names-cpu-kind and no-heap-kind. No verdict flipped, and both match the recorded verdicts.
  • Noise. The noise report says n too small to call (one case per pass). These numbers show the graders hold on real traffic; they do not measure a plugin gain.
  • Judge agreement. Unanimous in 6 of 6 runs for both llm graders in every pass.

Ready reviews. Two rounds of fresh-context code and security review ran locally, since review-venue reports no CI lane for either.

  • Round 1 found misses the first pass introduced: wrappers, a quoted tool name, nested and piped require. It also found a quadratic span and gaps in npx and dlx options. All are fixed in 944e3e2.
  • Round 2 found false hits from wrapper words outside command position, a too-loose pipe branch, the quoted --version guard, the literal-\n lookbehind, the 500-character bound, the npx value quadratic, and missing tab and long-flag forms. All are fixed in fa5c867.
  • Left for test(debugging): close the drive-routing grader gaps left by the ready reviews #9657: negations in the kind graders, older misses and false hits that origin/main shares, the node-flags loop timing, a single shared grader copy, the owner's review of the labels, and the judge miss above.

Other checks:

  • check-affected.sh --tests: 11 passed, 3 skipped.
  • check-changelog-fragments.sh --check and typos pass.

Related

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T14:11:59.011019Z fa5c867 Draft marked ready
ℹ️ 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

Copy link
Copy Markdown
Contributor

claude-security-review reviewed fa5c86718388663681b323e77fa60aeb579787cc: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

I read the full diff (9 files) and the PR context. Every changed file is an eval fixture: the case.yaml grader blocks and samples/*.json for the two drive-routing cases, plus a bump: none changelog fragment.

  • Runtime surface: none of it ships as plugin code. The regexes only grade recorded agent tool calls and replies inside the eval harness. They gate nothing at runtime and handle no secrets, tokens or credentials.
  • Manifests: no plugin.json or marketplace.json changed, so there are no manifest <field> lines.
  • Trust-gate paths: none are touched (trusted-actors, check-trusted-trigger, CODEOWNERS, .gitmodules).
  • Instruction surfaces: no standing instruction, rule, hook block list or allowlist is deleted or softened. The no-profiler-run grader got stricter, so it catches more profiler and debugger invocations, and the kind graders are narrower and more precise. I did not consult docs/conventions/instruction-exception-register/README.md, which is not needed here because nothing is removed.
  • Regex backtracking: the new patterns bound their lazy spans ({0,4000}?, {0,300}?) and use escape-aware tokens. The patterns run only over eval traffic, so there is no security-relevant denial of service. The PR reports timings for the final constructs.
  • Embedded instructions: the PR context contains no text aimed at the reviewer.
  • Sample strings: the gdb, sudo and ssh commands in the samples are inert JSON test data for the grader and never run.

critical-findings: 0

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa5c867183

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 2 inline finding(s) on fa5c86718388663681b323e77fa60aeb579787cc; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed fa5c86718388663681b323e77fa60aeb579787cc: 2 finding(s), 2 as inline comments.

Review of PR #9655, which changes the two drive-routing eval cases' no-profiler-run, names-cpu-kind and no-heap-kind graders and adds samples. I could not run anything in this lane (no shell). Everything below comes from reading the regexes against the diff, and nothing was executed. The PR's verification tables and eval runs are the author's claims and I have not confirmed them.

Findings

  • no-profiler-run: the require branch still fires on a grep for require text when node appears earlier in the command. Details are in the inline comment.
  • no-profiler-run: the wrappers ssh, watch and eval match only when the inner command is quoted, so unquoted forms still slip through. Details are in the inline comment.

Kind graders. I traced the new names-cpu-kind and no-heap-kind pattern against the added samples (two code spans, punctuation after the backtick, first --kind wins). The labels are consistent with it and I found no bug. The two case files carry identical grader blocks and samples, so one comment per finding covers both.

Closing issue #9543.

  • Items 1 to 5: each is addressed in both case files and has a reproducing sample.
  • Item 6 (settle the asks-for-the-file labels, then run judge calibration): the diff has no change to asks-for-the-file, so the diff cannot show it met. The PR says the labels were checked against the rubric but not reviewed by the owner, and defers that review to test(debugging): close the drive-routing grader gaps left by the ready reviews #9657. Treat item 6 as partially met and unverifiable from this diff.
  • Tests: every graded construct has a pass or fail sample, so none rests on an untested criterion.

Manifest. No plugin.json or marketplace.json change. The changelog fragment is bump: none, which fits an eval-only change.

Hold. None: no model or API spend change, no trust-gate paths touched, and no security finding.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 2ff0c0b Oct 24, 2026
101 checks passed
@kyle-sexton
kyle-sexton deleted the test/9543-debugging-grader-gaps branch October 24, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(debugging): close the remaining no-profiler-run and routing grader gaps

1 participant