0167: HTTP reuses pieces, not a shared transport abstraction
Status: Accepted by maintainer 2026-11-07; partially superseded by 0247 (accepted 2026-11-15; still no cross-protocol Service)
Context
HTTP, MCP and A2A all move requests and responses. MCP server
mode is
serve_line(State, str) -> Reply { state, out }
with a six-line stdin loop in the example main. A2A
is handle(Store, str, H) -> Reply with a
Transport { exchange(str) -> result<str, str> }
used by fixtures and loopback. The agent plugin has
CurlProcess and curl_send, an SSE
parser, and jsonscan, all tied to
StreamError and the agent platform package. JSON
readers already exist three times (mcp.wire,
agent/jsonscan, codec/rt).
Decision
Share concrete pieces only:
- curl config:
config_quote,config_headerand the hardened flag list move intohttp.client;agent/transport.hncurl_sendcalls them and keeps its--fail-with-bodyandStreamErrormapping. This is done in a separate step and only once no M14 lane touches that file. - Runtime: one monotonic-ms helper replaces
hrt_proc_millisforhrt_proc.handhrt_net.h(the agent and LSP copies move later);Listener/ConnfollowFile's handle and close pattern; grants usehrt_net_coversandnet_host.rsunchanged. - Protocol cores: MCP-over-HTTP and
A2A-over-HTTP become small
Handlers that pass the request body toserve_lineorhandle. Anhttp.client-backed type can implementa2a.transport.Transport. Both are deferred. - JSON: HTTP adds no JSON reader; apps use
mcp.wireorcodecderives.
Do not share:
- No common Transport/Service interface across HTTP, MCP and A2A. Their state types and framings differ, and the adapters are about 15 lines each.
- No change to
agent/sse.hn. It is a client parser; server-side SSE writing is a few lines of serialization. - No reuse of the agent
ReplayTransport. It is keyed by action id;http.clientgets its own canned runner, likea2a'sFixture. - No reuse of
budget.hnorlimits.hn. Token budgets and concurrency slots do not apply to a sequential server. - No JSON consolidation in this milestone. It goes in the parking lot.
Consequences
The curl hardening has one owner. The only new abstraction is
http.client.Runner, which CurlProcess
mirrors. Cross-plugin imports follow the a2a →
mcp.wire precedent.
Alternatives
- A generic
Service<S>used by all three protocols: more type machinery than the adapters it replaces. - Copy the curl code into
http.client: two copies of security-sensitive quoting.