Commit graph

110 commits

Author SHA1 Message Date
Brad Groux
f0c72717d3 feat(US-1101, US-1102): settings infrastructure + feature toggle hooks
- Added FeatureSettings types (Board, Tasks, Agents, Telemetry, Notifications, Archive)
- AppConfig.features field with backward-compatible defaults
- ConfigService auto-merges defaults for missing keys on load
- Deep merge utility for partial config updates
- GET/PATCH /api/settings/features endpoints
- useFeatureSettings, useFeatureSetting, useUpdateFeatureSettings hooks
- Debounced update helper for rapid toggle changes
- Optimistic updates with rollback on error
2026-01-28 02:16:23 -06:00
Brad Groux
0c12bacbf2 docs: Sprint 12-14 planning — LAN access, status indicator, metrics refactoring
Sprint US-1200 (6 stories): LAN access — Vite/Express binding, CORS,
  firewall, auto-detect URL, responsive audit
Sprint US-1300 (6 stories): Working indicator — status API, animated
  component, real-time hook, Veritas integration, history, header layout
Sprint US-1400 (7 stories): Metrics refactoring — telemetry ingestion,
  reporter, service refactor, task metrics, dashboard refresh, run badges,
  cost tracking

All three feature requests investigated, documented, tasks created with
subtasks, sprint docs written.
2026-01-28 02:06:58 -06:00
Brad Groux
785d60cbcd feat: real-time board updates via WebSocket broadcast + polling
- Add broadcast-service.ts that sends task:changed events to all
  connected WebSocket clients on any task mutation
- Wire broadcasts into task routes (create, update, delete, archive,
  restore, reorder)
- Add useTaskSync hook — connects to WS, listens for task:changed,
  invalidates React Query cache for instant board updates
- Add polling fallback: refetchInterval=10s, staleTime=5s on useTasks
- Auto-reconnect WebSocket with 3s backoff on disconnect

Board now updates within seconds of any external change (API calls
from Clawdbot agents, CLI, etc.) without manual page refresh.

Fixes: task_20260128_Zk4oV0
2026-01-28 01:20:56 -06:00
Brad Groux
f7f1487b12 feat: archived task read-only view, restore, and pagination
- Add readOnly prop to TaskDetailPanel — shows archived badge,
  displays all fields as non-editable text, hides delete/template buttons,
  shows 'Restore to Board' button instead
- Wire up task click in ArchiveSidebar to open read-only detail panel
- Add pagination to archive list (25 per page with 'Load More' button)
- Show results count when filters reduce the list
- ArchiveSidebar now manages its own detail panel internally

Fixes: task_20260128_tDh8SO
2026-01-28 01:15:40 -06:00
Brad Groux
ce5eda58b1 feat: add drag-and-drop task reordering within columns
- Add position field to Task type (shared/types.ts)
- Add POST /api/tasks/reorder endpoint to persist ordering
- Update task-service with reorderTasks() method
- Switch TaskCard from useDraggable to useSortable (@dnd-kit/sortable)
- Wrap KanbanColumn tasks in SortableContext with verticalListSortingStrategy
- Update KanbanBoard DnD handlers to support both within-column reorder
  and cross-column status changes
- Sort tasks by position in useTasksByStatus hook
- Use closestCorners collision detection for better sortable support

Fixes: task_20260128_4qCzGr
2026-01-28 01:08:21 -06:00
Brad Groux
8f8f4a9031 fix: stopTimer YAML crash — strip undefined values from timeTracking
- stopTimer() set activeEntryId: undefined which js-yaml cannot serialize
- Changed to omit activeEntryId when clearing (conditional spread)
- Same fix in deleteTimeEntry() for active entry deletion
- Added deepCleanUndefined() to taskToMarkdown() as defense-in-depth
- Imported TimeTracking type for explicit typing

Fixes: task_20260128_RrQUWH
2026-01-28 01:00:56 -06:00
Brad Groux
4a1b92b46c fix: remove duplicate ProjectConfig import in SettingsDialog 2026-01-28 00:37:38 -06:00
Brad Groux
2b5d07c1f1 Convert hardcoded sprints to managed list
- Added SprintConfig interface extending ManagedListItem in shared types
- Created SprintService with seed migration from existing tasks
- Added /api/sprints endpoints using managed list router pattern
- Implemented useSprints and useSprintsManager hooks
- Updated TaskDetailPanel and CreateTaskDialog to use dynamic sprint list
- Added sprint management UI to SettingsDialog
- Sprint IDs match existing task.sprint values for backward compatibility
- Reference counter prevents deletion of sprints with tasks
2026-01-28 00:29:16 -06:00
Brad Groux
a8ec6f1406 milestone: Sprint US-900 complete — all 20 stories archived
Sprint 9 (US-900): 20 stories delivered
- US-901–US-910: Enhanced task template system
- US-911–US-916: Entity management (comments, attachments, types, projects, tags→removed)
- US-917: Sprint assignment field
- US-918: Subtask progress on Kanban cards
- US-919: Task type display on Kanban cards
- US-920: Auto-archive by sprint
- Fixed US-800 archived tasks project assignment (Sprint 8 → veritas-kanban)
2026-01-28 00:07:16 -06:00
Brad Groux
027bc22eb3 feat(US-920): Auto-archive by sprint instead of project
- Server: getArchiveSuggestions groups by sprint instead of project
- Server: archiveSprint replaces archiveProject
- Server: bulk-archive endpoint takes sprint instead of project
- Server: added 'sprint_archived' activity type
- Frontend: ArchiveSuggestionBanner shows sprint completion banners
- Frontend: SprintArchiveSuggestion replaces ProjectArchiveSuggestion
- Frontend: API layer + hooks updated (archiveSprint, bulkArchive)
- Removed dead ProjectArchiveSuggestion.tsx
2026-01-27 23:59:42 -06:00
Brad Groux
b353ec1b53 fix: add US-100 sprint to sprint picker 2026-01-27 23:47:28 -06:00
Brad Groux
4406aa8efd chore: assign sprints to all tasks (active + archived)
- US-700 series (archive): US-701 through US-711
- US-800 series (archive): US-801 through US-808
- US-900 series (active): US-901 through US-919
- Created US-917 (sprint assignment), US-918 (subtask count), US-919 (task type on cards)
- All three marked done with closing comments
- Fixed path traversal in attachment filename sanitization
2026-01-27 23:38:39 -06:00
Brad Groux
331fd966a8 refactor: remove tags feature entirely, fix TS errors and path traversal sanitization
- Removed tag-service, TagPicker, useTags hook, tags routes, tags.json
- Stripped tag references from TaskCard, TaskDetailPanel, CreateTaskDialog,
  ApplyTemplateDialog, SettingsDialog, ArchiveSidebar, KanbanBoard/Column
- Removed tags from shared Task type and template types
- Fixed ManagedListManager prop types (Promise<void> → Promise<any>)
- Fixed unused imports in FilterBar, CreateTaskDialog, TaskDetailPanel
- Fixed unused generic param in UseManagedListOptions
- Fixed path traversal in attachment filename sanitization (collapse ..)
- All tests passing (62/62), full build clean
2026-01-27 23:33:15 -06:00
Brad Groux
e21dc2ec77 fix: black screen on task click + updated color palette
- Fixed Radix Select crash: empty string value ('') not supported
  Changed 'No project' SelectItem from value='' to value='__none__'
  in both TaskDetailPanel and CreateTaskDialog
- Updated task type colors: removed Rose, added bright Pink (fuchsia),
  darkened Blue (700), darkened Green (700), added Yellow, added Brown
2026-01-27 22:49:44 -06:00
Brad Groux
e6ac8cfe6a fix: remove hide/show feature, allow deleting any managed list item
- Removed isDefault protection from delete (any item can be deleted)
- Removed hide/show toggle button from ManagedListManager
- Delete still blocked if item has task references (with clear message)
- Cleaned up isHidden flags from task-types.json
- Simplified delete dialog messaging
2026-01-27 22:35:06 -06:00
Brad Groux
d28cf29598 fix: infinite recursion in project/tag service init, ID mismatch in seed migration
- ProjectService.init() had infinite recursion: list() → init() → seed → list() → init()...
- TagService seed checked file existence (always true after super.init creates it)
- Seed migrations now use seedItem() with raw project/tag strings as IDs
  so they match existing task.project and task.tags values
- Added seedItem() to ManagedListService base for custom-ID seeding
- Cleaned up task-types.json (removed duplicate, restored Research)
2026-01-27 22:30:53 -06:00
Brad Groux
93345980d6 fix(US-916): Use useTags hook for items in SettingsDialog
The useTagsManager hook only provides CRUD operations, not items. Need to call useTags() separately to get the items list.
2026-01-27 22:20:44 -06:00
Brad Groux
77910fdf06 fix: US-916 tag integration + US-911 review feedback
- Wire tags through KanbanBoard → KanbanColumn → TaskCard
- Render colored tag badges on cards (first 2 + overflow count)
- Tags settings section in SettingsDialog
2026-01-27 22:19:35 -06:00
Brad Groux
fc087bba50 feat: US-914 Project management with dropdown selection 2026-01-27 22:16:41 -06:00
Brad Groux
157630cb8b feat: US-915 ManagedListService + US-913 Custom task types
PHASE 1: US-915 ManagedListService Foundation
- Added ManagedListItem and ManagedListServiceOptions types to shared/src/types.ts
- Created ManagedListService<T> base class with full CRUD, reorder, and reference checking
- Created createManagedListRouter factory for generic Express routes
- Created useManagedList hook for React with TanStack Query integration
- Added managedList API helpers to web/src/lib/api.ts
- Created ManagedListManager React component with drag-to-reorder using @dnd-kit

PHASE 2: US-913 Custom Task Types
- Changed TaskType from union to string in shared types
- Added TaskTypeConfig interface extending ManagedListItem with icon and color
- Created TaskTypeService using ManagedListService with 4 built-in default types
- Registered task-types routes at /api/task-types
- Updated server validation in tasks.ts and templates.ts to accept dynamic types
- Created useTaskTypes hook with helper functions (getTypeIcon, getTypeLabel, etc.)
- Updated FilterBar to use dynamic task types
- Updated TaskCard to accept and use dynamic task types
- Updated KanbanBoard and KanbanColumn to fetch and pass task types
- Updated TaskDetailPanel to use dynamic task types
- Updated CreateTaskDialog to use dynamic task types
- Updated SettingsDialog template form to use dynamic task types
- Added Task Types management section to Settings with full CRUD and customization
- Added taskTypes API namespace to web/src/lib/api.ts

All UI components now render task types dynamically from .veritas-kanban/task-types.json
Icon and color customization available in Settings with 20+ Lucide icons and 10 colors
2026-01-27 22:09:21 -06:00
Brad Groux
76f71d2e0d feat(US-912): Implement task attachments with text extraction pipeline
Backend:
- Add Attachment types, limits config, and MIME type allowlist to shared types
- Create AttachmentService for file storage, upload/delete, archive lifecycle
- Create TextExtractionService supporting PDF, DOCX, XLSX, HTML, JSON, plain text
- Add attachment routes with multer upload middleware
- Add /api/tasks/:id/context endpoint for agent consumption
- Update task-service to handle attachments in frontmatter and lifecycle
- Install dependencies: multer, unpdf, mammoth, xlsx, mime-types

Frontend:
- Build AttachmentsSection component with drag-drop upload zone
- Add inline image thumbnails and expandable text previews
- Implement token cost warning banner (amber alert when ≥2 attachments)
- Add Attachments tab to TaskDetailPanel
- Add paperclip badge with count to TaskCard
- Create React hooks: useUploadAttachment, useDeleteAttachment, useTaskContext

Tests:
- Comprehensive test suites for attachment-service and text-extraction-service
- Cover upload, delete, archive, extraction for all file types

All 13 subtasks completed. Project compiles cleanly.
2026-01-27 21:49:00 -06:00
Brad Groux
f1c01eae72 feat(US-911): add task comments system for agent activity logs 2026-01-27 21:05:16 -06:00
Brad Groux
9f65175768 fix: match ApplyTemplateDialog help formatting to Template Guide style 2026-01-27 20:57:10 -06:00
Brad Groux
019d2613f5 feat: add help context to ApplyTemplateDialog with usage guide 2026-01-27 20:54:26 -06:00
Brad Groux
b243728f08 feat(US-910): Help context windows + keyboard shortcut fix 2026-01-27 20:50:26 -06:00
Brad Groux
f87fe0f8af feat(US-907): Apply template to existing task 2026-01-27 20:41:20 -06:00
Brad Groux
a81dfecadf docs: expand Sprint 10 with agent comparison, failure alerts, daily digest, budget tracking, velocity 2026-01-27 20:34:42 -06:00
Brad Groux
9c883d0f10 docs: Update sprint-9 status to Complete (8/9 stories)
US-907 (Apply template to existing task) deferred - requires significant TaskDetailPanel changes. All other stories completed successfully.
2026-01-27 20:33:48 -06:00
Brad Groux
a8d8457331 feat(US-907): Apply template to existing task (TODO)
Deferred: Requires significant TaskDetailPanel changes

Implementation plan:
- Add 'Apply Template' button in TaskDetailPanel header
- Create ApplyTemplateDialog component
- Merge strategy: only fill empty fields (non-destructive)
- Option to force-overwrite with confirmation
- Subtasks appended (not replaced)
- Activity log records template application

Technical requirements:
- New API endpoint or client-side merge logic
- Template application with variable interpolation
- Conflict resolution UI for non-empty fields
- Undo/revert capability
2026-01-27 20:33:05 -06:00
Brad Groux
d1fbd39dcb feat(US-909): Enhanced template UI (integrated)
Enhanced template UI features implemented across previous stories:
- Category tabs in CreateTaskDialog template picker (US-904)
- Template cards with category badges and icons (US-904)
- Variable input form with custom variable prompts (US-903)
- Blueprint preview showing task list and dependencies (US-905)
- Responsive template selector with filtering

Future enhancements for dedicated editor:
- Full-page template editor (currently inline in Settings)
- Drag-and-drop subtask builder
- Visual blueprint dependency wiring
- Template preview panel
2026-01-27 20:32:50 -06:00
Brad Groux
42effb04ba feat(US-908): Template import/export
- Export all templates as JSON file
- Import templates from JSON file with duplicate detection
- template-io utility for file handling and validation
- Import/Export buttons in SettingsDialog templates section
- Duplicates skipped during import with notification
2026-01-27 20:32:24 -06:00
Brad Groux
f4bb9ef22a docs: add Sprint 10 plan - Metrics & Observability Expansion 2026-01-27 20:31:22 -06:00
Brad Groux
219cf1a5bc feat(US-906): Agent & dependency defaults
- Add agent field to template editor (preferred agent for code tasks)
- Agent selector in AddTemplateForm with all available agents
- Agent displayed in template list alongside other defaults
- Templates can specify preferred agent (claude-code, amp, copilot, gemini, veritas)
2026-01-27 20:30:08 -06:00
Brad Groux
f99c3efde8 feat(US-905): Multi-task blueprints
- Blueprint templates create multiple linked tasks with dependencies
- CreateTaskDialog shows blueprint preview with task list
- Dependencies resolved via refId mapping (blockedByRefs -> actual task IDs)
- All blueprint tasks created sequentially, dependencies auto-wired
- Added blockedBy support to CreateTaskInput
- Blueprint UI shows task count, dependencies, and subtask count
2026-01-27 20:29:14 -06:00
Brad Groux
58427d6c66 feat(US-904): Template categories
- Add template-categories utility with built-in categories (bug, feature, sprint, content, research, automation, custom)
- Category selector in template creation form
- Category badges displayed in template list
- Category filter tabs in CreateTaskDialog template selector
- Templates without category default to 'custom'
2026-01-27 20:27:06 -06:00
Brad Groux
453f771794 feat(US-903): Variable interpolation
- Add template-variables utility with support for {{date}}, {{datetime}}, {{project}}, {{author}}, {{custom:label}}
- Extract custom variables from templates and prompt user for values
- Interpolate variables in description and subtask titles on task creation
- Display custom variable input form in CreateTaskDialog
- Variables resolved at creation time for dynamic content
2026-01-27 20:24:37 -06:00
Brad Groux
a452b6a279 feat(US-902): Subtask templates
- Add subtasks field to CreateTaskInput
- Task service creates subtasks from template when task is created
- CreateTaskDialog displays subtasks from template
- Users can remove individual subtasks before creating
- Subtasks sorted by order field and auto-generated with IDs
2026-01-27 20:22:58 -06:00
Brad Groux
8a731e27d8 feat(US-901): Enhanced template schema
- Extend TaskTemplate with version, category, tags, agent, subtaskTemplates, and blueprint fields
- Add SubtaskTemplate and BlueprintTask interfaces
- Implement v0 to v1 migration in template service (backward compatible)
- Export template types from shared package
- Server validates enhanced schema on create/update
2026-01-27 20:21:16 -06:00
Brad Groux
99fe5ab385 feat(task_20260128_nYPgZw): Enhanced Task Templates - Sprint 9 planning complete 2026-01-27 20:17:15 -06:00
Brad Groux
6c3925ef53 docs: add Sprint 9 plan - Enhanced Task Templates 2026-01-27 20:16:43 -06:00
Brad Groux
e675406164 Add Sprint 8 docs + telemetry data 2026-01-26 15:50:23 -06:00
Brad Groux
01b692ccb5 Merge feature/us-808-optional-traces: Optional Traces 2026-01-26 12:36:08 -06:00
Brad Groux
e6faa846bf feat(traces): add optional coarse traces for agent runs (US-808)
TraceService:
- 4 coarse step types: init, execute, complete, error
- Trace ID = Attempt ID for natural correlation
- Traces stored as JSON files in .veritas-kanban/traces/
- Off by default (enable via POST /api/traces/enable)

API Endpoints:
- GET /api/traces/status — Check if tracing is enabled
- POST /api/traces/enable — Enable tracing
- POST /api/traces/disable — Disable tracing
- GET /api/traces/:attemptId — Get a specific trace
- GET /api/traces/task/:taskId — List all traces for a task

AgentService Integration:
- Automatically records trace steps when tracing is enabled
- init: worktree setup, prompt building
- execute: agent process running
- complete: post-run processing
- error: captures error details
2026-01-26 12:36:04 -06:00
Brad Groux
b7c5b64649 Merge feature/us-806-807-dashboard: Dashboard Component and Placement 2026-01-26 12:20:02 -06:00
Brad Groux
e80f4b706e feat(dashboard): add metrics dashboard with collapsible section (US-806, US-807)
Dashboard Features:
- Task counts row: Total, To Do, In Progress, Review, Done, Archived, Completed
- Agent ops row: Error rate, Token usage, Run duration (with p50/p95)
- Project filter dropdown
- Period selector (24h / 7d)
- Auto-refresh every 30 seconds
- Color-coded metrics (green/yellow/red for error rates)

Placement:
- Collapsible section below Kanban board
- Collapsed by default
- 'D' keyboard shortcut to toggle
- State persisted in localStorage

New files:
- useMetrics hook with formatting utilities
- Dashboard component with MetricCard and StatCard
- DashboardSection with collapsible wrapper
2026-01-26 12:19:57 -06:00
Brad Groux
6282b760da Merge feature/us-805-metrics-api: Metrics API 2026-01-26 12:18:04 -06:00
Brad Groux
ac8ffea1e5 feat(metrics): add metrics API for dashboard (US-805)
New endpoints:
- GET /api/metrics/tasks — Task counts by status, total, completed, archived
- GET /api/metrics/runs?period=24h|7d — Error rate, success rate, run counts
- GET /api/metrics/tokens?period=24h|7d — Token totals, per-run stats (avg, p50, p95)
- GET /api/metrics/duration?period=24h|7d — Duration stats (avg, p50, p95)
- GET /api/metrics/all?period=24h|7d — All metrics in one call

All endpoints support optional project filter.
2026-01-26 12:18:00 -06:00
Brad Groux
d02ee6367d Merge feature/us-804-token-tracking: Token Usage Tracking 2026-01-26 12:16:46 -06:00
Brad Groux
98d12e510c feat(telemetry): add token usage tracking endpoint (US-804)
New endpoint: POST /api/agents/:taskId/tokens

Accepts:
- inputTokens (required)
- outputTokens (required)
- totalTokens (optional, defaults to sum)
- attemptId (optional, uses current attempt)
- agent (optional, uses current attempt's agent)
- model (optional)

Emits run.tokens telemetry event for dashboard metrics.
2026-01-26 12:16:43 -06:00
Brad Groux
fd15139491 Merge feature/us-803-run-events: Emit Run Events 2026-01-26 12:16:03 -06:00