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
//! **What a gesture addresses, one noun down** (REMOTE §8 as amended by
//! bl-49bc, DESIGN §8.5): the *conversation* table over [`Action`] and
//! [`Query`], and the one resolution that turns the needle it answers into an
//! agent **id**. Its own file beside [`super`]'s two nouns, on the seam that
//! module's doc already draws — one table per noun, standing once ahead of each
//! chokepoint's match.
//!
//! **One addressing vocabulary: an id, or the unique stored name a living agent
//! wears.** A `/prompt` receipt answers `{"kind":"started","conversation":
//! "<minted-name>"}` — the minted §3.3 name is all the fire knows, since the
//! root has no id until the detached driver writes `agents/<id>` — so before
//! this resolution existed, that handle composed with `message` (litany's one
//! name-resolving verb) and with nothing else: `/agent` read `present:false`,
//! `/steps` and `/transcript` answered empty rows, `/stop` and `/retarget`
//! refused, and — the dangerous half — `/floor`, `/flag` and `/delete-agent`
//! *succeeded*, writing yog's own policy rows against a string no conversation
//! answers to. A receipt whose handle only one verb accepts is not a receipt.
//!
//! **Names and ids are disjoint spaces, so the resolution never guesses.**
//! Every agent id opens with litany's compact `YYYYMMDDTHHMMSSZ` stamp
//! (ARCH §2.3) and litany refuses a *name* that reads like one at creation, so
//! [`id_shaped`] is a total discriminator on the needle itself. That buys three
//! things at once. An id costs nothing — no enumeration, no existence check, so
//! every seat that already spells one (the window, the inspector, a peer
//! following a `/conversations` row) is untouched, and `delete-agent` keeps
//! admitting the id no ref answers to that litany's §9.2 debris cleanup needs. A
//! name is resolved or **refused**, never passed through as though it were an
//! id — which is the whole defect. And the vocabulary is litany's own, not a
//! second one yog invented (`workspace::agent_name::resolve`: "an exact id match
//! first, else the unique living agent wearing that name"), so a handle that
//! addresses here addresses there.
//!
//! **A legacy display-only name refuses, and that is correct** (bl-8068): the
//! §3.3 ladder's rung two is a `You are <x>.` goal-stamp parse with no stored
//! `name` blob behind it, so no ref answers to it. It renders as a title and it
//! has never been an address; the seats that paint one already hover that fact.
use crateSnapshot;
use crate;
use Path;
/// Resolve the conversation a gesture names to the **agent id** every executor
/// and every derivation keys on, or refuse naming the token.
///
/// `needle` is the table above's answer, so `None` — a gesture that names no
/// conversation — resolves to nothing and no arm reads it: the general path with
/// no input, folded in here rather than spelled at both chokepoints.
///
/// Three rungs, each answering a question the one above it cannot.
///
/// 1. An **id-shaped** needle is an id (module doc): returned untouched, with no
/// enumeration and no existence claim — so every seat that already spells one
/// pays nothing, and `delete-agent` keeps admitting the id no ref answers to
/// that litany's §9.2 debris cleanup needs.
/// 2. Otherwise the **published derivation** ([`Snapshot`]) is asked, because it
/// is the very set every boundary *read* answers from: addressing and
/// answering must not be able to disagree about which conversations there
/// are. It holds foreign and hand-made ids — the ones litany's stamp grammar
/// does not recognize, which rung one cannot see — beside every stored name.
/// 3. Otherwise **disk**, for the conversation no derivation has swept yet
/// (bl-6c9e's barrier, one noun down): a `/prompt` fire returns the instant
/// its detached driver is launched, so the name its receipt hands back is
/// addressable before the next §7.2 pass has read the branch. Reached only
/// when rung two has no answer at all, so the steady state never pays for it.
///
/// An unknown needle refuses and so does an ambiguous one, in the resolver's own
/// words — never a pass-through, which is what let a display name reach `floor`,
/// `flag` and `delete-agent` as though it addressed a conversation.
pub
/// What `needle` addresses **within one enumerated conversation set**: the id it
/// already is, else the id of the unique agent wearing it as a stored name.
/// `Ok(None)` is *this set has no answer* — ask the next rung — and `Err` is one
/// name worn by two living agents, which refuses rather than guessing exactly as
/// two workspace roots sharing a leaf do.
///
/// One rule read over both sets, so the derivation and the disk behind it cannot
/// come to mean different things by the same word.
/// This workspace's conversations as the **published derivation** holds them
/// (§7.2): `(id, stored name)`, the shape [`crate::git_tree::living_agents`]
/// answers in. The stored [`Agent::name`](crate::git_tree::Agent) blob rather
/// than the §3.3 ladder's fold, because the ladder's second rung is a goal-stamp
/// *title* no ref answers to (bl-8068) — it renders, it has never addressed. A
/// workspace with no derived tree answers with none: the general path with empty
/// inputs.
/// Does `needle` read as an agent id — its first `-` segment being litany's
/// compact `YYYYMMDDTHHMMSSZ` stamp (ARCH §2.3)?
///
/// The grammar is [`crate::nav::convs::is_stamp`], the tree's one definition of
/// what an agent id is: the §3.3 ladder's floor reads it, the acceptance naming
/// scan reads it, and now the boundary's addressing does — so what counts as an
/// id cannot come to differ between the seat that paints one and the resolver
/// that accepts one.