Skip to main content

Module contract

Module contract 

Source
Expand description

Tolerant normalization helpers for external adapter state.

Adapter protocols are external state: catalogs can be reordered or replaced, and capability fields may be absent or malformed. Normalize those values at the core boundary before feeding them to the reducer. These helpers intentionally discard invalid entries rather than allowing a single bad catalog item to poison a session.

Functions§

equivalent_traces
Compare protocol-specific traces after normalization has occurred. The event vocabulary is the compatibility boundary, so equivalent ACP/native traces must replay to equal state.
normalize_capabilities
Normalize a protocol capability object. Unknown, omitted, or non-boolean fields resolve to false; a malformed object therefore behaves like an adapter with no optional capabilities.
normalize_modes
Normalize a mode catalog from either a bare array or an ACP-style object containing availableModes. Invalid entries and duplicate IDs are dropped while preserving the adapter’s remaining order.
replay_trace
Replay a normalized trace through the deterministic core reducer.