Skip to content

fix(evals): set aside a denied read of the run's own tool results when its path is in a shell variable #12583

Closed

Description

@kyle-sexton

Problem

run-validity.py fails a run for a harmless read of its own tool results when the path sits in a shell variable. own_results_denial sets a denial aside only when bash_read_paths returns the read's paths, and bash_read_paths returns None for this shape, so the denial counts against the run.

Measured on current main (plugins/evals/skills/plugin-eval/scripts/run-validity.py):

Command bash_paths bash_read_paths
grep -n x <results> the path the path
F=<results>; grep -n x $F the path (resolved, #12156) None
F=<results> newline grep -n x $F the path None
F=<results>; sed -n 1,5p $F | grep x the path None

The cause is the UNQUOTED_EXPANSION and operator checks at the top of bash_read_paths, which reject $F and ; before any assignment is resolved. #12156 taught bash_paths the same-command variable; bash_read_paths did not get it. #12217 added the set-aside for the plain form.

Impact

The third before leg of the #8431 Opus re-measure went INVALID on the F=...; grep ... $F shape, in a 51.34 USD pass that could not be called. Notes at the time count a second leg; its sandbox is deleted, so that is unconfirmed. #8431 waits on this fix.

Done when

  • bash_read_paths returns the read paths for a leading same-command assignment to a literal path followed by a read-only pipeline, in both ; and newline forms, so own_results_denial sets those denials aside.
  • A variable that is reassigned, unset, built from another expansion, or used by a non-reader still returns None.
  • A test covers each row above and each negative. The docstring states the rule.

Refs: #8431

Activity

  1. added
    needs-triage
    on Nov 3, 2026
  2. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Understood: bash_read_paths in run-validity.py returns None for a leading same-command assignment to a literal path followed by a read-only pipeline (F=<results>; grep x $F, in ; and newline forms). A harmless denied read of the run's own tool results therefore fails the run instead of being set aside. The fix should resolve the assignment, keep returning None for reassigned, unset, expansion-built or non-reader uses, and add tests plus a docstring. The issue says #8431 waits on this fix. The done-when items are exact and I found no duplicate.

    Automated triage, applied by the lanes App.

  3. added and removed
    needs-triage
    on Nov 3, 2026
  4. added
    status: ready
    on Nov 3, 2026
  5. melodic-automation-lanes commented on Nov 3, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane yet: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited; intake's refinement of this body is due and may supply them.

  6. added
    needs-triage
    on Nov 3, 2026
  7. melodic-automation-lanes commented on Nov 3, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Make bash_read_paths in run-validity.py return the read paths for a leading same-command literal-path assignment (; or newline) followed by a read-only pipeline, so own_results_denial sets those denials aside.

    Acceptance criteria

    • bash_read_paths('F=<results>; grep -n x $F') returns a tuple holding the results path, where <results> is a rooted literal path.
    • bash_read_paths('F=<results>' + newline + 'grep -n x $F') returns the same tuple.
    • bash_read_paths('F=<results>; sed -n 1,5p $F | grep x') returns the tuple with the path from the sed segment.
    • bash_read_paths('grep -n x <results>') still returns the path, unchanged.
    • A variable reassigned before use (F=a; F=b; grep x $F) still returns None.
    • A variable unset before use (F=<results>; unset F; grep x $F) still returns None.
    • A variable built from another expansion (F=$(cmd) or F=$OTHER/x; grep x $F) still returns None.
    • A variable used by a non-reader (F=<results>; rm $F or cat > $F) still returns None.
    • A test in plugins/evals/skills/plugin-eval/scripts/test_run_validity.py covers each of the four table rows and each negative above, and passes via run-validity.test.sh.
    • The bash_read_paths docstring states the rule: a leading same-command assignment to a literal path, resolved through shell_words, followed by a read-only pipeline.
    • A denied read of the run's own tool results of the F=...; grep ... $F shape is set aside by own_results_denial instead of failing the run (covered by a test).

    External state: none

    Dependencies

    • #​8431 waits on this fix; no work this issue waits on.

    Related work

    Sources read

    • plugins/evals/skills/plugin-eval/scripts/run-validity.py:242: UNQUOTED_EXPANSION = re.compile(r"[{*?\[$\]") rejects $ and other expansion characters.
    • plugins/evals/skills/plugin-eval/scripts/run-validity.py:1242: shell_words resolves same-command NAME=value assignments (top level, before compound commands) and drops names that are reassigned, mentioned oddly, reset or set by read/eval.
    • plugins/evals/skills/plugin-eval/scripts/run-validity.py:1314: bash_paths uses shell_words, so it resolves the variable.
    • plugins/evals/skills/plugin-eval/scripts/run-validity.py:1369: bash_read_paths returns None at the BASH_EXEC/UNQUOTED_EXPANSION check at 1375-1380, before any assignment is resolved, and its lexer treats ; as an operator word.
    • plugins/evals/skills/plugin-eval/scripts/run-validity.py:1402: segment_read_paths accepts only BASH_READERS commands with listed flags and rooted, non-UNRESOLVED path operands.
    • plugins/evals/skills/plugin-eval/scripts/run-validity.py:1481: the caller passes the Bash command to bash_read_paths; own_results_denial is at line 1700.
    • plugins/evals/skills/plugin-eval/scripts/test_run_validity.py: the existing test file, with no bash_read_paths cases found by grep.

    Automated refinement by the lanes App. Intake triages the issue again with it.

  8. removed
    needs-triage
    on Nov 3, 2026
  9. added
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Nov 3, 2026
  10. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor
    No description provided.
  11. melodic-automation-lanes commented on Nov 3, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue run that agent-ready started waited in its slot past a change to its lane workflow files on main, so it stopped before any model turn. The run's report-outcome removed and added agent-ready back to start a fresh run on main's workflow files. If this run ends the same way, it re-fires the issue again, waiting longer each time.

  12. added
    agent-ready
    and removed
    agent-ready
    on Nov 3, 2026
  13. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor
    No description provided.
  14. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor
    No description provided.
  15. melodic-automation-lanes commented on Nov 3, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped on this issue (patch-apply-failed): apply-issue-patch failed before it committed or refused the patch, a job fault.
    It keeps agent-ready, and work-unblock starts it again (retry 1 of 2).

    In the run's words:

    The run reported done, but apply-issue-patch did not commit its patch (patch-apply-failed): apply-issue-patch failed before it committed or refused the patch. The run's log names the path or check.

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41562331824

  16. added
    agent-ready
    and removed
    agent-ready
    on Nov 3, 2026
  17. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor
    No description provided.
  18. kyle-sexton commented on Nov 3, 2026

    @kyle-sexton
    MemberAuthor

    Fixed by #12585 (507b70a), merged 02:06Z. Checked on main: the three denied shapes in this issue now return their read paths from bash_read_paths, so own_results_denial sets them aside. A path outside tool-results still returns that path and is not set aside. #8431's fresh pair can run.

  19. removed
    status: ready
    agent-ready
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    agent-ready

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions