Skip to content

feat(tasks): auto-work eligible flag on tasks (T-58) - #23

Merged
jaesbit merged 1 commit into
mainfrom
feat/t58-autowork-eligible
Jul 6, 2026
Merged

feat(tasks): auto-work eligible flag on tasks (T-58)#23
jaesbit merged 1 commit into
mainfrom
feat/t58-autowork-eligible

Conversation

@jaesbit

@jaesbit jaesbit commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Why

Not every kanban task should be touched by auto-work. Explicit opt-in per task avoids accidental automation of sensitive or ambiguous cards.

Scope

  • autoWork: boolean added to the task protocol (packages/protocol/src/index.ts), default false.
  • DB migration 008-task-autowork.sql: ALTER TABLE tasks ADD COLUMN auto_work INTEGER NOT NULL DEFAULT 0, indexed for the future T-64 engine query.
  • REST API: GET /tasks, POST /tasks, PATCH /tasks/:id all read/write autoWork.
  • UI: "Eligible for Auto Work" checkbox in TaskModal's metadata grid; TaskCard shows a small Zap indicator when autoWork === true, styled like the priority badge.

This is task 2 of an 11-task "Auto Work" chain, stacked on feat/t57-task-dependencies (PR #22) — not based on main — since both tickets touch the same task protocol/DB/routes/UI files. This diff is only the incremental change on top of T-57's dependsOn work.

Non-goals

The "engine only considers autoWork tasks" part of the ticket is explicitly deferred to T-64 (not built yet, not in scope here). This PR only ships the data model, API, and UI toggle — no scheduling logic.

Files changed

  • packages/protocol/src/index.ts
  • apps/server/src/db/migrations/008-task-autowork.sql (new)
  • apps/server/src/db/tasks.ts, apps/server/src/db/tasks.test.ts
  • apps/server/src/routes-tasks.ts
  • apps/web/src/components/tasks/TaskModal.tsx, apps/web/src/components/tasks/TaskCard.tsx

TaskDrawer.tsx (listed in the ticket's surface area) is confirmed dead code — not imported anywhere in the app — so it was left untouched, matching T-57's precedent.

Validation

  • bun run --filter '@omp-deck/server' typecheck — clean
  • bun run --filter '@omp-deck/web' typecheck — clean
  • cd apps/server && bun test — 246/246 pass (6 new autoWork cases; includes T-57's 11 dependency cases still passing)
  • cd apps/web && bun test — 149/149 pass
  • bun run --filter '@omp-deck/web' build — succeeds (pre-existing >500kB chunk warning, unrelated)

Acceptance

  • Default false on create; must be explicitly opted in.
  • Field survives round-trips (create → list → patch → list).
  • Engine filters correctly — deferred to T-64 per the ticket note; not built here.

Base automatically changed from feat/t57-task-dependencies to main July 6, 2026 10:00
Adds an autoWork: boolean opt-in flag to kanban tasks so the auto-work
engine (T-64) only ever considers tasks the user explicitly marked
eligible. Not every card should be touched by unattended automation —
this ticket only builds the data model, API, and UI toggle; no
scheduling logic.

Stacked on feat/t57-task-dependencies (PR #22) since both tickets touch
the same task protocol/DB/routes/UI files — this diff is the
incremental change on top of T-57's dependsOn work, not a rebase onto
main.

- packages/protocol: Task.autoWork (always present, default false),
  CreateTaskRequest/UpdateTaskRequest.autoWork (optional).
- apps/server/src/db/migrations/008-task-autowork.sql: ALTER TABLE
  tasks ADD COLUMN auto_work INTEGER NOT NULL DEFAULT 0, same pattern
  as 006-task-priority.sql. Indexed for the future T-64 engine query
  (WHERE auto_work = 1).
- apps/server/src/db/tasks.ts: TaskRow/rowToTask carry auto_work
  through every read path (listTasks, getTask, findTaskByDisplayOrId).
  createTask/updateTask accept autoWork, persisted independently of
  the dependsOn set added by T-57.
- apps/server/src/routes-tasks.ts: POST/PATCH /tasks validate autoWork
  is a boolean before hitting the DB layer, same shape as the existing
  dependsOn/priority checks.
- apps/web: TaskCard shows a small Zap indicator next to the priority
  badge when autoWork is true. TaskModal gained an "Eligible for Auto
  Work" checkbox in the metadata grid, next to cwd. TaskDrawer.tsx is
  confirmed dead code (no imports anywhere, per T-57's findings) and
  was left untouched.

Tests: apps/server/src/db/tasks.test.ts gained 6 cases covering
default/explicit/toggle/untouched autoWork and independence from
dependsOn on create+update+list+get round-trips.
@jaesbit
jaesbit force-pushed the feat/t58-autowork-eligible branch from 3f3af2b to b5d06bd Compare July 6, 2026 10:09
@jaesbit
jaesbit merged commit a041822 into main Jul 6, 2026
@jaesbit
jaesbit deleted the feat/t58-autowork-eligible branch July 6, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant