scrum4me-mcp/__tests__
Madhura68 458b7a7d45 PBI-57: 'skipped' no-op exit + cascade preserves original error
When verify_task_against_plan returns EMPTY because the requested changes
already live in origin/main (parallel work, earlier PR, race between
siblings), the worker had no clean exit: update_job_status only accepted
running|done|failed. 'failed' triggered the PBI fail-cascade which then
overwrote the error column with 'cancelled_by_self' and cancelled all
sibling tasks of the PBI — see Scrum4Me job cmovkur8 / T-695 for the
reference incident.

This change introduces a fourth status and tightens the cascade:

ST-1273 — 'skipped' exit in update_job_status (T-706 + T-707)
- src/tools/update-job-status.ts: status enum + DB_STATUS_MAP +
  resolveNextAction now include 'skipped'. cleanupWorktreeForTerminalStatus
  signature widened to ('done'|'failed'|'skipped'); SKIPPED uses keepBranch
  semantics identical to FAILED (no push, no branch keep). New input guard:
  'skipped' is only valid for TASK_IMPLEMENTATION jobs and requires a
  non-empty error (≥10 chars) explaining the reason — it bypasses the
  verify-gate, the auto-PR, the SprintRun finalize/fail paths and the
  PBI fail-cascade. Locks are still released on terminal exit.
- Tool description spells out when to pick 'skipped' so MCP clients see it.
- New __tests__/update-job-status-skipped.test.ts: resolveNextAction with
  'skipped' (wait_for_job_again / queue_empty), and cleanupWorktreeForTerminalStatus
  with status='skipped' (keepBranch=false even with a branch reported,
  defers cleanup with active siblings).

ST-1274 — cascade ignores SKIPPED + appends trace (T-708 + T-709)
- src/cancel/pbi-cascade.ts: runCascade reads job.status, returns EMPTY
  when status === 'SKIPPED' (no sibling cancel). Trace persistence now
  reads the current error first and writes `${original}\n---\n${trace}`
  (truncated at 1900 chars), so the original failure cause is preserved
  for forensics instead of being overwritten.
- New cases in __tests__/cancel-pbi-cascade.test.ts: SKIPPED entry-guard
  (no findMany / updateMany / update), original error preserved with
  trace appended after '---', trace-only fallback when no original
  error, 1900-char truncation keeps the head of the original.

All 282 scrum4me-mcp tests pass; tsc build clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 17:10:02 +02:00
..
flow PBI-9 + PBI-47: worktree foundation, product-worktrees, P0 fixes, PAUSED flow 2026-05-06 21:09:48 +02:00
git PBI-49: review-fixes — primary_worktree order, idea-claim rollback, sprint mark-ready fallback 2026-05-07 11:02:23 +02:00
scripts feat: per-job token-usage capture via PostToolUse hook 2026-05-06 07:53:36 +02:00
verify PBI-9 + PBI-47: worktree foundation, product-worktrees, P0 fixes, PAUSED flow 2026-05-06 21:09:48 +02:00
cancel-pbi-cascade.test.ts PBI-57: 'skipped' no-op exit + cascade preserves original error 2026-05-07 17:10:02 +02:00
check-queue-empty.test.ts feat: add check_queue_empty tool (v0.3.0) 2026-05-03 17:57:17 +02:00
cleanup-my-worktrees.test.ts PBI-9 + PBI-47: worktree foundation, product-worktrees, P0 fixes, PAUSED flow 2026-05-06 21:09:48 +02:00
get-claude-context-filter.test.ts PBI-8: Sprint-flow MCP-orkestratie + verifier-fix 2026-05-06 16:59:58 +02:00
job-heartbeat.test.ts PBI-50 F5: tests voor SPRINT_IMPLEMENTATION-tools 2026-05-07 12:53:04 +02:00
mark-pbi-pr-merged.test.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.test.ts feat(mcp): set_pbi_pr + mark_pbi_pr_merged tools voor PBI-PR-gating (#18) 2026-05-03 16:25:53 +02:00
tasks-status-update.test.ts PBI-8: Sprint-flow MCP-orkestratie + verifier-fix 2026-05-06 16:59:58 +02:00
update-job-status-auto-pr.test.ts PBI-8 (vervolg): Sprint-aware branch + SPRINT-mode draft-PR 2026-05-06 17:15:04 +02:00
update-job-status-gate.test.ts feat(gate): verify_required levels — ALIGNED/ALIGNED_OR_PARTIAL/ANY (#16) 2026-05-02 17:55:06 +02:00
update-job-status-next-action.test.ts feat: worker presence layer + batch-loop docs (#7) 2026-05-01 16:39:26 +02:00
update-job-status-push.test.ts feat: integrate push into update_job_status DONE transition 2026-05-01 12:00:30 +02:00
update-job-status-skipped.test.ts PBI-57: 'skipped' no-op exit + cascade preserves original error 2026-05-07 17:10:02 +02:00
update-job-status-sprint-gate.test.ts PBI-50 F5: tests voor SPRINT_IMPLEMENTATION-tools 2026-05-07 12:53:04 +02:00
update-job-status-worktree.test.ts feat: branch-per-story + worktree-defer + verify EMPTY edge-cases (#12) 2026-05-01 17:04:54 +02:00
update-task-execution.test.ts PBI-50 F5: tests voor SPRINT_IMPLEMENTATION-tools 2026-05-07 12:53:04 +02:00
verify-plan.test.ts test+docs: verify-plan tests and README for verify_task_against_plan 2026-04-30 19:36:43 +02:00
verify-sprint-task.test.ts PBI-50 F5: tests voor SPRINT_IMPLEMENTATION-tools 2026-05-07 12:53:04 +02:00
verify-task-against-plan.test.ts feat: verify_task_against_plan calls classifyDiffAgainstPlan + saves verify_result to DB 2026-05-01 12:59:17 +02:00
wait-for-job-branch-resolution.test.ts PBI-8 (vervolg): Sprint-aware branch + SPRINT-mode draft-PR 2026-05-06 17:15:04 +02:00
wait-for-job-snapshot.test.ts feat(M13): retry-tracking — stale CLAIMED jobs → QUEUED (retry_count++) or FAILED (≥2 retries) 2026-05-01 13:18:59 +02:00
wait-for-job-worktree.test.ts PBI-8 (vervolg): Sprint-aware branch + SPRINT-mode draft-PR 2026-05-06 17:15:04 +02:00