Skip to content

fix(evals): excuse a read-only Bash read of the run's own tool-results in run-validity - #12226

Merged
kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-12217-41375047208-1
Nov 2, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-12217-41375047208-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #12217

Summary

Opened by the work-resolve-issue lane. The run's own summary:

run-validity.py now sets aside a denied Bash call that only reads the session's own config/projects/<project>/<session>/tool-results/, as it already did for Read, Grep and Glob. A new bash_read_paths parser accepts only a pipeline of cat, head, wc, grep and sed -n, joined by |, with an allowlist of flags per command (grep -f/-e/-r and sed -i/w are out) and every path operand rooted under that directory. A redirect, any other command or operator, command substitution, a newline, or an unquoted brace, glob, $ or backslash keeps the call a denial. Design choice: each denial tuple carries a sixth field, the paths the call only reads, so own_results_denial judges Read/Grep/Glob and Bash the same way.

Not verified

  • test_run_validity.py (run-validity.test.sh) was not executed: this lane runs no interpreter or test runner. Left to the PR's CI. The tests were checked by reading the code only, so shlex tokenization assumptions (punctuation_chars with whitespace_split, Python >= 3.8) are unverified until CI runs
  • The issue asks for the two slice C denials 'replayed as fixtures'. The issue elides their real sandbox paths (.../tool-results/toolu_....txt), so they are replayed as test cases through the existing denied_in_sandbox helper with the same command shape (grep -n -A40 / -A22 "Balancing autonomy and s
  • Deliberately strict, per the issue's 'keep it narrow': a harmless read that uses 2>/dev/null, a quoted '|' in a pattern, an unquoted $ or backslash, tail, or a long option still counts as a denial
  • Tidy: the ai-slop detector, digest guard and change-shape.sh scripts could not run (this lane's Bash runs only the named wrappers). The rubric was applied by reading instead and found nothing. Tidy proposals not applied: merge the two name == BASH_TOOL branches in denials() (touches unlisted lines
  • Tidy measurement excluded the untracked runner dotfiles (.bashrc, .gitconfig, .idea, .vscode, .mcp.json and others) that git status lists. They are the runner's environment, not part of this change
  • check-affected skipped typos (not installed) and several checks that run code from the checked tree. Its CI-only checks run on the PR

Fix

  • plugins/evals/skills/plugin-eval/scripts/run-validity.py: BASH_READERS table, SED_PRINT, BASH_EXEC, QUOTED_SPAN/UNQUOTED_EXPANSION guards; new bash_read_paths and segment_read_paths; denials() adds a sixth 'reads' field to each denial tuple and every unpack site is updated; own_results_denial uses t
  • plugins/evals/skills/plugin-eval/scripts/test_run_validity.py: new WARN tests for read-only Bash pipelines and for the two slice C commands replayed (grep -n -A40/-A22 "Balancing autonomy and safety" <tool-results file> | head -60); new stay-strict FAIL tests (redirects, tee, sed -i, sed w, rm
  • plugins/evals/skills/plugin-eval/reference/reading-results.md: Denials section says a read-only Bash pipeline under tool-results is set aside the same way, and what still counts
  • .changes/evals/work-resolve-issue-issue-12217-41375047208-1-f1b2842d.md: patch changelog fragment (Fixed)

Verification

The runner ran each check from the base copy against 881ea5b:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: all 16 fragments valid (run after the last edit)
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changed-skills: plugin-eval PASS, 0 errors, 5 warnings, all on the untouched SKILL.md (size and description length)
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 12 passed, 6 skipped (typos not installed; checks that run tree code), rest CI-only (run after the last edit)
  • fresh-context review subagent over the whole diff: it found 3 bypasses (unquoted brace/glob expansion in a grep pattern or sed script; $'...' ANSI-C quoting that shlex splits differently from bash; grep -r with no operand reading cwd). All 3 are confirmed in the code and fixed, with a FAIL test for
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41375047208

Left out: the items under Not verified.

Related

#12217

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #12226 (incremental, 881ea5b → 89b13cc)

No security issues found.

Scope: I read the one hunk in .claude-lane/incremental.diff, which touches plugins/evals/skills/plugin-eval/scripts/run-validity.py. The other files are unchanged since the last review of 881ea5b9.

What changed: the grep entry in the BASH_READERS allowlist went from "nicvwxoqsHhlLEFGPaIz" to "nicvwxoqszHhlLEFGPaI". The new string has the same characters in a different order: z moved from the end to after s. segment_read_paths reads this entry as the set of short flags grep may cluster (run-validity.py#L854). Same set, so the allowlist still accepts and rejects exactly the same flags. No flag was added, and -f, -e and -r stay excluded. This looks like a CI or spelling-check fix.

Security surface: the file matches no trusted-path glob. It is not a trust control, merge hold, kill switch, token-broker input or plugin manifest, and it removes no standing instruction. The script only parses the command text of Bash calls the eval sandbox already denied. Nothing in it runs commands or holds credentials. The last review covered the wider analysis, and this change doesn't affect it.

Prior findings: the lane's earlier post was a 0-finding summary with no line anchor, so there is nothing to restate. This is round 1 of a cap of 3, not past the cap. No settled-threads file was supplied.

PR context: it contains no embedded text telling the lane to pass the PR, skip a check or drop a finding.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #12226 (incremental since 881ea5b9), no findings

Scope. I read the one hunk that changed since the last review, in plugins/evals/skills/plugin-eval/scripts/run-validity.py. I used the full PR diff only for context.

What changed. In BASH_READERS, the string of grep short flags went from "nicvwxoqsHhlLEFGPaIz" to "nicvwxoqszHhlLEFGPaI". Only the z moved: both strings hold the same 20 characters, so the allowed flags did not change.

Behaviour is unchanged. The only code that reads this string is segment_read_paths (run-validity.py#L854-L870). It only checks whether each flag is in the string (flag not in flags) and never relies on order or position. The number-taking flags ABCm sit in a separate field, which this change leaves alone. So grep commands are accepted or rejected exactly as before, and the tests reviewed last round still describe the code correctly. The commit message says the change was made to fix failing CI checks. My guess is that a spell-check flagged the old string, but I did not confirm that.

Prior findings. My one earlier post was the round-0 summary, which had no findings, so nothing carries over. This is round 0 of a cap of 3, and the cap did not apply.

Closing issue #12217. This hunk does not change anything about the done-when criteria. Last round's assessment still holds.

Not verified. I had no interpreter, so I did not run the tests.

Embedded instructions. The PR context contains none.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 881ea5b9a9bf33917261c60c874ec3e4bd643511. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 89b13cc0fcd534eb40a80763a6c0ccbac98641e8.

Merged via the queue into main with commit 22fc0a5 Nov 2, 2026
40 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-12217-41375047208-1 branch November 2, 2026 03:30
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.

fix(evals): excuse a Bash read of the run's own tool-results file in run-validity

1 participant