Kpa-clawbot
e18a73e1f2
feat: Go server API parity with Node.js — response shapes, perf, computed fields
...
- Packets query rewired from packets_v VIEW (9s) to direct table joins (~50ms)
- Packet response: added first_seen, observation_count; removed created_at, score
- Node response: added last_heard, hash_size, hash_size_inconsistent
- Schema-aware v2/v3 detection for observer_idx vs observer_id
- All Go tests passing
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-03-27 01:50:46 -07:00
Kpa-clawbot
742ed86596
feat: add Go web server (cmd/server/) — full API + WebSocket + static files
...
35+ REST endpoints matching Node.js server, WebSocket broadcast,
static file serving with SPA fallback, config.json support.
Uses modernc.org/sqlite (pure Go, no CGO required).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-03-27 01:16:59 -07:00
Kpa-clawbot
e89c2bfe1f
test: add comprehensive Go test coverage for ingestor (80%) and server (90%)
...
- ingestor: add config_test.go (LoadConfig, env overrides, legacy MQTT)
- ingestor: add main_test.go (toFloat64, firstNonEmpty, handleMessage, advertRole)
- ingestor: extend decoder_test.go (short buffer errors, edge cases, all payload types)
- ingestor: extend db_test.go (empty hash, timestamp updates, BuildPacketData, schema)
- server: add config_test.go (LoadConfig, LoadTheme, health thresholds, ResolveDBPath)
- server: add helpers_test.go (writeJSON/Error, queryInt, mergeMap, round, percentile, spaHandler)
- server: extend db_test.go (all query functions, filters, channel messages, node health)
- server: extend routes_test.go (all endpoints, error paths, analytics, observer analytics)
- server: extend websocket_test.go (multi-client, buffer full, poller cycle)
Coverage: ingestor 48% -> 80%, server 52% -> 90%
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-03-27 00:07:44 -07:00