scrum4me-mcp/src/tools
Janpeter Visser 84c194d4e5
fix(cross-repo): per-repo worktree-branch + PR resolutie (IDEA-062) (#49)
Cross-repo sprints (sprint-product = repo X, maar een taak heeft
task.repo_url naar repo Y) faalden op twee plekken omdat sprint-brede
beslissingen werden toegepast op per-repo git-state.

1. createWorktreeForJob (src/git/worktree.ts)
   reuseBranch wordt sprint-breed bepaald in wait-for-job.ts. De eerste
   job die repo Y target krijgt reuseBranch=true terwijl de branch daar
   nooit is aangemaakt -> `git worktree add <path> <branch>` faalt met
   "invalid reference" -> job vast, worker UNHEALTHY. Idem na een
   container-recreate (clone is dan vers).
   Fix: 3-weg fallback in het reuseBranch-pad:
   - lokale branch bestaat   -> hergebruik
   - alleen op origin        -> recreate lokaal vanaf origin/<branch>
   - nergens                 -> fresh vanaf baseRef
   Lost ook het container-recreate-verlies op.

2. maybeCreateAutoPr (src/tools/update-job-status.ts)
   De sprint/story sibling-lookup voor pr_url-hergebruik filterde niet
   op repo. Een repo-Y-job erfde de pr_url van een repo-X-sibling ->
   job.pr_url wees naar de verkeerde repo en er werd nooit een PR voor
   de repo-Y-branch aangemaakt (branch wel gepusht, maar PR-loos).
   Fix: siblings groeperen per repo-bucket ((task.repo_url ?? null));
   alleen een sibling uit dezelfde bucket levert een herbruikbare
   pr_url. Geldt voor SPRINT- en STORY-mode. createPullRequest zelf was
   al repo-correct (gh pr create draait in de worktree).

Tests: 3 nieuwe in worktree.test.ts (reuse-local / recreate-from-origin
/ fresh-fallback), 2 nieuwe in update-job-status-auto-pr.test.ts
(cross-repo story + sprint). update-job-status-mock omgezet naar
findMany. Alle 373 tests groen, build groen.

package-lock.json: version 0.7.0 -> 0.8.0 (was niet mee-gesynced in de
v0.8.0-bump commit 55fa133).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 19:16:15 +02:00
..
ask-user-question.ts PBI-55: ask-user-question – triggerPush na claudeQuestion.create 2026-05-07 21:37:20 +02:00
cancel-question.ts feat(ST-1102): add 4 question-channel MCP tools (M11) 2026-04-28 01:00:59 +02:00
check-queue-empty.ts feat: add check_queue_empty tool (v0.3.0) 2026-05-03 17:57:17 +02:00
cleanup-my-worktrees.ts PBI-9 + PBI-47: worktree foundation, product-worktrees, P0 fixes, PAUSED flow 2026-05-06 21:09:48 +02:00
create-pbi.ts feat: auto-generate codes for PBI/Story/Task on create 2026-05-04 16:14:36 +02:00
create-sprint.ts feat(PBI-12): create_sprint + update_sprint MCP-tools (#47) 2026-05-11 21:37:05 +02:00
create-story.ts feat: IDEA_REVIEW_PLAN-wiring + create_story sprint_id (v0.8.0) (#48) 2026-05-14 16:30:17 +02:00
create-task.ts feat(create_task): optionele repo_url voor cross-repo tasks 2026-05-06 04:16:31 +02:00
get-claude-context.ts chore: sync schema + adapt to ACTIVE→OPEN, COMPLETED→CLOSED, EXCLUDED-task 2026-05-09 13:39:13 +02:00
get-idea-context.ts feat: M12 idea-job support — version 0.6.0 2026-05-04 22:12:36 +02:00
get-question-answer.ts feat(ST-1102): add 4 question-channel MCP tools (M11) 2026-04-28 01:00:59 +02:00
get-worker-settings.ts feat(M13): get_worker_settings + worker_heartbeat tools (v0.7.0) 2026-05-06 04:23:31 +02:00
health.ts feat: M12 idea-job support — version 0.6.0 2026-05-04 22:12:36 +02:00
job-heartbeat.ts PBI-50 F3: nieuwe MCP-tools voor SPRINT_IMPLEMENTATION-flow 2026-05-07 12:40:18 +02:00
list-open-questions.ts feat(ST-1102): add 4 question-channel MCP tools (M11) 2026-04-28 01:00:59 +02:00
list-products.ts feat(ST-705): read tools — health, list_products, get_claude_context 2026-04-26 23:04:51 +02:00
log-commit.ts chore: sync schema with scrum4me@43a4294 + write metadata in log tools 2026-04-26 23:44:33 +02:00
log-idea-decision.ts feat: M12 idea-job support — version 0.6.0 2026-05-04 22:12:36 +02:00
log-implementation.ts chore: sync schema with scrum4me@43a4294 + write metadata in log tools 2026-04-26 23:44:33 +02:00
log-test-result.ts chore: sync schema with scrum4me@43a4294 + write metadata in log tools 2026-04-26 23:44:33 +02:00
mark-pbi-pr-merged.ts feat(mcp): set_pbi_pr + mark_pbi_pr_merged tools voor PBI-PR-gating (#18) 2026-05-03 16:25:53 +02:00
set-pbi-pr.ts feat(mcp): set_pbi_pr + mark_pbi_pr_merged tools voor PBI-PR-gating (#18) 2026-05-03 16:25:53 +02:00
update-idea-grill-md.ts feat: M12 idea-job support — version 0.6.0 2026-05-04 22:12:36 +02:00
update-idea-plan-md.ts feat: M12 idea-job support — version 0.6.0 2026-05-04 22:12:36 +02:00
update-idea-plan-reviewed.ts feat: IDEA_REVIEW_PLAN-wiring + create_story sprint_id (v0.8.0) (#48) 2026-05-14 16:30:17 +02:00
update-job-status.ts fix(cross-repo): per-repo worktree-branch + PR resolutie (IDEA-062) (#49) 2026-05-14 19:16:15 +02:00
update-sprint.ts feat(PBI-12): create_sprint + update_sprint MCP-tools (#47) 2026-05-11 21:37:05 +02:00
update-task-execution.ts PBI-50 F3: nieuwe MCP-tools voor SPRINT_IMPLEMENTATION-flow 2026-05-07 12:40:18 +02:00
update-task-plan.ts feat(ST-706): task write tools — update_task_status and update_task_plan 2026-04-26 23:05:49 +02:00
update-task-status.ts PBI-50 F3: nieuwe MCP-tools voor SPRINT_IMPLEMENTATION-flow 2026-05-07 12:40:18 +02:00
verify-sprint-task.ts PBI-50 F3: nieuwe MCP-tools voor SPRINT_IMPLEMENTATION-flow 2026-05-07 12:40:18 +02:00
verify-task-against-plan.ts PBI-9 + PBI-47: worktree foundation, product-worktrees, P0 fixes, PAUSED flow 2026-05-06 21:09:48 +02:00
wait-for-job.ts feat: IDEA_REVIEW_PLAN-wiring + create_story sprint_id (v0.8.0) (#48) 2026-05-14 16:30:17 +02:00
worker-heartbeat.ts feat(M13): get_worker_settings + worker_heartbeat tools (v0.7.0) 2026-05-06 04:23:31 +02:00