docs: implementation plan (TTY precedents folded in); task decomposition (17 tasks)

Plan updated with the alknet-tty findings: the drainer pattern
(single ordered writer) makes outbound chunk-boundary parsing sound;
TestStdinSink's try_send→Full→Pending is the inbound backpressure
precedent; OQ-01(a) now cites the reference.

Task graph (taskgraph-validated, 17 tasks, 6 generations, no cycles):
- tasks/server/: core-types, auth, healthz-decoy, adapter
- tasks/gateway/: dispatch, routes, publish
- tasks/websocket/: byte-adapter (research POC), upgrade-session, overlay-ops
- tasks/adapters/: from-openapi, from-jsonschema, to-openapi, from-wss, mcp
- tasks/client/: http-host
- tasks/infra/: integration-suite (phase 4)

Critical path runs through server core → adapter → WS session →
overlay tests → integration suite. High-risk tasks are the three WS
tasks, de-risked by the ws-byte-adapter POC blocking upgrade-session.
This commit is contained in:
2026-08-28 06:05:45 +00:00
parent eaf1a203bc
commit 63dc4b6d06
19 changed files with 784 additions and 4 deletions
+47
View File
@@ -0,0 +1,47 @@
---
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.