Commit Graph

787 Commits

Author SHA1 Message Date
Lukas May
5d8830d2d3 fix: Write context/index.json so agents can look up tasks by phase
Agents were bulk-reading all context task files (39 files) because
filenames are opaque IDs and there was no way to find phase-relevant
tasks without reading every file. Now writeInputFiles generates a
context/index.json with tasksByPhase mapping phaseId to task metadata
(file, id, name, status). Prompt updated to direct agents to read
the index first.
2026-03-04 11:55:22 +01:00
Lukas May
26ed9e0395 fix: Tell agents context files are on-demand, not bulk-read
Agents were reading all contextFiles (38 tasks + 8 phases) upfront,
wasting massive context window. Updated INPUT_FILES and SESSION_STARTUP
prompts to clearly distinguish assignment files (read all) from context
files (read only when needed).
2026-03-04 11:48:25 +01:00
Lukas May
069eb66acb feat: Add project filter to listInitiatives
Add findByProjectId to InitiativeRepository using a subquery on the
initiative_projects junction table. Extend the listInitiatives tRPC
procedure to accept an optional projectId filter that composes with
the existing status filter. Add a project dropdown to the initiatives
page alongside the status filter.
2026-03-04 11:40:32 +01:00
Lukas May
b6ac797644 feat: Add "New Chat" button to reset chat session in-place
Adds startNewSession() to useChatSession hook that closes the current
session without closing the panel. New Plus button in chat header
appears when a conversation exists, with shift+click to skip confirm.
2026-03-04 11:39:58 +01:00
Lukas May
9c09683029 fix: Add scope awareness to chat prompt so agents focus on target entities
Pass targetId to buildChatPrompt and add <scope> block that clearly
distinguishes primary target files from context files. Context entities
may be modified when necessary (e.g. dependency links) but the agent
is instructed to focus changes on the primary target.
2026-03-04 11:31:49 +01:00
Lukas May
354950bb8a fix: Retry sends message with retry flag to avoid duplicate storage
Added retry:true flag to sendChatMessage input. Server skips storing
the user message when retry is set. Frontend uses a dedicated
retryLastMessage function that skips the optimistic message add.
2026-03-04 11:25:43 +01:00
Lukas May
84dcb0193d feat: Show agent errors in chat UI with retry button
When the chat agent crashes (e.g., expired OAuth token), display the
error message inline with a Retry button that re-sends the last user
message. Input stays enabled so users can also send a new message.
2026-03-04 11:23:41 +01:00
Lukas May
413a501570 fix: Pass chatSessionRepository through createContext in trpc-adapter
The createContext call manually enumerates every field rather than
spreading, so the new repo was silently dropped even though it existed
on the options object.
2026-03-04 10:56:47 +01:00
Lukas May
e4489f8c7a fix: Add chatSessionRepository to TrpcAdapterOptions
The repo was created in container.ts but silently dropped because
TrpcAdapterOptions (which derives ServerContextDeps) was missing the
field. This caused 500 errors on all chat session procedures.
2026-03-04 10:33:23 +01:00
Lukas May
1b5fdfde55 fix: Add error toasts and optimistic messages to chat session hook
Errors from sendChatMessage were silently swallowed. Now shows toast
on failure and immediately renders the user's message optimistically.
2026-03-04 10:31:19 +01:00
Lukas May
f06ac953eb fix: Increase detail agent task sizing to reduce tiny-task overhead
Each execute agent has significant startup cost (context loading, codebase
exploration, baseline tests). The previous sizing guidance (sweet spot
<150 lines, 1-3 files, merge at <20 lines) produced tasks too small to
justify that overhead.

New guidance targets cohesive feature units: 200-500 lines across 3-6
files as the sweet spot, merge threshold at <100 lines, and explicit
instruction to bundle related changes (validation + route + tests = one
task, not three).
2026-03-04 10:24:54 +01:00
Lukas May
2653e4c7ad fix: Add font-display to initiative detail header 2026-03-04 10:23:58 +01:00
Lukas May
1db5e2dc56 fix: Replace Instrument Serif with Playfair Display for display headings
Instrument Serif is inherently condensed and illegible at heading sizes.
Playfair Display is wider, has proper variable weight support (400-900),
and reads well at all sizes.
2026-03-04 10:23:26 +01:00
Lukas May
1cfe51b10e fix: Remove faux-bold and tracking-tight from Instrument Serif headings
Instrument Serif only ships weight 400, so font-bold/font-semibold
caused ugly browser-synthesized faux-bold. Tracking-tight compressed
it further. Removed both and bumped sizes slightly to let the display
font breathe.
2026-03-04 10:20:08 +01:00
Lukas May
1aef986127 fix: Sort pipeline tasks by dependency order instead of priority+createdAt
The Execution tab's PipelinePhaseGroup was using sortByPriorityAndQueueTime
which ignores task dependencies entirely. Tasks now sort topologically via
topologicalSortPhases, matching the Plan tab's TaskGraph behavior.

- Add listInitiativeTaskDependencies tRPC procedure (bulk fetch)
- Fetch task deps in PipelineTab, group by phase, pass through
- Replace priority sort with topological sort in PipelinePhaseGroup
- Show "blocked by N" count on PipelineTaskCard
2026-03-04 10:18:26 +01:00
Lukas May
fcf822363c feat: Add persistent chat sessions for iterative phase/task refinement
Introduces a chat loop where users send instructions to an agent that
applies changes (create/update/delete phases, tasks, pages) and stays
alive for follow-up messages. Includes schema + migration, repository
layer, chat prompt, file-io action field extension, output handler chat
mode, revert support for deletes, tRPC procedures, events, frontend
slide-over UI with inline changeset display and revert, and docs.
2026-03-04 10:14:28 +01:00
Lukas May
d6fb1abcba fix: Add missing Instrument Serif font files and @font-face declarations
font-display class referenced Instrument Serif but no font was loaded,
causing fallback to condensed Georgia serif.
2026-03-04 10:14:06 +01:00
Lukas May
2948eb1139 feat: Add tiptap editor for task descriptions in slide-over panel
- Add updateTask tRPC mutation (name, description fields)
- Replace static description with TiptapEditor in TaskSlideOver
- Auto-detect existing markdown descriptions and convert to tiptap JSON
- Debounced auto-save with flush on close/unmount
- Saving indicator in header
2026-03-04 09:06:44 +01:00
Lukas May
38be28e443 fix: Widen task slide-over panel to max-w-2xl (672px) 2026-03-04 08:51:37 +01:00
Lukas May
095b23a825 fix: Widen task slide-over panel from max-w-md to max-w-xl 2026-03-04 08:33:48 +01:00
Lukas May
b223427bd3 fix: Use fixed-position slide-over and render markdown descriptions with tiptap
- Switch TaskSlideOver from absolute to fixed positioning so it overlays
  the viewport instead of fighting with phase panel scroll
- Render task descriptions as rich HTML via markdownToSafeHtml (markdown
  → tiptap JSON → HTML roundtrip) with prose typography classes
- Move TaskSlideOver render to ExecutionProvider level in ExecutionTab
- Remove unnecessary relative overflow-hidden wrapper from PhaseDetailPanel
- Export markdownToSafeHtml from markdown-to-tiptap utility
2026-03-04 08:08:53 +01:00
Lukas May
2d15dcf368 feat: Replace task modal with slide-over panel and enrich task nodes
- Add category color mapping utility (lib/category.ts)
- Enhance TaskNode to 2-line layout with category badge, priority, blocked count
- Create TaskSlideOver panel that animates in from right within phase detail
- Remove centered TaskModal/TaskDetailModal in favor of contextual slide-over
- Update PipelineTab to also use TaskSlideOver
2026-03-04 08:01:48 +01:00
Lukas May
5a5d48aecc feat: Swap display font from Plus Jakarta Sans to Instrument Serif
Plus Jakarta Sans was too similar to Geist Sans — invisible difference.
Instrument Serif creates strong serif/sans contrast for headings, making
typographic hierarchy immediately obvious.
2026-03-04 08:01:04 +01:00
Lukas May
4e04863e32 feat: Polish pass — display font on headings, empty states, card interactivity, panel dividers
- Apply font-display (Plus Jakarta Sans) to all page h1/h2 headings
- Wire interactive Card prop on initiative cards and agent cards
- Redesign empty states with icons: agents (Users), inbox (Inbox/MessageSquare), right panels (Terminal)
- Unify initiative detail tabs to border-b-2 indicator style matching settings
- Strengthen two-panel dividers on agents and inbox pages (lg:border-r)
- Clean up filter pill badges — replace nested Badge with simpler span
- Increase PhaseAccordion spacing for better readability
- Fix error state styling in settings to use status tokens
- Increase settings/projects section spacing
2026-03-04 07:52:22 +01:00
Lukas May
2b62160c95 fix: Polish settings pages — display font, status tokens, spacing
Apply font-display to headings across settings layout and health page.
Replace text-destructive with text-status-error-fg for consistency with
the design system status tokens. Increase projects page section spacing
from space-y-4 to space-y-6.
2026-03-04 07:50:30 +01:00
Lukas May
7e60cbfff9 feat: Premium design overhaul — typography, atmosphere, animations, component polish
- Add Plus Jakarta Sans as display font for headings
- Add subtle noise texture overlay + indigo radial gradient for depth
- New keyframe animations: glow-pulse, fade-in-up, scale-in, slide-in-right
- Card: interactive hover-lift + selected ring variants
- Button: scale micro-interactions, destructive glow, transition-all
- Header: logo upgrade with wordmark, animated nav indicator bar, glass search button, gradient shadow depth
- StatusDot: glow halos per status variant (active/success/error/warning/urgent)
- HealthDot: glow effects for connected/disconnected/reconnecting states
- Card hover-lift and status glow CSS utilities
2026-03-04 07:30:06 +01:00
Lukas May
dd86f12057 feat: Add page-level entrance animations using motion library
Subtle fade-in + y-offset animations on mount for all main pages
(initiatives list, initiative detail, agents, inbox) and staggered
card animations for initiative and agent lists.
2026-03-04 07:28:53 +01:00
Lukas May
af092ba16a feat: Add task execution graph within phase detail panel
Tasks are now grouped by dependency depth using the same
groupPhasesByDependencyLevel utility. Parallel tasks are wrapped in dashed
containers, sequential layers connected by status-aware lines. Replaces
the flat TaskRow list and DependencyIndicator callout bars.
2026-03-04 07:20:44 +01:00
Lukas May
9f88d5b433 feat: Replace flat phase sidebar with vertical execution graph
Phases are now grouped by dependency depth using groupPhasesByDependencyLevel.
Single-phase layers render as compact nodes, multi-phase layers are wrapped in
a dashed "PARALLEL" container. Connectors between layers turn green when prior
layers are all completed. Staggered entrance animation per layer.
2026-03-04 05:44:23 +01:00
Lukas May
6a9d9e3452 feat: Redesign task and phase dependency display in plans tab
Replace plain text dependency indicators with visual, status-aware components:
- New DependencyChip/PhaseNumberBadge components with status-colored styling
- Sidebar shows compact numbered circles for phase deps instead of text
- Detail panel uses bordered cards with phase badges and status indicators
- Task dependency callout bars with resolved/total counters
- Collapse mechanism for tasks with 3+ dependencies (+N more button)
- Full dark mode support via semantic status tokens
2026-03-04 05:28:11 +01:00
Lukas May
9e7c246280 fix: Switch auto-spawn from discuss to refine agent, surface in UI
The auto-spawned agent on initiative creation was using discuss mode
(Q&A) when it should use refine mode (expand content). Now:

- Description seeds root page as tiptap content (split on double newlines)
- Spawns refine agent with the populated page in inputContext
- getActiveRefineAgent broadened to also surface discuss agents (for
  CLI-spawned discuss agents)
- RefineAgentPanel shows mode-appropriate label for discuss vs refine
2026-03-03 14:25:43 +01:00
Lukas May
b38a2ec034 fix: Pass task with description to auto-spawned discuss agent
The discuss agent spawned on initiative creation received only the
initiative in its inputContext, missing the task that carries the user's
description. The agent started without knowing what to discuss.
2026-03-03 14:13:45 +01:00
Lukas May
3d04cb2081 fix: Surface active architect agents in initiative activity state
Auto-spawned discuss/plan/refine agents were invisible because:
1. listInitiatives only filtered for mode='detail' agents
2. deriveInitiativeActivity returned 'idle' for zero phases before
   checking for active agents

Broadened agent filter to all architect modes (discuss, plan, detail,
refine), moved active agent check before zero-phases early return, and
added 'discussing'/'refining' activity states with pulsing indicators.
2026-03-03 14:12:20 +01:00
Lukas May
e4289659cd chore: Re-record full-flow cassettes after task dependency changes
Prompt changes in detail.ts invalidated the old cassette hashes.
Re-recorded all 4 cassettes with updated prompt content. Replay
verified passing in 12s.
2026-03-03 13:56:47 +01:00
Lukas May
9b91ffe0e5 fix: Persist and expose task dependencies from detail output
Detail agents define task dependencies in YAML frontmatter but they were
silently dropped — never written to the task_dependencies table. This
caused all tasks to dispatch in parallel regardless of intended ordering,
and the frontend showed no dependency information.

- Add fileIdToDbId mapping and second-pass dependency creation in
  output-handler.ts (mirrors existing phase dependency pattern)
- Add task_dependency to changeset entry entityType enum
- Add listPhaseTaskDependencies tRPC procedure for batch querying
- Wire blockedBy in PhaseDetailPanel and PhaseWithTasks from real data
- Clarify dependency semantics in detail prompt
2026-03-03 13:46:29 +01:00
Lukas May
536cdf08a1 feat: Propagate task summaries and input context to execution agents
Execution agents were spawning blind — no input files, no knowledge of
what predecessor tasks accomplished. This adds three capabilities:

1. summary column on tasks table — completeTask() reads the finishing
   agent's result.message and stores it on the task record
2. dispatchNext() gathers full initiative context (initiative, phase,
   sibling tasks, pages) and passes it as inputContext so agents get
   .cw/input/task.md, initiative.md, phase.md, and context directories
3. context/tasks/*.md files now include the summary field in frontmatter
   so dependent agents can see what prior agents accomplished
2026-03-03 13:42:37 +01:00
Lukas May
86a1912959 feat: Add description field and auto-spawn discuss agent on initiative creation 2026-03-03 13:40:37 +01:00
Lukas May
9edc93a268 feat: Auto-resume idle agents for inter-agent conversations
When an agent asks a question via `cw ask` targeting an idle agent,
the conversation router now auto-resumes the idle agent's session so
it can answer. Previously, questions to idle agents sat unanswered
forever because target resolution only matched running agents.

Changes:
- Add `resumeForConversation()` to AgentManager interface and implement
  on MultiProviderAgentManager (mirrors resumeForCommit pattern)
- Relax createConversation target resolution: prefer running, fall back
  to idle (was running-only)
- Trigger auto-resume after conversation creation for idle targets
- Add concurrency lock (conversationResumeLocks Set) to prevent
  double-resume race conditions
2026-03-03 13:29:39 +01:00
Lukas May
938700d45d feat: Make inter-agent communication prompt mode-aware
Planning modes (plan, refine) get a minimal block with just cw ask
syntax. Execution modes get the full protocol: commands table, shell
recipe for listener lifecycle, targeting guidance, when/when-not
decision criteria, good/bad examples, and answering guidelines.
2026-03-03 13:26:47 +01:00
Lukas May
3e678f2591 fix: Show detailing indicator by including detail tasks in listInitiativeTasks
listInitiativeTasks was filtering out detail tasks server-side, so the
detailAgentByPhase mapping could never resolve agent.taskId to a phaseId.
Move the filter to client-side (displayTasks) so detail tasks are available
for agent mapping but excluded from counts and display grouping.
2026-03-03 13:25:29 +01:00
Lukas May
0ab7b54ad7 feat: Show detailing status in pipeline tab phase groups
Thread detail agent info through PipelineGraph → PipelineStageColumn →
PipelinePhaseGroup. Phase groups now show spinner + "Detailing…" when a
detail agent is active and "Review changes" when finished with no tasks.
2026-03-03 13:13:07 +01:00
Lukas May
411700d37d feat: Show detailing status in initiative overview and phase sidebar
Add 'detailing' activity state derived from active detail agents
(mode=detail, status running/waiting_for_input). Initiative cards show
pulsing "Detailing" indicator. Phase sidebar items show spinner during
active detailing and "Review changes" when the agent finishes.
2026-03-03 13:08:05 +01:00
Lukas May
96386e1c3d feat: Replace initiative card N+1 queries with server-computed activity indicator
listInitiatives now returns an activity object (state, activePhase, phase
counts) derived server-side from phases, eliminating per-card listPhases
queries. Initiative cards show a StatusDot with pulse animation + label
instead of a static StatusBadge. Removed redundant View and Spawn Architect
buttons from cards. Added variant override prop to StatusDot.
2026-03-03 12:49:07 +01:00
Lukas May
b74b59b906 fix: Align subscription status mapping with tRPC state machine
tRPC subscriptions use connecting/pending/error/idle — not success.
The old code mapped pending→isConnecting and waited for success (which
never fires), causing AgentOutputViewer to permanently show "Connecting...".

Now: connecting→isConnecting, pending→isConnected, idle→disconnected.
2026-03-03 12:46:19 +01:00
Lukas May
c8f370583a feat: Add codebase exploration to architect agent prompts
Architect agents (discuss, plan, detail, refine) were producing generic
analysis disconnected from the actual codebase. They had full tool access
in their worktrees but were never instructed to explore the code.

- Add CODEBASE_EXPLORATION shared constant: read project docs, explore
  structure, check existing patterns, use subagents for parallel exploration
- Inject into all 4 architect prompts after INPUT_FILES
- Strengthen discuss prompt: analysis method references codebase, examples
  cite specific paths, definition_of_done requires codebase references
- Fix spawnArchitectDiscuss to pass full context (pages/phases/tasks) via
  gatherInitiativeContext() — was only passing bare initiative metadata
- Update docs/agent.md with new tag ordering and shared block table
2026-03-03 12:45:14 +01:00
Lukas May
1043079a08 feat: Persist agents page filter in URL query params, default to questions 2026-03-03 12:42:32 +01:00
Lukas May
2f2ad6eb95 feat: Add remove account button to health page UI 2026-03-03 12:08:48 +01:00
Lukas May
86c6ad8be1 chore: Switch dev.sh to side-by-side split layout (server | web) 2026-03-03 12:04:23 +01:00
Lukas May
2eada071a1 fix: Use npx tsx so tsx resolves from local node_modules 2026-03-03 12:03:05 +01:00
Lukas May
0fad4a42b9 chore: Move dev.sh into workdir/ with correct working directory 2026-03-03 12:02:21 +01:00