identified
A byte-transparent 2-peer Seam over a Connection whose two identities are known. broadcast == sendTo(remoteId). Woven at construction; Torn on conn EOF/error or close. Concurrent sends are serialized through an internal channel + single writer so wire order matches call order.
The seam closes conn itself when the link ends (#2898) — it does not wait for the application to call Seam.close. A clean end of Connection.incoming tears the seam with CloseReason.RemoteRequested; an incoming that throws (a stream cut mid-frame, an oversize length prefix) tears it with CloseReason.Error carrying that exception, so a consumer can tell the two apart. Either way conn is closed at once, without flushing frames still queued for the writer: the peer has gone or been refused, so nothing more is sent. A failed send closes conn the same way. The close happens exactly once across every path, and a close that arrives while another path's close is in flight waits for that one rather than closing again.
To send and then close, call Seam.flush in between. A close does not drain: a frame still queued for the writer when it runs is lost.
Thread-safety. This type is correct under a multi-threaded dispatcher — the injected dispatcher is only the scope for the read/write loops (scheduling); it is not a mutual-exclusion mechanism. Teardown is latched by a SeamStateGate: close and readLoop's finally both call tear(), which is single-shot, so teardown runs exactly once regardless of which thread arrives first and no late write can move the state off Torn. readLoop/broadcast/sendTo read state.value; because the suspending outbox.send() is an inherent check-then-send TOCTOU against a concurrent teardown that closes the channel, they convert a ClosedSendChannelException into the same clean closed-seam IllegalStateException the pre-check produces — a closed seam never leaks a raw channel exception.
Inbox backpressure. Inbound frames are delivered through a Spool whose capacity and overflow behaviour are governed by policy (default DeliveryPolicy.Reliable, capacity DeliveryPolicy.DEFAULT_CAPACITY, overflow us.tractat.kuilt.core.Overflow.SUSPEND). The old Channel.UNLIMITED inbox is gone: unbounded inbound queues are structurally unrepresentable per the fabric-backpressure epic.
Outbox. The outbound queue is a bounded Channel (capacity DeliveryPolicy.DEFAULT_CAPACITY, overflow BufferOverflow.SUSPEND). SUSPEND is the right strategy for an outbound queue: broadcast/sendTo callers are backpressured when the wire cannot keep up, preserving FIFO order without dropping frames. The outbox is distinct from the inbox policy because it is a wire-output buffer, not an inbound delivery buffer; a per-call override of outbound capacity is not useful at this primitive's level.
Parameters
The scope for the seam's read/write loops. Production callers pass Dispatchers.Default.limitedParallelism(1); test callers pass a TestCoroutineDispatcher derived from the test scheduler so that the seam's read/write loops share the same virtual clock as the test's withTimeout.
Governs the inbox Spool's capacity and overflow behaviour. Defaults to DeliveryPolicy.Reliable (bounded, backpressured, lossless).