3.6 KiB
3.6 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-backend-composite-semantics | Backend composite re-parent semantics | done | 1 | plan.md | ../../specs/tasks/requirements/subtask-reparenting-drag-drop.md |
Task 01: Backend composite re-parent semantics
Acceptance
Service.UpdateTasknormalizesmetadata.workspace.modefrominherit_parenttoshared_groupwhenever the effective parent changes (set or cleared); other modes and root tasks are untouched. The returned task, the persisted row, and thetask.updatedpayload all reflect the change.DashboardService.UpdateTaskParentID(Office dashboard PATCH) applies the same normalization on its non-empty parent path and includesmetadatain the publishedfieldswhen the mode changed.- All existing reparent/detach service and handler tests pass unchanged.
Verification
cd apps/backend && go test ./internal/task/service ./internal/task/handlers ./internal/office/dashboard
Files likely touched
apps/backend/internal/task/service/service_tasks.go(parent block inService.UpdateTask, newnormalizeWorkspaceModeAfterReparenthelper)apps/backend/internal/task/service/service_reparent_test.go(new cases)apps/backend/internal/office/dashboard/service_tasks.go(UpdateTaskParentID)apps/backend/internal/office/dashboard/service_detachment_test.go(parity test)apps/backend/internal/office/repository/sqlite/tasks.go(newUpdateTaskWorkspaceMode)apps/backend/internal/office/dashboard/service.go(repo interface member, ifUpdateTaskWorkspaceModeis not already surfaced)
Dependencies
None.
Inputs
- Spec sections: What (composite semantics), Data model, API surface, Failure modes.
- Existing pattern:
Service.DetachTask+detachTaskQuery(dialect-aware JSON mode normalization inapps/backend/internal/task/repository/sqlite/task.go),resolveParentID/validateReparentDepthinservice_tasks.go,publishTaskUpdatedin the office dashboard service. - Do NOT change
resolveParentID/validateReparentDepth; validation behavior is already shipped and tested.
Output contract
Report the service/repo changes, exact commands and results, files changed, blockers, residual risks; update this task and plan.md when acceptance passes.
Results
cd apps/backend && go test ./internal/task/service ./internal/task/handlers ./internal/office/dashboard— service and office/dashboardok; handlersok(run withumask 022; this sandbox's default umask 002 makes 3 pre-existing local-repository handler tests fail — they pass under standard umask and fail identically on the stash-clean base).- Added
normalizeWorkspaceModeAfterReparenttoService.UpdateTask(parent-change block):inherit_parent→shared_groupon any effective parent change. TDD red→green:TestService_UpdateTask_ReparentNormalizesInheritedWorkspaceMode,TestService_UpdateTask_UnnestNormalizesInheritedWorkspaceMode,TestService_UpdateTask_ReparentPreservesNonInheritedWorkspaceModes. - Office parity: repo
UpdateTaskParentIDnow setsparent_idAND normalizes mode in one dialect-aware UPDATE (SQLite JSON, mirroringdetachTaskQuery); dashboard service publishes["parent_id", "metadata"]; parity testTestUpdateTaskParentIDNormalizesInheritedWorkspaceMode; added the missingmetadatacolumn to the office test-harness tasks DDL (matches production schema). - Files changed:
internal/task/service/service_tasks.go,service_reparent_test.go,internal/office/dashboard/service_tasks.go,service_detachment_test.go,handler_test.go,internal/office/repository/sqlite/tasks.go.