538813de02
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
3.8 KiB
3.8 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-query-and-admit-thread-tasks | Query and admit Threads tasks | done | 2 |
|
plan.md |
|
|
|
Task 02: Query and Admit Threads Tasks
Summary
Build a pure, bounded task query for Threads. Apply scope, filters, sort, deep links, and the column limit before the board mounts task shells.
In scope
- Project candidates from active-workspace workflow snapshots and compact task summaries.
- Add the primary agent profile ID to the bounded task DTO and map agent and executor identity into snapshot state.
- Add table-driven filters for every specified Threads dimension.
- Add deterministic comparators with task-ID tie-breakers.
- Return matching, admitted, and hidden counts.
- Reserve one capped slot for a valid deep-link target.
- Reset stable order for query changes and Reapply sort.
- Preserve order for live events and fill open slots from sorted matches.
- Remove the global active-workflow constraint from Threads.
- Pass admitted candidates only to
ThreadsBoard.
Out of scope
- Filter-editor UI and saved-view controls.
Acceptance
- The canonical query has the same eligible-task outcome as the current deck.
- Selected IDs survive temporary task ineligibility.
- All clauses use AND and values inside one clause use OR.
- A limit of 3 mounts no more than three task shells.
- A hidden valid deep-link target is admitted without changing saved state.
- Live activity does not reorder surviving columns.
Verification
Write failing projection, filter, comparator, admission, and stable-order tests first. Then run:
(cd apps && pnpm --filter @kandev/web test -- --run lib/threads/thread-view-query.test.ts lib/threads/active-threads.test.ts hooks/domains/threads/use-stable-thread-order.test.ts components/threads/threads-board.test.tsx app/threads/threads-page-client.test.tsx)
(cd apps/web && pnpm run typecheck)
Files likely touched
apps/web/lib/threads/thread-view-query.tsapps/web/lib/threads/thread-view-query.test.tsapps/web/lib/threads/active-threads.tsapps/web/lib/state/slices/kanban/kanban-mappers.tsapps/web/hooks/domains/threads/use-stable-thread-order.tsapps/web/app/threads/threads-page-client.tsxapps/web/components/threads/threads-board.tsxapps/web/components/threads/threads-board.test.tsxapps/backend/internal/task/dto/dto.goapps/backend/internal/task/handlers/task_http_handlers.goapps/backend/internal/backendapp/boot_state.go
Dependencies
- Task 01 supplies normalized view and draft state.
Risks
- Do not fetch task or session detail to evaluate a filter.
- Keep the viewport detail-window rules inside the admitted task set.
Parallelism
sequential