All 5 new message types (event, alert, ble_scan, trigger_state,
system_health) were already implemented in hub.go with broadcast methods,
called from main.go/ingestion/volume_triggers/events, and handled in
app.js. Also includes security mode persistence from anomaly DB and
OpenAPI docs for triggers endpoints.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement GET and POST/PATCH /api/settings endpoints with:
- GET /api/settings: Returns all configurable settings as JSON with
default values merged in for any settings not explicitly set
- POST/PATCH /api/settings: Partial update with merge semantics,
only updating the keys provided in the request body
- SQLite persistence: Settings stored in settings table with
JSON-encoded values, loaded on startup
- Comprehensive validation: All known settings validated with
proper range checks (fusion_rate_hz, grid_cell_m, delta_rms_threshold,
tau_s, fresnel_decay, n_subcarriers, breathing_sensitivity,
motion_threshold, dwell_seconds, vacant_seconds, max_tracked_blobs,
replay_retention_hours, replay_max_mb, security_mode,
events_archive_days)
- OpenAPI-style godoc comments: Documentation for all endpoints
using swagger annotations
- Table-driven tests: Comprehensive test coverage for all
functionality including GET, POST, PATCH, validation,
persistence, and error cases
- Helper utilities: Extracted writeJSON, writeJSONError,
writeJSONData to utils.go for reuse
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>