Codec abstraction

How typed values become payload bytes, and back. This cluster :satisfies: Connector framework (FEAT_0030).

Feature: Codec abstraction FEAT_0032
status: open
satisfies: FEAT_0030

How typed values become payload bytes, and back. Codec selection is a compile-time decision via a generic parameter on the connector type; no runtime codec dispatch.

Requirement: PayloadCodec trait REQ_0210
status: implemented
satisfies: FEAT_0032
is refined by: IMPL_0010, IMPL_0030
is implemented by: BB_0003
is verified by: TEST_0110
links outgoing: BB_0003, TEST_0110

The framework shall define a PayloadCodec trait carrying format_name(), encode<T: Serialize>(value, &mut [u8]) -> Result<usize>, and decode<T: DeserializeOwned>(&[u8]) -> Result<T>.

Requirement: Codec is a generic parameter on connectors REQ_0211
status: open
satisfies: FEAT_0032
is refined by: ADR_0005

Each Connector implementation shall expose its codec as a generic parameter (MqttConnector<C: PayloadCodec>), monomorphised at compile time. The framework shall not provide runtime codec dispatch or erased_serde-style indirection.

Requirement: JsonCodec is the default codec REQ_0212
status: implemented
satisfies: FEAT_0032
is refined by: IMPL_0030
is implemented by: BB_0003
is verified by: TEST_0110
links outgoing: BB_0003, TEST_0110

The framework shall ship a JsonCodec implementation in taktora-connector-codec behind a default-on json cargo feature.

Requirement: Codec encode error variant REQ_0213
status: open
satisfies: FEAT_0032
is refined by: ARCH_0031, IMPL_0010, IMPL_0030
is verified by: TEST_0111

When PayloadCodec::encode fails (buffer too small, serializer error), ChannelWriter::send shall return ConnectorError::Codec carrying the codec’s format_name() and the underlying source error.

Requirement: Codec decode error variant REQ_0214
status: open
satisfies: FEAT_0032
is verified by: TEST_0112

When PayloadCodec::decode fails on a received envelope, ChannelReader::try_recv shall return ConnectorError::Codec and shall not silently drop the envelope.