refactor: introduce shared task mutation service boundary #321

Closed
opened 2026-05-11 19:19:52 +00:00 by barrettruth · 0 comments
Owner

Parent: #305

Problem

Task mutations are split between server actions and API route handlers. Ownership checks, recurrence scope behavior, revalidation, undo payloads, and mutation result shape should not drift between web UI and CLI/API paths.

Solution

Add a server-only task mutation service:

  • centralize owner lookup/authorization for task mutations
  • centralize create, update, status change, delete, dependency, and recurrence-scope flows where practical
  • keep src/core/task.ts as pure DB/domain operations
  • have route handlers and server actions call the same mutation service
  • keep revalidation and response shaping explicit

Acceptance criteria

  • A task mutation has one authoritative server path for shared behavior.
  • API route handlers and server actions no longer duplicate ownership/recurrence logic.
  • Existing API tests and task action tests pass or are updated around the new service boundary.
  • CLI-facing API behavior remains compatible unless explicitly changed in a linked issue.
Parent: #305 ## Problem Task mutations are split between server actions and API route handlers. Ownership checks, recurrence scope behavior, revalidation, undo payloads, and mutation result shape should not drift between web UI and CLI/API paths. ## Solution Add a server-only task mutation service: - centralize owner lookup/authorization for task mutations - centralize create, update, status change, delete, dependency, and recurrence-scope flows where practical - keep `src/core/task.ts` as pure DB/domain operations - have route handlers and server actions call the same mutation service - keep revalidation and response shaping explicit ## Acceptance criteria - A task mutation has one authoritative server path for shared behavior. - API route handlers and server actions no longer duplicate ownership/recurrence logic. - Existing API tests and task action tests pass or are updated around the new service boundary. - CLI-facing API behavior remains compatible unless explicitly changed in a linked issue.
barrettruth added this to the v0.1.0 milestone 2026-05-11 19:19:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
barrettruth/delta#321
No description provided.