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
//! The **step spine** — every operable commit a conversation has, and what
//! hangs off each one (VISION V1, the Historian rung; DESIGN §11).
//!
//! One **notch** per step, each notch that step's read-state commit — the
//! branch tip the model call was assembled against, already recorded in
//! `meta.json` and already read by the Steps view (§5.1 #29). Selecting a notch
//! **pins** the whole inspector to that commit (the [`pin`] submodule):
//! transcript as of, agent-context files as of, the config it resolves, budget folded
//! to that point.
//!
//! **The spine is drawn through the chat, not beside it** (bl-1802). It used to
//! be a `SidePanel` gutter of notches; the operator's ruling retired that seat:
//! *"every operable commit should be a horizontal rule across the chat, instead
//! of a window on the side. the fork overlay should show up when you click on
//! one."* The transcript was already drawing one faint rule per commit boundary
//! (§5.1 #29) — the same commits, from the same `meta.json`, rendered twice —
//! so the rule **is** the notch, and the gutter is gone. Each notch's seat in
//! the chat is its [`Place`], derived by the [`place`] submodule; the painting
//! is `transcript::spine`.
//!
//! **Two edges, one rendering** (VISION V1.3). A child's *context* edge — what
//! it inherited — is git ancestry; its *provenance* edge — who dispatched it —
//! is the descent id plus the parent-transcript notch where the dispatch
//! landed. A clean child (`litany dispatch --from config/<name>`) has
//! provenance only. The taxonomy is intact and still derived here; what it is
//! **drawn** as changed with the seat. A gutter had room for two strokes, solid
//! and dashed; a rule across a chat has no gutter to stroke in — and the fact
//! those strokes drew is already stated in words by the card's own fork label
//! (`from here` / `from <Name>@<oid>` carry ancestry, `from config/<name>`
//! carries provenance alone). Two renderings of one fact is one too many
//! (single source of truth), so the words survived the move and the strokes did
//! not. §11's descent tree stays the descent-**id** tree either way (§5.1 #8).
//!
//! **Both edges are derived, and neither costs a git call.** An agent's
//! `steps` list is `git log --first-parent <branch> --not --branches=config/*`
//! (§5.1 #8), so a *fork* child's list opens with the parent's own commits up
//! to the fork point and a *clean* child's shares nothing with it. The longest
//! common prefix of the two lists therefore **is** the fork point, and its
//! emptiness **is** cleanness — both read off facts the snapshot already
//! carries. The dispatch notch is located the same way for both kinds: the
//! last notch whose commit is no later than the child's own first commit.
//!
//! Everything here is a pure read of the litany workspace repo — refs, trees,
//! commits — derived, never pushed (VISION V1.6). The card updates on the
//! ordinary fs_watcher + off-thread snapshot read like every other §5.1
//! derivation, and the frame renders snapshots only.
//!
//! Burden check, verbatim from VISION V1: *"no dispatches → no cards, no
//! edges; the rail collapses to today's transcript for anyone who never clicks
//! a notch — the S0 stranger sees today's transcript exactly."* It needs no
//! `navigable` gate any more, and that gate is deleted: the rules the chat
//! draws are the ones bl-929d already shipped, so a conversation nobody forked
//! from paints exactly what it painted before — one faint line per commit
//! boundary, now clickable — and no cards, because there are none.
use BTreeMap;
use crate;
use crateStepsView;
use crateTranscript;
pub
pub
pub use ;
pub use ;
pub use Place;
pub use ;
/// Short-oid width, git's own default — the width the Steps list's Commit
/// column and the transcript's boundary rules already wear.
pub const SHORT_OID: usize = 7;
/// What a notch shows when its step recorded no read-state commit: the call is
/// in flight, or died before `meta.json`. Absence is said, never guessed.
const NO_COMMIT: &str = "—";
/// One notch: a step, and the read-state commit its model call was assembled
/// against. `commit` is `None` for a step that landed no `meta.json` — such a
/// notch is a point on the spine but not a pinnable one, because there is
/// no tree to pin to.
/// The live inline card at a dispatch notch (VISION V1.4): who the child is,
/// where it forked from, what it is doing, what it has spent, and the last of
/// its in-flight inference text. `provenance_notch` is the notch the card hangs
/// from — the rule in the chat where this child was born. The *context* edge is
/// not a second field: it is what [`ChildCard::fork`] says in words, and a
/// stored index nothing reads would be that fact's second home.
/// The spine: the parent's notches, and the cards hanging off them.
/// What [`build`] needs about one child, all of it already on the snapshot
/// (`Agent`) or already folded for another seat. Owned, so the rail holds the
/// whole card in hand and borrows nothing from the tree beneath it.
/// Derive the spine for one focused agent. `parent_name` labels a fork point
/// that is not a notch; `parent_commits` is the parent's `Agent::steps`, whose
/// order gives every notch commit a position; `steps` supplies the notches;
/// `transcript` gives each notch its seat in the chat ([`place`]); `children`
/// are the parent's direct descent-id children.