mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-03-31 16:55:48 +00:00
- Capture Node.js API response shapes from prod server as golden fixtures
- Store normalized shape schema in cmd/server/testdata/golden/shapes.json
covering 16 endpoints: stats, nodes, packets (raw + grouped), observers,
channels, channel_messages, analytics (rf, topology, hash-sizes, distance,
subpaths), bulk-health, health, perf, and node detail
- Add parity_test.go with recursive shape validator:
- TestParityShapes: validates Go response keys/types match Node golden
- TestParityNodeDetail: validates node detail response shape
- TestParityArraysNotNull: catches nil slices marshaled as null
- TestParityHealthEngine: verifies Go identifies itself as engine=go
- TestValidateShapeFunction: unit tests for the validator itself
- Add tools/check-parity.sh for live Node vs Go comparison on VM
- Shape spec handles dynamic-key objects (perObserverReach, perf.endpoints)
- Nullable fields properly marked (observer lat/lon, snr/rssi, hop names)
Current mismatches found (genuine Go bugs):
- /api/perf: packetStore missing 8 fields, sqlite missing 2 fields
- /api/nodes/{pubkey}: missing hash_sizes_seen, observations, _parsedPath,
_parsedDecoded in node detail response
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>