Skip to content

repo-fleet-hygiene: the plugin reports per-repository facts a sibling already owns, and cannot perform the fleet-wide cleanup it exists for #2597

Description

@kyle-sexton

Problem

/repo-fleet-hygiene:audit is correct and does not do the job it exists for.

A full run against a real 19-repository fleet produced 869 findings across 6204 lines. Independent verification found the findings accurate — 20/20 sampled re-derived, 377/377 HIGH verified by whole-population OID join, zero false negatives across 138 unflagged branches. The collector is sound and its HIGH tier can drive deletions.

The mismatch is scope. The operator's intent is a machine-wide cleanup: find every repository, remove every worktree and branch that is provably merged, and converge the machine on one worktree convention. What the plugin delivers is a per-item read-only report that then requires 38 separate gated invocations of two other skills to act on — and several of the per-repository facts it computes are already computed, more safely, by source-control:worktree.

Evidence

Fleet: 19 canonical repositories reached via 127 supplied paths, 292 linked worktrees.

Finding kind n Confidence
reclaimable-worktree 263 MEDIUM
merged-local-branch 214 HIGH
merged-worktree 163 HIGH
local-ancestry-only 105 LOW
merged-pr-tip-drift 98 MEDIUM
merge-evidence-privacy-gated 10 UNKNOWN
worktree-nested-in-repository 9 MEDIUM
others 7 mixed

Verification (deterministic stride sampling plus whole-population offline joins):

Category Confidence Sampled Confirmed Refuted
merged-local-branch HIGH 12 12 0
merged-worktree HIGH 8 8 0
reclaimable-worktree MEDIUM 8 8 0
merged-pr-tip-drift MEDIUM 5 5 0
github-remote-moved HIGH 1 1 0

214/214 merged-local-branch OIDs still equal their branch tips. 163/163 merged-worktree OIDs equal both branch tip and worktree HEAD. Zero overlap between the two sets. Zero of the 214 collide with a worktree-attached, current, or default branch.

source-control:worktree meanwhile already provides status (inventory with a stranded-work axis computed from landed-work.sh — unpushed unlanded commits, with unknown treated exactly as stranded), cleanup [--dry-run] (prune, remove, verify, with Windows file-lock release and git branch -D emitted rather than run), and audit. Against that, this plugin's reclaimable-worktree rests on git status --porcelain emptiness alone.

The capability no skill in the fleet provides — fanning a cleanup across 19 repositories behind one gate — is the one that was actually wanted.

Proposed change

Narrow the plugin to the axis only it can serve, and delegate the rest.

Concern Owner
Worktree convention, worktree_root, creation placement source-control:worktree (already)
Per-repository worktree inventory, stranded-work classification, removal source-control:worktree status / cleanup (already)
Per-repository branch, cache, and build hygiene repo-hygiene:clean (already)
Fleet discovery — every repository on a machine, resolved to canonical checkouts repo-fleet-hygiene
Cross-repository GitHub merge evidence at fleet scale repo-fleet-hygiene
Conformance reporting against the configured worktree root repo-fleet-hygiene (reads the key; never defines it)
Fleet batching — one confirmation gate, many repositories repo-fleet-hygiene (missing today)
Merged remote branches unowned — new capability

Execution model, decided with the operator:

  • read-only by default — report and stop, preserving today's boundary as the default
  • execute — act on a previously produced manifest, as a separate explicit act
  • report-and-execute in one unit of work — the report is still produced and shown; the operator has pre-authorized the follow-through in the same invocation

The manifest is the interchange format, and it is the only dry-run available for git worktree remove and git branch -d, neither of which has a native one. An execute pass must re-derive OIDs at execution time; nothing in a report is self-refreshing.

Acceptance criteria

  • The plugin no longer computes a per-repository worktree-disposability verdict of its own; it delegates to source-control:worktree status or consumes its classification.
  • A fleet run can hand off cleanup for N repositories behind one confirmation, not 2N.
  • Read-only remains the default mode; execution requires an explicit act or an explicit single-transaction flag.
  • The report states a per-repository verdict, not only per-item findings.

Child issues

Filed separately per this repository's one-defect-per-issue convention. This issue is the shared context they reference.

repo-fleet-hygiene

source-control — the convention layer this plugin reads but must not define

Activity

  1. added
    needs-triage
    on Aug 14, 2026
  2. 12 remaining items

  3. kyle-sexton commented on Aug 15, 2026

    @kyle-sexton
    MemberAuthor

    Reopening — two of four acceptance criteria are met; the executing verb this epic exists for does not exist

    Closed as COMPLETED, but the plugin still ships only skills/audit and skills/setup, and --apply-plan is explicitly read-only (audit-fleet.sh:443–453, and the flag "cannot be combined with audit discovery flags" — it renders, it does not act).

    Walking this issue's own acceptance criteria against origin/main at b7e56070 (0.19.1):

    Criterion State
    The plugin no longer computes a per-repository worktree-disposability verdict of its own; it delegates MET — reclaimable-worktree retired, replaced by worktree-status-handoff routing to /source-control:worktree status (0.14.0, a2f34207). Done with the expensive, correct fix rather than a rename.
    The report states a per-repository verdict, not only per-item findings MET — rollup shipped in 0.18.0, restored in 0.19.0.
    A fleet run can hand off cleanup for N repositories behind one confirmation, not 2N NOT MET — the action-plan JSON exists and is correctly ordered (delete-merged-local-branches before cleanup-worktrees), but nothing consumes it. The plan names invocations; a human still runs them one at a time.
    Read-only remains the default; execution requires an explicit act or a single-transaction flag NOT MET — there is no execution mode to be default-off from. Read-only is not a chosen posture here, it is the only posture.

    What landed is F11's prerequisite, not F11. That distinction matters because the prerequisite was the hard part and it is genuinely done:

    • the machine-readable plan exists, closing the "6,204 lines of prose, no manifest" gap this epic named;
    • the stranded-work axis was delegated to the sibling that computes it properly, which was the stated hard blocker on building an executing verb — an executor built before that fix would have deleted unlanded commits.

    So the remaining work is now unblocked for the first time, which is an argument for keeping this open rather than closing it as delivered.

    What remains

    A sibling verb — repo-fleet-hygiene:clean or :apply — with its own script, its own allowed-tools grant, and its own argv allowlist, consuming the existing action-plan JSON behind one batch-wide gate.

    Note the permission-surface constraint that shaped the original recommendation and still holds: allowed-tools grants but cannot restrict, and the existing grant Bash(…/audit-fleet.sh:*) matches any arguments — so adding an execution flag to audit-fleet.sh would widen the skill's authority with no change to its permission surface. That is why execution belongs in a new verb rather than a flag on the auditor, and it is consistent with fleet precedent (setup check|apply, clean --dry-run/--apply, worktree cleanup --dry-run).

    One cross-plugin dependency, which may be the real reason to split rather than simply reopen: the audit's largest actionable category is merged-local-branch, and its downstream verb still refuses to batch — plugins/repo-hygiene/skills/clean/SKILL.md:177 states "branch audit/deletion is not batched (interactive per-branch deletion can't sit behind one gate)". Either that changes, or the new verb owns batched branch deletion itself. Whichever is chosen, :audit must not be weakened to accommodate it.

    Suggested disposition: reopen as the epic (done here), or split into (a) the executing verb and (b) the repo-hygiene:clean batching decision, and close this once both are tracked. Either is fine; closing it as COMPLETED while neither exists is not.

  4. added a commit that references this issue on Aug 15, 2026
    f93e32c
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

    needs-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions