1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
//! **The chat pane as data** — every entry of a transcript, and the live fold,
//! as the rows the pane paints.
//!
//! Split from [`super`] at the design-time budget on the seam that module's
//! own doc draws: this is the **projection**, a pure function of the
//! transcript and the fold, and [`super`] is the pane that paints it. The two
//! change for different reasons — an entry kind the server grows changes this,
//! a control the pane grows changes that — and the split is what keeps a
//! reply-vocabulary change from touching any paint at all.
//!
//! **Nothing is dropped, including what nothing could parse.** An entry the
//! server could not read is surfaced as its raw bytes, and an entry of a kind
//! this build does not know is surfaced as its own word beside them — the
//! reply vocabulary's rung 3, on the glass. A transcript that quietly skipped
//! an entry would be a conversation the operator reads as shorter than it was,
//! which is the one failure a transcript must not have.
//!
//! The one thing that is **not** a row is a half of a turn with nothing in it
//! — see [`half`], which is that rule's one home. An empty half is not
//! something the operator was not shown; it is something that was never said.
use fold;
use crateSpeaker;
/// The turn that has not settled yet.
/// A call and its result, met on one row.
/// Whose weight a row is said in, and which bubble it stands on.
/// The row itself — what one line of the pane is made of (bl-1d79).
pub use Row;
/// What this seat sent, as rows after the committed ones.
use crateStream;
use crate;
use ;
pub use OPERATOR;
use delivered;
/// One painted row: who is speaking, and what they said.
///
/// **[`Row::fold`] is what makes a machine's answer machinery** (bl-90d0). It
/// is `None` for everything a person or a model said, whatever its length — a
/// long prose answer is the thing the pane is opened for — and `Some` only for
/// a tool result big enough to have something to hide. So the pane folds by
/// KIND and never by size, which is the distinction that matters: a
/// seven-hundred-line `bl --help` is not a long answer, it is bookkeeping in
/// front of one.
/// **What kind of row it is**, which is what the glass groups by (DESIGN
/// §4.42, item 4): something said, or a step of the trail — a call, its
/// result, or reasoning — which the paint gathers under one fold.
/// **Who a wound's row is said by**: nobody — it is the conversation's
/// state, so it wears the error rule and a word for what happened rather
/// than the server's virtual entry name.
pub const WOUND: &str = "it stopped";
/// **The whole pane as data.**
///
/// The live fold **is a newer reading of the committed read's `Streaming`
/// entry, and it paints only in that entry's place** (bl-f6b5). The tail
/// reaches a seat by two routes at two cadences — the pull read folds one on
/// at ask cadence, the follow lane delivers a newer one at write cadence — and
/// *the newest fold wins* is the only reconciliation either needs.
///
/// **So a transcript with no `Streaming` entry has no response open, and the
/// fold is not painted at all** — whether the TURN still runs is [`running`],
/// a different question answered off the transcript's shape. The server's
/// streaming entry rides the open response (REMOTE §5.5), so its absence is
/// the committed read saying the
/// response closed — the turn is a `model` entry now, and a fold appended
/// after it painted the answer twice, `«live»` under the committed one, for as
/// long as the lane's last fold stood in [`crate::ui::Model::live`]. The rule
/// is derived from the read rather than kept by clearing the field when the
/// lane ends: a lane end is not the commit (the read can land while the lane
/// is still open), while the read IS the commit, whichever order the two
/// routes arrive in — and a field nothing writes cannot go stale. The cost
/// is bounded and stated: a turn that has begun streaming but that no pull
/// read has yet seen paints its tail from the next read on, one ask cadence
/// late, rather than early.
/// **Whether the last turn is still running**, read off the transcript's
/// SHAPE and never off the open response alone (bl-2101). The `Streaming`
/// entry rides the open response (REMOTE §5.5), and a response is open only
/// while the model speaks: between a `tool_use` and the response that answers
/// its result — the whole time a tool executes, which is most of a turn's
/// wall time — there is none, and a seat that read *running* off that entry
/// folded the working to its one line under every tool call. So the turn runs
/// until the model's final prose stands or the conversation is wounded: its
/// last entry is the open response, a model entry that called a tool (no
/// result can precede its call, so the LAST entry calling one is a call
/// unanswered), or a tool result the model has yet to answer. Anything else
/// at the end — a model entry with no call in it, a wound, a compaction, a
/// deposit — is a turn at rest. A stop inside a tool window is settled in
/// band and deposits (REMOTE §3.1), so it ends in a deposit and reads settled
/// by this same rule, which is why nothing here asks the conversation row's
/// state; what is left open is a transcript that ends in a result no driver
/// will ever answer and no wound names, and it stands running until the next
/// entry says otherwise.
/// The two words a settled call is said in, on both routes.
pub const RETURNED: &str = "returned";
pub const FAILED: &str = "failed";
/// One entry's rows.
/// **The exit code a result states, and the words after it** (DESIGN §4.48
/// item 2): litany's envelope opens every result it renders with the line
/// `Exit code: N` (its `tool::envelope::render`), so the code is read off
/// the result's own words — and the line leaves the output, since the
/// card's badge is where it is said. A result that opens any other way
/// states no code, and its words stand whole.
/// The words litany's envelope opens a result with.
const EXIT: &str = "Exit code: ";
/// One content block. Reasoning is a **row**, not a spinner: a badge that never
/// grows cannot tell a model thinking hard from a driver that has hung.
///
/// The two halves of a turn go through [`half`], so the committed path obeys
/// the rule the live one states. The other two blocks do not: a tool call with
/// an empty input still happened, and an unreadable block is deliberately blank
/// — dropping either would be the opposite defect, a transcript the operator
/// reads as shorter than it was.