feat(schema): DispatchIdeaLink-model voor dispatch-idee-koppeling (IDEA-251, T-251) #83

Merged
janpeter merged 1 commit from claude/idea-251-dispatch-idea-link into main 2026-10-13 00:07:24 +02:00
Owner

IDEA-251 · T1 (T-251): Prisma model DispatchIdeaLink for the link between a dispatch request, an idea and a phase.

Change

  • New model DispatchIdeaLink, placed after AgentChatJob and mapped to dispatch_idea_links. It has:
    • request_id UUID as its primary key, with a foreign key to queue_dispatch_requests (onDelete: Restrict, onUpdate: NoAction);
    • idea_id, with a foreign key to ideas (onDelete: Restrict);
    • idea_phase UsageIdeaPhase;
    • created_at;
    • an index on idea_id.
  • Back-relations Idea.dispatch_idea_links and QueueDispatchRequest.idea_link. These are schema-only and change nothing in the database.
  • New text test __tests__/dispatch-idea-link-schema.test.ts pins the model's shape. Its regexes tolerate whitespace, and it imports nothing from @prisma.

Only web migrates this table, as an additive db-access contract (T2). mcp and workers only generate the client. claude_jobs and queue_dispatch_* stay untouched.

Verification

  • npm run verify: green (45 files, 793 tests).
  • Consumer validation in web (Scrum4Me origin/main ded4053a, with the submodule on this branch at b2c26ff):
    • bash scripts/gen-schema.sh && npx prisma generate --generator client exits 0;
    • prisma validate passes.
  • Generated SQL: prisma migrate diff --from-empty produces exactly the SQL from spec §3:
    • UUID, TEXT, "UsageIdeaPhase", TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP;
    • dispatch_idea_links_pkey and dispatch_idea_links_idea_id_idx;
    • request FK ON DELETE RESTRICT ON UPDATE NO ACTION;
    • idea FK ON DELETE RESTRICT ON UPDATE CASCADE.
  • Span for consumers: web and workers pin a1e8333. The commits a1e8333..6109a4a do not touch prisma/schema.prisma, so the T2 stop rule does not trigger. They do remove USD_PROXY/CREDITS helpers from usage-sql (ST-074); T2 and T4 check during their bump whether they still import those.

References

  • Spec rev 2 §3 and plan rev 2 §T1 (GO/GO): scrum4me-workers, branch claude/idea-251-spec, files docs/superpowers/specs/2026-10-12-idea-251-dispatch-idea-work-item-design.md and docs/superpowers/plans/2026-10-12-idea-251-dispatch-idea-work-item.md.

Merge by JP. The merge SHA becomes S1 for T2, T3 and T4.

🤖 Generated with Claude Code

**IDEA-251 · T1 (T-251)**: Prisma model `DispatchIdeaLink` for the link between a dispatch request, an idea and a phase. ## Change - New model `DispatchIdeaLink`, placed after `AgentChatJob` and mapped to `dispatch_idea_links`. It has: - `request_id` UUID as its primary key, with a foreign key to `queue_dispatch_requests` (`onDelete: Restrict`, `onUpdate: NoAction`); - `idea_id`, with a foreign key to `ideas` (`onDelete: Restrict`); - `idea_phase UsageIdeaPhase`; - `created_at`; - an index on `idea_id`. - Back-relations `Idea.dispatch_idea_links` and `QueueDispatchRequest.idea_link`. These are schema-only and change nothing in the database. - New text test `__tests__/dispatch-idea-link-schema.test.ts` pins the model's shape. Its regexes tolerate whitespace, and it imports nothing from `@prisma`. Only web migrates this table, as an additive db-access contract (T2). mcp and workers only generate the client. `claude_jobs` and `queue_dispatch_*` stay untouched. ## Verification - `npm run verify`: green (45 files, 793 tests). - **Consumer validation in web** (Scrum4Me `origin/main` `ded4053a`, with the submodule on this branch at `b2c26ff`): - `bash scripts/gen-schema.sh && npx prisma generate --generator client` exits 0; - `prisma validate` passes. - **Generated SQL:** `prisma migrate diff --from-empty` produces exactly the SQL from spec §3: - `UUID`, `TEXT`, `"UsageIdeaPhase"`, `TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP`; - `dispatch_idea_links_pkey` and `dispatch_idea_links_idea_id_idx`; - request FK `ON DELETE RESTRICT ON UPDATE NO ACTION`; - idea FK `ON DELETE RESTRICT ON UPDATE CASCADE`. - **Span for consumers:** web and workers pin `a1e8333`. The commits `a1e8333..6109a4a` do not touch `prisma/schema.prisma`, so the T2 stop rule does not trigger. They do remove USD_PROXY/CREDITS helpers from `usage-sql` (ST-074); T2 and T4 check during their bump whether they still import those. ## References - Spec rev 2 §3 and plan rev 2 §T1 (GO/GO): scrum4me-workers, branch `claude/idea-251-spec`, files `docs/superpowers/specs/2026-10-12-idea-251-dispatch-idea-work-item-design.md` and `docs/superpowers/plans/2026-10-12-idea-251-dispatch-idea-work-item.md`. Merge by JP. The merge SHA becomes S1 for T2, T3 and T4. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(schema): DispatchIdeaLink model voor dispatch-idee-koppeling (IDEA-251)
All checks were successful
CI / Verify (pull_request) Successful in 51s
b2c26ff711
Koppeltabel dispatch_idea_links: één rij per dispatch-verzoek met idee en
fase. Web migreert (additief db-access-contract); mcp en workers genereren
alleen de client. Schema-teksttest pint de vorm uit spec §3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
s4m-codex-reviewer left a comment

APPROVED

Findings:

  • Geen blokkerende of overige findings gevonden.

Plan gekoppeld via pr_refs (product scrum4me-workers). Referenties: T-251 (scrum4me-workers), ST-074 (scrum4me-workers). Er zijn geen omitted onderdelen.

De diff rondt de aangekondigde T1/T-251-scope af: DispatchIdeaLink, beide terugrelaties en de whitespace-tolerante schema-teksttest komen overeen met het gekoppelde plan en spec rev 2 §3. De request-relatie gebruikt RESTRICT/NO ACTION; de idee-relatie RESTRICT met de standaard CASCADE bij updates. De wijziging volgt het canonieke schema-eigenaarschap van shared; migraties blijven bij web en er worden geen Prisma-imports toegevoegd.

De overige acceptatiecriteria van ST-078 (migratie, tool, verwijdermelding en Usage-UI) zijn vervolgwerk buiten deze PR. ST-074 wordt niet geraakt; deze PR claimt die story niet af te ronden.

Verificatie op b2c26ff711: npm run verify geslaagd (dependency-gate, typecheck, 45 testbestanden / 793 tests), inclusief de drie nieuwe contracttests; git diff --check geslaagd. De PR beschrijft tevens geslaagde web-consumer-generatie, Prisma-validatie en SQL-diffcontrole; die consumer-checks zijn in deze review niet opnieuw uitgevoerd.

# APPROVED Findings: - Geen blokkerende of overige findings gevonden. Plan gekoppeld via pr_refs (product scrum4me-workers). Referenties: T-251 (scrum4me-workers), ST-074 (scrum4me-workers). Er zijn geen omitted onderdelen. De diff rondt de aangekondigde T1/T-251-scope af: DispatchIdeaLink, beide terugrelaties en de whitespace-tolerante schema-teksttest komen overeen met het gekoppelde plan en spec rev 2 §3. De request-relatie gebruikt RESTRICT/NO ACTION; de idee-relatie RESTRICT met de standaard CASCADE bij updates. De wijziging volgt het canonieke schema-eigenaarschap van shared; migraties blijven bij web en er worden geen Prisma-imports toegevoegd. De overige acceptatiecriteria van ST-078 (migratie, tool, verwijdermelding en Usage-UI) zijn vervolgwerk buiten deze PR. ST-074 wordt niet geraakt; deze PR claimt die story niet af te ronden. Verificatie op b2c26ff711245cfa7966ec150d6478c62385f622: npm run verify geslaagd (dependency-gate, typecheck, 45 testbestanden / 793 tests), inclusief de drie nieuwe contracttests; git diff --check geslaagd. De PR beschrijft tevens geslaagde web-consumer-generatie, Prisma-validatie en SQL-diffcontrole; die consumer-checks zijn in deze review niet opnieuw uitgevoerd.
Sign in to join this conversation.
No reviewers
No labels
severity/s4
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janpeter/scrum4me-shared!83
No description provided.