Commit Graph

326 Commits

Author SHA1 Message Date
Lukas May
81814ac213 docs(21): create phase plan for Polish & Integration
Phase 21: Polish & Integration
- 6 plans in 3 waves
- 3 parallel (Wave 1), 2 parallel (Wave 2), 1 sequential (Wave 3)
- Ready for execution
2026-02-05 07:46:36 +01:00
Lukas May
e2c84f0577 docs(20): complete real-time-subscriptions phase 2026-02-04 22:23:31 +01:00
Lukas May
48c81f70a8 docs(20-02): create summary and update state for frontend subscriptions
Phase 20 (Real-Time Subscriptions) is now complete. Both plans delivered:
- 20-01: SSE backend with subscription procedures
- 20-02: Frontend splitLink + subscription hooks on all 3 UI pages
2026-02-04 22:22:53 +01:00
Lukas May
170ac55afd feat(20-02): wire SSE subscription hooks into dashboard, detail, and inbox pages
Add useSubscription hooks to all three UI pages that invalidate React
Query caches on domain events:
- Dashboard: onTaskUpdate invalidates listInitiatives + listPhases
- Detail: onTaskUpdate invalidates phases/tasks/plans, onAgentUpdate
  invalidates listAgents
- Inbox: onAgentUpdate invalidates listWaitingAgents + listMessages

Subscription failures are silent (onError: () => {}) so pages degrade
gracefully to manual refresh when the backend is not running.
2026-02-04 22:21:44 +01:00
Lukas May
eaf3f10722 feat(20-02): add splitLink to route subscriptions to SSE httpSubscriptionLink
Replace single httpBatchLink with splitLink that routes subscription
operations to httpSubscriptionLink (SSE) while keeping queries/mutations
on httpBatchLink. No new packages needed — both exports are part of
@trpc/client v11.
2026-02-04 22:20:16 +01:00
Lukas May
8cfdfe987b docs(20): complete plan 20-01 SSE streaming summary and state update 2026-02-04 22:18:11 +01:00
Lukas May
42154d60d4 feat(20): export SubscriptionEvent type from shared package
Add SubscriptionEvent interface for frontend consumption of SSE
subscription data in onData callbacks. Vite proxy confirmed compatible
with SSE streaming (http-proxy passes chunked responses by default).
2026-02-04 22:16:57 +01:00
Lukas May
e5d8dbb583 feat(20): add SSE streaming support and subscription procedures
Fix tRPC HTTP adapter to stream ReadableStream responses instead of
buffering (required for SSE). Create subscriptions module that bridges
EventBus domain events into tRPC async generator subscriptions using a
queue-based pattern. Add three subscription procedures: onEvent (all
events), onAgentUpdate (agent lifecycle), onTaskUpdate (task/phase).
2026-02-04 22:16:14 +01:00
Lukas May
4b25ba0ab2 docs(20): create phase plan
Phase 20: Real-time Subscriptions
- 2 plans in 2 waves
- 1 parallel (Wave 1: backend SSE), 1 sequential (Wave 2: frontend hooks)
- SSE via tRPC httpSubscriptionLink (no WebSocket dependency)
- Ready for execution
2026-02-04 22:10:54 +01:00
Lukas May
9d7002d2bd fix(19): wire AgentManager into server tRPC context
AgentManager was never instantiated or passed to the CoordinationServer,
causing all agent-related tRPC procedures to throw "Agent manager not
available". Creates DrizzleAgentRepository, SimpleGitWorktreeManager,
and ClaudeAgentManager in startServer() and passes agentManager into
the server context deps.
2026-02-04 22:03:09 +01:00
Lukas May
049810ffae fix(19): gracefully handle missing agentManager in read-only agent procedures
listWaitingAgents, listAgents, and getAgentQuestions now return empty
results instead of throwing when agentManager is not wired into the
tRPC context. Mutation procedures (spawn, stop, resume) still throw.
2026-02-04 22:00:34 +01:00
Lukas May
c93b3aaa4c docs(19): complete agent-inbox phase 2026-02-04 21:57:46 +01:00
Lukas May
b4d6f9c070 docs(19-04): create inbox page assembly summary and update state
Phase 19 (Agent Inbox) complete. All 4 plans executed: backend API
procedures, InboxList/MessageCard components, QuestionForm/input
components, and inbox page assembly with tRPC wiring.
2026-02-04 21:57:00 +01:00
Lukas May
3cac453364 feat(19-04): wire inbox page with data fetching, detail panel, and answer submission
Replaces stub inbox page with full implementation connecting InboxList
and QuestionForm components to tRPC backend. Two-column layout with
agent list on left and detail panel on right. Handles answer submission
via resumeAgent mutation, notification dismissal via respondToMessage,
and loading/error states following patterns from initiative detail page.
2026-02-04 21:55:42 +01:00
Lukas May
d6cf309091 docs(19-03): create QuestionForm & Input Components summary and update state
Tasks completed: 2/2
- OptionGroup and FreeTextInput components
- QuestionForm component

SUMMARY: .planning/phases/19-agent-inbox/19-03-SUMMARY.md
2026-02-04 21:53:45 +01:00
Lukas May
ce46cfc663 docs(19-01): complete backend API for agent questions plan
Tasks completed: 2/2
- Add getAgentQuestions and listWaitingAgents tRPC procedures
- Export PendingQuestions and QuestionItem types from shared package

SUMMARY: .planning/phases/19-agent-inbox/19-01-SUMMARY.md
2026-02-04 21:53:21 +01:00
Lukas May
aa93efaf65 docs(19-02): create InboxList/MessageCard plan summary and update state 2026-02-04 21:52:55 +01:00
Lukas May
648f9db230 feat(19-03): create QuestionForm component
- Renders mixed question types from questions array
- Submit disabled until all questions answered
- onSubmit called with Record<string, string> mapping questionId to answer
2026-02-04 21:52:08 +01:00
Lukas May
bf3521e3dd feat(19-02): create InboxList component with filter/sort controls
InboxList joins agents with their latest messages, provides filter
(all/waiting/completed) and sort (newest/oldest) controls, renders
MessageCard instances, and shows empty state when no messages match.
2026-02-04 21:52:01 +01:00
Lukas May
47a2bb38bf feat(19-01): export PendingQuestions and QuestionItem from shared package
- Re-export PendingQuestions and QuestionItem types from agent/types
- Available via @codewalk-district/shared for frontend consumption
2026-02-04 21:51:51 +01:00
Lukas May
f73b85062d feat(19-03): create OptionGroup and FreeTextInput components
- OptionGroup renders radio or checkbox based on multiSelect prop
- "Other" field auto-selects when user types into it
- FreeTextInput renders Input or Textarea based on multiline prop
2026-02-04 21:51:40 +01:00
Lukas May
004140ea83 feat(19-01): add getAgentQuestions and listWaitingAgents tRPC procedures
- getAgentQuestions returns structured PendingQuestions from AgentManager
- listWaitingAgents filters agents to waiting_for_input status
- Updated JSDoc procedure list with both new procedures
2026-02-04 21:51:25 +01:00
Lukas May
6450e4072a feat(19-02): create MessageCard component for agent inbox
MessageCard displays agent name with status, message preview (truncated
to 80 chars), relative timestamp, and response indicator (filled/empty
circle). Uses shadcn Card base with selected state highlighting.
2026-02-04 21:51:24 +01:00
Lukas May
d9b6ce4748 docs(19): create agent inbox phase plan
Phase 19: Agent Inbox
- 4 plans in 2 waves
- 3 parallel (Wave 1), 1 sequential (Wave 2)
- Ready for execution
2026-02-04 21:47:58 +01:00
Lukas May
9586e379bc docs(18): complete initiative detail phase 2026-02-04 21:39:48 +01:00
Lukas May
572b7e3806 docs(18-04): create initiative detail page assembly summary and update state
Phase 18 (Initiative Detail) complete — all 4 plans finished.
2026-02-04 21:39:02 +01:00
Lukas May
1e26bfadbd feat(18-04): wire Initiative Detail page with data fetching and all components
Replace placeholder with full initiative detail page: tRPC data fetching
(getInitiative, listPhases, listPlans, listTasks), PhaseWithTasks helper
component pattern for stable hooks, two-column layout with phases on left
and progress/decisions on right, TaskDetailModal with selectedTask state,
queue actions for phases and tasks, loading/error states.
2026-02-04 21:37:41 +01:00
Lukas May
630c36af5a docs(18-03): create summary and update state for DecisionList/TaskDetailModal plan 2026-02-04 21:34:41 +01:00
Lukas May
2b6c58aae7 docs(18-02): create plan summary and update project state
Add 18-02-SUMMARY.md with task commits, decisions, and metrics.
Update STATE.md position to plan 2 of 4 in phase 18.
2026-02-04 21:34:24 +01:00
Lukas May
afc0099174 docs(18-01): complete InitiativeHeader & ProgressPanel plan
Tasks completed: 2/2
- InitiativeHeader with back button, name, status badge, dates
- ProgressPanel with progress bar and phase/task counts

SUMMARY: .planning/phases/18-initiative-detail/18-01-SUMMARY.md
2026-02-04 21:34:12 +01:00
Lukas May
92d4d36421 feat(18-02): create PhaseAccordion component
Expandable/collapsible phase container with chevron toggle, phase
number + name header, task count (completed/total), StatusBadge,
phase-level DependencyIndicator, and TaskRow list when expanded.
2026-02-04 21:33:20 +01:00
Lukas May
5b17b7a93b feat(18-03): create TaskDetailModal component for initiative detail
Controlled dialog showing full task metadata, dependencies, dependents,
and action buttons (Queue Task / Stop Task) with proper enable/disable
logic based on task status and dependency completion.
2026-02-04 21:33:18 +01:00
Lukas May
4becfe8452 feat(18-02): create TaskRow component
Renders a single task row with Unicode tree connectors (├── / └──),
StatusBadge, inline agent name, and DependencyIndicator for blocked
tasks. Entire row is clickable with hover feedback.
2026-02-04 21:32:56 +01:00
Lukas May
3baba49edd feat(18-03): create DecisionList component for initiative detail
Collapsible list of key decisions with expand/collapse per item and
show more/less toggle when exceeding maxVisible threshold. Renders
in a Card with empty-state placeholder.
2026-02-04 21:32:50 +01:00
Lukas May
8cfc197378 feat(18-01): create ProgressPanel component
- Card with Progress heading using CardHeader/CardContent pattern
- Reuses existing ProgressBar for task completion percentage
- Displays phase and task completion counts
- Handles 0/0 gracefully via ProgressBar's built-in guard
2026-02-04 21:32:46 +01:00
Lukas May
a00b7b56b3 feat(18-02): create DependencyIndicator component
Pure presentational component that renders blocked-by annotations
with ^ prefix in amber text. Returns null when blockedBy is empty.
2026-02-04 21:32:35 +01:00
Lukas May
62409a6302 feat(18-01): create InitiativeHeader component
- Back button with ChevronLeft icon for dashboard navigation
- Card displaying initiative name, status badge, and dates
- Disabled Actions placeholder button for future Plan 04 work
- Pure presentational component receiving props
2026-02-04 21:32:28 +01:00
Lukas May
305809f0b2 docs(18): create initiative detail phase plan
Phase 18: Initiative Detail
- 4 plans in 2 waves
- 3 parallel (wave 1), 1 sequential (wave 2)
- Ready for execution
2026-02-04 21:28:33 +01:00
Lukas May
cbf0ed28cb fix: wire database and repositories into server startup for tRPC context
The server never created a database or instantiated repositories, so all
tRPC procedures requiring initiativeRepository (and other repos) threw
"Initiative repository not available" on every request.

- Create ensureSchema() for shared database table initialization
- Extend TrpcAdapterOptions to accept all repository/manager dependencies
- Add ServerContextDeps to CoordinationServer for dependency injection
- Wire database, schema, and repositories in CLI startServer()
- Refactor test-helpers to use shared ensureSchema()
2026-02-04 21:18:30 +01:00
Lukas May
078e1dde30 docs(17): complete initiative dashboard phase 2026-02-04 21:10:31 +01:00
Lukas May
37683f26f9 docs(17-04): complete initiative dashboard integration plan with summary
Phase 17-04 wires all dashboard components into a functional page with
status filtering, create dialog, and card-to-detail navigation. AppLayout
header cleaned up. Build and types verified.
2026-02-04 21:09:46 +01:00
Lukas May
cc533c81f7 refactor(17-04): remove placeholder New Initiative button from AppLayout header
The dashboard page now owns the create action via its own header button
and empty state CTA. This keeps AppLayout generic — other pages like
Inbox shouldn't show initiative-specific actions.
2026-02-04 21:08:47 +01:00
Lukas May
24bfcfa421 feat(17-04): wire initiative dashboard with filter, list, and create dialog
Replace placeholder DashboardPage with fully functional initiative dashboard:
- Page header with title, status filter dropdown, and New Initiative button
- InitiativeList with statusFilter prop for backend-driven filtering
- CreateInitiativeDialog controlled by local state
- Navigation to /initiatives/$id via TanStack Router useNavigate
- All card callbacks wired (view, spawn architect, delete placeholder)
2026-02-04 21:08:20 +01:00
Lukas May
ca3c05e7b8 docs(17-03): complete interactive dialog and dropdown components plan
Tasks completed: 2/2
- CreateInitiativeDialog with shadcn primitives and tRPC mutation
- SpawnArchitectDropdown and ActionMenu with tRPC mutations

SUMMARY: .planning/phases/17-initiative-dashboard/17-03-SUMMARY.md
2026-02-04 21:06:42 +01:00
Lukas May
f24d136742 docs(17-02): complete InitiativeCard & InitiativeList plan
Tasks completed: 2/2
- InitiativeCard component with status, progress, and actions
- InitiativeList component with loading/empty/error states and filtering

SUMMARY: .planning/phases/17-initiative-dashboard/17-02-SUMMARY.md
2026-02-04 21:06:09 +01:00
Lukas May
895c96435c feat(17-02): create InitiativeList component
- Fetches initiatives via trpc.listInitiatives with optional status filter
- Handles loading, error, empty, and populated states
- Empty state shows "No initiatives yet" with CTA button
- Error state shows message with retry button
- Renders vertical stack of InitiativeCards with space-y-3 gap
- Fix: SerializedInitiative type for tRPC Date→string serialization
2026-02-04 21:04:43 +01:00
Lukas May
f6caa5df1a feat(17-03): add SpawnArchitectDropdown and ActionMenu components
- SpawnArchitectDropdown: discuss/breakdown modes via tRPC mutations
- Brief success state on button text after spawn
- ActionMenu: archive with browser confirm, disabled edit/duplicate/delete
- No deleteInitiative tRPC procedure exists, so delete is placeholder
- Both components invalidate listInitiatives on success
2026-02-04 21:04:42 +01:00
Lukas May
e5acb9f214 feat(17-03): create CreateInitiativeDialog with shadcn primitives
- Install shadcn Dialog, Input, Label, Textarea components
- Move from @/ literal dir to src/components/ui/ (known shadcn CLI issue)
- CreateInitiativeDialog: controlled dialog with name/description fields
- tRPC createInitiative mutation with loading/error states
- Form resets on open, validates name non-empty
2026-02-04 21:04:05 +01:00
Lukas May
ec93835ae5 feat(17-02): create InitiativeCard component
- Renders initiative name, StatusBadge, ProgressBar, and phase count
- Fetches phase stats per-card via trpc.listPhases (self-contained)
- Spawn Architect dropdown with discuss/breakdown modes
- More actions menu with edit/duplicate/archive/delete
- Responsive: stacks vertically on mobile, hides phase count text
- Card clickable with stopPropagation on action buttons
2026-02-04 21:03:44 +01:00
Lukas May
ff9c17c05b docs(17-01): complete StatusBadge & ProgressBar plan
Tasks completed: 2/2
- StatusBadge component with color-coded initiative/phase statuses
- ProgressBar component with percentage-based fill

SUMMARY: .planning/phases/17-initiative-dashboard/17-01-SUMMARY.md
2026-02-04 21:01:59 +01:00