ingraph-codegen 0.1.0

The emission engine behind ingraph-derive: a plain declaration model in, the ingraph framework faces out.
Documentation
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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
//! **THE RECIPE'S QUERY UNIT** — the two fields a dressed recipe publishes, the answer pair they
//! answer with, and the union that carries which members agreed.
//!
//! ```text
//! #[ingraph::search(shared(text(type = "String")), limit = 20, graphql(async_graphql))]
//! pub struct TravelSearch { subs: Subs, shots: Shots }
//! ```
//!
//! mints
//!
//! ```graphql
//! type Query {
//!   travelSearchKeys(text: String!, first: Int! = 20, depth: Int): [TravelSearchKeyMatch!]!
//!   travelSearch(    text: String!, first: Int! = 20, depth: Int): [TravelSearchMatch!]!
//! }
//!
//! type TravelSearchKeyMatch { node: KeyframeKey!, score: Float!, evidence: [TravelSearchSighting!]! }
//! type TravelSearchMatch    { node: Keyframe!,    score: Float!, evidence: [TravelSearchSighting!]! }
//!
//! union TravelSearchSighting = TravelSearchSubsSighting | TravelSearchShotsSighting
//! type TravelSearchSubsSighting  { score: f32!,  ordinal: Int!, contribution: Float! }
//! type TravelSearchShotsSighting { score: f32!,  ordinal: Int!, contribution: Float! }
//! ```
//!
//! # THE TIER NOUN IS THE NAME, and the bare name is the HYDRATED twin
//!
//! `{subject}{tier?}` — the retrieving family's own naming law (`Field::derived`) with the election
//! position empty, because a recipe HAS no election: the recipe IS the semantic name, which is what
//! *multiple recipes over one set of members, each a semantic wire name* means. So the keys field
//! wears the `Keys` noun and the hydrated one is the bare recipe, exactly as `shotsByClipKeys` and
//! `shotsByClip` are one grain down.
//!
//! # THE EVIDENCE IS A UNION, and the recipe's variants are NESTED where an index's are flat
//!
//! An index's per-leg sighting carries that leg's engine `Score`. A recipe's carries the MEMBER's own
//! evidence, whole and unopened — which is a whole tier's provenance rather than a number — and that
//! is the one structural difference between the two grains. The three rows are the same three:
//!
//! * `score` — the MEMBER's own currency, crossing as itself through `WireScore`;
//! * `ordinal` — the rank that member gave the root, in its own stream;
//! * `contribution` — `weight × 1/(k + rank)`, the fold's own arithmetic, one type however many
//!   currencies met.
//!
//! **The three come off the fold's own [`Sighting`], carried and never recomputed.** The Rust
//! evidence already holds them: `Fused::evidence` is `&[Sighting<V>]`, and what this emission does is
//! move each entry into the union arm its member names. Nothing here computes a number.
//!
//! # THE THREE SEAMS this face reaches its members through
//!
//! A resolver cannot be generic and cannot see a member's declaration, so what it needs of a member
//! arrives as projections off three OPEN traits, all three implemented by the member (or its root
//! key) and none of them named by this recipe's author:
//!
//! | seam | what it answers |
//! |---|---|
//! | `FusedEngine::Engine` | WHICH engine a schema asks this member through, so the call is concrete |
//! | `FusedCitizen::asking_position` | the slot, the read scope, the floor and the knobs, out of the schema's own citizens |
//! | `WireRoot::address` / `::hydrate` | what the answered root becomes in each of the two published tiers |
//!
//! # THE QUESTION arrives through the BROADCAST and nothing else
//!
//! ONE argument, and the member questions are CROSSED from it — `TrySharedQuestion<Seat, SeatTy>`,
//! the §7 crossing, with the seat's own marker type keying it. A member that answers `None` is
//! structurally absent from the request, which is `participates`' law read at the wire.
//!
//! # SEVERAL SEATS MAKE THAT ARGUMENT A CHOICE
//!
//! A recipe with one seat publishes the seat itself — `travelSearch(text: String!, …)` — and that is
//! this face byte for byte as it was. A recipe with SEVERAL publishes `<Recipe>AskInput`, an `@oneOf`
//! with one field per seat under the seat's OWN word, so `text: "harbour"` becomes
//! `ask: { text: "harbour" }`:
//!
//! ```graphql
//! input TravelSearchAskInput @oneOf { text: String, code: SkuRef }
//! travelSearch(ask: TravelSearchAskInput!, first: Int! = 20, depth: Int): [TravelSearchMatch!]!
//! ```
//!
//! The seats are MODES. The client fills exactly one — the library's own rule, refused in the
//! library's own words — and the members whose arms bought THAT seat answer the request. Every other
//! member is left unasked, so it fills no question slot and the fold's per-member read skips it: the
//! same structural absence the crossing's `Ok(None)` already meant, reached one step earlier. No
//! arriving variant can reach zero members, because a seat no member reaches is refused at the word.
//!
//! The other three arguments do not notice: `first`, `depth` and `pageToken` ride the same positions
//! in both shapes, and a resumed stretch names no seat at all — a captured snapshot already knows
//! which members made it.
//!
//! # AND A BOUND MEMBER'S QUESTION IS WALKED OUT OF IT
//!
//! This note used to say the opposite, and the sentence is worth keeping in view: a tower's `walk`
//! is an inherent fn whose arity is its step count and a recipe's expansion cannot see the steps, so
//! an arm's question could not be produced here and the crossing spent the seat's own type. What
//! closed it is the UNIFORM RUN — fixed arity, on the far side of the trait the tower macro
//! implements — and the door a deployment installs the assembled road in.
//!
//! So a member that binds a tower now crosses from `<Tower as SearchTower>::Answer`, which is the
//! very obligation `super::bind` has always demanded and nothing ever called. The road is: the
//! broadcast → the arm's bridge → the installed road, minted for this read → the tower's answer →
//! the member's own question. A member that binds NO tower crosses from the broadcast exactly as it
//! did, which is the absence-identity this face keeps at the recipe grain.
//!
//! **Two boundaries stay, and both are measured.** A member may bind ONE producing arm PER SEAT,
//! because the road ends in one value and two answers cannot both be one question — refused at the
//! word, in the derive. And a tower's KNOBS reach only tier two, the deployment's — see the `walked`
//! emitter's own note below, where the 2026-08-27 census of that boundary is written out.
//!
//! [`Sighting`]: https://docs.rs/ingraph

use heck::ToUpperCamelCase as _;
use quote::{format_ident, quote, quote_spanned};

use super::{ArmModel, MemberModel, SearchModel, SeatModel, SharedBinding, SharedBridge};
use crate::emit::{framework, leading, lower_initial, respan, snake, vendored};

#[cfg(test)]
mod tests;

impl SearchModel {
  /// The WIRE CITIZENSHIP a dressed recipe mints — the unit, the seat, the answer family and the
  /// two resolvers — or nothing at all for a recipe that named no backend.
  #[must_use]
  pub(super) fn wire(&self) -> proc_macro2::TokenStream {
    if !self.mounts() {
      return proc_macro2::TokenStream::new();
    }
    let SearchModel { krate, vis, .. } = self;
    let recipe = &self.name;
    let unit = self.unit_name();
    let face = framework(krate, &["transform"], "Graphql");
    let gate = framework(krate, &["gate"], "if_async_graphql");
    let prelude = crate::emit::wire::prelude();
    let choice = self.ask_input();
    let types = self.answer_types();
    let faces = self.answer_faces();
    let ask = self.ask_fn();
    let stretch = self.stretch_fn();
    let fields = self.query_fields();
    let asked_demand = self.asked_demand();
    let unit_sdl = unit.to_string();
    let ag = framework(krate, &[], "async_graphql");
    let shelf = vendored(krate, "async_graphql");
    let unit_doc = leading(&format!(
      "The root fields [`{recipe}`] answers — its fused read, in both tiers, as one mountable \
       value.\n\nMounted by folding it into a graph's root query; it holds nothing and reaches every \
       member's store through the citizens the schema was built with."
    ));
    quote! {
      #[doc = #unit_doc]
      #[derive(
        ::core::fmt::Debug,
        ::core::clone::Clone,
        ::core::marker::Copy,
        ::core::default::Default,
      )]
      #vis struct #unit;

      #[automatically_derived]
      impl #face for #recipe {
        // THE EMPTY PRODUCT ON BOTH RECORD-SHAPED HALVES, which is the retrieving family's answer one
        // grain down: a recipe is asked by no predicate and ordered by no column — its request
        // surface is the broadcast and the two numbers, and its answer surface is what its door
        // handed back.
        type Input = ();
        type Output = ();
        type Query = #unit;
      }

      #gate! {
        #choice

        #types

        // THE REQUEST FACE'S OWN DEMAND, outside the const and before everything: a `()`-faced
        // tower is told the one line to write at the `type = "…"` word that bound it, rather than
        // through async-graphql's own bound failing inside the emitted `#[Object]`.
        #asked_demand

        const _: () = {
          #prelude

          #ask

          #stretch

          #faces

          #[#ag::Object(crate = #shelf, name = #unit_sdl)]
          impl #unit {
            #fields
          }
        };
      }
    }
  }

  /// `<Recipe>Queries` — the unit a root folds.
  ///
  /// No word of its own: the unit is a Rust type a root spells once and a schema never sees, so its
  /// name is the recipe's, which is the record unit's own precedent.
  pub(super) fn unit_name(&self) -> syn::Ident {
    format_ident!("{}Queries", self.name)
  }

  /// The UNION a hit's evidence list holds.
  fn sighting_name(&self) -> syn::Ident {
    format_ident!("{}Sighting", self.name)
  }

  /// ONE MEMBER's arm of that union.
  fn member_sighting_name(&self, member: &MemberModel) -> syn::Ident {
    format_ident!(
      "{}{}Sighting",
      self.name,
      member.field.to_string().to_upper_camel_case()
    )
  }

  /// The KEYS tier's match — the address as it stands.
  ///
  /// `Match` and not `Hit`, on the 2026-08-18 alignment ruling: the family's noun is the one
  /// `graphql::Match` already wears one grain down, and this pair landed with the older vocabulary.
  /// Unpublished, so the sweep is the whole of the migration.
  ///
  /// The PAIR stays two emitted types where the framework's own row collapsed to one on 2026-08-19,
  /// and the asymmetry is real rather than an oversight: `graphql::Match<N, S>` is generic, so its
  /// two tiers are two instantiations of one `#[Object]`, while these two are CONCRETE structs a
  /// recipe mints — a recipe's tiers carry different ROWS, not merely a different node type, so
  /// neither could be the other at any instantiation.
  fn key_match_name(&self) -> syn::Ident {
    format_ident!("{}KeyMatch", self.name)
  }

  /// The HYDRATED tier's match — the row the address points at.
  fn match_name(&self) -> syn::Ident {
    format_ident!("{}Match", self.name)
  }

  /// The PAGED tier's answer — one stretch of a kept ranking, and the claim on the next.
  ///
  /// `Stretch` and not `Page` or `Connection`: those two are the RECORD tier's words for a keyset
  /// walk over a live table, and this is a walk over a ranking the deployment is holding. The word
  /// is the retrieve tier's own — the single-shot note called the next piece of a ranking a stretch
  /// before there was a keeper to cut one.
  fn stretch_name(&self, keys: bool) -> syn::Ident {
    if keys {
      format_ident!("{}KeyStretch", self.name)
    } else {
      format_ident!("{}Stretch", self.name)
    }
  }

  /// The SDL field name of one paged tier — `travelSearchKeysStretch` and `travelSearchStretch`.
  ///
  /// The unpaged tier's own word with the answer's noun after it, so the four fields a recipe
  /// publishes read as two pairs rather than four names.
  fn stretch_field_name(&self, keys: bool) -> String {
    format!("{}Stretch", self.field_name(keys))
  }

  /// The private entry both paged resolvers run — one keeper, one arbitration, one cut.
  fn stretch_fn_name(&self) -> syn::Ident {
    format_ident!("__ingraph_{}_stretch", snake(&self.name.to_string()))
  }

  /// The private entry both resolvers run — one fold, two answers.
  fn ask_name(&self) -> syn::Ident {
    format_ident!("__ingraph_{}_ask", snake(&self.name.to_string()))
  }

  /// The SDL field name of one tier — `travelSearchKeys` and `travelSearch`.
  ///
  /// `{subject}{tier?}`, which is the retrieving family's `{subject}{road?}By{election}{tier?}` with
  /// the two positions a recipe has nothing to put in left out.
  fn field_name(&self, keys: bool) -> String {
    let subject = lower_initial(&self.name.to_string());
    if keys {
      format!("{subject}Keys")
    } else {
      subject
    }
  }

  /// `<Recipe>AskInput` — the `@oneOf` a SEVERAL-SEAT recipe's four fields are asked through.
  ///
  /// The `…Input` noun is the fusion tree's own for a choice a client BUILDS — `<Stem>EngineInput` is
  /// the same shape one grain down, an enum of typed words published as an object of exactly one key
  /// — and `Ask` is the recipe family's own verb for what a client does to a recipe.
  ///
  /// Minted only where the recipe chooses: a single-seat recipe names its seat's type directly, and a
  /// type nobody can reach would be a name in the schema for nothing.
  fn ask_input_name(&self) -> syn::Ident {
    format_ident!("{}AskInput", self.name)
  }

  /// ONE SEAT's variant in that choice — the seat's own word, in the enum's casing.
  fn seat_variant(seat: &SeatModel) -> syn::Ident {
    format_ident!("{}", seat.name.to_string().to_upper_camel_case())
  }

  /// The WORD one seat is filled under, and it is the SAME word in both shapes.
  ///
  /// A single-seat recipe spells it as the argument; a choosing one spells it as a field of the
  /// `@oneOf`. So `text: "harbour"` becomes `ask: { text: "harbour" }` and a client that learnt the
  /// seat learnt the only word that matters.
  fn seat_word(seat: &SeatModel) -> String {
    crate::name::RustSafeName::from_ident(&seat.name)
      .external()
      .to_owned()
  }

  /// **THE TYPE THE PUBLISHED QUESTION ARGUMENT HAS** — the seat's own where there is one seat, and
  /// the choice over all of them where there are several.
  fn broadcast_ty(&self) -> proc_macro2::TokenStream {
    if self.chooses() {
      let choice = self.ask_input_name();
      return quote!(#choice);
    }
    let seat = &self.seats[0].ty;
    quote!(#seat)
  }

  /// **THE WORD THAT ARGUMENT IS WRITTEN UNDER** — the seat's own, or `ask` for the choice.
  fn broadcast_word(&self) -> String {
    if self.chooses() {
      return ASK.to_owned();
    }
    Self::seat_word(&self.seats[0])
  }

  /// The RUST parameter that argument arrives in — derived from the word, so the two cannot drift.
  fn broadcast_binding(&self) -> syn::Ident {
    crate::method::wire_method(&format_ident!("{}", snake(&self.broadcast_word())))
  }

  /// The ENGINE one member is asked through, as the projection that names it.
  fn engine(&self, member: &MemberModel) -> proc_macro2::TokenStream {
    let named = framework(&self.krate, &["graphql"], "FusedEngine");
    let ty = &member.ty;
    quote!(<#ty as #named>::Engine)
  }

  /// One member's `AsyncFusedRead` face at the engine a schema asks it through.
  fn read_at(&self, member: &MemberModel) -> proc_macro2::TokenStream {
    let read = framework(&self.krate, &["retrieve"], "AsyncFusedRead");
    let engine = self.engine(member);
    quote!(#read<#engine>)
  }

  /// The ROOT every member of this recipe agrees about, read off the FIRST member.
  ///
  /// One member and not a fold over all of them: the door's own `Root = K` bound is what proves the
  /// rest agree, and it reports as `E0271` at the call. Naming every member's here would be the same
  /// obligation stated twice, in a place where the second copy could only ever repeat the first.
  fn root(&self) -> proc_macro2::TokenStream {
    let first = &self.members[0];
    let ty = &first.ty;
    let read = self.read_at(first);
    quote!(<#ty as #read>::Root)
  }

  /// The ADDRESS that root is published as — the keys tier's own row.
  fn address(&self) -> proc_macro2::TokenStream {
    let wire = framework(&self.krate, &["graphql"], "WireRoot");
    let root = self.root();
    quote!(<#root as #wire>::Address)
  }

  /// The hydrated form of that root — the hydrated tier's own row.
  fn entity(&self) -> proc_macro2::TokenStream {
    let wire = framework(&self.krate, &["graphql"], "WireRoot");
    let root = self.root();
    quote!(<#root as #wire>::Entity)
  }

  /// ONE MEMBER's own evidence, whole — what its union arm carries.
  fn evidence_of(&self, member: &MemberModel) -> proc_macro2::TokenStream {
    let ty = &member.ty;
    let read = self.read_at(member);
    quote!(<#ty as #read>::Evidence)
  }

  /// **THE `@oneOf` A CHOOSING RECIPE IS ASKED THROUGH** — one field per declared seat, exactly one
  /// filled, and NOTHING AT ALL where the recipe declares a single seat.
  ///
  /// Written out against `async_graphql::OneofObject`'s own expansion rather than derived, for the
  /// reason every wire face in this family is written out: a derive is attached to a DECLARATION, and
  /// this one lands inside a gate whose predicate no declaring crate can name. What that expansion is
  /// — `oneof: true` in the meta type, one nullable input field per variant, a parse that admits an
  /// object of EXACTLY ONE key, and the two marker impls a `@oneOf` carries beside `InputType` — is
  /// the election road's own `@oneOf`, mirrored word for word one grain up.
  ///
  /// # The exactly-one rule is the LIBRARY's, and so is what a client reads when it is broken
  ///
  /// An object naming two seats is two requests and an object naming none is not a choice. Neither
  /// reaches this recipe's code at all: the parse refuses before a resolver runs, in async-graphql's
  /// own words about this input type, which is what keeps one sentence for a rule one library owns.
  ///
  /// # It derives NOTHING, and that is the additive law read at the derive list
  ///
  /// The election's `@oneOf` carries `Debug`/`Clone`/`PartialEq` because its variants hold packages
  /// that emission MINTED. These hold the APPLICATION's own seat types, and a single-seat recipe asks
  /// nothing of a seat type but `InputType` — so a derive here would be an obligation the choice
  /// invented, landing on authors who only added a second way to ask.
  fn ask_input(&self) -> proc_macro2::TokenStream {
    if !self.chooses() {
      return proc_macro2::TokenStream::new();
    }
    let krate = &self.krate;
    let vis = &self.vis;
    let ag = framework(krate, &[], "async_graphql");
    let recipe = &self.name;
    let name = self.ask_input_name();
    let sdl = name.to_string();
    let declared = self.seats.iter().map(|seat| {
      let variant = Self::seat_variant(seat);
      let ty = &seat.ty;
      let doc = leading(&format!(
        "Asking [`{recipe}`] at its `{seat}` seat — the members whose arms bought `{seat}` answer, \
         and every other member of this recipe is absent from the request.",
        seat = seat.name,
      ));
      quote! {
        #[doc = #doc]
        #variant(#ty)
      }
    });
    let entries = self.seats.iter().map(|seat| {
      let ty = &seat.ty;
      let word = Self::seat_word(seat);
      quote! {
        __ingraph_fields.insert(
          ::std::string::String::from(#word),
          #ag::registry::MetaInputValue {
            name: ::std::string::String::from(#word),
            description: ::core::option::Option::None,
            ty: <::core::option::Option<#ty> as #ag::InputType>::create_type_info(
              __ingraph_registry,
            ),
            deprecation: #ag::registry::Deprecation::NoDeprecated,
            default_value: ::core::option::Option::None,
            visible: ::core::option::Option::None,
            inaccessible: false,
            tags: ::std::vec::Vec::new(),
            is_secret: false,
            directive_invocations: ::std::vec::Vec::new(),
          },
        );
      }
    });
    // EXACTLY ONE KEY, which is the whole of what `@oneOf` means: an object naming two seats is two
    // requests, and an object naming none is not a choice.
    let reads = self.seats.iter().map(|seat| {
      let variant = Self::seat_variant(seat);
      let word = Self::seat_word(seat);
      quote! {
        if #ag::indexmap::IndexMap::contains_key(&__ingraph_object, #word)
          && __ingraph_object.len() == 1
        {
          let __ingraph_filled = #ag::InputType::parse(
            #ag::indexmap::IndexMap::swap_remove(&mut __ingraph_object, #word),
          )
          .map_err(#ag::InputValueError::propagate)?;
          return ::core::result::Result::Ok(Self::#variant(__ingraph_filled));
        }
      }
    });
    let writes = self.seats.iter().map(|seat| {
      let variant = Self::seat_variant(seat);
      let word = Self::seat_word(seat);
      quote! {
        Self::#variant(__ingraph_filled) => {
          __ingraph_map.insert(
            #ag::Name::new(#word),
            #ag::InputType::to_value(__ingraph_filled),
          );
        }
      }
    });
    let doc = leading(&format!(
      "HOW a request asks [`{recipe}`] — one field per declared seat, and a request fills exactly \
       one.\n\nThe seats are MODES rather than parts of one question: the members whose arms bought \
       the filled seat answer the request, and the rest are structurally absent from it. A value \
       that rides WITH a question — a language, a locale — is a field of a seat's own TYPE and never \
       a seat beside it, because filling one seat means not filling the others."
    ));
    quote! {
      #[doc = #doc]
      #vis enum #name {
        #(#declared,)*
      }

      const _: () = {
        #[automatically_derived]
        impl #ag::InputType for #name {
          type RawValueType = Self;

          #[inline]
          fn type_name() -> ::std::borrow::Cow<'static, ::core::primitive::str> {
            ::std::borrow::Cow::Borrowed(#sdl)
          }

          fn create_type_info(
            __ingraph_registry: &mut #ag::registry::Registry,
          ) -> ::std::string::String {
            __ingraph_registry.create_input_type::<Self, _>(
              #ag::registry::MetaTypeId::InputObject,
              |__ingraph_registry| #ag::registry::MetaType::InputObject {
                name: ::std::string::String::from(#sdl),
                description: ::core::option::Option::None,
                input_fields: {
                  let mut __ingraph_fields = #ag::indexmap::IndexMap::new();
                  #(#entries)*
                  __ingraph_fields
                },
                visible: ::core::option::Option::None,
                inaccessible: false,
                tags: ::std::vec::Vec::new(),
                rust_typename: ::core::option::Option::Some(::core::any::type_name::<Self>()),
                oneof: true,
                directive_invocations: ::std::vec::Vec::new(),
              },
            )
          }

          fn parse(
            __ingraph_value: ::core::option::Option<#ag::Value>,
          ) -> #ag::InputValueResult<Self> {
            if let ::core::option::Option::Some(#ag::Value::Object(mut __ingraph_object)) =
              __ingraph_value
            {
              #(#reads)*
              return ::core::result::Result::Err(#ag::InputValueError::expected_type(
                #ag::Value::Object(__ingraph_object),
              ));
            }
            ::core::result::Result::Err(#ag::InputValueError::expected_type(
              ::core::option::Option::unwrap_or_default(__ingraph_value),
            ))
          }

          fn to_value(&self) -> #ag::Value {
            let mut __ingraph_map = #ag::indexmap::IndexMap::new();
            match self {
              #(#writes)*
            }
            #ag::Value::Object(__ingraph_map)
          }

          #[inline]
          fn as_raw_value(&self) -> ::core::option::Option<&Self::RawValueType> {
            ::core::option::Option::Some(self)
          }
        }

        #[automatically_derived]
        impl #ag::InputObjectType for #name {}

        #[automatically_derived]
        impl #ag::OneofObjectType for #name {}
      };
    }
  }

  /// The DECLARATIONS the answer family lands: one sighting per member, the union over them, and one
  /// hit per tier.
  ///
  /// Inside the binding gate, unlike a retrieving declaration's — and the difference is measured
  /// rather than stylistic. An index's answer types are shaped by ENGINE projections, which exist in
  /// every build; a recipe's are shaped by `FusedEngine` and `WireRoot`, which are the wire's own
  /// seams and exist only behind the binding. A declaration outside the gate would name a trait that
  /// is not there.
  fn answer_types(&self) -> proc_macro2::TokenStream {
    let vis = &self.vis;
    let sighting = self.sighting_name();
    let key_match = self.key_match_name();
    let hydrated_match = self.match_name();
    let key_stretch = self.stretch_name(true);
    let hydrated_stretch = self.stretch_name(false);
    let root = self.address();
    let entity = self.entity();
    let recipe = &self.name;
    let members: Vec<syn::Ident> = self
      .members
      .iter()
      .map(|member| self.member_sighting_name(member))
      .collect();
    let variants: Vec<syn::Ident> = self.members.iter().map(variant).collect();

    let sightings = self.members.iter().zip(&members).map(|(member, name)| {
      let score = self.evidence_of(member);
      let field = &member.field;
      let doc = leading(&format!(
        "What [`{recipe}`]'s `{field}` member said about a fused root: its OWN evidence, the rank it \
         gave the root in its own stream, and the term that rank added to the fused score.\n\nThe \
         evidence is the member's whole provenance and this type opens none of it — a member that \
         fuses several routes of its own hands over its own evidence enum, all the way down."
      ));
      quote! {
        #[doc = #doc]
        #[derive(::core::fmt::Debug, ::core::clone::Clone, ::core::cmp::PartialEq)]
        #vis struct #name {
          seen: #score,
          ordinal: ::core::primitive::u64,
          contribution: ::core::primitive::f64,
        }

        #[automatically_derived]
        impl #name {
          #[doc = " One entry, taken as the fold computed it."]
          #[must_use]
          #[inline]
          #vis const fn new(
            seen: #score,
            ordinal: ::core::primitive::u64,
            contribution: ::core::primitive::f64,
          ) -> Self {
            Self { seen, ordinal, contribution }
          }

          #[doc = " What this member itself saw, in its own currency."]
          #[must_use]
          #[inline]
          #vis const fn seen_ref(&self) -> &#score {
            &self.seen
          }

          #[doc = " The rank this member gave the root, in its OWN stream."]
          #[must_use]
          #[inline]
          #vis const fn ordinal(&self) -> ::core::primitive::u64 {
            self.ordinal
          }

          #[doc = " The weighted term this sighting added to the fused score."]
          #[must_use]
          #[inline]
          #vis const fn contribution(&self) -> ::core::primitive::f64 {
            self.contribution
          }
        }
      }
    });

    let union_doc = leading(&format!(
      "WHICH of [`{recipe}`]'s members put a root where it is — one arm per member, each carrying \
       that member's own sighting.\n\nA SUM and not a product: a sighting IS one member's, and each \
       member scores in its own currency, which crosses as itself. A product with one nullable row \
       per member would publish a shape where all of them could be set and none of them had to be."
    ));
    let key_match_doc = leading(&format!(
      "One fused result of [`{recipe}`], addressed — the root, the fused score, and every member \
       that put it there."
    ));
    let hydrated_match_doc = leading(&format!(
      "One fused result of [`{recipe}`], HYDRATED — the row the address points at, beside the same \
       score and the same provenance.\n\nThe twin of the keys tier and in the same order: a row that \
       has gone is dropped rather than shifting the rows after it, so the two answers read side by \
       side."
    ));
    let key_stretch_doc = leading(&format!(
      "One STRETCH of a ranking [`{recipe}`] computed once and this deployment is holding: the \
       addresses of this stretch, and the page token that claims the next one.\n\nThe rows are \
       exact within the snapshot — one ranking taken at one moment, so a document indexed between \
       two stretches neither appears twice nor pushes a row off the end. The page token is opaque, \
       session-ephemeral, and refused by name once its answer is gone."
    ));
    let hydrated_stretch_doc = leading(&format!(
      "One STRETCH of a ranking [`{recipe}`] computed once, HYDRATED — the keys tier's own \
       stretch with each address resolved, in the same order and with the same provenance.\n\nThe \
       snapshot holds addresses and scores only; hydration happens per stretch, which is what \
       keeps a kept ranking's memory a function of its depth rather than of a row's width."
    ));
    quote! {
      #(#sightings)*

      #[doc = #union_doc]
      #[derive(::core::fmt::Debug, ::core::clone::Clone, ::core::cmp::PartialEq)]
      #vis enum #sighting {
        #(#variants(#members),)*
      }

      #[doc = #key_match_doc]
      #[derive(::core::fmt::Debug, ::core::clone::Clone)]
      #vis struct #key_match {
        key: #root,
        score: ::core::primitive::f64,
        evidence: ::std::vec::Vec<#sighting>,
      }

      #[automatically_derived]
      impl #key_match {
        #[doc = " One row, assembled out of the fold's own answer."]
        #[must_use]
        #[inline]
        #vis const fn new(
          key: #root,
          score: ::core::primitive::f64,
          evidence: ::std::vec::Vec<#sighting>,
        ) -> Self {
          Self { key, score, evidence }
        }

        #[doc = " The address this row is about."]
        #[must_use]
        #[inline]
        #vis const fn key_ref(&self) -> &#root {
          &self.key
        }

        #[doc = " The FUSED score — comparable against the other rows of this answer and nothing else."]
        #[must_use]
        #[inline]
        #vis const fn score(&self) -> ::core::primitive::f64 {
          self.score
        }

        #[doc = " Every member that saw this root, biggest mover first."]
        #[must_use]
        #[inline]
        #vis fn evidence(&self) -> &[#sighting] {
          &self.evidence
        }

        #[doc = " All three, none cloned — for a reader that takes the row apart."]
        #[must_use]
        #[inline]
        #vis fn into_components(
          self,
        ) -> (#root, ::core::primitive::f64, ::std::vec::Vec<#sighting>) {
          (self.key, self.score, self.evidence)
        }
      }

      // NO DERIVES, and that is the openness rather than an omission: the row is whatever the root
      // key's own `Hydrating` answered, and a type this emission asked `Debug` of would be a demand
      // on somebody else's entity that no field of this face spends.
      #[doc = #hydrated_match_doc]
      #vis struct #hydrated_match {
        entity: #entity,
        score: ::core::primitive::f64,
        evidence: ::std::vec::Vec<#sighting>,
      }

      #[automatically_derived]
      impl #hydrated_match {
        #[doc = " One row, the address already resolved."]
        #[must_use]
        #[inline]
        #vis const fn new(
          entity: #entity,
          score: ::core::primitive::f64,
          evidence: ::std::vec::Vec<#sighting>,
        ) -> Self {
          Self { entity, score, evidence }
        }

        #[doc = " The row this result is about."]
        #[must_use]
        #[inline]
        #vis const fn entity_ref(&self) -> &#entity {
          &self.entity
        }

        #[doc = " The FUSED score — the keys tier's own number, unchanged by hydration."]
        #[must_use]
        #[inline]
        #vis const fn score(&self) -> ::core::primitive::f64 {
          self.score
        }

        #[doc = " Every member that saw this root, biggest mover first."]
        #[must_use]
        #[inline]
        #vis fn evidence(&self) -> &[#sighting] {
          &self.evidence
        }
      }

      #[doc = #key_stretch_doc]
      #[derive(::core::fmt::Debug, ::core::clone::Clone)]
      #vis struct #key_stretch {
        matches: ::std::vec::Vec<#key_match>,
        next_page_token: ::core::option::Option<::std::string::String>,
      }

      #[automatically_derived]
      impl #key_stretch {
        #[doc = " One stretch of a kept ranking, and the claim on the next."]
        #[must_use]
        #[inline]
        #vis const fn new(
          matches: ::std::vec::Vec<#key_match>,
          next_page_token: ::core::option::Option<::std::string::String>,
        ) -> Self {
          Self { matches, next_page_token }
        }

        #[doc = " The rows of this stretch, in the ranking's own order."]
        #[must_use]
        #[inline]
        #vis fn matches(&self) -> &[#key_match] {
          &self.matches
        }

        #[doc = " The page token that claims the next stretch, or `None` at the end of the ranking."]
        #[must_use]
        #[inline]
        #vis fn next_page_token(&self) -> ::core::option::Option<&::core::primitive::str> {
          ::core::option::Option::as_deref(&self.next_page_token)
        }
      }

      // NO DERIVES, for the hydrated match's own reason one row down: the entity inside is somebody
      // else's type and a `Debug` this emission asked for would be a demand no field of this face
      // spends.
      #[doc = #hydrated_stretch_doc]
      #vis struct #hydrated_stretch {
        matches: ::std::vec::Vec<#hydrated_match>,
        next_page_token: ::core::option::Option<::std::string::String>,
      }

      #[automatically_derived]
      impl #hydrated_stretch {
        #[doc = " One stretch of a kept ranking, hydrated, and the claim on the next."]
        #[must_use]
        #[inline]
        #vis const fn new(
          matches: ::std::vec::Vec<#hydrated_match>,
          next_page_token: ::core::option::Option<::std::string::String>,
        ) -> Self {
          Self { matches, next_page_token }
        }

        #[doc = " The rows of this stretch, in the keys tier's own order."]
        #[must_use]
        #[inline]
        #vis fn matches(&self) -> &[#hydrated_match] {
          &self.matches
        }

        #[doc = " The page token that claims the next stretch, or `None` at the end of the ranking."]
        #[must_use]
        #[inline]
        #vis fn next_page_token(&self) -> ::core::option::Option<&::core::primitive::str> {
          ::core::option::Option::as_deref(&self.next_page_token)
        }
      }
    }
  }

  /// The FACES the answer family wears — one `#[Object]` per sighting, the union written out, and one
  /// `#[Object]` per hit.
  ///
  /// The union is three impls written by hand because `#[derive(Union)]` is unreachable from an
  /// emission: a derive is written ON a declaration, and this declaration is inside a gate whose
  /// predicate is not a `cfg` the declaring crate could name. The retrieving family's own note
  /// carries the measurement.
  fn answer_faces(&self) -> proc_macro2::TokenStream {
    let krate = &self.krate;
    let ag = framework(krate, &[], "async_graphql");
    let shelf = vendored(krate, "async_graphql");
    let wire_score = framework(krate, &["graphql"], "WireScore");
    let sighting = self.sighting_name();
    let key_match = self.key_match_name();
    let hydrated_match = self.match_name();
    let key_stretch = self.stretch_name(true);
    let hydrated_stretch = self.stretch_name(false);
    let key_stretch_sdl = key_stretch.to_string();
    let hydrated_stretch_sdl = hydrated_stretch.to_string();
    let (matches_method, next_page_token_method) = (
      crate::method::wire_method(&format_ident!("matches")),
      crate::method::wire_method(&format_ident!("next_page_token")),
    );
    let root = self.address();
    let entity = self.entity();
    let members: Vec<syn::Ident> = self
      .members
      .iter()
      .map(|member| self.member_sighting_name(member))
      .collect();
    let variants: Vec<syn::Ident> = self.members.iter().map(variant).collect();
    let union_sdl = sighting.to_string();

    let member_faces = self.members.iter().zip(&members).map(|(member, name)| {
      let score = self.evidence_of(member);
      let sdl = name.to_string();
      let field = &member.field;
      let doc = format!(" What the `{field}` member said about this root.");
      let (score_method, ordinal, contribution) = (
        crate::method::wire_method(&format_ident!("score")),
        crate::method::wire_method(&format_ident!("ordinal")),
        crate::method::wire_method(&format_ident!("contribution")),
      );
      quote! {
        #[doc = #doc]
        #[#ag::Object(crate = #shelf, name = #sdl)]
        impl #name {
          // THE BORROW IS SPELLED, and elision is what makes that necessary: `#[Object]` rewrites
          // a resolver to take a context beside the receiver, so a returned `Wire<'_>` has two input
          // lifetimes to choose between and rustc reports the ambiguity as a bound it cannot satisfy.
          #[graphql(name = "score")]
          async fn #score_method<'__ingraph_row>(
            &'__ingraph_row self,
          ) -> <#score as #wire_score>::Wire<'__ingraph_row> {
            <#score as #wire_score>::wire_score(#name::seen_ref(self))
          }

          #[graphql(name = "ordinal")]
          async fn #ordinal(&self) -> ::core::primitive::u64 {
            #name::ordinal(self)
          }

          #[graphql(name = "contribution")]
          async fn #contribution(&self) -> ::core::primitive::f64 {
            #name::contribution(self)
          }
        }
      }
    });

    // ONE ROW WORD FOR BOTH TIERS — `node`, which is why one binding serves both `#[Object]`s below.
    // Tier A's node is the ADDRESS and tier B's is the ENTITY, and the two faces are still two types
    // because an `#[Object]` impl publishes one row type per method; what the 2026-08-18 ruling
    // removed is the second SPELLING, not the second face.
    let (node_method, score_method, evidence_method) = (
      crate::method::wire_method(&format_ident!("node")),
      crate::method::wire_method(&format_ident!("score")),
      crate::method::wire_method(&format_ident!("evidence")),
    );
    let key_match_sdl = key_match.to_string();
    let hydrated_match_sdl = hydrated_match.to_string();

    quote! {
      #(#member_faces)*

      // THE UNION, written out — see this emitter's own note for why no derive can reach here.
      #[automatically_derived]
      impl #ag::resolver_utils::ContainerType for #sighting {
        async fn resolve_field(
          &self,
          _ctx: &#ag::Context<'_>,
        ) -> #ag::ServerResult<::core::option::Option<#ag::Value>> {
          ::core::result::Result::Ok(::core::option::Option::None)
        }

        fn collect_all_fields<'__ingraph_seen>(
          &'__ingraph_seen self,
          __ingraph_ctx: &#ag::ContextSelectionSet<'__ingraph_seen>,
          __ingraph_fields: &mut #ag::resolver_utils::Fields<'__ingraph_seen>,
        ) -> #ag::ServerResult<()> {
          match self {
            #(Self::#variants(__ingraph_arm) => #ag::resolver_utils::ContainerType::collect_all_fields(
              __ingraph_arm,
              __ingraph_ctx,
              __ingraph_fields,
            ),)*
          }
        }
      }

      #[automatically_derived]
      impl #ag::OutputType for #sighting {
        fn type_name() -> ::std::borrow::Cow<'static, ::core::primitive::str> {
          ::std::borrow::Cow::Borrowed(#union_sdl)
        }

        fn introspection_type_name(&self) -> ::std::borrow::Cow<'static, ::core::primitive::str> {
          match self {
            #(Self::#variants(_) => <#members as #ag::OutputType>::type_name(),)*
          }
        }

        fn create_type_info(
          __ingraph_registry: &mut #ag::registry::Registry,
        ) -> ::std::string::String {
          __ingraph_registry.create_output_type::<Self, _>(
            #ag::registry::MetaTypeId::Union,
            |__ingraph_registry| {
              #(<#members as #ag::OutputType>::create_type_info(__ingraph_registry);)*
              #ag::registry::MetaType::Union {
                name: ::std::string::String::from(#union_sdl),
                description: ::core::option::Option::None,
                possible_types: {
                  let mut __ingraph_arms = #ag::indexmap::IndexSet::new();
                  #(__ingraph_arms.insert(::std::borrow::Cow::into_owned(
                    <#members as #ag::OutputType>::type_name(),
                  ));)*
                  __ingraph_arms
                },
                visible: ::core::option::Option::None,
                inaccessible: false,
                tags: ::std::vec::Vec::new(),
                rust_typename: ::core::option::Option::Some(::core::any::type_name::<Self>()),
                directive_invocations: ::std::vec::Vec::new(),
              }
            },
          )
        }

        async fn resolve(
          &self,
          __ingraph_ctx: &#ag::ContextSelectionSet<'_>,
          _field: &#ag::Positioned<#ag::parser::types::Field>,
        ) -> #ag::ServerResult<#ag::Value> {
          #ag::resolver_utils::resolve_container(__ingraph_ctx, self).await
        }
      }

      #[automatically_derived]
      impl #ag::UnionType for #sighting {}

      #[doc = " One fused result: the address, the fused score, and every member that put it there."]
      #[#ag::Object(crate = #shelf, name = #key_match_sdl)]
      impl #key_match {
        #[graphql(name = "node")]
        async fn #node_method(&self) -> &#root {
          #key_match::key_ref(self)
        }

        #[graphql(name = "score")]
        async fn #score_method(&self) -> ::core::primitive::f64 {
          #key_match::score(self)
        }

        #[graphql(name = "evidence")]
        async fn #evidence_method(&self) -> &[#sighting] {
          #key_match::evidence(self)
        }
      }

      #[doc = " One fused result, hydrated: the row, the same score, and the same provenance."]
      #[#ag::Object(crate = #shelf, name = #hydrated_match_sdl)]
      impl #hydrated_match {
        #[graphql(name = "node")]
        async fn #node_method(&self) -> &#entity {
          #hydrated_match::entity_ref(self)
        }

        #[graphql(name = "score")]
        async fn #score_method(&self) -> ::core::primitive::f64 {
          #hydrated_match::score(self)
        }

        #[graphql(name = "evidence")]
        async fn #evidence_method(&self) -> &[#sighting] {
          #hydrated_match::evidence(self)
        }
      }

      #[doc = " One stretch of a kept ranking: its rows, and the claim on the next stretch."]
      #[#ag::Object(crate = #shelf, name = #key_stretch_sdl)]
      impl #key_stretch {
        #[graphql(name = "matches")]
        async fn #matches_method(&self) -> &[#key_match] {
          #key_stretch::matches(self)
        }

        // NULL IS THE END OF THE RANKING and never a refusal — a page token this schema declines
        // never reaches a stretch at all, it reaches the field's own error.
        #[graphql(name = "nextPageToken")]
        async fn #next_page_token_method(&self) -> ::core::option::Option<&::core::primitive::str> {
          #key_stretch::next_page_token(self)
        }
      }

      #[doc = " One stretch of a kept ranking, hydrated: its rows, and the claim on the next."]
      #[#ag::Object(crate = #shelf, name = #hydrated_stretch_sdl)]
      impl #hydrated_stretch {
        #[graphql(name = "matches")]
        async fn #matches_method(&self) -> &[#hydrated_match] {
          #hydrated_stretch::matches(self)
        }

        #[graphql(name = "nextPageToken")]
        async fn #next_page_token_method(&self) -> ::core::option::Option<&::core::primitive::str> {
          #hydrated_stretch::next_page_token(self)
        }
      }
    }
  }

  /// **THE TOWER THIS RECIPE PUBLISHES A REQUEST FACE FOR**, or [`None`] where it publishes none.
  ///
  /// The `options` argument is ONE argument of ONE type, and its type is a projection off a tower —
  /// so it exists exactly where this recipe's bound arms all walk THE SAME tower. That is the common
  /// shape and every dressed recipe in this tree today is one; what the answer forecloses is the
  /// other shape, where two arms walk two different towers and one argument could only have carried
  /// one of their packages.
  ///
  /// # It compares the WORDS and never resolves a type, which is the two-clock wall kept
  ///
  /// The model holds `type = "…"` as the author wrote it, so what is compared here is the written
  /// path — token for token. Two spellings of one type therefore read as two towers and this answers
  /// [`None`], which is the SAFE direction of the only error it can make: a recipe loses an argument
  /// it could have had, rather than gaining one whose value would reach the wrong `run`.
  ///
  /// # THE ABSENT ARGUMENT IS NOT A DROPPED KNOB, and the reason is a name
  ///
  /// A per-tower argument would need a per-tower NAME, and a recipe holds a type PATH — mangling one
  /// into an argument name is precisely what the record family exists to avoid. An arm's own name
  /// cannot serve either: two MEMBERS may each carry an arm called `text`, bound to two towers, so
  /// arm-keyed arguments would collide at exactly the shape that needs them. So a multi-tower recipe
  /// publishes no request face, and its towers keep every tier a deployment can reach.
  fn asked_tower(&self) -> Option<&syn::Type> {
    use quote::ToTokens as _;

    let mut bound = self
      .members
      .iter()
      .flat_map(|member| member.arms.iter())
      .filter(|arm| arm.shared.is_some())
      .map(|arm| &arm.tower);
    let first = bound.next()?;
    let spelling = first.to_token_stream().to_string();
    bound
      .all(|tower| tower.to_token_stream().to_string() == spelling)
      .then_some(first)
  }

  /// The REQUEST PACKAGE's type, as the published argument and both fold entries spell it — the
  /// projection off the bound tower's own record.
  fn asked_ty(&self) -> Option<proc_macro2::TokenStream> {
    use syn::spanned::Spanned as _;

    let tower = self.asked_tower()?;
    let at = tower.span();
    let declared = respan(framework(&self.krate, &["retrieve"], "DeclaredTower"), at);
    Some(quote_spanned!(at=> <#tower as #declared>::SearchOptions))
  }

  /// The `options` parameter both fold entries take, or nothing where this recipe publishes none.
  fn asked_parameter(&self) -> Option<proc_macro2::TokenStream> {
    let ty = self.asked_ty()?;
    Some(quote! {
      // TIER THREE, WHOLE. It is carried as the tower's own package rather than unpacked here: what
      // is in it is the TOWER GRAMMAR's business, and a recipe that read a row of it would be a
      // recipe that had to know which words its bound tower wrote.
      __ingraph_request: ::core::option::Option<#ty>,
    })
  }

  /// The `options` ARGUMENT the two published tiers take — spanned at the tower path, so the wire
  /// duty its type creates is reported at the `type = "…"` word that bound it.
  fn asked_argument(&self, binding: &syn::Ident) -> Option<proc_macro2::TokenStream> {
    let ty = self.asked_ty()?;
    Some(quote! {
      #[graphql(name = "options")] #binding: ::core::option::Option<#ty>,
    })
  }

  /// **THE ONE DEMAND A DRESSED RECIPE MAKES OF ITS BOUND TOWER'S REQUEST FACE** — spelled where the
  /// refusal can name the word that bound it.
  ///
  /// async-graphql's own `E0277` for a `()`-faced tower lands on the emitted `#[Object]` block and
  /// names a type the recipe's author never wrote. This is the same demand, made first and spanned
  /// at the tower path, so what a reader sees is `SearchOptionsFace`'s note and the one line to
  /// write.
  fn asked_demand(&self) -> Option<proc_macro2::TokenStream> {
    use syn::spanned::Spanned as _;

    let ty = self.asked_ty()?;
    let at = self.asked_tower()?.span();
    let face = respan(
      framework(&self.krate, &["graphql"], "SearchOptionsFace"),
      at,
    );
    Some(quote_spanned! {at=>
      const _: fn() = || {
        fn __ingraph_asks<__IgAsked: #face + ?::core::marker::Sized>() {}
        __ingraph_asks::<#ty>();
      };
    })
  }

  /// **WHICH ROAD ONE MEMBER'S QUESTION TAKES AT ONE SEAT** — the three answers, and none of them is
  /// a case the emission has to guess at.
  ///
  /// A member has ONE arm on a seat at most: the derive refuses two on a dressed recipe, because a
  /// resolver runs the arm's tower and two answers cannot both be one question. What several seats
  /// added is the third answer — a member whose arms bought OTHER seats is simply not in this
  /// request, and says so by contributing no crossing at all.
  ///
  /// An arm that read NO broadcast is never a producer: without a seat there is nothing for the tower
  /// to be asked, and that arm's own question is the question layer's to supply.
  fn producer<'a>(&self, member: &'a MemberModel, seat: &syn::Ident) -> Producer<'a> {
    let mut bought = member
      .arms
      .iter()
      .filter_map(|arm| arm.shared.as_ref().map(|shared| (arm, shared)))
      .peekable();
    if bought.peek().is_none() {
      return Producer::Broadcast;
    }
    bought
      .find(|(_, shared)| shared.seat == *seat)
      .map_or(Producer::Elsewhere, |(arm, shared)| {
        Producer::Arm(arm, shared)
      })
  }

  /// **LOOKUP AND RUN** — the assembled road found on the schema, walked over the broadcast, its one
  /// answer left in `__ingraph_answered` for the crossing below it.
  ///
  /// This is where the recorded boundary falls. A tower's `walk` takes one `&mut` per step and this
  /// expansion has never seen the steps, so what is called here is the UNIFORM run — fixed arity, on
  /// the far side of the trait the tower macro implements — and the value it is called on is minted
  /// per read by the door a deployment installed.
  ///
  /// # Everything it names is spanned at the TOWER PATH the recipe wrote
  ///
  /// The obligations this call raises — a refusal that renders, a broadcast that copies, a road that
  /// is installed — are all about the type named by one word in this declaration, so that word is
  /// where they are reported.
  ///
  /// # BOTH TIERS ARRIVE HERE, and neither of them is unpacked
  ///
  /// The DEPLOYMENT's package comes out of the door lookup and the REQUEST's off the published
  /// `options` argument, and this emission reads a row of NEITHER. That is the census's three walls
  /// answered rather than argued with:
  ///
  /// 1. **A `()` seat cannot cross.** Whether a step's `Serve::Options` is `()` is a fact only the
  ///    compiler holds and `()` has no wire face, so a per-step row cannot be published by a macro
  ///    that cannot know which rows are empty. The step-keyed package therefore never crosses, and
  ///    the one that does publishes FRAMEWORK-owned rows only.
  /// 2. **The run HAS a request seat now.** `AssembledTower::run` takes the steps, the question, the
  ///    deployment's options AND the request's — so composing the two is the TOWER's business, at the
  ///    one place that can see which words it wrote. A recipe still holds nothing but a type path.
  /// 3. **THIS GRAIN STILL HAS NO WORD TO KEY A FIELD ON**, and it needs none. A door whose fields
  ///    grow by declaration words needs the words, and `expand` and `route` are the TOWER grammar's —
  ///    so the token-keyed object is minted where the tokens are, and this emission publishes it by
  ///    PROJECTION (`<Tower as DeclaredTower>::SearchOptions`) without ever knowing a row of it.
  ///
  /// # The BUDGET is the one row read outside the run, and it rides a projection
  ///
  /// The wall is built AROUND the run, so the number cannot be raised from inside it —
  /// `AssembledTower::asked_budget` is the projection that gets it out of an otherwise opaque package
  /// and `walk_within` is where the two tiers meet. The COMPOSITION is still `tightened_budget`'s,
  /// spent there and nowhere else: composition written out at each road is composition that can drift
  /// at one of them.
  fn walked(&self, arm: &ArmModel, shared: &SharedBinding) -> proc_macro2::TokenStream {
    use syn::spanned::Spanned as _;

    let krate = &self.krate;
    let at = arm.tower.span();
    let ag = framework(krate, &[], "async_graphql");
    let tower = &arm.tower;
    let tower_face = respan(framework(krate, &["retrieve"], "SearchTower"), at);
    let assembled = respan(framework(krate, &["retrieve"], "AssembledTower"), at);
    let installed = respan(framework(krate, &["graphql"], "installed_road"), at);
    let within = respan(framework(krate, &["retrieve"], "walk_within"), at);
    let asked = self.bridged(arm, shared);
    // ONE PACKAGE, EVERY ARM. A recipe publishes at most one `options` argument and its members'
    // arms all walk the one tower it is typed off, so each crossing takes its own copy of the very
    // value the client sent — the same clone `bridged` takes of the broadcast, and for the same
    // reason: one request feeds every arm and a run consumes what it is handed.
    let (borrowed_request, handed_request) = if self.asked_tower().is_some() {
      (
        quote_spanned!(at=> ::core::option::Option::as_ref(&__ingraph_request)),
        quote_spanned!(at=> ::core::clone::Clone::clone(&__ingraph_request)),
      )
    } else {
      (
        quote_spanned!(at=> ::core::option::Option::None),
        quote_spanned!(at=> ::core::option::Option::None),
      )
    };
    quote_spanned! {at=>
      let (mut __ingraph_road, __ingraph_knobs, __ingraph_wall) =
        #installed::<#tower>(__ingraph_ctx, __ingraph_word)?;
      // THE IDENTITY CROSSING IS THE ORDINARY ONE HERE, and it is why the lint is allowed rather
      // than avoided: a `knn(searchable(tower = "…"))` fills the seat with the tower's OWN question
      // type, so the bridge is `From<T> for T` — the blanket impl, satisfied by every tower with
      // nothing written. That is the sugar road's whole point, and an emission that spelled two
      // shapes to keep clippy quiet would be deciding which of them a declaration wrote.
      //
      // THE COPY IS THE SECOND HALF OF THE SAME SENTENCE. `bridged` clones the broadcast because ONE
      // seat feeds every arm of every member and `From`/`TryFrom` consume it — and whether the seat's
      // type is `Copy` is a fact on the far side of the two-clock wall, so a `u32` seat earns
      // `clone_on_copy` at a line no declaration wrote. Both lints are allowed for one reason:
      // choosing between two spellings here would be the emission deciding a type it cannot see.
      #[allow(clippy::clone_on_copy, clippy::useless_conversion)]
      let __ingraph_asked: <#tower as #tower_face>::Question = #asked;
      // THE WALL AROUND THE WHOLE WALK — every step of it, the fan cells included, because what is
      // wrapped is the one uniform run rather than any stage inside it. A door that named no budget
      // takes the unwrapped road, so a deployment that named nothing meets no wrapper at all.
      let __ingraph_walked = #within(
        __ingraph_wall,
        // TIER THREE'S SIDE, read through the tower's own projection: the package is opaque here —
        // what is in it is the tower grammar's business — and this is the one row that has to be
        // known OUTSIDE the run, because the wall is built round the run and cannot be raised from
        // inside it. The COMPOSITION is still `tightened_budget`'s, one seam down.
        <#tower as #assembled>::asked_budget(#borrowed_request),
        ::core::any::type_name::<#tower>(),
        <#tower as #assembled>::run(
          &mut __ingraph_road,
          __ingraph_asked,
          __ingraph_knobs,
          #handed_request,
        ),
      ).await;
      let __ingraph_answered = match __ingraph_walked {
        ::core::result::Result::Ok(::core::result::Result::Ok(__ingraph_answered)) => {
          __ingraph_answered
        }
        // THE TOWER'S OWN SUM, RENDERED — the arm that refused names itself, and what a client
        // reads is that sentence rather than a heading this emission invented.
        ::core::result::Result::Ok(::core::result::Result::Err(__ingraph_refusal)) => {
          return ::core::result::Result::Err(#ag::Error::new(
            ::std::string::ToString::to_string(&__ingraph_refusal),
          ));
        }
        // THE BUDGET'S OWN ARM — a walk that ran out of time is SAID, never answered empty.
        ::core::result::Result::Err(__ingraph_spent) => {
          return ::core::result::Result::Err(#ag::Error::new(
            ::std::string::ToString::to_string(&__ingraph_spent),
          ));
        }
      };
    }
  }

  /// **THE SEAT'S OWN TYPE, CROSSED TO THE TOWER'S QUESTION** — the four shapes the `shared` word
  /// chose between, each spelled as the call `super::bind` already proved.
  ///
  /// # The two TRAIT bridges take a COPY, and the hooks take the borrow
  ///
  /// `From` and `TryFrom` are stated over the seat's own type and consume it, while ONE broadcast
  /// feeds every arm of every member — so each trait-bridged arm clones the value it was handed. A
  /// hook is written `fn(&Seat) -> Question` and needs no copy at all, which is one more thing the
  /// hook road buys an author who wants it.
  fn bridged(&self, arm: &ArmModel, shared: &SharedBinding) -> proc_macro2::TokenStream {
    use syn::spanned::Spanned as _;

    let krate = &self.krate;
    let at = arm.tower.span();
    let ag = framework(krate, &[], "async_graphql");
    let tower = &arm.tower;
    let tower_face = respan(framework(krate, &["retrieve"], "SearchTower"), at);
    let copied = quote_spanned!(at=> ::core::clone::Clone::clone(__ingraph_broadcast));
    match &shared.bridge {
      SharedBridge::Total => quote_spanned! {at=>
        <<#tower as #tower_face>::Question as ::core::convert::From<_>>::from(#copied)
      },
      SharedBridge::Fallible => quote_spanned! {at=>
        match <<#tower as #tower_face>::Question as ::core::convert::TryFrom<_>>::try_from(#copied) {
          ::core::result::Result::Ok(__ingraph_asked) => __ingraph_asked,
          ::core::result::Result::Err(__ingraph_refusal) => {
            return ::core::result::Result::Err(#ag::Error::new(
              ::std::string::ToString::to_string(&__ingraph_refusal),
            ));
          }
        }
      },
      SharedBridge::Hook(path) => quote_spanned!(at=> #path(__ingraph_broadcast)),
      SharedBridge::FallibleHook(path) => quote_spanned! {at=>
        match #path(__ingraph_broadcast) {
          ::core::result::Result::Ok(__ingraph_asked) => __ingraph_asked,
          ::core::result::Result::Err(__ingraph_refusal) => {
            return ::core::result::Result::Err(#ag::Error::new(
              ::std::string::ToString::to_string(&__ingraph_refusal),
            ));
          }
        }
      },
    }
  }

  /// **THE BROADCAST BECOMING THE RECIPE'S QUESTION** — one crossing per member at one seat, or the
  /// match over the seats where the recipe publishes a choice.
  ///
  /// # One seat is the emission it always was
  ///
  /// The declaration and the crossings, in that order and with nothing around them. That is the
  /// absence-identity this fork exists to keep: a recipe with one seat emits the tokens it emitted
  /// before the choice was buildable, and the SDL it publishes is byte for byte the same.
  ///
  /// # SEVERAL is a MATCH, and the arms are the modes
  ///
  /// The arriving variant is the seat the client filled, and each arm binds the seat's own value back
  /// to `__ingraph_broadcast` — so [`walked`](Self::walked) and [`bridged`](Self::bridged) emit word
  /// for word what they emit at one seat, and the road T5 landed is entered unchanged.
  ///
  /// **A member of ANOTHER seat contributes nothing**, and nothing is what it contributes: no
  /// crossing is emitted for it, so its question slot is never filled and the fold's own per-member
  /// read — `if let (true, Some(asked)) = (enabled, question.field())` — skips it. That is
  /// `participates`' law, which the crossing seam already answered `Ok(None)` under; several seats
  /// reach the same absence one step earlier, at the emission rather than at the impl. No arriving
  /// variant reaches ZERO members, because the derive refuses a seat no member reaches.
  fn crossings(&self) -> proc_macro2::TokenStream {
    let question_package = self.question_name();
    if !self.chooses() {
      let asked = self.seat_crossings(&self.seats[0]);
      return quote! {
        let __ingraph_question = #question_package::new();
        #(#asked)*
      };
    }
    let choice = self.ask_input_name();
    let arms = self.seats.iter().map(|seat| {
      let variant = Self::seat_variant(seat);
      let asked = self.seat_crossings(seat);
      quote! {
        #choice::#variant(__ingraph_broadcast) => {
          #(#asked)*
          __ingraph_question
        }
      }
    });
    quote! {
      let __ingraph_question = #question_package::new();
      // THE ARRIVING VARIANT IS THE MODE, and the members that answer it are the ones whose arms
      // bought this seat. Every other member is left unasked, which is how it contributes nothing.
      let __ingraph_question = match __ingraph_broadcast {
        #(#arms)*
      };
    }
  }

  /// ONE CROSSING PER MEMBER at one seat — the broadcast becomes that member's own question, or the
  /// member is structurally absent from this request.
  ///
  /// A MEMBER THAT BINDS A TOWER ON THIS SEAT CROSSES FROM WHAT THE TOWER ANSWERED, and one that
  /// binds no `shared` arm at all crosses from the broadcast itself. The two shapes are the same
  /// match over a different BROADCAST TYPE, which is the whole of what the walk changes at this seat:
  /// the crossing seam, the honest empty and the refusal arm are word for word the ones a plain
  /// member has always had. A member whose arms bought OTHER seats emits nothing.
  fn seat_crossings(&self, seat: &SeatModel) -> Vec<proc_macro2::TokenStream> {
    let krate = &self.krate;
    let ag = framework(krate, &[], "async_graphql");
    let crossing = framework(krate, &["retrieve"], "TrySharedQuestion");
    let fusable = framework(krate, &["retrieve"], "Fusable");
    let question_package = self.question_name();
    let seat_ty = &seat.ty;
    let seat_marker = self.seat_marker_name(&seat.name);
    self
      .members
      .iter()
      .filter_map(|member| {
        let field = &member.field;
        let ty = &member.ty;
        let with = format_ident!("with_{field}");
        let (walked, broadcast, from) = match self.producer(member, &seat.name) {
          Producer::Arm(arm, shared) => {
            let tower = &arm.tower;
            let tower_face = framework(krate, &["retrieve"], "SearchTower");
            (
              self.walked(arm, shared),
              quote!(<#tower as #tower_face>::Answer),
              quote!(&__ingraph_answered),
            )
          }
          Producer::Broadcast => (
            proc_macro2::TokenStream::new(),
            quote!(#seat_ty),
            quote!(__ingraph_broadcast),
          ),
          Producer::Elsewhere => return None,
        };
        Some(quote! {
          #walked
          let __ingraph_question = match <
            <#ty as #fusable>::Question as #crossing<#seat_marker, #broadcast>
          >::try_from_shared(#from) {
            ::core::result::Result::Ok(::core::option::Option::Some(__ingraph_asked)) => {
              #question_package::#with(__ingraph_question, __ingraph_asked)
            }
            // THE HONEST EMPTY: a member with nothing to ask is not walked, which is
            // `participates`' law read at the request rather than an empty question sent down.
            ::core::result::Result::Ok(::core::option::Option::None) => __ingraph_question,
            ::core::result::Result::Err(__ingraph_refusal) => {
              return ::core::result::Result::Err(#ag::Error::new(
                ::std::string::ToString::to_string(&__ingraph_refusal),
              ));
            }
          };
        })
      })
      .collect()
  }

  /// **THE ONE FOLD BOTH FIELDS RUN** — the broadcast crossed into every member's question, every
  /// member asked through the citizen seam, their rankings joined, and the answer moved into the
  /// union each member names.
  ///
  /// It answers in the ROOT rather than in either tier's own row, because both tiers need it: the
  /// keys tier projects the address off it and the hydrated tier hands the roots themselves to the
  /// hydration. A helper that had already crossed to one tier would have to cross back for the other.
  ///
  /// A free fn inside the const rather than a method on the unit, because a method on the unit is a
  /// PUBLISHED FIELD: `#[Object]` reads the impl block whole. The hydrated tier is this answer with
  /// one more step, which is what keeps the fold from being written twice.
  fn ask_fn(&self) -> proc_macro2::TokenStream {
    let krate = &self.krate;
    let ag = framework(krate, &[], "async_graphql");
    let citizen = framework(krate, &["graphql"], "FusedCitizen");
    let fusable = framework(krate, &["retrieve"], "Fusable");
    let route = framework(krate, &["retrieve"], "Route");
    let depth_law = framework(krate, &["retrieve"], "route_depth");
    let flavour = framework(krate, &["retrieve"], "FusionOptions");
    let fusion = framework(krate, &["retrieve"], "Fusion");
    let rooted = framework(krate, &["retrieve"], "Rooted");
    let weighted = framework(krate, &["retrieve"], "fuse_weighted");
    let join = framework(krate, &["retrieve"], self.dedup.join());
    let fused = framework(krate, &["retrieve"], "Fused");
    let fused_score = framework(krate, &["retrieve"], "FusedScore");
    let sighting_of = framework(krate, &["retrieve"], "Sighting");
    let ask = self.ask_name();
    let sighting = self.sighting_name();
    let evidence = self.evidence_name();
    let question_package = self.question_name();
    let options_package = self.options_name();
    let root = self.root();
    let broadcast_ty = self.broadcast_ty();
    let asked = self.crossings();

    // THE DECLARED EDGE, per member — the recipe's own `weight`/`depth` written into the route the
    // fold reads. The door already falls back to these where a route is absent, so what naming them
    // here buys is ONE shape whether or not a word was written, and one place a request-side
    // override will later be merged into.
    //
    // THAT SEAM IS STILL RESERVED, and the PER-MEMBER OVERRIDE is the door it is reserved for: a
    // request naming one member's weight or depth would be laid over the route built here, before
    // `member_edge` resolves it. What it waits on is a published request package —
    // `<Recipe>FuseOptions` is minted UNDRESSED (`super::fuse`'s `graphql: None`), so there is no
    // input face for a client to name a member through and nothing yet to merge.
    let edges: Vec<proc_macro2::TokenStream> = self
      .members
      .iter()
      .map(|member| {
        let field = &member.field;
        let ty = &member.ty;
        let with = format_ident!("with_{field}");
        let mut built = quote!(#route::<<#ty as #fusable>::Options>::new());
        if let Some(weight) = member.weight {
          built = quote!(#route::with_weight(#built, #weight));
        }
        if let Some(depth) = member.depth {
          let depth = depth.get() as usize;
          built = quote! {
            #route::with_depth(
              #built,
              match ::core::num::NonZeroUsize::new(#depth) {
                ::core::option::Option::Some(__ingraph_deep) => __ingraph_deep,
                // UNREACHABLE BY CONSTRUCTION: a zero `depth` is refused at the word, so this arm is
                // the `const` road to a `NonZeroUsize` rather than a runtime fork.
                ::core::option::Option::None => ::core::num::NonZeroUsize::MIN,
              },
            )
          };
        }
        quote! {
          let __ingraph_options = #options_package::#with(__ingraph_options, #built);
        }
      })
      .collect();

    // ONE ASK PER MEMBER, over the edge THE DOOR RESOLVES THE SAME WAY — `member_edge` is the one
    // authority for the four numbers and both roads splice it.
    let reads = self.members.iter().map(|member| {
      let field = &member.field;
      let ty = &member.ty;
      let variant = variant(member);
      let engine = self.engine(member);
      let edge = self.member_edge(member);
      quote! {
        {
          #edge
          if let (true, ::core::option::Option::Some(__ingraph_asked)) =
            (__ingraph_enabled, #question_package::#field(question))
          {
            let __ingraph_ranked = <#ty as #citizen<#engine>>::ranked(
              __ingraph_ctx,
              ::core::option::Option::and_then(__ingraph_route, #route::options),
              __ingraph_asked,
              __ingraph_depth,
            )
            .await?;
            __ingraph_members.push((
              __ingraph_weight,
              ::core::iter::Iterator::collect::<::std::vec::Vec<_>>(
                ::core::iter::Iterator::map(
                  ::std::vec::Vec::into_iter(__ingraph_ranked),
                  |__ingraph_hit| {
                    let (__ingraph_root, __ingraph_rank, __ingraph_seen) =
                      __ingraph_hit.into_components();
                    #rooted::new(
                      __ingraph_root,
                      __ingraph_rank,
                      #evidence::#variant(__ingraph_seen),
                    )
                  },
                ),
              ),
            ));
          }
        }
      }
    });

    let arms = self.members.iter().map(|member| {
      let variant = variant(member);
      let arm = self.member_sighting_name(member);
      quote! {
        #evidence::#variant(__ingraph_at) => #sighting::#variant(
          #arm::new(__ingraph_at, __ingraph_ordinal, __ingraph_contribution),
        ),
      }
    });

    let asked_parameter = self.asked_parameter();
    quote! {
      async fn #ask(
        __ingraph_ctx: &#ag::Context<'_>,
        // THE FIELD THAT ASKED, carried so a missing citizen names it: the two published tiers share
        // this fold, so the word cannot be a constant here without one of them lying about which
        // field a deployment has to look at.
        __ingraph_word: &::core::primitive::str,
        __ingraph_broadcast: &#broadcast_ty,
        __ingraph_first: ::core::primitive::u32,
        __ingraph_depth: ::core::option::Option<::core::primitive::u32>,
        #asked_parameter
      ) -> #ag::Result<
        ::std::vec::Vec<(#root, ::core::primitive::f64, ::std::vec::Vec<#sighting>)>,
      > {
        // THE EDGE-ZERO LAW: the door's currency admits no zero, so `first: 0` is not a smaller
        // question but no question at all — answered before any citizen lookup and any engine call.
        let ::core::option::Option::Some(__ingraph_budget) =
          ::core::num::NonZeroU32::new(__ingraph_first)
        else {
          return ::core::result::Result::Ok(::std::vec::Vec::new());
        };
        let __ingraph_budget = ::core::result::Result::unwrap_or(
          <::core::num::NonZeroUsize as ::core::convert::TryFrom<::core::num::NonZeroU32>>::try_from(
            __ingraph_budget,
          ),
          ::core::num::NonZeroUsize::MAX,
        );
        // NO WALL AT THIS GRAIN: `ceiling` is a declaration-written protection and the recipe
        // grammar takes none, so the request's own ask is cut by the budget alone. Each member's own
        // declaration still walls its own read, which is the fractal one level down.
        let limit = #depth_law(
          ::core::option::Option::map(
            ::core::option::Option::and_then(__ingraph_depth, ::core::num::NonZeroU32::new),
            |__ingraph_asked| ::core::result::Result::unwrap_or(
              <::core::num::NonZeroUsize as ::core::convert::TryFrom<
                ::core::num::NonZeroU32,
              >>::try_from(__ingraph_asked),
              ::core::num::NonZeroUsize::MAX,
            ),
          ),
          ::core::option::Option::None,
          __ingraph_budget,
        );

        #asked
        let question = &__ingraph_question;

        let __ingraph_options = #options_package::new();
        #(#edges)*
        let options = ::core::option::Option::Some(&__ingraph_options);

        let __ingraph_fusion = ::core::option::Option::map_or(
          ::core::option::Option::and_then(options, #options_package::fusion),
          <#fusion as ::core::default::Default>::default(),
          #flavour::fusion,
        );
        let mut __ingraph_members = ::std::vec::Vec::new();
        #(#reads)*
        // THE FRAMEWORK'S OWN FOLD, and the SAME one the Rust door runs — what differs between the
        // two roads is only HOW a member is asked, which is the whole reason the citizen seam exists.
        //
        // The door itself is not called here, and that is measured rather than chosen: its
        // parameters are `Ctx<'a>` GATs carrying `where E: 'a`, and calling it from inside an
        // `async fn` is rust-lang/rust#100013 — *lifetime bound not satisfied*, reported at the
        // attribute with no actionable span. What keeps the two roads from drifting is that the
        // NUMBERS come from one emitter (`member_edge`) and the ARITHMETIC from one function.
        let mut __ingraph_fused =
          #weighted::<_, _, #join<#root>>(__ingraph_members, __ingraph_fusion);
        ::std::vec::Vec::truncate(
          &mut __ingraph_fused,
          ::core::num::NonZeroUsize::get(__ingraph_budget),
        );
        ::core::result::Result::Ok(::core::iter::Iterator::collect(
          ::core::iter::Iterator::map(
            ::std::vec::Vec::into_iter(__ingraph_fused),
            |__ingraph_row| {
              let (__ingraph_score, __ingraph_root, __ingraph_evidence) =
                #fused::into_components(__ingraph_row);
              (
                __ingraph_root,
                #fused_score::get(&__ingraph_score),
                ::core::iter::Iterator::collect(::core::iter::Iterator::map(
                  ::std::vec::Vec::into_iter(__ingraph_evidence),
                  |__ingraph_seen| {
                    // THE THREE NUMBERS CARRIED, never recomputed: the fold held them and the
                    // sighting brought them out.
                    let (__ingraph_contribution, __ingraph_ordinal, __ingraph_member) =
                      #sighting_of::into_components(__ingraph_seen);
                    match __ingraph_member {
                      #(#arms)*
                    }
                  },
                )),
              )
            },
          ),
        ))
      }
    }
  }

  /// **THE PAGED ENTRY BOTH STRETCH RESOLVERS RUN** — one keeper, one arbitration, one cut.
  ///
  /// A free fn inside the const for [`ask_fn`](Self::ask_fn)'s reason, and split from it rather than
  /// folded into it because the two answer different questions: `ask` runs the FOLD, and this runs
  /// the KEEPER — which on a resume does not call `ask` at all. That is the whole of what paging
  /// buys: the second stretch of an answer walks no tower, asks no engine and folds nothing.
  ///
  /// # Page one and page nine are the same arithmetic
  ///
  /// A capture ends in a page token at offset zero and then reads through the same
  /// `SnapshotKeeper::read` a client's second page token arrives at, so there is no first-stretch
  /// path to get separately wrong.
  fn stretch_fn(&self) -> proc_macro2::TokenStream {
    let krate = &self.krate;
    let ag = framework(krate, &[], "async_graphql");
    let keeper = framework(krate, &["retrieve"], "SnapshotKeeper");
    let installed = framework(krate, &["retrieve"], "installed_keeper");
    let page_token = framework(krate, &["retrieve"], "PageToken");
    let stretch_of = framework(krate, &["retrieve"], "Stretch");
    let depth_law = framework(krate, &["retrieve"], "route_depth");
    let ask = self.ask_name();
    let stretch = self.stretch_fn_name();
    let sighting = self.sighting_name();
    let root = self.root();
    let seat_ty = self.broadcast_ty();
    let asked_parameter = self.asked_parameter();
    let handed_request = if self.asked_tower().is_some() {
      quote!(__ingraph_request,)
    } else {
      proc_macro2::TokenStream::new()
    };

    quote! {
      async fn #stretch(
        __ingraph_ctx: &#ag::Context<'_>,
        // THE FIELD THAT ASKED, `'static` because the keeper brands a snapshot with it: a page
        // token handed back to a different field is refused by name rather than downcast into
        // somebody else's answer.
        __ingraph_word: &'static ::core::primitive::str,
        __ingraph_broadcast: ::core::option::Option<#seat_ty>,
        __ingraph_first: ::core::primitive::u32,
        __ingraph_depth: ::core::option::Option<::core::primitive::u32>,
        __ingraph_page_token: ::core::option::Option<::std::string::String>,
        #asked_parameter
      ) -> #ag::Result<
        #stretch_of<(#root, ::core::primitive::f64, ::std::vec::Vec<#sighting>)>,
      > {
        // THE EDGE-ZERO LAW, the unpaged road's own: `first: 0` is not a shorter stretch but no
        // question at all — answered before the keeper is looked up, so a request for nothing
        // neither captures a snapshot nor spends one.
        let ::core::option::Option::Some(__ingraph_want) =
          ::core::num::NonZeroU32::new(__ingraph_first)
        else {
          return ::core::result::Result::Ok(#stretch_of::empty());
        };
        let __ingraph_want = ::core::result::Result::unwrap_or(
          <::core::num::NonZeroUsize as ::core::convert::TryFrom<::core::num::NonZeroU32>>::try_from(
            __ingraph_want,
          ),
          ::core::num::NonZeroUsize::MAX,
        );
        let __ingraph_keeper = #installed(__ingraph_ctx, __ingraph_word)?;
        let __ingraph_held = match (__ingraph_broadcast, __ingraph_page_token) {
          // BOTH NAMED — refused, on the record tier's own precedent for a page that states two
          // directions: the framework will not pick which of two requests a client meant.
          (
            ::core::option::Option::Some(_),
            ::core::option::Option::Some(_),
          ) => {
            return ::core::result::Result::Err(#ag::Error::new(::std::format!(
              "`{}` takes EITHER a question or a page token: a page token resumes an answer this \
               deployment is already holding and a question asks for a new one, so a request \
               naming both leaves it unsaid which of the two it meant",
              __ingraph_word,
            )));
          }
          // NEITHER — refused for the same reason from the other side.
          (
            ::core::option::Option::None,
            ::core::option::Option::None,
          ) => {
            return ::core::result::Result::Err(#ag::Error::new(::std::format!(
              "`{}` takes a question to ask or a page token to resume a kept answer, and this \
               request named neither",
              __ingraph_word,
            )));
          }
          // THE RESUME — no fold, no engine call, no tower walked.
          (
            ::core::option::Option::None,
            ::core::option::Option::Some(__ingraph_text),
          ) => {
            match <#page_token as ::core::str::FromStr>::from_str(&__ingraph_text) {
              ::core::result::Result::Ok(__ingraph_held) => __ingraph_held,
              ::core::result::Result::Err(__ingraph_refusal) => {
                return ::core::result::Result::Err(#ag::Error::new(
                  ::std::string::ToString::to_string(&__ingraph_refusal),
                ));
              }
            }
          }
          // THE CAPTURE — the fold runs once, to the depth this deployment holds.
          (
            ::core::option::Option::Some(__ingraph_asked),
            ::core::option::Option::None,
          ) => {
            // THE PROTECTIVE NUMBER, MIN-TIGHTENED: the keeper's ceiling is the wall and the
            // request's own `depth` is the ask, composed by the one function every other wall in
            // this pipeline is spelled by. A request asking shallower gets shallower; a request
            // asking deeper is CUT rather than refused, which is what the protective law's
            // caps-not-replaces reading means at a number the client may legitimately name.
            let __ingraph_ceiling = #keeper::depth(__ingraph_keeper);
            let __ingraph_wall = ::core::num::NonZeroU32::new(
              ::core::result::Result::unwrap_or(
                <::core::primitive::u32 as ::core::convert::TryFrom<
                  ::core::primitive::usize,
                >>::try_from(::core::num::NonZeroUsize::get(__ingraph_ceiling)),
                ::core::primitive::u32::MAX,
              ),
            );
            let __ingraph_capture = #depth_law(
              ::core::option::Option::map(
                ::core::option::Option::and_then(__ingraph_depth, ::core::num::NonZeroU32::new),
                |__ingraph_deep| ::core::result::Result::unwrap_or(
                  <::core::num::NonZeroUsize as ::core::convert::TryFrom<
                    ::core::num::NonZeroU32,
                  >>::try_from(__ingraph_deep),
                  ::core::num::NonZeroUsize::MAX,
                ),
              ),
              ::core::option::Option::as_ref(&__ingraph_wall),
              __ingraph_ceiling,
            );
            // THE CAPTURE LENGTH IS THE FOLD'S OWN BUDGET, which is why nothing about `ask`
            // changed to make paging work: its `first` has always been *how many survivors to
            // keep*, and a snapshot is that answer at the ceiling instead of at one stretch.
            let __ingraph_rows = #ask(
              __ingraph_ctx,
              __ingraph_word,
              &__ingraph_asked,
              ::core::result::Result::unwrap_or(
                <::core::primitive::u32 as ::core::convert::TryFrom<
                  ::core::primitive::usize,
                >>::try_from(::core::num::NonZeroUsize::get(__ingraph_capture)),
                ::core::primitive::u32::MAX,
              ),
              __ingraph_depth,
              // TIER THREE RIDES THE CAPTURE AND NOT THE STRETCH, which is the paging law read at
              // this argument: a ranking is computed ONCE, so the knobs that computed it are the
              // ones the capturing request named. A RESUME reaches none of this — no tower is
              // walked, so there is nothing for a second request's options to have configured.
              #handed_request
            )
            .await?;
            #keeper::keep(__ingraph_keeper, __ingraph_word, __ingraph_rows)
          }
        };
        match #keeper::read::<
          (#root, ::core::primitive::f64, ::std::vec::Vec<#sighting>),
        >(__ingraph_keeper, &__ingraph_held, __ingraph_word, __ingraph_want) {
          ::core::result::Result::Ok(__ingraph_stretch) => {
            ::core::result::Result::Ok(__ingraph_stretch)
          }
          ::core::result::Result::Err(__ingraph_refusal) => {
            ::core::result::Result::Err(#ag::Error::new(
              ::std::string::ToString::to_string(&__ingraph_refusal),
            ))
          }
        }
      }
    }
  }

  /// THE TWO PUBLISHED FIELDS — the keys tier and its hydrated twin, both over the one fold.
  fn query_fields(&self) -> proc_macro2::TokenStream {
    let krate = &self.krate;
    let ag = framework(krate, &[], "async_graphql");
    let wire = framework(krate, &["graphql"], "WireRoot");
    let recipe = &self.name;
    let ask = self.ask_name();
    let key_match = self.key_match_name();
    let hydrated_match = self.match_name();
    let root = self.root();
    let seat_ty = self.broadcast_ty();
    let seat_sdl = self.broadcast_word();
    let keys_sdl = self.field_name(true);
    let hydrated_sdl = self.field_name(false);
    let keys_method = crate::method::wire_method(&format_ident!("{}", snake(&keys_sdl)));
    let hydrated_method = crate::method::wire_method(&format_ident!("{}", snake(&hydrated_sdl)));
    let (ctx, broadcast, first, depth, page_token) = (
      crate::method::wire_method(&format_ident!("ctx")),
      self.broadcast_binding(),
      crate::method::wire_method(&format_ident!("first")),
      crate::method::wire_method(&format_ident!("depth")),
      crate::method::wire_method(&format_ident!("page_token")),
    );
    // TIER THREE'S OWN ARGUMENT, published on all four fields or on none of them: the two tiers and
    // their two paged twins are ONE request surface, and a knob reachable through half of it would
    // be a client's answer changing with which field it asked.
    let asked = crate::method::wire_method(&format_ident!("options"));
    let asked_argument = self.asked_argument(&asked);
    // THE HANDED VALUE, and the absent case is the fold entry's own parameter going away with it —
    // so a recipe with no request face emits the call it emitted before this door existed.
    let handed = if self.asked_tower().is_some() {
      quote!(#asked,)
    } else {
      proc_macro2::TokenStream::new()
    };
    let stretch = self.stretch_fn_name();
    let stretch_of = framework(krate, &["retrieve"], "Stretch");
    let key_stretch = self.stretch_name(true);
    let hydrated_stretch = self.stretch_name(false);
    let keys_stretch_sdl = self.stretch_field_name(true);
    let hydrated_stretch_sdl = self.stretch_field_name(false);
    let keys_stretch_method =
      crate::method::wire_method(&format_ident!("{}", snake(&keys_stretch_sdl)));
    let hydrated_stretch_method =
      crate::method::wire_method(&format_ident!("{}", snake(&hydrated_stretch_sdl)));
    let keys_stretch_doc = leading(&format!(
      "ONE STRETCH of the addresses [`{recipe}`] ranks nearest one question — the fused ranking \
       computed ONCE and held, then walked a stretch at a time.\n\nTakes EITHER a question, which \
       computes a fresh ranking and keeps it, OR the `pageToken` a previous stretch answered with, \
       which cuts the next stretch off the ranking already held — no member is asked and no tower \
       is walked on a resume. A page token whose answer has expired, been evicted, or was minted \
       elsewhere is refused BY NAME rather than answered with an empty stretch."
    ));
    let hydrated_stretch_doc = leading(&format!(
      "ONE STRETCH of the rows [`{recipe}`] ranks nearest one question — the keys tier's own \
       stretch with each address resolved, in the same order and with the same provenance.\n\nThe \
       snapshot holds addresses only, so hydration happens per stretch: the rows a client never \
       walks to are never read."
    ));
    let default = syn::LitInt::new(&self.wire_first().to_string(), self.name.span());
    let keys_doc = leading(&format!(
      "The ADDRESSES [`{recipe}`] ranks nearest one question — every member it lists asked at once, \
       their rankings joined by reciprocal rank fusion."
    ));
    let hydrated_doc = leading(&format!(
      "The ROWS [`{recipe}`] ranks nearest one question — the keys tier's own answer with each \
       address resolved, in the same order and with the same provenance."
    ));
    let hydrated_half = quote! {
      #[doc = #hydrated_doc]
      #[graphql(name = #hydrated_sdl)]
      async fn #hydrated_method(
        &self,
        #ctx: &#ag::Context<'_>,
        #[graphql(name = #seat_sdl)] #broadcast: #seat_ty,
        #[graphql(name = "first", default = #default)] #first: ::core::primitive::u32,
        #[graphql(name = "depth")] #depth: ::core::option::Option<::core::primitive::u32>,
        #asked_argument
      ) -> #ag::Result<::std::vec::Vec<#hydrated_match>> {
        let __ingraph_answered =
          #ask(#ctx, #hydrated_sdl, &#broadcast, #first, #depth, #handed).await?;
        let mut __ingraph_keys: ::std::vec::Vec<#root> = ::std::vec::Vec::new();
        let mut __ingraph_rest = ::std::vec::Vec::new();
        for (__ingraph_key, __ingraph_score, __ingraph_evidence) in __ingraph_answered {
          ::std::vec::Vec::push(&mut __ingraph_keys, __ingraph_key);
          ::std::vec::Vec::push(&mut __ingraph_rest, (__ingraph_score, __ingraph_evidence));
        }
        let __ingraph_rows = <#root as #wire>::hydrate(#ctx, __ingraph_keys).await?;
        // A HOLE IS AN ANSWER: a row that has gone is dropped, and every row that survives keeps the
        // place the keys tier gave it — which is what makes the two fields readable side by side.
        ::core::result::Result::Ok(::core::iter::Iterator::collect(
          ::core::iter::Iterator::filter_map(
            ::core::iter::Iterator::zip(
              ::std::vec::Vec::into_iter(__ingraph_rows),
              ::std::vec::Vec::into_iter(__ingraph_rest),
            ),
            |(__ingraph_row, (__ingraph_score, __ingraph_evidence))| {
              ::core::option::Option::map(__ingraph_row, |__ingraph_entity| {
                #hydrated_match::new(__ingraph_entity, __ingraph_score, __ingraph_evidence)
              })
            },
          ),
        ))
      }
    };
    quote! {
      #[doc = #keys_doc]
      #[graphql(name = #keys_sdl)]
      async fn #keys_method(
        &self,
        #ctx: &#ag::Context<'_>,
        #[graphql(name = #seat_sdl)] #broadcast: #seat_ty,
        #[graphql(name = "first", default = #default)] #first: ::core::primitive::u32,
        #[graphql(name = "depth")] #depth: ::core::option::Option<::core::primitive::u32>,
        #asked_argument
      ) -> #ag::Result<::std::vec::Vec<#key_match>> {
        let __ingraph_answered =
          #ask(#ctx, #keys_sdl, &#broadcast, #first, #depth, #handed).await?;
        // THE ADDRESS IS A PROJECTION OF THE ROOT'S COLUMNS, taken here and nowhere else: what a
        // schema can name is the root key's own answer, and this face names neither type.
        ::core::result::Result::Ok(::core::iter::Iterator::collect(
          ::core::iter::Iterator::map(
            ::std::vec::Vec::into_iter(__ingraph_answered),
            |(__ingraph_root, __ingraph_score, __ingraph_evidence)| #key_match::new(
              <#root as #wire>::address(__ingraph_root),
              __ingraph_score,
              __ingraph_evidence,
            ),
          ),
        ))
      }

      #hydrated_half

      #[doc = #keys_stretch_doc]
      #[graphql(name = #keys_stretch_sdl)]
      async fn #keys_stretch_method(
        &self,
        #ctx: &#ag::Context<'_>,
        // THE SEAT IS NULLABLE HERE and non-null on the unpaged twin, which is the two MODES this
        // field has rather than a loosening: an ask names a question, a resume names a page token,
        // and a request naming neither or both is refused by name inside.
        #[graphql(name = #seat_sdl)] #broadcast: ::core::option::Option<#seat_ty>,
        #[graphql(name = "first", default = #default)] #first: ::core::primitive::u32,
        #[graphql(name = "depth")] #depth: ::core::option::Option<::core::primitive::u32>,
        #[graphql(name = "pageToken")] #page_token: ::core::option::Option<::std::string::String>,
        #asked_argument
      ) -> #ag::Result<#key_stretch> {
        let __ingraph_cut = #stretch(
          #ctx, #keys_stretch_sdl, #broadcast, #first, #depth, #page_token, #handed
        ).await?;
        let (__ingraph_rows, __ingraph_next) = #stretch_of::into_components(__ingraph_cut);
        ::core::result::Result::Ok(#key_stretch::new(
          ::core::iter::Iterator::collect(::core::iter::Iterator::map(
            ::std::vec::Vec::into_iter(__ingraph_rows),
            |(__ingraph_root, __ingraph_score, __ingraph_evidence)| #key_match::new(
              <#root as #wire>::address(__ingraph_root),
              __ingraph_score,
              __ingraph_evidence,
            ),
          )),
          ::core::option::Option::map(__ingraph_next, |__ingraph_claim| {
            ::std::string::ToString::to_string(&__ingraph_claim)
          }),
        ))
      }

      #[doc = #hydrated_stretch_doc]
      #[graphql(name = #hydrated_stretch_sdl)]
      async fn #hydrated_stretch_method(
        &self,
        #ctx: &#ag::Context<'_>,
        #[graphql(name = #seat_sdl)] #broadcast: ::core::option::Option<#seat_ty>,
        #[graphql(name = "first", default = #default)] #first: ::core::primitive::u32,
        #[graphql(name = "depth")] #depth: ::core::option::Option<::core::primitive::u32>,
        #[graphql(name = "pageToken")] #page_token: ::core::option::Option<::std::string::String>,
        #asked_argument
      ) -> #ag::Result<#hydrated_stretch> {
        let __ingraph_cut = #stretch(
          #ctx, #hydrated_stretch_sdl, #broadcast, #first, #depth, #page_token, #handed
        ).await?;
        let (__ingraph_rows, __ingraph_next) = #stretch_of::into_components(__ingraph_cut);
        let mut __ingraph_keys: ::std::vec::Vec<#root> = ::std::vec::Vec::new();
        let mut __ingraph_rest = ::std::vec::Vec::new();
        for (__ingraph_key, __ingraph_score, __ingraph_evidence) in __ingraph_rows {
          ::std::vec::Vec::push(&mut __ingraph_keys, __ingraph_key);
          ::std::vec::Vec::push(&mut __ingraph_rest, (__ingraph_score, __ingraph_evidence));
        }
        // HYDRATION IS PER STRETCH, which is the memory clause read forwards: the snapshot holds
        // addresses, and the rows a client never walks to are never read.
        let __ingraph_hydrated = <#root as #wire>::hydrate(#ctx, __ingraph_keys).await?;
        ::core::result::Result::Ok(#hydrated_stretch::new(
          ::core::iter::Iterator::collect(::core::iter::Iterator::filter_map(
            ::core::iter::Iterator::zip(
              ::std::vec::Vec::into_iter(__ingraph_hydrated),
              ::std::vec::Vec::into_iter(__ingraph_rest),
            ),
            |(__ingraph_row, (__ingraph_score, __ingraph_evidence))| {
              ::core::option::Option::map(__ingraph_row, |__ingraph_entity| {
                #hydrated_match::new(__ingraph_entity, __ingraph_score, __ingraph_evidence)
              })
            },
          )),
          ::core::option::Option::map(__ingraph_next, |__ingraph_claim| {
            ::std::string::ToString::to_string(&__ingraph_claim)
          }),
        ))
      }
    }
  }

  /// THE `first` DEFAULT this recipe publishes — the DECLARED `limit`, or the framework's own number.
  ///
  /// A CODEGEN constant whose answer becomes an SDL LITERAL, which is the whole of why the declared
  /// number rides `DeclaredSearch::LIMIT` rather than the door: the schema states it at expansion and
  /// no door, seam or fold ever reads it back.
  fn wire_first(&self) -> core::num::NonZeroU32 {
    self.limit.unwrap_or(crate::index::FRAMEWORK_LIMIT)
  }
}

/// ONE member's variant name in the recipe's evidence enum and in its wire union — one derivation,
/// so the two cannot come to disagree about which member an arm names.
fn variant(member: &MemberModel) -> syn::Ident {
  format_ident!("{}", member.field.to_string().to_upper_camel_case())
}

/// **THE WORD A CHOOSING RECIPE'S QUESTION ARGUMENT IS WRITTEN UNDER.**
///
/// The recipe family's own verb — a recipe is ASKED, which is what `ask_fn` and `ask_name` already
/// call the fold this argument feeds. A single-seat recipe never spells it: its argument wears the
/// seat's own word, and that word survives the choice as a FIELD of this one.
const ASK: &str = "ask";

/// **WHERE ONE MEMBER'S QUESTION COMES FROM, at one seat** — see
/// [`SearchModel::producer`](SearchModel#method.producer) for why there are exactly three.
enum Producer<'a> {
  /// The member's arm bound to this seat: its tower is looked up, run, and its ANSWER crossed.
  Arm(&'a ArmModel, &'a SharedBinding),
  /// The member binds no `shared` arm at all, so the broadcast crosses into it directly — whichever
  /// seat arrived. The crossing an unbound member has always had.
  Broadcast,
  /// The member's arms bought OTHER seats, so it is structurally absent from this request: no
  /// crossing is emitted, no question is set, and the fold's own per-member read skips it.
  Elsewhere,
}