Skip to content

Crews: one Inbox approval for worktrees with unfinished work #749

Closed

Description

@bryantderosier

Item 9 of 9 in the Crews: organic teamwork milestone.

The problem

After #748, archiving a Crew removes every worktree that's safe to remove and keeps the rest. Those kept worktrees have uncommitted changes or commits that never merged. Some of that is work I want, and some is a dead end, but either way I have to find each one and decide by hand.

Where this sits

This is the second half of "Workspace cleanup" in Crews proposal v2 (25 October). Worktrees with uncommitted or unmerged work need one consolidated Inbox approval before removal, never a prompt per worktree. The summary screen isn't designed yet, so design comes first. It builds on the ownership record and the archive result from #748.

What we already have

Proposal

  • When an archive keeps any J5-created worktrees, J5 files one Inbox item for that archive.
  • The item lists every kept worktree with what removing it would discard. I can remove all, remove some, or keep all.
  • Before removing an approved worktree, J5 checks it again and skips any whose work changed.

Acceptance criteria

  • The cleanup summary is designed first, in dark mode, with variations. The approved mockup is saved as artifacts/design/ui/09-worktree-cleanup.html and linked here before building. It covers a short list, a long list, the result after deciding, and a partial failure.
  • An archive that keeps one or more J5-created worktrees files exactly one Inbox item, however many threads and worktrees it covered. Archiving a Crew of five seats is one item, not five.
  • Each worktree in the item shows:
    • the thread and branch;
    • the number of uncommitted files;
    • the number of commits not on the default branch;
    • its PR link, when it has one.
  • I can remove all listed worktrees, remove the ones I pick, or keep all. Keeping all clears the item and changes nothing.
  • Removal keeps the branch, so unmerged commits survive. The item says that removing discards uncommitted changes.
  • Before removing each approved worktree, J5 rechecks it. If anything changed since the item was filed (new commits or changes, now shared with an unarchived thread, its thread was unarchived, or a live session is using it), that worktree is skipped and reported.
  • The item resolves once. Answering on one device clears it on the others, and a second answer is refused with a message.
  • After deciding, the item shows what was removed, what was kept, and anything skipped or failed, with the reason.
  • Only a person can answer the item. Agents can't approve it through any tool.
  • A worktree removed or recreated some other way while the item is open is skipped without error.
  • Focused tests cover:
    • one item for many worktrees;
    • remove all;
    • remove some;
    • keep all;
    • a recheck that skips a changed worktree;
    • a second answer refused;
    • a removal failure.
  • archive-flow.md and inbox.md are rewritten for the cleanup item.

Out of scope

  • Deleting branches or closing PRs.
  • Restoring a removed worktree's uncommitted changes. Removal says up front that they're discarded.
  • Mobile. There's no J5 Inbox on mobile.

Activity

  1. added
    enhancement
    on Oct 27, 2026
  2. bryantderosier commented on Oct 28, 2026

    @bryantderosier
    CollaboratorAuthor

    The worktree cleanup mockup is approved: artifacts/design/ui/09-worktree-cleanup.html (saved in the J5 artifacts store, not in the repo).

    What I decided:

    • One Inbox item per archive, filed by J5 with an FYI urgency. It lists only worktrees with uncommitted files or unmerged commits, and says removal keeps the branch and discards uncommitted changes.
    • No rows are selected by default. The footer is Keep all, Select all (disabled once every row is picked) and Remove selected (n).
    • A long list shows five rows (uncommitted work first) and "Show N more".
    • After I decide, the item stays in place as a result block (removed, kept, skipped, failed, each with its reason), then moves to the Answered shelf. There's no retry.
    • Only an Owner can answer it, and agents get no tool for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions