Skip to content

feat(evals): prune stale plugin-eval run roots under HOME .ev at run start - #18283

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-15112-45095727227-1
Nov 23, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-15112-45095727227-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #15112

Summary

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

Adds plugins/evals/skills/plugin-eval/scripts/prune-run-roots.py. It removes a run root under $HOME/.ev only when the root is a real directory directly under realpath $HOME/.ev, holds claude-eval-* sandboxes, has had no mtime change anywhere inside for 3 days, and no process has a file open or its working directory under it (read from /proc). It opens each sealed/ with chmod 700 before removing. It refuses symlinks and any path outside $HOME/.ev, and refuses the whole pass (exit 2) when $HOME/.ev resolves to /, /tmp, /var/tmp or the system temp directory, or when /proc cannot be read. Plugin-eval Run step 3 now calls it before creating the run directory, and preflight still removes nothing. reference/sandboxes.md states the rule once in a new 'Pruning stale run roots' section beside 'Stale run roots', and SKILL.md points to it. Scope follows the 2026-11-22 recorded decision, which narrowed this issue to per-run roots after #17822 and uses the 3-day age stale_run_roots already reports by. The body's second done-when item (the latest decision restates the body's criteria) is met by a doc change: the leftover_sandboxes probe now counts nested claude-eval-* directories (find with -prune, no -maxdepth 1). Design choices: a Python script with a unittest suite, matching the other scripts in that directory. Open files are found through /proc/<pid>/fd and cwd, with no lsof dependency. A mode-000 directory the walk cannot enter counts by its own mtime, since nothing inside it can change while it is sealed.

Not verified

  • The new unittest suite (prune-run-roots.test.sh / test_prune_run_roots.py) was not executed: this lane allows no interpreter. Left to the PR's CI (run-plugin-tests.sh discovers *.test.sh)
  • prune-run-roots.test.sh and prune-run-roots.py are created without the executable bit (the lane cannot chmod); run-plugin-tests.sh invokes suites through bash, and the docs call the script through python3
  • Tidy not run: the change is about 440 changed lines, over the 300-line tidy cutoff
  • check-affected skipped typos (not installed), comment-hygiene (network fetch denied), size-check (script missing in lane), and the validate-plugins/changed-skills sub-steps that run checked-tree code; these run in CI
  • Review low findings left as is: a symlink swapped in during the microseconds between the checks and removal could let chmod touch directories outside the root (rmtree still refuses the symlink, so nothing outside is deleted); the sealed-mode test does not on its own prove the chmod 700 step ran
  • .github/workflows/pr-run-plugin-evals.yml and maintenance-measure-skill-edit-pass.yml also use $HOME/.ev on ephemeral CI runners; not changed (protected path, and runners are discarded after each job)
  • Untracked dotfiles at the repo root (.bashrc, .gitconfig, .mcp.json, .idea, .vscode and others) were not created by this run's edits and were left untouched; they should not go into the patch

Fix

  • plugins/evals/skills/plugin-eval/scripts/prune-run-roots.py: new prune script for run roots under $HOME/.ev (age, layout, symlink, location and open-file checks; chmod 700 on sealed/ before removal)
  • plugins/evals/skills/plugin-eval/scripts/test_prune_run_roots.py: new unittest suite: old root removed, recent change deep inside kept, root without sandbox kept, symlink in $HOME/.ev not followed, symlink inside a removed root keeps its target, paths outside $HOME/.ev (and /tmp) refused, $HOME/.ev…
  • plugins/evals/skills/plugin-eval/scripts/prune-run-roots.test.sh: wrapper so run-plugin-tests.sh discovers the suite, same shape as docker-links.test.sh
  • plugins/evals/skills/plugin-eval/reference/sandboxes.md: new 'Pruning stale run roots' section stating the 3-day rule once; 'Stale run roots' and 'Removing a run root' point to it; it says the prune reads every entry's mtime under a root while stale_run_roots reads only the root's own mtime, so the prune can keep a root preflight lists; the leftover_sandboxes probe counts nested sandboxes
  • plugins/evals/skills/plugin-eval/SKILL.md: Run step 3 runs the prune script before mktemp; the preflight text points stale_run_roots at the prune rule; the leftover_sandboxes field allows 'at least <n>'
  • .changes/evals/work-resolve-issue-issue-15112-45095727227-1-61647f49.md: minor changelog fragment for the evals plugin, noting that the prune's age check can keep a root stale_run_roots lists

Verification

The runner ran each check from the base copy against 9b74f1a:

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

The run reports:

  • check-changelog-fragments: all 2 fragments valid
  • check-changed-skills: plugin-eval PASS, 0 errors, 4 warnings, all pre-existing size/description warnings (SKILL.md 499/500 lines)
  • check-affected: first run failed spoke-plugin-root because sandboxes.md used ${CLAUDE_PLUGIN_ROOT}; changed it to <skill-dir>; rerun: 18 passed, 9 skipped, 0 failed
  • fresh-context review subagent over the whole diff: no high-severity findings. Fixed the doc findings: preflight-vs-prune mismatch for roots with no sandbox, the 3-day rule repeated, no instruction for exit 1/2, the PID-namespace limit of the /proc check
  • read https: //man7.org/linux/man-pages/man7/pid_namespaces.7.html: a /proc mount shows only processes in the PID namespace of the process that mounted it
  • read https: //man7.org/linux/man-pages/man5/proc_pid_fd.5.html: /proc/pid/fd holds one symlink per open file; reading those links is governed by a ptrace access-mode check
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/45095727227

Left out: the items under Not verified.

Related

#15112

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

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #18283, incremental since 9b74f1a

No security issues found in the changes since the last review.

Scope. This was an incremental, blocking-only review: this lane already reviewed head 9b74f1adfc79a6d73bd7137c737e2e8ab4cf93bc. I read every hunk of both files in .claude-lane/incremental.diff:

  • .changes/evals/work-resolve-issue-issue-15112-45095727227-1-61647f49.md
  • plugins/evals/skills/plugin-eval/reference/sandboxes.md

Neither file matches a trusted-path glob. The push touches no code, workflow, trust control or plugin manifest, so this review has no manifest lines.

What changed. Both edits are documentation only. They answer an earlier review thread, now resolved, which pointed out that the prune measures age differently from preflight's stale_run_roots. The new text says the prune's age check reads the root and every entry under it. That makes it stricter than preflight's check, which reads only the root's own mtime, so the prune can keep a root that preflight lists.

Instruction-surface lens. The sandboxes.md edit does not loosen any rule about removing a run root. It describes a stricter keep condition, one the reviewed prune-run-roots.py code already applies (newest_mtime). Every other removal condition is unchanged: real directory, direct child of realpath $HOME/.ev, holds claude-eval-* sandboxes, no process holds it. Nothing was deleted, narrowed or softened.

PR context. I found no text in the PR description or the issue comments that tries to instruct this lane.

Spend. This push spends no API credits or subscription usage and can cause no charge.

critical-findings: 0

@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 9b74f1adfc79a6d73bd7137c737e2e8ab4cf93bc; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review, incremental (9b74f1a..153b614): prune stale plugin-eval run roots (#18283, closes #15112)

This was a blocking-only review. The lane already reviewed an earlier head, so it reports only blocking findings and manifest flags. I read both files in the incremental diff in full: the changelog fragment and reference/sandboxes.md.

The push fixes this lane's earlier advisory finding (#18283 (comment)). That finding said the prune's age check was described as the same check preflight's stale_run_roots uses. The text now says the two differ:

  • Prune: it reads the root's mtime and every entry's mtime under it.
  • Preflight: stale_run_roots reads only the root's own mtime.
  • Effect: the prune can keep a root that preflight lists, and it prints kept (changed within 3 days) for it.

I checked this wording against the head script, and it matches:

  • newest_mtime starts from os.lstat(root).st_mtime and takes the newest lstat mtime under the root (prune-run-roots.py#L74-L82).
  • The keep message is changed within 3 days (#L132-L133).

The changelog fragment makes the same statement accurately.

The issue's 2026-11-22 done-check comment hoped "the report and the removal follow one rule". The PR now documents the gap instead of closing it, which is the first of the two fixes the earlier finding offered. There is no blocking issue left.

Loosened checks: none in this diff. Loosened checks would be marked: fail (the default, since the prompt has no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. The prompt has no loosened_check_decision_record: line, so I did not check the citation requirement.

Spend: none. The change is documentation only.

No plugin manifest changed. No new findings.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback

Run 45098289276, attempt 1

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

Failed GitHub API calls

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

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM66q5ZI
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-feedback-patch

Run 45098289276, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed 153b614
Run 45098289276

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 153b614.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback

Run 45098289276, attempt 1

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

Failed GitHub API calls

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head 153b61450f73feeaeb6ca1395b4fde613fcb15d5, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=HIGH demote=true head=153b61450f73feeaeb6ca1395b4fde613fcb15d5 rubric=10.8.2 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 701e630 Nov 23, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15112-45095727227-1 branch November 23, 2026 02:34
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 701e630b13e1d9316c35447e5683259bc12cea5f; later checks count it verified from this comment.

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.

evals: prune kept plugin-eval sandboxes under the eval temp root by age

0 participants