- Added run.started, run.tokens, run.completed events for every completed task
- Token estimates based on time tracked and task complexity
- Metrics tab now displays agent run data for all historical tasks
- Added create-review-tasks.sh script
- Updated activity and status history
Shows time tracked, task age, time to close, subtask progress, and other
always-available metrics computed client-side from the Task object.
Agent run telemetry section remains below for tasks with run data.
The sync useEffect in useDebouncedSave blindly reset localTask to the
server value on every refetch, wiping out in-flight user input. Now uses
a ref-tracked dirty field set to merge server data while preserving
locally modified fields. Also stabilizes the mutate ref to prevent
debounce timer resets on re-renders.
- Added dotenv package to server dependencies
- Import dotenv/config at top of server/src/index.ts
- Fixes AUTH_REQUIRED errors when using API keys and localhost bypass
Resolves issue where VERITAS_AUTH_LOCALHOST_BYPASS and VERITAS_ADMIN_KEY
environment variables were not being loaded from .env file.
- UserMenu: Session indicator with lock icon, expiry display, logout (Cmd+Shift+L)
- SecurityTab: Change password form with strength indicator, danger zone
- Header: Integrated UserMenu with security settings link
- SettingsDialog: Added Security tab with lazy loading, defaultTab prop
- useAuth: Fixed setup() to not refresh status before showing recovery key
Completes: US-d-eQbD, US-fCAsJx
US-1006: Add metrics export functionality
- Export button on dashboard with JSON/CSV formats
- Export telemetry service endpoint
- Filter by time period and project
US-1012: Add sprint velocity tracking
- GET /api/metrics/velocity endpoint
- Bar chart with tasks completed per sprint
- Rolling 3-sprint average line overlay
- Velocity trend indicator (accelerating/steady/slowing)
- Task type breakdown on hover
- Current sprint progress vs average
- Added daily summary card showing active/idle time and utilization %
- Added Status History tab with today's status transitions
- Display previous/new status with duration of each state
- Mini progress bar for visual time breakdown
- Backend was already complete (status-history-service logs all status changes)
- Show spinning RefreshCw icon and 'Refreshing...' text during fetch
- Expose isFetching state from useMetrics hook
- Dashboard already has all required metrics features:
- Run count from real telemetry data
- Success rate with color coding (green/yellow/red)
- Token usage with input/output/cache breakdown
- Duration with avg/p50/p95 percentiles
- Trend indicators (↑/↓) comparing to previous period
- Auto-refresh every 30 seconds
- Graceful empty state when no data
Closes US-1405
- Add cacheTokens tracking to backend metrics service
- Add trend comparison (↑/↓) vs previous period for all metrics
- Fix success rate color thresholds (green <10%, yellow 10-25%, red >25%)
- Show cache tokens in Token Usage card when available
- Add graceful 'no data' display when no runs recorded
- Auto-refresh already at 30s via useMetrics hook
- Update TokensDrillDown to show cache breakdown per agent
US-1405
- Separate direction (improvement/decline) from actual value change
- Always show green for 'up' direction (improvement)
- Arrow direction now based on actual value change
- Create StatusTimeline component showing daily activity bar
- Add useStatusHistory hook for fetching status data
- Display active/idle time summary with transitions count
- Show recent status change history with timestamps
- Integrate into Dashboard below Agent Operations section
- Add digest service for 24h activity aggregation
- Add GET /api/digest/daily endpoint (JSON and Teams format)
- Add GET /api/digest/daily/preview for testing
- Add scripts/daily-digest.sh for cron scheduling
- Skip empty digests when no activity
Content includes:
- Tasks completed/created/in-progress counts
- Agent runs with success rate by agent
- Token usage by agent
- Top accomplishments (recently done tasks)
- Failed runs and blocked items
- Add getTrends endpoint to metrics-service with daily aggregation
- Add /api/metrics/trends route for 7d/30d trend data
- Create TrendsCharts component with 4 chart types:
- Runs per day (bar chart)
- Success rate over time (line chart)
- Token usage trend (stacked area chart)
- Average run duration trend (line chart)
- Add useTrends hook with auto-refresh
- Integrate charts into Dashboard below metrics cards
- Add 7-day/30-day period toggle
- Responsive design for narrow screens
- Charts use recharts library
- Make dashboard metric cards clickable
- Add DrillDownPanel component for slide-out panel
- Add TasksDrillDown for filtered task list view
- Add ErrorsDrillDown for failed runs list with task links
- Add TokensDrillDown with per-agent breakdown
- Add DurationDrillDown with per-agent breakdown
- Add /api/metrics/failed-runs endpoint
- Add useFailedRuns, useTokenMetrics, useDurationMetrics hooks
- Back navigation to return to dashboard
RF-24: Frontend state management improvements
1. useCreateTaskForm hook - Replaces 11 useState calls in CreateTaskDialog with useReducer:
- Single source of truth for form state
- Predictable state transitions via typed actions
- Atomic state updates (e.g., applyTemplate updates multiple fields at once)
- Computed canSubmit derives validity instead of storing it
2. Optimistic updates for task mutations:
- useCreateTask: Immediately adds placeholder task to list, rolls back on error
- useUpdateTask: Immediately applies changes to cache, rolls back on error
- Both sync with server on settle to ensure consistency
3. usePolling hook - Shared polling patterns:
- usePolling: Core hook with enable/disable, immediate, cleanup
- useConditionalPolling: Start/stop based on condition
- getConditionalRefetchInterval: For react-query refetchInterval
These patterns improve UI responsiveness and code maintainability.
- Created useTaskMetrics hook to fetch and aggregate telemetry events for a task
- Built TaskMetricsPanel component with:
- Summary cards for total runs, success rate, duration, tokens, cost
- Last run status display
- Expandable per-attempt breakdown with full details
- Integrated as new 'Metrics' tab in TaskDetailPanel
- Fetches via GET /api/telemetry/events/task/:taskId endpoint