Commit graph

485 commits

Author SHA1 Message Date
Argo Workflows CI
2c8f8a89e6 ci: auto-bump version to 0.1.204 2026-04-14 19:35:14 +00:00
jedarden
6a7b93ae05 Fix deadlock in zones.UpdateBlobPositions by deferring callbacks
Collect zone crossing/transition events under lock, then fire callbacks
after releasing the lock to prevent re-entrant deadlock when callbacks
themselves call zone manager methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:35:03 -04:00
jedarden
d7c1adc260 Fix ESP-IDF 5.x firmware compilation for ESP32-S3 build
Port firmware/main to ESP-IDF 5.2 API:
- Add idf_component.yml with mdns and esp_websocket_client managed deps
- Rename esp_ota → app_update, esp_wifi_csi_info_t → wifi_csi_info_t
- Fix freertos/semphr.h include path rename
- Add missing headers: esp_mac.h, esp_netif.h, driver/temperature_sensor.h, string.h, math.h
- Add led.c to SRCS, fix xTaskCreate arg count (7→6)
- Use IDF 5.x temperature_sensor API in place of stub
- Fix mdns_query_ptr signature (add max_results arg)
- Fix url_decode isxdigit unsigned char cast
- Add flash size config (16MB) to sdkconfig.defaults
- Pin managed component versions in dependencies.lock
- Add sdkconfig (generated) to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:35:03 -04:00
Argo Workflows CI
12b8f39d02 ci: auto-bump version to 0.1.203 2026-04-14 19:21:50 +00:00
jedarden
c79f7ffee4 fix(firmware): declare mdns as managed component dependency
mdns was moved out of the built-in ESP-IDF tree in v5.x and must be
declared via idf_component.yml for the component manager to resolve it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:21:37 -04:00
Argo Workflows CI
7cf3cf1168 ci: auto-bump version to 0.1.202 2026-04-14 19:15:19 +00:00
jedarden
ab47adc88a fix(firmware): add led.c to CMakeLists SRCS
led.c was missing from the build, causing undefined reference errors
for led_init, led_stop_blink, and led_blink_identify at link time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:15:06 -04:00
Argo Workflows CI
432076a6d9 ci: auto-bump version to 0.1.201 2026-04-14 19:09:20 +00:00
jedarden
b8684aad68 fix(ci): set-target esp32s3 before idf.py build
ESP-IDF 5.x requires explicit set-target even when CONFIG_IDF_TARGET
is present in sdkconfig.defaults.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:09:06 -04:00
Argo Workflows CI
d193b5b28f ci: auto-bump version to 0.1.200 2026-04-14 19:03:53 +00:00
jedarden
f2b609a2ef fix(ci): source IDF export.sh in firmware build stage
espressif/idf entrypoint is not invoked in multi-stage builds, so
idf.py is not in PATH. Sourcing export.sh activates the toolchain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:03:40 -04:00
Argo Workflows CI
bfafb3cfa8 ci: auto-bump version to 0.1.199 2026-04-14 18:58:29 +00:00
jedarden
6b87040721 feat(ci): build ESP32 firmware in Dockerfile and seed OTA on startup
Add espressif/idf:v5.2 as a multi-stage build step so the firmware
binary is baked into the image at /firmware/spaxel-firmware.bin.
On startup the mothership copies it into /data/firmware/ (PVC) if not
already present, making it immediately available for the onboarding
wizard without a manual upload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 14:58:14 -04:00
Argo Workflows CI
21affcf449 ci: auto-bump version to 0.1.198 2026-04-14 01:59:06 +00:00
jedarden
299ae24916 fix(simple): load esp-web-tools for firmware flashing
The onboard wizard requires the esp-web-install-button custom element
from esp-web-tools. It was loaded in index.html but missing from
simple.html, causing "Firmware flashing component failed to load."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 21:58:53 -04:00
Argo Workflows CI
eb5a774299 ci: auto-bump version to 0.1.197 2026-04-14 01:38:53 +00:00
jedarden
ac1812aadf feat(simple): add node onboarding wizard to simple view
Add "+ Add Node" button to bottom nav and load onboard.js with wizard
CSS. Also fix broken init that still referenced removed SpaxelAuth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 21:38:41 -04:00
Argo Workflows CI
7dd223728f ci: auto-bump version to 0.1.196 2026-04-14 01:09:44 +00:00
jedarden
33c751b7b2 fix(dashboard): use window.BLEPanel in onclick to avoid ReferenceError
Bare `BLEPanel` in an inline onclick throws ReferenceError if the script
hasn't loaded yet. Using `window.BLEPanel` returns undefined instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 21:09:33 -04:00
Argo Workflows CI
ef681e4cb9 ci: auto-bump version to 0.1.195 2026-04-14 00:44:22 +00:00
jedarden
cf7d0c790a remove(auth): drop PIN-based auth — Google OAuth handles access
Traefik forward-auth with Google OAuth already gates all non-device
routes. The in-app PIN system was redundant. Removes auth middleware,
/api/auth/* endpoints, auth.js from all HTML pages, and SpaxelAuth
references from JS. The auth package remains for install_secret/node
token derivation used by provisioning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:44:12 -04:00
Argo Workflows CI
56c4931d53 ci: auto-bump version to 0.1.194 2026-04-13 23:51:27 +00:00
jedarden
aaa622d410 feat(ui): implement command palette (Component 34) with tests
- commandpalette.js: CommandPaletteManager with fuzzy scorer, time parsing,
  command registry (20 commands), recent history, entity search, mode gating
- commandpalette.css: modal overlay, search input, result list styles
- commandpalette.test.js: 64 tests covering fuzzy match, time parsing, commands
  completeness, keyboard nav, recent history, expert-mode gating, positioning
- app.js: spaxelGetState() exposure and Ctrl+K fallback listener
- index.html: includes commandpalette.css and commandpalette.js
- explainability.js + explain.go: detection explainability backend/frontend
- hub.go + server.go: dashboard WebSocket and API updates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 19:51:16 -04:00
Argo Workflows CI
2df378a666 ci: auto-bump version to 0.1.193 2026-04-13 23:08:17 +00:00
jedarden
823b67c630 feat(events): implement activity timeline with two-phase shutdown and test fixes
- StorageSubscriber: refactor to two-phase shutdown (forwarders drain
  EventBus channels into queue, then worker drains queue to SQLite)
  ensuring no in-flight events are lost on Stop()
- Fix bus_test: increase channel capacity to avoid non-blocking drops
  in TestEventBusConcurrentPublish
- Fix events_test: set MaxOpenConns(1) for in-memory SQLite to prevent
  concurrent-connection data visibility issues
- Fix storage_test: remove manual ctx/cancel initialization after
  StorageSubscriber struct was refactored to separate workerCtx/forwarderCtx
- Fix api/events.go: zone_id and person_id always take precedence;
  until timestamp uses < (cutoffMs+1000) to include full RFC3339 second
- Fix api/events_test: default mode is expert, simple mode requires
  explicit ?mode=simple parameter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 19:08:02 -04:00
Argo Workflows CI
0ed2ecbc58 ci: auto-bump version to 0.1.192 2026-04-13 22:08:30 +00:00
jedarden
76156b9c22 test(notify): add comprehensive tests for notification system
- Floor-plan renderer: 300x300 PNG dimensions, zone boundary pixel
  coordinates, blob colors (identified green, fall red, unknown blue)
- Batching: 3 LOW events produce 1 merged notification; URGENT bypasses
  batch queue and sends immediately
- Quiet hours gate: LOW suppressed, URGENT delivered; midnight-crossing
  range handled correctly
- Morning digest: queued events bundled and sent at digest time;
  sendMorningDigest clears queue and sets digestSentToday flag
- ntfy delivery: mock HTTP server verifies Title/Tags/Priority headers
  and body; image attachment in X-Image header
- Webhook delivery: JSON structure verified, base64 PNG image field
  decoded correctly; custom headers forwarded
- Test-notification endpoint: integration tests for ntfy and webhook
  channels with real HTTP mock servers
- Coverage: 81.2% on internal/notify (exceeds 80% requirement)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 17:42:26 -04:00
Argo Workflows CI
7679c7ebeb ci: auto-bump version to 0.1.191 2026-04-13 20:24:20 +00:00
jedarden
de272331b6 fix(health): don't degrade status when no nodes are connected
Zero connected nodes is valid for headless/standby deployments. The
5-minute grace period was causing an infinite crash loop: healthz
returned 503 after 5min uptime → liveness probe failed → pod restarted.
The "no nodes connected" reason is still reported but no longer sets
status to degraded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:24:07 -04:00
Argo Workflows CI
ecad097c2b ci: auto-bump version to 0.1.190 2026-04-13 16:28:32 +00:00
jedarden
d67ec45d15 fix(auth): serve minimal login page for unauthenticated page requests
Instead of serving the full dashboard HTML (which exposes the UI shell
when the auth overlay is deleted), serve a minimal page that only loads
the auth JS and CSS. Deleting the overlay now reveals a blank page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 12:28:16 -04:00
Argo Workflows CI
d83846b1f3 ci: auto-bump version to 0.1.189 2026-04-13 15:01:13 +00:00
jedarden
2976cc08a5 fix(auth): register middleware before routes (chi requirement)
Chi panics if r.Use() is called after any route registration.
Move the auth middleware registration before RegisterRoutes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 11:01:01 -04:00
Argo Workflows CI
8cb15e0c6e ci: auto-bump version to 0.1.188 2026-04-13 14:50:34 +00:00
jedarden
3cd10f6f07 fix(auth): enforce PIN authentication server-side on all API/WS routes
The PIN overlay was client-side only — deleting the DOM element bypassed
auth entirely. Add global chi middleware that returns 401 on protected
endpoints when no valid session cookie is present. Static files pass
through so the login page renders. During onboarding (no PIN set), all
routes remain open.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 10:50:18 -04:00
Argo Workflows CI
b8aa830329 ci: auto-bump version to 0.1.187 2026-04-12 21:27:36 +00:00
jedarden
6bcd4711f1 fix: guard migration 7 ALTER TABLE with column existence check
SQLite doesn't support IF NOT EXISTS on ALTER TABLE ADD COLUMN.
The error_message and error_count columns already exist in the
triggers table from v0.1.33, causing migration 7 to fail on upgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 17:27:24 -04:00
Argo Workflows CI
22a5bfe561 ci: auto-bump version to 0.1.186 2026-04-12 21:14:23 +00:00
jedarden
1cf11ac197 fix: resolve compilation errors breaking CI builds
- fleet/handler.go: add ota. package prefix to NodeOTAProgress
- notification_settings.go: remove duplicate declarations of
  testNotificationRequest, validateChannelConfig, writeJSON, and
  writeJSONError that conflict with notifications.go and utils.go;
  fix missing closing brace in validateTimeFormat
- cmd/mothership/main.go: use sigproc.HealthLogEntry (the actual
  return type of GetHealthHistory) instead of diagnostics.LinkHealthSnapshot

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 17:14:05 -04:00
Argo Workflows CI
6557977be2 ci: auto-bump version to 0.1.185 2026-04-12 02:42:09 +00:00
jedarden
136b2ecd97 feat: add OTA progress tracking to fleet status page
Add real-time OTA update progress broadcasting to dashboard clients:
- Hub.BroadcastOTAProgress() sends progress updates over WebSocket
- OTA Manager now broadcasts state transitions: pending → downloading → rebooting → verified/failed/rollback
- Dashboard can show live OTA status per node during fleet updates
- Includes test suite for fleet page functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 22:41:51 -04:00
jedarden
c9d25cde17 Update fleet status page bead (spaxel-0w4) - implementation complete
The fleet status page is fully implemented with all required features:
- HTML structure with navigation, filters, bulk actions, modals
- JavaScript with state management, filtering, sorting, inline editing, camera fly-to, CSV export
- CSS with responsive design and comprehensive styling
- REST API endpoints for all fleet operations
- Comprehensive test coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 22:41:51 -04:00
Argo Workflows CI
531b953f0a ci: auto-bump version to 0.1.184 2026-04-12 01:37:49 +00:00
jedarden
ff71d48962 feat: add OTA progress tracking to fleet status page
- Show "updating" status for nodes undergoing OTA updates
- Add OTAInProgress field to FleetNode response
- Improve updateAllNodes to trigger rolling OTA updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 21:37:37 -04:00
Argo Workflows CI
c83dccf576 ci: auto-bump version to 0.1.183 2026-04-12 01:03:04 +00:00
jedarden
d500900e0b feat: add feature discovery notification UI to proactive dashboard
Adds frontend implementation for feature discovery notifications:
- Polls /api/help/notifications every 30 seconds
- Displays notification cards with slide-in animation
- Handles action button clicks for navigation
- Persists dismissed notifications to prevent re-display
- Auto-dismisses after 30 seconds

Completes the feature discovery notifications feature for Phase 9,
complementing the backend notifier and monitor implementations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 21:02:43 -04:00
Argo Workflows CI
362ba60895 ci: auto-bump version to 0.1.182 2026-04-11 23:52:26 +00:00
jedarden
70745bb577 feat: implement proactive quality prompts with link diagnostics
- Show non-blocking prompt card when ambient confidence drops below 0.6 for >5 minutes
- Add 'Diagnose' button that fetches and displays root cause analysis
- Add 'Dismiss for today' option with localStorage persistence
- Implement pulsing amber highlight on 3D link lines for degraded links
- Display diagnostic results in plain English with possible causes and actions
- Do NOT show prompts for transient drops (< 5 minutes)
- Add GetDiagnosticFor method to diagnostics package for timestamp-based queries
- Wire up /api/links/{linkID}/diagnostics endpoint with health snapshots

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 19:51:57 -04:00
Argo Workflows CI
479ee7e3d9 ci: auto-bump version to 0.1.181 2026-04-11 21:56:00 +00:00
jedarden
4734e62aa1 feat: implement notification configuration UI for dashboard
Add comprehensive notification settings with delivery channel selector,
channel-specific credential fields, test notification button, event
type toggles, quiet hours picker, smart batching, and morning digest.

Backend:
- Add NotificationSettingsHandler with GET/PUT /api/settings/notifications
- Add POST /api/notifications/test endpoint
- Support ntfy, pushover, webhook channels with validation
- Store settings in settings table with proper JSON encoding

Frontend:
- Integrate notification settings into settings panel
- Channel selector with dynamic credential fields
- Event type toggles for filtering notifications
- Quiet hours time picker with day-of-week bitmask
- Smart batching toggle (default on)
- Morning digest toggle (default on)
- Test notification button with immediate feedback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 17:55:31 -04:00