Skip to content

fix(evals): resolve same-command shell variables in run-validity - #12275

Merged
kyle-sexton merged 9 commits into
mainfrom
fix/12225-replacement
Nov 2, 2026
Merged

kyle-sexton merged 9 commits into
mainfrom
fix/12225-replacement

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #12156
Refs: #12225

Summary

Replaces #12225, which the lanes could not land. #12226 added bash_read_paths, which calls
shlex.shlex(...) in run-validity.py, while #12225 dropped import shlex. The merge is
textually clean but raises NameError on CI's merge ref, so check-skills, test-bash (0) and
test-python (0) failed there. This branch is current main merged with #12225's head, plus the
import restore and the fix for #12225's open review thread.

The change itself is #12225's: bash_paths resolves NAME=<literal> assignments made earlier in
the same Bash command, so a plugin-data denial reached through $D is set aside like one written
with the literal path.

Fix

  • Restore import shlex in plugins/evals/skills/plugin-eval/scripts/run-validity.py, which
    bash_read_paths from fix(evals): excuse a read-only Bash read of the run's own tool-results in run-validity #12226 needs.
  • bash_paths no longer counts a prefix assignment's value as the simple command's rooted
    argument. PYTHONPATH=/opt/lib pytest -q now gives ('/opt/lib', None) and
    TMPDIR=/tmp make gives ('/tmp', None), since the command works in the working directory.
    An assignment-only command (D=<d>;) gets no entry, so D=<d>; R=$D/runs; ls -la "$R" still
    resolves with no None.
  • Both cases are pinned in test_a_later_command_naming_no_rooted_argument_adds_none.
  • reference/reading-results.md and the evals changelog fragment name the rule.

Verification

  • python3 -m unittest discover -s plugins/evals/skills/plugin-eval/scripts -p test_run_validity.py:
    123 tests, OK.
  • bash plugins/evals/skills/plugin-eval/scripts/run-validity.test.sh: 123 tests, OK.
  • scripts/run-ruff.sh check on both changed Python files: all checks passed.
  • scripts/check-changelog-fragments.sh --check: all 13 fragments valid.

Related

🤖 Generated with Claude Code

melodic-automation-lanes Bot and others added 8 commits November 2, 2026 02:17
Lane-Activity: work-resolve-issue/resolve-issue
Lane-Activity: pr-unblock/resolve-conflicts
The token broker refused a lane run on the previous head as workflow-modified (.github/workflows/pr-run-activity-write.yml). This commit changes no file.
Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yg83X
Lane-Thread: PRRT_kwDOTCGFQM6yhYgZ
…main merge

#12226 added bash_read_paths, which builds a shlex lexer; the #12225 branch
rewrote the tokenizer and dropped the import, so the merged run-validity.py
raised NameError on every Bash read-back path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
bash_paths filled each simple command's "names a rooted argument" flag
from every word, prefix assignments included, so PYTHONPATH=/opt/lib
pytest -q gave ('/opt/lib',) with no None although pytest works in the
working directory. Skip lead NAME=value words when filling the flag; an
assignment-only command gets no entry, so D=<d>; ls "$D/x" still
resolves. Pin PYTHONPATH=/opt/lib pytest -q and TMPDIR=/tmp make, and
name the rule in reading-results.md and the changelog fragment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-02T05:02:53.536014Z 89daf97 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 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #12275 (incremental, 89daf97 → dd5dd6e)

I found no security issues.

I read every hunk of the incremental diff in all 3 files in scope:

  • reference/reading-results.md
  • scripts/run-validity.py
  • scripts/test_run_validity.py

No changed file matches a TRUSTED PATHS: glob.

What changed

Before this change, shell_words gave no simple-command number to any command that reads a pipe. Now it does that only when the command's verb is in BASH_READERS (cat, head, wc, grep, sed, defined at run-validity.py#L188). Any other piped command that names no rooted argument (cat /x | ls, cat /x | find -type f) now adds None. bash_paths treats None as cwd-relative, so possibly the plugin.

What I checked

  • Direction. This change narrows: it marks more commands as possibly the plugin. It never lets a denial be set aside that the base version would have counted, so the validity gate fails more closed, not less.
  • Who can reach it and the impact. Only the eval harness runs this code, on transcripts from sandboxed eval runs. It only tokenizes the command text in Python and never runs it, so there is no injection surface. The worst case is a wrong eval verdict, which is none of the three impacts that count (leak, compromise or charge).
  • Lenses that don't apply. The diff changes no trust control, merge hold, workflow, plugin manifest or standing instruction.

The PR context file contains no embedded instructions aimed at the lane. The prior-findings file lists one earlier summary comment, which had 0 findings. There are 0 rounds with findings, so the round cap did not apply.

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: 89daf97220

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

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, 89daf972 → dd5dd6e9): #12275

I read every hunk of the incremental diff in all 3 in-scope files: reading-results.md, run-validity.py and test_run_validity.py. For context I also read the head shell_words, bash_paths and BASH_READERS. None of these files matches a trusted-path glob. I didn't run anything. The test results in the PR body are the author's claims and I haven't checked them.

The new change

This change fixes my earlier inline finding (r4439071796). Before, any command after a pipe was exempt from the "names no rooted argument" rule.

  • What changed: a piped command now gets simple = None only when its first non-assignment word is a BASH_READERS command (cat, head, wc, grep, sed). See run-validity.py#L1114-L1115.
  • Commands that ignore stdin: … | ls, … | find, … | make and … | pwd get a named entry again, so they add None.
  • Other cases I traced:
    • In … | LC_ALL=C wc -l, the prefix assignment is skipped, so wc is taken as the command.
    • || and |& don't set piped.
    • A command that is not a reader, such as sort or xargs, still adds None (it fails closed).
  • Tests: the three new cases in test_a_later_command_naming_no_rooted_argument_adds_none cover both sides of the rule.
  • Docs: the docstrings and reading-results.md now name the same five commands.

I found no new problem in this change.

Findings

  1. Closing issue fix(evals): resolve same-command shell variables in run-validity's Bash paths #12156, "Done when" (blocking, restated): the issue says "run-validity.py on the harness-config: concise rewrite of audit, audit-pass, audit-instructions (rollout slice A) #11564 before-pass results … sets aside the 3 plugin-data denials that go through a variable." This was a summary finding last round, so it's restated here. The incremental change doesn't affect it:

    • Case 1 is D=<sandbox>/config/plugins/data/harness-config-inline; R=$D/runs/...; bash "$S" lease acquire ... --plugin-data "$D"; ls -la "$R". It still adds None, for two reasons:
      • lease and acquire are relative words that aren't flags (run-validity.py#L1207).
      • $S is never assigned in that command.
    • Case 1 is the one denial that comes from a call the skill tells the model to make, and it keeps ap-config-lane-run-state INVALID. The WARN test covers only the D=…; R=$D/runs/ap-1; ls -la "$R" part of it (test_run_validity.py#L1192).
    • Case 3 (ls -d "$PD"/../*) is pinned as FAIL (test_run_validity.py#L1206).
    • So only case 4 can be set aside. The PR body still doesn't say the gate was run on m-before.json.

    Decision needed: someone has to choose between two options, and I can't settle it from the code:

Notes

  • The prior-findings file shows round 1 of a cap of 3, so the cap didn't apply.
  • No settled-threads file was given.
  • No plugin manifest changed in this increment, and no .claude/rules path rule applied.
  • The PR context contains no embedded instructions aimed at this lane.

shell_words gave every command after | no simple-command number, so
bash_paths never asked whether it names a rooted argument: cat <d>/x |
ls gave ('<d>/x',) and was set aside as plugin-data-only, although ls
lists the working directory. Exempt only a BASH_READERS command (cat,
head, wc, grep, sed) reading a pipe; any other piped command gets a
number like the rest. Pin cat /proc/v | ls and | find -type f (None)
and | wc -l (no None).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 8e3029e Nov 2, 2026
48 checks passed
@kyle-sexton
kyle-sexton deleted the fix/12225-replacement branch November 2, 2026 05:52
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): resolve same-command shell variables in run-validity's Bash paths

1 participant