Add currentBead field to WorkerInfo in src/types.ts and maintain it in
src/store.ts: set it from bead.claim.succeeded (event.bead) and clear it
(null) on bead.released. Foundation for the worker-card current-bead
display. Update src/store.test.ts to cover claim->set and release->clear.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add side-by-side worker comparison analytics to the TUI analytics panel.
Users can now press 'c' to enter comparison mode and view detailed metrics
comparing two workers across performance, error, cost, and efficiency dimensions.
- Add WorkerComparison type with differences, percent differences, and winner per metric
- Add compareWorkers() method to WorkerAnalytics class
- Extend WorkerAnalyticsPanel with comparison view mode
- Add renderComparison() method with formatted comparison rows
- Add keyboard bindings: [c] toggle comparison, [↑/↓] cycle workers, [←/→] swap selection
Related to docs/plan.md Worker Comparison Analytics section.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Updated NeedleEventType union to reflect actual event types emitted by NEEDLE
- Fixed outdated event type names (e.g., bead.claimed → bead.claim.succeeded)
- Added missing event types (worker.errored, worker.exhausted, peer.stale, etc.)
- Updated parser test to use correct event types
- Verified parser compatibility with 86,545 actual NEEDLE log events (100% success rate)
The parser's normalizeJsonl function accepts any string for event_type,
ensuring forward compatibility with new NEEDLE versions. The type
definition update is primarily for documentation and IDE support.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Wire shared EventDeduplicator across all ingestion paths (JSONL tailer,
OTLP/gRPC receiver, OTLP/HTTP receiver) so duplicate events from dual
ingestion are silently dropped on (session_id, worker_id, sequence).
Also adds docs/needle-exporter-wiring.md (OTLP configuration guide for
NEEDLE), SpanDag React component, EventFilter.eventType field, and
various test/layout fixes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace coarse NeedleWorkerStatus ('idle'|'executing'|'draining'|'starting')
with the real NEEDLE state machine: BOOTING→SELECTING→CLAIMING→WORKING→CLOSING→STOPPED.
- Add NeedleState type, VALID_TRANSITIONS map, needleStateToStatus() helper in types.ts
- Track needleState + lastStateTransition per worker by consuming worker.state_transition events
- Surface all six states in TUI worker cards (WorkerGrid, WorkerDetail) with per-state icons/colors
- Surface all six states in web WorkerGrid.tsx with NEEDLE_STATE_LABELS and NEEDLE_STATE_COLORS
- Add getNeedleStateColor/getNeedleStateIcon to colors.ts
- Rewire stuck detection to fire on state-transition gaps (state_gap pattern in stuckDetection.ts)
- Add sequence-based event ordering via compareEventsBySequence and queryOrdered()
- Legacy event-type fallback preserved for workers not emitting state_transition events
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add NeedleEvent interface as the canonical internal shape versioned at
schema-version 1. Parser validates wire format and asserts schema version
on incoming events. Legacy LogEvent retained as backward-compatible adapter.
docs/schema.md documents all fields, the (worker_id, sequence) ordering
contract, and the full event taxonomy cross-referenced with NeedleEventType.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add types for fleet analytics dashboard:
- DurationBucket for bead completion histograms
- ModelPerformanceMetrics with duration distribution
- StrandMetrics for strand utilization tracking
- CompletionQualityIndicator for shallow completions
- FleetAnalytics aggregating all metrics
- FleetAnalyticsOptions for query configuration
Add CSS styles for analytics dashboard:
- Stats bar with quick metrics
- Tab navigation for Models/Strands/Quality/Fleet views
- Mini bar charts for duration distributions
- Sparkline charts for worker time series
- Quality cards for shallow completion tracking
- Responsive design for mobile/tablet views
Co-Authored-By: Claude Code (glm-5) <noreply@anthropic.com>
Add PR preview functionality to the Git Integration panel:
- Generate PR title from commit messages
- Auto-generate PR description with file changes summary
- Generate commit message preview from activity
- List files changed with +/lines count
- Detect potential conflicts with upstream
- Rebase recommendation when conflicts detected
- New keyboard shortcuts: [p] Preview PR, [d] Diff, [s] Status
- PRPreview type with conflict detection and file stats
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
FileHeatmap component is fully integrated into main TUI app:
- Keyboard shortcut 'H' toggles heatmap view
- Real-time file access aggregation from event store
- Shows most-touched files with multiple sort modes
- All tests passing (943 tests, including 130 FileHeatmap tests)
Additional fixes:
- Fixed ErrorGroupPanel options to support bottom property
- Added vitest globals configuration for proper TypeScript support
- Fixed type assertions in server.test.ts
- Created comprehensive integration documentation
Co-Authored-By: Claude Worker <noreply@anthropic.com>
Comprehensive worker performance metrics tracking system:
Features:
- Beads per hour calculation
- Average completion time tracking
- Error rate monitoring
- Cost per bead calculation (USD)
- Idle percentage tracking
- Time-series data storage and retrieval
- Performance trend analysis
- Aggregated analytics across all workers
Implementation:
- Added WorkerAnalytics types to types.ts
- Created workerAnalytics.ts module with full aggregation logic
- Integrated with EventStore for automatic event processing
- 25 comprehensive unit tests (all passing)
- Exported from index.ts for public API access
Technical highlights:
- Automatic activity period detection with 5-minute gap threshold
- Time-series snapshots at configurable intervals (default 1 hour)
- Flexible time window filtering (hour/day/week/all)
- Worker ranking by performance, error rate, and cost efficiency
- Performance trend detection (improving/declining/stable)
Co-Authored-By: Claude Worker <noreply@anthropic.com>
Implement comprehensive session digest generation module that aggregates:
- Beads completed with duration tracking
- Files modified with tool and worker attribution
- Errors encountered with categorization
- Time spent per worker
- Token usage and estimated costs
Features:
- SessionDigestGenerator class for digest creation
- Markdown formatting with tables and summaries
- CLI integration via 'fabric digest' command
- Support for time range and worker filtering
- Comprehensive test coverage (14 tests, all passing)
CLI Usage:
fabric digest -f <logfile> [options]
Options: --output, --worker, --since, --until, --max-files, --max-errors
All tests passing: 616/616
Co-Authored-By: Claude <noreply@anthropic.com>
Add recovery playbook feature that suggests recovery actions when workers encounter errors.
Implementation includes:
- RecoverySuggestion, RecoveryAction, RecoveryPlaybookEntry types in types.ts
- recoveryPlaybook.ts utility module with RecoveryManager class
- Predefined playbooks for each error category (network, permission, timeout, etc.)
- Pattern matching to map errors to actionable recovery steps
- Integration with InMemoryEventStore for easy access to suggestions
- RecoveryPanel TUI component for displaying suggestions
- Console formatting utilities for CLI output
Recovery actions include:
- Automated actions (retry, backoff, investigate)
- Manual actions (fix permissions, install dependencies)
- Escalation to human when automated recovery not possible
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement file heatmap visualization that tracks which files are modified
most frequently and by which workers. Helps identify hotspots and potential
collision areas.
Features:
- Track file modifications across all workers
- Heat levels (cold/warm/hot/critical) based on modification frequency
- Worker contribution percentages per file
- Collision risk detection for files with multiple workers
- Sortable by modifications, recent activity, workers, or collisions
- Filter by directory or collision-only files
- Statistics overview with heat distribution
Integration:
- Press 'H' in TUI to toggle heatmap view
- Press 's' to cycle sort modes
- Press 'c' to toggle collision-only filter
- Press 'Esc' to return to default view
Also fixed pre-existing DependencyDag component build issues:
- Created missing dagUtils.ts utility module
- Fixed import paths and type annotations
Tests: 20 new tests for file heatmap, all 154 tests passing
Co-Authored-By: Claude Worker <noreply@anthropic.com>
- Add SessionReplay component with full playback controls
- Add replay command to CLI with filter support
- Fix color type references in SessionReplay
- Add EventFilter type import to CLI
- Add File Heatmap types for future feature
Co-Authored-By: Claude Worker <noreply@anthropic.com>
Implement smart error grouping to cluster similar errors together and reduce
noise in the activity stream. Uses pattern matching on error messages and
stack traces to group related errors.
Features:
- Error categorization into 9 categories (network, permission, validation, etc.)
- Pattern-based fingerprinting for grouping similar errors
- Normalization of variable data (IPs, paths, UUIDs, timestamps)
- Severity calculation based on frequency and recency
- Integration with InMemoryEventStore for automatic error tracking
New files:
- src/errorGrouping.ts - Error grouping module
- src/errorGrouping.test.ts - Comprehensive test suite (34 tests)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements bd-3a4 and bd-2pa.1 (project setup):
- Initialize npm project with TypeScript configuration
- Add package.json with build scripts and dependencies
- Create src/ structure with types and CLI entry point
- Add CLI commands: tui, web, tail (placeholders)
- Configure tsconfig.json for NodeNext modules
This addresses worker starvation (bd-29a) by demonstrating
that direct implementation is a viable alternative when
workers cannot claim beads due to dependency resolution issues.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>