pub enum ServerFrame {
Welcome(Welcome),
Event(Box<EventRecord>),
Answered(Box<Answered>),
Refusal(Box<AxError>),
Delta(Delta),
Log(LogLine),
Lagged(Lagged),
Output(LiveOutput),
Monitor(Sample),
}Expand description
Everything a server may send. Events are the push half; a Refusal
carries the three-part refusal the interface renders verbatim.
Delta is deliberately not an event. An event is a thing that
happened, and a token increment is not: it has no sequence number, it
is never written to the Ledger, it cannot be replayed, and a client
that missed one has lost nothing. Giving it a frame class of its own
is what keeps that true — folded into the event stream it would
become a second, unverifiable history of what the model said.
Variants§
Welcome(Welcome)
Event(Box<EventRecord>)
Answered(Box<Answered>)
Refusal(Box<AxError>)
Delta(Delta)
Text a model is saying, before the call it belongs to has
settled. Discardable by construction: the run it belongs to is
named so a client can throw the buffer away when model_returned
arrives, and the settled text of that record is what a page
draws. Where the two disagree, the record wins.
Log(LogLine)
One line of the process log, as docs/logging.md defines it.
A log is not history, and this frame is what keeps that true while a person still gets to read it: the line has no ledger sequence of its own, it is never written down, and a client that missed one has lost nothing. It carries the ledger position it was written at, which is the integer the two timelines line up on.
Lagged(Lagged)
The ledger records this session’s event stream skipped.
A session that reads slower than the city writes loses the middle of the stream: the buffer behind a subscription has a fixed capacity, and one slow reader is left behind rather than holding the writer up. Losing it in silence would let a page draw a history with a hole in it while nothing said so. The range is answered from the Ledger, which is the one home of what happened.
Only the event stream states a gap. An increment and a log line are written down nowhere, so a range naming them would name records that do not exist, and a reader that missed one has lost nothing it could have acted on.
Output(LiveOutput)
What a command still running has written so far. Discardable by
the rule Delta follows: the call’s result in the Ledger is the
authority on that output, and a page drops this once it lands.
Monitor(Sample)
One monitor reading, sent only to a session that is watching.