Skip to content

Design the WebSocket transport stack: contract (ADR-0032) + resilience (ADR-0033) #61

Description

@NotAProfDev

Goal

Design the WebSocket transport for the network adapter stack — the streaming sibling of the HTTP pair (ADR-0030 contract + ADR-0031 resilience) that ADR-0029 deferred to "a deliberate later session". Driven by the first Broker/Data Provider (IBKR Client Portal WS) and cross-checked against Binance and Coinbase so the generic transport carries no IBKR-shaped assumption.

Scope

Two paired ADRs (documentation only — no crate implementation in this issue):

  • ADR-0032 — WebSocket transport contract. Untyped duplex frame channel (grammar/demux adapter-side); asymmetric Stream recv / RPITIT one-shot send with split owned halves; minimal Frame enum; epoch-stamped lifecycle channel; uniform no-silent-drop backpressure guarantee; WsConnector leaf over tokio-tungstenite + rustls; per-transport AuthSource.
  • ADR-0033 — WebSocket resilience stack. Two-seam composition (WsConnector in / ReconnectingConnection out); reconnect as a spawned actor over a new runtime-neutral Spawn seam; two-axis layer stack (connect-time chain + per-frame recv/send pipelines); transport-liveness-vs-session-keepalive split (mandatory auto-Pong, passive idle + active keepalive-when-idle probe); lifecycle as a watch of an epoch-stamped LifecycleSnapshot; dual count+byte drop-oldest buffer; a circuit breaker that retries transient loss forever but surfaces permanent failure as Unrecoverable; a send-axis rate limit; force_reconnect on a control handle.

Out of scope

  • Implementation of oath-adapter-net-ws-api / -tungstenite / -mock crates (future work, gated on the net-http slices landing first — WS rides on the REST session).
  • The net-http construction-surface amendments (a separate workstream → ADR-0034).

Notes

Venue semantics (IBKR/Binance/Coinbase keepalive, rate limits, silent-loss, large frames) were verified against live docs, not recalled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions