Skip to content

fix(evals): give each plugin-eval run its own HOME .ev directory and remove it when the run ends - #17822

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-17061-44866394142-1
Nov 21, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-17061-44866394142-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17061
Refs: #15112

Summary

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

plugin-eval now requires $HOME/.ev as the eval temp root on Linux and WSL2. Each run gets its own TMPDIR, $HOME/.ev/<short-run-id>, made with mktemp -d, and the 24-character bound applies to that path. A new Run step 5 removes the run directory whether or not a read happened, after the read when there is one, unless the user explicitly asks to keep it; --keep-temp does not keep it. Preflight gains a report-only stale_run_roots field listing run roots older than 3 days with their nested claude-eval-* sandbox count. reference/sandboxes.md states the count rule and the run-root removal loop once, and SKILL.md points at them. This follows the recorded decision of 2026-11-21. Design choices: mktemp -d makes the short run id because it creates a unique directory in one step, and the GNU manual sets its three-X minimum, which is the route when $HOME is too long. "Older than 3 days" is find -mmin +4320 on the root's mtime. Refs: #15112 (#15112 stays open, narrowed to age-based removal of whole run roots; the PR must not close it).

Not verified

  • The new shell loop and find probes were not executed: lane Bash allows only the named wrappers. Review was by reading only.
  • tidy pass 5 (ai-slop): detect.sh could not run in this lane, so the deterministic detector was replaced with a Grep for em dashes and catalog vocabulary; no semantic-diff subagent ran because pass 5 made no rewrite. Passes 1-3 had nothing to do (markdown only).
  • build/test: no test suite covers these markdown files; eval-cases, evals-quality, lychee and other CI-only checks are left to the PR's CI.
  • check-affected skipped typos (not installed), comment-hygiene (network fetch blocked) and size-check (script missing in the lane checkout).
  • Staged before/after plugin copies (~/.evc-*) are out of scope per the recorded decision; nothing in the repository creates them.
  • The PR body must carry Refs: #15112 with no closing keyword for #15112; the lane writes the PR body.
  • The working tree holds untracked runner files this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc); they are not part of this change.

Fix

  • plugins/evals/skills/plugin-eval/SKILL.md: preflight gains the stale_run_roots field (pointing at sandboxes.md) and eval_tmpdir now means the per-run path, with the fewer-X route when it passes 24 characters; Run step 3 requires $HOME/.ev and creates the run directory with mkdir -p plus mktemp…
  • plugins/evals/skills/plugin-eval/reference/sandboxes.md: new 'Stale run roots' section (read-only probe, nested sandbox count, 3-day age, report-only); new 'Removing a run root' section with a second removal loop limited to a non-symlink directory whose realpath is a direct child of realpath…
  • .changes/evals/work-resolve-issue-issue-17061-44866394142-1-a33b600b.md: minor changelog fragment for the evals plugin.

Verification

The runner ran each check from the base copy against c6cdced:

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

The run reports:

  • read https: //www .gnu.org/software/coreutils/manual/html_node/mktemp-invocation.html: the template must hold at least three consecutive X's in its last component, -d creates the directory with permissions for the current user only, and intermediate directories in the template must already exist…
  • check-changelog-fragments: all 4 fragments valid
  • check-changed-skills: PASS for plugin-eval (SKILL.md 499/500 lines, 0 errors; its 4 warnings are about description and body size, which this change did not cause)
  • check-affected: 14 passed, 9 skipped (typos not installed, comment-hygiene fetch blocked, size-check script missing, checks that run code from the checked tree), rest CI only
  • fresh-context review subagent over the whole diff: no high findings. Fixed 2 medium findings (another session's read of run-root results had no removal path; the stale-root removal had no owner) and the low ones: chmod check, glob replaced by find so zsh works and symlinked sandboxes are skipped,…
  • tidy-diff over the change's lines: the write-for-agents and write-for-humans passes made 3 wording edits; the ai-slop check, done by hand with Grep, found no em dashes or catalog vocabulary
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44866394142

Left out: the items under Not verified.

Related

#17061

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #17822 (head c6cdced)

No security issues found.

The PR changes three Markdown files and no code: a changelog fragment, plugins/evals/skills/plugin-eval/SKILL.md and plugins/evals/skills/plugin-eval/reference/sandboxes.md. None of them matches a trusted-path glob. The PR changes no plugin manifest, workflow, trust control, merge hold or token scope.

What I checked

The new run-root removal loop (sandboxes.md, "Removing a run root"), read as a destructive command an agent will run:

  • Paths that point at the wrong thing. $HOME/.ev itself, ., .. and a trailing / all resolve outside the allowed scope. The dirname "$(realpath "$d")" != "$(realpath "$HOME/.ev")" check turns each of them away. When $HOME/.ev is missing, e is empty and every path is skipped. A symlinked root fails the -L check.
  • Symlinks inside a root. find -type d does not follow symlinked claude-eval-* entries. GNU chmod -R does not follow symlinks during traversal by default, and rm -rf removes a link, not its target.
  • chmod 700 on a symlinked sealed/. The [ -d "$1/sealed" ] && chmod 700 step can follow such a link. That only narrows permissions on a target the user already owns. The loop in "Removing a read's sandboxes" already handled sealed/ this way before this PR.
  • Quoting. The path comes from mktemp -d "$HOME/.ev/XXXXXX", so the id is alphanumeric. The doc also requires a path with no ' and no control character before it goes inside single quotes.
  • What the loop refuses to do. It never removes $HOME/.ev itself and never globs over its children.

The stale_run_roots preflight probe. It only reads (find, du) and removes nothing, so it keeps preflight's "removes nothing" rule. Root names it prints go into a quoted find/du command, but the names come from runs under the user's own $HOME/.ev. Eval code that could plant such a name (hooks, --scaffold scripts) already runs as the user outside the sandbox, as the Gotchas section says, so there is no new privilege.

Removed or softened instructions. The guidance against the /run/user tmpfs and against TMPDIR under /tmp or /var/tmp still appears in sandboxes.md ("Docker link swap") and in the SKILL.md Gotchas. Only the wording changed. "Removes nothing" still holds for preflight. No protected-class rule is lost. I did not read the instruction exception register; I judged these by what breaks when the rule is absent.

PR context. It holds no embedded directives aimed at this lane.

Spend

No billing impact. A new closing step removes local temp directories and spends nothing.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #17822 (plugin-eval per-run $HOME/.ev root and closing removal)

I read all three changed files in .claude-lane/pr.diff. I also read the unchanged parts of reference/sandboxes.md and SKILL.md that the new text calls (the existing removal loop, Run steps 3–4, and Calibrating a judge), the issue's criteria, and the matching path-scoped rules (skill-bodies-state-current-rules.md, cost-claims.md). The change meets most of #17061's confirmed done-when list:

  • $HOME/.ev is now the required root, and each run's TMPDIR is $HOME/.ev/<short-run-id>.
  • The 24-character bound applies to the per-run path.
  • Run step 5 removes the run directory whether or not a read happened, and the removal does not depend on --keep-temp.
  • stale_run_roots only reports. The listing has an age threshold and no age-based removal was added.
  • The second removal loop checks for a symlink, checks that the realpath is a direct child of $HOME/.ev, requires a claude-eval-* child, and handles sealed/ the same way the existing loop does.
  • The count rule and the removal rule are each stated once, in sandboxes.md.

I found no correctness defect in the new shell loop or the probes by reading them. I did not run them: this lane has no shell, and the PR says they were never run in its lane either.

Findings (not on a changed line)

  1. Closing-issue criterion not met: "The pull request carries a Refs: #15112 line and no closing keyword for evals: prune kept plugin-eval sandboxes under the eval temp root by age #15112." The PR body has no Refs: #15112 line. The issue number appears only inside the quoted run summary and the "Not verified" bullet, and there it is written Refs: #15112 with a fullwidth # (U+FF03). GitHub does not link that form, so evals: prune kept plugin-eval sandboxes under the eval temp root by age #15112 gets no reference from this PR, even though the recorded decision relies on it to keep evals: prune kept plugin-eval sandboxes under the eval temp root by age #15112 open and narrowed. The same body uses an ASCII # in Closes #17061, so this is not how the context file renders every number. Fix: add a standalone line Refs: #15112 with an ASCII # to the PR body, and no closing keyword.

  2. No test could fail if the new behavior broke. The issue's criteria are met, but nothing in the PR or the repository checks them. A grep of plugins/evals/evals/** finds no case that mentions TMPDIR, $HOME/.ev, run roots or the closing step; the only TMPDIR mention is an incidental sample in pe-scaffold-flag. These criteria are untested:

    • the required $HOME/.ev/<short-run-id> path made with mktemp -d (SKILL.md#L255);
    • Run step 5's removal whether or not a read happened, not tied to --keep-temp (SKILL.md#L279);
    • the report-only stale_run_roots field (SKILL.md#L53);
    • the run-root removal loop's guards (sandboxes.md#L121).

    The loop runs chmod -R and rm -rf and has never been run. The cheapest gap to close is a guard check: a must-pass/must-fail eval case, or a fixture test, giving the loop a symlinked root, a root outside $HOME/.ev, and a root with no claude-eval-* child, and checking that it skips all three.

Policy lines

  • Loosened checks would be marked: fail (the default: the prompt has no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. No changed file loosens a check; the change is Markdown only. The prompt has no loosened_check_decision_record: line, so the citation requirement was not checked.
  • Paved paths: the standards index has no paved-path row, so I report nothing on paved paths.
  • Plugin manifests: no plugin.json or marketplace.json changed. The changelog fragment's bump: minor matches a changed behavior plus a new preflight field.
  • Spend: none. This change starts no billing and spends no metered credit.
  • I checked the PR context, prior-findings and rule files for embedded instructions and found none.
  • Prior findings: this is the first review of this PR (0 earlier heads), so it is not blocking-only.

I did not run a separate verifier pass. Both findings rest on what I read directly: the PR context text and a grep of the evals tree.

Verifier dropped 0 of 2 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback

Run 44874128684, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44874128684

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on c6cdced.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback

Run 44874128684, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44874128684

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so no lane resolves it and a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=17822 -f activity=address-feedback

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation

Run 44875307656, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44875307656

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 21, 2026
@kyle-sexton kyle-sexton removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 21, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 8da0aa0 Nov 21, 2026
110 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-17061-44866394142-1 branch November 21, 2026 07:51
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): plugin-eval leaves TMPDIR roots and sealed sandboxes in the home directory

1 participant