Commit Graph

763 Commits

Author SHA1 Message Date
Lukas May
06b768e358 feat: Polish review tab — viewed tracking, file tree, syntax highlighting, better UX
- Add file "viewed" checkmarks with progress tracking (X/26 viewed in header + sidebar)
- Add directory-grouped file tree in sidebar with review progress bar
- Add sticky file headers that stay visible when scrolling through long diffs
- Add file change type badges (NEW/DELETED/RENAMED) with colored left borders
- Add syntax highlighting via shiki with lazy loading and progressive enhancement
- Add merge confirmation dropdown showing unresolved comments + viewed progress
- Make Approve & Merge button prominently green, Request Changes styled with error tokens
- Show full branch names instead of aggressively truncated text
- Add always-visible comment dots on lines with comments, subtle hover on others
- Improve hunk headers with two-tone @@ display and context function highlighting
- Add review progress bar to sidebar with file-level viewed state
2026-03-05 11:30:48 +01:00
Lukas May
173c7f7916 feat: Persist review comments to database
Review comments on phase diffs now survive page reloads and phase
switches. Adds review_comments table (migration 0028), repository
port/adapter (13th repo), tRPC procedures (listReviewComments,
createReviewComment, resolveReviewComment, unresolveReviewComment),
and replaces useState-based comments in ReviewTab with tRPC queries
and mutations.
2026-03-05 11:16:54 +01:00
Lukas May
69d2543995 fix: Scope loading spinner to diff pane only, keep sidebar always mounted 2026-03-05 11:12:51 +01:00
Lukas May
41cbc2c76c fix: Fix sidebar layout — sticky height constraint, padding on content only 2026-03-05 11:12:06 +01:00
Lukas May
a9832fc5ae feat: Replace horizontal commit nav with VSCode-style sidebar icon switcher
Move commit navigation from a horizontal strip into ReviewSidebar with a
vertical icon strip (Files/Commits views). Delete CommitNav.tsx.
2026-03-05 11:09:25 +01:00
Lukas May
222d73d0d6 fix: Clean up agent worktrees, branches, and logs on dismiss and auto-cleanup
- Track worktree removal success in autoCleanupAfterCompletion() instead of
  always returning removed:true when removeAgentWorktrees() throws
- Add removeAgentBranches() call to auto-cleanup path (agent/* branches were
  never cleaned after completion)
- Add filesystem cleanup (worktrees, branches, logs) to dismiss() to prevent
  resource leaks until next server restart
2026-03-05 11:09:11 +01:00
Lukas May
cbb8e66943 fix: Show commit nav for single-commit phases, remove early-exit guard 2026-03-05 11:03:15 +01:00
Lukas May
c58e0ea77e feat: Redesign review tab with phase selection, commit navigation, and consolidated toolbar
- Add BranchManager.listCommits() and diffCommit() for commit-level navigation
- Add getPhaseReviewCommits and getCommitDiff tRPC procedures
- New ReviewHeader: consolidated toolbar with phase selector pills, branch info,
  stats, integrated preview controls, and approve/reject actions
- New CommitNav: horizontal commit strip with "All changes" + individual commits,
  each showing hash, message, and change stats
- Slim down ReviewSidebar: file list only with dimming for out-of-scope files
  when viewing a single commit
- ReviewTab orchestrates all pieces in a single bordered card layout
2026-03-05 10:20:43 +01:00
Lukas May
f91ed5ab2d feat: Harden execute agent prompt with industry best practices
- Add Conventional Commits format requirement to git workflow
- Add pre-commit hook guidance (never --no-verify)
- Add secrets/credentials guard (never stage .env, API keys)
- Strengthen git add reasoning (explain why not git add .)
- Add CLAUDE.md read step to session startup
- Add lint/type-check gate to verification step
- Add doc update step to execution protocol
- Expand Definition of Done: lint, types, docs, debug cleanup
- Add anti-patterns: debug artifacts, spinning on failures (3x retry cap)
- Add stale reference check on file renames/moves
- Improve error signal guidance (include stack traces, not summaries)
2026-03-05 10:18:30 +01:00
Lukas May
91ce7dc4c0 fix: Prevent commit-retry infinite loop by preserving retry count across cleanup
commitRetryCount was being deleted in cleanupAgentState(), which runs
before tryAutoCleanup() checks the count. This reset the counter to 0
on every cycle, making MAX_COMMIT_RETRIES=1 dead code. Agents would
retry commits forever.

Move commitRetryCount cleanup to stop()/delete() only, letting
tryAutoCleanup() manage it during the retry lifecycle.
2026-03-05 10:10:40 +01:00
Lukas May
63400211b8 fix: Auto-complete tasks when agents finish successfully
The orchestrator's agent:stopped listener only called scheduleDispatch(),
never marking the agent's assigned task as completed. Tasks stayed
in_progress forever after their agent finished.

Now handleAgentStopped() calls dispatchManager.completeTask() before
scheduling new dispatches, respecting requiresApproval and skipping
manual (user_requested) stops.
2026-03-04 14:01:54 +01:00
Lukas May
748f0c294a feat: Add compact mode to TaskGraph, use in pipeline tab
TaskGraph now accepts a `compact` prop that hides the second line
(category badge, priority) and uses tighter vertical padding. Blocked-by
count moves inline on the first line as "N deps". Pipeline phase cards
pass compact; the plan tab's phase detail keeps the full two-line layout.
2026-03-04 13:16:37 +01:00
Lukas May
087f6945ae fix: Increase dark mode border contrast for graph lines and separators
Bump --border from L=16 to L=22 in dark mode, giving 11pt contrast
against card surfaces (was 5pt). Also bump --terminal-border to match.

Pipeline graph arrow tips: muted-foreground/40 → /60.
TaskGraph: remove opacity reduction on parallel container borders and
layer connectors so they use full border color.
2026-03-04 13:15:14 +01:00
Lukas May
baca008447 feat: Replace floating Execute button with pipeline summary bar
The orphaned Execute button is now part of a summary bar that shows
pipeline stats (phase count, task count, running/completed indicators)
with the execute action anchored to the right. The bar is always visible,
providing context even when no phases are actionable.
2026-03-04 13:12:12 +01:00
Lukas May
bf635375af refactor: Replace PipelineTaskCard with TaskGraph in pipeline phases
Pipeline phase cards now use the same TaskGraph component from the plan
tab's phase detail panel. This gives tasks a two-line layout with rail
dot, status badge, category badge, priority, and dependency layer
connectors instead of the flat single-line display.

Removes PipelineTaskCard (no longer imported anywhere).
2026-03-04 13:11:12 +01:00
Lukas May
685b2cb4ec feat: Refine pipeline UI — progress bars, status borders, collapsible tasks
- Wider phase cards (w-64 → w-72) to reduce task name truncation
- Left border accent colored by phase status for quick visual scanning
- Task count (completed/total) in phase header
- Thin progress bar below header showing completion percentage
- Collapsible task lists: phases with >5 tasks collapse with "N more" toggle
- Blocked-by count styled as a pill badge ("3 deps" instead of "blocked by 3")
- Dashed column connectors with better spacing between pipeline stages
2026-03-04 13:07:39 +01:00
Lukas May
029b5bf0f6 feat: Add approve+execute buttons to pipeline UI
Per-phase Play button now shows for pending phases (with tasks) and
approves before queueing. Top-level Execute button counts both pending
and approved phases, approving pending ones first.
2026-03-04 13:04:20 +01:00
Lukas May
1c7d6f20ee feat: Connect dispatch queue to agent spawning via auto-dispatch
ExecutionOrchestrator now listens for phase:queued and agent:stopped
events to drive the dispatch cycle, closing the gap between queueing
phases (Execute button) and actually spawning agents. Coalesced
scheduling prevents reentrancy with synchronous EventEmitter.
2026-03-04 12:55:20 +01:00
Lukas May
d03b204096 feat: Add theme-aware custom scrollbars
Thin 6px scrollbars using design tokens (--border, --muted-foreground)
so they blend properly in both light and dark mode. Uses standard
scrollbar-width/scrollbar-color plus WebKit pseudo-elements for
cross-browser coverage.
2026-03-04 12:44:54 +01:00
Lukas May
cc72c6d478 fix: Add missing await and update tests for async file-io reads 2026-03-04 12:29:10 +01:00
Lukas May
a0152ce238 fix: Convert sync file I/O to async in credential manager and usage module
Replace readFileSync/writeFileSync/mkdirSync with async equivalents from
fs/promises in default-credential-manager.ts and usage.ts to stop blocking
the Node.js event loop during credential read/write operations.
2026-03-04 12:26:37 +01:00
Lukas May
73a4c6cb0c fix: Convert sync file I/O to async in read path to unblock event loop
readFrontmatterFile, readFrontmatterDir, readSummary, readPhaseFiles,
readTaskFiles, readDecisionFiles, and readPageFiles all used readFileSync
and readdirSync which block the Node.js event loop during agent completion
handling. Converted to async using readFile/readdir from fs/promises and
added await at all call sites in output-handler.ts.
2026-03-04 12:25:34 +01:00
Lukas May
a2afc2e1fd fix: Convert sync file I/O to async in credential handler and account setup
Removes blocking readFileSync, writeFileSync, and mkdirSync calls from the
agent spawn hot path, replacing them with async fs/promises equivalents to
avoid stalling the Node.js event loop during credential operations.
2026-03-04 12:25:05 +01:00
Lukas May
bd0aec4499 fix: Convert sync file I/O to async in agent spawn path to unblock event loop
writeInputFiles, spawnDetached, and diagnostic writes now use
fs/promises (mkdir, writeFile) instead of mkdirSync/writeFileSync.
File writes in writeInputFiles are batched with Promise.all.
openSync/closeSync for child process stdio FDs remain sync as
spawn() requires the FDs immediately.
2026-03-04 12:15:31 +01:00
Lukas May
70fd996fa1 Revert "fix: Spawn chat agent in background to avoid blocking event loop"
This reverts commit 8ee02f6013.
2026-03-04 12:07:00 +01:00
Lukas May
8ee02f6013 fix: Spawn chat agent in background to avoid blocking event loop
sendChatMessage was awaiting the full agentManager.spawn() which
includes worktree creation, ~50 writeFileSync calls for input files,
credential setup, and process spawning. This blocked the Node.js event
loop long enough to cause ECONNREFUSED on the SSE connection.

Now the mutation returns immediately after storing the user message
and creating the task. The heavy spawn work runs in a detached promise.
On failure, a system message is stored so the UI can display the error.
2026-03-04 12:05:21 +01:00
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