diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index de45431..b698606 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -3,13 +3,14 @@ {"id":"spaxel-0ii","title":"Implement Zones CRUD REST endpoints","description":"Implement CRUD endpoints for zones: GET/POST /api/zones, PUT/DELETE /api/zones/{id}. Include OpenAPI-style godoc comments. Zone changes must reflect in live 3D view within one WebSocket cycle.","status":"closed","priority":2,"issue_type":"task","assignee":"echo","created_at":"2026-04-07T13:56:27.275139529Z","created_by":"coding","updated_at":"2026-04-07T19:01:48.974563569Z","closed_at":"2026-04-07T19:01:48.974408083Z","close_reason":"Zones CRUD REST endpoints already fully implemented: GET/POST /api/zones, PUT/DELETE /api/zones/{id}, GET /api/zones/{id}/history, plus portals CRUD. OpenAPI godoc comments, WebSocket broadcasting for live 3D view, 31 table-driven tests. go vet and go test pass.","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:1","mitosis-child","mitosis-depth:1","parent-spaxel-21n"],"dependencies":[{"issue_id":"spaxel-0ii","depends_on_id":"spaxel-3rd","type":"blocks","created_at":"2026-04-07T17:01:33.629176640Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-0ii","depends_on_id":"spaxel-5lo","type":"blocks","created_at":"2026-04-07T17:01:33.542274773Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-0j0k","title":"Implement responsive canvas resize and orientation handling","description":"Handle canvas resize on window resize and orientation change events, including iOS Safari visual viewport quirks and bottom navigation bar spacing.\n\n**Files:** dashboard/js/app.js (resize/orientationchange listeners), dashboard/css/expert.css (canvas height calculation)\n\n**Acceptance Criteria:**\n- Canvas resizes correctly on window resize event\n- Canvas resizes correctly on orientationchange event\n- renderer.setSize() called with updated dimensions\n- camera.aspect updated and camera.updateProjectionMatrix() called\n- Uses visualViewport.width/height on iOS Safari (fallback to window.innerWidth/Height)\n- Canvas height uses calc(100vh - 56px) when simple mode nav is visible","status":"closed","priority":2,"issue_type":"task","assignee":"bravo","created_at":"2026-04-11T06:26:50.081049506Z","created_by":"coding","updated_at":"2026-04-11T06:51:20.327121642Z","closed_at":"2026-04-11T06:51:20.327061414Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["mitosis-child","mitosis-depth:1","parent-spaxel-kth"]} {"id":"spaxel-0n8r","title":"Adopt single design system (Radix dark tokens) across dashboard","description":"## Goal\n\nAll dashboard pages (`index.html`, `ambient.html`, `fleet.html`, `simple.html`, `integrations.html`) share one design system per plan.md §8e.\n\n## Scope\n\nCreate `dashboard/css/tokens.css` with CSS custom properties for:\n\n- **Colors:** Radix `slate` scale (12 steps) as `--slate-1` … `--slate-12`. Accent: Radix `blue` scale. Semantic: `--ok` (green-9), `--warn` (amber-9), `--alert` (red-9).\n- **Typography:** `--font-body`, `--font-mono`. Sizes: `--text-xs` (12), `--text-sm` (14), `--text-base` (16), `--text-lg` (20), `--text-2xl` (28).\n- **Spacing:** `--space-1` (4px) through `--space-16` (64px) on the canonical scale.\n- **Radius:** `--radius-control` (6px), `--radius-card` (10px), `--radius-modal` (16px).\n\nThen refactor each existing CSS file to use these tokens instead of hard-coded values. Delete any light-theme rules; dashboard is dark-only.\n\n`integrations.html` is the reference — its current look already approximates the target. Use it as the acceptance bar for other pages.\n\n## Verification\n\n- `grep -r \"#[0-9a-fA-F]\\{3,6\\}\" dashboard/css/` returns only uses inside `tokens.css`.\n- Playwright screenshots of all five pages show one consistent theme.\n- axe-core reports zero WCAG AA contrast violations.\n\nTraceability: plan.md §8e.","status":"closed","priority":1,"issue_type":"feature","assignee":"quebec","created_at":"2026-04-24T11:13:23.515071217Z","created_by":"coding","updated_at":"2026-04-24T20:48:18.439563795Z","closed_at":"2026-04-24T20:48:18.439456031Z","close_reason":"Verified: design token migration already complete. All 25 non-token CSS files use var(--token-name) exclusively. Zero hard-coded hex/rgba outside tokens.css. Zero light-theme rules. tokens.css contains full Radix dark scale (slate 1-12, blue 1-12, semantic colors, typography, spacing, radius). Prior commits 1e8876d and 07abc03 completed this work.","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:50"]} -{"id":"spaxel-0w4","title":"Fleet status page","description":"## Background\n\nThe 3D scene is great for spatial context but poor for bulk fleet management tasks. With 6+ nodes, finding a specific node in the 3D view, checking its firmware version, and triggering an update involves hunting through the scene. The fleet status page provides a flat table view of all nodes with their key metrics and inline actions — the same information you would find in a server management panel, adapted for ESP32 nodes. It complements the 3D view rather than replacing it.\n\n## Fleet Status Table\n\nNew dashboard route: /fleet\n\nThe page layout:\n- Page header: \"Fleet Status\" title, total node count, online count, \"Update All\" button, \"Download report\" button\n- Filter and sort bar (below header)\n- Fleet table (main content)\n\nTable columns:\n1. Checkbox (for multi-select)\n2. Label (editable inline on double-click)\n3. MAC address (truncated, full on hover tooltip)\n4. Status: coloured dot + text. \"Online\" (green) / \"Offline\" (red) / \"Updating\" (yellow spinner)\n5. Firmware version: current version string. If a newer version is in the firmware manifest: version displayed in amber with an \"→ {new_version}\" indicator and an \"Update\" action badge.\n6. Uptime: formatted as \"3d 4h 12m\". Only valid when online.\n7. Current role: TX / RX / TX-RX / Passive. Small badge.\n8. Signal health: composite health score for this node's links as a small colour bar (green → red)\n9. Packet rate: \"{actual} / {configured} Hz\" as a fraction. Colour-coded: > 90% = green, 70-90% = amber, < 70% = red.\n10. Temperature: from health message. Shown as \"{N}°C\" or \"--\" if not reported. Alert colour if > 75°C.\n11. Actions column: [Locate] [OTA] [...more] buttons\n\nThe table rows are clickable (full row click = fly 3D camera to that node's position). Only clicking action buttons or the checkbox should not trigger the row fly-to.\n\n## Inline Label Edit\n\nDouble-clicking the label cell makes it inline-editable:\n- Input field replaces the text\n- Enter to confirm, Escape to cancel\n- Blur (click outside) to confirm\n- On confirm: PATCH /api/nodes/{mac}/label with the new label. Update the display.\n- Validation: max 32 characters, no control characters.\n\n## Action Buttons\n\n\"Locate\" (flash LED): sends a downstream command {\"type\":\"identify\"} to the node via WebSocket. The node flashes its onboard LED rapidly for 5 seconds. The button shows a spinner while the command is in-flight, then a brief green checkmark.\n\n\"OTA\" (firmware update): available only if the node's firmware version != latest in the manifest. Clicking shows a confirmation tooltip: \"Update Node [label] from v{current} to v{latest}? [Confirm] [Cancel]\". On confirm: POST /api/nodes/{mac}/ota. The node's row shows \"Updating\" status and a progress bar (populated from ota_status WebSocket messages for this node).\n\n\"More actions\" (... button): dropdown with: \"Re-assign role\", \"View health history\", \"View event history\", \"Remove from fleet\". Each with an appropriate icon.\n\n## Bulk Actions\n\nCheckbox column allows multi-selecting rows. When any row is selected, a bulk-actions bar slides in above the table:\n- \"Update {N} selected to latest firmware\" — confirms and triggers OTA for all selected nodes in sequence (with 30s stagger)\n- \"Re-assign roles\" — opens the role optimiser with the selected nodes included\n- \"Remove {N} from fleet\" — confirmation required: lists the nodes to be removed\n\nDeselect all: \"Clear selection\" button in the bulk actions bar, or uncheck all checkboxes.\n\n## Camera Fly-To\n\nClicking a table row (non-action click) triggers a smooth camera fly-to the node's position in the expert mode 3D view. The fleet page and expert mode are on different routes, so this requires:\n1. Store the target node MAC in localStorage or URL parameter (\"?highlight={mac}\")\n2. Redirect to the expert mode route / (or open expert mode in a second tab)\n3. On load, if ?highlight={mac} parameter is present, fly camera to that node's position\n\nAlternatively: if the fleet page is opened alongside the expert mode in a split-pane layout (future enhancement), coordinate via a shared state store. For Phase 9, the redirect approach is sufficient.\n\n## Sorting and Filtering\n\nColumn header click: sort by that column. First click = ascending, second = descending. Sort state shown with a small arrow indicator.\n\nFilter row (below column headers, toggle-able with a \"Filter\" button):\n- Label / MAC: text input, filters rows containing the substring\n- Status: dropdown \"All / Online / Offline\"\n- Firmware: dropdown \"All / Outdated only\"\n- Role: multi-select dropdown \"All / TX / RX / TX-RX / Passive\"\n\nActive filters: shown as chips above the table with individual dismiss buttons. \"Clear all filters\" link.\n\n## Download Report\n\n\"Download report\" button: exports the current fleet table (including all filters) as a CSV file. Columns: MAC, label, status, firmware_version, uptime_s, role, health_score, packet_rate_hz, temperature_c, last_seen.\n\nImplemented as a client-side CSV generation from the current table data (no API call needed if data is cached in the dashboard state). Use Blob + URL.createObjectURL for download.\n\n## REST API\n\nGET /api/fleet: returns all provisioned nodes with full details (same as GET /api/nodes but with more fields: uptime, firmware_version, temperature, health_score, packet_rate).\nPATCH /api/nodes/{mac}/label: update label\nPOST /api/nodes/{mac}/locate: send identify command\nPOST /api/nodes/{mac}/role: assign new role\nDELETE /api/nodes/{mac}: remove from fleet (disconnects and archives)\n\n## Files to Create or Modify\n\n- dashboard/fleet.html: fleet page HTML shell\n- dashboard/js/fleet.js: table rendering, sorting, filtering, bulk actions, inline edit\n- dashboard/css/fleet.css: fleet page styles\n- mothership/internal/dashboard/routes.go: fleet-specific API routes, /fleet HTML route\n\n## Tests\n\n- Test fleet table renders correctly with mock data: 4 nodes, verify all columns populated\n- Test inline label edit: double-click cell, type new label, Enter -> PATCH API called with correct body\n- Test bulk selection: check 3 nodes, verify bulk actions bar appears with correct count\n- Test bulk OTA triggers OTA for all 3 selected nodes\n- Test sorting: click \"Firmware version\" header -> rows sorted ascending by version string\n- Test filter: enter \"living\" in label filter -> only rows matching \"living\" visible\n- Test camera fly-to: clicking a row stores MAC in localStorage and redirects to expert mode with ?highlight parameter\n- Test CSV download: verify blob is created with correct headers and values\n\n## Acceptance Criteria\n\n- Fleet page loads with all nodes and their current metrics\n- Inline label edit saves correctly to the API and updates the display\n- Bulk OTA fires for all selected nodes with correct stagger\n- Sorting and filtering work correctly for all columns\n- Camera fly-to positions the 3D view correctly on the selected node after redirect\n- CSV download contains correct headers and all fleet data\n- Tests pass","status":"in_progress","priority":3,"issue_type":"task","assignee":"charlie","created_at":"2026-03-28T02:06:06.562532476Z","created_by":"coding","updated_at":"2026-04-12T01:46:28.273155296Z","close_reason":"Fleet status page already fully implemented with all required features:\n\n- dashboard/fleet.html: Complete HTML structure with navigation, filters, bulk actions, and modals\n- dashboard/js/fleet-page.js: Full JavaScript with state management, filtering, sorting, bulk actions, inline label editing, camera fly-to, and CSV export\n- dashboard/css/fleet-page.css: Complete responsive styling with CSS variables\n- mothership/internal/fleet/fleethandler.go: REST API with endpoints for list, get, set role, update position, update label, delete, identify, reboot, trigger OTA, export/import config\n- mothership/internal/fleet/handler_test.go: Comprehensive test coverage\n\nAdditional enhancement committed: OTA progress tracking now shows 'updating' status for nodes undergoing firmware updates.","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:33"],"dependencies":[{"issue_id":"spaxel-0w4","depends_on_id":"spaxel-sl2","type":"blocks","created_at":"2026-03-28T03:29:14.955755499Z","created_by":"coding","metadata":"{}","thread_id":""}]} +{"id":"spaxel-0w4","title":"Fleet status page","description":"## Background\n\nThe 3D scene is great for spatial context but poor for bulk fleet management tasks. With 6+ nodes, finding a specific node in the 3D view, checking its firmware version, and triggering an update involves hunting through the scene. The fleet status page provides a flat table view of all nodes with their key metrics and inline actions — the same information you would find in a server management panel, adapted for ESP32 nodes. It complements the 3D view rather than replacing it.\n\n## Fleet Status Table\n\nNew dashboard route: /fleet\n\nThe page layout:\n- Page header: \"Fleet Status\" title, total node count, online count, \"Update All\" button, \"Download report\" button\n- Filter and sort bar (below header)\n- Fleet table (main content)\n\nTable columns:\n1. Checkbox (for multi-select)\n2. Label (editable inline on double-click)\n3. MAC address (truncated, full on hover tooltip)\n4. Status: coloured dot + text. \"Online\" (green) / \"Offline\" (red) / \"Updating\" (yellow spinner)\n5. Firmware version: current version string. If a newer version is in the firmware manifest: version displayed in amber with an \"→ {new_version}\" indicator and an \"Update\" action badge.\n6. Uptime: formatted as \"3d 4h 12m\". Only valid when online.\n7. Current role: TX / RX / TX-RX / Passive. Small badge.\n8. Signal health: composite health score for this node's links as a small colour bar (green → red)\n9. Packet rate: \"{actual} / {configured} Hz\" as a fraction. Colour-coded: > 90% = green, 70-90% = amber, < 70% = red.\n10. Temperature: from health message. Shown as \"{N}°C\" or \"--\" if not reported. Alert colour if > 75°C.\n11. Actions column: [Locate] [OTA] [...more] buttons\n\nThe table rows are clickable (full row click = fly 3D camera to that node's position). Only clicking action buttons or the checkbox should not trigger the row fly-to.\n\n## Inline Label Edit\n\nDouble-clicking the label cell makes it inline-editable:\n- Input field replaces the text\n- Enter to confirm, Escape to cancel\n- Blur (click outside) to confirm\n- On confirm: PATCH /api/nodes/{mac}/label with the new label. Update the display.\n- Validation: max 32 characters, no control characters.\n\n## Action Buttons\n\n\"Locate\" (flash LED): sends a downstream command {\"type\":\"identify\"} to the node via WebSocket. The node flashes its onboard LED rapidly for 5 seconds. The button shows a spinner while the command is in-flight, then a brief green checkmark.\n\n\"OTA\" (firmware update): available only if the node's firmware version != latest in the manifest. Clicking shows a confirmation tooltip: \"Update Node [label] from v{current} to v{latest}? [Confirm] [Cancel]\". On confirm: POST /api/nodes/{mac}/ota. The node's row shows \"Updating\" status and a progress bar (populated from ota_status WebSocket messages for this node).\n\n\"More actions\" (... button): dropdown with: \"Re-assign role\", \"View health history\", \"View event history\", \"Remove from fleet\". Each with an appropriate icon.\n\n## Bulk Actions\n\nCheckbox column allows multi-selecting rows. When any row is selected, a bulk-actions bar slides in above the table:\n- \"Update {N} selected to latest firmware\" — confirms and triggers OTA for all selected nodes in sequence (with 30s stagger)\n- \"Re-assign roles\" — opens the role optimiser with the selected nodes included\n- \"Remove {N} from fleet\" — confirmation required: lists the nodes to be removed\n\nDeselect all: \"Clear selection\" button in the bulk actions bar, or uncheck all checkboxes.\n\n## Camera Fly-To\n\nClicking a table row (non-action click) triggers a smooth camera fly-to the node's position in the expert mode 3D view. The fleet page and expert mode are on different routes, so this requires:\n1. Store the target node MAC in localStorage or URL parameter (\"?highlight={mac}\")\n2. Redirect to the expert mode route / (or open expert mode in a second tab)\n3. On load, if ?highlight={mac} parameter is present, fly camera to that node's position\n\nAlternatively: if the fleet page is opened alongside the expert mode in a split-pane layout (future enhancement), coordinate via a shared state store. For Phase 9, the redirect approach is sufficient.\n\n## Sorting and Filtering\n\nColumn header click: sort by that column. First click = ascending, second = descending. Sort state shown with a small arrow indicator.\n\nFilter row (below column headers, toggle-able with a \"Filter\" button):\n- Label / MAC: text input, filters rows containing the substring\n- Status: dropdown \"All / Online / Offline\"\n- Firmware: dropdown \"All / Outdated only\"\n- Role: multi-select dropdown \"All / TX / RX / TX-RX / Passive\"\n\nActive filters: shown as chips above the table with individual dismiss buttons. \"Clear all filters\" link.\n\n## Download Report\n\n\"Download report\" button: exports the current fleet table (including all filters) as a CSV file. Columns: MAC, label, status, firmware_version, uptime_s, role, health_score, packet_rate_hz, temperature_c, last_seen.\n\nImplemented as a client-side CSV generation from the current table data (no API call needed if data is cached in the dashboard state). Use Blob + URL.createObjectURL for download.\n\n## REST API\n\nGET /api/fleet: returns all provisioned nodes with full details (same as GET /api/nodes but with more fields: uptime, firmware_version, temperature, health_score, packet_rate).\nPATCH /api/nodes/{mac}/label: update label\nPOST /api/nodes/{mac}/locate: send identify command\nPOST /api/nodes/{mac}/role: assign new role\nDELETE /api/nodes/{mac}: remove from fleet (disconnects and archives)\n\n## Files to Create or Modify\n\n- dashboard/fleet.html: fleet page HTML shell\n- dashboard/js/fleet.js: table rendering, sorting, filtering, bulk actions, inline edit\n- dashboard/css/fleet.css: fleet page styles\n- mothership/internal/dashboard/routes.go: fleet-specific API routes, /fleet HTML route\n\n## Tests\n\n- Test fleet table renders correctly with mock data: 4 nodes, verify all columns populated\n- Test inline label edit: double-click cell, type new label, Enter -> PATCH API called with correct body\n- Test bulk selection: check 3 nodes, verify bulk actions bar appears with correct count\n- Test bulk OTA triggers OTA for all 3 selected nodes\n- Test sorting: click \"Firmware version\" header -> rows sorted ascending by version string\n- Test filter: enter \"living\" in label filter -> only rows matching \"living\" visible\n- Test camera fly-to: clicking a row stores MAC in localStorage and redirects to expert mode with ?highlight parameter\n- Test CSV download: verify blob is created with correct headers and values\n\n## Acceptance Criteria\n\n- Fleet page loads with all nodes and their current metrics\n- Inline label edit saves correctly to the API and updates the display\n- Bulk OTA fires for all selected nodes with correct stagger\n- Sorting and filtering work correctly for all columns\n- Camera fly-to positions the 3D view correctly on the selected node after redirect\n- CSV download contains correct headers and all fleet data\n- Tests pass","status":"closed","priority":3,"issue_type":"task","assignee":"romeo","created_at":"2026-03-28T02:06:06.562532476Z","created_by":"coding","updated_at":"2026-04-25T12:49:56.798295553Z","closed_at":"2026-04-25T12:49:56.798220896Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:33"],"dependencies":[{"issue_id":"spaxel-0w4","depends_on_id":"spaxel-sl2","type":"blocks","created_at":"2026-03-28T03:29:14.955755499Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-16e","title":"Captive portal WiFi recovery","description":"## Background\n\nIf a node loses WiFi connectivity — because a router was replaced, credentials changed, or the node was moved out of range — it currently has no recovery path without physical intervention. The firmware already implements a captive portal AP fallback in firmware/main/wifi.c: after 10 consecutive WiFi connection failures with exponential backoff (up to 30s between attempts), the firmware transitions to AP mode with SSID \"spaxel-{last4mac}\". However, the captive portal HTTP config page served in this mode is currently a stub and needs to be completed. This bead finishes that implementation and adds the mothership-side offline detection and dashboard alert.\n\n## What Already Exists (Phase 1)\n\nfirmware/main/wifi.c implements the WIFI_STATE_CAPTIVE_PORTAL state transition after failure threshold. The firmware starts a SoftAP with SSID \"spaxel-{last4mac}\" and password-free (open AP). A stub HTTP server exists but serves only a 200 OK response with no content. The DNS server for captive portal hijacking is not yet implemented.\n\n## Captive Portal HTTP Server (Firmware)\n\nUse ESP-IDF's esp_http_server component to serve a config page at http://192.168.4.1/ when in AP mode.\n\nThe config page (served as inline HTML, no external resources — it must work fully offline):\n- Shows current provisioned SSID (from NVS, read-only display)\n- Form: new SSID input, password input, optional mothership host/port\n- Submit button: \"Save and Reconnect\"\n- On form submission: firmware writes new credentials to NVS (wifi_ssid, wifi_pass, optionally mothership_host/port) and calls esp_restart()\n- Minimal HTML with inline CSS: max 4KB so it fits in IRAM. No JavaScript needed.\n- Works on iOS Safari (no JS requirement), Android Chrome, desktop browsers\n\nThe HTTP server must handle the iOS and Android captive portal probe paths:\n- GET /hotspot-detect.html (iOS)\n- GET /generate_204 (Android)\n- GET /ncsi.txt (Windows)\nRespond to all of these with a 302 redirect to http://192.168.4.1/ to trigger the OS captive portal popup.\n\n## DNS Hijacking for Captive Portal Detection\n\nModern mobile OSes detect captive portals by making a DNS lookup for a known hostname (connectivitycheck.android.com, captive.apple.com, etc.) and checking if the response is correct. To trigger the OS captive portal popup automatically (so the user does not need to manually navigate to 192.168.4.1):\n\nImplement a minimal DNS server using lwIP's UDP API. The DNS server binds to UDP port 53 on the SoftAP interface (192.168.4.1). It responds to ALL DNS queries with an A record pointing to 192.168.4.1, regardless of the queried hostname. This causes the OS to detect the captive portal and show the popup.\n\nESP-IDF does not provide a ready-made DNS hijacking component — implement using esp_event_loop and lwIP udp_new()/udp_bind()/udp_recv() APIs. Keep the implementation minimal: parse enough of the DNS query to extract the transaction ID and question name, then build a minimal A record response.\n\n## Mothership Offline Detection and Dashboard Alert\n\nThe mothership detects node disconnection via heartbeat timeout. When a node's WebSocket closes (or health messages stop for > 30s), the mothership:\n1. Sets node status to OFFLINE in the node registry\n2. Broadcasts a node_offline WebSocket message to dashboard: {\"type\":\"node_offline\",\"mac\":\"aa:bb:cc:dd:ee:ff\",\"label\":\"Living Room\",\"last_seen\":\"2026-03-27T14:23:00Z\",\"likely_cause\":\"wifi_loss\"}\n\nThe dashboard shows an offline alert card:\n- \"Node [Living Room] went offline at 14:23. It may need WiFi reconfiguration.\"\n- Shows the captive portal AP SSID to connect to: \"Connect to Wi-Fi network 'spaxel-ff01' to reconfigure\"\n- Troubleshooting steps: 1) Check power LED, 2) Check WiFi router is online, 3) Connect to captive portal if LED is blinking\n\nThe likely_cause field is set by the mothership based on the last health message before disconnect (e.g. low WiFi RSSI in last health message -> \"wifi_range\", no recent health messages at all -> \"unknown\").\n\n## Reconnection and Portal Exit\n\nWhen the user submits new credentials in the captive portal and the node reboots:\n1. The SoftAP goes down (existing connections to \"spaxel-ff01\" are dropped)\n2. The node attempts WiFi connection with new credentials\n3. On success, connects to mothership — mothership sets status to ONLINE and broadcasts node_online event\n4. Dashboard shows reconnection notification: \"Node [Living Room] reconnected successfully\"\n\nIf the new credentials also fail (e.g. user mistyped), the node re-enters captive portal mode after another 10 failures. The portal should display an error on re-entry if the previous attempt failed.\n\n## Implementation Files\n\n- firmware/main/wifi.c: complete captive portal HTTP server, add DNS hijacking task\n- firmware/main/captive_portal.c (new): DNS hijacking task + HTTP handler functions\n- mothership/internal/ingestion/server.go: heartbeat timeout detection, node_offline event\n- mothership/internal/fleet/manager.go: node status tracking (ONLINE/OFFLINE/CAPTIVE_PORTAL)\n- dashboard/js/app.js: node_offline event handler, offline alert card rendering\n\n## Testing Challenges\n\nThis feature is difficult to unit test due to hardware dependency. Recommended approaches:\n1. Firmware: Integration test in QEMU (esp32s3 target) — simulate WiFi failures by mocking the WiFi event loop, verify state machine transitions to CAPTIVE_PORTAL after failure threshold\n2. DNS server: Unit test the DNS response builder function with a fixed query buffer and verify the response parses correctly\n3. HTTP config page: Unit test the form handler that writes to NVS (mock the NVS API)\n4. Mothership: Unit test heartbeat timeout detection with a fake time source, verify node_offline event is emitted\n\n## Acceptance Criteria\n\n- After WiFi failure (10 consecutive failures), node enters AP mode with SSID \"spaxel-{last4mac}\" within 5 minutes of initial loss\n- Mobile device connecting to the captive portal AP automatically sees the OS captive portal popup (tested on iOS 16+ and Android 12+)\n- Config page is served and functional without JavaScript\n- Updating credentials causes node to reboot and reconnect to mothership within 60s\n- Dashboard shows offline node alert within 30s of disconnection\n- Reconnection notification appears in dashboard within 30s of node reconnecting\n- Captive portal DNS server responds correctly to all DNS queries with 192.168.4.1\n- Tests pass","status":"closed","priority":2,"issue_type":"task","created_at":"2026-03-28T01:38:15.579673840Z","created_by":"coding","updated_at":"2026-03-28T05:36:39.291892350Z","closed_at":"2026-03-28T05:36:39.291803146Z","close_reason":"Implemented: firmware/main/wifi.c (fb69190, 89 lines added) — captive portal AP mode (spaxel-XXXX SSID), esp_http_server config page at 192.168.4.1, DNS hijacking to trigger OS captive portal popup, NVS credential update on form submission","source_repo":".","compaction_level":0,"original_size":0,"dependencies":[{"issue_id":"spaxel-16e","depends_on_id":"spaxel-uc9","type":"blocks","created_at":"2026-03-28T03:29:13.901241816Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-16z3","title":"Add webhook delivery tests","description":"Write tests for webhook delivery: verifies JSON structure and base64 PNG field. Acceptance Criteria: Webhook delivery tests pass.","status":"closed","priority":2,"issue_type":"task","assignee":"bravo","created_at":"2026-04-11T08:15:08.130589490Z","created_by":"coding","updated_at":"2026-04-11T09:07:17.379388848Z","closed_at":"2026-04-11T09:07:17.379333570Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:1","mitosis-child","mitosis-depth:1","parent-spaxel-40tl"]} {"id":"spaxel-17u","title":"Phase 9: UX Polish & Accessibility","description":"Goal: Accessible to every household member. Power user efficiency.\n\nDeliverables:\n- Simple mode (card-based mobile-first UI, room occupancy cards, activity feed)\n- Ambient dashboard mode (/ambient for wall tablets, simplified top-down, auto-dim)\n- Spatial quick actions (right-click context menus on 3D elements, follow camera)\n- Command palette (Ctrl+K universal search/command, fuzzy matching)\n- Morning briefing (daily summary card, push notification option)\n- Guided troubleshooting (proactive contextual help, post-feedback explanations)\n- Mobile-responsive expert mode (touch orbit/pan/zoom)\n- Fleet status page (full table, bulk actions, camera fly-to)\n\nExit criteria: Non-technical user can check occupancy without training. Ambient mode runs 7+ days.","status":"closed","priority":3,"issue_type":"phase","assignee":"golf","created_at":"2026-03-27T01:55:55.188364609Z","created_by":"coding","updated_at":"2026-04-10T09:52:30.053325636Z","closed_at":"2026-04-10T09:52:30.053221884Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:2"],"dependencies":[{"issue_id":"spaxel-17u","depends_on_id":"spaxel-2tlm","type":"blocks","created_at":"2026-04-10T02:03:09.311198456Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-2x1w","type":"blocks","created_at":"2026-04-10T02:03:09.525865595Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-7b3g","type":"blocks","created_at":"2026-04-10T02:03:09.377986112Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-bsek","type":"blocks","created_at":"2026-04-10T02:03:09.442882165Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-duvd","type":"blocks","created_at":"2026-04-10T02:03:09.577884728Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-eelr","type":"blocks","created_at":"2026-04-10T02:03:09.654765280Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-jxru","type":"blocks","created_at":"2026-04-10T02:03:09.755196510Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-sl2","type":"blocks","created_at":"2026-03-28T01:33:53.433780442Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-17u","depends_on_id":"spaxel-trsm","type":"blocks","created_at":"2026-04-10T02:03:09.707647462Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-19h","title":"fix: localization/spatial_weights.go unused variable linkID","description":"## Problem\n`internal/localization/spatial_weights.go:601` declares `linkID` but never uses it, causing build failure.\n\n## Fix\nFind line 601 in `mothership/internal/localization/spatial_weights.go` and either:\n- Remove the `linkID` variable assignment, or\n- Use the value (pass it somewhere meaningful), or\n- Replace with blank identifier: `linkID` → `_`\n\n## Verify\n```bash\ncd /home/coding/spaxel/mothership && PATH=$PATH:/home/coding/go/bin go build ./internal/localization/\n```\nMust compile with no errors.","status":"closed","priority":1,"issue_type":"task","assignee":"bravo","created_at":"2026-04-06T22:29:51.085342479Z","created_by":"coding","updated_at":"2026-04-06T22:35:21.502259769Z","closed_at":"2026-04-06T22:35:21.502022402Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0} {"id":"spaxel-1l2j","title":"Implement GET /api/events/{id} detail endpoint","description":"Implement GET /api/events/{id} for single event detail. Acceptance Criteria: Returns 404 for non-existent event IDs; Returns full event details for valid IDs.","status":"closed","priority":2,"issue_type":"task","assignee":"hotel","created_at":"2026-04-09T18:14:45.476239078Z","created_by":"coding","updated_at":"2026-04-09T19:09:34.130476972Z","closed_at":"2026-04-09T19:09:34.130355809Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["mitosis-child","mitosis-depth:1","parent-spaxel-yeh"]} {"id":"spaxel-1xt","title":"events: REST API GET /api/events with FTS5 search and cursor pagination","description":"## Overview\nImplement the HTTP handler for the events REST API (part 3 of spaxel-2ap split).\n\n## Endpoint\n`GET /api/events`\n\nQuery params:\n- `limit` (default 50, max 500)\n- `before` (cursor: timestamp_ms as string — keyset pagination, NOT OFFSET)\n- `after` (ISO8601 datetime)\n- `type` (filter by event type)\n- `zone` (filter by zone name)\n- `person` (filter by person label)\n- `q` (FTS5 query — prefix matching, e.g. `q=motion*`)\n\nResponse:\n```json\n{\"events\": [...], \"cursor\": \"1744000000000\", \"has_more\": true, \"total_filtered\": 42}\n```\n\n## Implementation\n- Register at `/api/events` in the existing chi router (requires spaxel-6ha is wired, but can be added independently)\n- FTS5 query via: `SELECT e.* FROM fts_events ft JOIN events e ON e.id = ft.rowid WHERE fts_events MATCH ? ORDER BY e.timestamp_ms DESC LIMIT ?`\n- Keyset: add `AND timestamp_ms < ?` when `before` cursor is provided\n- total_filtered: COUNT from same query without LIMIT\n\n## Verify\n```bash\ncd /home/coding/spaxel/mothership && PATH=$PATH:/home/coding/go/bin go build ./...\n# Run mothership and curl:\n# curl 'http://localhost:8080/api/events?limit=10&q=detection*'\n```\n\nRequires: spaxel-4u6 (schema must exist first)","status":"closed","priority":2,"issue_type":"task","assignee":"echo","created_at":"2026-04-06T22:31:17.453879797Z","created_by":"coding","updated_at":"2026-04-07T17:27:48.091794931Z","closed_at":"2026-04-07T17:27:48.091693315Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred"],"dependencies":[{"issue_id":"spaxel-1xt","depends_on_id":"spaxel-4u6","type":"blocks","created_at":"2026-04-06T22:31:24.454688305Z","created_by":"coding","metadata":"{}","thread_id":""}]} +{"id":"spaxel-1ydd","title":"Fix viz3d.js duplicate _renderer declaration","description":"## Problem\n\n`js/viz3d.js` declares `_renderer` twice:\n\n- Line 13: `let _scene, _camera, _controls, _clock, _renderer;`\n- Line 30: `let _renderer = null;`\n\nThis throws `SyntaxError: Identifier '_renderer' has already been declared` when the dashboard loads, killing the entire Viz3D IIFE. The cascade failure is what causes the home page's overlapping-panels visual chaos (Playwright review 2026-04-24).\n\n## Fix\n\nDelete line 30 of `js/viz3d.js`. Initialize `_renderer` in the existing declaration on line 13, or leave the declaration and assign later — whichever is consistent with how other private module state is handled in that file.\n\n## Verification\n\n1. Load the dashboard home page; open DevTools console.\n2. Confirm no `SyntaxError: Identifier '_renderer' has already been declared`.\n3. Confirm `Viz3D` global is defined (`typeof Viz3D === 'object'`).\n4. Run existing unit tests: `cd dashboard && npm test` (Jest suite covers viz3d).\n\n## Why this first\n\nThis is the single highest-leverage fix in the UI remediation queue — it unblocks several other visible defects listed in plan.md §8f.","status":"closed","priority":0,"issue_type":"bug","assignee":"charlie","created_at":"2026-04-24T11:13:01.111983612Z","created_by":"coding","updated_at":"2026-04-24T11:46:55.326179839Z","closed_at":"2026-04-24T11:46:55.326103741Z","close_reason":"Fixed duplicate _renderer declaration in dashboard/js/viz3d.js. Removed second 'let _renderer = null' on line 30 that conflicted with line 13. Commit c552ccd. Go tests pass, go vet clean.","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:9"]} {"id":"spaxel-21n","title":"Implement Zones and Portals REST endpoints","description":"Implement CRUD endpoints for zones: GET/POST /api/zones, PUT/DELETE /api/zones/{id}. Implement CRUD for portals: GET/POST /api/portals, PUT/DELETE /api/portals/{id}. Changes must reflect in live 3D view within one WebSocket cycle. Include OpenAPI-style godoc comments.","status":"closed","priority":2,"issue_type":"task","assignee":"echo","created_at":"2026-04-06T15:31:10.270709535Z","created_by":"coding","updated_at":"2026-04-07T19:21:31.773484992Z","closed_at":"2026-04-07T19:21:31.773069063Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:1","mitosis-child","mitosis-depth:1","parent-spaxel-6ha"],"dependencies":[{"issue_id":"spaxel-21n","depends_on_id":"spaxel-0ii","type":"blocks","created_at":"2026-04-07T13:56:27.311077260Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-21n","depends_on_id":"spaxel-fi6","type":"blocks","created_at":"2026-04-07T13:56:27.361443212Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-26o","title":"Dashboard presence indicator","description":"## Background\n\nPhase 2 signal processing (phase sanitisation, baseline, motion detection) is complete in mothership/internal/signal/. The pipeline produces per-link MotionState (IsMotion bool, DeltaRMS float64, Confidence float64) via ProcessorManager.GetAllMotionStates(). This bead surfaces that data in the browser dashboard — the first human-visible output of the detection pipeline.\n\n## What to Implement\n\n1. Server-side: Add a periodic broadcast (every 500ms) of all link motion states as a JSON WebSocket message type 'presence_update'. Message schema: {type:'presence_update', links: {linkID: {is_motion: bool, delta_rms: float, confidence: float}}}. Wire into mothership/internal/dashboard/hub.go — Hub already has a Broadcast method.\n\n2. Frontend (dashboard/js/app.js): Add a 'Presence' panel distinct from the raw amplitude bar chart. Per-link rows showing: link ID (nodeMAC:peerMAC abbreviated), coloured circle indicator (green = clear, amber = motion, red = high-confidence motion), deltaRMS value. Click a link row to select it for the amplitude time series.\n\n3. Amplitude time series: Rolling 10s buffer of deltaRMS values per link. Render as a Canvas 2D line chart below the presence panel. X-axis: time (10s window), Y-axis: deltaRMS (0..0.1 typical range). Show threshold line at 0.02 (DefaultDeltaRMSThreshold).\n\n## Key Files\n\n- mothership/internal/signal/processor.go — GetAllMotionStates(), MotionState struct\n- mothership/internal/dashboard/hub.go — Hub.Broadcast(message interface{})\n- mothership/internal/dashboard/server.go — WebSocket handler, periodic broadcast setup\n- dashboard/js/app.js — existing UI code to extend\n\n## Acceptance Criteria\n\n- presence_update messages broadcast every 500ms with all active link states\n- Dashboard shows per-link coloured motion indicator updating in real-time\n- Amplitude time series shows last 10s of deltaRMS for selected link\n- Threshold line visible at 0.02\n- All existing tests pass (cargo check equivalent: go test ./...)","status":"closed","priority":2,"issue_type":"task","assignee":"alpha","created_at":"2026-03-28T03:29:50.484956631Z","created_by":"coding","updated_at":"2026-03-28T03:56:59.340530333Z","closed_at":"2026-03-28T03:56:59.340245276Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred"]} {"id":"spaxel-288","title":"Add NTP server to provisioning payload","description":"Update mothership provisioning system:\n- Read SPAXEL_NTP_SERVER env var (default: pool.ntp.org)\n- Embed ntp_server field in provisioning payload JSON\n- Support config downstream message field ntp_server to push updated server to nodes\n\nAcceptance: NTP server is configurable via provisioning payload and can be updated via downstream config messages.","status":"closed","priority":2,"issue_type":"task","assignee":"alpha","created_at":"2026-04-07T14:37:00.339721504Z","created_by":"coding","updated_at":"2026-04-07T17:39:12.764197464Z","closed_at":"2026-04-07T17:39:12.764097159Z","close_reason":"NTP server configuration is now fully implemented:\n\n1. SPAXEL_NTP_SERVER env var read with default 'pool.ntp.org'\n2. ntp_server field embedded in provisioning payload JSON\n3. ConfigMessage supports ntp_server field for downstream updates\n4. SendNTPServerToMAC() function available to push NTP server changes to nodes\n\nThe mothership now passes the configured NTP server to nodes during provisioning and can update it at runtime via config messages.","source_repo":".","compaction_level":0,"original_size":0,"labels":["mitosis-child","mitosis-depth:1","parent-spaxel-u7y"]} @@ -26,7 +27,7 @@ {"id":"spaxel-3ps","title":"Detection feedback loop and accuracy tracking","description":"## Background\n\nEvery detection algorithm produces errors. False positives (detected presence when no one is there) are annoying and erode trust. False negatives (missed detection of a real person) are dangerous for safety applications. The feedback loop gives users a direct mechanism to correct errors and the system learns from those corrections. Showing users measurable improvement over time (\"You've provided 47 corrections. Accuracy improved 12% this week\") creates a virtuous engagement loop and transforms users into active participants in improving the system.\n\n## Feedback UI Elements\n\nEvery detection event exposed to the user should have feedback affordances. Three contexts:\n\n1. Dashboard 3D view: Each active track has a small thumbs-up/down icon that appears on hover/focus. Clicking thumbs-down opens a quick inline form.\n\n2. Activity timeline (Phase 8): Every detection event entry has thumbs-up/thumbs-down at the end of the row. Space-efficient: 2 icon buttons.\n\n3. Push notifications: Fall and anomaly notifications include a quick-reply option (via ntfy actions or Pushover callbacks): \"False alarm — clear this.\"\n\n4. \"I was here and wasn't detected\" button: On the timeline panel, a button \"Report missed detection\" opens a form: \"When? [time picker, default: now]\", \"Where? [zone picker]\", \"Who? [person picker, optional]\". Submits as a FALSE_NEGATIVE feedback event with the user-provided position.\n\nFeedback form for thumbs-down:\n- \"What was wrong?\" (radio buttons):\n - \"No one was there (false alarm)\"\n - \"Someone was missed at this location\"\n - \"Wrong person identified\"\n - \"Wrong zone/location\"\n- Optional free-text \"Notes\" field\n- Submit / Cancel\n\n## Feedback Storage\n\nSQLite schema:\nCREATE TABLE detection_feedback (\n id TEXT PRIMARY KEY,\n event_id TEXT, -- references events table (activity timeline)\n event_type TEXT, -- \"blob_detection\", \"zone_transition\", \"fall_alert\", \"anomaly\"\n feedback_type TEXT, -- \"TRUE_POSITIVE\", \"FALSE_POSITIVE\", \"FALSE_NEGATIVE\", \"WRONG_IDENTITY\", \"WRONG_ZONE\"\n details_json TEXT, -- {\"zone_id\":\"...\", \"person_id\":\"...\", \"notes\":\"...\"}\n timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,\n applied BOOLEAN DEFAULT FALSE, -- set to TRUE after weight refinement processes it\n processed_at DATETIME\n);\n\nThe applied flag enables incremental processing: the weight learner (Phase 7 self-improving localisation) queries WHERE applied = FALSE, processes batches, and marks them TRUE.\n\n## Accuracy Metrics\n\nCompute precision/recall/F1 per link, per zone, and per person weekly. This requires knowing the true positives, false positives, and false negatives.\n\nGround truth sources:\n- User thumbs-up -> TRUE_POSITIVE for the corresponding detection event\n- User thumbs-down (false alarm) -> FALSE_POSITIVE for the detection event\n- User \"missed detection\" report -> FALSE_NEGATIVE for the reported time/zone\n\nNote: ground truth is sparse — users will not feedback every event. We use the feedback we have as a sample. Assume events without feedback are TRUE_POSITIVE for the purpose of precision estimates (conservative: this means precision is an upper bound, not exact).\n\nMetrics computed weekly:\n- precision = TP / (TP + FP) — of all detections, what fraction were correct\n- recall = TP / (TP + FN) — of all true presence events, what fraction were detected\n- F1 = 2 * precision * recall / (precision + recall)\n- Per-link metrics: which links have the most false positives (worst precision)\n- Per-zone metrics: which zones are most often missed (worst recall)\n\nStorage: detection_accuracy (week TEXT, scope_type TEXT, scope_id TEXT, precision REAL, recall REAL, f1 REAL, tp_count INT, fp_count INT, fn_count INT, computed_at DATETIME). Scope types: \"system\", \"link\", \"zone\", \"person\".\n\n## Accuracy Trend Display\n\nDashboard \"Accuracy\" panel (in expert mode):\n- Overall accuracy gauge: composite F1 score as a circular gauge (0-100%)\n- Week-over-week trend graph: sparkline of weekly F1 over the last 8 weeks\n- \"You've provided N corrections. Your accuracy improved X% this week.\" — motivational counter\n- Per-zone breakdown: bar chart of precision/recall per zone (click a zone bar to jump to it in 3D view)\n- Per-link breakdown: link health vs. feedback score correlation (are high-health links also high-accuracy?)\n- Feedback count: total corrections given, open corrections (not yet processed), processed corrections\n\nThe accuracy trend display intentionally shows the improvement trajectory, not just the absolute value, to reinforce that feedback has an effect.\n\n## Feedback Application\n\nProcessing happens in a background goroutine (mothership/internal/learning/feedback_processor.go) that runs every 6 hours or when triggered manually.\n\nFor FALSE_POSITIVE events with associated CSI data (in the recording buffer from Phase 2):\n- Retrieve the CSI data from the recording buffer at the event timestamp for all links\n- Add the CSI frame data to a \"known false positive\" set in SQLite: false_positive_frames (link_id, timestamp, delta_rms, context_json)\n- The weight learner (self-improving localisation bead) uses this set as negative examples\n\nFor FALSE_NEGATIVE events with user-reported position:\n- Add to \"known false negative\" set: false_negative_frames (link_id, timestamp, expected_position_xyz, context_json)\n- The weight learner uses this as a positive example at the specified position\n\nAfter processing, mark feedback.applied = TRUE.\n\n## Files to Create or Modify\n\n- mothership/internal/learning/feedback_processor.go: feedback processing pipeline\n- mothership/internal/analytics/accuracy.go: weekly metric computation\n- dashboard/js/feedback.js: thumbs-up/down UI components (reusable across 3D view and timeline)\n- dashboard/js/accuracy.js: Accuracy panel rendering\n- mothership/internal/dashboard/routes.go: POST /api/feedback, GET /api/accuracy\n\n## Tests\n\n- Test feedback storage: POST /api/feedback with each feedback_type, verify SQLite record created\n- Test accuracy metric computation with synthetic TP/FP/FN data: 8 TP, 2 FP, 1 FN -> precision=0.8, recall=0.888\n- Test weekly rollup: 7 days of daily feedback -> correctly aggregated weekly metric\n- Test that applied=false events are found and marked as applied after processor run\n- Test \"improvements\" counter: feedback_count increases on each POST /api/feedback call\n\n## Acceptance Criteria\n\n- Thumbs-up/down buttons appear on active tracks in 3D view and on all timeline events\n- \"Missed detection\" button and form available in timeline panel\n- Feedback stored in SQLite with correct feedback_type and details\n- Accuracy metrics computed weekly and stored in detection_accuracy table\n- Accuracy panel shows week-over-week trend (requires at least 2 weeks of data)\n- Feedback improvement counter shows correct counts\n- Applied flag correctly set after processor run\n- Tests pass","status":"closed","priority":3,"issue_type":"task","assignee":"sp4","created_at":"2026-03-28T01:49:50.419277632Z","created_by":"coding","updated_at":"2026-03-29T22:08:03.778130122Z","closed_at":"2026-03-29T22:08:03.778000167Z","close_reason":"Implementation complete: feedback storage (SQLite), accuracy computation (precision/recall/F1 weekly), feedback processor (6h interval), API endpoints (/api/learning/*), frontend feedback UI (thumbs up/down, missed detection form), accuracy panel (F1 gauge, sparkline, per-zone breakdown). All 12 tests pass.","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:1"],"dependencies":[{"issue_id":"spaxel-3ps","depends_on_id":"spaxel-zvs","type":"blocks","created_at":"2026-03-28T03:29:14.442377218Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-3rd","title":"Wire WebSocket integration for zone changes","description":"Ensure zone changes from CRUD endpoints reflect in live 3D view within one WebSocket cycle. Acceptance: creating/updating/deleting a zone via REST API triggers an update broadcast through the WebSocket system.","status":"closed","priority":2,"issue_type":"task","assignee":"echo","created_at":"2026-04-07T17:01:33.587080369Z","created_by":"coding","updated_at":"2026-04-07T18:42:55.455708044Z","closed_at":"2026-04-07T18:42:55.455446177Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","mitosis-child","mitosis-depth:1","parent-spaxel-0ii"]} {"id":"spaxel-403","title":"Implement anomaly detection & security mode","description":"Build pattern learning and anomaly detection for security.\n\nDeliverables:\n- 7-day pattern learning algorithm\n- Anomaly scoring against learned patterns\n- Security mode integration\n\nAcceptance: System detects deviations from learned patterns; accuracy improves measurably over 4 weeks.","status":"closed","priority":2,"issue_type":"task","assignee":"golf","created_at":"2026-03-29T19:25:04.187535979Z","created_by":"coding","updated_at":"2026-04-09T12:18:14.752621360Z","closed_at":"2026-04-09T12:18:14.752279788Z","close_reason":"Anomaly detection & security mode implementation verified complete.\n\nDeliverables implemented:\n- 7-day pattern learning algorithm with Welford's online algorithm (analytics/patterns.go)\n- Anomaly scoring against learned patterns with z-score based computation\n- Security mode integration with Armed/Disarmed/ArmedStay states\n\nAcceptance criteria met:\n- System detects deviations from learned patterns via multiple anomaly types (UnusualHour, UnknownBLE, MotionDuringAway, UnusualDwell)\n- Accuracy improves measurably through feedback loop integration with learning/feedback_store\n\nKey components:\n- PatternLearner: 7-day cold start, hourly pattern updates, per-slot readiness checking\n- Detector: Multiple anomaly types, configurable thresholds, alert chain with timers\n- Security API: /api/security/arm, /api/security/disarm, /api/security/status\n- Alert Handler: Dashboard → webhook → escalation notification chain\n- Integration: Fully wired in main.go with zones, BLE registry, dashboard, and feedback store","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:922","mitosis-child","mitosis-depth:1","parent-spaxel-i28"]} -{"id":"spaxel-40tl","title":"Write comprehensive tests for notification system","description":"Add test files for all notification components. Tests must cover: floor-plan renderer produces 300x300 PNG with correct dimensions, zone boundaries appear at correct pixel coordinates, batching behavior (3 LOW events in 10s -> 1 notification, 1 URGENT -> immediate), quiet hours gate (LOW at 23:00 with 22:00-07:00 quiet hours -> queued, URGENT at 23:00 -> delivered), morning digest delivery bundles queued events at quiet_hours_end, ntfy delivery with mock HTTP server verifies headers/body, webhook delivery verifies JSON structure and base64 PNG field, test-notification endpoint fires correctly.\n\nAcceptance Criteria:\n- All renderer tests pass (dimensions, coordinates, colors)\n- All batching tests pass (windowing, priority bypass)\n- All quiet hours tests pass (queueing, bypass, digest)\n- All delivery client tests pass with mocks\n- Test endpoint integration test passes\n- Test coverage >= 80% for notification packages","status":"in_progress","priority":2,"issue_type":"task","assignee":"charlie","created_at":"2026-04-10T12:19:08.646045806Z","created_by":"coding","updated_at":"2026-04-11T22:45:49.974014970Z","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:8","mitosis-child","mitosis-depth:1","parent-spaxel-zpt"],"dependencies":[{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-0fm8","type":"blocks","created_at":"2026-04-11T08:15:08.008025729Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-16z3","type":"blocks","created_at":"2026-04-11T08:15:08.148112051Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-28j7","type":"blocks","created_at":"2026-04-11T08:15:07.907058347Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-35lb","type":"blocks","created_at":"2026-04-11T08:15:08.208324942Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-4frg","type":"blocks","created_at":"2026-04-11T08:15:08.056467899Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-k0rs","type":"blocks","created_at":"2026-04-11T08:15:07.972516975Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-wekq","type":"blocks","created_at":"2026-04-11T08:15:08.101758877Z","created_by":"coding","metadata":"{}","thread_id":""}]} +{"id":"spaxel-40tl","title":"Write comprehensive tests for notification system","description":"Add test files for all notification components. Tests must cover: floor-plan renderer produces 300x300 PNG with correct dimensions, zone boundaries appear at correct pixel coordinates, batching behavior (3 LOW events in 10s -> 1 notification, 1 URGENT -> immediate), quiet hours gate (LOW at 23:00 with 22:00-07:00 quiet hours -> queued, URGENT at 23:00 -> delivered), morning digest delivery bundles queued events at quiet_hours_end, ntfy delivery with mock HTTP server verifies headers/body, webhook delivery verifies JSON structure and base64 PNG field, test-notification endpoint fires correctly.\n\nAcceptance Criteria:\n- All renderer tests pass (dimensions, coordinates, colors)\n- All batching tests pass (windowing, priority bypass)\n- All quiet hours tests pass (queueing, bypass, digest)\n- All delivery client tests pass with mocks\n- Test endpoint integration test passes\n- Test coverage >= 80% for notification packages","status":"open","priority":2,"issue_type":"task","created_at":"2026-04-10T12:19:08.646045806Z","created_by":"coding","updated_at":"2026-04-25T06:13:06.116496929Z","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:8","mitosis-child","mitosis-depth:1","parent-spaxel-zpt"],"dependencies":[{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-0fm8","type":"blocks","created_at":"2026-04-11T08:15:08.008025729Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-16z3","type":"blocks","created_at":"2026-04-11T08:15:08.148112051Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-28j7","type":"blocks","created_at":"2026-04-11T08:15:07.907058347Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-35lb","type":"blocks","created_at":"2026-04-11T08:15:08.208324942Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-4frg","type":"blocks","created_at":"2026-04-11T08:15:08.056467899Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-k0rs","type":"blocks","created_at":"2026-04-11T08:15:07.972516975Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-40tl","depends_on_id":"spaxel-wekq","type":"blocks","created_at":"2026-04-11T08:15:08.101758877Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-4fg","title":"Implement Replay/Time-Travel REST endpoints","description":"Implement GET /api/replay/sessions to list recording sessions. Add POST endpoints: /api/replay/start to start replay at timestamp, /api/replay/stop to return to live, /api/replay/seek to seek within session, /api/replay/tune to update pipeline parameters mid-replay. Include OpenAPI-style godoc comments.","status":"closed","priority":2,"issue_type":"task","assignee":"alpha","created_at":"2026-04-06T15:31:10.497876498Z","created_by":"coding","updated_at":"2026-04-07T13:20:09.903154198Z","closed_at":"2026-04-07T13:20:09.902983511Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["mitosis-child","mitosis-depth:1","parent-spaxel-6ha"]} {"id":"spaxel-4frg","title":"Add morning digest tests","description":"Write tests for morning digest delivery: bundles queued events at quiet_hours_end. Acceptance Criteria: Morning digest tests pass.","status":"closed","priority":2,"issue_type":"task","assignee":"alpha","created_at":"2026-04-11T08:15:08.033947792Z","created_by":"coding","updated_at":"2026-04-11T09:24:34.821263381Z","closed_at":"2026-04-11T09:24:34.821202594Z","close_reason":"Morning digest tests implemented and passing. All 8 morning digest tests pass covering queuing at quiet_hours_end, disabled behavior, once-per-day, empty handling, event inclusion, queue clearing, mixed priorities, and title format. Acceptance criteria met.","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:3","mitosis-child","mitosis-depth:1","parent-spaxel-40tl"]} {"id":"spaxel-4u6","title":"events: SQLite schema, FTS5 table, indexes, and 90-day archive job","description":"## Overview\nCreate the SQLite storage layer for the unified activity timeline (part 1 of spaxel-2ap split).\n\n## Schema to create in mothership/internal/events/ (db setup or migration)\n```sql\nCREATE TABLE IF NOT EXISTS events (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n type TEXT NOT NULL,\n timestamp_ms INTEGER NOT NULL,\n zone TEXT,\n person TEXT,\n blob_id TEXT,\n detail_json TEXT,\n severity TEXT\n);\n\nCREATE VIRTUAL TABLE IF NOT EXISTS fts_events USING fts5(\n type, zone, person, detail_json,\n content='events', content_rowid='id'\n);\n\nCREATE INDEX IF NOT EXISTS idx_events_ts ON events(timestamp_ms DESC);\nCREATE INDEX IF NOT EXISTS idx_events_type ON events(type);\nCREATE INDEX IF NOT EXISTS idx_events_zone ON events(zone);\nCREATE INDEX IF NOT EXISTS idx_events_person ON events(person);\n\nCREATE TABLE IF NOT EXISTS events_archive (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n type TEXT NOT NULL,\n timestamp_ms INTEGER NOT NULL,\n zone TEXT, person TEXT, blob_id TEXT, detail_json TEXT, severity TEXT\n);\n```\n\n## Archive job\n- In `events` package, add `RunArchiveJob(db *sql.DB)` that runs nightly at 02:00 local time\n- Migrates rows from `events` where `timestamp_ms < now - 90 days` into `events_archive`\n- Deletes moved rows from `events`\n\n## Go types\n```go\ntype Event struct {\n ID int64\n Type string\n TimestampMs int64\n Zone string\n Person string\n BlobID string\n DetailJSON string\n Severity string\n}\n\nfunc InsertEvent(db *sql.DB, e Event) error\nfunc QueryEvents(db *sql.DB, params QueryParams) ([]Event, string, bool, error)\n```\n\n## Verify\n```bash\ncd /home/coding/spaxel/mothership && PATH=$PATH:/home/coding/go/bin go build ./internal/events/\n```","status":"closed","priority":2,"issue_type":"task","assignee":"charlie","created_at":"2026-04-06T22:30:57.090344045Z","created_by":"coding","updated_at":"2026-04-07T16:45:36.428356135Z","closed_at":"2026-04-07T16:45:36.428249897Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:2"]} @@ -38,7 +39,7 @@ {"id":"spaxel-5lo","title":"Implement Zones CRUD REST endpoints with OpenAPI docs","description":"Implement CRUD endpoints for zones: GET/POST /api/zones, PUT/DELETE /api/zones/{id}. Include OpenAPI-style godoc comments. Acceptance: endpoints respond correctly to HTTP requests, godoc annotations present.","status":"closed","priority":2,"issue_type":"task","assignee":"charlie","created_at":"2026-04-07T17:01:33.493352900Z","created_by":"coding","updated_at":"2026-04-07T18:13:38.639619498Z","closed_at":"2026-04-07T18:13:38.639505434Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:1","mitosis-child","mitosis-depth:1","parent-spaxel-0ii"]} {"id":"spaxel-5yq","title":"load-shedding: health endpoint + dashboard WS alert integration","description":"## Task\nExpose the load shedding level in the health endpoint and send a dashboard WS alert when Level 3 is triggered. Requires spaxel-54i to be complete (GetShedLevel() must exist).\n\n## 1. Health endpoint (mothership/cmd/mothership/main.go)\nFind the `/healthz` handler (around line 218). Change the JSON to include `shedding_level`:\n```go\nfmt.Fprintf(w, `{\"status\":\"ok\",\"version\":\"%s\",\"shedding_level\":%d}`, version, pm.GetShedLevel())\n```\n\n## 2. Dashboard WS alert on Level 3\nIn the fusion loop in main.go (the goroutine that calls `pm.Process()`), track the previous shed level and broadcast an alert when it changes to 3 or recovers:\n```go\n// after pm.Process() call:\nnewLevel := pm.GetShedLevel()\nif newLevel != prevShedLevel {\n if newLevel == 3 {\n msg := map[string]interface{}{\n \"type\": \"alert\",\n \"severity\": \"warning\",\n \"description\": \"System under load — CSI rate reduced to 10 Hz\",\n }\n data, _ := json.Marshal(msg)\n dashboardHub.Broadcast(data)\n }\n prevShedLevel = newLevel\n log.Printf(\"[INFO] Load shedding level changed: %d\", newLevel)\n}\n```\nDeclare `prevShedLevel int` before the fusion goroutine.\n\n## 3. Level 3 rate reduction push (best effort — log only if push mechanism not yet available)\nWhen `newLevel == 3`, log: `log.Printf(\"[INFO] Load shed level 3 — would push 10Hz cap to nodes\")`\nWhen `newLevel` recovers from 3, log: `log.Printf(\"[INFO] Load shed recovered — restoring prior node rate\")`\n\n## Verify\n```bash\ncd /home/coding/spaxel/mothership && PATH=$PATH:/home/coding/go/bin go build ./...\n# curl http://localhost:8080/healthz should include shedding_level\n```\n\nRequires: spaxel-54i","status":"closed","priority":2,"issue_type":"task","assignee":"charlie","created_at":"2026-04-07T06:33:19.278442007Z","created_by":"coding","updated_at":"2026-04-07T17:56:41.358181685Z","closed_at":"2026-04-07T17:56:41.358116981Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:4"],"dependencies":[{"issue_id":"spaxel-5yq","depends_on_id":"spaxel-54i","type":"blocks","created_at":"2026-04-07T06:33:23.206754212Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-65k","title":"Dashboard: activity timeline view","description":"## Overview\n\nBuild the unified activity timeline — the primary event history UI, accessible via the #timeline route added in the dashboard framework bead.\n\n## What to build (dashboard/js/timeline.js + timeline.css)\n\n### Timeline sidebar\n- Scrollable chronological event list (newest at top)\n- Event types with distinct icons/colors:\n - Zone entry/exit (green/orange)\n - Portal crossing (blue arrow)\n - Anomaly / security alert (red pulse)\n - Learning milestone (purple star)\n - System event (grey gear)\n- Each event shows: timestamp, description, person name (if identified), zone name\n- Click event → jump to that moment in the 3D view (triggers replay seek to that timestamp)\n\n### Filter bar\n- Filter by: person, zone, event type, time range (today / last 7d / custom)\n- Search box with debounced text filter across event descriptions\n\n### Inline feedback\n- Thumbs up / thumbs down on presence detection events\n- POST /api/feedback with event_id and correct (bool)\n- System response toast: 'Thanks — threshold adjusted for kitchen link'\n\n### Data source\n- Initial load: GET /api/events?limit=200&since=24h\n- Live updates: 'event' messages from WebSocket feed (requires spaxel-9eg)\n\n## Acceptance\n\n- 200 events render within 200ms of page load\n- New events prepend without layout shift\n- Clicking an event in replay mode seeks the replay to ±5s around the event\n- Feedback buttons POST successfully and show toast confirmation","status":"closed","priority":2,"issue_type":"task","assignee":"alpha","created_at":"2026-04-06T12:56:03.195915329Z","created_by":"coding","updated_at":"2026-04-06T16:01:48.118589901Z","closed_at":"2026-04-06T16:01:48.118470381Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:1"]} -{"id":"spaxel-6ha","title":"Complete REST API: settings, zones, portals, triggers, notifications, replay","description":"## Problem\n\nMany HTTP endpoints are stubbed or missing. The dashboard settings panel, automation builder, and replay UI all require working REST endpoints.\n\n## Endpoints to implement in mothership/\n\n### Settings\n- GET /api/settings — return all configurable settings as JSON\n- POST /api/settings — update settings (partial update, merge semantics)\n\n### Zones & Portals\n- GET /api/zones — list all zones\n- POST /api/zones — create zone\n- PUT /api/zones/{id} — update zone geometry/name\n- DELETE /api/zones/{id} — delete zone\n- GET /api/portals — list all portals\n- POST /api/portals — create portal\n- PUT /api/portals/{id} — update\n- DELETE /api/portals/{id} — delete\n\n### Automation Triggers\n- GET /api/triggers — list all triggers\n- POST /api/triggers — create trigger\n- PUT /api/triggers/{id} — update\n- DELETE /api/triggers/{id} — delete\n- POST /api/triggers/{id}/test — fire trigger once for testing\n\n### Notifications\n- GET /api/notifications/config — get delivery channel config\n- POST /api/notifications/config — set Ntfy/Pushover/webhook settings\n- POST /api/notifications/test — send a test notification\n\n### Replay / Time-Travel\n- GET /api/replay/sessions — list available recording sessions\n- POST /api/replay/start — start replay at given timestamp\n- POST /api/replay/stop — stop replay, return to live\n- POST /api/replay/seek — seek to timestamp within session\n- POST /api/replay/tune — update pipeline parameters mid-replay\n\n### BLE Devices\n- GET /api/ble/devices — list known devices\n- PUT /api/ble/devices/{mac} — set label, assign to person\n\n## Acceptance\n\n- All endpoints return JSON with appropriate status codes\n- Settings endpoint persists to SQLite across restarts\n- Zone/portal CRUD reflected in the live 3D view within one WebSocket cycle\n- OpenAPI-style godoc comment on each handler with method, path, request, response","status":"in_progress","priority":2,"issue_type":"task","assignee":"foxtrot","created_at":"2026-04-06T12:55:51.683246046Z","created_by":"coding","updated_at":"2026-04-07T20:33:14.451043337Z","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:7"],"dependencies":[{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-21n","type":"blocks","created_at":"2026-04-06T15:31:10.298537585Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-4fg","type":"blocks","created_at":"2026-04-06T15:31:10.528996520Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-kxf","type":"blocks","created_at":"2026-04-06T15:31:10.466981102Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-mul","type":"blocks","created_at":"2026-04-06T15:31:10.407580303Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-p5p","type":"blocks","created_at":"2026-04-06T15:31:10.594070369Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-ubu","type":"blocks","created_at":"2026-04-06T15:31:10.240906965Z","created_by":"coding","metadata":"{}","thread_id":""}]} +{"id":"spaxel-6ha","title":"Complete REST API: settings, zones, portals, triggers, notifications, replay","description":"## Problem\n\nMany HTTP endpoints are stubbed or missing. The dashboard settings panel, automation builder, and replay UI all require working REST endpoints.\n\n## Endpoints to implement in mothership/\n\n### Settings\n- GET /api/settings — return all configurable settings as JSON\n- POST /api/settings — update settings (partial update, merge semantics)\n\n### Zones & Portals\n- GET /api/zones — list all zones\n- POST /api/zones — create zone\n- PUT /api/zones/{id} — update zone geometry/name\n- DELETE /api/zones/{id} — delete zone\n- GET /api/portals — list all portals\n- POST /api/portals — create portal\n- PUT /api/portals/{id} — update\n- DELETE /api/portals/{id} — delete\n\n### Automation Triggers\n- GET /api/triggers — list all triggers\n- POST /api/triggers — create trigger\n- PUT /api/triggers/{id} — update\n- DELETE /api/triggers/{id} — delete\n- POST /api/triggers/{id}/test — fire trigger once for testing\n\n### Notifications\n- GET /api/notifications/config — get delivery channel config\n- POST /api/notifications/config — set Ntfy/Pushover/webhook settings\n- POST /api/notifications/test — send a test notification\n\n### Replay / Time-Travel\n- GET /api/replay/sessions — list available recording sessions\n- POST /api/replay/start — start replay at given timestamp\n- POST /api/replay/stop — stop replay, return to live\n- POST /api/replay/seek — seek to timestamp within session\n- POST /api/replay/tune — update pipeline parameters mid-replay\n\n### BLE Devices\n- GET /api/ble/devices — list known devices\n- PUT /api/ble/devices/{mac} — set label, assign to person\n\n## Acceptance\n\n- All endpoints return JSON with appropriate status codes\n- Settings endpoint persists to SQLite across restarts\n- Zone/portal CRUD reflected in the live 3D view within one WebSocket cycle\n- OpenAPI-style godoc comment on each handler with method, path, request, response","status":"in_progress","priority":2,"issue_type":"task","assignee":"sierra","created_at":"2026-04-06T12:55:51.683246046Z","created_by":"coding","updated_at":"2026-04-25T13:15:17.637496117Z","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:9"],"dependencies":[{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-21n","type":"blocks","created_at":"2026-04-06T15:31:10.298537585Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-4fg","type":"blocks","created_at":"2026-04-06T15:31:10.528996520Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-kxf","type":"blocks","created_at":"2026-04-06T15:31:10.466981102Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-mul","type":"blocks","created_at":"2026-04-06T15:31:10.407580303Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-p5p","type":"blocks","created_at":"2026-04-06T15:31:10.594070369Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6ha","depends_on_id":"spaxel-ubu","type":"blocks","created_at":"2026-04-06T15:31:10.240906965Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-6hd","title":"Floor plan image upload and pixel-to-meter calibration","description":"## Overview\nAllow users to upload a floor plan image (PNG/JPG) and calibrate it to real-world coordinates so the 3D scene displays nodes and blobs at accurate physical positions.\n\n## Backend (mothership/internal/ — new floorplan.go)\n- POST /api/floorplan/image — multipart form; accept PNG/JPG max 10 MB; save to /data/floorplan/image.png\n- GET /api/floorplan/image — serve the stored image (200 or 404 if none)\n- POST /api/floorplan/calibrate — accept {ax,ay,bx,by,distance_m,rotation_deg}: two pixel coordinates and their real-world distance; compute and persist pixel-to-meter transform\n- GET /api/floorplan/calibrate — return current calibration or 404 if none\n- SQLite floorplan table: image_path TEXT, cal_ax,cal_ay,cal_bx,cal_by REAL, distance_m REAL, rotation_deg REAL, updated_at INT\n\n## Dashboard (dashboard/js/floorplan-setup.js)\n- Setup panel section: 'Floor Plan' with upload button\n- On image select: POST to /api/floorplan/image; display uploaded image on ground plane in 3D scene\n- Calibration UI: click point A on image → click point B → enter real-world distance in meters → Save\n- Compute pixel-to-meter scale factor: scale = distance_m / pixel_distance(A,B)\n- Apply scale and rotation to Three.js ground plane texture on load\n\n## Acceptance\n- Uploaded image displayed as ground plane texture in 3D view\n- Calibrated coordinate system maps pixel positions to correct meter positions\n- Image persists across server restart\n- > 10 MB upload rejected with 413 error","status":"closed","priority":2,"issue_type":"task","assignee":"golf","created_at":"2026-04-06T16:42:49.829463356Z","created_by":"coding","updated_at":"2026-04-09T12:45:23.190650793Z","closed_at":"2026-04-09T12:45:23.190526084Z","close_reason":"Implementation complete. All acceptance criteria met:\n- Backend API with image upload (max 10 MB) and calibration endpoints\n- Dashboard UI with two-point calibration and pixel-to-meter scale computation\n- Viz3D integration with texture transformation for accurate positioning\n- SQLite persistence for image metadata and calibration data\n- Image file storage at /data/floorplan/image.png\n\nBoth dependent beads (spaxel-dbd dashboard UI, spaxel-klk backend API) were already CLOSED.","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:1"],"dependencies":[{"issue_id":"spaxel-6hd","depends_on_id":"spaxel-dbd","type":"blocks","created_at":"2026-04-07T14:46:37.377627731Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-6hd","depends_on_id":"spaxel-klk","type":"blocks","created_at":"2026-04-07T14:46:37.307745453Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-6n9","title":"events: internal pub/sub event bus (decouple packages from dashboard)","description":"## Overview\nCreate a lightweight Go pub/sub event bus so any internal package can emit events without importing the dashboard package directly (part 2 of spaxel-2ap split).\n\n## Implementation in mothership/internal/eventbus/ (package already exists — extend it)\n\n```go\n// bus.go\npackage eventbus\n\ntype Event struct {\n Type string\n TimestampMs int64\n Zone string\n Person string\n BlobID string\n DetailJSON interface{}\n Severity string\n}\n\ntype Handler func(Event)\n\nvar (\n mu sync.RWMutex\n handlers []Handler\n)\n\nfunc Subscribe(h Handler)\nfunc Publish(e Event)\n```\n\n- `Publish` calls all subscribers in separate goroutines (non-blocking)\n- `Subscribe` is safe to call at any time, including after startup\n- Event types to define as constants: detection, zone_entry, zone_exit, portal_crossing, trigger_fired, fall_alert, anomaly, security_alert, node_online, node_offline, ota_update, baseline_changed, system, learning_milestone\n\n## Integration\n- Have the events package's `InsertEvent` also call `eventbus.Publish`\n- Dashboard WS handler subscribes to the bus to forward events to connected clients (wired in spaxel-9eg)\n\n## Verify\n```bash\ncd /home/coding/spaxel/mothership && PATH=$PATH:/home/coding/go/bin go build ./internal/eventbus/\nPATH=$PATH:/home/coding/go/bin go test ./internal/eventbus/\n```","status":"closed","priority":2,"issue_type":"task","assignee":"charlie","created_at":"2026-04-06T22:31:07.051525693Z","created_by":"coding","updated_at":"2026-04-07T16:52:34.549568384Z","closed_at":"2026-04-07T16:52:34.549293102Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0} {"id":"spaxel-6th","title":"Multi-link CSI fusion and localization","description":"## Background\n\nSingle-link motion detection (Phase 2) shows presence on a link axis. With 4+ links we can localise people to ±0.5–1.0m using Fresnel zone weighted localization. This is the core spatial intelligence of spaxel. The physics: WiFi CSI is most sensitive to motion within the first Fresnel zone (an ellipsoid between TX and RX). The approach: for each occupancy grid voxel, compute its weight for each link based on Fresnel zone intersection, multiply by that link's deltaRMS, sum contributions, extract blob peaks.\n\n## What to Implement\n\nNew package: mothership/internal/fusion/\n\n### OccupancyGrid\n- mothership/internal/fusion/grid.go\n- 3D float32 grid, configurable resolution (default 0.25m)\n- Dimensions from room config (width, depth, height in meters)\n- Methods: Reset(), Set(x,y,z int, val float32), Get(x,y,z int) float32, Dims() (nx,ny,nz int)\n\n### Fresnel zone geometry\n- mothership/internal/fusion/fresnel.go\n- FresnelWeight(voxelPos, txPos, rxPos vec3, wavelength float64) float64\n- For 5GHz WiFi: wavelength = 0.06m\n- A voxel is in the first Fresnel zone if: d1+d2 <= dist(tx,rx) + wavelength/2\n where d1 = dist(voxel, tx), d2 = dist(voxel, rx)\n- Weight = deltaRMS × exp(-excess_path_length² / (2×0.1²))\n where excess_path_length = (d1+d2) - dist(tx,rx)\n- Weight = 0 outside Fresnel zone\n\n### FusionEngine\n- mothership/internal/fusion/engine.go\n- Inputs: ProcessorManager (from signal package), NodeRegistry (from fleet/session)\n- Runs at 10Hz via time.Ticker\n- Each tick: reset grid, for each active link get deltaRMS from ProcessorManager, for each voxel compute FresnelWeight × deltaRMS, accumulate to grid\n- Output: call BlobExtractor.Extract(grid), broadcast via dashboard hub as 'blob_update' JSON message\n\n### BlobExtractor\n- mothership/internal/fusion/blobs.go\n- Find 3D local maxima in the grid above threshold (default 0.02)\n- Non-maximum suppression: suppress any peak within 0.5m of a higher peak\n- Output: []BlobDetection{Position vec3, Confidence float32, Radius float32}\n- Limit to max 10 blobs\n\n### Room config\n- Add to mothership config (JSON): room.width_m, room.depth_m, room.height_m (defaults: 5, 5, 2.5)\n- Node positions: initially from fleet manager, defaulting to corners if unset\n\n## Key Files\n- mothership/internal/signal/processor.go — GetAllMotionStates()\n- mothership/internal/dashboard/hub.go — Broadcast() for blob_update\n- New: mothership/internal/fusion/grid.go, fresnel.go, engine.go, blobs.go + tests\n\n## Acceptance Criteria\n- FusionEngine produces blob_update WebSocket messages at 10Hz\n- Single active link produces blob peak along the TX-RX axis\n- Two crossing links produce peak near their intersection\n- BlobExtractor correctly suppresses nearby peaks\n- FresnelWeight returns 0 for voxels clearly outside the Fresnel zone\n- go test ./internal/fusion/... passes","status":"closed","priority":2,"issue_type":"task","created_at":"2026-03-28T03:30:50.362272102Z","created_by":"coding","updated_at":"2026-03-28T05:36:26.188829209Z","closed_at":"2026-03-28T05:36:26.188507646Z","close_reason":"Implemented: fusion/fusion.go + fusion/grid3d.go (9c56a37) — 3D occupancy grid 0.25m res, Fresnel zone ellipsoid weighting, FusionEngine 10Hz, BlobExtractor with NMS","source_repo":".","compaction_level":0,"original_size":0,"dependencies":[{"issue_id":"spaxel-6th","depends_on_id":"spaxel-cxm","type":"blocks","created_at":"2026-03-28T03:30:50.362272102Z","created_by":"coding","metadata":"{}","thread_id":""}]} @@ -56,19 +57,19 @@ {"id":"spaxel-8u3","title":"Fleet manager with SQLite persistence","description":"Node registry, role assignment engine, and self-healing.\n\n## Deliverables\n- New package: mothership/internal/fleet/\n- SQLite node registry (MAC, ID, role, last seen, health, position)\n- Role assignment engine (TX/RX/passive/TX-RX including passive radar virtual node)\n- Stagger scheduling for multi-node packet timing\n- Self-healing: auto role reassignment on node loss, graceful degradation warnings\n- REST API endpoints: GET /api/nodes, GET /api/nodes/:mac, POST /api/nodes/:mac/role\n\n## Acceptance Criteria\n- Node state persists across mothership restarts\n- Roles auto-reassign when a node goes offline\n- Stagger scheduling prevents packet collisions\n- Tests cover registration, role assignment, and failure recovery\n\n## References\n- Plan: docs/plan/plan.md items 14\n- SQLite: modernc.org/sqlite (pure Go, already in go.mod intent)","status":"closed","priority":2,"issue_type":"task","assignee":"spaxel-alpha","created_at":"2026-03-27T01:56:38.835804826Z","created_by":"coding","updated_at":"2026-03-28T05:36:26.132787526Z","closed_at":"2026-03-28T05:36:26.132727724Z","close_reason":"Implemented: fleet/manager.go + fleet/registry.go (fb69190) — SQLite node registry, role assignment engine, stagger scheduling, self-healing role reassignment on node loss","source_repo":".","compaction_level":0,"original_size":0,"dependencies":[{"issue_id":"spaxel-8u3","depends_on_id":"spaxel-cxm","type":"blocks","created_at":"2026-03-28T03:29:13.704767150Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-8wem","title":"Increase touch target sizes to 44x44px minimum","description":"Audit and resize all interactive elements in expert mode for WCAG 2.1 touch target compliance (44x44px minimum).\n\n**Files:** dashboard/css/expert.css\n\n**Acceptance Criteria:**\n- Layer toggle checkboxes have 44x44px touch area (padding or pseudo-element expansion)\n- Link list entries have minimum 44px height\n- Panel close buttons are 44px x 44px\n- Slider controls (baseline tau, threshold) have drag targets at least 44px tall\n- Context menu items have minimum 44px height","status":"closed","priority":2,"issue_type":"task","assignee":"alpha","created_at":"2026-04-11T06:26:50.115125378Z","created_by":"coding","updated_at":"2026-04-11T06:54:59.059288468Z","closed_at":"2026-04-11T06:54:59.058954568Z","close_reason":"Implemented WCAG 2.1 touch target compliance (44x44px minimum) for all expert mode interactive elements: Panel close buttons expanded to 44x44px, slider controls expanded to 44px height, toggle switches expanded to 44px height, checkboxes expanded with pseudo-elements, context menu items and link entries set to minimum 44px height, all buttons meet 44x44px minimum.","source_repo":".","compaction_level":0,"original_size":0,"labels":["mitosis-child","mitosis-depth:1","parent-spaxel-kth"]} {"id":"spaxel-9eg","title":"Expand dashboard WebSocket feed: events, alerts, anomalies, triggers, BLE","description":"## Problem\n\nThe dashboard WebSocket (/ws/dashboard) currently only sends blob/node/zone/link/confidence/predictions/sleep/flow state. Events, alerts, anomalies, triggers, and BLE device data are never pushed to the dashboard, making Phase 6-9 UI impossible without a polling API.\n\n## What to add to the WS feed\n\nIn mothership/internal/dashboard/ (hub.go or server.go):\n\n### New message types to broadcast:\n\n**event** — presence transitions, zone entries/exits, portal crossings\n { type: 'event', event: { id, ts, kind, zone, blob_id, person_name } }\n\n**alert** — anomaly detections, security mode triggers\n { type: 'alert', alert: { id, ts, severity, description, acknowledged } }\n\n**ble_scan** — BLE device list updates (5s interval)\n { type: 'ble_scan', devices: [{ mac, name, rssi, last_seen, label, blob_id }] }\n\n**trigger_state** — automation trigger state changes\n { type: 'trigger_state', trigger: { id, name, last_fired, enabled } }\n\n**system_health** — periodic system stats (60s interval)\n { type: 'system_health', health: { uptime_s, node_count, bead_count, go_routines, mem_mb } }\n\n### In dashboard JS (app.js):\n- Handle each new message type in the WebSocket onmessage handler\n- Update app state for each type\n- Log unhandled types to console (for future debugging)\n\n## Acceptance\n\n- All 5 new message types appear in browser devtools WebSocket inspector\n- BLE device list updates every 5s when devices are present\n- Events appear within 1s of a zone transition\n- Existing blob/node/link messages unaffected","status":"closed","priority":1,"issue_type":"task","assignee":"delta","created_at":"2026-04-06T12:55:40.859267153Z","created_by":"coding","updated_at":"2026-04-07T15:20:38.722641396Z","closed_at":"2026-04-07T15:20:38.722538891Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:1"],"dependencies":[{"issue_id":"spaxel-9eg","depends_on_id":"spaxel-28k","type":"blocks","created_at":"2026-04-06T14:18:27.421346709Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-9eg","depends_on_id":"spaxel-2ea","type":"blocks","created_at":"2026-04-06T14:18:27.498282335Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-9eg","depends_on_id":"spaxel-fyi","type":"blocks","created_at":"2026-04-06T14:18:27.643320410Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-9eg","depends_on_id":"spaxel-hf8","type":"blocks","created_at":"2026-04-06T14:18:27.581630865Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-9eg","depends_on_id":"spaxel-ncw","type":"blocks","created_at":"2026-04-06T14:18:27.696083142Z","created_by":"coding","metadata":"{}","thread_id":""}]} -{"id":"spaxel-9mkk","title":"Fix Three.js OrbitControls touch event handling","description":"Fix touch event propagation from panels to canvas, resolve iOS Safari passive event listener warnings, prevent double-tap zoom conflicts, improve pinch gesture accuracy, and enable three-finger pan.\n\n**Files:** dashboard/js/controls.js, dashboard/css/expert.css\n\n**Acceptance Criteria:**\n- Touch events on sidebar panels do not propagate to the canvas (event.stopPropagation() on panel touch listeners)\n- No iOS Safari passive event listener warnings (touch-action: none on canvas or non-passive listener override)\n- Double-tap to zoom is disabled (user-scalable=no in meta viewport)\n- Pinch gesture is accurate on actual devices (zoomSpeed may be adjusted for touch)\n- Three-finger pan is enabled in OrbitControls","status":"open","priority":2,"issue_type":"task","created_at":"2026-04-11T06:26:49.932473223Z","created_by":"coding","updated_at":"2026-04-11T06:42:47.025394549Z","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:2","mitosis-child","mitosis-depth:1","parent-spaxel-kth"],"dependencies":[{"issue_id":"spaxel-9mkk","depends_on_id":"spaxel-m80q","type":"blocks","created_at":"2026-04-11T06:34:56.711149924Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-9mkk","depends_on_id":"spaxel-mlxq","type":"blocks","created_at":"2026-04-11T06:34:56.751639064Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-9mkk","depends_on_id":"spaxel-yvwf","type":"blocks","created_at":"2026-04-11T06:34:56.656196392Z","created_by":"coding","metadata":"{}","thread_id":""}]} +{"id":"spaxel-9mkk","title":"Fix Three.js OrbitControls touch event handling","description":"Fix touch event propagation from panels to canvas, resolve iOS Safari passive event listener warnings, prevent double-tap zoom conflicts, improve pinch gesture accuracy, and enable three-finger pan.\n\n**Files:** dashboard/js/controls.js, dashboard/css/expert.css\n\n**Acceptance Criteria:**\n- Touch events on sidebar panels do not propagate to the canvas (event.stopPropagation() on panel touch listeners)\n- No iOS Safari passive event listener warnings (touch-action: none on canvas or non-passive listener override)\n- Double-tap to zoom is disabled (user-scalable=no in meta viewport)\n- Pinch gesture is accurate on actual devices (zoomSpeed may be adjusted for touch)\n- Three-finger pan is enabled in OrbitControls","status":"open","priority":2,"issue_type":"task","created_at":"2026-04-11T06:26:49.932473223Z","created_by":"coding","updated_at":"2026-04-11T06:42:47.025394549Z","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:2","mitosis-child","mitosis-depth:1","parent-spaxel-kth"],"dependencies":[{"issue_id":"spaxel-9mkk","depends_on_id":"spaxel-yvwf","type":"blocks","created_at":"2026-04-11T06:34:56.656196392Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-9nj","title":"fix: falldetect unused imports and vars cause build failure","description":"## Problem\n`internal/falldetect/detector.go` fails to compile:\n- Line 9: `\"math\"` imported and not used\n- Line 360: `startZ` declared and not used\n- Line 360: `endZ` declared and not used\n\n## Fix\n1. Remove `\"math\"` from the import block in `detector.go`\n2. Remove or use the `startZ` and `endZ` variables (prefix with `_` if needed, or delete)\n\n## Verify\n```bash\ncd /home/coding/spaxel/mothership && PATH=$PATH:/home/coding/go/bin go build ./internal/falldetect/\n```\nMust compile with no errors.","status":"closed","priority":1,"issue_type":"task","assignee":"bravo","created_at":"2026-04-06T22:29:46.582450658Z","created_by":"coding","updated_at":"2026-04-06T22:46:04.704272938Z","closed_at":"2026-04-06T22:46:04.704068691Z","close_reason":"Already fixed in commit d3f4d8f — removed unused math import and startZ/endZ variables. Build verified clean.","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:2"]} {"id":"spaxel-9z3","title":"Infrastructure: database schema migration engine","description":"## Overview\nImplement a versioned schema migration framework so the mothership can safely upgrade its SQLite schema across releases without data loss.\n\n## Implementation (mothership/internal/db/ or cmd/mothership/migrate.go)\n\n- schema_migrations table: version INT PK, applied_at INT, description TEXT\n- Migration registry: slice of Migration structs {Version int, Description string, Up func(*sql.Tx) error}\n- Startup phase (before any other subsystem): read current schema_ver; identify pending migrations\n- Run each pending migration in its own transaction; commit on success, rollback on failure\n- On failure: log error, preserve pre-migration backup, exit non-zero\n- Startup shutdown on error: never serve traffic with a partially migrated schema\n\n## Pre-migration safety\n- Before first migration: use SQLite Online Backup API to copy DB to /data/backups/pre-upgrade-v-to-v-.sqlite\n- Create /data/backups/ if not exists\n- Backups older than 90 days: pruned daily at 02:00 local time (or on startup)\n\n## Initial migrations\n- migration_001: initial schema (nodes, links, baselines, events, zones, portals, sessions, etc.)\n- migration_002: add diurnal_baselines table\n- migration_003: add anomaly_patterns table\n- migration_004: add prediction_models table\n- migration_005: add ble_device_aliases table\n\n## Acceptance\n- 'go test ./internal/db/...' passes including migration test from v1 to current\n- Pre-migration backup created before any schema change\n- Failed migration exits cleanly; DB unchanged; backup preserved\n- Idempotent: running migrations on already-migrated DB is a no-op","status":"closed","priority":1,"issue_type":"task","assignee":"alpha","created_at":"2026-04-06T13:09:15.158103223Z","created_by":"coding","updated_at":"2026-04-06T15:10:12.224579147Z","closed_at":"2026-04-06T15:10:12.224316659Z","close_reason":"Database schema migration engine implemented with:\n\n- schema_migrations table tracking version, applied_at, description\n- Migration registry with Migration structs (Version, Description, Up func)\n- Startup phase integration via OpenDB() with 7-phase sequence\n- Transactional migration execution with commit/rollback\n- Pre-migration backup using VACUUM INTO to /data/backups/\n- Failed migration exits cleanly with backup preserved\n- Idempotent migrations (checks current version, only runs pending)\n- 90-day backup retention with automatic pruning\n- Initial migrations 001-005 for all core tables\n- Comprehensive test coverage (idempotency, rollback, v1-to-current migration)\n\nImplementation in mothership/internal/db/ (migrate.go, migrations.go, db.go, migrate_test.go)\nCommitted as 2da6e23 and deadlock fix as f9632c7","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:2"]} {"id":"spaxel-9zs","title":"Mothership: SIGTERM graceful shutdown sequence","description":"## Overview\nImplement the full 10-step ordered shutdown sequence so the mothership drains cleanly without data loss on SIGTERM (Docker stop, Kubernetes termination).\n\n## Sequence (plan lines 3480-3494) — 30s hard deadline:\n1. Set shutting_down=true; ingestion server returns HTTP 503 to new WebSocket upgrade requests\n2. Broadcast {type:'shutdown', reconnect_in_ms:30000} to all dashboard WebSocket clients\n3. Cancel fusion loop context (stops fusion goroutine)\n4. Drain signal processing pipeline: wait for in-flight CSI frames (max 2s)\n5. Flush in-memory baselines to SQLite in a single transaction\n6. Sync CSI recording buffer to disk (close writer, fsync)\n7. Close all node WebSocket connections with normal close frame (1000)\n8. Write {type:'system', description:'Mothership stopped'} event to events table\n9. PRAGMA wal_checkpoint(FULL) to collapse WAL into main DB file\n10. sqlite3.Close()\n\n## Implementation\n- context.WithTimeout(30s) wraps entire shutdown\n- Each step gets its own log line: '[SHUTDOWN] Step N/10 — ...'\n- Steps that fail log ERROR but do not abort remaining steps\n- Exit code 0 if all steps completed within deadline; exit code 1 if deadline exceeded\n\n## Acceptance\n- docker stop (SIGTERM) completes within 35s (30s shutdown + 5s buffer)\n- No WAL file remains after clean shutdown (verified with ls -la /data/)\n- system_stopped event present in events table after restart\n- In-flight CSI frames processed (not dropped) during drain step","status":"closed","priority":2,"issue_type":"task","assignee":"alpha","created_at":"2026-04-06T16:43:43.743509570Z","created_by":"coding","updated_at":"2026-04-07T15:52:40.588868807Z","closed_at":"2026-04-07T15:52:40.588753306Z","close_reason":"Implemented the full 10-step ordered shutdown sequence so the mothership drains cleanly without data loss on SIGTERM (Docker stop, Kubernetes termination).\n\nShutdown sequence (30s hard deadline):\n1. Set shutting_down=true; ingestion server returns HTTP 503 to new WebSocket upgrade requests\n2. Broadcast {type:'shutdown', reconnect_in_ms:30000} to all dashboard WebSocket clients\n3. Cancel fusion loop context (stops fusion goroutine)\n4. Drain signal processing pipeline: wait for in-flight CSI frames (max 2s)\n5. Flush in-memory baselines to SQLite in a single transaction\n6. Sync CSI recording buffer to disk (close writer, fsync)\n7. Close all node WebSocket connections with normal close frame (1000)\n8. Write {type:'system', description:'Mothership stopped'} event to events table\n9. PRAGMA wal_checkpoint(FULL) to collapse WAL into main DB file\n10. sqlite3.Close()\n\nEach step gets its own log line: '[SHUTDOWN] Step N/10 — ...'\nSteps that fail log ERROR but do not abort remaining steps.\nExit code 0 if all steps completed within deadline; exit code 1 if deadline exceeded.","source_repo":".","compaction_level":0,"original_size":0,"labels":["failure-count:4"]} {"id":"spaxel-a1f","title":"Morning briefing","description":"## Background\n\nThe morning briefing is a daily summary delivered when the first household member opens the dashboard (or wakes up, detected by the presence system) after the quiet hours / sleep period. It collects the most relevant information from the previous night and the upcoming day into a single concise card, so the user starts the day informed about their home without any active effort. A good morning briefing is like a trusted home assistant quietly summarising overnight events.\n\n## BriefingGenerator\n\nNew package: mothership/internal/briefing/generator.go\n\nBriefingGenerator runs as a scheduled goroutine, generating a DailyBriefing at a configurable time (default 06:00 server-local time). The briefing is stored in SQLite (daily_briefings table) and pushed to dashboard clients on their first connection after the briefing time.\n\nDailyBriefing struct:\n- id TEXT (UUID)\n- date DATE (the date this briefing covers — typically \"today\", covering the previous night)\n- generated_at DATETIME\n- sections []BriefingSection\n- delivered BOOLEAN (set true after first push to any dashboard client)\n- acknowledged BOOLEAN (set true when user dismisses the card)\n\nEach BriefingSection has a type and content:\n- SectionType: \"sleep\", \"overnight_events\", \"system_health\", \"predictions\", \"weather\" (optional)\n\n## Section: Sleep Report\n\nFor each person with a completed sleep session from the previous night:\nGenerated from the sleep_sessions table (Phase 7, spaxel-qfp).\nContent example: \"Alice slept 7h 23m. 2 wake-ups, 91% efficiency. Avg breathing 14/min.\"\nIf no sleep session: \"No sleep data for Alice last night.\"\nIf sleep session is still in progress (woke up after 6am): \"Alice is still asleep.\"\n\nFormatting rules:\n- Good sleep (efficiency > 85%, duration > 7h): green indicator\n- Fair sleep (efficiency 70-85% or duration 6-7h): amber indicator\n- Poor sleep (efficiency < 70% or duration < 6h): red indicator\n- Anomaly (breathing rate anomaly flagged): include note: \"Unusual breathing pattern detected at 02:14.\"\n\n## Section: Overnight Events\n\nSummary of activity timeline events that occurred during the quiet hours period (e.g. 10pm-6am).\nFilter: FallDetected, AnomalyDetected, NodeDisconnected events only.\nIf no events: \"No incidents overnight.\" (Reassuring — users should see this most mornings.)\nIf events: \"Node Living Room went offline at 02:15 and reconnected at 02:47.\" or \"Anomaly detected at 03:30 in Kitchen (acknowledged).\"\nFall events: always prominently listed, even if acknowledged: \"Possible fall detected at 04:12 for Alice in Bedroom (acknowledged).\"\nLimit: maximum 5 events summarised. If more than 5: \"...and 3 more events. [View all]\"\n\n## Section: System Health\n\nQuick summary of current system health.\nContent: \"4 nodes healthy.\" or \"3 nodes healthy. Node Hallway has been offline since 02:15.\"\nIf a node has been offline > 1 hour: include the duration.\nLink health average: \"Detection quality: 92%.\" (from ambient confidence score, Phase 5).\n\n## Section: Predictions\n\nFor each tracked person, their predicted first activity today.\nGenerated from the presence prediction model (Phase 7, spaxel-hnp).\nContent: \"Alice typically leaves at 8:30am on Tuesdays (78% confidence).\"\nOnly included if prediction model has sufficient data (> 7 days per person).\nIf prediction confidence < 60%: omit (not useful at low confidence).\n\n## Section: Weather (Optional)\n\nIf a weather API URL is configured in settings (e.g. OpenWeatherMap, wttr.in):\nFetch current outdoor temperature and conditions.\nContent: \"Outside: 14°C, partly cloudy.\"\nThis is a nice-to-have context note for heating decisions. The API call is optional and fails gracefully (omit the section if the API is unavailable).\n\nImplementation: GET https://wttr.in/{location}?format=%t+%C (plain text format). Cache for 30 minutes.\n\n## Dashboard Delivery\n\nOn the first WebSocket connection after 06:00 from any dashboard client:\n1. Check if today's DailyBriefing exists and has not been delivered yet\n2. If yes: push {\"type\":\"morning_briefing\",\"briefing\":BriefingJSON} to that client\n3. Mark briefing.delivered = true\n\nDashboard rendering:\n- Simple mode: full-width dismissible card at the very top of the home view. Large enough to read at a glance. Dismiss button (X) in top-right corner.\n- Expert mode: a floating panel overlay (300px wide, top-right of screen), auto-dismisses after 30 seconds of inactivity (the user sees it then goes back to work)\n- Ambient mode: the morning briefing overlay already handled by the ambient mode bead (spaxel-5es) — this briefing generator feeds that overlay.\n\nAcknowledgement: the dismiss button sends POST /api/briefings/{id}/acknowledge. Sets briefing.acknowledged = true.\n\n## Push Notification Delivery\n\nThe briefing is also pushed as a notification at 06:00 (via the notification module, Phase 6 spaxel-zpt), even if no dashboard is open. This ensures users get their morning summary even if they have not opened the dashboard.\n\nThe notification includes a floor-plan thumbnail (from the floor-plan renderer, spaxel-zpt) showing the current home state at 06:00.\n\nNotification title: \"Good morning\" (or \"Good morning, Alice\" if single person)\nNotification body: condensed version of the briefing: the most important item from each section.\n\n## Files to Create or Modify\n\n- mothership/internal/briefing/generator.go: BriefingGenerator, DailyBriefing, section generation\n- mothership/internal/briefing/scheduler.go: daily schedule (6am goroutine)\n- mothership/internal/dashboard/hub.go: morning_briefing push on first connection\n- dashboard/js/briefing.js: morning briefing card rendering in simple and expert modes\n- mothership/internal/dashboard/routes.go: POST /api/briefings/{id}/acknowledge, GET /api/briefings/today\n\n## Tests\n\n- Test briefing generation at 06:00: mock time at 06:00, verify BriefingGenerator creates a DailyBriefing\n- Test sleep section: inject a completed sleep session, verify section content is correct\n- Test overnight events: inject a NodeDisconnected event at 03:00, verify it appears in the overnight section\n- Test system health section: inject node_offline state, verify it appears correctly with duration\n- Test that briefing.delivered is set to true after the first push\n- Test that the briefing is pushed only once (second connection after delivery does not re-push)\n- Test push notification is sent at 06:00 (with mock time and mock notification module)\n\n## Acceptance Criteria\n\n- Morning briefing card appears on the first dashboard open after 06:00 (configurable)\n- All sections (sleep, overnight events, system health, predictions) are correctly populated\n- Briefing is pushed only once per day (not re-pushed on second dashboard open)\n- Push notification delivered at 06:00 with condensed briefing summary\n- Dismiss button correctly acknowledges the briefing and hides the card\n- \"No incidents overnight\" message appears correctly on quiet nights\n- Weather section appears when weather API is configured\n- Tests pass","status":"closed","priority":3,"issue_type":"task","assignee":"bravo","created_at":"2026-03-28T02:03:19.830232092Z","created_by":"coding","updated_at":"2026-04-11T08:06:51.045338042Z","closed_at":"2026-04-11T08:06:51.045230298Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:17"],"dependencies":[{"issue_id":"spaxel-a1f","depends_on_id":"spaxel-qfp","type":"blocks","created_at":"2026-03-28T02:03:23.803412940Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-a1f","depends_on_id":"spaxel-sl2","type":"blocks","created_at":"2026-03-28T03:29:15.060252766Z","created_by":"coding","metadata":"{}","thread_id":""}]} -{"id":"spaxel-a55","title":"Dashboard: anomaly detection & security mode UI","description":"## Overview\n\nThe anomaly detection backend (mothership/analytics/ or signal/) is ~80% complete. This bead covers the remaining backend wiring and the full dashboard UI for security mode.\n\n## Backend (if not yet done)\n- Confirm AnomalyDetector is initialized and running in main()\n- Anomaly events must be pushed to the dashboard WS feed as 'alert' messages (requires spaxel-9eg)\n- GET /api/anomalies?since=24h — list recent anomaly events\n- POST /api/security/arm + /api/security/disarm — arm/disarm security mode\n- GET /api/security/status — { armed, learning_until, anomaly_count_24h }\n\n## Dashboard UI (dashboard/js/security-panel.js)\n\n### Security mode card (always visible in header or sidebar)\n- Arm / Disarm toggle button with confirmation dialog\n- Status badge: DISARMED / LEARNING (N days remaining) / ARMED / ALERT\n- Learning period progress bar: '5 of 7 days complete'\n- Last anomaly: '2 hours ago — kitchen motion at 3:14am'\n\n### Alert banner\n- Full-width red banner when anomaly triggered while armed\n- Description, timestamp, affected zone\n- Acknowledge button (POST /api/anomalies/{id}/acknowledge)\n\n### Anomaly timeline tab\n- List of recent anomaly events with severity, zone, timestamp\n- Links to timeline view for full context\n\n## Acceptance\n\n- Arm/disarm persists across server restarts\n- Learning period progress updates on page refresh\n- Anomaly alert banner appears within 2s of detection\n- Acknowledged alerts disappear from the banner (not from history)\n\n## Note\n\nCloses or supersedes spaxel-403 if that bead's remaining work matches this scope.","status":"in_progress","priority":2,"issue_type":"task","assignee":"golf","created_at":"2026-04-06T12:56:14.953369134Z","created_by":"coding","updated_at":"2026-04-09T09:47:02.010060681Z","close_reason":"Already implemented in commit 0491965. All acceptance criteria verified: arm/disarm persists via SQLite, learning progress polls on refresh, alert banner via WebSocket within 2s, acknowledge removes from banner not history.","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:337"],"dependencies":[{"issue_id":"spaxel-a55","depends_on_id":"spaxel-7x2","type":"blocks","created_at":"2026-04-06T16:09:35.835740127Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-a55","depends_on_id":"spaxel-d04","type":"blocks","created_at":"2026-04-06T16:09:35.892072969Z","created_by":"coding","metadata":"{}","thread_id":""}]} +{"id":"spaxel-a55","title":"Dashboard: anomaly detection & security mode UI","description":"## Overview\n\nThe anomaly detection backend (mothership/analytics/ or signal/) is ~80% complete. This bead covers the remaining backend wiring and the full dashboard UI for security mode.\n\n## Backend (if not yet done)\n- Confirm AnomalyDetector is initialized and running in main()\n- Anomaly events must be pushed to the dashboard WS feed as 'alert' messages (requires spaxel-9eg)\n- GET /api/anomalies?since=24h — list recent anomaly events\n- POST /api/security/arm + /api/security/disarm — arm/disarm security mode\n- GET /api/security/status — { armed, learning_until, anomaly_count_24h }\n\n## Dashboard UI (dashboard/js/security-panel.js)\n\n### Security mode card (always visible in header or sidebar)\n- Arm / Disarm toggle button with confirmation dialog\n- Status badge: DISARMED / LEARNING (N days remaining) / ARMED / ALERT\n- Learning period progress bar: '5 of 7 days complete'\n- Last anomaly: '2 hours ago — kitchen motion at 3:14am'\n\n### Alert banner\n- Full-width red banner when anomaly triggered while armed\n- Description, timestamp, affected zone\n- Acknowledge button (POST /api/anomalies/{id}/acknowledge)\n\n### Anomaly timeline tab\n- List of recent anomaly events with severity, zone, timestamp\n- Links to timeline view for full context\n\n## Acceptance\n\n- Arm/disarm persists across server restarts\n- Learning period progress updates on page refresh\n- Anomaly alert banner appears within 2s of detection\n- Acknowledged alerts disappear from the banner (not from history)\n\n## Note\n\nCloses or supersedes spaxel-403 if that bead's remaining work matches this scope.","status":"closed","priority":2,"issue_type":"task","assignee":"romeo","created_at":"2026-04-06T12:56:14.953369134Z","created_by":"coding","updated_at":"2026-04-25T13:04:10.210239764Z","closed_at":"2026-04-25T13:04:10.210171225Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred","failure-count:338"],"dependencies":[{"issue_id":"spaxel-a55","depends_on_id":"spaxel-7x2","type":"blocks","created_at":"2026-04-06T16:09:35.835740127Z","created_by":"coding","metadata":"{}","thread_id":""},{"issue_id":"spaxel-a55","depends_on_id":"spaxel-d04","type":"blocks","created_at":"2026-04-06T16:09:35.892072969Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-axa","title":"Phase 4: Onboarding & OTA","description":"Goal: Non-technical users can add and update nodes. Interactive guided wizard.\n\nDeliverables:\n- Interactive onboarding wizard (flash via Web Serial, guided walk-through with live sensor feedback)\n- Provisioning payload (WiFi creds + node ID config blob → NVS)\n- OTA system (HTTP firmware serving, WebSocket-triggered, rolling updates, automatic rollback)\n- Captive portal recovery (AP fallback, config page for re-provisioning)\n- Guided troubleshooting foundation (first-time tooltips, node-offline steps, reinforcement)\n\nExit criteria: New ESP32-S3 from unboxed to streaming CSI in under 5 minutes.","status":"closed","priority":2,"issue_type":"phase","assignee":"echo","created_at":"2026-03-27T01:55:16.517644233Z","created_by":"coding","updated_at":"2026-03-29T03:57:13.016777393Z","closed_at":"2026-03-29T03:57:13.016673982Z","close_reason":"Phase 4: Onboarding & OTA System - COMPLETE\n\nAll deliverables implemented and committed (90e230f):\n\nInteractive Onboarding Wizard:\n- 8-step Web Serial-based provisioning flow\n- Firmware flashing via esp-web-install-button (CDN)\n- Live CSI waveform feedback during guided calibration\n- Server-side provisioning with client-side fallback\n\nOTA Firmware Management:\n- Firmware list with SHA-256 hashes and size display\n- Per-node progress tracking\n- Rolling update orchestration via REST API\n- Status bar button with state indicators\n\nGuided Troubleshooting:\n- First-time feature tooltips with 8s auto-dismiss\n- Sequential tooltip tour on first node connection\n- Node offline cards with recovery instructions\n- Client-side link health check (60s threshold)\n\nExit criteria met: New ESP32-S3 from unboxed to streaming CSI in under 5 minutes. 96 tests passing.","source_repo":".","compaction_level":0,"original_size":0,"labels":["deferred"],"dependencies":[{"issue_id":"spaxel-axa","depends_on_id":"spaxel-uc9","type":"blocks","created_at":"2026-03-28T01:33:40.376191069Z","created_by":"coding","metadata":"{}","thread_id":""}]} {"id":"spaxel-axa.1","title":"Interactive onboarding wizard","description":"## Background\n\nPhase 4's central goal is that a non-technical user can go from an unboxed ESP32-S3 to streaming CSI in under 5 minutes. The onboarding wizard is the centrepiece of this experience. It uses the Web Serial API (available in Chrome/Edge) to communicate with the ESP32 over USB — no driver installation needed, no CLI, no app download. The wizard is embedded in the existing mothership dashboard, accessible at /onboard.\n\n## Why Web Serial?\n\nThe alternative approaches — a dedicated mobile app, a WiFi provisioning AP, or a CLI tool — all have significant UX friction. Web Serial lets us flash firmware, provision WiFi credentials, and guide the user through calibration all in one browser session. The dashboard already knows the mothership IP/port. Chrome and Edge (95%+ of desktop browser market) support Web Serial natively since 2021. The only caveat is that Web Serial is not available in Firefox or Safari — this must be documented prominently at the start of the wizard.\n\n## Wizard Steps\n\n1. **Browser check**: Detect navigator.serial availability. If missing, show: 'Please use Google Chrome or Microsoft Edge to use the setup wizard. Firefox and Safari do not support USB device access.'\n\n2. **Connect device**: Call navigator.serial.requestPort(). Guide the user to hold BOOT button while plugging in if the device does not appear. Show a GIF or SVG illustration of the ESP32-S3 board with the BOOT button highlighted.\n\n3. **Flash firmware** (if not already spaxel firmware): Use esp-web-tools (espressif/esp-web-tools, CDN: https://unpkg.com/esp-web-tools@10/dist/web/install-button.js). This open-source library handles the full ESP32 flashing pipeline via Web Serial, including ROM bootloader protocol, chip detection, and progress reporting. It needs a firmware manifest.json at GET /api/firmware/manifest describing binary addresses and offsets. Show a progress bar during flashing. Estimated time: 45-90 seconds.\n\n4. **Provision WiFi**: Show a form for SSID and password. Optional: mothership host/port override (for non-mDNS setups). Assemble the provisioning payload and send to the ESP32 over serial as JSON (see Provisioning Payload bead for format). If using esp-web-tools, the provisioning can be injected via custom serial commands after flashing.\n\n5. **Detect mothership**: Once provisioned and rebooted, the ESP32 boots and discovers the mothership via mDNS (spaxel-mothership.local) or the configured host. Poll GET /api/nodes every 3s for up to 120s waiting for the new node to appear. Show animated 'Connecting...' indicator. On timeout: show WiFi troubleshooting guidance (5GHz check, SSID typo check, distance check).\n\n6. **Guided calibration**: Show the CSI waveform for the new node's links as they come online. Steps:\n a. 'Walk around your space for 30 seconds' — CSI amplitude should show activity. If flat: check node orientation.\n b. 'Stand still at the far end of the room' — capture baseline. Show countdown. Green check when baseline is captured.\n c. 'Walk through the centre of the room' — Fresnel zone lights up in 3D view, blob appears. 'The sensor can see you!'\n d. 'Sit down and stay still for 30 seconds' — test stationary detection (if Phase 5 available). Otherwise skip.\n\n7. **Node placement guidance**: Transition to the coverage painting UI (spaxel-qq6) for optimal node positioning. Show GDOP overlay for the current node placement. Suggest additional node positions if coverage is poor.\n\n## Files to Create/Modify\n\n- dashboard/js/onboard.js: wizard state machine, Web Serial API calls, step rendering\n- dashboard/index.html: add /onboard route and wizard container div, import esp-web-tools\n- mothership/internal/dashboard/routes.go (or similar): add GET /api/firmware/manifest route\n- mothership/internal/dashboard/hub.go: no changes needed (wizard uses REST polling, not WebSocket for this flow)\n\n## esp-web-tools Integration\n\n\n\nManifest served at GET /api/firmware/manifest:\n\n\n## Wizard State Machine\n\nStates: BROWSER_CHECK → CONNECT_DEVICE → FLASH_FIRMWARE → PROVISION_WIFI → DETECT_NODE → CALIBRATE → PLACEMENT → COMPLETE\n\nEach state has: render() function, onEnter() side effects, onNext() transition, onBack() for revert, onError() for failure handling.\n\nPersisted in sessionStorage so a page refresh during onboarding resumes from the last step (critical for the reboot-then-detect step).\n\n## Error Handling\n\nMap every known failure to a human-friendly message:\n- 'NotFoundError: No port selected' → 'No device detected. Make sure the USB cable is connected and hold the BOOT button while plugging in.'\n- 'NetworkError' during flash → 'The connection was interrupted. Check the USB cable is not loose and try again.'\n- Node not appearing after 120s → 'Your node connected to WiFi but cannot reach the mothership. Check: 1) Your router blocks device-to-device communication (AP isolation). 2) The mothership address is correct. 3) Your network uses a VLAN that separates devices.'\n- Wrong SSID/password → Node will fall into captive portal mode after 10 failures, triggering a 'Captive portal detected' guidance flow.\n\nNever show stack traces, WebSocket error codes, or Go error strings to the user.\n\n## Tests\n\n- Mock navigator.serial API in Jest (using jest-serial-port or a hand-written mock) to test wizard state transitions without real hardware\n- Test that provisioning payload is correctly assembled and sent over the mocked serial port\n- Test that polling GET /api/nodes correctly detects node appearance and transitions to DETECT_NODE → CALIBRATE\n- Test that BROWSER_CHECK step correctly detects missing serial API and shows the correct error\n- Test that sessionStorage correctly restores wizard state on page refresh at each step\n\n## Acceptance Criteria\n\n- Wizard completes in under 5 minutes on a fresh ESP32-S3 with a working WiFi network\n- User sees live CSI waveform during calibration step\n- Node appears in dashboard after wizard completion, with correct label\n- All known error conditions show human-friendly guidance, not technical errors\n- All existing dashboard tests pass\n- Wizard state is resumable after page refresh","status":"tombstone","priority":2,"issue_type":"task","created_at":"2026-03-28T01:34:58.168170967Z","created_by":"coding","updated_at":"2026-03-28T01:35:25.110026775Z","closed_at":"2026-03-28T01:35:25.110026775Z","source_repo":".","deleted_at":"2026-03-28T01:35:25.110008642Z","deleted_by":"coding","delete_reason":"delete","original_type":"task","compaction_level":0,"original_size":0} {"id":"spaxel-b49t","title":"fleet: surface Unpaired nodes in /api/fleet/health response","description":"## What\nMerge unpaired (connected-but-unprovisioned) nodes into the fleet health response so the dashboard can show them.\n\n## Changes\n- Add `UnpairedProvider` interface (`GetUnpairedMACs() []string`) to `fleet/fleethandler.go`\n- Add `unpairedProvider` field + `SetUnpairedProvider` setter to `FleetHandler`\n- Add `Unpaired bool` to `fleetNodeEntry`\n- In `getFleetHealth` and `getFleet`: for each unpaired MAC not already in the registry, append an entry with `Unpaired: true`; for MACs in the registry, set `Unpaired: true` on their entry\n\n## File\n`mothership/internal/fleet/fleethandler.go`","status":"closed","priority":2,"issue_type":"task","created_at":"2026-04-24T22:35:26.466438566Z","created_by":"coding","updated_at":"2026-04-24T22:46:13.299704914Z","closed_at":"2026-04-24T22:46:13.299644958Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0} {"id":"spaxel-b6a","title":"Implement calibration POST endpoint","description":"## Task\nImplement POST /api/floorplan/calibrate endpoint.\n\n## Specification\n- Accept {ax,ay,bx,by,distance_m,rotation_deg}: two pixel coordinates and their real-world distance\n- Compute and persist pixel-to-meter transform to SQLite floorplan table\n\n## Acceptance\n- Calibration data persists to SQLite floorplan table","status":"closed","priority":2,"issue_type":"task","assignee":"charlie","created_at":"2026-04-07T17:55:52.516620827Z","created_by":"coding","updated_at":"2026-04-07T18:53:06.721066Z","closed_at":"2026-04-07T18:53:06.720893263Z","close_reason":"done","source_repo":".","compaction_level":0,"original_size":0,"labels":["mitosis-child","mitosis-depth:1","parent-spaxel-klk"]} {"id":"spaxel-bf5","title":"Build crowd flow visualization","description":"Create visualization tools for occupancy patterns and movement.\n\nDeliverables:\n- Trajectory accumulation over time\n- Directional flow map rendering\n- Dwell time hotspot visualization\n\nAcceptance: Dashboard shows accumulated movement patterns and hotspots.","status":"closed","priority":2,"issue_type":"task","assignee":"sp3","created_at":"2026-03-29T19:25:04.155117811Z","created_by":"coding","updated_at":"2026-03-29T19:39:12.378329742Z","closed_at":"2026-03-29T19:39:12.378228906Z","close_reason":"Implemented crowd flow visualization with three components:\n\nBackend (Go):\n- FlowAccumulator records trajectory segments and dwell time in SQLite\n- REST endpoints for flow map, dwell heatmap, and detected corridors\n- Bresenham rasterization, angular variance analysis, connected component labeling\n\nFrontend (JavaScript):\n- Pattern controls in dashboard sidebar (flows, dwell, corridors toggles)\n- Time filter dropdown (7d, 30d, all time)\n- 3D visualization with ArrowHelper, PlaneGeometry, pulsating animations\n\nFiles: dashboard/index.html, dashboard/js/app.js, mothership/internal/analytics/","source_repo":".","compaction_level":0,"original_size":0,"labels":["mitosis-child","mitosis-depth:1","parent-spaxel-i28"]} {"id":"spaxel-bnbj","title":"Fix simple.html blank page (ES module loaded as classic script)","description":"## Problem\n\n`simple.html` renders completely blank. Browser console shows:\n\n```\nUnexpected token 'export'\n```\n\nAn ES-module script is being loaded with a classic `