Skip to content

fix(evals): grant converted cases the tools their skill needs - #11987

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/8635-converter-allowed-tools
Nov 1, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/8635-converter-allowed-tools

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #8635

Summary

convert-evals-json.py wrote allowed_tools: [Read, Glob, Grep, Skill] into every converted case. A skill that needs Bash could not run, and the validator did not flag it. The first slice-3 conversion showed this: a paid run of the converted rate-limit-guard suite was INVALID. Its setup skill has a pre-computed !`command -v node …` line, so without Bash the slash command failed to load and the run ended at 0 turns. The check skill could not run node --version. That run had 26 permission denials.

Fix

  • Converter: a case's allowed_tools is now the base list, plus Bash when the skill's SKILL.md has a !` pre-computed line or names Bash as the tool to run, plus the tools in the skill's own allowed-tools frontmatter. Bash(git *) becomes Bash. The order is stable and duplicates are dropped.
  • Validator: a new WARN fires when a case's skill (named by its leading /<plugin>:<skill> or by a tag) has a pre-computed line and the case's allowed_tools lacks Bash: "without it the slash command fails to load and the run ends at 0 turns". The WARN paragraph in /evals:validate names it.
  • The pre-computed-line constant carries its upstream pointer (skills, inject dynamic context), its as-of date and its recheck trigger.
  • An evals changelog fragment.

Verification

  • convert-evals-json.test.sh: 21 tests OK. validate-cases.test.sh: 80 tests OK. I re-ran both on this branch. scripts/run-ruff.sh check plugins/evals/skills: clean.
  • 5 new positive tests fail on the old scripts: 3 for the converter, 2 for the validator.
  • End to end: I reconverted rate-limit-guard with this converter. All 5 cases list Bash, and a --runs 1 --allow-tools Bash smoke is VALID, with-arm mean 0.88 against 0.60 without, delta +0.28 (95% interval +0.12 to +0.44). Removing Bash from the two setup cases makes the new WARN fire on both.
  • Left out: the rate-limit-guard conversion itself. It ships in its own PR once its confirming 3-run check finishes.

Related

Remaining

  • One conversion PR per group of plugins, under the owner's (c2) decision: about 3,100 cases across 85 plugins. Four plugins still refuse to convert: session-flow, source-control, user-interface and verification.

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits November 1, 2026 09:56
Refs: #8635

convert-evals-json.py wrote [Read, Glob, Grep, Skill] into every case, so
a skill with a pre-computed context line could not load and the run ended
at 0 turns. Cases now add Bash for such a line or a Bash instruction in
the body, plus the skill's allowed-tools frontmatter. validate-cases.py
warns when a case names such a skill and its allowed_tools lacks Bash.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs: #8635

Give PRECOMPUTED in both scripts a pointer, as-of date and recheck
trigger, like the validator's other upstream constants, and count a
Bash(...) grant as Bash in the validator's new WARN.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 1, 2026 16:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 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-11-01T16:28:26.229819Z ac59188 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

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: incremental (bfe6832 → b734be4)

Scope: I read every hunk of the two in-scope files in .claude-lane/incremental.diff:

  • plugins/evals/skills/plugin-eval/scripts/convert-evals-json.py: one change, to the WRAP regex. A hard-wrapped line was previously joined to the next line after the leading whitespace was consumed. The lookahead now tests the next line's content after its indentation. As a result, an indented list item or a whitespace-only line is no longer folded into the previous line.
  • plugins/evals/skills/plugin-eval/scripts/test_convert_evals_json.py: one new test covering the nested-item and whitespace-blank-line cases.

Neither file matches a trusted-path glob.

Assessment: I found no security issues.

  • The regex only affects how the offline eval converter detects a negated "use Bash" instruction in a skill's own SKILL.md. The fix means a negation on one line no longer suppresses a Bash mention on a separate indented or blank-separated line.
  • Its output is the allowed_tools list in a generated eval case. That list is test-harness configuration for eval runs, not a lane token or an installed-plugin permission. No untrusted input reaches it in a credentialed context.
  • The new pattern has no nested quantifiers that could backtrack catastrophically.
  • No trust control, merge hold, plugin manifest or standing instruction is touched.

Spend: none beyond normal eval runs. This incremental change does not alter eval run counts or billing.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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

Incremental review (bfe6832 → b734be4)

This round reviews only the WRAP regex change in convert-evals-json.py and the test added for it. No findings.

What the regex change does. The old pattern was [ \t]*\n[ \t]*(?![\n\-*#>|]|\d+\.). Its lookahead came after the indentation run, so on an indented line the engine could backtrack: it gave up one space of indentation, the lookahead then saw a space instead of a block start, and the line was joined to the one before it. Two cases broke this way:

  • Nested list items: - Do not edit the config\n - run the check through Bash was folded into the negated clause above it, so Bash was not granted.
  • Whitespace-only blank lines: file\n \nRun ... was folded the same way.

The new pattern, [ \t]*\n(?![ \t]*(?:[\n\-*#>|]|\d+\.))[ \t]*, puts the indentation inside the lookahead. Backtracking can no longer get around the block-start test. I traced both cases by hand:

  • nested: the newline is not joined, and the second line matches through Bash in a clause with no negation. Bash is granted.
  • spaced: the first newline is not joined, because the lookahead sees the second newline. The second newline ( \nRun) is joined. The split on \n in body_needs_bash (convert-evals-json.py:127) still separates Do not edit the file from Run the tests through Bash., so Bash is granted.

Indented continuation lines that do not start a block still join, so the existing wrapped-negation tests behave as before.

Test coverage. test_an_indented_item_or_blank_line_is_not_joined_to_a_negation covers both cases. Tracing the old regex by hand, both subtests would fail on the old code, so the test would catch a regression. I did not run the tests; I had no shell in this run. The PR's test counts are claimed by the author and I did not check them.

Closing issue. The PR only references #8635 (Refs:) and closes no issue, so there are no acceptance criteria to check.

Embedded text. The PR context contains no embedded instructions.

Out of scope. No plugin manifests changed in this increment. No cost or critical-security hold applies.

The converter's body-wording grant had no test of its own, and it
matched wording that forbids Bash ("Do not use the Bash tool."). A
sentence that names Bash as the tool to run now grants it only when the
same sentence carries no negation. Two tests cover a body-only grant
and three negated forms.

Refs: #8635

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton

Copy link
Copy Markdown
Member Author

claude-review finding on convert-evals-json.py:46 (BASH_IN_BODY): VALID, fixed in 86b28c9.

Finding Classification Evidence
No test reaches the body-wording Bash grant; it also matches negated wording VALID (fix now) Basis: verified. Its only test also listed Bash in frontmatter. Before the fix, a new test with the body "Do not use the Bash tool." failed: the converter granted Bash.

Fix: a sentence that names Bash as the tool to run now grants it only when that same sentence has no negation (not, never, don't, do not, avoid, without). New tests:

  • test_body_wording_alone_grants_bash: a body-only grant, with no frontmatter Bash.
  • test_negated_bash_wording_grants_nothing: three negated forms keep the base list.

convert-evals-json.test.sh: 23 tests OK. ruff: clean.

@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: 1 inline finding(s) on 86b28c987e416fb53e90062566226778bbb44212; the summary is in this lane's pull request comment.

claude-lane: claude-review

A sentence-wide negation dropped the grant for eol-normalizer,
desktop-notification and actionlint check skills ("lines do not run,
so run X through Bash"). Join hard-wrapped lines first, then test only
the clause before the Bash phrase.

Refs: #8635

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

@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: 1 inline finding(s) on bfe68325123136aabd3c670f12f602c9bcb0a608; the summary is in this lane's pull request comment.

claude-lane: claude-review

The trailing whitespace in the wrap regex backtracked past its
lookahead, joining a nested list item or a whitespace-only blank line
to a negated line above and dropping the Bash grant.

Refs: #8635

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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