Skip to content

fix(goal): worktree removers keep unique work, shared guard - #1263

Merged
tieubao merged 3 commits into
masterfrom
l312-removers
Dec 3, 2026
Merged

tieubao merged 3 commits into
masterfrom
l312-removers

Conversation

@tieubao

@tieubao tieubao commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

What

Two more places that remove a worktree now keep unique work the way wrap apply has since the ignored-files fix.

  1. The guard (unique ignored files, uncommitted changes, hidden index flags, an initialized submodule) moved out of lib/wrap/wrap-apply.sh into a shared lib/wrap/wt-guard.sh, unchanged.
  2. lib/goal/wt.sh and lib/queue/orchestrate.sh (wave worktrees) run it before any removal; a removal that would lose unique work refuses and says why.
  3. lib/goal/wt.sh releases the registry claim only after the remove succeeds.
  4. Seven shellcheck warnings in orchestrate.sh cleared, no behavior change.
    Board writeback keeps its old behavior: its scratch worktree holds only its own edit.

Demo

A goal worktree with a unique ignored file: deleted before, kept with a reason after.

Proof

docs/verification/worktree-removers-ignored-guard.md

  • Verdict: works: the goal and wave removers keep unique work, and clean worktrees are still removed.
  • Proof: tests/test-worktree-removers-ignored.sh red on master, 107/107 after on bash 3.2 and 5; 90/90 affected suites green, including test-wrap-apply and test-wrap-apply-ignored 211/211; planted faults red; a fresh review confirmed the extraction is behavior-neutral, and both of its blockers were fixed.
  • Risk: a goal or wave run can now stop on a worktree holding unique files instead of deleting them; undo with a revert.
  • Needs Han: nothing.

Bookkeeping

no-board-row: leftover audit slice tracked on the devkit leftovers item

@tieubao
tieubao merged commit e7da794 into master Dec 3, 2026
46 of 55 checks passed
@tieubao
tieubao deleted the l312-removers branch December 3, 2026 03: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.

1 participant