Skip to content

feat(source-control): remove worktrees across repositories when cleanup runs outside a repository - #11139

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-11120-40995657507-1
Oct 30, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-11120-40995657507-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #11120

Summary

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

/source-control:worktree cleanup run outside a repository now acts across repositories instead of only reporting. It collects with worktree-discover.sh, runs Steps 1 and 2 once per owning repository, shows one grouped confirm, and runs every guard and removal with git -C '<owning-repo>' (subshells for steps that need a directory), so the guards and what counts as a candidate are unchanged and the caller's working directory never moves. An eval case covers the two-repository case from the issue.

Not verified

  • The issue's done-when bash plugins/skill-quality/scripts/check-skill.sh plugins/source-control/skills/worktree was not run here. This lane cannot run repository scripts directly, and check-affected skips changed-skills because it runs the checked tree's own skill-quality code. The PR's CI runs it.
  • Eval 24 was added and passed check-evals-quality but was not executed against a model. Running eval suites is left to CI and to a person.
  • Tidy's ai-slop pass could not run the deterministic detector (detect.sh is not a command this lane may run). The changed lines were checked by hand for em dashes and catalog vocabulary instead, with none found.
  • The new-changelog-fragment wrapper refused on a detached HEAD, so the fragment was written by hand in the existing fragment format. check-changelog-fragments accepts it.
  • Validate-plugins sub-checks (identity-prerequisites drift, native-overlap registry, claude plugin test) and typos were skipped by check-affected in this lane; they are left to the PR's CI.

Fix

  • plugins/source-control/skills/worktree/context/cleanup.md: replaced the 'outside a repository, cleanup reports and removes nothing' paragraph with an 'Outside a repository: across repositories' subsection. Every git command, forge read and helper targets the owning repository; it has Collect, Identi
  • plugins/source-control/skills/worktree/SKILL.md: Smart Default step 1 now lists cleanup among the actions that work outside a repository. The Graceful Degradation bullet now describes the cross-repository cleanup and links the new subsection.
  • plugins/source-control/skills/worktree/evals/evals.json: added eval 24, cleanup-outside-a-repository-acts-per-owning-repository: two repositories under one worktree root, each with one merged and one stranded worktree. Expected: one grouped confirm, only the two merged worktrees removed, each throug
  • .changes/source-control/feat-11120-cleanup-across-repositories-3b7e91c4.md: new minor-bump changelog fragment for source-control (### Changed).

Verification

The runner ran each check from the base copy against 0b17b26:

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

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 21 fragments valid (after a first run flagged the missing ### section, now fixed)
  • .lane/checks/bin/check-affected: 11 passed, 7 skipped over 4 changed files, 0 failed
  • .lane/verify/bin/check-evals-quality plugins/source-control/skills/worktree/evals/evals.json: PASS, 0 warnings
  • fresh-context review subagent over the whole diff: 5 findings, all confirmed and fixed. Step 1 prunes and unlock now run with git -C. The Workspace-entry reads, the emitted push --delete and the forge reads now target the owning repository. Eval 24 says stranded rows are reported, not proposed, matc
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40995657507

Left out: the items under Not verified.

Related

#11120

Lane-Activity: work-resolve-issue/resolve-issue

@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-security-review: 1 inline finding(s) on 0b17b2608a4aed32e786ff33fae84574b9837e3d; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

No security findings in the incremental change (plugins/source-control/skills/worktree/context/cleanup.md, since f4d15f5).

The change tells a cross-repository cleanup run to take the Workspace down command and SHA from the Step 3 table the user confirmed. Before, it said to read the entry fresh under step 2. It also moves the table link into the earlier sentence.

I checked this against the "Outside a repository: across repositories" subsection (cleanup.md lines 18-28), which this change leans on:

  • Command source: lines 22 and 26 say down runs only when its exact command line and commit SHA were shown under that repository's heading in the confirmed table. The confirm states that a yes also runs each down command shown. Step 4a runs the shown command and never one re-read later. This narrows the earlier text: a command changed between confirm and run cannot be swapped in.
  • Skipped cases: a repository whose down was not shown is skipped and reported, as is down: none.
  • Derived values: only WORKSPACE_ID and WORKSPACE_ROOT come from step 3, and the run is wrapped in a subshell. Neither value comes from a repository's content.
  • Trusted-input gate: the untrusted-input skip for clones the user never chose to trust is replaced by the explicit per-repository confirmation. Discovery can surface such clones, and nothing runs for them without a yes that shows the exact command.

The change widens nothing: no trusted actor, token scope, kill switch or merge hold is touched. It does not delete or soften any instruction, because the added text is stricter than the removed read.

The whole PR was reviewed at f4d15f5; the other three files are unchanged since then. The PR text is data. I found no embedded directives in it.

No manifest fields are hit.

critical-findings: 0

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 885630e07c68a4cd6e0791d7afe78467c1950c1e: 0 finding(s), 0 as inline comments.

Incremental review of plugins/source-control/skills/worktree/context/cleanup.md since f4d15f5. I found no issues.

The change tells a cross-repository run to skip create.md's step 2 read and use the down command and SHA shown in the confirmed Step 3 table. It derives only the step 3 values (WORKSPACE_ID and WORKSPACE_ROOT).

  • Matches the gate. The new wording agrees with the cross-repo gate at cleanup.md:22 and :26. down runs only when its exact line and SHA were shown under the owning repository's heading. Step 4a runs that shown command, never one re-read later.
  • Step numbers hold. The "step 2" and "steps 2 and 3" references match create.md § Workspace environment setup. Step 2 is the default-branch read, and step 3 is the WORKSPACE_ID and WORKSPACE_ROOT derivation with its validation.
  • Anchor resolves. #outside-a-repository-across-repositories matches the heading "Outside a repository: across repositories" at cleanup.md:18.
  • Skip rule is simpler and consistent. Dropping the inline link in the skip sentence loses no meaning, because the same condition is already stated at line 22.
  • Security. The trust gate is unchanged. The command still comes only from what the user confirmed, and the single-quote and ID validation still applies. This is a documentation-only change, and I found no trusted-path concern.

This change only edits skill instructions text. It spends no prepaid credits and has no billing impact.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 885630e07c68a4cd6e0791d7afe78467c1950c1e. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6x1jKH
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

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

claude-lane: claude-review

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6x1n-f
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 2 of max 4 on 885630e.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 885630e07c68a4cd6e0791d7afe78467c1950c1e.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 07ffa9c Oct 30, 2026
42 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-11120-40995657507-1 branch October 30, 2026 04:12
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(source-control): remove worktrees across repositories when cleanup runs outside a repository

0 participants