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.
1.6 KiB
1.6 KiB
id, name, status, depends_on, scope, risk, impact, level, tags
| id | name | status | depends_on | scope | risk | impact | level | tags | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| server-adapter | HttpAdapter — ProtocolHandler with hyper over BiStream | pending |
|
moderate | medium | component | implementation |
|
Description
Port the HttpAdapter (ProtocolHandler for http/1.1 + h2) from
/workspace/@alkdev/alknet/crates/alknet-http/src/server/adapter.rs,
adapted to alkcall's shapes: handle() receives a Connection
(alkcall::core::types), takes the BiStream from accept_bi(), wraps
with TokioIo, drives hyper's http1/http2 connection builder against
the axum Router (built once at construction, with_decoy /
with_extra_routes builders per ADR-046). Branch on
connection.remote_alpn(). Leave a route slot for the WS upgrade
(wired in the websocket tasks).
Acceptance Criteria
HttpAdapter::new/h2/for_alpn+with_decoy+with_extra_routesportedProtocolHandlerimpl drives hyper over the BiStream; returns on connection close- Router merges extra routes; default surface wins collisions
- Integration test: full HTTP request/response cycle over
tokio::io::DuplexStream→Connection::from_bidi→ adapter cargo testpasses; feature gatesh2/http1both compile
References
- docs/architecture/http-server.md (§Running axum over a bidirectional stream)
- docs/architecture/decisions/002-protocol-handler-trait.md
- alkcall:
core::types::Connection::accept_bireturns joinedBiStream(alkcall ADR-005)
Notes
Agent fills during implementation.
Summary
Agent fills on completion.