3 Commits

Author SHA1 Message Date
Daniel Pupius
8130158c1e feat(cache): priority-based eviction with age protection and Bélády approximation
Replace the flat circular buffer with NodeAwareCache, a smarter eviction
strategy for historical mesh packet data:

- Packets younger than 1 hour are never evicted (recent traffic preserved)
- Under pressure, evict from the lowest-priority type first (neighbor-info
  outlasts node-info; chat messages outlast everything)
- Within a priority tier, evict from the most recently active source node —
  that node will resend soonest, so its old packet is cheapest to lose
  (Bélády approximation; protects flaky/distant node history)
- Node retention window still applies: silent nodes' packets are excluded
  from GetAll and pruned proactively before priority eviction runs

Also:
- Add --cache-retention flag (default 3h) and raise --cache-size default to 5000
- Fix decoder error strings (replace verbose Go errors with short codes)
- Add HTTP security headers middleware to server
- Fix broker dispatchLoop deadlock on source channel close
- Fix make gen-proto scanning web/node_modules for .proto files
- Fix tools target always reinstalling protoc-gen-go (handles stale arch binary)
- Move server port from 8080 to 5446; update Dockerfile, docker-compose, moat.yaml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 20:23:50 +00:00
Daniel Pupius
e8e1a112ab feat(topology): track mesh node connections and render as map polylines
Add passive topology tracking from four sources with confidence ranking:
- Zero-hop MQTT observations (continuous, per-gateway, highest frequency)
- Traceroute replies (RouteDiscovery, full path + SNR data)
- NeighborInfo packets (self-reported neighbor SNR)
- relay_node inferred links (1-hop packets with known relay)

Backend: add rx_snr (field 62) and rx_rssi (field 63) to meshstream Data
proto; extract from MeshPacket in decoder.go; regenerate Go bindings.

Frontend:
- topologySlice: LinkObservation model, per-direction confidence merge,
  24h TTL pruning, 2000-edge cap, Redux-pure (timestamp from payload)
- aggregatorSlice: add hopsFromGateway to NodeData
- __root.tsx: dispatch processTopologyPacket after each SSE message
- NetworkMap: render polylines colored by SNR (green/yellow/red/gray),
  dimmed at 0.4 opacity for viaMqtt edges; Links toggle button in legend
- NodeDetail: Connections section showing per-edge SNR, source badge,
  viaMqtt badge, and last-seen time

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-15 16:43:48 +00:00
Daniel Pupius
e9fa0104e3 Docker set up and fixes for build 2025-05-01 15:34:16 -07:00