refactor(shared): single TaskStatus enum replaces dual db-status / ui_status split #1163

Closed
opened 2026-05-14 22:05:19 +00:00 by claude-desktop · 0 comments
Collaborator

As a developer, I want a single exhaustive TaskStatus type shared between the DB layer and the UI, so that adding a new status state doesn't require updating two enums and two mapping functions in separate packages.

Acceptance criteria

Package

  • packages/shared/src/task-status.ts exports TaskStatus (canonical union covering all DB values) and DisplayStatus (UI display states)
  • toDisplayStatus(s: TaskStatus): DisplayStatus mapping function in the same file — replaces the dual-enum mapping currently scattered across components
  • packages/shared/src/index.ts re-exports both types + the mapping function

DB layer

  • Drizzle task_history.status column type aligned to TaskStatus string union
  • No raw string literals for status values in query files — use the enum values

Web

  • task.ui_status computed field removed from the API wire format
  • All components that read task.ui_status replaced with toDisplayStatus(task.status)
  • StatusPill props unchanged (still consumes DisplayStatus values)

Quality

  • just qa passes (typecheck + lint clean)
  • No new status values added (out of scope)

Out of scope

  • Adding new status values (separate ticket)
  • Changing StatusPill visual appearance
  • Changing task lifecycle logic

References

  • agent-output-unification audit 2026-05-15
  • Inconsistency: "Status Terminology Mismatch" (HIGH)
As a developer, I want a single exhaustive TaskStatus type shared between the DB layer and the UI, so that adding a new status state doesn't require updating two enums and two mapping functions in separate packages. ### Acceptance criteria #### Package - [ ] `packages/shared/src/task-status.ts` exports `TaskStatus` (canonical union covering all DB values) and `DisplayStatus` (UI display states) - [ ] `toDisplayStatus(s: TaskStatus): DisplayStatus` mapping function in the same file — replaces the dual-enum mapping currently scattered across components - [ ] `packages/shared/src/index.ts` re-exports both types + the mapping function #### DB layer - [ ] Drizzle `task_history.status` column type aligned to `TaskStatus` string union - [ ] No raw string literals for status values in query files — use the enum values #### Web - [ ] `task.ui_status` computed field removed from the API wire format - [ ] All components that read `task.ui_status` replaced with `toDisplayStatus(task.status)` - [ ] `StatusPill` props unchanged (still consumes `DisplayStatus` values) #### Quality - [ ] `just qa` passes (typecheck + lint clean) - [ ] No new status values added (out of scope) ### Out of scope - Adding new status values (separate ticket) - Changing `StatusPill` visual appearance - Changing task lifecycle logic ### References - agent-output-unification audit 2026-05-15 - Inconsistency: "Status Terminology Mismatch" (HIGH)
Sign in to join this conversation.
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.

Reference
charles/agent-hooks#1163
No description provided.