spaxel/mothership/internal/analytics
jedarden 0377426926 fix: wire anomaly detection & security mode API endpoints
- Add missing CountAnomaliesSince method to mockDetectorProvider
  in security_test.go to satisfy the DetectorProvider interface
- Fix variable shadowing bug in anomaly.go QueryAnomalyEvents
  where incomplete rename from 'events' to 'result' caused
  append(events, &e) to reference the package instead of the slice

All security mode endpoints verified:
- GET /api/anomalies?since=24h — lists recent anomaly events
- POST /api/security/arm + /api/security/disarm — arm/disarm
- GET /api/security/status — {armed, learning_until, anomaly_count_24h}
- Anomaly events push to dashboard WS as 'alert' messages
- Arm/disarm state persists across restarts via learning_state table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 12:10:01 -04:00
..
anomaly.go fix: wire anomaly detection & security mode API endpoints 2026-04-07 12:10:01 -04:00
anomaly_test.go feat: implement 7-day pattern learning algorithm for anomaly detection 2026-04-06 21:27:10 -04:00
flow.go feat(analytics): implement crowd flow visualization 2026-03-29 15:38:40 -04:00
flow_test.go feat(localization): implement self-improving localization with BLE ground truth 2026-03-29 20:11:22 -04:00
handler.go feat: implement 7-day pattern learning algorithm for anomaly detection 2026-04-06 21:27:10 -04:00
patterns.go feat: implement 7-day pattern learning algorithm for anomaly detection 2026-04-06 21:27:10 -04:00
patterns_test.go feat: implement 7-day pattern learning algorithm for anomaly detection 2026-04-06 21:27:10 -04:00