summaryrefslogtreecommitdiffhomepage
path: root/.dispatch/rules/frontend-inject-transport.md
blob: fbe83d7757a33f3d49914d12252b41782db5fc23 (plain)
1
2
3
4
5
6
7
# Rule: inject the transport; parsers are pure

The WS/NDJSON framing + parsing is a PURE function (bytes/messages → typed events);
the socket/fetch is INJECTED. Test the parser with crafted chunk inputs (and
trace-replay-style fixtures), never a live connection. The op-protocol core is a
pure state machine: `reduce(intent, incoming) → { viewModel, outgoingCommands }`;
the carrier (WebSocket) is the injected shell.