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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
//! What a SEARCH RECIPE is, for the readers that cannot see its tokens.
//!
//! A recipe is layer ⑥ — the only grain a QUESTION has — and its whole content is a list of members,
//! the towers bound to them, and the seats one question is broadcast into:
//!
//! ```ignore
//! #[ingraph::search(shared(text(type = "String")), dedup(hash), limit = 20)]
//! pub struct TravelSearch {
//! #[ingraph(weight = 1.0, depth = 50, tower(zh(type = "crate::ZhQuery", shared)))]
//! subs: Subs,
//! #[ingraph(weight = 2.0, depth = 100,
//! tower(text(type = "crate::ClipText", shared)))]
//! shots: Shots,
//! }
//! ```
//!
//! # THE RECORD IS WHAT CROSSES THE WALL
//!
//! [`DeclaredTower`](crate::DeclaredTower)'s shape one layer up, and it exists for the same wall:
//! two macro expansions cannot read each other, so a recipe STATES its facts as a trait impl and
//! whoever needs them NAMES them through a projection. A graph root mounting
//! `#[ingraph(search)] travel: TravelSearch` sees a TYPE and nothing else.
//!
//! # WHAT IS HERE, AND WHAT DELIBERATELY IS NOT
//!
//! Everything on these rows is a NAME or a NUMBER, and that is the const grain rather than an
//! omission. A member's index and an arm's tower are TYPES, and a type is what the recipe's own
//! emitted bounds name — where the compiler can check it — so what a reader of this record does with
//! a member is name its ROW: the fold term it contributes, the evidence variant it fills, the schema
//! row it publishes. The same division [`Step`](crate::Step) already makes one layer up, where a
//! step carries its field name and never its server.
//!
//! A declared FLOOR is the one fact that is a value and still cannot travel: it is a const in the
//! ENGINE's own currency, an open type with no seat on a shared row, so a row carries the fact that
//! one was named and the recipe's own emission spends the const itself.
use ;
/// **WHAT ONE BROADCAST BECOMES**, at a seat — the crossing a recipe's `shared(…)` seat takes to
/// reach one member's question.
///
/// ```ignore
/// impl SharedQuestion<TravelSearchTextSeat, String> for ShotsFuseQuestion {
/// fn from_shared(asked: &String) -> Option<Self> { … }
/// }
/// ```
///
/// # `Seat` is a MARKER, and it is what lets one question read TWO broadcasts
///
/// A recipe may declare several seats, and one member may be reachable from more than one of them —
/// a text seat and a raw-coordinates seat both landing on the same question. Keying the crossing on
/// the seat's own marker type is what keeps those two impls from colliding, where a bare
/// `From<String>` would have made *which broadcast this is* unstatable. The marker is minted by the
/// recipe, one per declared seat, and is never a value anybody holds.
///
/// # SEVERAL SEATS ARE MODES, and a companion value is NOT one of them
///
/// A published recipe's seats become the query field's `@oneOf`: a client fills EXACTLY ONE, and the
/// members whose arms bought that seat answer the request. So a second seat says *this is another
/// way to ask*, and filling it means NOT filling the first.
///
/// A value that rides WITH a question — a language tag, a locale, a caller's own hint — is therefore
/// a FIELD OF A SEAT'S OWN TYPE and never a seat beside it. Written as a seat it would be unaskable
/// beside the question it belongs to. That is why no language, locale or hint vocabulary appears
/// anywhere in this framework: what carries one is the application's own seat type, crossing into a
/// tower's question through the bridge the arm already declared.
///
/// # `Option` IS THE ANSWER, and [`None`] is a structural absence
///
/// A member that cannot be built from this broadcast is not an error: it is not walked, which is
/// [`participates`](super::participates)' own law read one layer up. So the honest empty is
/// [`None`] rather than a refusal a client would have to read as *nothing went wrong*.
///
/// # THE TOTAL FACE, whose twin is [`TrySharedQuestion`]
///
/// This one cannot fail. A crossing that can says so with the other trait, and the blanket below is
/// what makes every total crossing usable at a fallible seat — so a consumer names ONE face and
/// both kinds of author reach it.
/// **THE FALLIBLE TWIN** of [`SharedQuestion`] — the crossing a `shared(try)` arm demands, and the
/// ONE face a door consumes.
///
/// # Every total crossing is a fallible one, by blanket
///
/// [`Error`](Self::Error) is [`Infallible`] there, so a door written against this trait alone reaches
/// an author who implemented either. That is the same one-face discipline the fusion tree already
/// keeps: a consumer that had to ask *which of two traits did this author write* would be asking a
/// question no projection can answer.
/// **WHAT ONE SEARCH RECIPE DECLARED** — the facts its own expansion states, for the readers that
/// cannot see its tokens.
///
/// ```ignore
/// impl DeclaredSearch for TravelSearch {
/// const SEATS: &'static [Seat] = &[Seat::of("text")];
/// const MEMBERS: &'static [Member] = &[
/// Member::of("subs").weighted(1.0).deep(50).bound(&[Binding::of("zh").shared(Bridge::Total)]),
/// Member::of("shots").weighted(2.0).bound(&[Binding::of("text").shared(Bridge::Total)]),
/// ];
/// const LIMIT: Option<NonZeroU32> = NonZeroU32::new(20);
/// }
/// ```
///
/// # What each seat is FOR
///
/// A reader that mounts a recipe has three questions its own tokens cannot answer, and this row
/// answers all three: which questions a caller may broadcast into it ([`SEATS`](Self::SEATS)), which
/// members it fuses and what each declared about its route and its arms
/// ([`MEMBERS`](Self::MEMBERS), in declaration order — the order the fold takes its terms in), and
/// how many roots its door answers when nothing asks ([`LIMIT`](Self::LIMIT)).
///
/// # It is a PUBLIC seam
///
/// Every seat is defaulted, so a hand-written recipe joins with `impl DeclaredSearch for MySearch {}`
/// and states the honest nothing. A recipe is not obliged to be generated to be mounted.
/// ONE BROADCAST SEAT, as the recipe's head declared it.
///
/// The NAME is the whole row, and it is enough for what a reader does with a seat: a seat feeds the
/// arms that share its name, so holding the name is holding the pairing.
/// ONE DECLARED MEMBER, as the recipe wrote it.
///
/// The per-field facts of the recipe grammar in the shape a reader spends them: which field, what it
/// declared about its route, and which towers it bound.
///
/// # Absence is a DEFERRAL at every number
///
/// [`None`] never means a value this row invented. [`weight`](Self::weight) absent is the
/// multiplicative identity — [`Route::DEFAULT_WEIGHT`](crate::Route::DEFAULT_WEIGHT), so a recipe
/// where nobody weighted anything runs the unweighted fold exactly — and [`depth`](Self::depth)
/// absent defers to the caller's own budget, which is
/// [`route_depth`](crate::route_depth)'s law and not this row's.
/// ONE BOUND TOWER, as the member's `tower(…)` word wrote it.
///
/// # It is the BINDING, and `arm` is what it MINTS
///
/// Two words, one row, and each is the right one on its own side. The theorem net calls this edge a
/// BINDING — *binding ↔ tower*, *binding ↔ member*, the two demands the recipe's emission states
/// about it — and the WIRE calls what it mints an arm, one variant of its member's question. The row
/// is named for the edge and its [`name`](Self::name) is the arm's, which is also the seat it may
/// read.
///
/// The TOWER is not here, for the module note's reason: it is a type, and a type is what the
/// recipe's own emitted bounds name.
/// HOW A BROADCAST SEAT CROSSES into one arm's question — the word the arm's `shared` was written
/// with.
///
/// A CLOSED framework vocabulary, and closed for the reason the framework-open discipline names: what
/// it distinguishes is which of two conversions the emission DEMANDS and which of two shapes a hook
/// has, and both of those are the framework's own crossings. The types on either side stay entirely
/// the application's.
///
/// A hook's PATH is not here for the module note's reason: it names an item, and the recipe's own
/// emission is what calls it.
///
/// # The variants are NOT called `From` and `TryFrom`, and the reason is MEASURED
///
/// The obvious names would be the traits the first two demand. They cost too much: rustc prints the
/// SHORTEST UNAMBIGUOUS path for a type in a diagnostic, and a publicly exported `Bridge::From` makes
/// the bare name ambiguous for every crate that links this one — so `the trait `From<X>` is not
/// implemented` becomes `std::convert::From<X>` in messages that have nothing to do with search. It
/// was measured, not feared: six of this workspace's own refusal goldens moved on that word alone,
/// each by exactly that substitution. The names here say what each crossing IS, and the docs name the
/// trait each demands.