Skip to content

feat(testing): let cleanup plan a whole repo as per-project batches - #10000

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-6043-40188609037-1
Oct 25, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-6043-40188609037-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #6043

Summary

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

/testing:cleanup given the repository root (or a whole-repo request with no folder) now prints a plan instead of refusing: one audit run, one batch per test project (a C# row's .csproj folder, else the test file's folder), ordered by finding count. Each chosen batch runs through the unchanged single-folder steps 0 to 7 with its own diff and approval, and a live or operational project is marked and skipped unless the user names it, then runs only in cannot-fail-only mode, which runs no test. The never list still forbids more than one folder in one batch.

Not verified

  • CI's check-skills / changed-skills (skill-quality checker) was not run here: the lane skips it because it runs the checked tree's own code; left to the PR's CI
  • listing-budget and next-graph whole-repo scanners are CI only; the description grew by about 75 characters, left to the PR's CI
  • No eval run for the cleanup skill: the change adds a mode and cuts nothing, and the lane cannot run model evals
  • The changelog fragment was written by hand because new-changelog-fragment refuses on a detached HEAD; its name follows the <branch-slug>-<8 hex>.md shape and the fragment check validates it
  • No commit was made: the lane's instructions say to leave every change uncommitted for the runner to turn into a patch

Fix

  • plugins/testing/skills/cleanup/SKILL.md: new ## Repository plan section (findings, batch grouping with same-language nesting and no root batch, plan file under .work/testing-cleanup-plan/, live/operational skip with by-name opt-in into cannot-fail-only mode, an ask for unknown-kind batches, one ba
  • plugins/testing/README.md: the /testing:cleanup row describes the repository plan
  • .changes/testing/feat-6043-cleanup-repo-plan-3b9e42d7.md: new minor changelog fragment for testing

Verification

The runner ran each check from the base copy against 8eeff12:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 13 fragments valid
  • .lane/checks/bin/check-affected: 9 passed, 7 skipped (changed-skills, typos, shellcheck, ruff and three validate-plugins sub-checks skipped by the lane), 0 failed
  • Grep length probe on the SKILL.md description: between 960 and 1000 characters, under the 1024 maximum
  • Confirmed #6041's project/kind fields exist before building on them: plugins/testing/skills/audit/SKILL.md 'Project context' and cant-fail-scan.sh kind detection
  • Fresh-context opus review of the whole diff: 3 findings (the _ slug-collision claim was false, a root-level test file would collapse every batch into the root, non-C# kinds are always unknown); all confirmed and fixed, checks re-run green
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40188609037

Left out: the items under Not verified.

Related

#6043

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

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 8eeff125dac24e1158769cac4e37749bfad0cb6f: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

critical-findings: 0

Scope read: the full diff (.claude-lane/pr.diff, 3 files) and the PR context. The changes are plugins/testing/skills/cleanup/SKILL.md (a new "Repository plan" section and argument wording), the README row, and a changelog fragment. No changed file matches a trusted path. No plugin.json or marketplace.json changed, so there are no manifest <field> lines.

Instruction-surface lens: the diff rewords the "never clean more than one folder per batch" rule so that it permits a plan of batches. It does not remove the guardrail. Each batch still goes through steps 0 to 7 unchanged: its own diff, its own user approval, and a clean-tree requirement before the next batch starts. The live/operational control is preserved and tightened:

  • A batch with any live or operational row is marked skip: kind <kind>.
  • Such a batch runs only when the user names its folder, and then only in cannot-fail-only mode, which runs no test. The text says "never run a live or operational project's tests, a baseline included".
  • Outside C#, where every kind is unknown, the plan asks the user which projects reach live or shared environments.
  • An unattended run starts no unknown-kind batch.

I found no deleted or softened rule that nothing else enforces.

Considered and not reported:

  • The kind marking depends on audit findings. A live project with no findings sitting inside another batch's folder would not be marked. That needs an unusual nested layout and the diff gives no concrete exploit path, so I did not report it.
  • The plan files live in the gitignored .work/testing-cleanup-plan/, which a pull request cannot supply, and the skill checks that .work/ is ignored.

Cost: the repository plan makes one repo-wide audit run, plus a per-batch run. That spends only prepaid or subscription usage. It is not a hold and I did not count it as a finding.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 8eeff125dac24e1158769cac4e37749bfad0cb6f: 4 finding(s), 0 as inline comments.

The change adds a repository-root plan mode to /testing:cleanup, with a README row and a minor changelog fragment. The three closing-issue criteria on the skill text are met: a root target prints a plan, each batch runs through the single-folder steps, and a live or operational project needs a by-name opt-in. The never list still forbids more than one folder per batch. I read the diff, the PR context, the full head SKILL.md, the audit skill's project-context section, the cleanup evals and the testing manifest. I ran nothing, and the PR's own verification claims are author-claimed and unverified by me.

Findings (4, inline):

  • Run step vs. live opt-in. Step 4 of the plan passes only the invocation's --cannot-fail-only, so naming a live or operational folder does not force that mode.
  • Plan resume. Nothing says what to do when plan.md already exists, so a second invocation can overwrite recorded outcomes and the user's skip: kind live marks.
  • Evals. Nothing in the PR would fail if the plan behavior broke, and the existing evals only cover single-folder runs.
  • Manifest description. plugin.json does not mention the repo-plan capability.

Manifest checks (plugins/testing/.claude-plugin/plugin.json; the PR leaves it unchanged and releases through fragments):

  • manifest version bump: pass. The fragment's bump: minor fits an added mode.
  • manifest description: flag, /testing:cleanup (rewrite, quarantine, or delete low-value tests behind a mutation gate) omits the new repository-plan capability the diff adds.
  • manifest userConfig: not hit.

The PR body says CI's check-skills and the listing-budget check were not run in the lane. I did not verify them either, and the closing issue lists check-skills as a PR check.

No spend beyond subscription or prepaid usage. No hold.

critical-findings: 4

Findings not posted inline (their lines are not in the diff):

  • plugins/testing/skills/cleanup/SKILL.md:71 (RIGHT): Step 3 says a skip: kind (live or operational) batch runs only in cannot-fail-only mode. This step passes only "the invocation's --cannot-fail-only" and runs steps 0 to 7 "unchanged". Repro: run /testing:cleanup <repo root> with no flag, then name a skip: kind live folder. Nothing here forces cannot-fail-only, so step 0 and step 3 can take the normal path. Step 3 then records a baseline with /mutation-testing:audit, which runs the live tests. That is what the closing issue's constraint forbids ("never execute operational test projects ... including for a baseline"). State here that a named skip: kind batch always runs in cannot-fail-only mode, whatever flags the invocation had.
  • plugins/testing/.claude-plugin/plugin.json:4 (RIGHT): manifest description: flag. The plugin description says /testing:cleanup (rewrite, quarantine, or delete low-value tests behind a mutation gate). This PR adds a repository-wide per-project planning mode that the description omits, and the README, skill description and changelog all name it. Add a short clause such as "or plan a whole repo as per-project batches". Note that this file is not in the diff, so the comment is anchored to the existing line and the change belongs in this PR.

Findings not posted inline (their path, line or side is malformed):

  • plugins/testing/skills/cleanup/SKILL.md:62: The plan files are "read at every batch boundary, never from conversation memory", but no step covers an existing .work/testing-cleanup-plan/plan.md. Step 3 says "Write plan.md" with every state pending. Repro: finish batch 1 (committed, outcome recorded), end the session, and re-run /testing:cleanup <repo root>. The re-run rewrites plan.md from a fresh scan. That loses the recorded outcomes and the user's skip: kind live marks for unknown-kind batches, so a batch the user excluded can come back as pending. Say what a re-invocation does: reuse the existing plan and rescan only to refresh counts, or ask before overwriting.
  • plugins/testing/skills/cleanup/SKILL.md:46: Criteria 1 to 3 of feat(testing): let cleanup plan a whole repo as per-project batches #6043 (a root target prints a plan, each batch runs through the single-folder flow, a live or operational project needs an opt-in) are met by this text. Nothing in the PR would fail if they broke. skills/cleanup/evals/evals.json has no case for a repository-root target, and its existing cases only cover single-folder runs. The PR body says no eval was added. The skip-by-default behavior for live and operational projects guards against running tests that reset shared environments. Add at least one eval on the cleanup-dotnet fixture: a root invocation that must print a plan, mark a live project skip: kind live, and run no test.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 8eeff125dac24e1158769cac4e37749bfad0cb6f.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit bbcbea0 Oct 25, 2026
40 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-6043-40188609037-1 branch October 25, 2026 12:44
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.

feat(testing): let cleanup plan a whole repo as per-project batches

0 participants