PBI-47: schema, pause_context Zod, resumePausedSprintRunAction, PAUSED-banner UI (#137)

Scrum4Me-side counterpart of scrum4me-mcp@f7f5a48 (PBI-9 + PBI-47):

- prisma migration: ClaudeJob.{base_sha,head_sha} + SprintRun.pause_context
- lib/pause-context.ts: Zod schema + parsePauseContext + pauseReasonLabel
  helper; single source of truth for the JSON pause_context shape produced
  by the mcp sprint-run flow (MERGE_CONFLICT pause)
- actions/sprint-runs.ts: resumePausedSprintRunAction — separate from the
  existing FAILED-resume flow, requires SprintRun.status === PAUSED, closes
  the linked ClaudeQuestion, clears pause_context, sets RUNNING/QUEUED based
  on whether a claim is still active
- components/sprint/sprint-run-controls.tsx: PAUSED banner with reason label,
  PR link, conflict-files list (max 5 + "+N more"), Resume button with
  confirm() guard
- app/(app)/products/[id]/sprint/page.tsx: load pause_context from active
  SprintRun and pass through to SprintRunControls

All MD3 tokens (warning-container, on-warning-container, primary). No raw
Tailwind utility colours.

Tests: 532 passing across 72 files (Scrum4Me side).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-05-06 22:17:11 +02:00 committed by GitHub
parent 77617e89ac
commit d3e79021c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 173 additions and 2 deletions

View file

@ -0,0 +1,10 @@
-- Add base_sha + head_sha to ClaudeJob (per-job verify scope + merge-guard).
-- Add pause_context to SprintRun (rich PAUSED-state for merge-conflicts).
-- All nullable so legacy rows remain valid; new code-paths set them.
-- AlterTable
ALTER TABLE "claude_jobs" ADD COLUMN "base_sha" TEXT,
ADD COLUMN "head_sha" TEXT;
-- AlterTable
ALTER TABLE "sprint_runs" ADD COLUMN "pause_context" JSONB;

View file

@ -318,6 +318,7 @@ model SprintRun {
failure_reason String?
failed_task Task? @relation("SprintRunFailedTask", fields: [failed_task_id], references: [id], onDelete: SetNull)
failed_task_id String?
pause_context Json?
created_at DateTime @default(now())
updated_at DateTime @updatedAt
jobs ClaudeJob[]
@ -389,6 +390,8 @@ model ClaudeJob {
cache_read_tokens Int?
cache_write_tokens Int?
plan_snapshot String?
base_sha String?
head_sha String?
branch String?
pr_url String?
summary String?