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
//! What a SEARCH RECIPE declared: the members it fuses, the towers it binds to them, and the seats
//! a caller broadcasts one question 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, floor = "crate::floors::SEM_TEXT")),
//! tower(image(type = "crate::ClipImage", shared)))]
//! shots: Shots,
//! }
//! ```
//!
//! # FIELDS ARE MEMBERS, which is what deleted the word-count door laws
//!
//! A recipe LISTS what it fuses. A field's NAME is the member's name and its TYPE is the index that
//! member reads, so there is nothing here that mints a name, nothing that counts words to decide how
//! many members a door has, and nothing to trim: the arity is the declaration's own field list. That
//! is the same collapse the tower grammar made one layer down, where fields became steps.
//!
//! # THE MODEL IS ONE CLOCK, and the compiler is the other
//!
//! Everything here is what the DECLARATION SAID. A tower is carried as the TYPE PATH the word
//! named, never as a name this pass mangled out of one and never as a fact it went looking for:
//! whether that type is a tower, what it is asked, what it answers and what knobs it seats are
//! questions only the compiler can answer, and the emission asks them as projections off
//! `DeclaredTower` and `SearchTower` where it can see them. A model that resolved a path would be
//! guessing across the expansion wall — the wall the `Declared…` record family exists to be
//! shouted over.
//!
//! # ABSENCE IS A ROAD at every number here
//!
//! `weight`, `depth`, `limit` and both `floor`s are [`Option`], and [`None`] never means a value
//! this pass invented. It means the declaration named none, and the tier below it answers: the
//! resolution order is request > this recipe > the election's own field > its container > the
//! framework's own number. A model that defaulted a number here would be a recipe silently
//! outranking an election that had a better answer.
use NonZeroU32;
use quote;
use crateDedup;
/// A validated search recipe, ready to emit.
///
/// PLAIN — no `Copy`, no comparison — for [`super::tower::TowerModel`]'s reason: a model is carried
/// once, from the pass that validated it to the pass that emits it.
/// ONE BROADCAST SEAT — the head's `shared(<name>(type = "…"))`.
///
/// The name and the type are the whole of it, and they answer two different parties: the NAME is
/// what an arm writes `shared` against, and the TYPE is what a caller of the whole recipe hands
/// over once.
/// ONE MEMBER — the field, the index it reads, and the defaults the recipe declares for its route.
/// ONE BOUND TOWER — `tower(text(type = "crate::ClipText", shared, floor = "…"))`.
///
/// The arm of a member's question that carries a tower's own question, and the row the emission
/// spends every projection off: what the tower is asked, what it answers, whether its walk is
/// awaited and what it seats are all read through [`ArmModel::tower`] rather than guessed from
/// [`ArmModel::name`].
/// WHERE AN ARM'S QUESTION COMES FROM when the recipe was asked once — the resolved `shared` word.
///
/// Two halves, because the word decides two things: WHICH seat feeds this arm, and HOW the seat's
/// type becomes the tower's question.
/// THE BRIDGE a broadcast seat crosses to reach one arm's question — the word inside `shared`.
///
/// A CLOSED framework vocabulary, because what it names is which of two conversions the emission
/// demands and which of two shapes a hook has. The types on either side are the application's and
/// stay open; the crossing is the framework's.
///
/// The variants are NOT called `From` and `TryFrom`, and the reason is measured rather than stylistic
/// — see the runtime record's own `Bridge`, whose note carries the six goldens that moved on that
/// word. One vocabulary across the two crates, so the reason lands once and the names never diverge.