From c82a7b1c0684450fb68c0464868a296ab4b9bc1e Mon Sep 17 00:00:00 2001 From: janpeter visser Date: Sat, 2 May 2026 18:01:08 +0200 Subject: [PATCH] =?UTF-8?q?feat(schema):=20Task.repo=5Furl=20=E2=80=94=20c?= =?UTF-8?q?ross-repo=20override=20for=20agent=20worktree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a task targets a different repo than its parent product (e.g. an MCP-server task tracked under the main product's PBI), product.repo_url points to the wrong place. Result observed in story 'Verify-gate' batch (2 May): agent's gate-task work failed to push because product was Scrum4Me but the code lives in scrum4me-mcp. Add optional `Task.repo_url` (TEXT, nullable). scrum4me-mcp's `resolveRepoRoot` will read this in a follow-up PR — null falls back to product.repo_url, preserving current behaviour for the 99% case. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../20260502175000_add_task_repo_url/migration.sql | 4 ++++ prisma/schema.prisma | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 prisma/migrations/20260502175000_add_task_repo_url/migration.sql diff --git a/prisma/migrations/20260502175000_add_task_repo_url/migration.sql b/prisma/migrations/20260502175000_add_task_repo_url/migration.sql new file mode 100644 index 0000000..779dc9f --- /dev/null +++ b/prisma/migrations/20260502175000_add_task_repo_url/migration.sql @@ -0,0 +1,4 @@ +-- AlterTable: optional repo_url override on Task. Used when an MCP-server +-- task is tracked under a different product's PBI (cross-repo support). +-- Falls back to product.repo_url when NULL. +ALTER TABLE "tasks" ADD COLUMN "repo_url" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1c9c121..599cdc2 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -254,6 +254,11 @@ model Task { status TaskStatus @default(TO_DO) verify_only Boolean @default(false) verify_required VerifyRequired @default(ALIGNED_OR_PARTIAL) + // Override product.repo_url for branch/worktree/push purposes. Set when + // a task targets a different repo than its parent product (e.g. an + // MCP-server task tracked under the main product's PBI). Falls back to + // product.repo_url when null. + repo_url String? created_at DateTime @default(now()) updated_at DateTime @updatedAt claude_questions ClaudeQuestion[]