Skip to content

fix(orchestrate): reject tasks that share a planned branch - #833

Open
rudycelekli wants to merge 1 commit into
cursor:mainfrom
rudycelekli:fix/merge-branch-collision-20261023
Open

rudycelekli wants to merge 1 commit into
cursor:mainfrom
rudycelekli:fix/merge-branch-collision-20261023

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

A worker named slice-a and a merge worker named merge-slice-a are both instructed to push orch//slice-a. The plan validates, and the two cloud agents overwrite one branch.

PlanSchema now rejects a plan when two tasks compute the same planned branch, and the error names that branch.

Validation: On origin/main, the new schemas test failed because PlanSchema.safeParse returned success for slice-a plus merge-slice-a. After the fix validation fails and the issue mentions orch/ship-refactor/slice-a. The rest of bun test tests/schemas.test.ts still passes. Also ran bun test --timeout 20000 in orchestrate/skills/orchestrate/scripts (pass), bunx tsc --noEmit, bunx biome check on the changed files, git diff --check, and node scripts/validate-plugins.mjs after installing ajv and ajv-formats.


Note

Low Risk
Adds plan-time validation only; no runtime or auth changes, and it prevents a known branch-collision failure mode.

Overview
Plan validation now rejects orchestration plans where two tasks would push to the same Git branch, closing a gap where a slice worker and a merge-* worker could both target orch/<root>/<slice> and overwrite each other in the cloud.

PlanSchema’s superRefine walks tasks, computes each task’s planned branch via plannedBranchForTask, and fails validation with a message naming the colliding branch and the other task. A new schema test covers the slice-a + merge-slice-a case and expects the error to mention orch/ship-refactor/slice-a.

Reviewed by Cursor Bugbot for commit 87a3df9. Bugbot is set up for automated code reviews on this repo. Configure here.

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