From a3af2dda63531149a940931ca614d85ea9b9727e Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Thu, 30 Apr 2026 19:13:07 +0200 Subject: [PATCH 1/3] feat: add plan_snapshot field to ClaudeJob schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nullable String? column on claude_jobs captures the task's implementation_plan at claim time โ€” immutable baseline for drift detection. Co-Authored-By: Claude Sonnet 4.6 --- docs/erd.svg | 2 +- .../20260430171227_add_claude_job_plan_snapshot/migration.sql | 2 ++ prisma/schema.prisma | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 prisma/migrations/20260430171227_add_claude_job_plan_snapshot/migration.sql diff --git a/docs/erd.svg b/docs/erd.svg index fd4b3eb..9c88b70 100644 --- a/docs/erd.svg +++ b/docs/erd.svg @@ -1 +1 @@ -

active_product

user

enum:role

user

user

product

enum:status

pbi

product

sprint

assignee

enum:status

story

enum:type

enum:status

product

enum:status

story

sprint

enum:status

user

product

task

enum:status

claimed_by_token

user

token

product

user

user

product

user

story

task

product

asker

answerer

Role

PRODUCT_OWNER

PRODUCT_OWNER

SCRUM_MASTER

SCRUM_MASTER

DEVELOPER

DEVELOPER

StoryStatus

OPEN

OPEN

IN_SPRINT

IN_SPRINT

DONE

DONE

PbiStatus

READY

READY

BLOCKED

BLOCKED

DONE

DONE

ClaudeJobStatus

QUEUED

QUEUED

CLAIMED

CLAIMED

RUNNING

RUNNING

DONE

DONE

FAILED

FAILED

CANCELLED

CANCELLED

TaskStatus

TO_DO

TO_DO

IN_PROGRESS

IN_PROGRESS

REVIEW

REVIEW

DONE

DONE

LogType

IMPLEMENTATION_PLAN

IMPLEMENTATION_PLAN

TEST_RESULT

TEST_RESULT

COMMIT

COMMIT

TestStatus

PASSED

PASSED

FAILED

FAILED

SprintStatus

ACTIVE

ACTIVE

COMPLETED

COMPLETED

users

String

id

๐Ÿ—๏ธ

String

username

String

email

โ“

String

password_hash

Boolean

is_demo

String

bio

โ“

String

bio_detail

โ“

Bytes

avatar_data

โ“

DateTime

created_at

DateTime

updated_at

user_roles

String

id

๐Ÿ—๏ธ

Role

role

api_tokens

String

id

๐Ÿ—๏ธ

String

token_hash

String

label

โ“

DateTime

created_at

DateTime

revoked_at

โ“

products

String

id

๐Ÿ—๏ธ

String

name

String

code

โ“

String

description

โ“

String

repo_url

โ“

String

definition_of_done

Boolean

archived

DateTime

created_at

DateTime

updated_at

pbis

String

id

๐Ÿ—๏ธ

String

code

โ“

String

title

String

description

โ“

Int

priority

Float

sort_order

PbiStatus

status

DateTime

created_at

DateTime

updated_at

stories

String

id

๐Ÿ—๏ธ

String

code

โ“

String

title

String

description

โ“

String

acceptance_criteria

โ“

Int

priority

Float

sort_order

StoryStatus

status

DateTime

created_at

DateTime

updated_at

story_logs

String

id

๐Ÿ—๏ธ

LogType

type

String

content

TestStatus

status

โ“

String

commit_hash

โ“

String

commit_message

โ“

Json

metadata

โ“

DateTime

created_at

sprints

String

id

๐Ÿ—๏ธ

String

sprint_goal

SprintStatus

status

DateTime

created_at

DateTime

completed_at

โ“

tasks

String

id

๐Ÿ—๏ธ

String

title

String

description

โ“

String

implementation_plan

โ“

Int

priority

Float

sort_order

TaskStatus

status

DateTime

created_at

DateTime

updated_at

claude_jobs

String

id

๐Ÿ—๏ธ

ClaudeJobStatus

status

DateTime

claimed_at

โ“

DateTime

started_at

โ“

DateTime

finished_at

โ“

String

branch

โ“

String

summary

โ“

String

error

โ“

DateTime

created_at

DateTime

updated_at

claude_workers

String

id

๐Ÿ—๏ธ

String

product_id

โ“

DateTime

started_at

DateTime

last_seen_at

product_members

String

id

๐Ÿ—๏ธ

DateTime

created_at

todos

String

id

๐Ÿ—๏ธ

String

title

String

description

โ“

Boolean

done

Boolean

archived

DateTime

created_at

DateTime

updated_at

login_pairings

String

id

๐Ÿ—๏ธ

String

secret_hash

String

desktop_token_hash

String

status

String

desktop_ua

โ“

String

desktop_ip

โ“

DateTime

created_at

DateTime

expires_at

DateTime

approved_at

โ“

DateTime

consumed_at

โ“

claude_questions

String

id

๐Ÿ—๏ธ

String

question

Json

options

โ“

String

status

String

answer

โ“

DateTime

answered_at

โ“

DateTime

created_at

DateTime

expires_at

\ No newline at end of file +

active_product

user

enum:role

user

user

product

enum:status

pbi

product

sprint

assignee

enum:status

story

enum:type

enum:status

product

enum:status

story

sprint

enum:status

user

product

task

enum:status

claimed_by_token

user

token

product

user

user

product

user

story

task

product

asker

answerer

Role

PRODUCT_OWNER

PRODUCT_OWNER

SCRUM_MASTER

SCRUM_MASTER

DEVELOPER

DEVELOPER

StoryStatus

OPEN

OPEN

IN_SPRINT

IN_SPRINT

DONE

DONE

PbiStatus

READY

READY

BLOCKED

BLOCKED

DONE

DONE

ClaudeJobStatus

QUEUED

QUEUED

CLAIMED

CLAIMED

RUNNING

RUNNING

DONE

DONE

FAILED

FAILED

CANCELLED

CANCELLED

TaskStatus

TO_DO

TO_DO

IN_PROGRESS

IN_PROGRESS

REVIEW

REVIEW

DONE

DONE

LogType

IMPLEMENTATION_PLAN

IMPLEMENTATION_PLAN

TEST_RESULT

TEST_RESULT

COMMIT

COMMIT

TestStatus

PASSED

PASSED

FAILED

FAILED

SprintStatus

ACTIVE

ACTIVE

COMPLETED

COMPLETED

users

String

id

๐Ÿ—๏ธ

String

username

String

email

โ“

String

password_hash

Boolean

is_demo

String

bio

โ“

String

bio_detail

โ“

Bytes

avatar_data

โ“

DateTime

created_at

DateTime

updated_at

user_roles

String

id

๐Ÿ—๏ธ

Role

role

api_tokens

String

id

๐Ÿ—๏ธ

String

token_hash

String

label

โ“

DateTime

created_at

DateTime

revoked_at

โ“

products

String

id

๐Ÿ—๏ธ

String

name

String

code

โ“

String

description

โ“

String

repo_url

โ“

String

definition_of_done

Boolean

archived

DateTime

created_at

DateTime

updated_at

pbis

String

id

๐Ÿ—๏ธ

String

code

โ“

String

title

String

description

โ“

Int

priority

Float

sort_order

PbiStatus

status

DateTime

created_at

DateTime

updated_at

stories

String

id

๐Ÿ—๏ธ

String

code

โ“

String

title

String

description

โ“

String

acceptance_criteria

โ“

Int

priority

Float

sort_order

StoryStatus

status

DateTime

created_at

DateTime

updated_at

story_logs

String

id

๐Ÿ—๏ธ

LogType

type

String

content

TestStatus

status

โ“

String

commit_hash

โ“

String

commit_message

โ“

Json

metadata

โ“

DateTime

created_at

sprints

String

id

๐Ÿ—๏ธ

String

sprint_goal

SprintStatus

status

DateTime

created_at

DateTime

completed_at

โ“

tasks

String

id

๐Ÿ—๏ธ

String

title

String

description

โ“

String

implementation_plan

โ“

Int

priority

Float

sort_order

TaskStatus

status

DateTime

created_at

DateTime

updated_at

claude_jobs

String

id

๐Ÿ—๏ธ

ClaudeJobStatus

status

DateTime

claimed_at

โ“

DateTime

started_at

โ“

DateTime

finished_at

โ“

String

plan_snapshot

โ“

String

branch

โ“

String

summary

โ“

String

error

โ“

DateTime

created_at

DateTime

updated_at

claude_workers

String

id

๐Ÿ—๏ธ

String

product_id

โ“

DateTime

started_at

DateTime

last_seen_at

product_members

String

id

๐Ÿ—๏ธ

DateTime

created_at

todos

String

id

๐Ÿ—๏ธ

String

title

String

description

โ“

Boolean

done

Boolean

archived

DateTime

created_at

DateTime

updated_at

login_pairings

String

id

๐Ÿ—๏ธ

String

secret_hash

String

desktop_token_hash

String

status

String

desktop_ua

โ“

String

desktop_ip

โ“

DateTime

created_at

DateTime

expires_at

DateTime

approved_at

โ“

DateTime

consumed_at

โ“

claude_questions

String

id

๐Ÿ—๏ธ

String

question

Json

options

โ“

String

status

String

answer

โ“

DateTime

answered_at

โ“

DateTime

created_at

DateTime

expires_at

\ No newline at end of file diff --git a/prisma/migrations/20260430171227_add_claude_job_plan_snapshot/migration.sql b/prisma/migrations/20260430171227_add_claude_job_plan_snapshot/migration.sql new file mode 100644 index 0000000..b578c1a --- /dev/null +++ b/prisma/migrations/20260430171227_add_claude_job_plan_snapshot/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "claude_jobs" ADD COLUMN "plan_snapshot" TEXT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 6586980..898b87e 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -260,6 +260,7 @@ model ClaudeJob { claimed_at DateTime? started_at DateTime? finished_at DateTime? + plan_snapshot String? branch String? summary String? error String? From 075af9d61946d7449324e7b84fc886ae8df4bbe4 Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Thu, 30 Apr 2026 19:27:37 +0200 Subject: [PATCH 2/3] docs: update ClaudeJob lifecycle with plan_snapshot Document state machine snapshot capture/reset, plan_snapshot field rationale, and drift-detection baseline semantics. Co-Authored-By: Claude Sonnet 4.6 --- docs/scrum4me-architecture.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/scrum4me-architecture.md b/docs/scrum4me-architecture.md index 6439d5f..4d0a2ce 100644 --- a/docs/scrum4me-architecture.md +++ b/docs/scrum4me-architecture.md @@ -1120,12 +1120,15 @@ Developers kunnen vanuit de Task Detail Dialog een lokale Claude Code-sessie ins ### State machine ``` -QUEUED โ†’ CLAIMED โ†’ RUNNING โ†’ DONE - โ†’ FAILED +QUEUED โ†’ CLAIMED (snapshot capture) โ†’ RUNNING โ†’ DONE + โ†’ FAILED โ†’ CANCELLED (door user) -CLAIMED โ†’ QUEUED (stale claim cleanup, >30min) +CLAIMED โ†’ QUEUED (stale claim cleanup, >30min; snapshot gewist) +QUEUED โ†’ CLAIMED (re-claim na stale reset; snapshot refreshed) ``` +**Snapshot-rationale:** bij atomic claim schrijft `wait_for_job` de dan-actuele `task.implementation_plan` naar `claude_jobs.plan_snapshot`. Dit veld blijft bevroren terwijl de job loopt โ€” ook als een gebruiker `update_task_plan` aanroept. Zo kan een toekomstige verify-tool drift detecteren tussen de baseline (snapshot) en de actuele plan. Jobs zonder snapshot (NULL) zijn aangemaakt vรณรณr deze feature en worden als "no baseline" gemarkeerd. + ### ClaudeJob model ``` @@ -1134,6 +1137,7 @@ claude_jobs status: ClaudeJobStatus (QUEUED|CLAIMED|RUNNING|DONE|FAILED|CANCELLED) claimed_by_token_id (FK โ†’ api_tokens, nullable) claimed_at, started_at, finished_at + plan_snapshot: String? โ€” bevroren snapshot van task.implementation_plan bij claim branch, summary, error @@index([user_id, status]) @@index([task_id, status]) From a532a8d851726cc240162a28bb2af98c3614c70a Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Thu, 30 Apr 2026 19:28:07 +0200 Subject: [PATCH 3/3] refactor: remove duplicate header labels on backlog page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both the product H1 + description in the page header and the "Product Backlog" panel-title in the PBI panel duplicated info already visible in the NavBar. Removed both, keeping the right-aligned action bars (activate/sprint/settings, plus filters/+PBI) intact. PanelNavBar component is unchanged โ€” Stories and Taken panels keep their titles. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/(app)/products/[id]/page.tsx | 10 +- components/backlog/pbi-list.tsx | 158 +++++++++++++++---------------- 2 files changed, 78 insertions(+), 90 deletions(-) diff --git a/app/(app)/products/[id]/page.tsx b/app/(app)/products/[id]/page.tsx index 647d8c6..85519dd 100644 --- a/app/(app)/products/[id]/page.tsx +++ b/app/(app)/products/[id]/page.tsx @@ -92,14 +92,8 @@ export default async function ProductBacklogPage({ params, searchParams }: Props return (
- {/* Product header */} -
-
-

{product.name}

- {product.description && ( -

{product.description}

- )} -
+ {/* Product header โ€” actions only; product-naam zit al in NavBar */} +
{user?.active_product_id !== id && ( diff --git a/components/backlog/pbi-list.tsx b/components/backlog/pbi-list.tsx index 8f79138..3995102 100644 --- a/components/backlog/pbi-list.tsx +++ b/components/backlog/pbi-list.tsx @@ -24,7 +24,6 @@ import { toast } from 'sonner' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover' -import { PanelNavBar } from '@/components/shared/panel-nav-bar' import { useSelectionStore } from '@/stores/selection-store' import { usePlannerStore } from '@/stores/planner-store' import { useBacklogStore } from '@/stores/backlog-store' @@ -330,92 +329,87 @@ export function PbiList({ productId, isDemo }: PbiListProps) { return (
- - {filterPriority !== 'all' && ( - - )} - {filterStatus !== 'all' && ( - - )} - - - {`Filters${activeFilterCount > 0 ? ` (${activeFilterCount})` : ''}`} - - } - /> - - - - -
- -
-
-
- +
+ {filterPriority !== 'all' && ( + + )} + {filterStatus !== 'all' && ( + + )} + + + {`Filters${activeFilterCount > 0 ? ` (${activeFilterCount})` : ''}`} + + } + /> + + + + +
- - - } - /> +
+
+
+ + + +
{pbis.length === 0 ? (