From a85fae73a589e0d20eb6702d6879a767530a88fd Mon Sep 17 00:00:00 2001 From: cheedo Date: Thu, 1 Jan 2026 18:42:04 -0800 Subject: [PATCH] refactor(formula): Move cleanup-worktrees earlier in sync workflow (gt-gqiwm) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reordered mol-sync-workspace.formula.toml so cleanup-worktrees runs after handle-dirty-state instead of after run-tests. This is more logical: worktree cleanup is housekeeping that should happen during workspace prep, not after verification steps. New execution order: 1. assess-state 2. handle-dirty-state 3. cleanup-worktrees ← moved here 4. sync-git 5. sync-beads → run-doctor → verify-build → run-tests 6. generate-report → signal-ready 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .beads/formulas/mol-sync-workspace.formula.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.beads/formulas/mol-sync-workspace.formula.toml b/.beads/formulas/mol-sync-workspace.formula.toml index ac9d7f4f..ee8fb5cf 100644 --- a/.beads/formulas/mol-sync-workspace.formula.toml +++ b/.beads/formulas/mol-sync-workspace.formula.toml @@ -132,7 +132,7 @@ Recent stashes may contain valuable WIP - preserve or commit. [[steps]] id = "sync-git" title = "Sync with git remote" -needs = ["handle-dirty-state"] +needs = ["cleanup-worktrees"] description = """ Fetch and rebase onto current main. @@ -374,7 +374,7 @@ However, they must be tracked. [[steps]] id = "cleanup-worktrees" title = "Clean up stale worktrees" -needs = ["run-tests"] +needs = ["handle-dirty-state"] description = """ Remove orphaned worktrees from cross-rig work. @@ -408,7 +408,7 @@ Check with `gt worktree list` if available. [[steps]] id = "generate-report" title = "Generate sync report" -needs = ["cleanup-worktrees"] +needs = ["run-tests"] description = """ Summarize sync results for broadcast response.