Skip to content

fix(worktrees): honor cleanup rules for closed threads - #905

Merged
nixuuu merged 2 commits into
devfrom
fix/archived-worktree-cleanup
Nov 17, 2026
Merged

nixuuu merged 2 commits into
devfrom
fix/archived-worktree-cleanup

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Archived worktrees remained on disk because ignored dependencies/build output counted as local changes, and cleanup still required manual confirmation after squash merges or remote branch deletion.

Exclude Git-ignored files from cleanup status. Enabling Archived threads or Deleted threads authorizes removing the checkout and discarding local files once all sharing threads meet that rule, even when Git reports unpushed commits. Preserve the local branch whenever ordinary local changes or unpushed commits exist. Other cleanup rules and manual removal retain their confirmation requirements.

Validate closed-thread authorization under the reservation transaction's locks before persisting a removal command. Block unarchive/restore during removal, keep worker activity/HEAD/path checks, and stop treating paused goals of closed threads as active work. Update settings copy and the worktree documentation.

Fixes: #82

Validation

  • 59 affected integration tests passed across worktree lifecycle, closed-thread cleanup, squash/rebase cleanup, automation and archive resource cleanup. Corrected lifecycle and automation tests were rerun selectively; passing files with unchanged inputs were reused. The check:tmp runs left no test temporary files.
  • Gateway, worker, mobile and integration package typechecks passed. Lint passed on all edited source/test files; edited supported files were formatted.
  • Web settings inspected at 1440 px and 390 px in light/dark, with no horizontal overflow. Native layouts were unchanged; mobile copy was reviewed and typechecked.
  • Full generation, repository checks and builds remain with CI. No protobuf or migration changes.

Copy audit (§8)

  • 1–2: Archived/Deleted descriptions now explicitly say “discard local files”; mobile “Settled threads” becomes “Archived threads”. Changed sentences use plain English, sentence case, glossary terms and stay within length limits.
  • 3–4: The mobile cleanup confirmation now asks “Clean up worktrees?” and states the actual effect. The new reopen error explains the blocker and retry action.
  • 5–8: Removed misleading “Local changes stay” and blanket local-work protection promises. No empty-state changes, repeated effects, new jargon or humor.
  • 9–10: Fixed setting descriptions inspected in the browser at desktop/phone widths and light/dark; no changed text interpolates user names. Meaning is explicit text and does not rely on color or icons.

@nixuuu
nixuuu enabled auto-merge (squash) November 17, 2026 01:51
Ignore Git-ignored files during cleanup scans. Enabled archived/deleted thread rules authorize discarding local files and removing the checkout despite unpushed or squash-diverged commits, while retaining its local branch. Recheck that authorization atomically before persisting removal and fence reopening against cleanup.

Fixes: #82
@nixuuu
nixuuu force-pushed the fix/archived-worktree-cleanup branch from cc56317 to 79144c7 Compare November 17, 2026 02:11
@nixuuu
nixuuu merged commit 7163ed6 into dev Nov 17, 2026
15 checks passed
@nixuuu
nixuuu deleted the fix/archived-worktree-cleanup branch November 17, 2026 02:18
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