Problem
TCPClient (src/traceml_ai/transport/tcp_transport.py:195) is never
constructed against a real socket in any test: exporter/publisher tests
substitute fakes, and the TCPServer tests only cover bind behavior, never
accepting and decoding a framed envelope. The msgpack framing tests verify a
test-side re-implementation of the writer framing rather than the production
writer. Malformed or version-skewed envelopes through the aggregator drain
path are also unpinned.
This means the actual product wire (4-byte length prefix + msgpack envelope,
client connect/send/reconnect, server accept/drain) has no automated coverage;
any framing or protocol regression only surfaces in a live run.
Proposal
One in-process integration test (real sockets on port 0, no subprocesses):
- Start a real
TCPServer, connect a real TCPClient, send a batch through
the production sender path, drain it in the aggregator loop, and assert the
projected SQLite rows.
- Add malformed-envelope cases (truncated frame, missing meta keys, wrong
types) and assert the drain path fails safe instead of crashing the loop.
- Optionally a reconnect case: restart the server and assert the client
re-establishes and continues.
Problem
TCPClient(src/traceml_ai/transport/tcp_transport.py:195) is neverconstructed against a real socket in any test: exporter/publisher tests
substitute fakes, and the TCPServer tests only cover bind behavior, never
accepting and decoding a framed envelope. The msgpack framing tests verify a
test-side re-implementation of the writer framing rather than the production
writer. Malformed or version-skewed envelopes through the aggregator drain
path are also unpinned.
This means the actual product wire (4-byte length prefix + msgpack envelope,
client connect/send/reconnect, server accept/drain) has no automated coverage;
any framing or protocol regression only surfaces in a live run.
Proposal
One in-process integration test (real sockets on port 0, no subprocesses):
TCPServer, connect a realTCPClient, send a batch throughthe production sender path, drain it in the aggregator loop, and assert the
projected SQLite rows.
types) and assert the drain path fails safe instead of crashing the loop.
re-establishes and continues.