proptest-driven round-trip for a representative struct:
encode(value,&mutbuf) followed by decode(&buf[..len])
yields a value equal to the original under every shrunken input.
Runs against JsonCodec; MsgPackCodec has its own round-trip
test (MsgPackCodec round-trip and... (TEST_0955)) and ProtoCodec will be added once it lands.
Test Case: Codec encode error on undersized bufferTEST_0111
Encoding a value larger than the provided buffer returns
ConnectorError::PayloadOverflow{actual,max} so the
buffer-exhaustion path is distinguishable from genuine serializer
faults at the codec layer. Other serializer failures (NaN
floats with strict configuration, non-string map keys, etc.)
surface as ConnectorError::Codec carrying the codec’s static
format_name() and the underlying serializer error chain.
Routing buffer-overflow to PayloadOverflow keeps the codec
layer consistent with Outbound bridge saturation ... (REQ_0323) and Payload-overflow rejection (TEST_0125) —
buffer exhaustion is always the same variant regardless of which
layer detects it.
Test Case: Codec decode error propagationTEST_0112
Receiving a payload that fails decode<T> (e.g. truncated JSON,
wrong shape) surfaces as ConnectorError::Codec from
ChannelReader::try_recv rather than silently dropping the
envelope.
Test Case: BinaryCodec round-trip and constant-length contractTEST_0195
A proptest-driven round-trip over fixed-width values, plus assertions that
a u16 encodes to exactly 2 bytes for every value, that big-endian and
little-endian produce the expected byte order, and that a multi-field
fixed-width struct encodes to the summed width. An undersized buffer returns
ConnectorError::PayloadOverflow and a truncated decode returns
ConnectorError::Codec.
Test Case: MsgPackCodec round-trip and error contractTEST_0955
A proptest-driven round-trip over a representative struct
(primitives, String, Vec), plus assertions that the
MessagePack encoding is smaller than the JSON encoding of the same
value, that format_name() is "msgpack", that an undersized
buffer returns ConnectorError::PayloadOverflow, and that a
truncated payload decodes to ConnectorError::Codec rather than
being silently dropped.