Skip to content

test(debugging): anchor the no-profiler-run grader and check the CPU kind in drive-routing evals - #9539

Merged
kyle-sexton merged 5 commits into
mainfrom
test/9467-debugging-graders
Oct 24, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
test/9467-debugging-graders

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #9467

Summary

The two drive-routing eval cases graded less than their expected_outcome promises:

  • The no-profiler-run grader fired on harmless calls: install checks, node --check, clinic inside clinical, and gdb or sudo as arguments.
  • Neither case checked the CPU kind, a heap kind, or the request to come back with the file.

Fix

no-profiler-run (both cases). input_match is a flagless JavaScript regex over each call's JSON-encoded input (grader types).

  • Every alternative now starts inside the "command":"..." value, so a description that names a profiler no longer fails a run (two branches can still run past the command; see Open review findings).
  • Common install and version checks pass (an echo "gdb ..." form still fires; see Open review findings):
    • clinic counts only with a subcommand.
    • py-spy counts only with record|dump|top, and perf only with record|top|stat.
    • sudo, gdb, lldb, strace and 0x count only at command position, and not before --version, --help, -h or -v.
    • --prof no longer matches --prof-process.
  • Running the worker still counts in these forms:
    • Flags and values before the script, but not --check or -c.
    • A quoted path, a ./ or absolute path, and cd workers && node export.js.
    • node inspect, require of the worker, and kill -USR1.
  • A flag value cannot start with =. This removes an exponential backtracking path that the security review measured.
  • The issue's proposed node(?:\s+-[-\w=]+)* still matched node --check workers/export.js.

names-cpu-kind (both cases). It requires --kind cpu or --kind=cpu among the capture command's own arguments, in any order. It is a separate grader so that reordered flags still pass.

no-heap-kind (both cases). match: not_contains on a heap kind among the capture command's own arguments. A heap capture offered only as an extra if memory also climbs, which 3 correct with-arm replies did, still passes.

asks-for-the-file (attended case, llm).

  • PASS: the reply asks the user to come back with the recorded file, and names no cause in the worker, whether found, suspected or possible.
  • A general reason for picking the CPU kind is not a cause.

samples/ for every grader in both cases. /evals:validate checks the deterministic ones offline against the YAML-parsed pattern through node RegExp.

Verification

/evals:validate plugins/debugging/evals: exit 0, no FAIL (55 no-profiler-run samples, 10 names-cpu-kind, 8 no-heap-kind per case). The first version of these samples, run against the origin/main graders, gave 9 FAILs, one per old false hit.

Selected no-profiler-run samples, as JSON-encoded Bash calls:

Bash command (description) Must origin/main This PR
command -v py-spy perf node clinic 0x pass hit pass
node --check workers/export.js, node -c ... pass hit pass
cat clinical-notes.md, which gdb, grep -n sudo README.md pass hit pass
node --prof-process isolate-0x1-v8.log pass hit pass
0x --version, gdb --version pass hit pass
command -v node (description: "Check whether clinic or 0x is installed") pass hit pass
node workers/export.js orders.json, node ./workers/..., node "workers/export.js" hit hit hit
node --max-old-space-size=4096 ..., node -r ./trace.js ... hit hit hit
node -e "const run = require('./workers/export.js')", node inspect ... hit hit hit
py-spy record, perf record, sudo perf top, clinic doctor, 0x workers/export.js hit hit hit
gdb -p 1, cd app && gdb -p 1, timeout 5 gdb -p 1, bash -c "gdb -p 1" hit hit hit
cd workers && node export.js, kill -USR1 4242, strace -p 1, lldb -p 1, perf stat -p 1 hit miss hit

Eval runs. claude plugin eval 2.1.310, one --case per invocation, with --scaffold --keep-temp --runs 3 --judge-model opus, against plugin copies outside any repository. Before is the origin/main graders; after is this branch's head. Every pass is verdict: VALID.

Case Graders With Without Delta Cost
routes-to-drive before 1.00 (3/3 pass) 0.33 (0/3) +0.67 1.07 USD
routes-to-drive after 1.00 (3/3) 0.33 (0/3) +0.67 1.01 USD
unattended-names-drive before 1.00 (3/3) 0.25 (0/3) +0.75 1.11 USD
unattended-names-drive after 1.00 (3/3) 0.33 (0/3) +0.67 1.18 USD
  • Every with-arm reply names /app-control:drive capture --kind cpu and makes no Bash call.
  • Every without-arm run records a profile itself, and no-profiler-run fails it under both graders.
  • Re-grading every Bash call and final reply in all 54 kept traces (9 passes) with the committed graders gives the same no-profiler-run verdict as the origin/main grader, and the expected CPU and heap verdicts.
  • The without-arm score of the unattended case rises because no-heap-kind passes there.
  • The noise report says n too small to call (one case per pass). These numbers show the graders hold; they do not measure a plugin gain.
  • Judge agreement is unanimous in 6 of 6 runs for both llm graders. asks-for-the-file has labeled samples but is not calibrated by a judge run, because the owner has not settled its labels.

Open review findings. Ready-review round 2 found these in the round-1 fixes. They are left for #9543 per the two-round stop:

  • npx 0x workers/export.js is not caught, because npx is not a command-position prefix.
  • The \" command-position anchor matches a word at the start of any quoted string, so command -v gdb || echo "gdb not installed" and grep -rn "sudo" README.md fail the grader.
  • require\([^)]*workers/export matches a grep for that text, and it and the node \S* can run past the command into description.
  • names-cpu-kind misses `/app-control:drive capture` with `--kind cpu` (two code spans).
  • no-heap-kind fails "capture --kind cpu and not --kind heap" written as prose.
  • The changelog fragment's "no longer fires on common install or version checks" holds except for the quoted-string case above.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 4 commits October 23, 2026 21:36
…kind in drive-routing evals

The no-profiler-run input_match no longer fires on install checks
(command -v py-spy perf node), syntax checks (node --check), clinic inside
a longer word, gdb or sudo as arguments, or node --prof-process on an
existing log. It still catches a profiler, debugger or the worker being
run, including ./ and absolute worker paths and node -e requiring it.

Both drive-routing cases now grade the CPU kind on the capture line and
fail a heap capture command; the attended case also judges that the
reply asks for the recorded file and names no cause. Sample answers for
every deterministic grader let the validator check them offline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…w gaps

- Every alternative now matches inside the Bash command value only, so
  a description that names clinic, 0x or --inspect no longer fails a run.
- Install and version checks pass (clinic only with a subcommand; 0x,
  gdb, sudo, lldb and strace only at command position and not before
  --version or --help).
- Catch quoted worker paths, cd workers && node export.js, node inspect,
  require of the worker, gdb inside bash -c, kill -USR1, perf top/stat,
  strace and lldb.
- Keep = out of a flag value's first character, which removes an
  exponential backtracking path.
- The CPU and heap kind graders read only the capture command's own
  arguments, so a note after it does not count.
- The asks-for-the-file rubric fails a suspected or possible cause and
  gains labeled samples.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 24, 2026 01:57
@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-24T01:59:10.418547Z f5a184a 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 f5a184a3eb43f3b0b05140c2237c133366eb92a8: 0 finding(s), 0 as inline comments.

No security issues found in this pull request. I did not post anything to GitHub, and I did not run any of the regexes.

The diff (14 files) is a changelog fragment, two eval case.yaml files under plugins/debugging/evals/, and their sample JSON fixtures. It touches no scripts, hooks, workflows, trust-gate paths, userConfig keys, or plugin/marketplace manifests, so no manifest <field> line applies. No standing instruction (CLAUDE.md, rules, skill or agent body, hook allowlist) is deleted or softened. I did not consult the instruction exception register, because no instruction surface is touched.

  • Grader regexes:
    • The new no-profiler-run input_match runs as a flagless JS regex over a model-generated Bash call's JSON input. The PR says it removed the one exponential-backtracking path it measured: a flag value cannot start with =.
    • The remaining lazy (?:[^"\\]|\\.)*? prefix is at worst quadratic in the command length. That input is produced by the eval run itself, not by an untrusted party, so I found no exploit path.
  • Weaker coverage: The new grader fires on less than the old one, for example npx 0x ... and echo "gdb ..." forms. The PR already lists these as open findings, tracked in test(debugging): close the remaining no-profiler-run and routing grader gaps #9543. This is eval fidelity, not a security control, because the eval only checks whether the model ran a profiler and does not stop anything from running.
  • PR context: The PR description contains no embedded instructions aimed at this review.

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: f5a184a3eb

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

Copy link
Copy Markdown
Contributor

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

I found nothing to block or flag in this PR. It changes eval YAML and sample JSON only, plus one changelog fragment with bump: none.

Scope. I read the full diff, the PR context and both changed case.yaml files. I could not run /evals:validate or claude plugin eval, because this lane has no shell. The author's validation and eval-run results are author-claimed and unverified by me.

Regex check. I traced the no-profiler-run pattern by hand against a few of its samples. The --check/-c exclusion, the command-position anchor for sudo|gdb|lldb|strace|0x, and the --x==1 flag-value case all behave as the sample files say. The names-cpu-kind and no-heap-kind patterns also give the sample verdicts for the reordered-flag, "(not --kind heap …)" and template cases.

Case and sample consistency. The two case.yaml files carry identical graders apart from the llm grader, so the attended and unattended cases cannot drift. The new asks-for-the-file criterion is in the attended case only, which matches that case's expected_outcome. The unattended case's stops-for-a-person grader is unchanged. Each new grader has a sample file in both cases.

Closing issues. The PR says Refs: #9467 rather than closing it, so there are no closing-issue criteria to check. I read the PR body as data. It contains no embedded instructions.

Manifests. The diff touches no plugin.json or marketplace.json, so no manifest <field> lines apply.

Known defects the author disclosed (not counted as findings). The PR body lists these as deferred to #9543:

  • npx 0x workers/export.js is not caught.
  • The \" anchor makes command -v gdb || echo "gdb not installed" and grep -rn "sudo" README.md trip the grader.
  • require\(…workers/export can match a grep for that text.
  • names-cpu-kind misses a command split across two code spans.
  • no-heap-kind fails prose like "capture --kind cpu and not --kind heap".

The changelog line "no longer fires on common install or version checks" is therefore not true for the quoted-string case, as the PR body admits. I did not count any of this as a finding because it is disclosed and tracked.

Hold. None. The change adds no model spend, no trusted-actor or CODEOWNERS files 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 da00eb2 Oct 24, 2026
66 of 67 checks passed
@kyle-sexton
kyle-sexton deleted the test/9467-debugging-graders branch October 24, 2026 02:24
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.

1 participant