Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

fix: orchestrator owns STATE.md/ROADMAP.md writes in parallel worktree mode - #1599

Merged
trek-e merged 2 commits into
mainfrom
fix/worktree-shared-artifact-overwrite-1571
Apr 3, 2026
Merged

trek-e merged 2 commits into
mainfrom
fix/worktree-shared-artifact-overwrite-1571

Conversation

@trek-e

@trek-e trek-e commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Closes #1571

What

In parallel worktree mode, the orchestrator now owns all STATE.md and ROADMAP.md writes after each wave; worktree executor agents only create their plan-local SUMMARY.md.

Why

Each worktree agent was independently writing STATE.md and ROADMAP.md; the last merge back to main silently overwrote earlier agents' updates, leaving planning artifacts incomplete.

How

  • Removed STATE.md and ROADMAP.md from the worktree executor agent <success_criteria> and updated the <objective> to explicitly prohibit those writes.
  • Added step 4.6 in execute_waves: after each wave's worktrees are merged back, the orchestrator runs roadmap update-plan-progress for every completed plan and then state update-position once — a single writer, no conflicts.
  • Added a separate <success_criteria> block for sequential mode (USE_WORKTREES=false) that retains the STATE.md/ROADMAP.md update requirements, since there is no conflict risk when agents run one at a time.
  • Added tests/execute-phase-worktree-artifacts.test.cjs with 8 tests covering all four behaviours (worktree criteria absent, sequential criteria present, post-wave orchestrator commands present).

Testing

  • N/A (not runtime-specific)

Checklist

  • Issue linked (Closes #1571)
  • Follows GSD style
  • Existing tests pass

Breaking Changes

None

@trek-e
trek-e requested a review from glittercowboy as a code owner April 3, 2026 16:05
@trek-e
trek-e force-pushed the fix/worktree-shared-artifact-overwrite-1571 branch from 7b7d21f to 52926fc Compare April 3, 2026 16:18
@trek-e
trek-e merged commit ec7bf04 into main Apr 3, 2026
6 checks passed
@trek-e
trek-e deleted the fix/worktree-shared-artifact-overwrite-1571 branch April 6, 2026 04:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Worktree agents overwrite shared planning artifacts

1 participant