scrum4me-mcp/__tests__/git
Madhura68 d2f43fe8e6 PBI-49: review-fixes — primary_worktree order, idea-claim rollback, sprint mark-ready fallback
Three findings from PBI-47 review:

P1 — primary_worktree_path scheiden van lock-volgorde
  setupProductWorktrees acquired locks in alphabetical order (deadlock prevention)
  but also returned worktrees in that order, so worktrees[0] could point at a
  secondary product when its id sorted before the primary's. Lock-acquire stays
  sorted; output now preserves caller's input order so worktrees[0] is always
  the primary.

P1 — Idea-claim rollback bij worktree setup failure
  setupProductWorktrees runs after tryClaimJob has already flipped the job to
  CLAIMED. A failure in lock-acquire/git-fetch/reset/sync left the job hanging
  until the 30-min stale-reset and the lock-map populated. Wrapped in try/catch
  with releaseLocksOnTerminal + rollbackClaim mirror of the task-pad behaviour.

P2 — SPRINT mark-ready fallback when last task didn't push
  The mark-ready path used updated.pr_url, which is null when the closing task
  was verify-only or had no diff. Now falls back to a Prisma findFirst on the
  SprintRun's earliest job with pr_url IS NOT NULL.

Tests: 31 files, 243 passing (incl. new input-order regression for setupProductWorktrees).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 11:02:23 +02:00
..
file-lock.test.ts PBI-9 + PBI-47: worktree foundation, product-worktrees, P0 fixes, PAUSED flow 2026-05-06 21:09:48 +02:00
job-locks.test.ts PBI-49: review-fixes — primary_worktree order, idea-claim rollback, sprint mark-ready fallback 2026-05-07 11:02:23 +02:00
pr-enable-auto-merge.test.ts PBI-9 + PBI-47: worktree foundation, product-worktrees, P0 fixes, PAUSED flow 2026-05-06 21:09:48 +02:00
pr.test.ts PBI-8 (vervolg): Sprint-aware branch + SPRINT-mode draft-PR 2026-05-06 17:15:04 +02:00
push.test.ts feat: add pushBranchForJob helper (src/git/push.ts) 2026-05-01 11:57:14 +02:00
worktree.test.ts feat(routing): cross-repo task routing + orphan-branch cleanup (#17) 2026-05-02 18:07:57 +02:00