Summary
Create a standalone Python script that simulates a radar node pushing detection frames over TCP, for use in testing and debugging the TCP push pipeline.
Context
Depends on #6 (TcpServer + TcpReceiver) being complete to test against.
See design spec: docs/superpowers/specs/2026-03-11-tcp-push-detection-forwarding-design.md in the retina monorepo.
Deliverable
tests/simulate_node.py
A CLI tool that connects to tracker-host's TCP server and sends detection frames. Serves as both a test fixture and a manual debugging tool.
Scenarios to support
- Normal stream — send synthetic detection frames at configurable CPI rate (default 0.5s)
- Disconnect/reconnect — close socket after N frames, reconnect after configurable delay
- Multiple nodes — simulate N concurrent nodes with different node_ids
- Invalid token — connect with wrong token, verify rejection
- Malformed JSON — send garbage data, verify server handles gracefully
- Buffer burst — simulate reconnect with a burst of buffered frames (rapid send of N frames)
- Heartbeat only — connect and send only heartbeats, no detections
CLI interface
# Basic: single node, continuous stream
python tests/simulate_node.py --host localhost --port 30050 --node-id radar-test --token secret
# Multiple nodes
python tests/simulate_node.py --host localhost --port 30050 --nodes 3 --token secret
# Disconnect/reconnect scenario
python tests/simulate_node.py --host localhost --port 30050 --node-id radar-test --token secret --disconnect-after 10 --reconnect-delay 5
# Buffer burst on reconnect
python tests/simulate_node.py --host localhost --port 30050 --node-id radar-test --token secret --disconnect-after 10 --reconnect-delay 5 --buffer-burst 50
Detection frame format
Generate realistic synthetic frames with:
- Monotonically increasing timestamps
- 1-5 random detections per frame (random delay/doppler/snr values in plausible ranges)
- Optional synthetic ADS-B matches
Acceptance criteria
Summary
Create a standalone Python script that simulates a radar node pushing detection frames over TCP, for use in testing and debugging the TCP push pipeline.
Context
Depends on #6 (TcpServer + TcpReceiver) being complete to test against.
See design spec:
docs/superpowers/specs/2026-03-11-tcp-push-detection-forwarding-design.mdin the retina monorepo.Deliverable
tests/simulate_node.pyA CLI tool that connects to tracker-host's TCP server and sends detection frames. Serves as both a test fixture and a manual debugging tool.
Scenarios to support
CLI interface
Detection frame format
Generate realistic synthetic frames with:
Acceptance criteria