Files
PaperClipAI/doc
992d687608 feat(workspaces): pin PR-prep issues to an exact existing branch
PR-preparation tasks could never attach an isolated execution workspace
on a pre-existing branch: child-issue creation inherited the source
issue's workspace binding (often the shared primary checkout), and the
worktree runtime only knew template-derived branch names, silently
creating a fresh branch off base when the rendered name did not exist.

Add workspaceStrategy.existingBranch as the smallest explicit contract:

- Shared type + issue validator accept the pin only with isolated mode
  and a git_worktree strategy, reject branchTemplate alongside it, and
  validate the branch-name shape.
- realizeExecutionWorkspace gains an exact-branch mode: verify the
  branch exists (fail closed otherwise), reuse a registered worktree
  that already has it checked out (including legacy .worktrees/ paths),
  otherwise attach it under the managed worktree parent without -b.
  Exact mode never creates, renames, fast-forwards, resets, or
  reconciles the requested branch, and never falls back to
  project_primary or a derived branch.
- Dispatch ignores an inherited reuse_existing workspace binding whose
  recorded branch does not equal the pinned branch and realizes the
  pinned branch instead.
- scripts/repair-pr-prep-workspace-attachment.mjs converts stranded
  PR-prep issues to the new contract via the company-scoped API without
  touching any git branch.

Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 08:19:06 +00:00
..
2026-02-16 14:25:00 -06:00