Files
alknet/docs/architecture/questions/047-stdin-closure-canonical-signal.md
T
glm-5.2 a3cb44968e docs(adr): 093 — channels pure channel multiplexing (8-byte header, no stream_type)
Prune the channels spec to reflect the stream-unification resolution
(docs/research/stream-unification/findings.md): the channels wire format
goes from 9 bytes to 8 bytes, the channels layer no longer carries a
stream_type concept, into_sub_streams() is removed, and TTY always uses
its 5-byte format (carried transparently in the channels payload).

ADR-093 is the umbrella decision (the channels-layer consequence of
ADR-092's BiStream handler leaf): every channel is a BiStream, the
handler owns its sub-stream multiplexing, the channels layer routes by
channel_id only. Amends ADR-071 (8-byte header, no stream_type),
ADR-074 (into_sub_streams removed, accept_bi yields BiStream), reverses
ADR-077 (TTY always 5-byte), and the channels-facing clauses of
ADR-072/073/075/076/080/081. Adds ADR-092 forward-reference note
(into_sub_streams preservation subsequently reversed by ADR-093) and
the missing ADR-092 cross-reference on ADR-070.

Adds OQ-68 (add/strip API shape — built-in vs utility; the contract is
decided in ADR-093, the function surface is open; two-way door, low
priority, decision-ready when the channels crate's implementation
begins).

Rewrites the 7 channels spec docs (README, overview, channels-wire,
channels-connection, channels-adapter, channel-operations, channel-client)
to describe the post-amendment shape as current, with the 8-byte header,
the add/strip composition, single accept_bi accessor, BiStream per
channel, and TTY-always-5-byte.

Touch-up cross-references in hub README, client README, ADR-085, and
the OQ-45/47/65 question files (TTY-internal stream_type 3 →
STREAM_CTRL_IN; channels 9-byte → 8-byte).
2026-07-18 18:10:17 +00:00

23 lines
1.2 KiB
Markdown

# OQ-47: Stdin Closure Canonical Signal
- **Origin**: `docs/research/alknet-docker/poc-summary.md` §"Open
Unknowns" #4 (stdin closure semantics for raw carriage);
[crates/tty/tty-wire.md](crates/tty/tty-wire.md) §"Stdin Closure".
- **Status**: resolved
- **Door type**: Two-way
- **Priority**: low
- **Resolution**: Either a zero-length stdin chunk (stream_type 0,
length 0 — the docker POC's sentinel) or a `{"type":"eof"}`
control chunk (TTY's `STREAM_CTRL_IN`, stream_type 3 — the tty POC's
explicit signal) closes the client's stdin. Both are accepted by the
adapter; the spec recommends `eof` for explicitness (it's a control
message, not a data-length hack). The adapter handles both
identically: signal EOF to the backend's stdin (`ChildStdin::drop` /
PTY writer close) and keep pumping stdout until the exit resolves —
the client may still want to receive remaining output + the exit
code. A third path (client closes the write half of the bidi stream)
is also accepted and handled the same way. See ADR-052 and
`tty-wire.md`.
- **Cross-references**: ADR-052, [tty-wire.md](crates/tty/tty-wire.md),
[tty-adapter.md](crates/tty/tty-adapter.md)