Expand description
Safe streaming (spec §18.5).
Streaming is where a careful runtime is most likely to lie, because the natural thing to send first is the sentence and the sentence is the part that is not true yet. So publication is gated by the turn’s own phase:
- Nothing that states an outcome leaves before commit. A
ResponseBlock::Receipt, and every model-authored block, is refused byPublicationGateuntil the turn reachesTurnPhase::Committed. There is no configuration that relaxes it. - Model-authored text goes out only once the plan is safe to publish. Which, for this runtime, is the same moment: composition runs after the commit bundle has landed.
- Cards and receipts are atomic typed events. They travel as whole
TurnEvent::Blockvalues, never as a stream of characters a client would have to reassemble into a button. - A click-only turn returns immediately.
TurnStream::immediateyields a finished turn with no model call behind it (§9).
§Prose arrives whole
A reply is reviewed before it is shown, so model-authored text is published as
one finished TurnEvent::Block, under the same gate as every other block.
§Progress is not an outcome
While the turn is interpreting and committing, the only thing on the wire is
TurnEvent::Phase. It is what a client hangs an activity indicator on, and
it says nothing about what will happen — which is exactly the point: a phase
marker cannot be misread as a receipt.
Structs§
- Channel
Sink - A sink that forwards to a
TurnStream. - Null
Sink - A sink that drops everything, for a caller that does not stream.
- Publication
Gate - Decides what may go on the wire at the phase the turn has reached.
- Recording
Sink - A sink that records every event, for tests and for a caller that wants the whole trace at the end.
- Turn
Publisher - Publishes a turn’s events through a sink, under the
PublicationGate. - Turn
Stream - The events of one turn, as a
Stream.
Enums§
- Turn
Event - One thing a client learns while a turn is being handled.
Traits§
- Turn
Sink - Receives the events of a turn as it runs.
Functions§
- publishes_
outcomes - Returns
trueonce a turn’s effects are settled, so a block that states an outcome may be published (spec §18.5).