Skip to content

feat(repo-fleet-hygiene): sync verb — move every canonical repo to its default branch, ff-pull, park divergent work in a worktree #3992

Description

@kyle-sexton

Problem

Nothing in the marketplace moves a fleet of canonical checkouts to their default branch and fast-forwards them without risking work. repo-fleet-hygiene:audit is read-only by contract, apply only deletes merged branches and worktrees, and repo-hygiene:clean tree-batch is a destructive reset.

Proposal

A new repo-fleet-hygiene:sync skill:

  • switches each canonical checkout to the remote's current default branch (git ls-remote --symref origin HEAD) and pull --ff-onlys it;
  • parks divergent work (non-default branch with uncommitted changes, or dirty tree on the default branch) into a linked worktree via source-control's worktree-create.sh, which gains an existing-branch mode;
  • infers scope from a six-rung ladder on bare invocation (explicit args, fleet conf, conversation-named paths, ghq roots if ghq is present, cwd context, else a transparent exit 3), via a shared resolver that audit also adopts as its no-scope fallback;
  • bare invocation is a dry-run plan; mutation only behind --apply after one confirmation gate; non-fast-forward, dubious ownership, and partial stash apply are skip-and-report.

Brief and acceptance criteria: docs/topics/fleet-sync/PLAN.md on the task branch.

Out of scope (follow-ups)

  • Zero-argument scope inference for repo-hygiene:clean tree-batch (separate plugin, destructive verb).
  • Adding sync-related findings to audit-fleet.sh.

Activity

  1. added
    needs-triage
    on Sep 9, 2026
  2. added
    needs-human
    and removed
    needs-triage
    on Sep 23, 2026
  3. kyle-sexton commented on Sep 23, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during triage.

    Human-gated. Open decision: approve implementation of the locked PLAN (C4: new skill + a source-control worktree-create mode + audit's shared resolver, spans two plugins)

  4. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    MemberAuthor

    From the 2026-09-29 audit of the unattended Cursor run.

    What the audit found. The 2026-09-23 triage comment parked this issue as human-gated on "approve implementation of the locked PLAN", and no approval is recorded on the issue. PR #5129 (0.23.43) merged the sync verb anyway, under the owner's account, from the unattended run. The PLAN the audit quotes (feat/3992-fleet-sync:docs/topics/fleet-sync/PLAN.md) is not on origin, so this comment cites the audit findings, not a link. The verb that shipped also had defects and left part of the PLAN's scope out.

    Owner decision needed (implement neither option here).

    Delivered on the fix branch (draft PR #5289, Refs #3992). Stash by marker SHA; nonzero exit with the remedy; handling of worktree-helper exit codes 3/4/5; sibling-plugin probe removed; helper-resolved worktree root; exit-3 remedies; pairing gate for sync; docs.

    Still open (listed in the follow-up issue). --skip, --skip-from, --repos-from, the ancestor probe, ghq root --all, per-target rung output, and shared discovery so sync honors fleet.skip and fleet.skipAppend.

    Reopened and kept needs-human; nothing else changes until the owner answers.

  5. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    MemberAuthor

    Owner decision (2026-09-29): Option A. Ratify the sync verb shipped in 0.23.43 (#5129) and keep it; defects are fixed in #5289. Owner note: accepted the recommendation, and "decide with evidence if you want a harder check: the verb mutates every canonical checkout" is optional, not required. Next: closing this issue as completed. Follow-up #5294 (skip flags, repos-from, ancestor probe, shared discovery) is now workable on its own.

  6. removed
    needs-human
    on Sep 29, 2026
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

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions