Commit graph

110 commits

Author SHA1 Message Date
jedarden
f37d88de3e feat(bd-eir): complete FABRIC↔NEEDLE dovetail — wire cross-source dedup, add exporter docs
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>
2026-04-21 19:35:39 -04:00
jedarden
af1560fba1 feat(bd-zci): add instrument alias resolution and source-priority upserts
- Add INSTRUMENT_ALIASES map resolving NEEDLE's plural naming
  (needle.worker.beads.*) to canonical singular (needle.bead.*)
- Source-priority SQL in upsertSessionWorkerSummary: otlp-metric rows
  survive lower-priority log-derived overwrites via CASE expressions
- Prefer OTLP metric snapshots over log-derived estimates in task
  recording (flushMetricSamples + persistSession)
- Document accepted aliases in docs/schema.md
- Add tests for alias resolution, coaccumulation, and priority protection

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 18:16:39 -04:00
jedarden
f661430fce fix(bd-zci): map snake_case DB rows to camelCase in getSessionWorkerSummaries
- getSessionWorkerSummaries now maps SQLite snake_case columns to the
  TypeScript camelCase return type, fixing the type mismatch
- Fix getSessionsInRange typo (was getSingsInRange)
- Fix flaky duration test using deterministic timestamps
- Update tests to use camelCase property names

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 17:28:13 -04:00
jedarden
a6fb5c9289 feat(bd-zci): map OTLP metrics → analytics DB instruments
Add OTLP metric ingestion pipeline that persists Sum/Histogram/Gauge
data points to fabric.db with canonical instrument names:

- MetricAccumulator in workerAnalytics.ts accumulates per-worker
  running totals for tokens, cost, durations, bead counts
- Schema v2 in historicalStore.ts adds metric_samples and
  session_worker_summaries tables with source preference tracking
- flushMetricSamples() in store.ts drains accumulator → SQLite on
  every event, upserting session summaries and live session rows
- docs/schema.md documents instrument names and resolution order

Fix source preference ordering (otlp-metric > otlp-span > log-derived)
using CASE-based SQL sort instead of alphabetical ASC which was
inverted. Fix metricsSource detection to not require costUsd > 0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 17:18:32 -04:00
jedarden
e74149f167 feat(bd-zci): map OTLP metrics → analytics DB instruments
Fix histogram data point value extraction in normalizer — OTLP histogram
points carry sum/count instead of asDouble/asInt, so needle.bead.duration
was silently dropped. Add MetricAccumulator tests and end-to-end tests
validating OTLP metrics flow through to session_worker_summaries in
fabric.db with otlp-metric source preference.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 17:06:45 -04:00
jedarden
1f392c39d6 feat(bd-pyz): add --source flag, logs alias, and update CLI examples
Add --source flag to tui/web/tail subcommands for specifying log source
as file or directory (directories get workers.log appended). Add 'logs'
as alias for 'tail' subcommand per plan.md CLI spec. Update README.md
with fabric logs examples and --source usage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 14:59:15 -04:00
jedarden
0f7aced61b feat(bd-9jm): add LRU event dedup keyed on (session_id, worker_id, sequence)
When FABRIC ingests events from both JSONL and OTLP sources, the same
logical event can arrive twice. EventDeduplicator keeps the first
arrival and silently drops duplicates with a counter for observability.
Events with sequence < 0 (legacy formats) always pass through.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 14:45:31 -04:00
jedarden
6805bff904 feat(bd-qtg): map OTLP spans → paired started/finished events for DAG
- normalizeOtlpSpanStart: emit {name}.started with span_id/parent_span_id/trace_id
- normalizeOtlpSpanEnd: emit {name}.finished with duration_ms and span attributes
- needleEventToLogEvent: promote span_id, parent_span_id, trace_id, span_name
- dagUtils: add buildSpanDag() using parent_span_id for parent-child linkage
- dagUtils: add findSpansForBead() for bead-to-span lookup
- Add integration test confirming bead lifecycle renders as DAG node with children
- Add namespaced OTLP attribute resolution (needle.worker.id etc.)
- Add OTLP body (AnyValue) extraction for logs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 14:34:28 -04:00
jedarden
cf7f727210 feat(bd-j1t): first-class worker state machine — NeedleState + gap-based stuck detection
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>
2026-04-21 14:26:16 -04:00
jedarden
006e0f5b59 fix(bd-j1t): update tests for uppercase state labels + canonical event types
WorkerDetail now renders statuses in uppercase (ACTIVE/IDLE/ERROR) to
match NeedleState labels. Store only recognizes canonical event types
(bead.completed, not "Task completed") for state transitions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 14:14:45 -04:00
jedarden
039f692fb4 fix(bd-9ah): use sequence-based ordering in web SessionReplay
The web frontend SessionReplay component was sorting events by
timestamp, inconsistent with all other consumers (store, TUI replay,
export, analytics, narrative) which use compareEventsBySequence.
Switched to the canonical (worker, sequence) ordering so multi-host
OTLP ingestion produces correct replay order despite clock skew.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 13:34:37 -04:00
jedarden
7210fdf323 feat(bd-593): add OTLP/HTTP receiver on :4318 (protobuf + JSON)
Mount OTLP/HTTP handlers on the existing Express web server via a second
HTTP listener so OTLP endpoints are reachable at the standard :4318
address without a separate process. Accepts both application/x-protobuf
and application/json content types, routing decoded records through the
same Normalizer pipeline as the gRPC receiver.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 13:33:36 -04:00
jedarden
8f7d7cf72d feat(bd-j1t): worker state machine — gap-based stuck detection + web WorkerDetail NeedleState
- Add state_gap stuck detection using lastStateTransition — fires when
  a worker in an active NeedleState hasn't transitioned within the
  configurable threshold (default 5min, critical at 2x).
- Update web WorkerDetail.tsx to display needleState with icons and
  colors instead of coarse active/idle/error status.
- Add stuckDetection.test.ts with 16 tests covering gap-based detection,
  legacy patterns, and edge cases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 13:32:46 -04:00
jedarden
e0c16e19af feat(bd-f4p): add OTLP/gRPC receiver on :4317
Add full OTLP/gRPC receiver terminating LogsService, TraceService, and
MetricsService Export RPCs. Decoded protobuf records are normalized via
the shared Normalizer pipeline and emitted as LogEvents on the event bus.

- gRPC server via @grpc/grpc-js with protobufjs codec
- Protobuf definitions for all three OTLP collector services
- enrichRecord() merges scope/resource attributes for normalizer
- extractDataPoints() handles gauge, sum, and histogram metrics
- Integration tests with real gRPC client/server round-trip

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 13:03:13 -04:00
jedarden
51520a35ac feat(bd-6q2): refactor parser to emit NeedleEvent, keep LogEvent as adapter
- Tighten parseNeedleEvent signature to accept string (JSON line) and
  preserve all canonical fields (timestamp, event_type, worker_id,
  session_id, sequence, bead_id, data)
- Make parseLogLine a thin adapter that calls parseNeedleEvent then
  projects to legacy LogEvent via needleEventToLogEvent
- Add comprehensive parseNeedleEvent unit tests covering canonical format,
  session_id/sequence/data round-trip, all 47 NeedleEventType values,
  schema version validation, and legacy format conversion
- Rewrite parser.real-logs.integration.test.ts to assert NeedleEvent
  shape against real ~/.needle/logs/*.jsonl fixtures

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 13:00:41 -04:00
jedarden
f67868bea5 feat(bd-h40): extract Normalizer component — decouple parse from ingest
- Create src/normalizer.ts with normalize(raw, source): NeedleEvent supporting
  all 5 sources: jsonl, otlp-log, otlp-span-start, otlp-span-end, otlp-metric
- Move JSONL parsing logic (canonical, legacy NEEDLE, flat legacy) from
  parser.ts into normalizer.ts
- Refactor parser.ts to thin facade delegating to normalizer
- Tailer now imports directly from normalizer (pure source, no parse coupling)
- Add 63 unit tests covering all source paths, edge cases, and cross-source
  parity between JSONL and OTLP-log

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 12:34:30 -04:00
jedarden
10146b6415 feat(bd-cj8): adopt NeedleEvent canonical schema + publish docs/schema.md
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>
2026-04-21 11:57:19 -04:00
jedarden
46c51a79c3 feat: add budget dashboard with per-bead cost tracking and EMA burn rate
Adds Budget panel (B key) to TUI with per-bead/per-worker cost tracking,
EMA-smoothed burn rate, time-series storage, and CostDashboard web component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 01:14:14 -04:00
jedarden
27d9278cf9 feat(bd-5ny): Add fleet analytics types and enhanced CSS styles
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>
2026-03-20 07:26:25 -04:00
jedarden
3f5ddb96e0 feat(bd-5ny): Add fleet analytics dashboard with model/strand/quality metrics
Parse NEEDLE worker log JSONL files to compute fleet-wide analytics:
- Model performance: beads completed, avg/median duration, distribution histogram
- Strand utilization: invocations, success rates, time spent per strand
- Completion quality: shallow detection (<10s), claim races, flagged beads
- Fleet overview: hourly time series with sparklines, workspace coverage, relaunch count

Adds /api/analytics endpoint and AnalyticsDashboard React component with
tabbed UI (Models/Strands/Quality/Fleet). No persistent DB needed — reads
logs fresh on each request.

Co-Authored-By: Claude Code (glm-5-turbo) <noreply@anthropic.com>
2026-03-20 07:19:53 -04:00
jedarden
b9a7dcce92 feat(bd-4ka): Wire replay command into analytics pipeline
Feed replay events into the store's analytics pipeline via store.add()
in the onEvent callback, enabling worker analytics, error grouping,
cross-reference tracking, collision detection, and semantic narrative
generation during replay sessions. Print analytics summary on replay end.

Co-Authored-By: Claude Code (glm-5-turbo) <noreply@anthropic.com>
2026-03-20 00:34:07 -04:00
jedarden
4d6f71e74a feat(bd-o0x): Add real-time worker count badge to TUI header
The header now displays a live badge showing worker counts by status:
- Green for active workers
- Blue for idle workers
- Red for error workers

Example: "FABRIC - Worker Activity Monitor [2 active | 1 idle]"

Changes:
- getWorkerStats() calculates total/active/idle/error counts
- getHeaderContent() builds colored badge with status breakdown
- updateHeader() refreshes the badge in default view
- Added updateHeader() call in addEvent() for real-time updates
- Fixed setViewMode() to use getHeaderContent() when returning to default view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 00:20:42 -04:00
jedarden
94d5273d8e test(bd-3rf): Add comprehensive regression test suite for frankentui TUI
Add unit tests for TUI components that previously lacked test coverage:
- WorkerDetail: worker info display, status icons, event rendering
- BudgetAlertPanel: cost tracking, budget alerts, burn rate display
- FilterPanel: filter validation, persistence, edge cases
- RecoveryPanel: utility functions, console formatting, summary generation
- SessionDigest: digest generation, error categorization, statistics

Enhance regression.test.ts with:
- Snapshot tests for consistent rendered output format
- Component rendering regression tests
- Edge case handling tests
- Additional mock method implementations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 23:21:19 -04:00
jedarden
379883435b test(bd-1j9): Add E2E test for WorkerDetail panel
Verify WorkerDetail displays correct worker information including status
(active/idle/error), uptime formatting, beads completed count, last
activity details (bead, tool, duration, error), and recent events with
proper color tags and truncation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 22:44:58 -04:00
jedarden
9666668482 test(bd-29t): Add E2E test for web ActivityStream component
Verify chronological ordering, timestamp formatting, level CSS classes,
auto-scroll behavior, timeline highlighting, filtering, bead pinning,
and realistic multi-worker event stream rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 22:34:40 -04:00
jedarden
4a649b806d test(bd-2x9): Add E2E test for WorkerGrid status color rendering
Create vitest E2E test that verifies WorkerGrid component renders
worker entries with correct status colors:
- Green (light-green-fg) for active workers
- Yellow (light-yellow-fg) for idle workers
- Red (light-red-fg) for error workers

The test mocks blessed screen and verifies the content contains
appropriate color tags matching the theme system's status colors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 22:30:15 -04:00
jedarden
8434701bd5 fix(ci): handle missing homedir in ThemeManager for CI environments
Wrap os.homedir() in try/catch and guard against undefined return value
in ThemeManager.getConfigPath(). In CI environments, os.homedir() may be
undefined, causing path.join() to throw and preventing SessionReplay
from being constructed. When homedir is unavailable, theme persistence
is gracefully skipped and the default dark theme is used.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 07:38:40 -04:00
jedarden
d35c9adcdc fix(bd-9sm): Replace substring matching with NEEDLE event type in persistSession
persistSession() still used msg.includes('completed'/'finished'/'closed') to
find bead completion events. With NEEDLE format, msg is the event type string
(e.g. 'bead.completed'), so substring matching can misfire on
'bead.agent_completed'. Match on exact event types 'bead.completed' and
'bead.failed' instead — consistent with the fix already applied to
updateWorkerInfo() and trackTaskForHistory() in bd-vqd.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 23:56:40 -04:00
jedarden
374be30dac fix(bd-vqd): Align NeedleLogEntry and parser with NEEDLE telemetry format
- NeedleLogEntry.worker: accept string | NeedleWorkerObject (NEEDLE emits
  flat runner-provider-model-identifier strings)
- Add optional level field to NeedleLogEntry (NEEDLE always includes it)
- parseNeedleFormat: reconstruct worker as runner-provider-model-identifier
  from legacy object form (was missing provider and model)
- parseNeedleFormat: gate provider/model extraction on object form (was
  accessing .provider/.model unconditionally, yielding undefined)
- parseNeedleFormat: prefer entry.level over inferred level
- inferLogLevel: match NEEDLE's _needle_telemetry_infer_level rules exactly
  (prefix/suffix matching: error.*, *.failed, *.retry, debug.*)
- Add NeedleEventType, NeedleWorkerStatus types to types.ts
- Add session/provider/model optional fields to LogEvent
- Fix store.ts status detection: match on exact NEEDLE event types instead
  of substring-based heuristics
- Update all tests to match corrected behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 22:39:04 -04:00
default
13e3090ca1 fix(bd-jec): Fix TypeScript build error and resolve worker starvation alert
- Fixed corrupted auth middleware code in server.ts that was causing build failure
- Verified TUI color rendering works correctly (bd-2b3)
- Resolved bd-jec: Found 8 beads in ready queue, worker starvation was due to assignee filtering

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-11 05:49:33 +00:00
default
a2e3161134 feat(bd-n8y): Add authentication/authorization to FABRIC event ingestion endpoint
- Added authToken option to WebServerOptions interface
- Created createAuthMiddleware function for Bearer token auth
- Applied auth middleware to POST /api/events and /api/events/batch
- Updated CLI to read FABRIC_AUTH_TOKEN env var
- Added comprehensive tests for authentication scenarios

- Updated POST /api/events test cases to use auth token
- All tests passing successfully
2026-03-11 05:13:12 +00:00
default
446c3a655c test(bd-2bt): add comprehensive tests for POST /api/events endpoint
Tests cover:
- Valid NEEDLE format event ingestion
- Event storage in store
- WebSocket broadcast on event receipt
- Error handling (missing ts/event fields, invalid JSON)
- Batch endpoint for multiple events
- Batch error reporting for partial failures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-11 04:57:09 +00:00
default
b21df31ea4 feat(bd-3ip): Add POST /api/events/batch endpoint for batched NEEDLE telemetry
- Add MAX_BATCH_SIZE constant (100 events limit)
- Implement POST /api/events/batch endpoint that accepts JSON array of events
- Validate array format, empty batches, and batch size limits
- Validate each event has required fields (ts, event)
- Store all valid events via store.add()
- Broadcast all ingested events via WebSocket
- Return 201 with ingested count, total count, and errors array
- Handle partial success (valid events processed, errors reported)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-11 04:43:19 +00:00
default
ee90eb05a3 feat(bd-2bt): add POST /api/events endpoint to ingest NEEDLE telemetry
Add HTTP POST endpoint to receive NEEDLE telemetry events from the
fabric.sh forwarder. This bridges NEEDLE and FABRIC, enabling real-time
event ingestion via HTTP.

Changes:
- Add parseEventObject() to parser.ts for parsing JSON objects directly
- Add POST /api/events endpoint with JSON body parser (64KB limit)
- Validate required fields (ts, event) before processing
- Store events and broadcast to WebSocket clients in real-time
- Return 201 Created on success, 400 for invalid payloads

Acceptance criteria met:
- NEEDLE events sent via curl POST arrive in FABRIC's event store
- Events are broadcast to WebSocket clients in real-time
- Invalid payloads return appropriate error codes (400)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:06:55 +00:00
default
3d6f19ec43 feat(bd-288): add FABRIC web server persistent service script
- Add scripts/fabric-web.sh for managing FABRIC web server as tmux session
- Supports start/stop/restart/status/logs commands
- Auto-restarts on crash via tmux session management
- Configurable via FABRIC_PORT and FABRIC_LOG_PATH env vars
- Fix TypeScript build error in CommandPalette.test.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:01:48 +00:00
default
d6b9976a88 feat(bd-1o0): Command Palette Fuzzy Search
- Integrate fuzzyMatch utility for fzf-style fuzzy matching on label, category, and action fields
- Highlight matching characters in yellow using blessed tags
- Add recent commands history (last 10), persisted to ~/.fabric/recent-commands.json
- Boost recently-used commands in fuzzy search scoring
- Show recent commands first when no query is entered
- Arrow key navigation with wrapping (pre-existing)
- Add comprehensive test suite (13 tests)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-08 22:53:03 +00:00
jeda
629d7430dc feat(bd-2u6): File Context Panel (Split View) implementation
Verified and closed bd-2u6 - FileContextPanel is fully implemented for both TUI and Web:

Features:
- Split view: Activity (left) | File Context (right)
- Auto-update when file event selected
- Syntax highlighting based on file extension (TS, JS, Python, Rust, Go, etc.)
- Line numbers with highlight on relevant lines
- Sticky panel - stays visible while scrolling activity
- File history: see all operations on this file
- Quick toggle between recently touched files ([/]/[] keys)
- 'Open in Editor' button (launches configured editor)

TUI Layout:
- Ctrl+F to toggle file context panel
- { and } to resize split view
- Tab to switch focus between panels

Web Layout:
- Collapsible side panel with toggle button
- Resizable divider
- Pop out to separate window

Editor Integration:
- Uses $EDITOR env var
- Supports VS Code, vim, nano, etc.
- Opens at specific line number

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-07 12:24:28 +00:00
jeda
93f8e5a407 feat(bd-2r0): Focus Mode Presets
Implements save/load/delete functionality for focus mode pin configurations:

**TUI Changes:**
- [ key to save current focus configuration as named preset
- ] key to cycle through saved presets
- Preset commands in CommandPalette (Ctrl+K):
  - preset:save - Save current focus
  - preset:list - List all presets
  - preset:load:<name> - Load a specific preset
  - preset:delete:<name> - Delete a preset
- Presets stored in ~/.fabric/focus-presets.json
- Updated help text with new keybindings

**Web Changes:**
- Preset dropdown in header with save/load/delete UI
- Modal dialog for saving new presets
- Presets stored in localStorage
- Styled with CSS matching existing UI

**Core:**
- FocusPresetManager utility class for preset CRUD operations
- Storage abstraction (Memory, LocalStorage, File-based)
- Full test coverage for preset management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-07 05:31:25 +00:00
jeda
61cd3e321a feat(bd-3o4): Git PR Preview
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>
2026-03-07 05:19:27 +00:00
jeda
7ddbd7820b feat(bd-1dq): Export Session Replay
Add export/import functionality for session replay:

**Export Features:**
- Export as shareable link (base64 encoded events in URL parameter)
- Export as .fabric-replay file (JSON format)
- Share button in replay controls with dropdown menu

**Import Features:**
- Import from .fabric-replay file via file picker
- Import from URL parameter (?replay=base64EncodedEvents)
- Automatic detection and loading of replay data from URL

**Implementation:**
- src/utils/replayExport.ts: Core export/import utilities for Node.js
- src/web/frontend/src/utils/replayExport.ts: Browser-specific utilities
- Updated web SessionReplay.tsx with export dropdown and status messages
- Updated TUI SessionReplay.ts with exportToFile/importFromFile methods
- Added session replay panel to App.tsx with URL parameter support
- Added CSS styles for export dropdown, status messages, and replay panel

**Export Format:**
```json
{
  "version": "1.0",
  "exportedAt": 1709337600,
  "eventCount": 150,
  "events": [...],
  "metadata": {
    "sessionStart": 1709337000,
    "sessionEnd": 1709337600,
    "workerCount": 3
  }
}
```

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 05:11:13 +00:00
jeda
e80f891c8a feat(bd-iyz): Anomaly Detection for File Activity
Implements anomaly detection for file activity in the heatmap panel:

- Add anomaly detection types (AnomalyType, AnomalySeverity, FileAnomaly)
- Create fileAnomalyDetection.ts utility with detection algorithms:
  - Config file modifications (e.g., .env, config/, settings.json)
  - Sensitive file access (secrets, credentials, keys)
  - High-frequency modifications (outliers beyond 3x average)
  - Burst activity (rapid successive modifications)
  - Unusual multi-worker patterns (3+ workers on same file)
- Add getFileAnomalies() and getAnomalyStats() methods to store
- Update FileHeatmap component to show anomaly alerts:
  - New [a] keybinding to toggle anomaly-only view
  - "Unexpected activity" section at bottom of heatmap
  - Severity icons (🚨 critical, ⚠️ warning, ℹ️ info)
- Update app.ts to pass anomaly getter to FileHeatmap
- Add comprehensive tests for anomaly detection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-07 05:01:42 +00:00
jeda
296d547c12 feat(bd-40a): Web Timeline Visualization
Add timeline visualization component to the web dashboard:
- Create TimelineView.tsx component showing worker activity over time
- Support time range selection (5m, 10m, 30m, 1h)
- Click on timeline bar to jump to that time in activity stream
- Color-code by worker status (active/idle/error)
- Add timeline toggle button in header
- Integrate with Focus Mode for filtering workers

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-07 04:49:37 +00:00
jeda
e1f81e5bed feat(bd-hn5): Budget Alerts and Projections
Add comprehensive budget monitoring and alert system:

- Burn rate calculation (cost per minute over configurable window)
- Time-to-budget-exhaustion projection with formatted output
- Top consumer identification with cost breakdown and insights
- Real-time alert generation at 80% (warning) and 95% (critical) thresholds
- BudgetAlertPanel TUI component for displaying alerts and projections
- New interfaces: BurnRate, BudgetAlert, TopConsumer
- Formatting utilities: formatBurnRate, formatTimeToExhaustion, getBudgetBadge, formatBudgetAlert

Thresholds updated per plan.md specification (80%/95% instead of 75%/90%).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 04:41:34 +00:00
jeda
07ee238d80 feat(bd-257): Web Auto-Reconnect with Exponential Backoff
Implement robust WebSocket reconnection logic for the web frontend:

- Detect connection loss immediately via onclose handler
- Show 'Reconnecting...' status indicator with yellow dot
- Implement exponential backoff (1s, 2s, 4s, 8s, 16s, max 30s)
- Re-sync state automatically after successful reconnection
- Show reconnection attempt count in brackets
- Manual reconnect button appears after max retries (10)
- Green dot with glow for connected state
- Red dot for disconnected state
- Animated pulse effect on reconnecting indicator

UI States:
- Connected: Green dot with glow
- Reconnecting: Yellow pulsing dot with countdown and attempt count
- Disconnected: Red dot with manual retry button

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-07 04:34:23 +00:00
jeda
73cf7bae51 feat(bd-2ot): Add theme support (Dark/Light) for TUI and Web
## TUI Theme Support
- Create ThemeManager class with dark/light theme palettes
- Update colors.ts to use theme system via proxy pattern
- Add Ctrl+T keybinding for theme toggle
- Add theme commands to CommandPalette (theme:toggle, theme:dark, theme:light)
- Persist theme preference to ~/.fabric/theme.json
- Update footer to show current theme

## Web Dashboard Theme Support
- Create ThemeContext with React context API
- Add light theme CSS variables (data-theme="light")
- Add ThemeToggle button to header
- Persist theme preference to localStorage
- Support system color scheme preference detection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-07 04:28:29 +00:00
jeda
3457ef35d8 feat(bd-art): SQLite Historical Analytics Storage
Implements persistent storage for historical session analytics:

- Add HistoricalStore class using better-sqlite3
- Schema includes sessions, task_metrics, and error_history tables
- Session management: start/end sessions with worker/task/cost metrics
- Task metrics: record per-bead completion times, costs, tokens
- Error history: track errors with resolution status
- Historical queries: worker comparison across sessions
- Learned recoveries: extract patterns from historical error resolutions
- Integration with EventStore for automatic session persistence
- Historical query methods in WorkerAnalytics
- Enhanced recovery suggestions using historical data in RecoveryManager
- Comprehensive unit tests (20 passing tests)

Database stored at ~/.needle/fabric.db for cross-session persistence.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-07 04:18:45 +00:00
jeda
04666e71fd fix: add lowercase key bindings for view toggles
Added lowercase alternatives for all view toggle shortcuts:
- h/H: Heatmap
- d/D: DAG
- r/R: Replay
- e/E: Errors
- g/G: Digest
- c/C: Collisions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-05 04:38:14 +00:00
jeda
b7ca7ab818 fix: add Escape key to close WorkerDetail modal
Previously Escape only handled view mode changes. Now it first checks
if the WorkerDetail modal is visible and closes it before returning
to the default view.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-05 04:36:29 +00:00
jeda
41052cb0dd feat(bd-1j9): E2E test: WorkerDetail shows selected worker info
Added comprehensive E2E test suite for WorkerDetail component with 39 test cases covering:
- Worker status display (active, idle, error)
- Event count and current tool display
- Last seen timestamp formatting
- Recent events list rendering
- Collision alert display
- Current activity section
- CSS classes and accessibility features
- Edge cases and error handling

All tests passing.

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-05 03:57:08 +00:00
jeda
d0df0954cb feat(bd-29t): E2E test: ActivityStream displays scrolling log entries
Comprehensive E2E test suite covering:
- Chronological order display (100+ events)
- Timestamp formatting and display
- Level colors for debug/info/warn/error
- Scrolling behavior with maxLines buffer
- Filtering by worker, level, search term, time range
- Pause/resume workflow
- High volume event handling (1000+ events)

All 36 tests passing.

Co-Authored-By: Claude Worker <noreply@anthropic.com>
2026-03-05 03:54:31 +00:00