--- id: adapter-from-wss name: from_wss consumer adapter (wss feature) status: pending depends_on: [ws-byte-adapter, ws-upgrade-session] scope: moderate risk: high impact: component level: implementation tags: [adapters, phase-3] --- ## Description Implement `from_wss` per ADR-070 behind the `wss` feature (tokio-tungstenite): dial wss:// endpoint → adapt the WS stream with the shared byte-adapter → `Connection::from_bidi(_, b"alk/channels")` → consumer half (alkcall ChannelClient machinery: channel 0 install + client dispatch loop) → services/list + services/schema → one forwarding HandlerRegistration per discovered op (FromCall provenance, leaf, Internal default). Forwarding: serialize input → call.requested frame on channel 0 → correlate by id. Bearer token from Capabilities (no-env-vars). Reconnect policy: v1 = drop → retryable failures (OQ-03 disposition). ## Acceptance Criteria - [ ] Adapter behind `wss` feature; base crate compiles without it - [ ] Round-trip test: from_wss consumer ↔ ws-upgrade-session server (both halves of the adapter exercised together) - [ ] Discovered ops invoke correctly; identity/ACL enforced end-to-end - [ ] Connection drop → in-flight calls fail retryable, no hang - [ ] Credentials flow from Capabilities only (no env-var reads) - [ ] `cargo test --all-features` passes ## References - docs/architecture/decisions/070-from-wss-consumer-adapter.md - docs/architecture/websocket.md (§The consumer-side mirror) - alkcall ADR-028 (from_call pattern), ADR-043 (ChannelClient) ## Notes > Agent fills during implementation. ## Summary > Agent fills on completion.