Commit graph

11 commits

Author SHA1 Message Date
jedarden
8116dc8fc2 docs(bf-2hdbg): migration window (not tokens) accepts tokenless sim nodes
Third link of the bf-34lwt split. Pins down that the bf-3hji 'no REJECT,
sim nodes accepted' state is a side effect of the default 24h migration
window a fresh boot opens — not a token/auth fix. Tokens never enter the
admission decision: sim nodes are tokenless where checked (hello.Token
body field is empty; the X-Spaxel-Token header they set is unread per
bf-29wyl). The sole acceptor is the migration deadline.

Verified against current source:
- config.go:139 MigrationWindowHours defaults to 24 (config.go:43 field
  comment '0 = disabled'); main.go:4495-4497 installs deadline=now+24h
  only when >0, so a fresh boot opens the window.
- server.go:510-518 acceptance branch gates on server.go:515
  !deadline.IsZero() && time.Now().Before(deadline) — tokenOK is
  irrelevant here; tokenless node admitted as Unpaired.
- server.go:519-526 reject branch (else of 515) hits server.go:525
  sendReject(conn,"invalid_token") + conn.Close(); sendReject writes
  {"type":"reject","reason":"invalid_token"} (server.go:841-845).

Conclusion: 'no reject' is a 24h-window MASK. REJECT returns when
SPAXEL_MIGRATION_WINDOW_HOURS=0 (deadline never set -> IsZero() ->
reject) or uptime > 24h (Before(deadline) false -> reject). Real fix is
on the token/supply side, not the window.

Carries the adjacent bf-3hji section it builds on ('the bf-3hji no-reject
finding above'), also uncommitted docs. No Go code touched; build + unit
tests + go vet clean.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-07 07:24:19 -04:00
jedarden
8014ad1768 docs(bf-3zll): document hardware-free mothership build + boot to /healthz
Verified the mothership builds from a clean checkout (mothership/ module root,
plain 'go build', no -tags=embed needed locally) and boots to /healthz with
no ESP32 hardware, reaching status=ok in ~230ms with no panic/crash in stderr.
Records the exact commands for the next child in the bf-40hc chain; canonical
path is TestHarness.Start in mothership/tests/e2e/e2e_test.go.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-07 00:37:30 -04:00
jedarden
83ec5a5ff7 docs: mark Phase 2 CSI recording buffer + adaptive sensing rate Done
Both are implemented (mothership/internal/recording/buffer.go and
mothership/internal/ingestion/ratecontrol.go). Phase 2 is now complete.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-03 00:17:13 -04:00
jedarden
9fabeb8a40 docs: mark Dashboard presence indicator Done in PROGRESS.md
Some checks are pending
CI Benchmark - Fusion Loop Timing / Fusion Loop Timing Benchmark (push) Waiting to run
Phase 2 table showed "Dashboard presence indicator" as Pending, but it
is implemented in dashboard/live.html and dashboard/js/app.js
(updatePresenceIndicator, #presence-indicator styling). Update the
table row to Done and drop it from the "Remaining for Phase 2" list.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-03 00:03:09 -04:00
jedarden
733f0b9f94 docs: mark Phase 8 and Phase 9 COMPLETE — all 9 phases of Spaxel implementation done 2026-04-15 19:18:53 -04:00
jedarden
af0dc8a5b5 docs: document Phase 7 completion - presence prediction implementation
Document the complete presence prediction system implementation
for Home Assistant integration with:

- Per-person transition probability tracking with Laplace smoothing
- Per-zone occupancy patterns from historical data
- Time-slot based predictions via Monte Carlo simulation
- HA sensor exposure with auto-discovery (3 sensors per person)
- Accuracy tracking targeting >75% at 15-minute horizon

All acceptance criteria for presence prediction have been met.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 10:17:32 -04:00
jedarden
973b0a0b62 feat(mothership): signal processing package with phase/baseline/motion detection
- Phase sanitization: complex CSI computation, RSSI normalization, spatial
  phase unwrapping, linear regression for STO/CFO removal
- HT20 subcarrier map: 64 total, 46 data subcarriers (null/guard/pilot excluded)
- Baseline system: EMA with motion-gated updates, confidence scoring,
  snapshot/restore for SQLite persistence
- Motion detection: NBVI subcarrier selection (Welford's algorithm),
  deltaRMS computation, exponential smoothing, threshold-based detection
- LinkProcessor/ProcessorManager: thread-safe per-link processing

Complete: phase sanitization, baseline, motion detection (items 7-9 of Phase 2)
Remaining: dashboard presence indicator, CSI recording buffer, adaptive rate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 08:08:46 -04:00
jedarden
3f2962f945 feat(deploy): Docker packaging with multi-stage build and compose orchestration
- Dockerfile: golang:1.23-bookworm builder → distroless/static-debian12:nonroot
- docker-compose.yml: host networking (required for mDNS), Traefik labels, resource limits
- VERSION: 0.1.0 for image tagging
- .dockerignore: excludes docs, build artifacts, IDE files
- .gitignore: standard Go/ESP-IDF ignores

Key decisions:
- Host networking required: Docker bridge blocks mDNS multicast 224.0.0.251
- distroless/static-debian12:nonroot: no shell, minimal attack surface, UID 65532
- Firmware via volume mount: users provide their own binaries for OTA
- Traefik labels disabled by default: enable SPAXEL_TRAEFIK_ENABLE=true for TLS

Complete: Phase 1 Docker packaging — all foundation items now done
Remaining: Phase 2 signal processing (baseline, deltaRMS, Fresnel zones)
2026-03-26 07:46:15 -04:00
jedarden
8230ef4222 feat(dashboard): web dashboard skeleton with Three.js 3D scene and CSI visualization
- Static HTML/JS dashboard served by mothership at /
- Three.js 3D scene with ground grid, OrbitControls (pan/zoom/rotate)
- WebSocket connection at /ws/dashboard for real-time CSI streaming
- Binary CSI frame parsing (24-byte header + I/Q payload)
- Amplitude bar chart (64 subcarriers) as 2D Canvas overlay
- Node/link panels with live status and click-to-select
- Dashboard Go package with Hub for client broadcasting
- Ingestion server broadcasts CSI frames and node events to dashboard
- 5 new tests for dashboard hub operations

Complete: 3D scene, WebSocket, amplitude chart, node/link panels
Remaining: Docker packaging (Phase 1 final item)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 07:40:53 -04:00
jedarden
f178496c83 feat(firmware): ESP32-S3 firmware skeleton with CSI/BLE/WebSocket
- State machine: 7-state lifecycle (BOOT→WIFI→DISCOVERY→CONNECTED,
  degraded modes WIFI_LOST/MOTHERSHIP_UNAVAILABLE/CAPTIVE_PORTAL)
- WiFi: STA connection with exponential backoff, mDNS discovery with
  cached IP fallback, captive portal AP for provisioning
- WebSocket: bidirectional comms, binary CSI frames (24B header + I/Q),
  JSON hello/health/ble/ota_status upstream, role/config/ota/reboot
  downstream, OTA task with progress reporting
- CSI: promiscuous mode capture, queue-based processing, passive BSSID
  filter, on-device variance tracking (Welford's) for motion hints
- BLE: passive scanning on Core 0, 60-device cache, 5s reporting
- NVS: 15-key schema with versioning, role/rate persistence

Complete: ESP32 firmware skeleton, passive radar, BLE scanning
Remaining: Dashboard skeleton, Docker packaging (Phase 1 items 5-6)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 07:20:55 -04:00
jedarden
3937dbe06e feat(mothership): WebSocket ingestion server with binary/JSON frame parsing
- /ws/node endpoint: one goroutine per connection, bidirectional
- Binary frames: 24-byte header → CSIFrame struct; payload as []int8 I/Q pairs
- JSON frames: dispatched by "type" field (hello, health, ble, motion_hint, ota_status)
- Per-link ring buffer: 256-sample circular, keyed by (node_mac, peer_mac)
- Node identity from first "hello" — no pre-registration required
- Used gorilla/websocket: mature, SetReadDeadline, binary frame support
- mDNS via hashicorp/mdns at _spaxel._tcp.local:8080
- Ping/pong keepalive: 30s ping interval, 60s read deadline
- Malformed frame tracking: warn at 100/min, close at 1000/min

Complete: frame parsing, ring buffers, mDNS, hello/health/ble dispatch, tests (22 passing)
Remaining: OTA command dispatch, /ws/dashboard publisher, SQLite fleet manager (Phase 2)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 06:55:22 -04:00