Commit graph

328 commits

Author SHA1 Message Date
Argo Workflows CI
7de14da27e ci: auto-bump version to 0.1.132 2026-04-10 04:25:57 +00:00
jedarden
1a52dde111 feat: implement morning briefing feature
Add daily summary card with push notification option.

- Add briefings table with person and sections_json columns (migration 013)
- Implement briefing generator with sections for alerts, sleep, people, anomalies, health, predictions, and learning
- Add briefing scheduler for automatic daily generation at configurable time
- Add push notification support via notify adapter
- Add API endpoints: GET/POST /api/briefing, /api/briefing/latest, /api/briefing/settings
- Add frontend briefing card with sections styled by type
- Add briefing settings panel for configuration (time, push notifications, auto-generate)
- Add briefing indicator icon when dismissed but available
- Integrate briefing scheduler into main.go with providers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 00:25:33 -04:00
Argo Workflows CI
c572fb67aa ci: auto-bump version to 0.1.131 2026-04-10 03:11:16 +00:00
jedarden
61e4035862 feat: implement command palette with fuzzy matching and mode awareness
- Ctrl+K/Cmd+K keyboard shortcut for power user efficiency
- Fuzzy matching across zones, people, nodes, events, settings, and help
- Categories: navigation, fleet, security, nodes, zones, view, mode, theme, help
- Recent commands tracking with localStorage persistence
- Keyboard navigation (arrows, Page Up/Down, Home/End, Enter)
- Search result highlighting with mark tags
- Help modal with contextual documentation
- Dismissible keyboard shortcut hint for first-time users
- Mode awareness: only available in expert mode (disabled in simple/ambient)
- Show toast notification when opened from restricted modes
- CSS with dark/light mode support and reduced motion preference
- Full keyboard accessibility with visible focus indicators
- Command registry API for dynamic command registration
2026-04-09 23:11:07 -04:00
Argo Workflows CI
19d099fb24 ci: auto-bump version to 0.1.130 2026-04-10 03:03:17 +00:00
jedarden
b9292db99f feat: implement spatial quick actions with follow camera
- Add userData.mac to node meshes for raycasting support in context menus
- Fix duplicate blobMeshes function definition in viz3d.js
- Fix typo: FeeddownPanel -> FeedbackPanel in quick-actions.js
- Enable right-click context menus on 3D elements (blobs, nodes, zones, portals, triggers)
- Add long-press support for mobile devices
- Implement follow camera functionality that tracks selected person
- Add follow mode indicator with stop button and ESC key support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 23:02:54 -04:00
jedarden
6b22ba65ac feat: implement spatial quick actions with follow camera
- Add right-click context menus on 3D elements (blobs, nodes, zones)
- Implement follow camera functionality with visual indicator
- Add zone detection in context menu based on position
- Integrate with state management system for data lookups
- Support both mouse right-click and touch long-press interactions
- Add ESC key handler to stop following

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 22:54:36 -04:00
Argo Workflows CI
7d342b95a0 ci: auto-bump version to 0.1.129 2026-04-10 02:27:01 +00:00
jedarden
6d30c63414 feat: implement ambient dashboard mode for wall-mounted tablets
- Add /ambient route serving dedicated ambient.html page
- Simplified top-down floor plan using Canvas 2D (no Three.js)
- Time-of-day aware palettes: morning (bright/cool), day (neutral), evening (warm amber), night (dim)
- People rendered as glowing colored dots (BLE-identified) or neutral dots (unknown)
- Room labels with occupancy counts
- Auto-dim after 30 minutes of inactivity
- Alert mode with pulsing red border and action buttons
- Morning briefing integration with auto-dismiss
- WebSocket for real-time blob and zone updates
- Lightweight implementation targeting <30 MB RAM for older tablets
- OLED-safe night mode with true black background
2026-04-09 22:26:37 -04:00
Argo Workflows CI
f21743cb6e ci: auto-bump version to 0.1.128 2026-04-10 02:08:12 +00:00
jedarden
425d503449 feat: implement simple mode UI with WebSocket integration
- Add card-based mobile-first UI for non-technical users
- Implement room occupancy cards with real-time updates
- Add activity feed with WebSocket integration
- Support progressive disclosure from simple to expert mode
- Integrate with router for hash-based navigation (#simple)
- Handle WebSocket messages for blobs, zones, events, and alerts
- Add room detail modals and security mode toggle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 22:08:03 -04:00
Argo Workflows CI
c2030ee7ff ci: auto-bump version to 0.1.127 2026-04-10 01:31:01 +00:00
jedarden
cdd9c64800 feat: complete pre-deployment simulator implementation
Implements comprehensive pre-deployment simulator for WiFi CSI-based
positioning that allows users to predict detection quality before
purchasing hardware.

Components:
- Virtual space definition with rooms, walls, and material properties
- Virtual nodes with configurable roles (TX/RX/TX_RX/PASSIVE/IDLE)
- Synthetic walkers (random walk, path-following, node-to-node)
- GDOP overlay for coverage quality visualization
- Signal propagation model with path loss and wall attenuation
- Fresnel zone accumulation for blob detection
- REST API endpoints for simulator control
- Dashboard integration with space/node/walker management
- Coverage optimization recommendations

The simulator produces realistic synthetic CSI data matching
real-world conditions by using the same propagation models and
localization algorithms as the live system.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 21:30:47 -04:00
jedarden
a70e3e433d feat: implement GDOP overlay for simulator visualization
- Add GET /api/simulator/gdop/heatmap endpoint in both simulator handlers
- Fix viz3d.js to call correct endpoint (GET instead of POST)
- Update response format handling to parse gdop_map and grid_dimensions
- Generate colors from GDOP values using quality thresholds
- Position overlay correctly in 3D scene

The GDOP overlay now visualizes accuracy metrics across the virtual space
with color-coded quality indicators (green=excellent, yellow=good, orange=fair, red=poor).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 21:30:47 -04:00
Argo Workflows CI
dd427713fb ci: auto-bump version to 0.1.126 2026-04-09 23:27:58 +00:00
jedarden
6d975f472b feat: implement time-travel debugging and CSI replay
This commit implements the replay feature that allows users to pause the
live 3D view, scrub through a 48-hour recording buffer, and replay the 3D
scene exactly as it was at any historical moment.

Key components:
- Recording buffer with SeekToTimestamp for time-travel navigation
- Replay engine with session management (start, stop, seek, play, pause)
- Replay signal processing pipeline with tunable parameters
- REST API endpoints for replay control
- Dashboard UI with timeline scrubber, playback controls, and tuning panel
- Comprehensive test coverage for all replay functionality

Acceptance criteria met:
- Seek to any point in 48-hour window completes in < 1 second
- Replay produces identical blob positions to original live processing
- Parameter sliders re-process in < 3 seconds
- "Apply to Live" correctly writes parameter changes
- Timeline scrubber event markers correctly align
- "Back to Live" correctly resumes live detection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 19:27:42 -04:00
jedarden
be7afae362 feat: integrate VolumeEditor initialization with 3D scene
- Initialize VolumeEditor module in initScene() override
- Pass scene, camera, controls, and renderer to VolumeEditor.init()
- Enables 3D trigger volume drawing and visualization
- Completes spatial automation trigger volume builder implementation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 18:32:45 -04:00
Argo Workflows CI
d7c49bee25 ci: auto-bump version to 0.1.125 2026-04-09 22:18:52 +00:00
jedarden
245bbe89bb docs: verify REST API implementation completeness
All required REST API endpoints have been verified as implemented:

- Settings (GET/POST /api/settings): SQLite-backed with cache
- Zones & Portals (CRUD): WebSocket broadcast for live 3D view
- Automation Triggers (CRUD + test): VolumeTriggersHandler with webhook/MQTT/Ntfy
- Notifications (config + test): Inline handlers with quiet-hours support
- Replay/Time-Travel (sessions, start, stop, seek, tune): CSI recording buffer
- BLE Devices (list, update): Device registry with person assignment

All handlers include OpenAPI-style godoc comments and proper error handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 18:18:42 -04:00
Argo Workflows CI
9d85f81ea1 ci: auto-bump version to 0.1.124 2026-04-09 21:18:30 +00:00
jedarden
8216c76bd0 feat: implement Fresnel zone debug overlay for 3D visualization
Add comprehensive Fresnel zone ellipsoid visualization for all active links
in the 3D scene. Provides developers with real-time feedback on link
coverage geometry and detection quality.

Features:
- FresnelEllipsoid() helper function in dashboard/js/fresnel.js for shared
  ellipsoid geometry computation (used by both debug and explainability)
- Wireframe + fill material rendering for clear ellipsoid visualization
- Debug layer toggle in node panel (expert mode only)
- Hover interaction with tooltip showing link details (distance, wavelength,
  Fresnel radius, health score)
- Click interaction to select corresponding link in sidebar
- Mobile viewport optimization (reduced segment count for performance)
- Comprehensive test coverage for ellipsoid geometry computation

The first Fresnel zone ellipsoid represents the region where point
reflectors have maximum impact on CSI phase. Visualizing these zones
helps system tuners understand why localisation places blobs in specific
positions and identify coverage gaps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 17:17:43 -04:00
Argo Workflows CI
41153865c2 ci: auto-bump version to 0.1.123 2026-04-09 20:51:02 +00:00
jedarden
b7f2b67241 feat: implement CSI simulator Go CLI for hardware-free testing
Implemented mothership/cmd/sim with full CSI simulation capabilities:
- Virtual nodes connect via WebSocket with hello/health/role protocol
- Synthetic CSI binary frame generation with proper header format
- Walker simulation with random walk motion and wall bouncing
- BLE advertisement simulation (optional)
- Blob count verification mode for CI integration
- CSV ground truth export for offline analysis
- Comprehensive test coverage

The simulator enables integration testing without ESP32 hardware:
  sim --mothership localhost:8080 --nodes 4 --walkers 2 --rate 20 --duration 60
  sim --verify --nodes 2 --walkers 1 --duration 10 --seed 42

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 16:50:40 -04:00
jedarden
c3572e4305 feat: implement time-travel debugging and CSI replay
This commit adds complete time-travel debugging capabilities for CSI data,
enabling users to pause the live 3D view, scrub through historical data,
and replay the 3D scene exactly as it was at any point in the 48-hour recording
window.

Key features:
- ReplayEngine with state machine (LIVE, PAUSED, REPLAYING, SEEKING)
- Replay pipeline separate from live pipeline with tunable parameters
- WebSocket command handlers for replay control (seek, play, pause, set_params, apply_to_live)
- Timeline scrubber UI with playback controls and parameter tuning panel
- Seek performance < 1 second for all active links
- Parameter sliders for motion threshold, baseline tau, fresnel decay, subcarriers, breathing sensitivity

Implementation:
- mothership/internal/replay/engine.go: ReplayEngine with state machine
- mothership/internal/replay/pipeline.go: Replay signal processing pipeline
- mothership/internal/replay/types.go: Session types and TunableParams
- mothership/internal/dashboard/server.go: WebSocket command handlers
- dashboard/js/replay.js: Timeline scrubber UI with playback controls
- mothership/internal/dashboard/hub.go: BroadcastReplayBlobs method

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 16:50:40 -04:00
Argo Workflows CI
2fcf33813e ci: auto-bump version to 0.1.122 2026-04-09 20:14:40 +00:00
jedarden
75b7d0e832 feat: implement CSI simulator Go CLI for hardware-free testing
Implements a complete CSI simulator CLI that connects to the mothership
as virtual nodes and streams synthetic CSI frames for automated
integration testing without ESP32 hardware.

CLI Implementation (mothership/cmd/sim/):
- main.go: CLI entry point with all required flags (--mothership, --nodes,
  --walkers, --rate, --duration, --seed, --space, --ble, --verify,
  --noise-sigma, --wall, --output-csv)
- generator.go: synthetic CSI frame generation with proper binary format
- walker.go: random walk and path-following simulation
- verify.go: blob count verification with exit code reporting

Features:
- Virtual nodes connect via WebSocket with hello/health/BLE messages
- Synthetic CSI frames match Phase 1 protocol (24-byte header + I/Q payload)
- Configurable noise sigma for I/Q generation
- Wall definitions affecting path loss model
- CSV ground truth output for offline analysis
- Seed-based reproducibility for testing
- Verification mode for CI smoke testing

Physics Model (mothership/internal/simulator/):
- propagation.go: two-ray model (direct + reflection) with wall attenuation
- physics.go: path loss, RSSI computation, Fresnel zone calculations
- Reusable package shared with pre-deployment simulator

Tests:
- Binary header format validation (magic, version, fields in correct positions)
- RSSI range validation for given distances
- I/Q clamping to int8 range [-127, 127]
- Hello message format validation
- Verification mode blob detection
- Seed reproducibility for identical walker paths
- CSV output format validation
- Wall parsing validation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 16:14:17 -04:00
Argo Workflows CI
b58324d7bc ci: auto-bump version to 0.1.121 2026-04-09 19:30:55 +00:00
jedarden
1995b06820 feat: add anomaly_detected and sleep_session_end to valid event types
- Update isValidEventType to include anomaly_detected and sleep_session_end
- These event types were already supported in simple mode filtering
- Ensures consistency between type validation and mode filtering
2026-04-09 15:30:45 -04:00
Argo Workflows CI
6e3a421c09 ci: auto-bump version to 0.1.120 2026-04-09 19:17:55 +00:00
jedarden
a48fc8134b feat: implement POST /api/events/{id}/feedback endpoint
- Add missing encoding/json import to events.go
- Add EventID field to FeedbackRequest struct
- Implement postEventFeedback handler that:
  - Returns 404 for non-existent event IDs
  - Validates feedback type (correct, incorrect, missed)
  - Delegates to feedback handler via SubmitFeedback interface
  - Falls back to logging feedback event if no handler set
- Add comprehensive tests for POST /api/events/{id}/feedback endpoint:
  - Valid feedback (correct, incorrect, missed)
  - Event not found (404)
  - Invalid event ID (400)
  - Invalid feedback type (400)
  - Invalid request body (400)
  - Feedback handler delegation with mock

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 15:17:47 -04:00
Argo Workflows CI
6c413ba3bc ci: auto-bump version to 0.1.119 2026-04-09 19:09:08 +00:00
jedarden
2810bfec1c test: add tests for GET /api/events/{id} endpoint
- TestGetEvent_NotFound: verifies 404 for non-existent event IDs
- TestGetEvent_InvalidID: verifies 400 for invalid ID format
- TestGetEvent_HTTPHandler_Found: verifies 200 with full event details

Acceptance criteria met:
- Returns 404 for non-existent event IDs
- Returns full event details for valid IDs
2026-04-09 15:09:01 -04:00
Argo Workflows CI
9902fb0d91 ci: auto-bump version to 0.1.118 2026-04-09 19:02:41 +00:00
jedarden
1a31fe658d feat: implement GET /api/events list endpoint with full query support
Implement the GET /api/events endpoint with comprehensive query parameters:
- since, until: time-range filtering (ISO8601 format)
- type: filter by event type
- person_id, zone_id: filter by person/zone (with aliases)
- limit: pagination (max 500 per page)
- mode: simple/expert mode (filters system events in simple mode)

Acceptance criteria met:
- Filtered queries use indexed columns (idx_events_time, idx_events_type, idx_events_zone, idx_events_person)
- Time-range filtering returns correct subsets with since/until parameters
- Person and zone filters return correct subsets with person_id/zone_id aliases
- Mode parameter filters system events in simple mode (excludes: node_online, node_offline, ota_update, baseline_changed, system)
- Pagination works correctly with before cursor and limit parameter

Added comprehensive tests for:
- Mode parameter (simple vs expert mode)
- person_id and zone_id parameter aliases
- Combined filters with mode parameter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 15:02:31 -04:00
Argo Workflows CI
f01a5acc76 ci: auto-bump version to 0.1.117 2026-04-09 18:34:04 +00:00
jedarden
d879e2268b feat: add search and filter to timeline with category checkboxes
Implement comprehensive filter bar with:
- Type filter checkboxes for event categories (Presence, Zones, Alerts, System, Learning)
- Person and zone dropdowns for filtering
- Date range selector with preset options (Today/Last 7 days/Last 30 days/Custom)
- Text search input for fuzzy matching on descriptions
- Client-side filtering for loaded events (instant feedback)
- Server-side filtering for date-range queries
- Load more pagination works for 500+ results

Backend changes:
- Add support for 'since'/'until' date range parameters in /api/events
- Add zone_id and person_id query parameter aliases
- Add POST /api/events/{id}/feedback endpoint for feedback submission

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 14:33:33 -04:00
Argo Workflows CI
fd9c56fb38 ci: auto-bump version to 0.1.116 2026-04-09 18:25:12 +00:00
jedarden
f37772f5be feat: implement timeline storage subscriber
Create SQLite events table with indexes on timestamp, person_id, zone_id,
and type. Implement timeline storage subscriber goroutine that reads from
EventBus and writes to SQLite. Use 1000-event buffered queue with drop-oldest
behavior on overflow.

- StorageSubscriber subscribes to all EventBus event types
- 1000-event buffered queue with drop-oldest overflow handling
- Warning log every 100 dropped events
- Graceful shutdown with drain of remaining events
- Stats() method returns queue size and drop count
- Tests cover all event types, concurrent handling, and overflow behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 14:24:50 -04:00
Argo Workflows CI
b84a2dc353 ci: auto-bump version to 0.1.115 2026-04-09 18:05:41 +00:00
jedarden
43ca7fc49a feat: implement internal typed event bus with pub-sub
Implemented EventBus in mothership/internal/events/bus.go with:

- BusEventType enum with 18 event types (MotionDetected, ZoneTransition,
  FallDetected, NodeConnected, etc.)
- Typed EventPayload structs for all event types implementing
  EventType() and GetTimestamp() methods
- EventBus.Publish(payload) - non-blocking fan-out to all subscribers
- EventBus.Subscribe(eventType) - returns buffered channel for events
- EventBus.Unsubscribe() - removes subscriber
- EventBus.PublishBlocking() - blocking publish with context support
- Multiple subscribers per event type with non-blocking delivery
- Thread-safe with sync.RWMutex

Acceptance criteria met:
- Publish completes within 10ms (TestEventBusPublishWithin10ms)
- Multiple subscribers receive same event (TestEventBusMultipleSubscribers)
- All 18 event types have corresponding payload structs (TestAllPayloadTypes)
- 17 tests covering subscribe, publish, unsubscribe, concurrent access

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 14:05:32 -04:00
Argo Workflows CI
927b759823 ci: auto-bump version to 0.1.114 2026-04-09 18:02:09 +00:00
jedarden
92bdcf1023 feat: implement timeline storage subscriber with buffered queue
- Create timeline storage package that subscribes to EventBus
- Implement 1000-event buffered queue with drop-oldest behavior
- SQLite writer goroutine flushes events every 100ms in batches of 100
- Publishers never block - events dropped with warning log on overflow
- All event types stored in SQLite within 1 second of firing
- Comprehensive table-driven tests for all acceptance criteria

Acceptance Criteria Met:
- All event types stored in SQLite within 1 second of firing
- Storage subscriber never blocks publishers
- Handles queue overflow gracefully with warning log
- Tests cover basic storage, non-blocking, drop-oldest, all event types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 14:02:00 -04:00
Argo Workflows CI
37e63386ca ci: auto-bump version to 0.1.113 2026-04-09 17:52:18 +00:00
jedarden
54cab1e89d wip: various improvements
- Visualization improvements in 3D view
- Event API enhancements
- Replay system refinements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:52:10 -04:00
Argo Workflows CI
75f792044a ci: auto-bump version to 0.1.112 2026-04-09 17:33:06 +00:00
jedarden
357459e0b4 feat(s simulator): add GDOP overlay and realistic synthetic data
Implemented GDOP overlay visualization support and enhanced synthetic data
generation for the pre-deployment simulator.

GDOP Overlay Features:
- Added GDOPColorMap() for color mapping (green/yellow/orange/red/gray)
- Added GDOPHeatmapData struct for frontend consumption
- Added ToHeatmapData() to convert results to overlay format
- Added ComputeAccuracyMap() for expected accuracy per cell
- Added ComputeColorMap() for RGB color array generation
- Added GetWorstCoverageCells() to find problem areas
- Added GetBestCoverageCells() to find optimal positions

Realistic Synthetic Data:
- Added GenerateCSIFrame() for binary CSI frame simulation
  with temporal fading, frequency selectivity, and noise
- Added GenerateCSIFrames() for time-series CSI generation
- Added ComputeLinkMetrics() for realistic link statistics:
  - RSSI statistics (mean, std dev)
  - Packet delivery rate simulation
  - Link quality scoring
- Enhanced temporal variation with Rayleigh fading model

Tests:
- Added 8 new tests for overlay functionality
- Added 4 new tests for synthetic data generation
- All tests follow table-driven pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:32:48 -04:00
jedarden
2115b002d7 feat(replay): complete time-travel debugging implementation
Add time-based querying to recording store via ScanRange(), enabling
timeline scrubbing through historical CSI data. Refactor fusion engine
to interface for better testability and decoupling.

Changes:
- store.go: Add ScanRange(fromNS, toNS) for time-range queries
- worker.go: Change fusionEngine from *localization.Engine to interface
- api/replay.go: Add SetFusionEngine() method for dependency injection

Acceptance criteria met:
- Pause live mode: Dashboard Pause button + pauseLiveMode()
- Timeline scrubbing: Replay scrubber + seek API + ScanRange
- Replay 3D: BroadcastReplayBlobs() + updateReplayBlobs()
- 24h buffer: 360MB default in RecordingStore (configurable)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:32:48 -04:00
Argo Workflows CI
93093eb9fa ci: auto-bump version to 0.1.111 2026-04-09 17:08:56 +00:00
jedarden
acd4df2e19 feat(s simulator): implement synthetic walkers for node-to-node traversal
Add WalkerTypeNodeToNode that traverses between virtual nodes with realistic movement patterns:
- Walkers move from node to node in sequence, optionally waiting at each node
- Realistic speed variation (0.8x-1.2x base speed) for natural movement
- Acceleration/deceleration when approaching target nodes
- Falls back to random walk if no nodes are configured
- Maintains consistent walker height throughout traversal

New factory functions:
- NewNodeToNodeWalker() - creates walker with configurable wait time
- NewNodeToNodeWalkerNoWait() - creates walker without waiting
- CreateNodeToNodeWalkers() - creates multiple walkers with node rotation
- WalkerSet.AddNodeToNodeWalker() - add to walker set

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:08:24 -04:00
Argo Workflows CI
a5e09d001e ci: auto-bump version to 0.1.110 2026-04-09 16:58:25 +00:00