caixa-core 0.1.15

Manifest types, layout invariants, and version contract for the caixa tatara-lisp package system.
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
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
use serde::{Deserialize, Serialize};
use thiserror::Error;

/// A single dependency declaration in a `caixa.lisp` manifest.
///
/// **Store model = Git, like Zig.** There is no central registry; a caixa is
/// just a Git repo with a `caixa.lisp` at its root. When `:fonte` is omitted,
/// the resolver falls back to `github:<default-org>/<nome>` (org defaults to
/// `pleme-io`, override via `~/.config/caixa/config.yaml`).
///
/// ```lisp
/// ;; Shorthand — resolves to github:pleme-io/caixa-teia (or your default org):
/// (:nome "caixa-teia" :versao "^0.1")
///
/// ;; Explicit git source:
/// (:nome "caixa-teia"
///  :versao "^0.1"
///  :fonte (:tipo git :repo "github:pleme-io/caixa-teia" :tag "v0.1.0"))
///
/// ;; Arbitrary git URL (not limited to GitHub):
/// (:nome "private-caixa"
///  :versao "*"
///  :fonte (:tipo git :repo "ssh://git@git.example/team/priv-caixa.git" :branch "main"))
///
/// ;; Local path (dev only; not publishable):
/// (:nome "caixa-teia"
///  :versao "0.1.0"
///  :fonte (:tipo path :caminho "../caixa-teia"))
/// ```
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Dep {
    /// Caixa name — must match the target caixa's `:nome`.
    pub nome: String,

    /// Semver constraint string (`"^0.1"`, `"~0.1.2"`, `"0.1.0"`, `"*"`).
    pub versao: String,

    /// Where to fetch the caixa from. Defaults to the feira registry.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub fonte: Option<DepSource>,

    /// If true, a missing `:fonte` is not a build failure.
    #[serde(default, skip_serializing_if = "is_false")]
    pub opcional: bool,

    /// Feature flags to enable on the target caixa.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub caracteristicas: Vec<String>,
}

/// Where a dep is fetched from. Tagged via `:tipo` in Lisp.
///
/// Only two shapes — Git and local Path. No central registry variant: a caixa
/// is just a Git repo. Omitting `:fonte` means *"use the default resolver
/// convention"*, which is `github:<default-org>/<nome>`; the resolver fills
/// that in when computing the lacre.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "tipo", rename_all = "lowercase")]
pub enum DepSource {
    /// Clone from Git. One of `:tag`, `:rev`, or `:branch` may be set.
    /// `repo` can be a `github:org/repo` shorthand, a full `https://…` URL,
    /// or any git-ssh URL.
    Git {
        repo: String,
        #[serde(default, skip_serializing_if = "Option::is_none")]
        tag: Option<String>,
        #[serde(default, skip_serializing_if = "Option::is_none")]
        rev: Option<String>,
        #[serde(default, skip_serializing_if = "Option::is_none")]
        branch: Option<String>,
    },
    /// Local filesystem path — dev only; cannot be published.
    Path { caminho: String },
}

impl DepSource {
    /// Build a registry-shorthand git source (`github:<org>/<nome>`).
    ///
    /// This is the resolver-side fallback for `dep.fonte: None`, not an
    /// author-surface value — it carries no pin (`:tag`/`:rev`/`:branch`
    /// all `None`) and is therefore rejected by [`Self::validate`]. The
    /// resolver fills the pin in at fetch time from the resolved commit;
    /// authors never serialize this shape as a `Dep::fonte` value.
    #[must_use]
    pub fn default_github(org: &str, nome: &str) -> Self {
        Self::Git {
            repo: format!("github:{org}/{nome}"),
            tag: None,
            rev: None,
            branch: None,
        }
    }

    /// Substrate-canonical per-`:fonte` sole-set git-pin scalar accessor
    /// every consumer that reads "which single git ref does this source
    /// resolve to?" keys off — returns the author-declared `:tag` /
    /// `:rev` / `:branch` byte-string verbatim as an `Option<&str>`,
    /// borrowed from the typed slot's own `Option<String>` storage; `None`
    /// on [`Self::Path`] (a path source carries no git-ref) and on a
    /// [`Self::Git`] variant whose `tag`, `rev`, and `branch` are all
    /// `None` (the [`Self::default_github`] shorthand shape the resolver
    /// materializes when the author omits `:fonte` — rejected by
    /// [`Self::validate`], but the accessor's return is defined on this
    /// arm too so pre-validate consumers reach for the same typed dispatch
    /// as post-validate ones).
    ///
    /// **Precedence: rev > tag > branch.** The canonical precedence every
    /// per-`:fonte` git-ref consumer already applies: caixa-resolver's
    /// per-fetch `git checkout <ref>` reads through the same
    /// `rev.or(tag).or(branch)` cascade at caixa-resolver/src/resolve.rs,
    /// and caixa-crd's `dep_into_ref` `CaixaSource.git_ref` fill reads
    /// through the same cascade at caixa-crd/src/conversion.rs. The
    /// [`Self::validate`] gate enforces "exactly one pin set" — under
    /// that invariant every accepted [`Self::Git`] carries exactly one
    /// non-`None` pin and the precedence is unobservable, but the
    /// precedence remains defined for pre-validate consumers (the
    /// resolver's `MissingPin` diagnostic path, the caixa-crd
    /// round-trip's default `"main"` fallback the author never sees a
    /// diagnostic on) and defense-in-depth for a hypothetical future
    /// state where multiple pins survive the gate. The precedence is
    /// **rev before tag** because `:rev` (a git commit OID) is the
    /// reproducibility-strongest identifier — an OID resolves to exactly
    /// one commit regardless of which refname points at it, whereas
    /// `:tag` and `:branch` are refnames the remote can silently move
    /// (a tag re-push, a branch head advance); the resolver's freeze
    /// step at fetch time promotes the resolved commit to `:rev` for
    /// exactly this reason. **Tag before branch** because `:tag` is
    /// conventionally immutable (a release tag) whereas `:branch` is
    /// conventionally mutable (a tracking ref) — a caixa carrying both
    /// a release tag and a tracking branch reads as "prefer the release
    /// pin, fall through to the tracking pin only if the release is
    /// missing". The cascade order also matches the byte-order every
    /// per-`:tag`/`:rev`/`:branch` diagnostic tuple this crate emits
    /// (`(":tag", tag), (":rev", rev), (":branch", branch)` — see
    /// [`Self::validate`]'s `pins` array).
    ///
    /// Prior to this lift the "sole set pin" projection sat twice in the
    /// workspace — inline at caixa-resolver's `fetch_git` (`let gitref =
    /// rev.or(tag).or(branch).ok_or_else(|| ResolveError::MissingPin
    /// { … })?;`) and at caixa-crd's `dep_into_ref`
    /// (`git_ref: rev.clone().or(tag.clone()).or(branch.clone())
    /// .unwrap_or_else(|| "main".to_string())`) — two open-coded copies
    /// of the same precedence cascade with no compile-time link back to
    /// the typed slot. A future extension of the pin axis to a richer
    /// author surface (a `:commit` pin peer of `:rev` once the substrate
    /// grows a signed-commit-verification pin, a `:ref` pin the M4
    /// substrate operator resolves per-cluster ahead of fetch, a
    /// promotion of the plain `Option<String>` pins to a typed
    /// `GitPin::{Rev(Oid), Tag(RefName), Branch(RefName)}` newtype
    /// once the sibling [`crate::render::is_git_oid`] /
    /// [`crate::render::is_git_ref_name`] gates land as typed
    /// constructors) would have had to be threaded through both
    /// open-coded copies in lockstep or the resolver's `git checkout`
    /// target would silently disagree with the CRD's `git_ref` fill —
    /// an author's `(:fonte (:tipo git :repo "…" :rev "deadbeef" :tag
    /// "v1"))` would ship with the resolver checking out `deadbeef`
    /// while the CRD round-trip re-emitted a Dep pointing at `v1`, one
    /// lacre closure disagreeing with the emitted K8s CR the operator
    /// reads. Lifting the resolution to a typed method on the substrate
    /// primitive means both downstream consumers reach for exactly one
    /// typed dispatch — the resolver's accept-set migrates as a unit on
    /// any future pin-axis addition.
    ///
    /// Peer of the sibling outer-`Dep` [`Dep::fonte`] (d65d1bf)
    /// `Option<&DepSource>` composite-reference accessor on the outer-
    /// `Dep` `:fonte`-slot axis — extended one nesting level down onto
    /// the per-[`Self::Git`]-variant sole-set-pin projection axis every
    /// git-fetching consumer runs after the outer `:fonte` slot resolves
    /// to a [`Self::Git`] shape. Same "one typed dispatch on the
    /// substrate primitive, thin projections at each consumer" discipline
    /// the outer accessor family already carries.
    #[must_use]
    pub fn sole_pin(&self) -> Option<&str> {
        match self {
            Self::Git {
                tag, rev, branch, ..
            } => rev.as_deref().or(tag.as_deref()).or(branch.as_deref()),
            Self::Path { .. } => None,
        }
    }

    /// Validate the `:fonte` value-shape: every author-surface
    /// `:fonte (:tipo git …)` must carry a non-empty `:repo` and
    /// exactly one of `:tag` / `:rev` / `:branch` set to a non-empty
    /// value; every `:fonte (:tipo path …)` must carry a non-empty
    /// `:caminho`.
    ///
    /// Called from [`Dep::validate`] with the dep's `:nome` so every
    /// diagnostic carries the offending entry verbatim — same
    /// self-locating shape the `:deps :versao` (2420c44),
    /// `:membros :versao` (9888b13), `:children :versao` (b38ff3a),
    /// `:placement :clusters` (6cbb900), and `:membros :caixa`
    /// (3f9d7a0) gates already expose.
    ///
    /// Until this gate landed `:fonte` was the only `:deps`-related
    /// typed surface still untyped past `Caixa::from_lisp`:
    /// - Empty `:repo` (`(:tipo git :repo "" :tag "v1")`) silently
    ///   passed parse and surfaced as a git-clone failure at
    ///   lacre-resolve time, far from the source caixa.lisp.
    /// - A bare `(:tipo git :repo "…")` with no `:tag`/`:rev`/`:branch`
    ///   passed parse and surfaced as the resolver's
    ///   [`ResolveError::MissingPin`](../../caixa-resolver/src/resolve.rs)
    ///   at fetch time, again far from the source caixa.lisp; lifting
    ///   to validate-time gives the author the same diagnostic at the
    ///   edit site.
    /// - `(:tipo git :repo "…" :tag "v1" :branch "main")` — multiple
    ///   pins set — passed parse and the resolver silently picked
    ///   `:rev > :tag > :branch`, ignoring the other pins with no
    ///   diagnostic; the author had no way to know their `:branch`
    ///   was dropped. This is the canonical "pin drift" footgun.
    /// - An empty pin value (`(:tipo git :repo "…" :tag "")`) silently
    ///   passed parse and surfaced as `git checkout ""` at fetch time.
    /// - Empty `:caminho` (`(:tipo path :caminho "")`) silently passed
    ///   parse and surfaced as
    ///   [`ResolveError::MissingPath`](../../caixa-resolver/src/resolve.rs)
    ///   with `path: PathBuf("")` — not actionable.
    ///
    /// Each rejected shape maps to a typed
    /// [`DepError::Fonte*`] variant that names the offending
    /// dep's `:nome` and the specific axis, so the author can grep
    /// their caixa.lisp for the `:nome "<nome>"` block and fix it in
    /// one edit.
    pub fn validate(&self, nome: &str) -> Result<(), DepError> {
        match self {
            Self::Git {
                repo,
                tag,
                rev,
                branch,
            } => {
                if repo.is_empty() {
                    return Err(DepError::FonteRepoEmpty {
                        nome: nome.to_string(),
                    });
                }
                // The `:repo` value flows verbatim into the caixa-resolver's
                // `git clone <repo>` subprocess invocation. Until this gate
                // landed `:repo` was the last untyped `:fonte`-related axis
                // past the empty arm: a malformed-but-non-empty repo URL
                // (`":repo "github:p/x ""` trailing space, paste-from-doc;
                // `":repo "-upload-pack=evil""` leading `-` — the canonical
                // CLI-argument-injection vector at the `git clone` boundary;
                // `":repo "pleme-io/caixa-teia""` missing scheme — `git clone`
                // reads as a relative filesystem path rather than the
                // GitHub-shorthand expansion; `":repo "github:p/x\n""`
                // embedded newline; `":repo "github:café/x""` raw non-ASCII)
                // silently passed validate and the failure surfaced at
                // lacre-resolve time with a porcelain-quoting-confused error
                // far from the source caixa.lisp. The lifted predicate makes
                // the git-porcelain-URL intersection-floor a substrate-level
                // invariant at validate time, peer with the three pin axes
                // (`:tag` + `:branch` via [`crate::render::is_git_ref_name`],
                // e70d213; `:rev` via [`crate::render::is_git_oid`], be07fd5)
                // — every `:fonte (:tipo git …)` past validate is now
                // structurally accept-shaped on every axis the resolver
                // consumes (the `:repo` URL the `git clone` invokes against,
                // the `:tag`/`:branch` refname `git fetch`/`git checkout`
                // accepts, the `:rev` commit OID the lacre's content-
                // addressing equality probe resolves), closing the
                // `:fonte` slot's value-shape trajectory end-to-end.
                if let Err(reason) = crate::render::is_git_repo_url(repo) {
                    return Err(DepError::FonteRepoShape {
                        nome: nome.to_string(),
                        repo: repo.clone(),
                        reason,
                    });
                }
                let pins: [(&'static str, Option<&String>); 3] = [
                    (":tag", tag.as_ref()),
                    (":rev", rev.as_ref()),
                    (":branch", branch.as_ref()),
                ];
                let set: Vec<&'static str> =
                    pins.iter().filter_map(|(n, v)| v.map(|_| *n)).collect();
                match set.len() {
                    0 => {
                        return Err(DepError::FontePinMissing {
                            nome: nome.to_string(),
                        });
                    }
                    1 => {
                        for (pin, value) in pins {
                            if value.is_some_and(String::is_empty) {
                                return Err(DepError::FontePinEmpty {
                                    nome: nome.to_string(),
                                    pin: pin.to_string(),
                                });
                            }
                        }
                    }
                    _ => {
                        return Err(DepError::FontePinAmbiguous {
                            nome: nome.to_string(),
                            pins: set.join(", "),
                        });
                    }
                }
                // Per-pin value-shape gate. The refname-shaped axes
                // (`:tag` + `:branch`) route through
                // [`crate::render::is_git_ref_name`]; the hex-OID-shaped
                // `:rev` axis routes through
                // [`crate::render::is_git_oid`]. The two predicates
                // partition the `:fonte` pin axes structurally — refname
                // vs. hex commit — so a cross-axis mis-slot (the
                // canonical "I conflated `:rev` and `:branch`" footgun:
                // `:rev "main"` defeating the reproducibility contract,
                // `:tag "deadbeef…"` mis-slotting a SHA into the
                // refname-shaped axis) lands at the offending axis's
                // predicate, not at lacre-resolve `git fetch` /
                // `git checkout` time. Their valid sets intersect at
                // the empty set: every refname is rejected by
                // `is_git_oid`, every OID is rejected by
                // `is_git_ref_name`, structurally.
                //
                // Until this gate landed `:tag` / `:branch` were the
                // refname-shaped axes still untyped past the empty-pin
                // arm: a malformed-but-non-empty refname
                // (`:tag "v0.1.0 "` trailing space — the canonical
                // paste-from-doc footgun; `:tag "v0.1.0.lock"` colliding
                // with git's atomic-rename guard suffix; `:tag "../escape"`
                // path-traversal via consecutive dots; `:branch "main "`
                // trailing space; `:branch "feature/foo bar"` embedded
                // space; `:branch "@"` the literal HEAD alias;
                // `:branch "refs/heads/main"` the fully-qualified ref
                // copied from `git show-ref` output that resolves to
                // a literal ref named `refs/heads/refs/heads/main` on
                // disk) silently passed validate; the `:rev` axis was
                // the last `:fonte`-related axis still untyped past the
                // empty-pin arm: a malformed-but-non-empty hex-OID
                // (`:rev "main"` conflating with `:branch` — the
                // reproducibility-contract leak; `:rev "v0.1.0"`
                // conflating with `:tag` — the same mis-slot on the
                // refname/OID boundary; `:rev "c0ffee"` an abbreviated
                // 6-char prefix that's ambiguous across repo history;
                // `:rev "DEADBEEF…"` an uppercase OID that round-trips
                // inconsistently against `git rev-parse HEAD`'s
                // lowercase emission) silently passed validate and the
                // failure surfaced at lacre-resolve `git fetch` /
                // `git checkout` time with a quoting-confused error
                // far from the source caixa.lisp, with no field naming
                // which `:deps` entry carried the typo. Lifting both
                // gates to caixa-build time matches the value-shape
                // trajectory the peer typed axes already follow
                // (c4213a4 typed WitContract endpoint/subject/slot;
                // eb3456d :entrada :paths; c7d05ec :entrada :host;
                // 4f0390b :contratos :endpoint; 6226bf4 :contratos :wit;
                // 63e18a0 :contratos :subject; 2f4316e :contratos
                // :slot; e70d213 :fonte :tag + :branch) — the typed
                // slot's valid set matches its downstream consumer's
                // accepted set (here, the git porcelain's refname /
                // commit-OID grammars at `git fetch` / `git checkout`
                // time), structurally. Same diagnostic shape every
                // per-axis value-shape lift already exposes
                // (`*Invalid { axis, reason }`); the `value:` field
                // carries the offending refname / OID verbatim so the
                // author can grep their caixa.lisp for the
                // `:tag "<value>"` / `:branch "<value>"` /
                // `:rev "<value>"` literal and fix it in one edit.
                for (pin, value) in [(":tag", tag.as_ref()), (":branch", branch.as_ref())] {
                    if let Some(v) = value
                        && let Err(reason) = crate::render::is_git_ref_name(v)
                    {
                        return Err(DepError::FontePinShape {
                            nome: nome.to_string(),
                            pin: pin.to_string(),
                            value: v.clone(),
                            reason,
                        });
                    }
                }
                if let Some(v) = rev.as_ref()
                    && let Err(reason) = crate::render::is_git_oid(v)
                {
                    return Err(DepError::FontePinShape {
                        nome: nome.to_string(),
                        pin: ":rev".to_string(),
                        value: v.clone(),
                        reason,
                    });
                }
                Ok(())
            }
            Self::Path { caminho } => Self::validate_caminho(nome, caminho),
        }
    }

    /// Reproducibility + path-API gate on the `:fonte (:tipo path …)`
    /// `:caminho` axis. Walks the leading-byte cascade closed by the
    /// b94fd83 (`/`), a5c248e (`~`), and f4efe9c (`$`) arms; the
    /// orthogonal embedded-control-byte arm (d624c8d) covering
    /// `0x00..=0x1F` plus `0x7F` anywhere in the value; and the
    /// embedded-`\` Windows-path-separator arm closing the
    /// cross-host-OS-separator divergence vector on the same
    /// THEORY.md §V.2 render-determinism axis.
    ///
    /// Extracted from [`Self::validate`]'s `Self::Path` arm because the
    /// per-arm cascade now spans nine diagnostic shapes — every new
    /// `:caminho` arm (a future `&` / `;` / `|` shell-metachar arm,
    /// a future glob-metachar `*` / `?` arm) lands here rather than
    /// re-inflating `Self::validate`. The
    /// function stays a thin per-arm linear walk for one reason: each
    /// arm's diagnostic carries a distinct typed [`DepError`] variant
    /// rather than a parser-shaped `reason` string, so collapsing the
    /// cascade onto a generic [`crate::render`] predicate would regress
    /// the per-arm self-locating diagnostic that `feira lint` consumers
    /// depend on. The wrapped predicate trajectory ([`crate::render::is_dns_1123_label`],
    /// [`crate::render::is_git_repo_url`], etc.) lives on the
    /// reason-string-shaped axes; the `:caminho` axis keeps its
    /// per-arm variant shape.
    #[allow(
        clippy::too_many_lines,
        reason = "the per-arm cascade is structurally flat by design — every \
                  `:caminho` arm carries its own typed [`DepError`] variant + \
                  per-arm Why comment, so collapsing the cascade onto a generic \
                  [`crate::render`] predicate would regress the per-arm self-locating \
                  diagnostic the `feira lint` consumer surface depends on"
    )]
    fn validate_caminho(nome: &str, caminho: &str) -> Result<(), DepError> {
        if caminho.is_empty() {
            return Err(DepError::FonteCaminhoEmpty {
                nome: nome.to_string(),
            });
        }
        // Reproducibility gate on the `:fonte (:tipo path …)`
        // `:caminho` axis. The lacre pipeline embeds the value
        // verbatim in its per-dep content-address
        // (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189) and that string
        // folds into the BLAKE3 closure the lacre keys every
        // downstream consumer (the substrate's reproducibility
        // contract, CAIXA-SDLC §III.2 — the lacre is the
        // build's content-addressed identity, peer of the Nix
        // store path) against. Until this gate landed an
        // absolute `:caminho` (`/home/me/work/caixa-teia` — the
        // canonical "I dragged the folder out of Finder into
        // my editor" footgun; `/Users/alice/dev/caixa-teia` on
        // the macOS path-layout peer; the
        // `${WORKSPACE}/caixa-teia` shell-expanded literal
        // pasted from a CI manifest) silently passed validate
        // and the failure surfaced *as a successful build with
        // a divergent lacre*: the BLAKE3 closure on Alice's
        // workstation differed from the closure on Bob's
        // workstation, two CI runners with different
        // `${HOME}` layouts emitted two distinct
        // content-addresses for the byte-identical caixa, and
        // the substrate's "the lacre is the build's identity"
        // contract silently broke far from the source
        // caixa.lisp — the most insidious failure mode the
        // typed slot can carry (no error surfaces; the
        // divergence is invisible until two machines compare
        // lacres). The same THEORY.md §V.2 render-determinism
        // discipline `is_sandboxed_relative_path` already
        // applies on the M2 typed path-slots
        // (`:behavior :on-*`, `:upgrade-from :state-change
        // :script`, `:bibliotecas`, `:exe`, `:servicos`), here
        // narrowed to the absolute-vs-relative axis only:
        // `:fonte :caminho`'s canonical author-surface form is
        // the `..`-traversing sibling-workspace path
        // (`"../caixa-teia"`, the in-tree dev-dep frame), so a
        // full `is_sandboxed_relative_path` lift would
        // structurally reject every legitimate path-fonte
        // dep. The narrower
        // `std::path::Path::is_absolute` cut admits the
        // sibling-workspace form while still rejecting the
        // host-layout-leaking absolute shape — the
        // reproducibility contract bites at exactly the
        // absolute boundary, and that's the axis the
        // substrate-level invariant is meant to hold. Same
        // diagnostic shape every per-axis value-shape lift on
        // the surrounding [`DepError::Fonte*`] cluster carries
        // (the offending `:nome` + offending `:caminho`
        // quoted verbatim so the author can grep their
        // caixa.lisp for the `:caminho "<value>"` literal and
        // fix it in one edit). The empty arm strictly
        // precedes this arm so the blank-string footgun
        // surfaces the more self-locating
        // `FonteCaminhoEmpty` diagnostic (the empty string
        // is not absolute under `Path::new("").is_absolute()`
        // so the precedence is a no-op at value level — the
        // pin matters only at the diagnostic-shape level if
        // a future codec round-trip ever produces an empty
        // string that probes as absolute).
        if std::path::Path::new(caminho).is_absolute() {
            return Err(DepError::FonteCaminhoAbsolute {
                nome: nome.to_string(),
                caminho: caminho.to_string(),
            });
        }
        // Reproducibility gate's tilde-expansion arm. The b94fd83
        // `FonteCaminhoAbsolute` closes the leading-`/`
        // host-layout-leak; a `:caminho "~/work/caixa-teia"` (the
        // canonical paste-from-shell-prompt / paste-from-`cd ~`-
        // doc footgun) silently passed both the empty arm and
        // the absolute arm because `Path::new("~").is_absolute()`
        // returns `false` — `~` is a shell-expansion convention,
        // not a POSIX path component, so `std::path::Path` treats
        // it as a literal directory-name segment. The lacre
        // pipeline then embedded the value verbatim
        // (`conteudo: format!("path:~/work/caixa-teia")`) and the
        // failure mode forked per consumer:
        //
        //   - The caixa-resolver's `Path` arm folds `:caminho`
        //     through `Path::new(caminho).join(<file>)` without
        //     `~`-expansion, so the build looked for a literal
        //     `./~/work/caixa-teia` subdirectory and failed at
        //     resolve time with a `No such file or directory`
        //     error far from the source caixa.lisp (the lacre
        //     itself, though, was already byte-identical across
        //     machines — every machine emitted the same
        //     `path:~/work/caixa-teia` content-address).
        //   - A future caixa-resolver pass that *does* expand `~`
        //     (the canonical shell-convention idiom every
        //     resolver eventually reaches for once an author
        //     reports the literal-`~`-directory bug) would re-
        //     introduce the host-layout-leak the b94fd83 absolute
        //     gate closes: Alice's `~` expands to `/home/alice`,
        //     Bob's to `/home/bob`, two CI runners with different
        //     `$HOME` layouts resolve to two distinct paths for
        //     the byte-identical caixa, and the substrate's
        //     "the lacre is the build's identity" contract
        //     silently breaks far from the source caixa.lisp.
        //
        // Closing the gate at `DepSource::validate` (here at the
        // canonical caixa-build-time boundary, peer with the
        // absolute arm above) refuses both failure modes
        // structurally: the typed accepted set excludes every
        // `~`-prefixed authoring shape, so the resolver is
        // free to grow `~`-expansion (or any other convention-
        // expansion the substrate adopts) without re-opening
        // the host-layout-leak at the typed boundary. Same
        // diagnostic shape every per-axis value-shape gate on
        // the surrounding [`DepError::Fonte*`] cluster carries
        // (the offending `:nome` + offending `:caminho` quoted
        // verbatim so the author can grep their caixa.lisp for
        // the `:caminho "<value>"` literal and fix it in one
        // edit).
        //
        // The cascade preserves narrower-diagnostic-first
        // ordering: `FonteCaminhoEmpty` → `FonteCaminhoAbsolute`
        // → `FonteCaminhoTildeExpansion`. The empty arm
        // structurally precedes both (the bytes "" / "~" don't
        // overlap), and the absolute arm structurally precedes
        // the tilde arm (an absolute path can't start with `~`
        // since absolute paths start with `/`; the bytes "/" /
        // "~" don't overlap either). Both arms are
        // value-disjoint, so the precedence is a no-op at value
        // level — the pin matters only at the diagnostic-shape
        // level if a future codec round-trip ever produces a
        // value that probes as both absolute and tilde-prefixed.
        if caminho.starts_with('~') {
            return Err(DepError::FonteCaminhoTildeExpansion {
                nome: nome.to_string(),
                caminho: caminho.to_string(),
            });
        }
        // Reproducibility gate's shell-variable-expansion arm.
        // The b94fd83 `FonteCaminhoAbsolute` closes the leading-`/`
        // host-layout-leak; the a5c248e `FonteCaminhoTildeExpansion`
        // closes the leading-`~` shell-home-expansion shape; the
        // leading-`$` is the sibling shell-variable-expansion shape
        // — same host-layout-leaking semantic, different syntactic
        // surface. A `:caminho "$HOME/work/caixa-teia"` (the
        // canonical paste-from-`echo $HOME`-doc footgun) and the
        // `${VAR}`-braced variant (`"${WORKSPACE}/caixa-teia"` —
        // the canonical paste-from-CI-manifest footgun every
        // GitHub Actions / GitLab CI / Drone manifest carries)
        // silently passed every prior arm because
        // `Path::is_absolute` returns false on `$` (the `$` is a
        // shell convention, not a POSIX path component, so
        // `std::path::Path` treats it as a literal directory-name
        // segment) and the tilde arm's `starts_with('~')` doesn't
        // fire.
        //
        // Same per-consumer failure-fork the tilde arm closes:
        //
        //   - The caixa-resolver's `Path` arm folds `:caminho`
        //     through `Path::new(caminho).join(<file>)` without
        //     `$`-expansion, so the build looks for a literal
        //     `./$HOME/work/caixa-teia` subdirectory and fails at
        //     resolve time with a `No such file or directory`
        //     error far from the source caixa.lisp.
        //   - A future caixa-resolver pass that *does* expand
        //     `$VAR` (the shell-convention idiom every resolver
        //     eventually reaches for once an author reports the
        //     literal-`$HOME`-directory bug, especially for CI's
        //     `${WORKSPACE}` idiom) would re-introduce the host-
        //     layout-leak the b94fd83 absolute gate closes:
        //     Alice's `$HOME` expands to `/home/alice`, Bob's to
        //     `/home/bob`, two CI runners with different
        //     `${WORKSPACE}` layouts resolve to two distinct
        //     paths for the byte-identical caixa, and the
        //     substrate's "the lacre is the build's identity"
        //     contract silently breaks far from the source
        //     caixa.lisp.
        //
        // Closing the gate at `DepSource::validate` (here at the
        // canonical caixa-build-time boundary, peer with the
        // absolute + tilde arms above) refuses both failure modes
        // structurally. Same diagnostic shape every per-axis
        // value-shape gate on the surrounding [`DepError::Fonte*`]
        // cluster carries (the offending `:nome` + offending
        // `:caminho` quoted verbatim).
        //
        // The cascade preserves narrower-diagnostic-first ordering:
        // `FonteCaminhoEmpty` → `FonteCaminhoAbsolute` →
        // `FonteCaminhoTildeExpansion` → `FonteCaminhoVarExpansion`.
        // The empty arm structurally precedes all three subsequent
        // arms; the absolute arm structurally precedes both the
        // tilde and the var arms (absolute paths start with `/`,
        // the bytes `/` / `~` / `$` don't overlap at the leading
        // position); the tilde arm structurally precedes the var
        // arm (`~` and `$` don't overlap at the leading position).
        // Every pair is value-disjoint, so the precedence is a
        // no-op at value level — the pin matters only at the
        // diagnostic-shape level if a future codec round-trip ever
        // produces a probe-as-both value.
        //
        // The gate covers every leading-`$` shape: the canonical
        // `"$HOME/work/caixa-teia"` (POSIX shell), the braced
        // `"${HOME}/work/caixa-teia"` (POSIX shell braces), the
        // CI-manifest idiom `"${WORKSPACE}/caixa-teia"` (the
        // GitHub Actions / GitLab CI / Drone paste footgun), the
        // XDG idiom `"$XDG_CONFIG_HOME/caixa"`, and the bare `$`
        // (degenerate "I meant `$HOME` and forgot the rest"). All
        // shapes route through the same `caminho.starts_with('$')`
        // byte check.
        if caminho.starts_with('$') {
            return Err(DepError::FonteCaminhoVarExpansion {
                nome: nome.to_string(),
                caminho: caminho.to_string(),
            });
        }
        // Reproducibility gate's leading-space arm. The b94fd83 / a5c248e /
        // f4efe9c arms closed the leading-byte host-layout-leak shapes
        // (`/` / `~` / `$`); the embedded-control-byte arm below closes
        // every byte in `0x00..=0x1F` plus `0x7F` (which already includes
        // tab `0x09`, LF `0x0A`, CR `0x0D` — every ASCII whitespace
        // *except* the ASCII space byte `0x20`). The bare ASCII space at
        // the leading position is the orthogonal paste-from-aligned-doc
        // shape that silently passed every prior arm: `Path::is_absolute`
        // returns false on `" ../caixa-teia"` (the leading byte is `0x20`
        // not `0x2F`), `0x20` is not `~` / `$` / `\` / a control byte, and
        // the value's last byte is not `/`, so the canonical
        // paste-from-aligned-`caixa.lisp`-doc footgun (every `:fonte`
        // form in a multi-entry `:deps` block sits at the same column —
        // an author selecting `"<sp><sp><sp>../caixa-teia"` and pasting
        // it from the rendered alignment into a fresh entry preserves the
        // leading whitespace verbatim) silently rendered as a path with
        // a leading-space directory component the resolver folds through
        // `Path::join` looking for a literal `./ ../caixa-teia`
        // subdirectory that fails at resolve time with a non-self-
        // locating `No such file or directory` error.
        //
        // The lacre pipeline's reproducibility contract bites
        // strictly at this byte: `path:" ../caixa-teia"` and
        // `path:"../caixa-teia"` yield distinct BLAKE3 closures
        // (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189) for the byte-divergent /
        // semantic-identical caixa, and the substrate's "the lacre is
        // the build's identity" contract (CAIXA-SDLC §III.2) silently
        // breaks across two workstations whose authors differ only in
        // paste-from-aligned-doc whitespace habits — the most insidious
        // failure mode the typed slot can carry (no error surfaces; the
        // divergence is invisible until two machines compare lacres).
        //
        // The arm fires AFTER the absolute / tilde / var leading-byte
        // arms (each names the more self-locating shell-convention
        // diagnostic on values that probe as that arm's leading-byte
        // sentinel followed by a leading space — e.g.
        // `:caminho "/  /foo"` surfaces `FonteCaminhoAbsolute` because
        // the leading byte is `/`, not space) and BEFORE the
        // embedded-control-byte arm (a leading-space value with an
        // embedded control byte surfaces the broader leading-space
        // diagnostic because the cascade walks leading-byte arms first
        // — peer with how `FonteCaminhoAbsolute` precedes
        // `FonteCaminhoControlChar` on `"/etc/passwd\n"`).
        //
        // The peer single-token-shaped axes already reject leading
        // whitespace on the same paste-from-aligned-doc contract:
        // [`crate::render::is_git_repo_url`] rejects leading whitespace
        // on `:fonte :repo`, [`crate::render::is_git_ref_name`] rejects
        // leading whitespace on `:fonte :tag`/`:branch`,
        // [`crate::render::is_chart_description_shape`] rejects leading
        // whitespace on `:descricao`,
        // [`crate::render::is_spdx_expression_shape`] rejects leading
        // whitespace on `:licenca`. Closing the same byte on
        // `:fonte :caminho` makes the substrate-wide "no leading ASCII
        // space anywhere in a typed string slot" invariant structurally
        // consistent across every value-shape-gated typed surface (the
        // `:caminho` axis was the last typed string surface still
        // admitting a leading space byte).
        if caminho.starts_with(' ') {
            return Err(DepError::FonteCaminhoLeadingWhitespace {
                nome: nome.to_string(),
                caminho: caminho.to_string(),
            });
        }
        // Reproducibility gate's leading-`-` CLI-argument-injection arm.
        // The b94fd83 + a5c248e + f4efe9c + LeadingWhitespace arms closed
        // the four prior leading-byte shapes (`/` / `~` / `$` / space);
        // this arm closes the orthogonal leading-`-` axis on the same
        // subprocess-argument-boundary the peer `is_git_repo_url` arm
        // (render.rs:2037, `-upload-pack=…` on `:fonte :repo`) and
        // `is_git_ref_name` arm (render.rs:1381, 5a28454, `-stable` on
        // `:fonte :tag` / `:branch`) already reject.
        //
        // The lacre pipeline embeds `:caminho` verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189) and the resolver folds the
        // value through `Path::join` looking for a literal `./{caminho}`
        // subdirectory. Every downstream subprocess that consumes the
        // resolved path — a `git -C {caminho} <verb>` invocation, a
        // future `feira tofu` `terraform -chdir={caminho}` shell-out, a
        // future operator-side `nix build --path {caminho}` spawn, an
        // `xargs` / `find {caminho}` / `stat {caminho}` /
        // `rm -rf {caminho}` cleanup — reinterprets a leading-`-` value
        // as a CLI flag rather than a positional path when the
        // subprocess invocation does not carry a `--` argument-list
        // terminator between the flag block and the path argument. The
        // canonical footguns:
        //
        //   - `:caminho "-rf"` — bare short-flag paste (`rm -rf` /
        //     `find -rf` reinterpretation; the byte the peer
        //     `FonteCaminhoShellSemicolon` arm's `; rm -rf build`
        //     example paste-idiom carries as its first token).
        //   - `:caminho "-C"` — `git -C` config-injection paste
        //     (`git -C -C` reinterprets the second `-C` as another
        //     `--change-directory` flag rather than the path
        //     argument; the canonical `git -C <path>` porcelain
        //     idiom every multi-repo workspace tool carries).
        //   - `:caminho "--upload-pack=cat /etc/passwd"` — the
        //     canonical long-flag CLI-arg-injection vector at every
        //     git porcelain entry point (`git clone`, `git fetch`,
        //     `git ls-remote`) that consumes a path or URL
        //     argument; peer with `is_git_repo_url`'s leading-`-`
        //     arm (render.rs:2037) on the sibling `:fonte :repo`
        //     axis, which the arm's diagnostic explicitly cites.
        //   - `:caminho "--config=…"` / `:caminho "-c"` — git-config
        //     override paste-idiom (paste-from-`git -c foo=bar`
        //     shell-history footgun that reinterprets the value as
        //     a `[foo] bar` config injection on every git porcelain
        //     entry point).
        //
        // POSIX `std::path::Path` treats a leading `-` as a literal
        // filename byte, so the resolver folds `-rf` through `Path::join`
        // and looks for a literal `./-rf` subdirectory — the failure
        // surfaces at resolve time with a non-self-locating `No such
        // file or directory` error far from the source caixa.lisp, and
        // the value rides through the lacre content-address into every
        // downstream shell-spawned subprocess. On any consumer that
        // shells out without the `--` terminator (the common case at
        // every porcelain entry-point) the reinterpretation is silent
        // and the failure mode is arbitrary-argument-injection.
        //
        // The arm fires AFTER the absolute / tilde / var / leading-space
        // leading-byte arms (each names the more self-locating shell-
        // convention diagnostic on values that probe as that arm's
        // leading-byte sentinel — the byte sets are pairwise disjoint at
        // the leading position, so the precedence pin is a no-op at
        // value level, but the ordering keeps every leading-byte arm's
        // diagnostic-shape stable) and BEFORE the embedded-control-byte
        // arm (a leading-`-` value with an embedded control byte
        // surfaces the narrower leading-`-` diagnostic because the
        // cascade walks leading-byte arms first — peer with how
        // `FonteCaminhoAbsolute` precedes `FonteCaminhoControlChar` on
        // `"/etc/passwd\n"`, and how `FonteCaminhoLeadingWhitespace`
        // precedes `FonteCaminhoControlChar` on `" ../foo\n"`).
        //
        // The peer single-token-shaped axes already reject leading `-`
        // on the same CLI-arg-injection contract:
        // [`crate::render::is_git_repo_url`] rejects it on `:fonte :repo`
        // (render.rs:2037), [`crate::render::is_git_ref_name`] rejects
        // it on `:fonte :tag` / `:fonte :branch` (render.rs:1381,
        // 5a28454), [`crate::render::is_dns_1123_label`] rejects it on
        // every DNS-1123-shaped axis (top-level Caixa `:nome`, `:membros
        // :caixa`, `:children :caixa`, `:deps :nome`, cluster names),
        // [`crate::render::is_cargo_feature_name`] rejects it on
        // `:caracteristicas`, and the feira `init` / `add <nome>`
        // positional gate (868c191) rejects it on the CLI positional
        // itself. Closing the same byte on `:fonte :caminho` makes the
        // substrate-wide "no leading `-` anywhere in a typed single-
        // token string slot routed through a subprocess argument"
        // invariant structurally consistent across every value-shape-
        // gated typed surface (the `:caminho` axis was the last typed
        // string surface still admitting a leading `-` byte).
        if caminho.starts_with('-') {
            return Err(DepError::FonteCaminhoLeadingHyphen {
                nome: nome.to_string(),
                caminho: caminho.to_string(),
            });
        }
        // Reproducibility gate's embedded-control-byte arm. The
        // b94fd83 + a5c248e + f4efe9c arms closed the three
        // leading-byte host-layout-leak shapes (`/` / `~` / `$`);
        // this arm closes the orthogonal embedded-control-byte
        // axis — any ASCII control byte (`0x00..=0x1F` plus
        // `0x7F` DEL) appearing anywhere in `:caminho`. Same
        // shape every peer single-token-typed-slot value-shape
        // predicate the surrounding [`crate::render`] cluster
        // gates against (the lifted `is_git_repo_url` arm on
        // `:fonte :repo`, the `is_git_ref_name` arm on
        // `:tag`/`:branch`, the `is_chart_description_shape` /
        // `is_chart_maintainer_name_shape` /
        // `is_chart_keyword_shape` arms on the
        // Helm-chart-shaped axes); now consistent on the
        // `:caminho` axis too.
        //
        // Until this gate landed any embedded control byte
        // silently passed validate, the lacre pipeline embedded
        // the value verbatim in its per-dep content-address
        // (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), and the failure
        // forked per byte and per consumer:
        //
        //   - NUL (`0x00`) the canonical "POSIX paths cannot
        //     contain a NUL byte" shape: every `std::fs` syscall
        //     routes the path through `CString::new`, which
        //     fails with `NulError` on the first NUL byte; the
        //     build would surface a `NulError` at resolve time
        //     far from the source caixa.lisp.
        //   - LF (`0x0A`) / CR (`0x0D`) the canonical paste-from-
        //     multiline-doc footgun: a `:caminho
        //     "../caixa-teia\nrm -rf /"` value (paste landed mid-
        //     `:caminho` block from a multi-line code-fence)
        //     silently round-trips through `Path::join` but the
        //     embedded newline class is a sibling of the CRLF-at-
        //     subprocess-argument injection vector
        //     `is_git_repo_url` already closes on `:repo`.
        //   - Tab (`0x09`) the canonical paste-from-aligned-table
        //     footgun: the tab is invisible in most editors, and
        //     the lacre embeds the value verbatim so two
        //     paste-from-distinct-tables yield divergent lacres
        //     across host editors that strip vs preserve tabs.
        //   - DEL (`0x7F`) + every other `0x00..=0x1F` byte: the
        //     paste-from-binary-blob shape every peer single-
        //     token-shaped slot rejects under the same
        //     `b < 0x20 || b == 0x7F` predicate.
        //
        // Mirrors the cascade discipline every prior `:caminho`
        // arm establishes: `FonteCaminhoEmpty` →
        // `FonteCaminhoAbsolute` → `FonteCaminhoTildeExpansion`
        // → `FonteCaminhoVarExpansion` →
        // `FonteCaminhoLeadingWhitespace` →
        // `FonteCaminhoLeadingHyphen` → `FonteCaminhoControlChar`.
        // The six leading-byte arms structurally precede the
        // embedded-byte arm because the leading-byte shapes are
        // the more self-locating diagnostic on values that probe
        // as both (e.g. `:caminho "/etc/passwd\n"` surfaces the
        // narrower `FonteCaminhoAbsolute` rather than the broader
        // embedded-control-byte arm); the precedence pin matters
        // at the diagnostic-shape level even though the empty /
        // absolute / tilde / var arms are value-disjoint from a
        // bare control byte (which would itself be a leading
        // byte under the empty / absolute / tilde / var arms'
        // leading-position semantics, but those arms guard the
        // specific shell-convention characters `/` / `~` / `$`
        // — a leading `0x01` byte falls through to this arm).
        for &b in caminho.as_bytes() {
            if b < 0x20 || b == 0x7F {
                return Err(DepError::FonteCaminhoControlChar {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's Windows-path-separator arm. The four
        // leading-byte arms (`/` / `~` / `$`) and the embedded-
        // control-byte arm close the host-layout-leaking + paste-from-
        // multiline-doc shapes; the leading-`\` / embedded-`\` byte is
        // the orthogonal cross-host-OS-separator shape — same render-
        // determinism axis, different semantic mechanism. POSIX
        // [`std::path::Path`] treats `\` (0x5C) as a literal byte
        // inside a single path component (so `..\caixa-teia` is one
        // directory named literally `..\caixa-teia`, sibling of `.`
        // and `..`); Windows [`std::path::Path`] treats `\` as a
        // primary path separator equal to `/` (so `..\caixa-teia` is
        // the parent's sibling directory `caixa-teia`). The lacre
        // pipeline embeds the value verbatim in its per-dep content-
        // address (`conteudo: format!("path:{caminho}")`, caixa-
        // resolver/src/resolve.rs:189), so byte-identical caixa.lisp
        // values resolve to two distinct directories across runner
        // OSes — the same THEORY.md §V.2 render-determinism contract
        // the absolute / tilde / var arms protect, here against the
        // cross-host-OS-separator divergence vector. Even on POSIX-
        // only resolvers (the canonical pleme-io substrate posture),
        // a `..\caixa-teia` (the Windows-Explorer "copy as path" /
        // PowerShell `Get-Location` paste-idiom footgun) silently
        // passes every prior arm because `Path::is_absolute` returns
        // false on `..` and `\` is neither a leading-byte sentinel
        // nor a control byte, then the resolver folds the value
        // through `Path::new(caminho).join(<file>)` looking for a
        // literal `./..\caixa-teia` subdirectory and fails at
        // resolve time with a non-self-locating `No such file or
        // directory` error far from the source caixa.lisp.
        //
        // The peer single-token-shaped axes on the same git-CLI /
        // path-CLI consumer cluster already reject `\` under the same
        // Windows-path-leak banner: [`crate::render::is_git_ref_name`]
        // line 1441 (`"must not contain \\ … the canonical Windows-
        // path-leak footgun; use / for hierarchical refs"`) gates
        // `:fonte :tag` / `:fonte :branch` against the same byte,
        // and [`crate::render::is_gateway_api_http_path`] line 506
        // includes `\` in the eleven-byte RFC-3986-reserved rejection
        // set on `:entrada :paths`. Closing the same byte on `:fonte
        // :caminho` makes the substrate-wide "no Windows path
        // separator anywhere in a typed string slot" invariant
        // structurally consistent across every path-shaped typed
        // surface (the `:caminho` axis was the last typed string
        // surface still admitting `\`).
        //
        // The arm fires AFTER the control-char arm because the
        // control-char diagnostic is the more self-locating axis on
        // values that probe as both (`"..\caixa\0teia"` carries both
        // a `\` and a NUL — NUL is the load-bearing POSIX-syscall-
        // rejected byte, so `FonteCaminhoControlChar` wins). Same
        // narrower-diagnostic-first cascade discipline every prior
        // arm establishes. A pure-`\` value
        // (`"..\caixa-teia"` with no control bytes) falls through
        // every prior arm and lands here.
        for &b in caminho.as_bytes() {
            if b == b'\\' {
                return Err(DepError::FonteCaminhoBackslash {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                });
            }
        }
        // Reproducibility gate's shell-redirection arm. The 3a4e1d7 backslash
        // arm closes the cross-host-OS-separator vector; `<` (`0x3C`) and `>`
        // (`0x3E`) are the orthogonal shell-redirection sentinels — same
        // paste-from-shell-prompt footgun class, different syntactic surface.
        // POSIX `std::path::Path` treats `<` / `>` as literal bytes inside a
        // single path component (so `../caixa-teia>output` is one directory
        // named literally `../caixa-teia>output`, sibling of `.` and `..`),
        // but every interactive shell (bash / zsh / fish / nushell) lexes
        // `<` / `>` as input / output redirection operators — a `:caminho
        // "../caixa-teia>build.log"` (the canonical "I pasted a shell
        // pipeline that wrote build output and forgot to trim the redirect"
        // footgun) or `:caminho "../<input.lisp"` (the symmetric input-
        // redirection paste idiom) silently passes every prior arm because
        // `Path::is_absolute` returns false, `<` / `>` are neither leading-
        // byte sentinels nor control bytes nor `\`, and the value's last byte
        // isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./..\caixa-teia>build.log` subdirectory and fails at resolve time
        // with a non-self-locating `No such file or directory` error far
        // from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `<` / `>` byte lands in
        // the BLAKE3 closure and rides downstream as part of the build's
        // identity. The bytes carry a second class of hazard the prior
        // separator-shaped arms don't: every typed-string slot whose value
        // ever flows verbatim into a shell-spawned subprocess (the caixa-
        // resolver's `git clone` invocation, a future `feira tofu` shell-
        // out, a future operator-side `nix flake check` spawn) is the
        // canonical CRLF-at-subprocess-argument / shell-metachar injection
        // surface that every peer single-token-shaped typed slot already
        // closes. The peer path-shaped axis `[crate::render::is_gateway_api_http_path]`
        // (caixa-core/src/render.rs:506) rejects `<` / `>` as part of its
        // eleven-byte RFC-3986-reserved set on `:entrada :paths`, and the
        // peer git-ref-shaped axis `[crate::render::is_git_ref_name]` rejects
        // `<` / `>` on `:fonte :tag` / `:fonte :branch` under the same
        // shell-metachar-injection banner. The `:caminho` axis was the last
        // typed string surface still admitting these two bytes; this arm
        // closes the gap so the substrate-wide "no shell-redirection
        // metacharacter anywhere in a typed string slot" invariant is now
        // structurally consistent across every path-shaped typed surface.
        //
        // The arm fires AFTER the control-char arm + backslash arm because
        // both prior arms carry more self-locating diagnostics on values
        // that probe as both (`"..\foo<bar"` carries both `\` and `<` — the
        // cross-OS-separator divergence is the load-bearing axis, so the
        // backslash arm wins; `"../foo\n<bar"` carries both LF and `<` —
        // the POSIX-syscall-rejected byte is the load-bearing axis, so the
        // control-char arm wins). The arm fires BEFORE the trailing-`/` arm
        // because the embedded redirection byte is the more semantic-
        // locating axis on probe-as-both values (`"../foo</"` ends in `/`
        // but the load-bearing diagnostic is the embedded `<` shell-
        // redirection — the trailing `/` is the secondary observation, and
        // an author who removes the `<` is likely to also tab-strip the
        // trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'<' || b == b'>' {
                return Err(DepError::FonteCaminhoShellRedirection {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-pipe arm. The e457141 shell-redirection
        // arm closes the `<` / `>` input/output redirection sentinels; `|`
        // (`0x7C`) is the orthogonal shell-pipe sentinel — same paste-from-
        // shell-prompt footgun class, different syntactic surface. POSIX
        // `std::path::Path` treats `|` as a literal path-component byte (so
        // `../caixa-teia|tee` is one directory named literally
        // `../caixa-teia|tee`, sibling of `.` and `..`), but every interactive
        // shell (bash / zsh / fish / nushell) lexes `|` as the pipe operator
        // — a `:caminho "../caixa-teia | grep foo"` (the canonical "I copied a
        // `ls ../caixa-teia | grep` line out of a shell-history block and
        // forgot to trim the pipeline tail" footgun) or `:caminho
        // "../foo||bar"` (the symmetric "I copied a `cmd-a || cmd-b` short-
        // circuit OR line" idiom) silently passes every prior arm because
        // `Path::is_absolute` returns false on `..`, `|` is neither a leading-
        // byte sentinel nor a control byte nor `\` nor `<` / `>`, and the
        // value's last byte isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./../caixa-teia | grep foo` subdirectory and fails at resolve time
        // with a non-self-locating `No such file or directory` error far
        // from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `|` byte lands in the
        // BLAKE3 closure and rides downstream as part of the build's identity
        // into every shell-spawned subprocess (the caixa-resolver's `git
        // clone` invocation, a future `feira tofu` shell-out, a future
        // operator-side `nix flake check` spawn) as the canonical CRLF-at-
        // subprocess-argument / shell-metachar injection surface every peer
        // single-token-shaped typed slot already closes. The peer path-shaped
        // axis [`crate::render::is_gateway_api_http_path`]
        // (caixa-core/src/render.rs:506) rejects `|` as part of its eleven-
        // byte RFC-3986-reserved set on `:entrada :paths`. The `:caminho`
        // axis was the last typed path-string surface still admitting this
        // byte; this arm closes the gap so the substrate-wide "no shell-
        // composition metacharacter anywhere in a typed string slot that
        // flows verbatim into a shell-spawned subprocess" invariant extends
        // from shell-redirection (`<` / `>`) to shell-pipe (`|`) on the
        // `:caminho` axis.
        //
        // The arm fires AFTER the shell-redirection arm because the prior
        // arm's two-byte `byte: u8` payload is the more self-locating axis on
        // values that probe as both (`"../caixa-teia<input|tee"` carries both
        // `<` and `|` — the input-redirection-paste idiom is the load-bearing
        // root-cause edit, so `FonteCaminhoShellRedirection` wins; same
        // cascade discipline every prior `:caminho` arm establishes). The arm
        // fires BEFORE the trailing-`/` arm because the embedded pipe byte is
        // the more semantic-locating axis on probe-as-both values
        // (`"../foo|tee/"` ends in `/` but the load-bearing diagnostic is the
        // embedded `|` shell-pipe — the trailing `/` is the secondary
        // observation, and an author who removes the `|` is likely to also
        // tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'|' {
                return Err(DepError::FonteCaminhoShellPipe {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                });
            }
        }
        // Reproducibility gate's shell-command-separator arm. The 124106f
        // shell-pipe arm closes the `|` byte; `;` (`0x3B`) is the orthogonal
        // shell-command-separator sentinel — same paste-from-shell-prompt
        // footgun class, different syntactic surface. POSIX `std::path::Path`
        // treats `;` as a literal path-component byte (so
        // `../caixa-teia;rm -rf /` is one directory named literally
        // `../caixa-teia;rm -rf /`, sibling of `.` and `..`), but every
        // interactive shell (bash / zsh / fish / nushell) lexes `;` as the
        // sequential-command terminator that fires the next command
        // regardless of the prior command's exit status — a `:caminho
        // "../caixa-teia; rm -rf build"` (the canonical "I pasted a shell
        // one-liner that chained a cleanup tail after the directory name"
        // footgun) or `:caminho "../foo;;bar"` (the symmetric "I copied a
        // POSIX `case` arm's `;;` terminator into the middle of a path"
        // idiom) silently passes every prior arm because `Path::is_absolute`
        // returns false on `..`, `;` is neither a leading-byte sentinel nor a
        // control byte nor `\` nor `<` / `>` nor `|`, and the value's last
        // byte isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./../caixa-teia; rm -rf build` subdirectory and fails at resolve
        // time with a non-self-locating `No such file or directory` error far
        // from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `;` byte lands in the
        // BLAKE3 closure and rides downstream as part of the build's identity
        // into every shell-spawned subprocess (the caixa-resolver's `git
        // clone` invocation, a future `feira tofu` shell-out, a future
        // operator-side `nix flake check` spawn) as the canonical
        // shell-metachar injection surface every peer single-token-shaped
        // typed slot already closes. The peer path-shaped axis
        // [`crate::render::is_gateway_api_http_path`]
        // (caixa-core/src/render.rs:506) rejects `;` as part of its eleven-
        // byte RFC-3986-reserved set on `:entrada :paths`. The `:caminho`
        // axis was the last typed path-string surface still admitting this
        // byte; this arm closes the gap so the substrate-wide "no shell-
        // composition metacharacter anywhere in a typed string slot that
        // flows verbatim into a shell-spawned subprocess" invariant extends
        // from shell-pipe (`|`) to shell-command-separator (`;`) on the
        // `:caminho` axis.
        //
        // The arm fires AFTER the shell-pipe arm because the prior arm's
        // canonical-cmd-a-|-cmd-b shape is the more common shell-history
        // paste idiom on values that probe as both (`"../caixa-teia | tee;
        // rm"` carries both `|` and `;` — the pipeline-tail paste is the
        // load-bearing root-cause edit, so `FonteCaminhoShellPipe` wins; same
        // cascade discipline every prior `:caminho` arm establishes). The arm
        // fires BEFORE the trailing-`/` arm because the embedded
        // command-separator byte is the more semantic-locating axis on
        // probe-as-both values (`"../foo;rm/"` ends in `/` but the
        // load-bearing diagnostic is the embedded `;` shell-command-
        // separator — the trailing `/` is the secondary observation, and an
        // author who removes the `;` is likely to also tab-strip the trailing
        // separator).
        for &b in caminho.as_bytes() {
            if b == b';' {
                return Err(DepError::FonteCaminhoShellSemicolon {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                });
            }
        }
        // Reproducibility gate's shell-background / logical-AND arm. The
        // 05c358e shell-command-separator arm closes the `;` byte; `&`
        // (`0x26`) is the orthogonal shell-background / list-AND sentinel
        // — same paste-from-shell-prompt footgun class, different
        // syntactic surface. POSIX `std::path::Path` treats `&` as a
        // literal path-component byte (so `../caixa-teia & sleep 1` is
        // one directory named literally `../caixa-teia & sleep 1`,
        // sibling of `.` and `..`), but every interactive shell
        // (bash / zsh / fish / nushell) lexes `&` two ways:
        //
        //   - Single `&` as the background-task terminator that detaches
        //     the prior command into the background and returns control
        //     to the prompt immediately (the canonical `cmd &` idiom
        //     every long-running pipeline uses);
        //   - Double `&&` as the logical-AND list operator that fires
        //     the next command only if the prior command succeeded (the
        //     canonical `make && make install` idiom every build script
        //     carries).
        //
        // A `:caminho "../caixa-teia & sleep 1"` (the canonical "I
        // pasted a `cd path & sleep 1` background-launch into the
        // `:caminho` slot" footgun) or `:caminho "../caixa-teia && make"`
        // (the symmetric "I copied a `cd path && make` build chain"
        // idiom) silently passes every prior arm because
        // `Path::is_absolute` returns false on `..`, `&` is neither a
        // leading-byte sentinel nor a control byte nor `\` nor
        // `<` / `>` nor `|` nor `;`, and the value's last byte isn't `/`.
        // The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./../caixa-teia & sleep 1` subdirectory and fails at resolve
        // time with a non-self-locating `No such file or directory`
        // error far from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so an `&` byte lands in
        // the BLAKE3 closure and rides downstream as part of the build's
        // identity into every shell-spawned subprocess (the
        // caixa-resolver's `git clone` invocation, a future `feira tofu`
        // shell-out, a future operator-side `nix flake check` spawn) as
        // the canonical shell-metachar injection surface every peer
        // single-token-shaped typed slot already closes. The peer
        // path-shaped axis [`crate::render::is_gateway_api_http_path`]
        // (caixa-core/src/render.rs:506) rejects `&` as part of its
        // eleven-byte RFC-3986-reserved set on `:entrada :paths`. The
        // `:caminho` axis was the last typed path-string surface still
        // admitting this byte; this arm closes the gap so the
        // substrate-wide "no shell-composition metacharacter anywhere
        // in a typed string slot that flows verbatim into a
        // shell-spawned subprocess" invariant extends from
        // shell-command-separator (`;`) to shell-background /
        // logical-AND (`&`) on the `:caminho` axis.
        //
        // The arm fires AFTER the shell-command-separator arm because
        // the prior arm's `cmd-a; cmd-b` shape is the more common
        // shell-history paste idiom on values that probe as both
        // (`"../caixa-teia; rm & sleep"` carries both `;` and `&` — the
        // command-separator-tail paste is the load-bearing root-cause
        // edit, so `FonteCaminhoShellSemicolon` wins; same cascade
        // discipline every prior `:caminho` arm establishes). The arm
        // fires BEFORE the trailing-`/` arm because the embedded
        // background / list-AND byte is the more semantic-locating axis
        // on probe-as-both values (`"../foo&bar/"` ends in `/` but the
        // load-bearing diagnostic is the embedded `&` shell-background
        // / logical-AND metachar — the trailing `/` is the secondary
        // observation, and an author who removes the `&` is likely to
        // also tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'&' {
                return Err(DepError::FonteCaminhoShellBackground {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                });
            }
        }
        // Reproducibility gate's shell-command-substitution arm. The
        // e12e4f3 shell-background / logical-AND arm closes the `&`
        // byte; the backtick (`0x60`) is the orthogonal POSIX legacy
        // command-substitution sentinel — every POSIX shell (sh /
        // bash / zsh / dash / ksh / fish / nushell) lexes the byte as
        // the canonical legacy wrapper that runs the enclosed command
        // and substitutes its standard-output verbatim into the
        // surrounding word (a `whoami` wrapped in backticks expands
        // to the current user's name; a `cat /etc/passwd` wrapped in
        // backticks expands to the file's contents — the canonical
        // CWE-78 shell-command-injection vector every shell-side
        // hardening guide enumerates first). POSIX
        // `std::path::Path` treats backtick as a literal path-
        // component byte (so `../caixa-teia/<backtick>whoami<backtick>`
        // is one directory named literally that, sibling of `.` and
        // `..`).
        //
        // A `:caminho "../caixa-teia/<backtick>whoami<backtick>"` (the
        // canonical "I pasted a shell one-liner carrying a backticked
        // `whoami` command-substitution expansion into the `:caminho`
        // slot" footgun) or `:caminho "<backtick>pwd<backtick>/caixa-
        // teia"` (the symmetric "I copied a `<backtick>pwd<backtick>/
        // path` working-directory expansion") silently passes every
        // prior arm because `Path::is_absolute` returns false on
        // `..`, the backtick byte is neither a leading-byte sentinel
        // (the f4efe9c `FonteCaminhoVarExpansion` arm catches the
        // modern `$()` form at leading position only; backtick is
        // the orthogonal legacy form) nor a control byte nor `\` nor
        // `<` / `>` nor `|` nor `;` nor `&`, and the value's last
        // byte isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // subdirectory whose name embeds the backticked token and
        // fails at resolve time with a non-self-locating `No such
        // file or directory` error far from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-
        // dep content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a backtick byte
        // lands in the BLAKE3 closure and rides downstream as part
        // of the build's identity into every shell-spawned
        // subprocess (the caixa-resolver's `git clone` invocation, a
        // future `feira tofu` shell-out, a future operator-side
        // `nix flake check` spawn) as the canonical shell-metachar
        // injection surface every peer single-token-shaped typed
        // slot already closes. The peer path-shaped axis
        // [`crate::render::is_gateway_api_http_path`]
        // (caixa-core/src/render.rs:506) rejects backtick as part of
        // its eleven-byte RFC-3986-reserved set on `:entrada
        // :paths`. The `:caminho` axis was the last typed path-
        // string surface still admitting this byte; this arm closes
        // the gap so the substrate-wide "no shell-composition
        // metacharacter anywhere in a typed string slot that flows
        // verbatim into a shell-spawned subprocess" invariant
        // extends from shell-background / logical-AND (`&`) to
        // shell-command-substitution (backtick) on the `:caminho`
        // axis.
        //
        // The arm fires AFTER the shell-background arm because the
        // prior arm's `cmd & sleep` shape is the more common shell-
        // history paste idiom on values that probe as both (a
        // `"../caixa-teia & <backtick>whoami<backtick>"` carries
        // both `&` and a backtick — the background-launch tail is
        // the load-bearing root-cause edit, so
        // `FonteCaminhoShellBackground` wins; same cascade
        // discipline every prior `:caminho` arm establishes). The
        // arm fires BEFORE the trailing-`/` arm because the
        // embedded command-substitution byte is the more semantic-
        // locating axis on probe-as-both values (a
        // `"../<backtick>whoami<backtick>/"` ends in `/` but the
        // load-bearing diagnostic is the embedded backtick shell-
        // command-substitution metachar — the trailing `/` is the
        // secondary observation, and an author who removes the
        // backtick is likely to also tab-strip the trailing
        // separator).
        for &b in caminho.as_bytes() {
            if b == b'`' {
                return Err(DepError::FonteCaminhoShellCommandSubstitution {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                });
            }
        }
        // Reproducibility gate's shell-glob arm. The c4d62b3 shell-command-
        // substitution arm closes the backtick byte; `*` (`0x2A`) and `?`
        // (`0x3F`) are the orthogonal POSIX glob-expansion sentinels — same
        // paste-from-shell-prompt footgun class, different syntactic surface.
        // Every POSIX shell (sh / bash / zsh / dash / ksh / fish / nushell)
        // lexes `*` and `?` as pathname-expansion wildcards: `*` matches any
        // sequence of characters in a path component (including the empty
        // sequence), `?` matches exactly one character. POSIX
        // `std::path::Path` treats both bytes as literal path-component bytes
        // (so `../caixa-teia/*.lisp` is one directory named literally
        // `../caixa-teia/*.lisp`, sibling of `.` and `..`).
        //
        // A `:caminho "../caixa-teia/*"` (the canonical "I pasted a
        // `ls ../caixa-teia/*` shell-listing one-liner into the `:caminho`
        // slot" footgun) or `:caminho "../foo?"` (the symmetric "I copied a
        // `rm foo?` single-char-wildcard removal idiom") silently passes
        // every prior arm because `Path::is_absolute` returns false on `..`,
        // `*` / `?` are neither leading-byte sentinels nor control bytes nor
        // `\` nor `<` / `>` nor `|` nor `;` nor `&` nor backtick, and the
        // value's last byte isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./../caixa-teia/*` subdirectory and fails at resolve time with a
        // non-self-locating `No such file or directory` error far from the
        // source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `*` or `?` byte lands in
        // the BLAKE3 closure and rides downstream as part of the build's
        // identity into every shell-spawned subprocess (the caixa-resolver's
        // `git clone` invocation, a future `feira tofu` shell-out, a future
        // operator-side `nix flake check` spawn) as the canonical
        // shell-metachar / pathname-expansion surface every peer
        // single-token-shaped typed slot already closes. The peer path-shaped
        // axis [`crate::render::is_gateway_api_http_path`]
        // (caixa-core/src/render.rs:506) rejects `*` and `?` as part of its
        // eleven-byte RFC-3986-reserved set on `:entrada :paths`. The
        // `:caminho` axis was the last typed path-string surface still
        // admitting these two bytes; this arm closes the gap so the
        // substrate-wide "no shell-composition / glob-expansion
        // metacharacter anywhere in a typed string slot that flows verbatim
        // into a shell-spawned subprocess" invariant extends from
        // shell-command-substitution (backtick) to glob-expansion
        // (`*` / `?`) on the `:caminho` axis.
        //
        // The arm fires AFTER the backtick arm because the prior arm's
        // CWE-78 shell-command-injection vector is the load-bearing
        // diagnostic on values that probe as both (a `"../`whoami`/*"`
        // carries both backtick and `*` — the command-substitution paste
        // is the load-bearing root-cause edit, so
        // `FonteCaminhoShellCommandSubstitution` wins; same cascade
        // discipline every prior `:caminho` arm establishes). The arm
        // fires BEFORE the trailing-`/` arm because the embedded glob
        // byte is the more semantic-locating axis on probe-as-both values
        // (`"../foo*/"` ends in `/` but the load-bearing diagnostic is the
        // embedded `*` glob metachar — the trailing `/` is the secondary
        // observation, and an author who removes the `*` is likely to
        // also tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'*' || b == b'?' {
                return Err(DepError::FonteCaminhoShellGlob {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-subshell-grouping arm. The cf9034b
        // shell-glob arm closes the `*` / `?` pathname-expansion sentinels;
        // `(` (`0x28`) and `)` (`0x29`) are the orthogonal POSIX subshell-
        // grouping sentinels — same paste-from-shell-prompt footgun class,
        // different syntactic surface. Every POSIX shell (sh / bash / zsh /
        // dash / ksh / fish / nushell) lexes the parenthesis pair as the
        // subshell-grouping operator: `(<cmd>)` runs `<cmd>` in a child
        // shell with a fresh environment scope (the canonical sandboxing
        // idiom every shell-history `(cd <path> && <cmd>)` one-liner uses
        // to scope a `cd` to one subshell without disturbing the parent's
        // working directory), and `$(<cmd>)` is the modern Bourne
        // command-substitution shape the upstream f4efe9c
        // `FonteCaminhoVarExpansion` arm closes the leading `$` byte of —
        // the closing `)` byte completes that substitution shape and must
        // be refused on the same axis (peer with the
        // [`crate::render::is_git_repo_url`] 3b99147 arm that closes the
        // same byte-pair on the sibling `:fonte :repo` axis under the
        // same shell-subshell-grouping + RFC-3986-sub-delims banner).
        // POSIX `std::path::Path` treats both bytes as literal path-
        // component bytes (so `../caixa-teia/(date)` is one directory
        // named literally `../caixa-teia/(date)`, sibling of `.` and
        // `..`).
        //
        // A `:caminho "../caixa-teia/$(date)/build"` (the canonical "I
        // pasted a `cd ../caixa-teia/$(date)/build` shell-history one-
        // liner whose modern command-substitution expansion lands the
        // current date as a subdirectory name" footgun) or `:caminho
        // "../(cd foo && pwd)/caixa-teia"` (the symmetric "I copied a
        // `(cd foo && pwd)` subshell-grouping working-directory probe
        // idiom") silently passes every prior arm because
        // `Path::is_absolute` returns false on `..`, `(` / `)` are
        // neither leading-byte sentinels nor control bytes nor `\` nor
        // `<` / `>` nor `|` nor `;` nor `&` nor backtick nor `*` / `?`,
        // and the value's last byte isn't `/`. The resolver folds the
        // value through `Path::new(caminho).join(<file>)` looking for a
        // literal `./../caixa-teia/$(date)/build` subdirectory and fails
        // at resolve time with a non-self-locating `No such file or
        // directory` error far from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `(` or `)` byte lands
        // in the BLAKE3 closure and rides downstream as part of the
        // build's identity into every shell-spawned subprocess (the
        // caixa-resolver's `git clone` invocation, a future `feira tofu`
        // shell-out, a future operator-side `nix flake check` spawn) as
        // the canonical shell-metachar / subshell-grouping surface every
        // peer single-token-shaped typed slot already closes. The peer
        // git-source axis [`crate::render::is_git_repo_url`] (3b99147)
        // rejects the same byte pair on `:fonte :repo` under the same
        // shell-subshell-grouping / RFC-3986-sub-delims banner. The
        // `:caminho` axis was the last typed path-string surface still
        // admitting these two bytes;
        // this arm closes the gap so the substrate-wide "no shell-
        // composition metacharacter anywhere in a typed string slot that
        // flows verbatim into a shell-spawned subprocess" invariant
        // extends from shell-glob (`*` / `?`) to shell-subshell-grouping
        // (`(` / `)`) on the `:caminho` axis. Together with the f4efe9c
        // leading-`$` arm, the typed `:caminho` accepted set now
        // structurally excludes the entire modern Bourne
        // command-substitution surface — leading `$` closes the
        // leading byte of every `$(<cmd>)` shape, this arm closes the
        // trailing `)` boundary.
        //
        // The arm fires AFTER the shell-glob arm because the prior arm's
        // `*` / `?` pathname-expansion shape is the more common shell-
        // history paste idiom on values that probe as both
        // (`"../caixa-teia/*(date)"` carries both `*` and `(` — the
        // glob-paste-tail is the load-bearing root-cause edit, so
        // `FonteCaminhoShellGlob` wins; same cascade discipline every
        // prior `:caminho` arm establishes). The arm fires BEFORE the
        // trailing-`/` arm because the embedded subshell-grouping byte
        // is the more semantic-locating axis on probe-as-both values
        // (`"../foo(date)/"` ends in `/` but the load-bearing diagnostic
        // is the embedded `(` shell-subshell-grouping metachar — the
        // trailing `/` is the secondary observation, and an author who
        // removes the `(` is likely to also tab-strip the trailing
        // separator).
        for &b in caminho.as_bytes() {
            if b == b'(' || b == b')' {
                return Err(DepError::FonteCaminhoShellSubshellGrouping {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-brace-expansion arm. The 0633c91
        // shell-subshell-grouping arm closes `(` / `)`; `{` (`0x7b`) and
        // `}` (`0x7d`) are the orthogonal shell-brace-expansion /
        // URI-Template-placeholder byte pair — same paste-from-shell-
        // prompt + paste-from-templated-doc footgun class, different
        // syntactic surface. Every POSIX-derived shell that implements
        // brace expansion (bash / zsh / ksh / fish; the canonical
        // `mkdir -p ../{caixa-teia,caixa-helm,caixa-flux}` /
        // `cp file{,.bak}` idiom every shell-history block carries)
        // expands `{a,b,c}` to the cross-product of its comma-separated
        // members and `{1..10}` to the integer range; RFC 6570 reserves
        // the matched pair for URI Template placeholders (the canonical
        // `https://{host}/{org}/{repo}` substitution shape every
        // OpenAPI / Swagger / Postman / GitHub Octokit client /
        // Helm chart-URL fragment / Mustache `{{org}}` doubled-brace
        // form carries), and Tera / Jinja2 / Handlebars / Go html/template
        // every IaC tool (Helm, Kustomize, Terraform's `${var}` cousin
        // shape) emit. POSIX `std::path::Path` treats both bytes as
        // literal path-component bytes (so `../{caixa-teia,caixa-helm}`
        // is one directory named literally `../{caixa-teia,caixa-helm}`,
        // sibling of `.` and `..`).
        //
        // A `:caminho "../{caixa-teia,caixa-helm}/build"` (the canonical
        // "I pasted a `cd ../{caixa-teia,caixa-helm}` shell brace-
        // expansion one-liner that fans across two siblings" footgun)
        // or `:caminho "../{{org}}/caixa-teia"` (the symmetric "I copied
        // a `{{org}}` Mustache / Helm template placeholder out of a
        // README quick-start and forgot to substitute") silently passes
        // every prior arm because `Path::is_absolute` returns false on
        // `..`, `{` / `}` are neither leading-byte sentinels nor control
        // bytes nor `\` nor `<` / `>` nor `|` nor `;` nor `&` nor
        // backtick nor `*` / `?` nor `(` / `)`, and the value's last
        // byte isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./../{caixa-teia,caixa-helm}/build` subdirectory and fails
        // at resolve time with a non-self-locating `No such file or
        // directory` error far from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `{` or `}` byte
        // lands in the BLAKE3 closure and rides downstream as part of
        // the build's identity into every shell-spawned subprocess
        // (the caixa-resolver's `git clone` invocation, a future
        // `feira tofu` shell-out, a future operator-side `nix flake
        // check` spawn) as the canonical shell-metachar / brace-
        // expansion surface every peer single-token-shaped typed
        // slot already closes. The peer git-source axis
        // [`crate::render::is_git_repo_url`] (42d8f9d — the URI Template
        // placeholder arm) rejects the same byte pair on `:fonte :repo`
        // under the same RFC-3986-'delims' / RFC-6570-URI-Template /
        // shell-brace-expansion banner. The `:caminho` axis was the last
        // typed path-string surface still admitting these two bytes;
        // this arm closes the gap so the substrate-wide "no shell-
        // composition metacharacter anywhere in a typed string slot
        // that flows verbatim into a shell-spawned subprocess"
        // invariant extends from shell-subshell-grouping (`(` / `)`)
        // to shell-brace-expansion (`{` / `}`) on the `:caminho` axis,
        // and the typed `:caminho` accepted set now also structurally
        // excludes the URI Template / templating-engine placeholder
        // surface that would silently round-trip through any
        // downstream IaC templating-engine layer.
        //
        // The arm fires AFTER the shell-subshell-grouping arm because
        // the prior arm's `(` / `)` shape is the more semantic-locating
        // axis on values that probe as both (`"../{cd foo}(date)"`
        // carries both `{` and `(` — the parenthesis-pair is the
        // load-bearing modern-Bourne-command-substitution surface the
        // prior arm closes; same cascade discipline every prior
        // `:caminho` arm establishes). The arm fires BEFORE the
        // trailing-`/` arm because the embedded brace-expansion byte
        // is the more semantic-locating axis on probe-as-both values
        // (`"../{caixa-teia,caixa-helm}/"` ends in `/` but the
        // load-bearing diagnostic is the embedded `{` brace-expansion
        // metachar — the trailing `/` is the secondary observation,
        // and an author who removes the `{` is likely to also tab-
        // strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'{' || b == b'}' {
                return Err(DepError::FonteCaminhoShellBraceExpansion {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-bracket-expansion arm. The 598b770
        // shell-brace-expansion arm closes `{` / `}`; `[` (`0x5b`) and
        // `]` (`0x5d`) are the orthogonal POSIX glob-character-class /
        // shell-`test`-builtin byte pair — same paste-from-shell-prompt
        // footgun class, different syntactic surface. Every POSIX shell
        // (sh / bash / zsh / dash / ksh / fish / nushell) lexes the
        // bracket pair as the glob character-class operator: `[abc]`
        // matches one of `a`, `b`, `c`; `[a-z]` matches any lowercase
        // ASCII letter; `[^x]` negates (the canonical
        // `ls *.[ch]` C-source-file glob and the `cd ../[a-z]*`
        // lowercase-sibling glob every shell-history block carries —
        // the orthogonal axis to the cf9034b `*` / `?` shell-glob arm
        // closing the unbounded pathname-expansion sentinels). The
        // bracket pair additionally carries the POSIX `test` /
        // `[` builtin command (`[ -d ../caixa-teia ] && cd ...` —
        // the canonical idiom every shell-script conditional uses) and
        // bash's `[[ ... ]]` extended-test grammar. Beyond shell, the
        // bracket pair is the TOML inline-array delimiter
        // (`features = ["a", "b"]` — the canonical paste-from-Cargo-
        // manifest cross-idiom-leak vector), the YAML flow-sequence
        // delimiter (`paths: [/a, /b]` — the canonical paste-from-
        // values.yaml cross-idiom leak), the JSON array delimiter,
        // and the POSIX-ERE / PCRE bracket-expression / character-
        // class anchor (the canonical paste-from-regex-doc shape).
        // POSIX `std::path::Path` treats both bytes as literal path-
        // component bytes (so `../[caixa-teia]` is one directory
        // named literally `../[caixa-teia]`, sibling of `.` and
        // `..`).
        //
        // A `:caminho "../caixa-[a-z]/build"` (the canonical "I
        // pasted a `cd ../caixa-[a-z]/build` glob-character-class
        // one-liner that matches every lowercase-sibling-suffix
        // sibling directory" footgun), `:caminho "../[caixa-teia]/
        // build"` (the symmetric "I pasted a TOML inline-array /
        // YAML flow-sequence shape out of an aligned manifest"
        // idiom), or `:caminho "../caixa-[ch]"` (the canonical
        // `*.[ch]` C-source character-class paste-from-shell-history
        // shape) silently passes every prior arm because
        // `Path::is_absolute` returns false on `..`, `[` / `]` are
        // neither leading-byte sentinels nor control bytes nor `\`
        // nor `<` / `>` nor `|` nor `;` nor `&` nor backtick nor
        // `*` / `?` nor `(` / `)` nor `{` / `}`, and the value's
        // last byte isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./../caixa-[a-z]/build` subdirectory and fails at resolve
        // time with a non-self-locating `No such file or directory`
        // error far from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `[` or `]` byte
        // lands in the BLAKE3 closure and rides downstream as part of
        // the build's identity into every shell-spawned subprocess
        // (the caixa-resolver's `git clone` invocation, a future
        // `feira tofu` shell-out, a future operator-side `nix flake
        // check` spawn) as the canonical shell-metachar / glob-
        // character-class / TOML-array surface every peer single-
        // token-shaped typed slot already closes. The `:caminho` axis
        // was the last typed path-string surface still admitting
        // these two bytes; this arm closes the gap so the substrate-
        // wide "no shell-composition metacharacter anywhere in a
        // typed string slot that flows verbatim into a shell-spawned
        // subprocess" invariant extends from shell-brace-expansion
        // (`{` / `}`) to shell-bracket-expansion (`[` / `]`) on the
        // `:caminho` axis. Together with the cf9034b `*` / `?` arm,
        // the typed `:caminho` accepted set now structurally excludes
        // the entire POSIX pathname-expansion / glob surface —
        // unbounded glob (`*` / `?`) AND bounded character-class
        // (`[abc]` / `[a-z]`).
        //
        // The arm fires AFTER the shell-brace-expansion arm because
        // the prior arm's `{` / `}` shape is the more semantic-
        // locating axis on values that probe as both
        // (`"../{a,b}[ch]"` carries both `{` and `[` — the brace-
        // expansion fan is the load-bearing root-cause edit, so
        // `FonteCaminhoShellBraceExpansion` wins; same cascade
        // discipline every prior `:caminho` arm establishes). The arm
        // fires BEFORE the trailing-`/` arm because the embedded
        // bracket-expansion byte is the more semantic-locating axis
        // on probe-as-both values (`"../[a-z]/"` ends in `/` but the
        // load-bearing diagnostic is the embedded `[` glob-character-
        // class metachar — the trailing `/` is the secondary
        // observation, and an author who removes the `[` is likely
        // to also tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'[' || b == b']' {
                return Err(DepError::FonteCaminhoShellBracketExpansion {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-quote-grouping arm. The 986963b
        // shell-bracket-expansion arm closes `[` / `]`; `'` (`0x27`) and
        // `"` (`0x22`) are the orthogonal POSIX shell-string-literal
        // delimiter pair — same paste-from-shell-prompt footgun class,
        // different syntactic surface. Every POSIX shell (sh / bash /
        // zsh / dash / ksh / fish / nushell) lexes the pair as the
        // string-literal quoting operator: `'…'` is the strong
        // (no-expansion) single-quoted string and `"…"` is the weak
        // (variable-/command-substitution-preserving) double-quoted
        // string — the canonical `cd '../caixa-teia'` shell-history
        // idiom every path-with-embedded-whitespace paste block carries,
        // and the symmetric `git clone "$REPO"` weak-quoted CI-manifest
        // shape. Beyond shell, the two bytes carry the JSON string-literal
        // delimiter (`"key": "value"` — the canonical paste-from-JSON-
        // config cross-idiom-leak vector), the YAML double-quoted +
        // single-quoted flow-scalar delimiters (`path: "../caixa-teia"`
        // — the canonical paste-from-values.yaml / paste-from-K8s-YAML-
        // manifest cross-idiom leak), the TOML basic + literal string
        // delimiters (`path = "../caixa-teia"` — the canonical paste-
        // from-Cargo-manifest cross-idiom-leak vector), the tatara-lisp
        // string-literal delimiter itself (`(:caminho "../caixa-teia")`
        // — the canonical "I copied the entire `:caminho "..."` slot
        // rather than just the string body" author-surface footgun),
        // and RFC 3986 §2.2's `gen-delims` / `sub-delims` grammar which
        // excludes both bytes from the `unreserved / pct-encoded /
        // sub-delims / ":" / "@"` `pchar` production. POSIX
        // `std::path::Path` treats both bytes as literal path-component
        // bytes (so `../"caixa-teia"` is one directory named literally
        // `../"caixa-teia"`, sibling of `.` and `..`).
        //
        // A `:caminho "'../caixa-teia'"` (the canonical "I pasted a
        // `cd '../caixa-teia'` shell-history one-liner whose strong-
        // quoting preserved the sibling-workspace path verbatim across
        // the whitespace paste boundary" footgun), `:caminho
        // "\"../caixa-teia\""` (the symmetric weak-quoted paste-from-
        // JSON / paste-from-YAML flow-scalar / paste-from-TOML basic-
        // string / paste-from-tatara-lisp string-literal cross-idiom-
        // leak shape), or `:caminho "../\"caixa-teia\""` (the embedded-
        // quote "I pasted a JSON key-value pair fragment into the
        // middle of the path" idiom) silently passes every prior arm
        // because `Path::is_absolute` returns false on `..` / `'` /
        // `"`, `'` / `"` are neither leading-byte sentinels nor
        // control bytes nor `\` nor `<` / `>` nor `|` nor `;` nor `&`
        // nor backtick nor `*` / `?` nor `(` / `)` nor `{` / `}` nor
        // `[` / `]`, and the value's last byte isn't `/`. The resolver
        // folds the value through `Path::new(caminho).join(<file>)`
        // looking for a literal `./'../caixa-teia'` subdirectory and
        // fails at resolve time with a non-self-locating `No such file
        // or directory` error far from the source caixa.lisp.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so a `'` or `"` byte
        // lands in the BLAKE3 closure and rides downstream as part of
        // the build's identity into every shell-spawned subprocess
        // (the caixa-resolver's `git clone` invocation, a future
        // `feira tofu` shell-out, a future operator-side `nix flake
        // check` spawn) as the canonical shell-metachar / string-
        // literal-delimiter surface every peer single-token-shaped
        // typed slot already closes. The peer `:fonte :repo` axis
        // closes both bytes under the same shell-quote-grouping /
        // RFC-3986-sub-delims banner (e7a109f `'` shell-single-quote
        // + 4267d8b `"` shell-double-quote on `is_git_repo_url`). The
        // `:caminho` axis was the last typed path-string surface
        // still admitting these two bytes; this arm closes the gap
        // so the substrate-wide "no shell-composition metacharacter
        // anywhere in a typed string slot that flows verbatim into a
        // shell-spawned subprocess" invariant extends from shell-
        // bracket-expansion (`[` / `]`) to shell-quote-grouping (`'`
        // / `"`) on the `:caminho` axis. Together with the peer
        // JSON / YAML / TOML string-literal delimiters closing at
        // this arm and the 598b770 `{` / `}` brace-expansion arm
        // closing the templating-engine-placeholder boundary, the
        // typed `:caminho` accepted set now structurally excludes
        // the entire cross-config-DSL string-literal / templating
        // paste-from-aligned-manifest cross-idiom-leak surface that
        // would silently round-trip through any downstream JSON /
        // YAML / TOML / HCL / tatara-lisp parsing layer.
        //
        // The arm fires AFTER the shell-bracket-expansion arm because
        // the prior arm's `[` / `]` shape is the more semantic-
        // locating axis on values that probe as both (`"../[a-z]'x'"`
        // carries both `[` and `'` — the glob-character-class
        // expansion is the load-bearing root-cause edit, so
        // `FonteCaminhoShellBracketExpansion` wins; same cascade
        // discipline every prior `:caminho` arm establishes). The arm
        // fires BEFORE the trailing-`/` arm because the embedded
        // quote-grouping byte is the more semantic-locating axis on
        // probe-as-both values (`"../'caixa-teia'/"` ends in `/` but
        // the load-bearing diagnostic is the embedded `'` shell-
        // string-literal metachar — the trailing `/` is the secondary
        // observation, and an author who removes the `'` is likely to
        // also tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'\'' || b == b'"' {
                return Err(DepError::FonteCaminhoShellQuoteGrouping {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-comment / URL-fragment / YAML-comment arm.
        // The d14cbc5 shell-quote-grouping arm closes `'` / `"`; `#` (`0x23`) is
        // the orthogonal "byte at which four distinct downstream parsers all
        // truncate the value at the first occurrence" surface, and no prior arm
        // has covered it on the `:caminho` axis. Every POSIX shell (sh / bash /
        // zsh / dash / ksh / fish / nushell) lexes an unquoted `#` at the head
        // of a word (or after unquoted whitespace) as the comment-lead: from
        // that byte to the end of the physical line is a comment discarded
        // before command parsing (`cd ../caixa-teia  # legacy sibling` — the
        // canonical paste-from-shell-history-with-trailing-annotation shape
        // every operator-notebook and CI-manifest carries; POSIX.1-2017 §2.3
        // Token Recognition step 6). YAML 1.2 §6.6 makes `#` the comment lead
        // at any position preceded by whitespace or at line-start (`path:
        // ../caixa-teia  # pin` — the canonical paste-from-values.yaml /
        // paste-from-K8s-manifest cross-idiom-leak shape). tatara-lisp itself
        // treats `;` as the comment-lead but a growing number of consumer
        // config-DSL layers (HCL, Terraform, Nix flake attributes, .env
        // dotenv-style files, gitconfig / .gitignore, ini / TOML) use `#` as
        // the comment-lead too — the pair extends the cross-config-DSL
        // paste-idiom surface the d14cbc5 quote-grouping arm and the 598b770
        // brace-expansion arm already cover on adjacent axes. RFC 3986 §3.5
        // reserves `#` as the URL fragment-identifier delimiter (the canonical
        // paste-from-browser-address-bar `github.com/foo/bar#readme` /
        // `github.com/foo/bar#L42` permalink shape, and the symmetric
        // Nix-flake-ref cross-idiom leak `github:foo/bar#packageName` where
        // `#` selects a flake output — the same axis the peer
        // [`crate::render::is_git_repo_url`] closes on the `:fonte :repo`
        // surface at a68f818 with the same downstream-drops-the-tail
        // rationale).
        //
        // POSIX `std::path::Path` treats `#` as a literal path-component byte,
        // so a `:caminho "../caixa-teia # legacy sibling"` (the canonical
        // paste-from-shell-history-with-trailing-annotation footgun),
        // `:caminho "../caixa-teia  # pin"` (the symmetric YAML flow-scalar
        // paste-with-trailing-comment shape), or `:caminho "../caixa-teia
        // #readme"` (the URL fragment paste-from-browser-address-bar shape)
        // silently passes every prior arm because `Path::is_absolute` returns
        // false on `..`, `#` is neither a leading-byte sentinel nor a control
        // byte nor `\` nor `<` / `>` nor `|` nor `;` nor `&` nor backtick nor
        // `*` / `?` nor `(` / `)` nor `{` / `}` nor `[` / `]` nor `'` / `"`,
        // and the value's last byte isn't `/`. The resolver folds the value
        // through `Path::new(caminho).join(<file>)` looking for a literal
        // subdirectory named `../caixa-teia # legacy sibling` and fails at
        // resolve time with a non-self-locating `No such file or directory`
        // error far from the source caixa.lisp — while every downstream
        // shell / YAML / URL parser silently truncates the value at the `#`
        // byte to `../caixa-teia`, so a `feira tofu` shell-out to a
        // `cd '{caminho}'` command line and a `nix flake check` invocation on
        // an emitted YAML `path:` scalar disagree with the resolver on which
        // directory the value names. Two workstations whose downstream
        // shell / YAML / URL parsing layers differ in unquoted-`#`
        // recognition emit divergent build artifacts for the byte-identical
        // caixa.lisp value.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so the byte lands in the BLAKE3
        // closure and rides downstream as part of the build's identity into
        // every shell-spawned subprocess (the caixa-resolver's `git clone`
        // invocation, a future `feira tofu` shell-out, a future operator-side
        // `nix flake check` spawn) as the canonical shell-metachar /
        // comment-lead / URL-fragment-delimiter surface every peer
        // single-token-shaped typed slot already closes. The peer `:fonte
        // :repo` axis closes the byte under the URL-fragment-identifier
        // banner (a68f818 `#` on `is_git_repo_url`); the `:caminho` axis was
        // the last typed path-string surface still admitting the byte. This
        // arm closes the gap so the substrate-wide "no shell-composition
        // metacharacter / comment-lead / URL-fragment-delimiter anywhere in a
        // typed string slot that flows verbatim into a shell-spawned
        // subprocess or downstream YAML / URL parser" invariant extends from
        // shell-quote-grouping (`'` / `"`) to shell-comment / URL-fragment
        // (`#`) on the `:caminho` axis. Together with the peer JSON / YAML /
        // TOML string-literal delimiters the d14cbc5 quote-grouping arm
        // closes and the 598b770 `{` / `}` brace-expansion arm closes on the
        // templating-engine-placeholder boundary, the typed `:caminho`
        // accepted set now structurally excludes the entire
        // paste-with-trailing-annotation / paste-from-URL-permalink /
        // paste-from-YAML-comment cross-idiom-leak surface that would
        // silently round-trip through any downstream shell / YAML / URL /
        // dotenv / gitconfig / HCL parsing layer to a different value than
        // the resolver's `Path::join` sees.
        //
        // The arm fires AFTER the shell-quote-grouping arm because the prior
        // arm's `'` / `"` shape is the more semantic-locating axis on values
        // that probe as both (`"../'x'#pin"` carries both `'` and `#` — the
        // shell-string-literal-delimiter is the load-bearing root-cause edit,
        // so `FonteCaminhoShellQuoteGrouping` wins; same cascade discipline
        // every prior `:caminho` arm establishes). The arm fires BEFORE the
        // trailing-`/` arm because the embedded comment-lead / fragment-
        // delimiter byte is the more semantic-locating axis on probe-as-both
        // values (`"../caixa-teia#pin/"` ends in `/` but the load-bearing
        // diagnostic is the embedded `#` — the trailing `/` is the secondary
        // observation, and an author who removes the `#pin` fragment is
        // likely to also tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'#' {
                return Err(DepError::FonteCaminhoShellComment {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's URL-percent-encoding-escape arm. The 6622063
        // shell-comment arm closes the `#` URL-fragment-identifier byte; `%`
        // (`0x25`) is the orthogonal RFC 3986 §2.1 URL percent-encoding-escape
        // byte — the mandatory encoding mechanism for every byte outside the
        // `unreserved` alphanumeric / `-` / `.` / `_` / `~` set, and `%`
        // itself must be percent-encoded as `%25` to appear literally inside
        // a URL value. The byte carries three distinct render-determinism
        // hazards on the `:caminho` axis, no prior arm has covered it, and
        // the peer `:fonte :repo` axis (a323db8 `%` on `is_git_repo_url`)
        // already closes the same byte under the same URL-percent-encoding
        // banner — the `:caminho` axis was the last typed path-string surface
        // still admitting the byte.
        //
        // First, the paste-from-browser-address-bar percent-encoded-space
        // footgun: an author copies `../caixa%20teia` out of a URL-encoded
        // README hyperlink / a browser address bar / a percent-encoded
        // permalink expecting `%20` to decode to a literal space at the
        // filesystem layer. POSIX `std::path::Path` treats the byte as a
        // literal path-component byte, so `Path::join` looks for a literal
        // `./../caixa%20teia` subdirectory and fails at resolve time with a
        // non-self-locating `No such file or directory` error far from the
        // source caixa.lisp — while the author's mental model was
        // `../caixa teia`, the decoded shape. Two authors whose only
        // difference is percent-encoding presence resolve to two distinct
        // BLAKE3 closures (`path:../caixa%20teia` vs `path:../caixa teia`)
        // for what they intended as the byte-identical sibling-workspace
        // dep. The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so the divergence rides
        // downstream into the BLAKE3 closure and locks the substrate's
        // "the lacre is the build's identity" contract (CAIXA-SDLC §III.2)
        // to the wrong encoding — the same THEORY.md §V.2 render-
        // determinism vector every prior `:caminho` arm protects.
        //
        // Second, the printf-format-specifier lead footgun: `%` is the C /
        // POSIX printf format-directive lead-in (`%s`, `%d`, `%02x`, the
        // canonical `printf "path=%s\n" ../caixa-teia` invocation every
        // shell-diagnostic one-liner carries) and the printf builtin is
        // wired into every POSIX shell (bash / zsh / dash / ksh / busybox
        // ash) as the format-string lead. A `:caminho "../caixa-%s-teia"`
        // value flowing into any future `feira` verb that shells out with a
        // printf-formatted path template silently gets reinterpreted as a
        // format-directive rather than a literal byte — the canonical
        // CWE-134 format-string-injection vector.
        //
        // Third, the bash-job-control-specifier lead footgun: bash / zsh /
        // ksh reserve `%N` at word-start as the job-control specifier —
        // `%1` names "job 1", `%%` names "the current job", `%foo` names
        // "the most recent job whose command started with `foo`". A future
        // `feira` verb that invokes `kill %1` on a caminho-scoped
        // subprocess would silently redirect the signal to a wrong target.
        //
        // Beyond the three shell-side hazards, `%` is a first-class parser
        // byte in three cross-config-DSL layers the substrate's paste-idiom
        // surface routinely crosses: YAML 1.2 §6.8.1 lexes `%` at
        // line-start as the directive lead (`%YAML 1.2` / `%TAG` — a
        // `:caminho "%YAML/1.2/../caixa-teia"` paste from a top-of-doc
        // YAML directive block silently trips the YAML directive parser on
        // any downstream emitted YAML manifest); Prometheus / Grafana
        // template syntax uses `%(var)s` as the substitution lead; and Nix
        // interpolation uses `${var}` (not `%`) but Envsubst /
        // Kubernetes / OpenShift template layers use `%VAR%` as the
        // Windows-shell env-var-reference lead — the paste-from-`.bat` /
        // paste-from-PowerShell-`%env:PATH%` cross-idiom leak.
        //
        // The three malformed-`%HH` classes documented on the peer
        // `is_git_repo_url` `%` arm (a323db8) apply here too:
        //
        //   - The lone-`%` malformed-escape shape (`"../caixa-teia%foo"`
        //     where `%` isn't followed by two hex digits) — every WHATWG-
        //     conformant URL parser rejects the value at parse time per
        //     RFC 3986 §2.1, but the byte rides into the lacre before
        //     the resolver subprocess crosses the URL-parser boundary.
        //   - The over-encoded path-separator shape (`"../caixa%2Fteia"`
        //     intending the `%2F` as the URL encoding of `/`) locks a
        //     `path:../caixa%2Fteia` BLAKE3 closure that diverges from
        //     the byte-identical `path:../caixa/teia` form.
        //   - The double-encoded shape (`"../caixa%2520teia"` — the `%25`
        //     already itself an encoded `%`, so the intent was likely a
        //     literal `%20` that survived one round-trip through a
        //     URL-encoder that shouldn't have run) locks a triply-
        //     divergent closure across the encoded / once-decoded /
        //     twice-decoded chain.
        //
        // POSIX `std::path::Path` treats the byte as a literal path-
        // component byte, so a `:caminho "../caixa%20teia"` (the canonical
        // paste-from-browser-address-bar percent-encoded-space footgun),
        // `:caminho "%YAML/../caixa-teia"` (the symmetric paste-from-YAML-
        // directive-block cross-idiom leak), or `:caminho
        // "../caixa-%s-teia"` (the printf-format-specifier paste-from-
        // shell-diagnostic-one-liner shape) silently passes every prior arm
        // because `Path::is_absolute` returns false on `..`, `%` is neither
        // a leading-byte sentinel nor a control byte nor `\` nor `<` / `>`
        // nor `|` nor `;` nor `&` nor backtick nor `*` / `?` nor `(` / `)`
        // nor `{` / `}` nor `[` / `]` nor `'` / `"` nor `#`, and the
        // value's last byte isn't `/`. The resolver folds the value through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // subdirectory named `../caixa%20teia` and fails at resolve time
        // with a non-self-locating `No such file or directory` error far
        // from the source caixa.lisp — while every downstream URL parser /
        // shell printf builtin / YAML directive parser silently
        // reinterprets the byte to a different value than the resolver's
        // `Path::join` sees. Two workstations whose downstream URL / shell
        // / YAML layers differ in `%HH` recognition emit divergent build
        // artifacts for the byte-identical caixa.lisp value.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`, caixa-
        // resolver/src/resolve.rs:189), so the byte lands in the BLAKE3
        // closure and rides into every shell-spawned subprocess (the
        // resolver's `git clone`, a future `feira tofu` shell-out, a
        // future operator-side `nix flake check` spawn) as the canonical
        // URL-percent-encoding-escape / printf-format-specifier / bash-
        // job-control-specifier surface every peer single-token-shaped
        // typed slot already closes. This arm closes the gap so the
        // substrate-wide "no URL-percent-encoding-escape / printf-format-
        // specifier / job-control-specifier / YAML-directive-lead byte
        // anywhere in a typed string slot that flows verbatim into a
        // shell-spawned subprocess or downstream URL / printf / YAML
        // parser" invariant extends from shell-comment / URL-fragment
        // (`#` — 6622063) to URL-percent-encoding-escape (`%`) on the
        // `:caminho` axis.
        //
        // The arm fires AFTER the shell-comment arm because the prior
        // arm's `#` shape is the more semantic-locating axis on values
        // that probe as both (`"../caixa%20teia#pin"` carries both `%`
        // and `#` — the URL-fragment-identifier is the load-bearing
        // downstream-truncation edit, so `FonteCaminhoShellComment` wins;
        // same cascade discipline every prior `:caminho` arm establishes).
        // The arm fires BEFORE the trailing-`/` arm because the embedded
        // percent-encoding-escape byte is the more semantic-locating axis
        // on probe-as-both values (`"../caixa%20teia/"` ends in `/` but
        // the load-bearing diagnostic is the embedded `%` percent-
        // encoding-escape — the trailing `/` is the secondary observation,
        // and an author who decodes the `%20` to a literal space is
        // likely to also tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'%' {
                return Err(DepError::FonteCaminhoUrlPercentEncoding {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's embedded-`$` shell-variable-expansion /
        // command-substitution / arithmetic-expansion arm. The f4efe9c
        // leading-`$` arm at line 540 routes `caminho.starts_with('$')`
        // through `FonteCaminhoVarExpansion` under the leading-byte-
        // sentinel host-layout-leak banner (peer with the b94fd83
        // absolute / a5c248e tilde leading-byte arms), but the arm
        // fires only at position 0 — a `:caminho "../foo$HOME/bar"`
        // (embedded `$HOME` in a nested path segment — the canonical
        // paste-from-`ls ../foo$HOME/bar`-shell-one-liner footgun where
        // an author copies a partially-substituted shell one-liner and
        // the leading segment is a literal `../foo` while the mid
        // segment carries the un-substituted `$HOME` template), a
        // `:caminho "../foo${WORKSPACE}/bar"` (the symmetric braced-CI-
        // manifest paste-from-`.gitlab-ci.yml` / paste-from-GitHub-
        // Actions-workflow shape), a `:caminho "../foo$(whoami)/bar"`
        // (the paste-from-shell-prompt command-substitution idiom), or
        // a `:caminho "../foo$((1+2))/bar"` (the arithmetic-expansion
        // idiom) silently passes every prior arm because
        // `Path::is_absolute` returns false on `..`, `$` is neither a
        // leading-byte sentinel (the f4efe9c arm fires only at position
        // 0) nor a control byte nor `\` nor `<` / `>` nor `|` nor `;`
        // nor `&` nor backtick nor `*` / `?` nor `(` / `)` nor `{` /
        // `}` nor `[` / `]` nor `'` / `"` nor `#` nor `%`, and the
        // value's last byte isn't `/`. Note that `$(...)` command-
        // substitution and `$((...))` arithmetic-expansion each carry
        // an embedded `(` byte that the 0633c91 shell-subshell-grouping
        // arm catches structurally at the earlier `(` position — but
        // an author who reaches for the sh-brace-substitution
        // `${VAR}` or the bare `$VAR` shape carries only the `$` byte,
        // which no prior arm covers. This arm closes the last
        // positional gap on the `$` byte on the `:caminho` axis so
        // every position — leading (`FonteCaminhoVarExpansion`) and
        // embedded (`FonteCaminhoShellVariableExpansion`) — is
        // structurally rejected.
        //
        // Every POSIX shell (sh / bash / zsh / dash / ksh / busybox
        // ash / fish / nushell) lexes `$` as the variable-expansion /
        // command-substitution / arithmetic-expansion operator per
        // POSIX.1-2017 §2.6 (Word Expansions): `$<name>` (Parameter
        // Expansion) expands a named variable, `${<name>}` (Parameter
        // Expansion braced form) does the same with an explicit token
        // boundary, `$(<cmd>)` (Command Substitution modern form,
        // `` `<cmd>` `` legacy form which the c370458 backtick arm
        // already closes) runs a subshell and substitutes its stdout,
        // and `$((<expr>))` (Arithmetic Expansion) evaluates an
        // arithmetic expression. Every form is a host-layout /
        // environment-state / shell-subprocess-side-effect leak when
        // the byte lands in a value the resolver passes to a shell-
        // spawned subprocess. Beyond the POSIX shell layer, `$` is
        // the Nix `${var}` string-interpolation lead (the paste-from-
        // `flake.nix` / paste-from-`.nix`-attribute cross-idiom leak
        // where an author copies `"${pkgs.hello}/bin/hello"` out of a
        // nix expression), the Make `$(var)` / `$@` / `$<` automatic-
        // variable lead (the paste-from-`Makefile` shape), the
        // JavaScript / TypeScript template-literal `${expr}` interp
        // lead (the paste-from-JS-template-string idiom in a
        // multi-lang-monorepo where a `path` attribute gets copied out
        // of a `package.json` script or a Vite config), the envsubst /
        // Kubernetes / OpenShift template `${VAR}` interp lead (the
        // paste-from-Helm-values / paste-from-K8s-manifest cross-idiom
        // leak), the PHP variable lead (`$_GET`, `$_ENV` — the paste-
        // from-`.php`-config footgun), the Perl scalar-variable lead
        // (`$foo`), the SASS / SCSS variable lead (`$primary-color`),
        // and the SQL bind-parameter lead in PostgreSQL / SQLite
        // (`$1`, `$2` — the paste-from-`.sql`-migration idiom). The
        // cross-idiom paste-footgun surface is broader than any single
        // shell layer — `$` is a first-class parser byte in nearly
        // every config / templating / build-system DSL the substrate's
        // paste-idiom surface routinely crosses. The peer `:fonte
        // :repo` axis closes the byte under the shell-variable-
        // expansion / URL-sub-delim banner (b9d187c `$` on
        // `is_git_repo_url`), the peer `:fonte :tag` / `:fonte :branch`
        // axes close `$` as part of `is_git_ref_name`'s printable-
        // ASCII-restricted grammar (`git check-ref-format` rejects the
        // byte outright), and the peer `:entrada :paths` axis closes
        // `$` via `is_gateway_api_http_path`'s eleven-byte RFC-3986-
        // reserved set. The `:caminho` axis was the last typed path-
        // string surface still admitting `$` at positions other than 0.
        //
        // POSIX `std::path::Path` treats `$` as a literal path-
        // component byte, so `:caminho "../foo$HOME/bar"` silently
        // routes through `Path::new(caminho).join(<file>)` looking for
        // a literal `./{caminho}` subdirectory that fails at resolve
        // time with a non-self-locating `No such file or directory`
        // error far from the source caixa.lisp. But every downstream
        // shell / envsubst / Nix / Make / K8s-template parser silently
        // reinterprets the byte to a different value than the
        // resolver's `Path::join` sees — so a `feira tofu` shell-out
        // to a `cd '{caminho}'` command line, a `nix flake check`
        // invocation on an emitted YAML `path:` scalar folded through
        // envsubst, or a `helm template` invocation with a
        // `values.yaml` `path: {caminho}` embedded in a `{{`-quoted
        // template all disagree with the resolver on which directory
        // the value names. Two workstations whose downstream shell /
        // envsubst / Nix / Make / K8s-template parsing layers differ
        // in `$VAR` recognition (or, worse, expand the byte against
        // divergent environments — Alice's `$HOME=/home/alice`, Bob's
        // `$HOME=/home/bob`) emit divergent build artifacts for the
        // byte-identical caixa.lisp value. Even in the case where the
        // resolver strictly does NOT expand `$VAR` (the current
        // implementation) the divergence still bites at the lacre-
        // identity axis: the lacre pipeline embeds the value verbatim
        // in its per-dep content-address (`conteudo:
        // format!("path:{caminho}")`, caixa-resolver/src/resolve.rs:189),
        // so `path:../foo$HOME/bar` locks a BLAKE3 closure distinct
        // from the byte-identical-semantic `path:../foo/home/alice/bar`
        // one author would have produced by substituting the literal
        // value at author time, defeating the THEORY.md §V.2 render-
        // determinism contract on the same axis every prior `:caminho`
        // arm protects.
        //
        // Beyond the render-determinism / host-layout-leak vectors,
        // `$` at any position in a value flowing verbatim into a
        // shell-spawned subprocess is the canonical CWE-78 shell-
        // command-injection surface every peer single-token-shaped
        // typed slot already closes. A `:caminho "../foo$(whoami)/bar"`
        // that rides into a future `feira tofu` shell-out as `cd
        // '../foo$(whoami)/bar'` gets substituted by the shell at
        // subprocess-argument-expansion time even inside single quotes
        // in fewer positions than one might expect (the substitution
        // fires only outside single-quoting per POSIX §2.2.2, but
        // eval-style wrappers and `sh -c` layers that route the value
        // through re-parsing round-trip the substitution — the same
        // vector the c370458 backtick arm closes at the sibling
        // command-substitution-legacy-form surface). Every future
        // `feira` verb that shells out with a `caminho`-formatted
        // subprocess argument silently inherits this substitution
        // vector unless the typed slot's accepted set structurally
        // excludes the byte.
        //
        // Frontier inspiration: OTP's `gen_server` return-value grammar
        // rejects mid-tuple shell-metachar bytes by construction —
        // `{noreply, State}` never carries a raw `$` because the
        // Erlang term type system has no notion of "string that gets
        // shelled out"; caixa's typed slots inherit the same
        // structural discipline (types-are-theorems, the compounding
        // mandate's leverage-point-1) by refusing values that would
        // silently reinterpret at any downstream layer. Peer with
        // Unison's content-addressed code (no ambient environment —
        // every reference is a hash, no `$VAR` substitution possible)
        // and Pony's capabilities (a path capability that carries a
        // `$` would be ill-typed at the reference layer).
        //
        // The arm fires AFTER the URL-percent-encoding-escape arm (the
        // e3558fa `%` arm) because a value carrying both `%` and `$`
        // (`"../foo%20$HOME/bar"` — the canonical "I pasted a percent-
        // encoded space next to a `$HOME` template") surfaces the
        // narrower URL-encoding diagnostic first — the paste-from-
        // browser-address-bar shape is the load-bearing self-locating
        // edit on every probe-as-both value; same cascade discipline
        // every prior `:caminho` arm establishes (a323db8 %  before
        // this arm, this arm before trailing-`/`). The arm fires
        // BEFORE the trailing-`/` arm because the embedded shell-
        // variable-expansion byte is the more semantic-locating axis
        // on probe-as-both values (`"../foo$HOME/bar/"` ends in `/`
        // but the load-bearing diagnostic is the embedded `$` — the
        // trailing `/` is the secondary observation, and an author
        // who substitutes the `$HOME` template with a literal value is
        // likely to also tab-strip the trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'$' {
                return Err(DepError::FonteCaminhoShellVariableExpansion {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-history-expansion / RFC-3986-sub-delims
        // arm. The immediate-predecessor `$` embedded arm closes the shell-
        // variable-expansion / command-substitution byte; `!` (`0x21`) is the
        // orthogonal POSIX shell-history-expansion sentinel every interactive
        // shell with history enabled (bash / ksh / zsh's `bashcompat` /
        // csh / tcsh) lexes as the history-expansion prefix: `!command`
        // re-runs the most recent history entry beginning with `command`,
        // `!!` re-runs the prior command verbatim, `!$` substitutes the
        // last word of the prior command, `!:N` substitutes the Nth word,
        // `^old^new` rewrites the prior command's `old` to `new` (the
        // canonical set of `set -o histexpand` operators bash's default
        // interactive session enables). Beyond the shell-history layer,
        // RFC 3986 §2.2 lists `!` in the `sub-delims` set (the URL grammar
        // admits the byte inside a path segment, but every WHATWG-conformant
        // special-scheme URL parser percent-encodes it inside a query
        // component via the 'special-query percent-encode set' the peer
        // `is_git_repo_url` `*` / `(` / `)` / `'` arms close on); the byte
        // is also the C / C++ / Rust / JavaScript / Python bang-operator
        // (logical-negation prefix — the paste-from-source-code idiom where
        // an author copies `!path.exists()` out of a Rust snippet and the
        // trailing punctuation crosses the string-literal boundary); the
        // canonical English-typography emphasis / exclamation mark (the
        // paste-from-prose enthusiasm-form idiom where an author writes
        // `:caminho "../caixa-teia!"` expecting the substrate to coerce it
        // to a kebab-case slug); and the Nix flake-ref import-attribute
        // `import ./foo.nix { … }` sibling operator surface.
        //
        // POSIX `std::path::Path` treats `!` as a literal path-component
        // byte, so a `:caminho "../caixa-teia!sudo"` (the canonical paste-
        // from-shell-history footgun where the author copies a `cd
        // ../caixa-teia && !sudo make install` one-liner from a quick-
        // start README and the trailing `!sudo` rides in verbatim as a
        // history-expansion reference), a `:caminho "../foo!!/bar"` (the
        // `!!` repeat-prior-command paste idiom), a `:caminho
        // "../caixa-teia!"` (the English-typography enthusiasm-form
        // paste-from-prose footgun), or a `:caminho "../foo!$"` (the
        // last-word-substitution shape) silently pass every prior arm
        // because `Path::is_absolute` returns false on `..`, `!` is neither
        // a leading-byte sentinel nor a control byte nor `\` nor `<` / `>`
        // nor `|` nor `;` nor `&` nor backtick nor `*` / `?` nor `(` / `)`
        // nor `{` / `}` nor `[` / `]` nor `'` / `"` nor `#` nor `%` nor `$`,
        // and the value's last byte isn't `/`. The resolver folds the value
        // through `Path::new(caminho).join(<file>)` looking for a literal
        // `./../caixa-teia!sudo` subdirectory and fails at resolve time
        // with a non-self-locating `No such file or directory` error far
        // from the source caixa.lisp — while every downstream interactive
        // shell with `set -o histexpand` reinterprets the byte as the
        // history-expansion prefix, and the failure mode forks per
        // consumer: a `feira tofu` shell-out to a `cd '{caminho}'` command
        // line executed under `bash -i` (the operator-notebook interactive
        // shell) substitutes the `!sudo` reference to the most recent
        // history entry starting with `sudo`, silently invoking whatever
        // privileged command that entry named.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so the byte lands in the
        // BLAKE3 closure and rides into every shell-spawned subprocess
        // (the resolver's `git clone`, a future `feira tofu` shell-out,
        // a future operator-side `nix flake check` spawn) as the
        // canonical shell-history-expansion / RFC-3986-sub-delims surface
        // every peer single-token-shaped typed slot already closes. The
        // peer `:fonte :repo` axis closes the byte under the same shell-
        // history-expansion / RFC-3986-sub-delims banner (7d53c68 `!` on
        // `is_git_repo_url`); the `:caminho` axis was the last typed
        // path-string surface still admitting the byte. This arm closes
        // the gap so the substrate-wide "no shell-composition
        // metacharacter / history-expansion sentinel anywhere in a typed
        // string slot that flows verbatim into a shell-spawned subprocess"
        // invariant extends from shell-variable-expansion (`$`) to shell-
        // history-expansion (`!`) on the `:caminho` axis. Together with
        // the peer c370458 backtick command-substitution-legacy-form arm
        // and the b9d187c-`$`-embedded-variable-expansion arm on the
        // sibling `:repo` axis, the typed `:caminho` accepted set now
        // structurally excludes every byte the POSIX shell §2.6 Word
        // Expansions section, §2.3 Token Recognition step 6, and every
        // history-expansion / brace-expansion / pathname-expansion /
        // parameter-expansion / command-substitution / arithmetic-
        // expansion operator lexes as a first-class parser byte.
        //
        // Frontier inspiration: Unison's content-addressed code (no
        // ambient environment — every reference is a hash, no `!<num>`
        // history-index substitution possible; the caixa substrate's
        // lacre discipline arrives at the same guarantee by refusing
        // bytes at manifest-parse time that would reinterpret against
        // ambient shell history state); Pony's capabilities (a path
        // capability that carries a `!` would be ill-typed at the
        // reference layer).
        //
        // The arm fires AFTER the shell-variable-expansion arm because a
        // value carrying both `$` and `!` (`"../foo$HOME/bar!sudo"` — the
        // canonical "I pasted a `$HOME`-templated path adjacent to a
        // trailing `!sudo` history-expansion") surfaces the narrower
        // shell-variable-expansion diagnostic first — the paste-from-CI-
        // manifest-with-`$VAR`-template shape is the load-bearing self-
        // locating edit on every probe-as-both value; same cascade
        // discipline every prior `:caminho` arm establishes. The arm
        // fires BEFORE the trailing-`/` arm because the embedded shell-
        // history-expansion byte is the more semantic-locating axis on
        // probe-as-both values (`"../foo!sudo/"` ends in `/` but the
        // load-bearing diagnostic is the embedded `!` — the trailing `/`
        // is the secondary observation, and an author who removes the
        // `!sudo` history reference is likely to also tab-strip the
        // trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'!' {
                return Err(DepError::FonteCaminhoShellHistoryExpansion {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's shell-history-substitution / RFC-3986-unwise
        // / regex-anchor arm. The immediate-predecessor `!` arm closes the
        // POSIX `!command` / `!!` / `!$` history-expansion prefix; `^`
        // (`0x5E`) is the paired-operator half of the same bash-reference
        // §9.3 histexpand feature — the `^old^new^` "quick substitution"
        // form (POSIX bash rewrites the prior command's `old` string to
        // `new` and re-executes it, the canonical typo-correction one-
        // liner idiom `git clone <bad-url>` → `^bad^good` that pastes the
        // trailing substitution fragment verbatim into a `:caminho` value
        // when the author trims only the leading `git clone` prefix). The
        // peer `:fonte :repo` axis closes the byte under the same
        // shell-history-substitution / RFC-3986-unwise banner (49e142f `^`
        // on `is_git_repo_url`); the `:caminho` axis was the last typed
        // path-string surface still admitting the byte after 6a04767
        // landed the `!` arm.
        //
        // Beyond bash history-substitution, `^` carries five distinct
        // downstream-reinterpretation surfaces the typed slot's accepted
        // set must structurally exclude:
        //
        // 1. **RFC 3986 §2 'unwise' set** — the four-byte cross-transport
        //    layer set (`{`, `}`, `|`, `\`) plus `^` every URL parser is
        //    required to percent-encode-or-refuse at the wire boundary.
        //    The WHATWG URL spec's 'fragment percent-encode set' maps
        //    `^` → `%5E` at the query / fragment component transition;
        //    libcurl silently percent-encodes the byte on the wire, so a
        //    `:caminho "../foo^bar"` value the resolver's `Path::join`
        //    sees as a literal `./../foo^bar` subdirectory diverges from
        //    the byte-transformed `%5E` shape any downstream `feira tofu`
        //    curl-invocation or artifact-registry-fetch would emit — the
        //    canonical wire-boundary divergence vector the peer
        //    `{`, `}`, `|`, `\` `:caminho` arms already close (
        //    `FonteCaminhoShellBraceExpansion` at 598b770,
        //    `FonteCaminhoShellPipe` at the pipe arm,
        //    `FonteCaminhoBackslash` at the backslash arm).
        // 2. **Regex character-class negation prefix `[^abc]`** — the
        //    canonical paste-from-doc-regex-pipeline footgun where an
        //    author copies a `grep '[^abc]'` idiom from a docs quick-
        //    listing and the character-class negation byte rides in
        //    verbatim.
        // 3. **Bitwise XOR operator** in C / C++ / Rust / Python /
        //    JavaScript / Nix / Go — the paste-from-source-code idiom
        //    where an author copies an `x ^ y`-shaped expression out of
        //    a source snippet and the operator crosses the string-
        //    literal boundary.
        // 4. **Windows `cmd.exe` escape metacharacter** — the byte
        //    escapes the next character in a `cmd.exe` batch context (a
        //    peer of the backslash arm's Windows-separator-leak vector).
        //    A `:caminho "..^&whoami"` cross-platform paste-from-batch-
        //    file footgun reinterprets at every `cmd.exe`-spawned
        //    subprocess (the resolver's future Windows-runner shell-out,
        //    the operator's WinRM path, a future PowerShell-embedded
        //    invocation).
        // 5. **LaTeX / Markdown / BibTeX superscript operator** — the
        //    paste-from-typeset-doc footgun where a mathematical
        //    superscript notation (`x^2` / `M^T`) leaks from prose.
        //
        // POSIX `std::path::Path` treats `^` as a literal path-component
        // byte, so `:caminho "../foo^bar/baz"` (embedded quick-
        // substitution), `:caminho "../foo^"` (trailing history-
        // substitution-open shape), `:caminho "../[^a-z]/foo"` (regex-
        // negation-prefix paste from a grep pipeline; note the `[` / `]`
        // arm at 986963b fires first on this shape), or `:caminho
        // "../x^y"` (XOR-expression paste-from-source) all silently pass
        // every prior arm (`^` isn't `\` / `<` / `>` / `|` / `;` / `&` /
        // backtick / `*` / `?` / `(` / `)` / `{` / `}` / `[` / `]` / `'`
        // / `"` / `#` / `%` / `$` / `!`) and route through
        // `Path::new(caminho).join(<file>)` looking for a literal
        // `./{caminho}` subdirectory that fails at resolve time with a
        // non-self-locating `No such file or directory` error far from
        // the source caixa.lisp — while every downstream shell / curl /
        // regex / `cmd.exe` layer reinterprets the byte to its own
        // semantic.
        //
        // The lacre pipeline embeds the value verbatim in its per-dep
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so the byte lands in the
        // BLAKE3 closure and rides into every shell-spawned subprocess
        // (the resolver's `git clone`, a future `feira tofu` shell-out,
        // a future operator-side `nix flake check` spawn) as the
        // canonical shell-history-substitution / RFC-3986-unwise /
        // regex-negation surface every peer single-token-shaped typed
        // slot already closes. This arm together with the immediate-
        // predecessor `!` arm (6a04767) closes the full `set -o
        // histexpand` operator surface on the `:caminho` axis — the
        // `!command` / `!!` / `!$` prefix form via `!`, the `^old^new^`
        // quick-substitution form via `^` — so the substrate-wide "no
        // shell-history operator anywhere in a typed string slot that
        // flows verbatim into a shell-spawned subprocess" invariant
        // extends from the `!` prefix half to the `^` quick-substitution
        // half. Every peer bash-history operator now fails at manifest-
        // parse time with a self-locating diagnostic naming the offending
        // caixa.lisp rather than at resolve-time as a `Path::join`-
        // derived `No such file or directory` (harmless but non-self-
        // locating) or worse riding into a downstream `bash -i` context
        // that reinterprets the byte-pair against ambient history state.
        //
        // Frontier inspiration: bash reference §9.3 HISTORY EXPANSION
        // "Quick substitution. Repeat the previous command, replacing
        // string1 with string2." + RFC 3986 §2 'unwise' set
        // ("characters that gateways and other transport agents are
        // known to sometimes modify") + Pony's capabilities (a path
        // capability that carries a `^` would be ill-typed at the
        // reference layer, matching the same structural discipline the
        // sibling `!` history-expansion arm inherits from Unison's
        // content-addressed no-ambient-history discipline).
        //
        // The arm fires AFTER the shell-history-expansion `!` arm because
        // a value carrying both `!` and `^` (`"../foo!sudo^bad^good"` —
        // the canonical "I pasted a `!sudo` history-reference next to a
        // `^bad^good` quick-substitution") surfaces the narrower prefix-
        // form `!` diagnostic first — the `!` form is the load-bearing
        // self-locating edit on every probe-as-both value (an author who
        // removes the `!sudo` reference is likely to also strip the
        // paired `^` substitution fragment); same cascade discipline
        // every prior `:caminho` arm establishes. The arm fires BEFORE
        // the trailing-`/` arm because the embedded shell-history-
        // substitution byte is the more semantic-locating axis on
        // probe-as-both values (`"../foo^bar/"` ends in `/` but the
        // load-bearing diagnostic is the embedded `^` — the trailing `/`
        // is the secondary observation, and an author who removes the
        // `^bar` substitution fragment is likely to also tab-strip the
        // trailing separator).
        for &b in caminho.as_bytes() {
            if b == b'^' {
                return Err(DepError::FonteCaminhoShellHistorySubstitution {
                    nome: nome.to_string(),
                    caminho: caminho.to_string(),
                    byte: b,
                });
            }
        }
        // Reproducibility gate's trailing-`/` arm. The b94fd83 absolute arm
        // closes the leading-`/` host-layout-leak; the embedded-control-byte
        // arm closes any byte-in-the-`0x00..=0x1F` / `0x7F` range; the
        // backslash arm closes the cross-host-OS-separator vector. The
        // trailing-`/` is the orthogonal shell-tab-completion-on-a-directory
        // footgun — `Path::join("../caixa-teia")` and
        // `Path::join("../caixa-teia/")` resolve to the same directory
        // (POSIX path-component-walk treats trailing `/` as a no-op for
        // directory targets, which `:caminho` always names — the sibling-
        // workspace dep root is structurally a directory). The lacre
        // pipeline embeds the value verbatim in its per-dep content-address
        // (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so byte-identical caixa
        // semantic-meaning yields two distinct BLAKE3 closures depending on
        // whether the author shell-tab-completed the path (every interactive
        // shell appends `/` on tab-completing a directory, idiomatic in
        // bash / zsh / fish / nushell), pasted from `pwd` (which on most
        // shells emits without trailing `/`, but `realpath -e -m` on a
        // directory with trailing `/` preserves it), or copied a Cargo
        // `path = "../caixa-teia/"` entry from cross-substrate documentation
        // (Cargo accepts both shapes and folds them the same way). Two
        // workstations whose authors differ only in tab-completion habits
        // emit byte-divergent lacres for the byte-identical-semantic caixa,
        // and the substrate's "the lacre is the build's identity" contract
        // (CAIXA-SDLC §III.2) silently breaks far from the source caixa.lisp.
        //
        // Same THEORY.md §V.2 render-determinism axis every prior `:caminho`
        // arm protects, here against the trailing-separator divergence
        // vector: every typed slot's accepted set excludes byte-divergent
        // values that round-trip to the same downstream semantic. The peer
        // path-shaped axes already reject trailing separators on the same
        // contract: [`crate::render::is_gateway_api_http_path`] gates
        // `:entrada :paths` against any non-canonical normalization, and
        // [`crate::render::is_sandboxed_relative_path`] gates the M2 typed
        // path-slots (`:behavior :on-*`, `:upgrade-from :state-change
        // :script`, `:bibliotecas`, `:exe`, `:servicos`) against shapes
        // whose canonical form would re-introduce determinism divergence.
        //
        // The arm fires last in the cascade because every prior arm carries
        // a more self-locating diagnostic on values that probe as both
        // (e.g. `:caminho "../foo/\0/"` ends in `/` but the load-bearing
        // diagnostic is the NUL byte's POSIX-syscall-rejection — the
        // control-char arm wins; `:caminho "/etc/passwd/"` ends in `/` but
        // the load-bearing diagnostic is the absolute host-layout-leak —
        // the absolute arm wins; `:caminho "..\caixa-teia/"` ends in `/`
        // but the load-bearing diagnostic is the Windows-separator cross-
        // OS divergence — the backslash arm wins). The arm covers every
        // shape where the last byte is `/` regardless of length, including
        // the degenerate single-`/` (which the absolute arm catches first)
        // and the consecutive-`//` (where every prior arm passes on the
        // bytes other than the trailing `/`).
        if caminho.as_bytes().last() == Some(&b'/') {
            return Err(DepError::FonteCaminhoTrailingSlash {
                nome: nome.to_string(),
                caminho: caminho.to_string(),
            });
        }
        Ok(())
    }
}

impl Dep {
    /// Substrate-canonical per-`:deps` / `:deps-dev` entry `:nome` scalar
    /// accessor every consumer of the dep-graph identity axis keys off —
    /// returns the author-declared `:nome` byte-string verbatim as a
    /// `&str`, borrowed from the typed slot's own [`String`] storage.
    ///
    /// The `:deps :nome` / `:deps-dev :nome` slot carries the DNS-1123
    /// label that names the target caixa (validated by [`Self::validate`]
    /// through the shared [`crate::render::is_dns_1123_label`] predicate,
    /// same accept-set the peer caixa-identifier axes carry — top-level
    /// [`crate::Caixa::nome`], per-`:membros` [`crate::Membro::nome`],
    /// per-`:children` [`crate::supervisor::ChildSpec::nome`]). Every
    /// downstream consumer that fans on the dep's name-identity keys off
    /// this scalar: the [`crate::Caixa::validate_deps`] per-list
    /// [`crate::render::insert_first_seen`] dedup key + the paired
    /// [`DepError::DuplicateNome`] carrier the walk raises on collision,
    /// the cross-list [`validate_no_self_dep`] parent-name equality gate
    /// on both `:deps` and `:deps-dev` traversals, the `caixa-resolver`
    /// pipeline's `HashSet<String>` seen-set the closure walker gates
    /// requeueing off (`caixa-resolver/src/resolve.rs:55`), the resolver's
    /// per-transitive-target requeue path (`resolve.rs:63,66`), the
    /// [`crate::DepSource::default_github`]-shaped resolver-side shorthand
    /// fill-in that folds `:nome` into the fetched-git-URL (`resolve.rs:147`),
    /// every `caixa-resolver` `ResolveError::MissingPath` /
    /// `ResolveError::MissingPin` carrier that names the offending dep
    /// (`resolve.rs:177,206`), each resolved
    /// `caixa-lacre::LacreEntry` `nome:` field the closure hash keys off
    /// (`resolve.rs:108,113`), and the peer `feira lock` stub-resolver's
    /// `LacreEntry` emitter (`caixa-feira/src/cmd/lock.rs:59,61,64`).
    ///
    /// Prior to this lift the `.nome` byte-string was read inline at every
    /// production site — the [`crate::Caixa::validate_deps`] paired
    /// `dep.nome.as_str()` / `dep.nome.clone()` accesses on both `:deps`
    /// and `:deps-dev` traversals, the [`validate_no_self_dep`] pair of
    /// parent-equality checks, and every caixa-resolver / caixa-feira
    /// site enumerated above — open-coded field-accesses that expressed
    /// no compile-time link back to the typed slot. A future extension of
    /// the `:deps :nome` axis to a richer author surface (a per-scope
    /// alias table the resolver folds through the `~/.config/caixa/config.yaml`
    /// entry the [`crate::dep::Dep`] docstring already acknowledges, a
    /// namespace-qualified rewrite the future M4 lacre-federation layer
    /// applies per-cluster, a promotion of the plain [`String`] byte-string
    /// to a richer scoped-identifier newtype once cross-registry federation
    /// lands) would have had to be threaded through every open-coded copy
    /// in lockstep or two consumers would silently disagree on which caixa
    /// a given dep resolves to — the [`crate::Caixa::validate_deps`] dedup
    /// set treating the name as `"caixa-teia"` while the caixa-resolver
    /// closure walker treated it as `"tenant-a/caixa-teia"` would silently
    /// split the [`DepError::DuplicateNome`] refusal from the resolver's
    /// requeue-suppression seen-set, one build-time diagnostic
    /// disagreeing with the run-time closure the substrate's lacre
    /// pipeline actually materializes. Lifting the resolution rule to a
    /// typed method on the substrate primitive means every downstream
    /// consumer of the caixa's per-`:deps` identity surface reaches for
    /// exactly one typed dispatch — the resolver's accept-set migrates as
    /// a unit on any future axis addition.
    ///
    /// First accessor on the outer `Dep` type — opens the outer-`Dep`
    /// `&str`-return required-scalar projection pattern the sibling
    /// per-`Dep` `:versao` future lift folds on. Peer of the sibling
    /// per-`:membros` [`crate::Membro::nome`] (4a32abf) /
    /// per-`:children` [`crate::supervisor::ChildSpec::nome`] (dfb4a81)
    /// / top-level [`crate::Caixa::nome`] (e6b7d97) caixa-identity scalar
    /// accessors — same "one typed dispatch on the substrate primitive,
    /// thin projections at each consumer" discipline extended onto the
    /// third named-caixa-referencing axis (`:deps` / `:deps-dev`), the
    /// remaining unlifted caixa-name-referencing accessor family in the
    /// substrate. Named `nome()` to match the tatara-lisp author-surface
    /// term the field's docstring already reaches for ("Caixa name — must
    /// match the target caixa's `:nome`") and the peer caixa-identity
    /// accessor family the substrate already carries.
    #[must_use]
    pub fn nome(&self) -> &str {
        self.nome.as_str()
    }

    /// Substrate-canonical per-`:deps` / `:deps-dev` entry `:versao`
    /// Cargo-shaped semver-requirement scalar accessor every consumer of
    /// the dep-graph version-pin axis keys off — returns the author-
    /// declared `:versao` requirement byte-string verbatim as a `&str`,
    /// borrowed from the typed slot's own [`String`] storage.
    ///
    /// The `:deps :versao` / `:deps-dev :versao` slot carries the
    /// Cargo-shaped semver requirement string (`"^0.1"`, `"~0.1.2"`,
    /// `"0.1.0"`, `"*"`) the shared [`crate::version::parse_requirement`]
    /// entry-point consumes — same accept-set the peer requirement-
    /// carrying axes carry (per-`:membros`
    /// [`crate::Membro::versao_requirement`], per-`:children`
    /// [`crate::supervisor::ChildSpec::versao_requirement`]), validated
    /// through the shared
    /// [`crate::render::require_valid_versao_requirement`] cascade in
    /// [`Self::validate`]. Every downstream consumer that fans on the
    /// dep's version-pin keys off this scalar: the [`Self::validate`]
    /// `require_valid_versao_requirement` gate + the paired
    /// [`DepError::VersaoInvalid`] carrier the cascade raises on
    /// requirement-shape rejection, the `feira lock` stub-resolver's
    /// `format!("{}@{}", dep.nome(), dep.versao_requirement())`
    /// `conteudo` hash-input interpolation and the paired
    /// `LacreEntry.versao:` `String`-carry fill (`caixa-feira/src/cmd/lock.rs`),
    /// and the peer `feira lock` end-to-end fixture in `caixa-feira/tests/feira_e2e.rs`.
    ///
    /// Prior to this lift the `.versao` byte-string was read inline at
    /// every production site — the [`Self::validate`] paired
    /// `&self.versao` requirement-gate reference and `self.versao.clone()`
    /// error-body carrier, the `caixa-feira/src/cmd/lock.rs` paired
    /// `format!("{}@{}", dep.nome(), dep.versao)` `conteudo` interpolation
    /// and `versao: dep.versao.clone()` `LacreEntry` fill, and the
    /// `caixa-feira/tests/feira_e2e.rs` end-to-end fixture's pair of the
    /// same shapes — open-coded field-accesses that expressed no
    /// compile-time link back to the typed slot. A future extension of
    /// the `:deps :versao` axis to a richer author surface (a per-scope
    /// version-lock overlay the resolver folds through the
    /// `~/.config/caixa/config.yaml` entry the [`crate::dep::Dep`]
    /// docstring already acknowledges, a per-cluster canary-version
    /// overlay per MESH-COMPOSITION §III.2, a promotion of the plain
    /// [`String`] requirement to a richer parsed-`VersionReq` newtype
    /// once cross-registry federation lands) would have had to be
    /// threaded through every open-coded copy in lockstep or two
    /// consumers would silently disagree on which release constraint a
    /// given dep resolves to — the [`Self::validate`] requirement-gate
    /// call reading `"^0.1"` while the `feira lock` stub-resolver's
    /// `conteudo` hash-input read `"tenant-a-pin/^0.1"` would silently
    /// split the [`DepError::VersaoInvalid`] refusal from the lacre's
    /// content-addressed hash the substrate's fetch pipeline actually
    /// materializes, one build-time diagnostic disagreeing with the
    /// run-time closure. Lifting the resolution rule to a typed method
    /// on the substrate primitive means every downstream consumer of
    /// the caixa's per-`:deps` version-pin surface reaches for exactly
    /// one typed dispatch — the resolver's accept-set migrates as a
    /// unit on any future axis addition.
    ///
    /// Second accessor on the outer `Dep` type — folds on the outer-
    /// `Dep` `&str`-return required-scalar projection pattern the
    /// sibling per-`Dep` [`Self::nome`] (eba2cde) accessor opened. Peer
    /// of the per-`:membros` [`crate::Membro::versao_requirement`]
    /// (a40b0e3) / per-`:children`
    /// [`crate::supervisor::ChildSpec::versao_requirement`] (7844f4e
    /// family) member/child version-pin accessors — the three
    /// requirement-carrying axes (`Dep::versao_requirement` on the
    /// per-caixa dep-graph edge, `Membro::versao_requirement` on the M3
    /// Aplicacao side, `ChildSpec::versao_requirement` on the M2
    /// Supervisor side) now share one accessor discipline for the
    /// shared substrate concept "another caixa referenced by a
    /// Cargo-shaped semver requirement". The pair
    /// `(nome(), versao_requirement())` jointly projects the
    /// `(nome, versao)` field pair every dep-graph consumer that fans
    /// on per-dep identity + version pin keys off. Named
    /// `versao_requirement()` rather than `versao()` because the field's
    /// storage-side `.versao` label is already the author-surface term
    /// (`:versao`); the accessor's name carries the semantic role — the
    /// semver *requirement* string the shared
    /// [`crate::version::parse_requirement`] entry-point consumes — so a
    /// raw field access and a typed dispatch read differently at every
    /// consumer site. Matches the peer
    /// [`crate::Membro::versao_requirement`] /
    /// [`crate::supervisor::ChildSpec::versao_requirement`] naming
    /// discipline verbatim.
    #[must_use]
    pub fn versao_requirement(&self) -> &str {
        self.versao.as_str()
    }

    /// Substrate-canonical per-`:deps` / `:deps-dev` entry `:fonte`
    /// Zig-store-model per-dep source-tuple optional-composite-reference
    /// accessor every consumer of the dep-graph fetch-source axis keys
    /// off — returns the author-declared `:fonte` typed [`DepSource`]
    /// verbatim as an `Option<&DepSource>` borrowed from the typed slot's
    /// own `Option<DepSource>` storage, with `None` naming the "author
    /// omitted `:fonte`" shorthand every resolver-side default-fill
    /// (`caixa-feira/src/cmd/lock.rs`'s stub, `caixa-resolver/src/resolve.rs`'s
    /// canonical fetcher, per the [`DepSource::default_github`] fallback
    /// the [`Dep::fonte`] field docstring already documents) treats as
    /// the "resolve through the configured default host / org
    /// (`github:<default-org>/<nome>`)" partition.
    ///
    /// The `:deps :fonte` / `:deps-dev :fonte` slot carries the two-
    /// arm typed [`DepSource`] the `Zig-style git-only store model` the
    /// enclosing [`Dep`] docstring names — `DepSource::Git { repo, tag,
    /// rev, branch }` for the git-clone arm every published caixa
    /// resolves through, `DepSource::Path { caminho }` for the dev-only
    /// local-filesystem arm every unpublishable in-tree checkout
    /// resolves through. Every downstream consumer that fans on the
    /// dep's fetch-source keys off this accessor: [`Self::validate`]'s
    /// per-`:fonte` [`DepSource::validate`] delegation (which raises
    /// the empty-`:repo` / missing-pin / multiple-pin / empty-`:caminho`
    /// diagnostics through the [`DepError::Fonte*`] carrier family
    /// naming the offending `Dep::nome`), the caixa-crd conversion
    /// crate's `dep_into_ref` two-arm projection into the `CaixaSource`
    /// `{repo, git_ref}` pair the K8s-CR side consumes
    /// (`caixa-crd/src/conversion.rs`), and — through the paired
    /// resolver-side default-fill's `Option::unwrap_or_else` — every
    /// `caixa-feira` / `caixa-resolver` fetch site that requires a
    /// concrete `DepSource` at run time.
    ///
    /// Prior to this lift the `.fonte` typed slot was read inline at
    /// every production site — the [`Self::validate`]
    /// `if let Some(ref fonte) = self.fonte` bracket the per-`:fonte`
    /// gate delegates through, the caixa-crd `dep_into_ref`
    /// `d.fonte.as_ref().and_then(...)` two-arm `CaixaSource` projector,
    /// the resolver-side `caixa-feira/src/cmd/lock.rs` / `caixa-resolver/src/resolve.rs`
    /// `dep.fonte.clone().unwrap_or_else(...)` default-fill pair — open-
    /// coded field-accesses that expressed no compile-time link back to
    /// the typed slot. A future extension of the `:deps :fonte` axis
    /// to a richer author surface (a per-scope source-override table
    /// the resolver folds through the `~/.config/caixa/config.yaml`
    /// entry the [`Dep`] docstring already acknowledges, a per-org
    /// mirror-fallback list the future M4 lacre-federation resolver
    /// consults ahead of the `default_github` fallback, a promotion of
    /// the plain `Option<DepSource>` to a richer
    /// `{primary, mirrors, integrity}` triple once cross-registry
    /// federation lands, a per-dep `sri:sha256-…` integrity slot the
    /// M4 lacre gate binds against ahead of the git-fetch) would have
    /// had to be threaded through every open-coded copy in lockstep or
    /// two consumers would silently disagree on which fetch source a
    /// given dep resolves to — the [`Self::validate`] per-`:fonte`
    /// gate reading the author-declared source while the caixa-crd
    /// projector read a per-scope-override-resolved source would
    /// silently split the build-time refusal from the CR the
    /// substrate's admission pipeline actually materializes, one
    /// build-time diagnostic disagreeing with the run-time closure.
    /// Lifting the resolution rule to a typed method on the substrate
    /// primitive means every downstream consumer of the caixa's per-
    /// `:deps` fetch-source surface reaches for exactly one typed
    /// dispatch — the resolver's accept-set migrates as a unit on any
    /// future axis addition.
    ///
    /// First outer-`Dep` `Option<&Composite>`-return composite-reference
    /// accessor — opens the outer-`Dep` `Option<&Composite>` composite-
    /// reference projection pattern the sibling per-`Dep` `:opcional`
    /// (`Option<Copy>` — the plain-bool axis) / `:caracteristicas`
    /// (`&[String]` — the feature-flag list) future outer scalar / slice
    /// lifts fold on. Peer of the outer-top-level [`crate::Caixa`]
    /// `Option<&Composite>` composite-reference sub-family the
    /// [`crate::Caixa::limits`] (b2bd9d7) / [`crate::Caixa::behavior`]
    /// (35d8b52) / [`crate::Caixa::politicas`] (5d23d29) /
    /// [`crate::Caixa::placement`] (4fb8074) / [`crate::Caixa::entrada`]
    /// (e4128e4) accessors already close on the outer [`crate::Caixa`]
    /// altitude, and of the outer M3 mesh-slot [`crate::AplicacaoSpec`]
    /// altitude the sibling [`crate::AplicacaoSpec::entrada`] (d32111c)
    /// accessor already carries — extends that "one typed dispatch on
    /// the substrate primitive, thin projections at each consumer"
    /// discipline onto the third outer typed-slot altitude that carries
    /// an `Option<Composite>` axis (`Dep`, the outer per-dep-list-entry
    /// slot). Returns `Option<&DepSource>` (not the owning composite by
    /// copy or clone) because every downstream consumer of the fonte
    /// composite treats it as a read-only per-arm dispatch source — the
    /// reference-view is the narrowest borrow that supports every
    /// present + roadmapped consumer (per-arm match projection at the
    /// caixa-crd `CaixaSource` two-arm emitter, presence-probe early
    /// return on the "author-omitted `:fonte` ⇒ resolver-side
    /// `default_github` fill applies" partition every resolver
    /// consults, `.cloned()`-on-demand for the two resolver-side
    /// default-fill call sites that require an owned `DepSource` for
    /// `Option::unwrap_or_else`) without cloning the composite through
    /// every consumer's fast path. The `Option` half of the return-type
    /// preserves the load-bearing "author-omitted `:fonte` ⇒ resolver-
    /// side default applies" partition (not a default composite the
    /// downstream must reject on emptiness) — the accessor projects the
    /// raw `Option<DepSource>` slot's presence bit through the
    /// reference-return unchanged. Named `fonte()` to match the storage
    /// field's name verbatim and the tatara-lisp author-surface term
    /// (`:fonte`) the field's own docstring already carries.
    #[must_use]
    pub fn fonte(&self) -> Option<&DepSource> {
        self.fonte.as_ref()
    }

    /// Substrate-canonical per-`:deps` / `:deps-dev` entry
    /// `:caracteristicas` Cargo-shaped feature-toggle-set slice accessor
    /// every consumer of the dep-graph feature-flag axis keys off —
    /// returns the author-declared `:caracteristicas` feature-name list
    /// verbatim as a `&[String]` slice-view over the same backing buffer
    /// the raw `self.caracteristicas.as_slice()` field access borrows
    /// from. Empty-list-carrying (`:caracteristicas` is a default-empty
    /// axis every `Dep` supplies with `Vec::new()` when the author omits
    /// the slot; the [`crate::Caixa::from_lisp`] derive folds an omitted
    /// `:caracteristicas` through `#[serde(default)]` to `Vec::new()`,
    /// so a `Dep` past parse definitionally carries a `Vec<String>` slot
    /// — possibly empty — and the returned `&[String]` degenerates to
    /// an empty slice on that arm without any silent `None` collapse).
    ///
    /// The `:deps :caracteristicas` / `:deps-dev :caracteristicas` slot
    /// carries the set-shaped feature-toggle list the substrate walks
    /// through the [`Self::validate_caracteristicas`] per-entry shape +
    /// duplicate cascade — same Cargo `[dependencies.<dep>.features]`
    /// accept-set (per-entry Cargo-feature-name grammar via the shared
    /// [`crate::render::is_cargo_feature_name`] predicate, cross-entry
    /// uniqueness via the shared [`crate::render::insert_first_seen`]
    /// walk, empty-first / value-shape-second / duplicate-third
    /// precedence via the peer per-axis two-arm cascade discipline every
    /// substrate-blessed Vec-keyed-by-name slot already follows).
    /// Every downstream consumer that fans on the dep's feature-toggle
    /// keys off this accessor: [`Self::validate_caracteristicas`]'s
    /// per-entry linear walk that gates each feature-name byte-string
    /// through the empty / value-shape / duplicate arms (raising the
    /// [`DepError::CaracteristicaEmpty`] / [`DepError::CaracteristicaInvalid`]
    /// / [`DepError::CaracteristicaDuplicate`] carrier family naming the
    /// offending `Dep::nome`), and every future
    /// per-`Caixa`-manifest / caixa-resolver / caixa-crd feature-toggle-
    /// facing consumer the CAIXA-SDLC §I roadmap acknowledges (the
    /// future caixa-resolver per-dep feature-projection walk that folds
    /// the toggle set into the resolved [`crate::Caixa`]'s activated
    /// [`crate::render::CARGO_FEATURE_NAME_MAX_LEN`]-bounded feature
    /// closure ahead of the lacre hash, the future caixa-crd per-`spec.deps`
    /// features slice the K8s-CR admission gate consumes, the future
    /// per-cluster feature-overlay the M4 lacre-federation resolver
    /// composes ahead of the substrate-wide feature-name accept-set).
    ///
    /// Prior to this lift the `.caracteristicas` byte-string list was
    /// read inline at the [`Self::validate_caracteristicas`] `for c in
    /// &self.caracteristicas` walk — the only in-crate consumer of the
    /// raw field beyond the per-`Dep` constructor pair
    /// ([`Self::simple`] / [`Self::git`]) and the paired serde
    /// round-trip / per-test fixture-mutation paths — an open-coded
    /// field-access that expressed no compile-time link back to the
    /// typed slot. A future extension of the `:caracteristicas` axis to
    /// a richer author surface (a per-scope feature-overlay the resolver
    /// folds through the `~/.config/caixa/config.yaml` entry the
    /// [`Dep`] docstring already acknowledges, a per-cluster feature-
    /// activation overlay the future M4 lacre-federation layer applies
    /// per-CR, a promotion of the plain `Vec<String>` byte-string list
    /// to a richer parsed-feature-set newtype once the Cargo-shaped
    /// namespaced-dep `dep/feat` syntax the value-shape gate's
    /// docstring anticipates lands) would have had to be threaded
    /// through every open-coded copy in lockstep or two consumers
    /// would silently disagree on which feature closure a given dep
    /// activates — the [`Self::validate_caracteristicas`] gate walking
    /// the author-declared list while a downstream caixa-resolver
    /// consumer walked a per-scope-override-resolved list would
    /// silently split the build-time refusal from the lacre closure
    /// the substrate's fetch pipeline actually materializes, one
    /// build-time diagnostic disagreeing with the run-time closure.
    /// Lifting the resolution rule to a typed method on the substrate
    /// primitive means every downstream consumer of the caixa's per-
    /// `:deps` feature-toggle surface reaches for exactly one typed
    /// dispatch — the resolver's accept-set migrates as a unit on any
    /// future axis addition.
    ///
    /// First outer-`Dep` `&[T]`-return slice accessor — opens the
    /// outer-`Dep` `&[String]` slice projection pattern the sibling
    /// per-`Dep` `:opcional` (`bool` — the plain-`Copy`-scalar axis)
    /// future outer scalar lift folds on and closes the outer-`Dep`
    /// slot-family the sibling [`Self::nome`] (eba2cde) /
    /// [`Self::versao_requirement`] (05529b1) / [`Self::fonte`] (d65d1bf)
    /// accessors already open, leaving the `:opcional` `Copy`-scalar arm
    /// as the sole remaining unlifted outer-`Dep` slot. Peer of the
    /// outer top-level [`crate::Caixa`] `&[String]`-return foreign-code-
    /// slot sub-family ([`crate::Caixa::bibliotecas`] 8a36c23,
    /// [`crate::Caixa::exe`] 65d9527, [`crate::Caixa::servicos`]
    /// 611f78b) and the outer top-level [`crate::Caixa`] universal-axis
    /// text-tag family ([`crate::Caixa::autores`] b5d813f,
    /// [`crate::Caixa::etiquetas`] 78c7d3c) that already carry the
    /// `&[String]` slice-projection discipline on the outer-`Caixa`
    /// altitude — extends the "one typed dispatch on the substrate
    /// primitive, thin projections at each consumer" discipline onto the
    /// outer per-dep-list-entry [`Dep`] altitude's set-shaped byte-
    /// string list slot. Returns `&[String]` (not `&Vec<String>`)
    /// because every downstream consumer of the feature-toggle list
    /// treats it as a read-only sequence — the slice-view is the
    /// narrowest borrow that supports every present + roadmapped
    /// consumer (`.iter()`, `.len()`, `.is_empty()`) without leaking
    /// the backing `Vec`'s grow/push/reserve surface no consumer of
    /// the typed view reaches for (the storage-side `Vec` remains
    /// reachable through the `pub caracteristicas` field for the
    /// mutation-carrying serde round-trip and per-test fixture-mutation
    /// paths). Named `caracteristicas()` to match the storage field's
    /// name verbatim and the tatara-lisp author-surface term
    /// (`:caracteristicas`) the field's own docstring already carries.
    #[must_use]
    pub fn caracteristicas(&self) -> &[String] {
        self.caracteristicas.as_slice()
    }

    /// Substrate-canonical per-`:deps` / `:deps-dev` entry `:opcional`
    /// missing-source-tolerance flag scalar accessor every consumer of
    /// the dep-graph opt-in-fetch axis keys off — returns the author-
    /// declared `:opcional` `bool` verbatim, `Copy`-projected from the
    /// typed slot's own `bool` storage (no borrow of `&self` past the
    /// call; the `Copy`-return arm matches the peer
    /// [`crate::Caixa::max_restarts`] (eba5211) `Option<u32>` `Copy`-
    /// projected sibling discipline the outer flat-spread family
    /// already carries). Default-`false` (`#[serde(default,
    /// skip_serializing_if = "is_false")]` on the storage slot, so a
    /// `Dep` past parse definitionally carries a `bool` — `false` when
    /// the author omits `:opcional` — and the returned value degenerates
    /// to `false` on that arm without any silent `None` collapse).
    ///
    /// The `:deps :opcional` / `:deps-dev :opcional` slot carries the
    /// per-entry "if this dep's `:fonte` cannot be resolved, treat the
    /// missing-source arm as a soft-fail rather than a build refusal"
    /// bit — the same Cargo-shaped `[dependencies.<dep>.optional = true]`
    /// accept-set (an opcional dep whose `:fonte` fails to resolve is
    /// dropped from the resolved dep-graph rather than tripping the
    /// build-refusal edge that a mandatory `:opcional false` entry
    /// would). Every downstream consumer that fans on the dep's
    /// missing-source-tolerance keys off this accessor: the future
    /// caixa-resolver's per-`:fonte` resolve-fail arm (drop-vs-error
    /// dispatch on the opcional bit ahead of the lacre closure
    /// materialization), the future caixa-crd per-`spec.deps`
    /// `optional` boolean the K8s-CR admission gate consumes on the
    /// per-dep partition, and the future feira / caixa-resolver /
    /// caixa-crd feature-projection walk that folds the opcional bit
    /// into the resolved feature-closure the future M4 lacre-federation
    /// layer emits.
    ///
    /// Prior to this lift the `.opcional` `bool` slot was read inline
    /// at the sole in-crate consumer site — the tests-module
    /// `registry_dep_is_minimal` fixture's `assert!(!d.opcional)` gate
    /// pinning the [`Self::simple`] constructor's default-`false` fill
    /// (the only in-crate read of the raw field beyond the per-`Dep`
    /// constructor pair [`Self::simple`] / [`Self::git`] and the paired
    /// serde round-trip / per-test fixture-mutation paths) — an open-
    /// coded field-access that expressed no compile-time link back to
    /// the typed slot. A future extension of the `:opcional` axis to a
    /// richer author surface (a per-scope opcional-override the resolver
    /// folds through the `~/.config/caixa/config.yaml` entry the [`Dep`]
    /// docstring already acknowledges, a per-cluster opcional-override
    /// the future M4 lacre-federation layer applies per-CR, a promotion
    /// of the plain `bool` to a richer `OpcionalPolicy { drop, warn,
    /// error }` tri-state once the CAIXA-SDLC §II opcional-policy
    /// roadmap lands) would have had to be threaded through every open-
    /// coded copy in lockstep or two consumers would silently disagree
    /// on which missing-source arm a given dep resolves to — the
    /// [`Self::simple`] constructor's default-`false` fill reading
    /// verbatim while a downstream caixa-resolver consumer read a per-
    /// scope-override-resolved bit would silently split the build-time
    /// arm from the lacre closure the substrate's fetch pipeline
    /// actually materializes, one build-time diagnostic disagreeing
    /// with the run-time closure. Lifting the resolution rule to a
    /// typed method on the substrate primitive means every downstream
    /// consumer of the caixa's per-`:deps` opcional-tolerance surface
    /// reaches for exactly one typed dispatch — the resolver's accept-
    /// set migrates as a unit on any future axis addition.
    ///
    /// Fifth and final outer-`Dep` accessor — closes the outer-`Dep`
    /// slot-family the sibling per-`Dep` [`Self::nome`] (eba2cde) /
    /// [`Self::versao_requirement`] (05529b1) / [`Self::fonte`] (d65d1bf)
    /// / [`Self::caracteristicas`] (9197944) accessors opened, so every
    /// outer-`Dep` slot (`:nome`, `:versao`, `:fonte`, `:opcional`,
    /// `:caracteristicas`) now routes through exactly one typed
    /// dispatch on the substrate primitive. First outer-`Dep`
    /// `bool`-return / plain-`Copy`-scalar accessor — opens the
    /// outer-`Dep` `Copy`-scalar projection pattern that folds on the
    /// peer outer-top-level [`crate::Caixa`] `Option<Copy>`
    /// flat-spread sub-family ([`crate::Caixa::max_restarts`] eba5211,
    /// [`crate::Caixa::estrategia`] ed04d3c) the outer-`Caixa` altitude
    /// already carries — extends the "one typed dispatch on the
    /// substrate primitive, thin projections at each consumer"
    /// discipline onto the outer per-dep-list-entry [`Dep`] altitude's
    /// bool-shaped missing-source-tolerance slot. Returns `bool` by
    /// `Copy` (not by `&bool` reference) because `bool` is `Copy` and
    /// every downstream consumer treats it as a plain discriminant
    /// value — the by-value return is the narrowest return-shape that
    /// supports every present + roadmapped consumer (`.then(…)` early
    /// return on the resolver-side drop-vs-error partition, direct
    /// bool composition with a per-scope-override projector, plain
    /// `if dep.opcional() { … }` early return at every future admission
    /// gate) without leaking the storage field's `bool`-in-`&self`
    /// lifetime the by-value return elides. Marked `pub const fn` so
    /// the accessor is `const`-callable — same discipline the peer
    /// [`crate::Caixa::max_restarts`] `Option<u32>` `Copy`-return
    /// accessor carries. Named `opcional()` to match the storage
    /// field's name verbatim and the tatara-lisp author-surface term
    /// (`:opcional`) the field's own docstring already carries.
    #[must_use]
    pub const fn opcional(&self) -> bool {
        self.opcional
    }

    /// Build a minimal registry-sourced dep.
    #[must_use]
    pub fn simple(nome: impl Into<String>, versao: impl Into<String>) -> Self {
        Self {
            nome: nome.into(),
            versao: versao.into(),
            fonte: None,
            opcional: false,
            caracteristicas: Vec::new(),
        }
    }

    /// Build a Git-sourced dep (tag-based).
    #[must_use]
    pub fn git(
        nome: impl Into<String>,
        versao: impl Into<String>,
        repo: impl Into<String>,
        tag: impl Into<String>,
    ) -> Self {
        Self {
            nome: nome.into(),
            versao: versao.into(),
            fonte: Some(DepSource::Git {
                repo: repo.into(),
                tag: Some(tag.into()),
                rev: None,
                branch: None,
            }),
            opcional: false,
            caracteristicas: Vec::new(),
        }
    }

    /// Reject dependency entries whose `:nome` or `:versao` are empty,
    /// whose `:nome` is non-empty but not a valid DNS-1123 label,
    /// or whose `:versao` is non-empty but not a valid Cargo-shaped
    /// semver requirement.
    ///
    /// The author surface for `:deps :versao` (and `:deps-dev :versao`)
    /// is the same Cargo-shaped requirement string `:membros :versao`
    /// (validated at [`crate::AplicacaoSpec::validate`] since 9888b13)
    /// and `:children :versao` (validated at
    /// [`crate::SupervisorSpec::validate`] since b38ff3a) carry — and
    /// the lacre pipeline resolves all three axes through the same
    /// [`crate::parse_requirement`] entry-point. Until 2420c44 landed
    /// `:deps :versao` was the last `:versao` axis untyped past
    /// `Caixa::from_lisp`: a malformed-but-non-empty requirement
    /// (`"^bad-version"`, `"^^0.1"`, the canonical git-tag-shape-
    /// leaking-into-:versao `"v0.1"` typo, the accidental
    /// `"not-a-req"`) silently passed parse and the `semver::Error`
    /// surfaced at lacre-resolve time, far from the source
    /// caixa.lisp, with no field naming which `:deps` entry carried
    /// the typo. The diagnostic [`DepError::VersaoInvalid`] carries
    /// the offending entry's `:nome` + the offending `:versao`
    /// verbatim + the parser's own wording in `reason`, so the
    /// author's grep target is unambiguous.
    ///
    /// The author surface for `:deps :nome` is the same DNS-1123 label
    /// the peer caixa-identifier axes carry — top-level Caixa `:nome`
    /// (validated at [`crate::Caixa::validate_nome`] since 6c992f8),
    /// `:membros :caixa` (validated at
    /// [`crate::AplicacaoSpec::validate_membros`] since 3f9d7a0),
    /// `:children :caixa` (validated at
    /// [`crate::SupervisorSpec::validate`] since 31bfa43). A `:deps
    /// :nome` value flows verbatim through the lacre pipeline as the
    /// target caixa's `:nome` (which the gate at the *target* side now
    /// rejects if non-DNS-1123) and lands as the rendered caixa's
    /// `lareira-<nome>` Helm chart name segment, the per-dep
    /// `LABEL_PROGRAM` label value, and the `caixa-resolver`'s
    /// `~/.cache/caixa/<org>/<nome>` checkout-directory leaf. Until
    /// this gate landed `:deps :nome` was the fourth and last
    /// DNS-1123-shaped caixa-identifier axis still untyped past
    /// `Caixa::from_lisp`: a syntactically wrong dep name (`"Caixa-
    /// Teia"` uppercase — the canonical "I copied the README header"
    /// typo; `"caixa_teia"` underscore — the Go module / Python
    /// identifier leak; `"caixa-teia."` trailing dot — the FQDN
    /// confusion; `"-caixa-teia"` leading hyphen; a 64-byte slug)
    /// silently passed parse and surfaced at lacre-resolve time when
    /// the resolved target caixa's `:nome` failed *its* DNS-1123 gate
    /// — far from the source `:deps` entry, with a diagnostic naming
    /// the *target's* `:nome` rather than the dep entry that referenced
    /// it. Mirroring the 3f9d7a0 / 31bfa43 / 6c992f8 trajectory through
    /// the lifted [`crate::render::is_dns_1123_label`] predicate (the
    /// "before its third occurrence" PRIME DIRECTIVE boundary, THEORY.md
    /// §I.3.5): every `Dep::nome` past validate is DNS-1123-label-shaped,
    /// so every downstream consumer (caixa-resolver's lacre fetch,
    /// caixa-helm's `lareira-<nome>` chart name, the future M4 per-dep
    /// fan-out emitter) reaches for the name knowing the value is
    /// apiserver-valid without re-validating.
    ///
    /// Empty checks fire first (narrower diagnostic), parse last —
    /// same ordering discipline as
    /// [`crate::AplicacaoSpec::validate_membros`] and
    /// [`crate::SupervisorSpec::validate`]. `parse_requirement("")`
    /// returns `Ok(VersionReq::STAR)`, so the empty-`:versao` arm is
    /// structurally necessary even with the parse arm in place. The
    /// `:nome` shape gate runs after the `:nome` empty gate and before
    /// the `:versao` checks so a one-entry caixa.lisp with both wrong
    /// sees the name-side diagnostic first (the name is the
    /// self-locating axis — without it, the parse diagnostic can't
    /// quote `:nome "<bad>"`).
    pub fn validate(&self) -> Result<(), DepError> {
        if self.nome.is_empty() {
            return Err(DepError::NomeEmpty);
        }
        if let Err(reason) = crate::render::is_dns_1123_label(&self.nome) {
            return Err(DepError::NomeInvalid {
                nome: self.nome.clone(),
                reason,
            });
        }
        // Delegate the empty-first + `parse_requirement` cascade to the
        // shared [`crate::render::require_valid_versao_requirement`]
        // helper — same two-arm shape the peer
        // [`crate::AplicacaoSpec::validate_membros`] on `:membros
        // :versao` and [`crate::SupervisorSpec::validate`] on `:children
        // :versao` route through, so drift between the three axes'
        // accepted requirement sets is structurally impossible and the
        // parse-side no-op the empty-first arm closes (semver's empty
        // parse yields an implicit `*`) lives in exactly one predicate.
        crate::render::require_valid_versao_requirement(
            self.versao_requirement(),
            || DepError::VersaoEmpty {
                nome: self.nome.clone(),
            },
            |reason| DepError::VersaoInvalid {
                nome: self.nome.clone(),
                versao: self.versao_requirement().to_string(),
                reason,
            },
        )?;
        if let Some(fonte) = self.fonte() {
            fonte.validate(&self.nome)?;
        }
        self.validate_caracteristicas()?;
        Ok(())
    }

    /// Reject per-entry `:caracteristicas` (feature-flag) values that
    /// are operationally meaningless. The `:caracteristicas` slot is
    /// a set of feature toggles to enable on the target caixa — same
    /// shape as Cargo's `[dependencies.<dep>.features]` list — and
    /// two structural footguns close here:
    ///
    ///   - empty-string entry (`(:caracteristicas (""))`): the future
    ///     caixa-resolver lacre pipeline would consume the empty
    ///     identifier as a no-op feature enable, silently dropping the
    ///     author's intent far from the source `caixa.lisp`;
    ///   - duplicate entry within one dep (`(:caracteristicas ("http"
    ///     "http"))`): the feature-toggle slot is set-shaped (enabling
    ///     a feature twice has no additional semantic — there is no
    ///     `feature × 2`), so two entries naming the same feature are
    ///     a silent miscount, the same set-not-multiset distinction
    ///     every peer Vec-keyed-by-name axis already closes
    ///     ([`crate::SupervisorError::DuplicateChildCaixa`] on
    ///     `:children :caixa`, [`crate::AplicacaoError::MembroDuplicate`]
    ///     on `:membros :caixa`, [`crate::AplicacaoError::ContratoDuplicate`]
    ///     on `:contratos`, [`crate::AplicacaoError::PlacementClusterDuplicate`]
    ///     on `:placement :clusters`, [`crate::AplicacaoError::EntradaPathDuplicate`]
    ///     on `:entrada :paths`, [`crate::UpgradeError::DuplicateFrom`]
    ///     on `:upgrade-from :from`, [`crate::UpgradeError::DuplicateLoadModule`]
    ///     / [`crate::UpgradeError::DuplicateStateChange`] /
    ///     [`crate::UpgradeError::DuplicateCleanup`] on the within-
    ///     entry `:upgrade-from` axes, and [`DepError::DuplicateNome`]
    ///     on the cross-entry `:deps`/`:deps-dev` `:nome` axis the
    ///     immediate-predecessor 359fba5 closed).
    ///
    /// Same linear-walk + `HashSet` + first-collision diagnostic shape
    /// every peer set-not-multiset gate uses; the empty arm fires
    /// before the duplicate arm so an entry with both an empty feature
    /// *and* a duplicate of some later feature surfaces the empty-
    /// shape diagnostic first (the empty-feature axis is the
    /// more-actionable defect since the missing-name renders the
    /// duplicate-key arm ambiguous: two `""` entries would both report
    /// `caracteristica: ""` with no way to distinguish the offending
    /// site). Empty-first cascade discipline mirrors every peer per-
    /// entry shape + duplicate gate
    /// (`SupervisorSpec::validate`'s `EmptyChildName` before
    /// `DuplicateChildCaixa`; `validate_membros`'s `MembroCaixaEmpty`
    /// before `MembroDuplicate`).
    ///
    /// The per-entry value-shape gate (Cargo-feature-name grammar via
    /// the lifted [`crate::render::is_cargo_feature_name`] predicate)
    /// fires between the empty arm and the duplicate arm — the
    /// canonical per-entry-shape-before-cross-entry-uniqueness
    /// precedence every peer two-arm + value-shape gate establishes
    /// ([`crate::SupervisorSpec::validate`]'s `EmptyChildName` →
    /// `ChildCaixaInvalid` → `DuplicateChildCaixa`,
    /// [`crate::AplicacaoSpec::validate_membros`]'s `MembroCaixaEmpty`
    /// → `MembroCaixaInvalid` → `MembroDuplicate`, [`Dep::validate`]'s
    /// `NomeEmpty` → `NomeInvalid` → cross-list `DuplicateNome`).
    /// Until the value-shape arm landed `:caracteristicas` accepted
    /// every non-empty distinct string — a structurally invalid
    /// feature name (`"http feature"` whitespace, `"+http"` the
    /// canonical paste-from-`+optional-feature` doc activation-form
    /// footgun, `"-flag"` leading hyphen, `".feat"` leading dot,
    /// `"http/json"` Cargo's `dep/feat` namespaced-dep syntax that
    /// only applies inside list-grammar contexts, `"http,json"`
    /// list-separator-belongs-to-the-list-grammar miscomprehension,
    /// `"café"` un-percent-encoded non-ASCII silently round-tripping
    /// inconsistently across NFC/NFD normalization, the 65-byte
    /// paste-from-binary slug) silently passed validate and the
    /// failure surfaced at `cargo metadata` time as the
    /// `restricted_names::validate_feature_name` parser's rejection,
    /// far from the source `caixa.lisp`, with no field naming which
    /// `:deps` entry's `:caracteristicas` carried the typo. The
    /// lifted predicate makes the Cargo-feature-name-grammar
    /// intersection-floor a substrate-level invariant at validate
    /// time — same trajectory as the eight peer
    /// [`crate::render`] value-shape predicates each typed surface
    /// downstream of a structured grammar already follows
    /// ([`is_dns_1123_label`](crate::render::is_dns_1123_label),
    /// [`is_gateway_api_http_path`](crate::render::is_gateway_api_http_path),
    /// [`is_wit_world_ref`](crate::render::is_wit_world_ref),
    /// [`is_nats_subject`](crate::render::is_nats_subject),
    /// [`is_wasi_keyvalue_slot`](crate::render::is_wasi_keyvalue_slot),
    /// [`is_git_ref_name`](crate::render::is_git_ref_name),
    /// [`is_git_oid`](crate::render::is_git_oid),
    /// [`is_git_repo_url`](crate::render::is_git_repo_url)).
    fn validate_caracteristicas(&self) -> Result<(), DepError> {
        let mut seen = std::collections::HashSet::new();
        for c in self.caracteristicas() {
            if c.is_empty() {
                return Err(DepError::CaracteristicaEmpty {
                    nome: self.nome.clone(),
                });
            }
            if let Err(reason) = crate::render::is_cargo_feature_name(c) {
                return Err(DepError::CaracteristicaInvalid {
                    nome: self.nome.clone(),
                    caracteristica: c.clone(),
                    reason,
                });
            }
            crate::render::insert_first_seen(&mut seen, c.as_str(), || {
                DepError::CaracteristicaDuplicate {
                    nome: self.nome.clone(),
                    caracteristica: c.clone(),
                }
            })?;
        }
        Ok(())
    }
}

/// Cross-slot coherence gate on the dep-graph axis: no `:deps` or
/// `:deps-dev` entry may name the caixa's own `:nome`.
///
/// A caixa that lists itself as a dep is a degenerate self-edge in the
/// lacre closure's dep-graph — the closure is a DAG rooted at the
/// caixa's `:nome`, and the caixa-resolver's lacre pipeline traverses
/// every `:deps` / `:deps-dev` entry's target by name. A self-dep
/// hands the resolver a node that is its own parent: a one-node cycle
/// it either rejects mid-traversal far from the source `caixa.lisp`
/// (the resolver detecting infinite recursion on the closure walk) or,
/// worse, recurses on until it exhausts its stack. Because every
/// `:nome` is a globally-unique substrate identity (DNS-1123 label +
/// lacre closure root), a dep entry whose `:nome` equals the caixa's
/// own `:nome` *is* the caixa itself, not a coincidentally-named peer.
///
/// Lives outside [`Caixa::validate_deps`] because the dep-list view
/// carries the entries but not the parent `:nome`; mirrors the
/// cross-slot self-edge gates [`crate::supervisor::validate_no_self_supervision`]
/// (ad4abf1) on the `:children :caixa` axis and
/// [`crate::aplicacao::validate_no_self_membership`] on the
/// `:membros :caixa` axis — the same "an edge from a graph node to
/// itself is structurally not a tree/graph edge" discipline, here on
/// the third typed-name-graph axis (the dep closure; the supervision
/// tree and the Aplicacao membership set were the prior two).
///
/// Walks `:deps` first then `:deps-dev` so the diagnostic for a caixa
/// that self-references on both axes surfaces the `:deps` arm first —
/// the load-bearing axis the lacre closure resolves at every build,
/// peer with the canonical [`Caixa::validate_deps`] walk order
/// (`:deps` → `:deps-dev`).
///
/// Carries the offending list tag (`":deps"` or `":deps-dev"`)
/// verbatim into the diagnostic so the author can grep their
/// `caixa.lisp` for the offending block in one edit — same
/// `list: &'static str` shape [`DepError::DuplicateNome`] (359fba5)
/// uses on the cross-list duplicate-name axis.
///
/// `Code paths` (`:bibliotecas` / `:exe` / `:servicos`) are the
/// substrate-blessed shape for referencing the caixa's *own* code, so
/// the diagnostic names them as the corrective surface — every
/// legitimate "I want to use code from this caixa" authoring intent
/// routes through one of those three slots, not a self-dep.
pub fn validate_no_self_dep(
    deps: &[Dep],
    deps_dev: &[Dep],
    parent_nome: &str,
) -> Result<(), DepError> {
    for dep in deps {
        if dep.nome() == parent_nome {
            return Err(DepError::DepIsSelf {
                nome: parent_nome.to_string(),
                list: crate::render::DEP_AUTHOR_KEY_DEPS,
            });
        }
    }
    for dep in deps_dev {
        if dep.nome() == parent_nome {
            return Err(DepError::DepIsSelf {
                nome: parent_nome.to_string(),
                list: crate::render::DEP_AUTHOR_KEY_DEPS_DEV,
            });
        }
    }
    Ok(())
}

/// Errors raised by [`Dep::validate`].
///
/// Mirrors the per-axis error families the other `:versao`-carrying
/// typed surfaces expose
/// ([`crate::AplicacaoError::MembroVersaoEmpty`] /
/// [`crate::AplicacaoError::MembroVersaoInvalid`],
/// [`crate::SupervisorError::EmptyChildVersion`] /
/// [`crate::SupervisorError::ChildVersaoInvalid`]) so a future top-
/// level `CaixaError` (M4) sums these without reshaping the diagnostic.
#[derive(Debug, Error, PartialEq, Eq)]
pub enum DepError {
    #[error(
        ":deps entry has empty :nome (every dep must name a target caixa; \
         omit the entry instead of carrying an empty name)"
    )]
    NomeEmpty,
    #[error(
        ":deps entry :nome {nome:?} is not a valid DNS-1123 label: {reason} \
         (the value flows verbatim as the target caixa's `:nome`, the rendered \
         `lareira-<nome>` Helm chart name segment, the `LABEL_PROGRAM` label \
         value, and the resolver's checkout-directory leaf — each apiserver-side \
         schema rejects non-DNS-1123 names at admission time; use a lowercase \
         RFC 1123 label like `\"caixa-teia\"` or `\"pleme-mesh\"`, 1..=63 bytes, \
         pattern `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`)"
    )]
    NomeInvalid { nome: String, reason: String },
    #[error(
        ":deps entry {nome:?} has empty :versao (every dep must pin a semver \
         constraint that resolves through the lacre pipeline)"
    )]
    VersaoEmpty { nome: String },
    #[error(
        ":deps entry {nome:?} :versao {versao:?} is not a valid semver \
         requirement: {reason} (use Cargo-shaped forms like `\"^0.1\"`, \
         `\"~0.1.2\"`, `\"0.1.0\"`, or `\"*\"` — the same shape `:membros :versao` \
         and `:children :versao` carry; the lacre pipeline resolves all three \
         through the same parser)"
    )]
    VersaoInvalid {
        nome: String,
        versao: String,
        reason: String,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo git …) has empty :repo \
         (every git source must name a repo — use a `github:org/repo` \
         shorthand, an `https://…` URL, or an ssh-git URL; omit the \
         entire :fonte block to fall back to the default-host resolver \
         convention)"
    )]
    FonteRepoEmpty { nome: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo git …) :repo {repo:?} has \
         invalid value-shape: {reason} (the value flows verbatim into the \
         caixa-resolver's `git clone <repo>` subprocess invocation; every \
         documented form carries a `:` separator and no whitespace / \
         control / non-ASCII bytes — use a `github:org/repo` shorthand, \
         an `https://host/path` / `ssh://[user@]host/path` / \
         `git://host/path` / `file:///path` URL, or the `git@host:path` \
         scp-style SSH form)"
    )]
    FonteRepoShape {
        nome: String,
        repo: String,
        reason: String,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo git …) has no pin set \
         (set exactly one of :tag, :rev, or :branch so the resolver \
         can pick a reproducible commit; omit the entire :fonte block \
         to fall back to the default-host resolver convention, which \
         resolves the latest tag matching :versao)"
    )]
    FontePinMissing { nome: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo git …) has multiple pins \
         set ({pins}); exactly one of :tag, :rev, or :branch must be \
         set so the resolver's checkout target is unambiguous (the \
         resolver's silent precedence is :rev > :tag > :branch — if \
         you intended one specifically, drop the others)"
    )]
    FontePinAmbiguous { nome: String, pins: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo git …) has empty {pin} \
         (a set pin must name a non-empty git ref; drop the {pin} key \
         entirely to fall through to another pin axis)"
    )]
    FontePinEmpty { nome: String, pin: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo git …) {pin} {value:?} has invalid \
         value-shape: {reason} (the git porcelain enforces the same shape at \
         `git fetch` / `git checkout` time on every pin; use a leaf refname \
         like `\"v0.1.0\"` for `:tag` or `\"main\"` / `\"feature/foo\"` for \
         `:branch`, or a full 40/64 lowercase-hex commit OID for `:rev` — \
         drop any `refs/heads/` or `refs/tags/` prefix the caixa-resolver \
         prepends at clone time, and avoid abbreviated SHAs which are \
         ambiguous across repository history)"
    )]
    FontePinShape {
        nome: String,
        pin: String,
        value: String,
        reason: String,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) has empty :caminho \
         (every path source must name a non-empty filesystem path; \
         omit the entire :fonte block to fall back to the default-host \
         resolver convention)"
    )]
    FonteCaminhoEmpty { nome: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} is \
         absolute (the lacre pipeline embeds the value verbatim in its \
         per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, so an absolute path makes the \
         BLAKE3 closure differ across machines — defeating the \
         reproducibility contract that's load-bearing for CSE; express \
         the path relative to the caixa.lisp location, e.g. \
         \"../caixa-teia\" for a sibling workspace dep)"
    )]
    FonteCaminhoAbsolute { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} starts \
         with `~` (the leading-tilde is a shell-expansion convention, not a \
         POSIX path component — `Path::is_absolute` returns false on it, so \
         the b94fd83 absolute-path gate doesn't catch it, but the lacre \
         pipeline embeds the value verbatim in its per-dep content-address \
         `path:{caminho}` at caixa-resolver/src/resolve.rs:189 and the \
         caixa-resolver folds it through `Path::join` without `~`-expansion, \
         so the build looks for a literal `./{caminho}` subdirectory and \
         fails at resolve time far from the source caixa.lisp; even worse, a \
         future caixa-resolver pass that *does* expand `~` would silently \
         re-open the host-layout-leak the b94fd83 absolute gate closes — \
         Alice's `~` resolves to `/home/alice`, Bob's to `/home/bob`, two CI \
         runners with different `$HOME` layouts resolve to two distinct paths \
         for the byte-identical caixa, defeating the THEORY.md §V.2 render-\
         determinism contract; express the path relative to the caixa.lisp \
         location, e.g. \"../caixa-teia\" for a sibling workspace dep, or \
         spell out the full relative path explicitly if a workstation-rooted \
         dep is genuinely intended)"
    )]
    FonteCaminhoTildeExpansion { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} starts \
         with `$` (the leading-`$` is a shell-variable-expansion convention, \
         not a POSIX path component — `Path::is_absolute` returns false on it \
         and the a5c248e tilde gate doesn't catch it, but the lacre pipeline \
         embeds the value verbatim in its per-dep content-address \
         `path:{caminho}` at caixa-resolver/src/resolve.rs:189 and the \
         caixa-resolver folds it through `Path::join` without `$`-expansion, \
         so the build looks for a literal `./{caminho}` subdirectory and \
         fails at resolve time far from the source caixa.lisp; even worse, a \
         future caixa-resolver pass that *does* expand `$VAR` (the canonical \
         shell-convention idiom that CI's `${{WORKSPACE}}` paste-idiom \
         invites) would silently re-open the host-layout-leak the b94fd83 \
         absolute gate closes — Alice's `$HOME` resolves to `/home/alice`, \
         Bob's to `/home/bob`, two CI runners with different `${{WORKSPACE}}` \
         layouts resolve to two distinct paths for the byte-identical caixa, \
         defeating the THEORY.md §V.2 render-determinism contract; express \
         the path relative to the caixa.lisp location, e.g. \"../caixa-teia\" \
         for a sibling workspace dep, or spell out the full relative path \
         explicitly if a workstation-rooted dep is genuinely intended)"
    )]
    FonteCaminhoVarExpansion { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} starts \
         with a space (the leading ASCII space `0x20` is the orthogonal \
         paste-from-aligned-doc footgun that silently passes \
         `Path::is_absolute` and every prior leading-byte arm — \
         `\" ../caixa-teia\"` resolves via `Path::join` to a literal \
         `./ ../caixa-teia` subdirectory the resolver fails to find at \
         resolve time with a non-self-locating `No such file or directory` \
         error far from the source caixa.lisp; the lacre pipeline embeds \
         the value verbatim in its per-dep content-address `path:{caminho}` \
         at caixa-resolver/src/resolve.rs:189, so byte-divergent / \
         semantic-identical caixa values (` ../caixa-teia` vs \
         `../caixa-teia`) yield two distinct BLAKE3 closures across two \
         workstations whose authors differ only in paste-from-aligned- \
         caixa.lisp-doc whitespace habits — the most insidious failure \
         mode the typed slot can carry (no error surfaces; the divergence \
         is invisible until two machines compare lacres), defeating the \
         THEORY.md §V.2 render-determinism contract. The canonical \
         paste-from-aligned-`:deps`-block footgun (every `:fonte` form in \
         a multi-entry `:deps` block sits at the same column — an author \
         selecting `\"<sp><sp><sp>../caixa-teia\"` and pasting it from \
         the rendered alignment into a fresh entry preserves the leading \
         whitespace verbatim); peer `:fonte :repo` axis already rejects \
         leading whitespace via `is_git_repo_url`, `:fonte :tag` / \
         `:fonte :branch` via `is_git_ref_name`, `:descricao` via \
         `is_chart_description_shape`, `:licenca` via \
         `is_spdx_expression_shape`. Drop the leading space; express the \
         path as a bare relative single-token like \"../caixa-teia\")"
    )]
    FonteCaminhoLeadingWhitespace { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} starts \
         with `-` (the canonical CLI-argument-injection footgun on the \
         `:caminho` axis — the lacre pipeline embeds the value verbatim in \
         its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189 and the caixa-resolver folds it \
         through `Path::join` looking for a literal `./{caminho}` \
         subdirectory. Every downstream subprocess that consumes the resolved \
         path — `git -C {caminho} <verb>`, `terraform -chdir={caminho}`, \
         `nix build --path {caminho}`, `find {caminho}`, `stat {caminho}`, \
         `cp -r {caminho} …`, `rm -rf {caminho}` — reinterprets a leading-`-` \
         value as a CLI flag rather than a positional path when the invocation \
         does not carry a `--` argument-list terminator between the flag block \
         and the path (the common case at every porcelain entry point). The \
         canonical footguns: `:caminho \"-rf\"` (bare short-flag paste), \
         `:caminho \"-C\"` (`git -C -C` config-injection paste), \
         `:caminho \"--upload-pack=cat /etc/passwd\"` (the canonical long-flag \
         CLI-arg-injection vector at every git porcelain entry point that \
         consumes a path or URL argument, peer with is_git_repo_url's \
         leading-`-` arm on the sibling `:fonte :repo` axis), \
         `:caminho \"--config=…\"` (`git -c foo=bar` config-override paste). \
         POSIX `std::path::Path` treats a leading `-` as a literal filename \
         byte so the resolver folds `\"-rf\"` through `Path::join` and looks \
         for a literal `./-rf` subdirectory that fails at resolve time with a \
         non-self-locating `No such file or directory` error far from the \
         source caixa.lisp — but on any downstream shell-out without `--` the \
         reinterpretation is silent and the failure mode is arbitrary-\
         argument-injection. Peer arms: `is_git_repo_url` (render.rs:2037) \
         rejects leading `-` on `:fonte :repo` for `git clone <repo>` CLI-\
         arg-injection; `is_git_ref_name` (render.rs:1381, 5a28454) rejects \
         leading `-` on `:fonte :tag` / `:branch` for `git checkout <ref>` \
         CLI-arg-injection; `is_dns_1123_label` rejects leading `-` on every \
         DNS-1123-shaped axis (top-level Caixa `:nome`, `:membros :caixa`, \
         `:children :caixa`, `:deps :nome`, cluster names); \
         `is_cargo_feature_name` rejects leading `-` on `:caracteristicas`; \
         the feira `init` / `add <nome>` positional gate (868c191) rejects \
         leading `-` on the CLI positional itself. Express the path as a bare \
         relative single-token like \"../caixa-teia\" — the sibling-workspace \
         directory name carries no leading-hyphen semantic, and `./` / `../` \
         prefixes structurally partition the leading-byte set to safe values.)"
    )]
    FonteCaminhoLeadingHyphen { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains \
         ASCII control byte 0x{byte:02x} (POSIX paths reject NUL `0x00` outright — \
         every `std::fs` syscall routes the path through `CString::new` which \
         fails with `NulError` at resolve time; the lacre pipeline embeds the \
         value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189 so a control byte anywhere in the \
         value lands in the BLAKE3 closure and breaks the THEORY.md §V.2 render-\
         determinism contract — the canonical paste-from-multiline-doc \
         (`\\n`/`\\r`), paste-from-aligned-table (`\\t`), or paste-from-binary-\
         blob (`0x00`-DEL) footgun every peer single-token-shaped axis \
         (`:fonte :repo`, `:fonte :tag`/`:branch`, the Helm chart-string axes) \
         already gates against. Express the path as a relative single-line ASCII \
         string, e.g. \"../caixa-teia\" for a sibling workspace dep)"
    )]
    FonteCaminhoControlChar {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains `\\` \
         (POSIX `std::path::Path` treats `\\` as a literal byte inside a single path \
         component, so `..\\caixa-teia` is one directory named literally `..\\caixa-teia` — \
         not the parent's sibling — and the caixa-resolver folds the value through \
         `Path::join` looking for a literal `./{caminho}` subdirectory that fails at \
         resolve time with a non-self-locating `No such file or directory` error far \
         from the source caixa.lisp; Windows `std::path::Path` treats `\\` as a \
         primary path separator equal to `/`, so byte-identical caixa.lisp values \
         resolve to two distinct directories across runner OSes — the lacre pipeline \
         embeds the value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, defeating the THEORY.md §V.2 render-\
         determinism contract via the cross-host-OS-separator divergence vector. The \
         canonical Windows-Explorer `Copy as path` / PowerShell `Get-Location` \
         paste-idiom footgun; peer `:fonte :tag` / `:fonte :branch` axis already \
         rejects `\\` via `is_git_ref_name` for the same Windows-path-leak reason, \
         and `:entrada :paths` rejects `\\` via `is_gateway_api_http_path`'s eleven-\
         byte RFC-3986-reserved set. Express the path with `/` as the separator, e.g. \
         \"../caixa-teia\" for a sibling workspace dep)"
    )]
    FonteCaminhoBackslash { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         redirection metacharacter 0x{byte:02x} `{ch}` (every interactive shell — bash / \
         zsh / fish / nushell — lexes `<` and `>` as input / output redirection \
         operators, so `:caminho \"../caixa-teia>build.log\"` is the canonical \
         paste-from-shell-pipeline footgun where an author copies a `command > log` \
         tail without trimming the redirect; POSIX `std::path::Path` treats both bytes \
         as literal path-component bytes, so the resolver folds the value through \
         `Path::new(caminho).join(<file>)` looking for a literal `./{caminho}` \
         subdirectory and fails at resolve time with a non-self-locating `No such \
         file or directory` error far from the source caixa.lisp. The lacre pipeline \
         embeds the value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, so the byte lands in the BLAKE3 closure \
         and rides into every shell-spawned subprocess (the resolver's `git clone`, a \
         future `feira tofu` shell-out, a future operator-side `nix` spawn) as the \
         canonical CRLF-at-subprocess-argument / shell-metachar injection surface every \
         peer single-token-shaped typed slot already closes. The peer `:fonte :tag` / \
         `:fonte :branch` axis already rejects `<` / `>` via `is_git_ref_name`, and \
         `:entrada :paths` rejects them via `is_gateway_api_http_path`'s eleven-byte \
         RFC-3986-reserved set. Express the path as a bare relative single-token like \
         \"../caixa-teia\" — the sibling-workspace directory name carries no shell-\
         redirection semantic.",
        ch = *byte as char
    )]
    FonteCaminhoShellRedirection {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-pipe \
         metacharacter `|` (every interactive shell — bash / zsh / fish / nushell — lexes \
         `|` as the pipe operator that wires one command's stdout to the next command's \
         stdin, so `:caminho \"../caixa-teia | grep foo\"` is the canonical paste-from-\
         shell-history footgun where an author copies a `ls ../caixa-teia | grep` line \
         without trimming the pipeline tail, and `:caminho \"../foo||bar\"` is the \
         symmetric `cmd-a || cmd-b` short-circuit-OR paste shape; POSIX `std::path::Path` \
         treats `|` as a literal path-component byte, so the resolver folds the value \
         through `Path::new(caminho).join(<file>)` looking for a literal `./{caminho}` \
         subdirectory and fails at resolve time with a non-self-locating `No such file or \
         directory` error far from the source caixa.lisp. The lacre pipeline embeds the \
         value verbatim in its per-dep content-address `path:{caminho}` at caixa-resolver/\
         src/resolve.rs:189, so the byte lands in the BLAKE3 closure and rides into every \
         shell-spawned subprocess (the resolver's `git clone`, a future `feira tofu` \
         shell-out, a future operator-side `nix` spawn) as the canonical CRLF-at-\
         subprocess-argument / shell-metachar injection surface every peer single-token-\
         shaped typed slot already closes. The peer `:entrada :paths` axis rejects `|` \
         via `is_gateway_api_http_path`'s eleven-byte RFC-3986-reserved set. Express the \
         path as a bare relative single-token like \"../caixa-teia\" — the sibling-\
         workspace directory name carries no shell-pipe semantic."
    )]
    FonteCaminhoShellPipe { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         command-separator metacharacter `;` (every interactive shell — bash / zsh / fish \
         / nushell — lexes `;` as the sequential-command terminator that fires the next \
         command regardless of the prior command's exit status, so `:caminho \
         \"../caixa-teia; rm -rf build\"` is the canonical paste-from-shell-one-liner \
         footgun where an author copies a `cd path; do-thing` chain without trimming \
         the cleanup tail, and `:caminho \"../foo;;bar\"` is the symmetric POSIX `case` \
         arm `;;` terminator paste shape; POSIX `std::path::Path` treats `;` as a \
         literal path-component byte, so the resolver folds the value through \
         `Path::new(caminho).join(<file>)` looking for a literal `./{caminho}` \
         subdirectory and fails at resolve time with a non-self-locating `No such file \
         or directory` error far from the source caixa.lisp. The lacre pipeline embeds \
         the value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, so the byte lands in the BLAKE3 closure and \
         rides into every shell-spawned subprocess (the resolver's `git clone`, a \
         future `feira tofu` shell-out, a future operator-side `nix` spawn) as the \
         canonical shell-metachar injection surface every peer single-token-shaped \
         typed slot already closes. The peer `:entrada :paths` axis rejects `;` via \
         `is_gateway_api_http_path`'s eleven-byte RFC-3986-reserved set. Express the \
         path as a bare relative single-token like \"../caixa-teia\" — the sibling-\
         workspace directory name carries no shell-command-separator semantic."
    )]
    FonteCaminhoShellSemicolon { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         background / list-AND metacharacter `&` (every interactive shell — bash / zsh \
         / fish / nushell — lexes `&` two ways: single `&` as the background-task \
         terminator detaching the prior command and returning control immediately to \
         the prompt, double `&&` as the logical-AND list operator firing the next \
         command only if the prior succeeded; POSIX `std::path::Path` treats it as a \
         literal byte. The canonical paste-from-shell-prompt footgun is a `cd path & \
         sleep 1` background-launch one-liner or a `cd path && make install` build-\
         chain idiom selected whole into the `:caminho` slot — the prior `;` arm at \
         05c358e closed the sequential-command-separator vector, this arm closes the \
         orthogonal background-task / logical-AND vector on the same paste-from-shell-\
         prompt class. The lacre pipeline embeds the value verbatim in its per-dep \
         content-address `path:{caminho}` at caixa-resolver/src/resolve.rs:189, so the \
         byte lands in the BLAKE3 closure and rides into every shell-spawned \
         subprocess (the resolver's `git clone`, a future `feira tofu` shell-out, a \
         future operator-side `nix` spawn) as the canonical shell-metachar injection \
         surface every peer single-token-shaped typed slot already closes. The peer \
         `:entrada :paths` axis rejects `&` via `is_gateway_api_http_path`'s eleven-\
         byte RFC-3986-reserved set. Express the path as a bare relative single-token \
         like \"../caixa-teia\" — the sibling-workspace directory name carries no \
         shell-background / logical-AND semantic."
    )]
    FonteCaminhoShellBackground { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         command-substitution metacharacter `` ` `` (every POSIX shell — sh / bash / zsh / \
         dash / ksh / fish / nushell — lexes the byte as the legacy command-substitution \
         wrapper that runs the enclosed command and substitutes its standard-output \
         verbatim into the surrounding word, so a backticked `whoami` expands to the \
         current user's name and a backticked `cat /etc/passwd` expands to the file's \
         contents — the canonical CWE-78 shell-command-injection vector; POSIX \
         `std::path::Path` treats the byte as a literal path-component byte. The canonical \
         paste-from-shell-prompt footgun is a `cd ../path/<backtick>whoami<backtick>` legacy substitution \
         one-liner or a `cd <backtick>pwd<backtick>/path` working-directory expansion idiom selected whole \
         into the `:caminho` slot — the prior `&` arm at e12e4f3 closed the shell-\
         background / logical-AND vector, this arm closes the orthogonal command-\
         substitution vector on the same paste-from-shell-prompt class (the modern `$()` \
         form is gated at leading position by the f4efe9c `FonteCaminhoVarExpansion` arm; \
         the legacy backtick form is the orthogonal axis). The lacre pipeline embeds the \
         value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, so the byte lands in the BLAKE3 closure and \
         rides into every shell-spawned subprocess (the resolver's `git clone`, a future \
         `feira tofu` shell-out, a future operator-side `nix` spawn) as the canonical \
         shell-metachar injection surface every peer single-token-shaped typed slot \
         already closes. The peer `:entrada :paths` axis rejects the byte via \
         `is_gateway_api_http_path`'s eleven-byte RFC-3986-reserved set. Express the path \
         as a bare relative single-token like \"../caixa-teia\" — the sibling-workspace \
         directory name carries no shell-command-substitution semantic."
    )]
    FonteCaminhoShellCommandSubstitution { nome: String, caminho: String },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         glob / pathname-expansion metacharacter 0x{byte:02x} `{ch}` (every POSIX shell — \
         sh / bash / zsh / dash / ksh / fish / nushell — lexes `*` and `?` as pathname-\
         expansion wildcards: `*` matches any sequence of characters in a path component \
         and `?` matches exactly one character, so a `:caminho \"../caixa-teia/*\"` is the \
         canonical paste-from-shell-listing footgun where an author copies a \
         `ls ../caixa-teia/*` listing without trimming the wildcard, and `:caminho \
         \"../foo?\"` is the symmetric single-char-wildcard paste shape; POSIX \
         `std::path::Path` treats both bytes as literal path-component bytes, so the \
         resolver folds the value through `Path::new(caminho).join(<file>)` looking for \
         a literal `./{caminho}` subdirectory and fails at resolve time with a non-self-\
         locating `No such file or directory` error far from the source caixa.lisp. The \
         lacre pipeline embeds the value verbatim in its per-dep content-address \
         `path:{caminho}` at caixa-resolver/src/resolve.rs:189, so the byte lands in the \
         BLAKE3 closure and rides into every shell-spawned subprocess (the resolver's \
         `git clone`, a future `feira tofu` shell-out, a future operator-side `nix` \
         spawn) as the canonical shell-metachar / glob-expansion surface every peer \
         single-token-shaped typed slot already closes. The peer `:entrada :paths` axis \
         rejects `*` and `?` via `is_gateway_api_http_path`'s eleven-byte RFC-3986-\
         reserved set. Express the path as a bare relative single-token like \
         \"../caixa-teia\" — the sibling-workspace directory name carries no shell-glob \
         / pathname-expansion semantic.",
        ch = *byte as char
    )]
    FonteCaminhoShellGlob {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         subshell-grouping metacharacter 0x{byte:02x} `{ch}` (every POSIX shell — sh / bash / \
         zsh / dash / ksh / fish / nushell — lexes `(` and `)` as the subshell-grouping \
         operator: `(<cmd>)` runs `<cmd>` in a child shell with a fresh environment scope \
         (the canonical `(cd <path> && <cmd>)` shell-history one-liner scopes a `cd` to one \
         subshell without disturbing the parent's working directory), and `$(<cmd>)` is the \
         modern Bourne command-substitution shape the leading-`$` `FonteCaminhoVarExpansion` \
         arm closes the leading byte of — together the two arms now structurally exclude the \
         entire `$(<cmd>)` substitution surface from the typed `:caminho` accepted set. \
         POSIX `std::path::Path` treats the byte as a literal path-component byte, so a \
         `:caminho \"../caixa-teia/$(date)/build\"` (the canonical paste-from-shell-history \
         modern-command-substitution footgun) or `:caminho \"../(cd foo && pwd)/caixa-teia\"` \
         (the symmetric subshell-grouping working-directory-probe paste idiom) silently passes \
         every prior arm and the resolver folds the value through `Path::new(caminho).join(\
         <file>)` looking for a literal subdirectory and fails at resolve time with a non-\
         self-locating `No such file or directory` error far from the source caixa.lisp. The \
         lacre pipeline embeds the value verbatim in its per-dep content-address `path:\
         {caminho}` at caixa-resolver/src/resolve.rs:189, so the byte lands in the BLAKE3 \
         closure and rides into every shell-spawned subprocess (the resolver's `git clone`, a \
         future `feira tofu` shell-out, a future operator-side `nix` spawn) as the canonical \
         shell-metachar / subshell-grouping surface every peer single-token-shaped typed slot \
         already closes. The peer `:fonte :repo` axis (3b99147) closes the same byte under the \
         same shell-subshell-grouping / RFC-3986-sub-delims banner on `is_git_repo_url`, \
         together with the leading-`$` `FonteCaminhoVarExpansion` arm closing the leading byte \
         of every `$(<cmd>)` shape. Express the path as a bare relative single-token \
         like \"../caixa-teia\" — the sibling-workspace directory name carries no shell-\
         subshell-grouping semantic.",
        ch = *byte as char
    )]
    FonteCaminhoShellSubshellGrouping {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         brace-expansion / URI-Template placeholder metacharacter 0x{byte:02x} `{ch}` \
         (every POSIX-derived brace-expanding shell — bash / zsh / ksh / fish — lexes `{{` / \
         `}}` as the brace-expansion operator: `{{a,b,c}}` expands to the cross-product of \
         comma-separated members and `{{1..10}}` expands to the integer range — the \
         canonical `mkdir -p ../{{caixa-teia,caixa-helm,caixa-flux}}` / `cp file{{,.bak}}` \
         idiom every shell-history block carries; RFC 6570 reserves the matched pair for \
         URI Template placeholders (the canonical `https://{{host}}/{{org}}/{{repo}}` \
         substitution shape every OpenAPI / Swagger / Postman / GitHub Octokit client \
         library / Helm chart-URL fragment carries) and the Mustache / Handlebars / \
         Tera / Jinja2 / Go html/template doubled-brace substitution form every IaC \
         templating engine (Helm, Kustomize, Terraform's `${{var}}` cousin) emits. POSIX \
         `std::path::Path` treats the byte as a literal path-component byte, so a \
         `:caminho \"../{{caixa-teia,caixa-helm}}/build\"` (the canonical paste-from-\
         shell-history brace-expansion fan-across-siblings footgun) or `:caminho \"../{{{{org}}}}/\
         caixa-teia\"` (the symmetric paste-from-templated-doc URI-Template placeholder \
         idiom every README quick-start / OpenAPI spec / Helm chart `home:` field carries) \
         silently passes every prior arm and the resolver folds the value through \
         `Path::new(caminho).join(<file>)` looking for a literal subdirectory and fails at \
         resolve time with a non-self-locating `No such file or directory` error far from \
         the source caixa.lisp. The lacre pipeline embeds the value verbatim in its \
         per-dep content-address `path:{caminho}` at caixa-resolver/src/resolve.rs:189, \
         so the byte lands in the BLAKE3 closure and rides into every shell-spawned \
         subprocess (the resolver's `git clone`, a future `feira tofu` shell-out, a \
         future operator-side `nix` spawn) as the canonical shell-metachar / brace-\
         expansion / URI-Template-placeholder surface every peer single-token-shaped \
         typed slot already closes. The peer `:fonte :repo` axis (42d8f9d) closes the \
         same byte pair on `is_git_repo_url` under the same RFC-3986-'delims' / \
         RFC-6570-URI-Template / shell-brace-expansion banner. Express the path as a \
         bare relative single-token like \"../caixa-teia\" — the sibling-workspace \
         directory name carries no shell-brace-expansion / URI-Template-placeholder \
         semantic; if two siblings actually need pinning, author two separate `:deps` \
         entries rather than one brace-expanded `:caminho` value.",
        ch = *byte as char
    )]
    FonteCaminhoShellBraceExpansion {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         bracket-expansion / POSIX glob-character-class / shell-`test`-builtin metacharacter \
         0x{byte:02x} `{ch}` (every POSIX shell — sh / bash / zsh / dash / ksh / fish / nushell \
         — lexes the bracket pair as the glob character-class operator: `[abc]` matches one of \
         `a` / `b` / `c`, `[a-z]` matches any lowercase ASCII letter, `[^x]` negates — the \
         canonical `ls *.[ch]` C-source-file glob and `cd ../caixa-[a-z]*` lowercase-sibling \
         glob every shell-history block carries; the bracket pair additionally carries the \
         POSIX `test` / `[` builtin command (`[ -d ../caixa-teia ] && cd ...` every shell-\
         script conditional uses) and bash's `[[ ... ]]` extended-test grammar; beyond shell \
         the pair is the TOML inline-array delimiter (`features = [\"a\", \"b\"]` — the \
         canonical paste-from-Cargo-manifest cross-idiom-leak vector), the YAML flow-sequence \
         delimiter (`paths: [/a, /b]` — the canonical paste-from-values.yaml cross-idiom \
         leak), the JSON array delimiter, and the POSIX-ERE / PCRE bracket-expression anchor. \
         POSIX `std::path::Path` treats the byte as a literal path-component byte, so a \
         `:caminho \"../caixa-[a-z]/build\"` (the canonical paste-from-shell-history glob-\
         character-class fan-across-siblings footgun) or `:caminho \"../[caixa-teia]/build\"` \
         (the symmetric paste-from-TOML-array / paste-from-YAML-flow-sequence cross-idiom \
         leak) silently passes every prior arm and the resolver folds the value through \
         `Path::new(caminho).join(<file>)` looking for a literal subdirectory and fails at \
         resolve time with a non-self-locating `No such file or directory` error far from \
         the source caixa.lisp. The lacre pipeline embeds the value verbatim in its per-dep \
         content-address `path:{caminho}` at caixa-resolver/src/resolve.rs:189, so the byte \
         lands in the BLAKE3 closure and rides into every shell-spawned subprocess (the \
         resolver's `git clone`, a future `feira tofu` shell-out, a future operator-side \
         `nix` spawn) as the canonical shell-metachar / glob-character-class / TOML-array \
         surface every peer single-token-shaped typed slot already closes. Express the path \
         as a bare relative single-token like \"../caixa-teia\" — the sibling-workspace \
         directory name carries no shell-bracket-expansion / glob-character-class / array-\
         literal semantic; if a family of sibling caixas actually needs pinning, author \
         separate `:deps` entries rather than one character-class-expanded `:caminho` value.",
        ch = *byte as char
    )]
    FonteCaminhoShellBracketExpansion {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         quote-grouping / cross-config-DSL string-literal-delimiter metacharacter \
         0x{byte:02x} `{ch}` (every POSIX shell — sh / bash / zsh / dash / ksh / fish / \
         nushell — lexes `'` as the strong string-literal delimiter (`'…'` — no expansion) \
         and `\"` as the weak string-literal delimiter (`\"\"` — variable- / command-\
         substitution-preserving); the canonical `cd '../caixa-teia'` shell-history idiom \
         every path-with-embedded-whitespace paste block carries and the symmetric \
         `git clone \"$REPO\"` weak-quoted CI-manifest shape both leak the pair verbatim. \
         Beyond shell the pair is the JSON string-literal delimiter (`\"key\": \"value\"` — \
         the canonical paste-from-JSON-config cross-idiom-leak vector), the YAML double- \
         and single-quoted flow-scalar delimiter (`path: \"../caixa-teia\"` — the canonical \
         paste-from-values.yaml / paste-from-K8s-YAML-manifest cross-idiom leak), the TOML \
         basic and literal string delimiter (`path = \"../caixa-teia\"` — the canonical \
         paste-from-Cargo-manifest cross-idiom leak), the tatara-lisp string-literal \
         delimiter itself (`(:caminho \"../caixa-teia\")` — the canonical \"I copied the \
         entire `:caminho \"...\"` slot rather than just the string body\" author-surface \
         footgun), and RFC 3986 §2.2's `gen-delims` / `sub-delims` grammar which excludes \
         both bytes from the `pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"` \
         production. POSIX `std::path::Path` treats the byte as a literal path-component \
         byte, so a `:caminho \"'../caixa-teia'\"` (the canonical paste-from-shell-history \
         strong-quoted sibling-workspace path footgun) or `:caminho \"\\\"../caixa-teia\\\"\"` \
         (the symmetric weak-quoted paste-from-JSON / paste-from-YAML flow-scalar / paste-\
         from-TOML basic-string / paste-from-tatara-lisp string-literal cross-idiom-leak \
         shape) silently passes every prior arm and the resolver folds the value through \
         `Path::new(caminho).join(<file>)` looking for a literal subdirectory and fails at \
         resolve time with a non-self-locating `No such file or directory` error far from \
         the source caixa.lisp. The lacre pipeline embeds the value verbatim in its per-dep \
         content-address `path:{caminho}` at caixa-resolver/src/resolve.rs:189, so the byte \
         lands in the BLAKE3 closure and rides into every shell-spawned subprocess (the \
         resolver's `git clone`, a future `feira tofu` shell-out, a future operator-side \
         `nix` spawn) as the canonical shell-metachar / string-literal-delimiter surface \
         every peer single-token-shaped typed slot already closes. The peer `:fonte :repo` \
         axis closes both bytes under the same shell-quote-grouping / RFC-3986-sub-delims \
         banner (e7a109f `'` shell-single-quote + 4267d8b `\"` shell-double-quote on \
         `is_git_repo_url`). Express the path as a bare relative single-token like \
         \"../caixa-teia\" — the sibling-workspace directory name carries no shell-quote-\
         grouping / string-literal-delimiter semantic; strip the outer quote pair from the \
         paste (the tatara-lisp `:caminho \"...\"` slot already carries the string-literal \
         quoting on the outer syntactic layer, so an inner quote pair would nest and \
         desugar to a broken layer).",
        ch = *byte as char
    )]
    FonteCaminhoShellQuoteGrouping {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         comment / URL-fragment-identifier / YAML-comment cross-config-DSL metacharacter \
         0x{byte:02x} `{ch}` (every POSIX shell — sh / bash / zsh / dash / ksh / fish / \
         nushell — lexes an unquoted `#` at the head of a word or after unquoted \
         whitespace as the comment-lead per POSIX.1-2017 §2.3 Token Recognition step 6, \
         discarding the byte and everything after it to the end of the physical line \
         before command parsing (`cd ../caixa-teia  # legacy sibling` — the canonical \
         paste-from-shell-history-with-trailing-annotation shape every operator-notebook \
         and CI-manifest carries); YAML 1.2 §6.6 makes `#` the comment-lead at any \
         position preceded by whitespace or at line-start (`path: ../caixa-teia  # pin` \
         — the canonical paste-from-values.yaml / paste-from-K8s-manifest cross-idiom-\
         leak); RFC 3986 §3.5 reserves `#` as the URL fragment-identifier delimiter (the \
         canonical paste-from-browser-address-bar `github.com/foo/bar#readme` / \
         `github.com/foo/bar#L42` permalink shape, and the symmetric Nix-flake-ref \
         cross-idiom leak `github:foo/bar#packageName` where `#` selects a flake \
         output); the same cross-config-DSL surface extends to HCL / Terraform / Nix \
         flake attributes / dotenv `.env` / gitconfig / .gitignore / ini / TOML where \
         `#` is likewise the comment-lead. POSIX `std::path::Path` treats the byte as a \
         literal path-component byte, so a `:caminho \"../caixa-teia # legacy sibling\"` \
         (the canonical paste-from-shell-history-with-trailing-annotation footgun), \
         `:caminho \"../caixa-teia  # pin\"` (the symmetric YAML flow-scalar paste-with-\
         trailing-comment shape), or `:caminho \"../caixa-teia#readme\"` (the URL \
         fragment paste-from-browser-address-bar shape) silently passes every prior arm \
         and the resolver folds the value through `Path::new(caminho).join(<file>)` \
         looking for a literal subdirectory named `../caixa-teia # legacy sibling` and \
         fails at resolve time with a non-self-locating `No such file or directory` \
         error far from the source caixa.lisp — while every downstream shell / YAML / \
         URL parser silently truncates the value at the `#` byte to `../caixa-teia`, so \
         a `feira tofu` shell-out and a `nix flake check` on an emitted YAML `path:` \
         scalar disagree with the resolver on which directory the value names. The \
         lacre pipeline embeds the value verbatim in its per-dep content-address \
         `path:{caminho}` at caixa-resolver/src/resolve.rs:189, so the byte lands in \
         the BLAKE3 closure and rides into every shell-spawned subprocess (the \
         resolver's `git clone`, a future `feira tofu` shell-out, a future operator-\
         side `nix` spawn) as the canonical shell-metachar / comment-lead / URL-\
         fragment-delimiter surface every peer single-token-shaped typed slot already \
         closes. The peer `:fonte :repo` axis closes the byte under the same URL-\
         fragment-identifier banner (a68f818 `#` on `is_git_repo_url`). Express the \
         path as a bare relative single-token like \"../caixa-teia\" — the sibling-\
         workspace directory name carries no shell-comment / URL-fragment / YAML-\
         comment semantic; move any trailing annotation to a tatara-lisp `;`-comment \
         on the surrounding form (`;; legacy sibling` above the `(:caminho ...)` slot) \
         and drop any `#fragment` tail entirely (fragment identifiers select \
         renderings, not directories, and `:caminho` names a directory).",
        ch = *byte as char
    )]
    FonteCaminhoShellComment {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains URL-\
         percent-encoding-escape / printf-format-specifier / bash-job-control-specifier \
         / YAML-directive-lead metacharacter 0x{byte:02x} `{ch}` (RFC 3986 §2.1 reserves \
         `%` as the URL percent-encoding-escape — `%HH` is the mandatory encoding \
         mechanism for every byte outside the `unreserved` alphanumeric / `-` / `.` / \
         `_` / `~` set, and `%` itself must be percent-encoded as `%25` to appear \
         literally inside a URL value. The canonical paste-from-browser-address-bar \
         percent-encoded-space footgun (an author copies `../caixa%20teia` out of a URL-\
         encoded README hyperlink / browser address bar / percent-encoded permalink \
         expecting `%20` to decode to a literal space at the filesystem layer) locks two \
         distinct BLAKE3 closures (`path:../caixa%20teia` vs `path:../caixa teia`) for \
         what the author intended as the byte-identical sibling-workspace dep. POSIX \
         `std::path::Path` treats the byte as a literal path-component byte, so \
         `Path::join` looks for a literal `./{caminho}` subdirectory and fails at \
         resolve time with a non-self-locating `No such file or directory` error far \
         from the source caixa.lisp — while every downstream URL parser / shell printf \
         builtin / YAML directive parser silently reinterprets the byte to a different \
         value than the resolver's `Path::join` sees. Beyond the URL-encoding hazard, \
         `%` is the C / POSIX printf format-directive lead-in (`%s`, `%d`, `%02x` — \
         wired into every POSIX shell's `printf` builtin, the canonical CWE-134 format-\
         string-injection vector); the bash / zsh / ksh job-control-specifier lead-in \
         (`%1` names \"job 1\", `%%` names \"the current job\", `%foo` names \"the most \
         recent job whose command started with `foo`\" — a future `kill %1` invocation \
         silently redirects the signal to a wrong target); the YAML 1.2 §6.8.1 \
         directive lead-in (`%YAML 1.2` / `%TAG` — the paste-from-top-of-doc YAML \
         directive block cross-idiom leak); and the Windows-shell env-var-reference \
         lead-in (`%PATH%` — the paste-from-`.bat` / paste-from-PowerShell-`%env:PATH%` \
         cross-idiom leak). The lacre pipeline embeds the value verbatim in its per-dep \
         content-address `path:{caminho}` at caixa-resolver/src/resolve.rs:189, so the \
         byte lands in the BLAKE3 closure and rides into every shell-spawned subprocess \
         (the resolver's `git clone`, a future `feira tofu` shell-out, a future \
         operator-side `nix` spawn) as the canonical URL-percent-encoding-escape / \
         printf-format-specifier / job-control-specifier surface every peer single-\
         token-shaped typed slot already closes. The peer `:fonte :repo` axis closes \
         the byte under the same URL-percent-encoding-escape banner (a323db8 `%` on \
         `is_git_repo_url`). Express the path as a bare relative single-token like \
         \"../caixa-teia\" — the sibling-workspace directory name carries no URL-\
         percent-encoding-escape / format-specifier / job-control semantic; substitute \
         any `%20` percent-encoded-space with a literal space then reject the whole \
         value at the leading-whitespace / embedded-`?` arm on the same axis (a caixa \
         directory name never carries an embedded space in practice); drop any \
         `%2F`-encoded path separator in favor of a literal `/`; and drop any leading \
         `%YAML` / `%PATH%` cross-idiom-leak prefix entirely.",
        ch = *byte as char
    )]
    FonteCaminhoUrlPercentEncoding {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         variable-expansion / command-substitution / arithmetic-expansion / cross-config-\
         DSL-interpolation metacharacter 0x{byte:02x} `{ch}` (every POSIX shell — sh / \
         bash / zsh / dash / ksh / busybox ash / fish / nushell — lexes `$` per \
         POSIX.1-2017 §2.6 as the variable-expansion `$<name>` / braced-form `${{<name>}}` \
         / command-substitution `$(<cmd>)` / arithmetic-expansion `$((<expr>))` operator; \
         Nix uses `${{var}}` as the string-interpolation lead, Make uses `$(var)` / `$@` \
         / `$<` for variables and automatic-variables, JavaScript / TypeScript template \
         literals use `${{expr}}` for interpolation, envsubst / Kubernetes / OpenShift \
         templates use `${{VAR}}` for env-var-reference, PHP uses `$_GET` / `$_ENV` for \
         superglobals, Perl uses `$foo` for scalars, SASS / SCSS uses `$primary-color` \
         for variables, and PostgreSQL / SQLite use `$1` / `$2` for bind parameters — \
         the byte is a first-class parser byte in nearly every config / templating / \
         build-system DSL the substrate's paste-idiom surface routinely crosses. POSIX \
         `std::path::Path` treats the byte as a literal path-component byte, so the \
         canonical paste-from-shell-one-liner `:caminho \"../foo$HOME/bar\"` / paste-\
         from-CI-manifest `:caminho \"../foo${{WORKSPACE}}/bar\"` / paste-from-shell-\
         prompt `:caminho \"../foo$(whoami)/bar\"` footguns silently pass every prior \
         cascade arm (`$` isn't `\\` / `<` / `>` / `|` / `;` / `&` / backtick / `*` / \
         `?` / `(` / `)` / `{{` / `}}` / `[` / `]` / `'` / `\"` / `#` / `%`) and route \
         through `Path::new(caminho).join(<file>)` looking for a literal `./{caminho}` \
         subdirectory that fails at resolve time with a non-self-locating `No such file \
         or directory` error far from the source caixa.lisp. The lacre pipeline embeds \
         the value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, so byte-identical caixa.lisp values differing \
         only in whether the author substituted `$HOME` / `${{WORKSPACE}}` at author \
         time lock to two distinct BLAKE3 closures across two workstations whose \
         downstream envsubst / Nix / Make / K8s-template layers differ in `$VAR` \
         recognition — defeating the THEORY.md §V.2 render-determinism contract on the \
         same axis every prior `:caminho` arm protects. Beyond the determinism vector, \
         `$` at any position in a value flowing verbatim into a shell-spawned subprocess \
         is the canonical CWE-78 shell-command-injection surface every peer single-\
         token-shaped typed slot already closes: peer `:fonte :repo` axis rejects `$` \
         under the shell-variable-expansion / URL-sub-delim banner via `is_git_repo_url` \
         (b9d187c), peer `:fonte :tag` / `:fonte :branch` axes reject `$` as part of \
         `is_git_ref_name`'s printable-ASCII-restricted grammar (`git check-ref-format` \
         rejects the byte outright), and peer `:entrada :paths` axis rejects `$` via \
         `is_gateway_api_http_path`'s eleven-byte RFC-3986-reserved set. The leading-`$` \
         position on the same axis routes through `FonteCaminhoVarExpansion` at the \
         f4efe9c leading-byte arm; this arm closes the last positional gap on the byte \
         so every position — leading and embedded — is structurally rejected. Substitute \
         the `$VAR` / `${{VAR}}` / `$(cmd)` template with the literal value at author \
         time, or express the path as a bare relative single-token like \
         \"../caixa-teia\" — the sibling-workspace directory name carries no shell-\
         variable-expansion / command-substitution / arithmetic-expansion semantic.",
        ch = *byte as char
    )]
    FonteCaminhoShellVariableExpansion {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         history-expansion / RFC-3986-sub-delims / bang-operator metacharacter 0x{byte:02x} \
         `{ch}` (every interactive POSIX shell with history enabled — bash / ksh / zsh's \
         `bashcompat` / csh / tcsh — lexes `!` as the history-expansion prefix per bash \
         reference §9.3: `!command` re-runs the most recent history entry beginning with \
         `command`, `!!` re-runs the prior command verbatim, `!$` substitutes the last \
         word of the prior command, `!:N` substitutes the Nth word of the prior command, \
         and the substitution fires at every history-expansion-enabled shell context — \
         `set -o histexpand` is bash's default for interactive sessions and the layer \
         every `feira tofu` / `git clone` / `nix flake check` subprocess-argument \
         invocation crosses when spawned under `bash -i`. Beyond shell history, RFC 3986 \
         §2.2 lists `!` in the `sub-delims` set (the URL grammar admits the byte inside \
         a path segment, but every WHATWG-conformant special-scheme URL parser percent-\
         encodes it inside a query component via the 'special-query percent-encode set' \
         the peer `is_git_repo_url` `*` / `(` / `)` / `'` arms close on); the byte is \
         also the C / C++ / Rust / JavaScript / Python bang-operator (logical-negation \
         prefix — the paste-from-source-code idiom where an author copies \
         `!path.exists()` out of a Rust snippet and the trailing punctuation crosses \
         the string-literal boundary); the canonical English-typography emphasis / \
         exclamation mark (the paste-from-prose enthusiasm-form idiom where an author \
         writes `:caminho \"../caixa-teia!\"` expecting the substrate to coerce it to a \
         kebab-case slug); and the Nix flake-ref attribute-selection operator surface. \
         POSIX `std::path::Path` treats `!` as a literal path-component byte, so the \
         canonical paste-from-shell-history footgun `:caminho \"../caixa-teia!sudo\"` \
         (an author copies a `cd ../caixa-teia && !sudo make install` one-liner from a \
         quick-start README and the trailing `!sudo` rides in verbatim as a history-\
         expansion reference), the symmetric `:caminho \"../foo!!/bar\"` (the `!!` \
         repeat-prior-command paste idiom), the English-typography `:caminho \
         \"../caixa-teia!\"` (paste-from-prose enthusiasm-form), and the last-word-\
         substitution `:caminho \"../foo!$\"` shape silently pass every prior cascade \
         arm (`!` isn't `\\` / `<` / `>` / `|` / `;` / `&` / backtick / `*` / `?` / `(` \
         / `)` / `{{` / `}}` / `[` / `]` / `'` / `\"` / `#` / `%` / `$`) and route \
         through `Path::new(caminho).join(<file>)` looking for a literal `./{caminho}` \
         subdirectory that fails at resolve time with a non-self-locating `No such file \
         or directory` error far from the source caixa.lisp. The lacre pipeline embeds \
         the value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, so the byte lands in the BLAKE3 closure and \
         rides into every shell-spawned subprocess (the resolver's `git clone`, a \
         future `feira tofu` shell-out, a future operator-side `nix flake check` spawn) \
         as the canonical shell-history-expansion / RFC-3986-sub-delims surface every \
         peer single-token-shaped typed slot already closes. The peer `:fonte :repo` \
         axis closes the byte under the same shell-history-expansion / RFC-3986-sub-\
         delims banner (7d53c68 `!` on `is_git_repo_url`). Express the path as a bare \
         relative single-token like \"../caixa-teia\" — the sibling-workspace directory \
         name carries no shell-history-expansion / bang-operator semantic; drop any \
         `!sudo` / `!!` / `!$` history-expansion trailing paste-from-shell-history \
         idiom; and drop any trailing English-typography exclamation mark that pasted \
         from prose.",
        ch = *byte as char
    )]
    FonteCaminhoShellHistoryExpansion {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} contains shell-\
         history-substitution / RFC-3986-'unwise' / regex-negation metacharacter 0x{byte:02x} \
         `{ch}` (POSIX bash's `set -o histexpand` mode — the default for every interactive \
         session and every `bash -i` subprocess-argument context `feira tofu` / `git clone` / \
         `nix flake check` cross — lexes `^old^new^` per bash reference §9.3 as the 'quick \
         substitution' history operator that rewrites the prior command's `old` string to \
         `new` and re-executes it verbatim, the canonical typo-correction one-liner idiom \
         (`git clone <bad-url>` → `^bad^good` typo-fix-and-rerun the paste-from-shell-\
         history author trims only the leading `git clone` prefix from). RFC 3986 §2 lists \
         `^` in the 'unwise' set every URL parser is required to percent-encode-or-refuse at \
         the wire boundary, and the WHATWG URL spec's 'fragment percent-encode set' maps \
         `^` → `%5E` at the query / fragment component transition, so `Path::join` on the \
         literal value diverges from every downstream `feira tofu` curl-invocation / \
         artifact-registry-fetch that percent-encodes the byte before the wire. `^` is also \
         the regex character-class negation prefix (`[^abc]`), the bitwise XOR operator in \
         C / C++ / Rust / Python / JavaScript / Nix / Go, the Windows `cmd.exe` escape \
         metacharacter, and the LaTeX / Markdown / BibTeX superscript operator. POSIX \
         `std::path::Path` treats `^` as a literal path-component byte, so \
         `:caminho \"../foo^bar/baz\"` (embedded quick-substitution), `:caminho \
         \"../foo^\"` (trailing history-substitution-open shape), or `:caminho \"../x^y\"` \
         (XOR-expression paste-from-source) silently pass every prior cascade arm (`^` \
         isn't `\\` / `<` / `>` / `|` / `;` / `&` / backtick / `*` / `?` / `(` / `)` / `{{` \
         / `}}` / `[` / `]` / `'` / `\"` / `#` / `%` / `$` / `!`) and route through \
         `Path::new(caminho).join(<file>)` looking for a literal `./{caminho}` subdirectory \
         that fails at resolve time with a non-self-locating `No such file or directory` \
         error far from the source caixa.lisp. The lacre pipeline embeds the value verbatim \
         in its per-dep content-address `path:{caminho}` at caixa-resolver/src/resolve.rs:189, \
         so the byte lands in the BLAKE3 closure and rides into every shell-spawned \
         subprocess (the resolver's `git clone`, a future `feira tofu` shell-out, a future \
         operator-side `nix flake check` spawn) as the canonical shell-history-substitution \
         / RFC-3986-unwise surface every peer single-token-shaped typed slot already closes. \
         The peer `:fonte :repo` axis closes the byte under the same shell-history-\
         substitution / RFC-3986-unwise banner (49e142f `^` on `is_git_repo_url`). Together \
         with the immediate-predecessor `!` arm (6a04767) this arm closes the full `set -o \
         histexpand` operator surface on the `:caminho` axis — the `!command` / `!!` / `!$` \
         prefix form via `!`, the `^old^new^` quick-substitution form via `^`. Express the \
         path as a bare relative single-token like \"../caixa-teia\" — the sibling-workspace \
         directory name carries no shell-history-substitution / regex-negation / XOR-operator \
         semantic; drop any `^old^new` history-substitution paste-from-shell-history idiom; \
         drop any trailing `^` history-substitution-open fragment.",
        ch = *byte as char
    )]
    FonteCaminhoShellHistorySubstitution {
        nome: String,
        caminho: String,
        byte: u8,
    },
    #[error(
        ":deps entry {nome:?} :fonte (:tipo path …) :caminho {caminho:?} has a trailing \
         `/` (the resolver's `Path::join` resolves `\"../caixa-teia\"` and \
         `\"../caixa-teia/\"` to the same directory, but the lacre pipeline embeds the \
         value verbatim in its per-dep content-address `path:{caminho}` at \
         caixa-resolver/src/resolve.rs:189, so two authors whose only difference is \
         shell tab-completion emit byte-divergent BLAKE3 closures for the same caixa — \
         defeating the THEORY.md §V.2 render-determinism contract via the trailing-\
         separator vector (the canonical paste-from-shell-tab-completion + paste-from-\
         `pwd`-with-`/`-suffix footgun, and the canonical Cargo-style `path = \
         \"../caixa-teia/\"` paste-from-Cargo-manifest cross-idiom leak). Drop the \
         trailing `/`; every `:caminho` value names a sibling-workspace directory \
         already, so the trailing separator carries no information. Use \
         `\"../caixa-teia\"` rather than `\"../caixa-teia/\"`)"
    )]
    FonteCaminhoTrailingSlash { nome: String, caminho: String },
    #[error(
        "{list} carries duplicate entry :nome {nome:?} — every dep list keys its \
         entries by caixa name (Cargo's [dependencies] / [dev-dependencies] tables \
         apply the same set-not-multiset discipline; one package per table), and \
         two entries naming the same caixa carry two version constraints / source \
         pins / feature sets for one identity. The caixa-resolver's lacre pipeline \
         consumes the list as a `HashMap`-keyed-by-`:nome` lookup: the second entry \
         silently overwrites the first at the resolver-side `concrete_versao` step, \
         and the dropped entry's pin / features never reach the closure — far from \
         the source caixa.lisp, with no field naming which `:deps` entry was the \
         silent loser. If two version constraints are genuinely needed (the rare \
         multi-version closure case the lacre pipeline doesn't yet support), the \
         author surface is two distinct caixa names (e.g. a `caixa-teia-v01` / \
         `caixa-teia-v02` aliased pair); within one list, one entry per caixa name."
    )]
    DuplicateNome { nome: String, list: &'static str },
    #[error(
        ":deps entry {nome:?} has empty :caracteristicas entry — every feature flag must \
         name a non-empty identifier on the target caixa (Cargo's [dependencies.<dep>.features] \
         applies the same per-entry non-empty discipline). An empty feature flag reaches the \
         caixa-resolver's lacre pipeline as a no-op feature enable, silently dropping the \
         author's intent far from the source caixa.lisp; drop the empty entry, or replace it \
         with the canonical kebab-case feature name the target caixa declares."
    )]
    CaracteristicaEmpty { nome: String },
    #[error(
        ":deps entry {nome:?} :caracteristicas entry {caracteristica:?} is not a valid Cargo \
         feature name: {reason} (the value flows verbatim into Cargo's \
         [dependencies.<dep>.features] list and Cargo's `restricted_names::validate_feature_name` \
         parser enforces the same shape at `cargo metadata` time; use a single-token \
         identifier like `\"http\"`, `\"derive\"`, or `\"runtime-tokio\"` — kebab-case ASCII \
         alphanumeric with `-`, `_`, `+`, or `.` as continuation characters, starting with \
         an ASCII alphanumeric or `_`)"
    )]
    CaracteristicaInvalid {
        nome: String,
        caracteristica: String,
        reason: String,
    },
    #[error(
        ":deps entry {nome:?} :caracteristicas carries duplicate feature {caracteristica:?} — \
         every feature-flag list keys its entries by name (Cargo's \
         [dependencies.<dep>.features] applies the same set-not-multiset discipline; one entry \
         per feature per dep), and two entries naming the same feature are a redundant \
         set-membership declaration for one identity (the feature-toggle slot is set-shaped; \
         enabling a feature twice has no additional semantic). The caixa-resolver's lacre \
         pipeline consumes the list as a set-shaped feature toggle — the resolver enables the \
         feature once regardless of declaration count, so the duplicate's pin / position never \
         reaches the closure with no field naming the silent loser. One entry per feature per \
         dep; if two distinct features are intended, name each verbatim."
    )]
    CaracteristicaDuplicate {
        nome: String,
        caracteristica: String,
    },
    #[error(
        "{list} entry :nome {nome:?} names the caixa itself — a caixa cannot depend \
         on itself (the lacre closure's dep-graph traversal is rooted at the caixa's \
         :nome, and a self-dep would be a one-node cycle the caixa-resolver either \
         rejects mid-traversal far from the source caixa.lisp or recurses on until \
         it exhausts its stack). Every :nome is globally-unique substrate identity, \
         so a :deps / :deps-dev entry whose :nome equals the parent caixa's :nome \
         *is* the parent itself, not a coincidentally-named peer. Drop the \
         self-referential dep entry — to reference code from this caixa, use \
         :bibliotecas / :exe / :servicos (the substrate-blessed shape for \
         referencing the caixa's own code surface) instead."
    )]
    DepIsSelf { nome: String, list: &'static str },
}

#[allow(clippy::trivially_copy_pass_by_ref)]
fn is_false(b: &bool) -> bool {
    !*b
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn registry_dep_is_minimal() {
        let d = Dep::simple("caixa-teia", "^0.1");
        assert_eq!(d.nome, "caixa-teia");
        assert_eq!(d.versao, "^0.1");
        assert!(d.fonte.is_none());
        assert!(!d.opcional());
        assert!(d.caracteristicas().is_empty());
    }

    #[test]
    fn git_dep_carries_tag() {
        let d = Dep::git("t", "*", "github:o/r", "v1");
        match d.fonte {
            Some(DepSource::Git {
                ref repo, ref tag, ..
            }) => {
                assert_eq!(repo, "github:o/r");
                assert_eq!(tag.as_deref(), Some("v1"));
            }
            _ => panic!("expected Git source"),
        }
    }

    #[test]
    fn validate_accepts_simple_dep() {
        Dep::simple("caixa-teia", "^0.1").validate().unwrap();
    }

    #[test]
    fn validate_rejects_empty_nome() {
        // The fail-before-pass-after pin for `:nome ""`: the empty-name
        // arm fires first so the per-entry parse-side diagnostic doesn't
        // emit a useless `nome: ""` reference.
        let mut d = Dep::simple("placeholder", "^0.1");
        d.nome = String::new();
        assert_eq!(d.validate().unwrap_err(), DepError::NomeEmpty);
    }

    #[test]
    fn validate_rejects_empty_versao() {
        // `parse_requirement("")` returns `Ok(VersionReq::STAR)` (the
        // semver crate accepts the empty string as a wildcard match),
        // so the empty-`:versao` arm is structurally necessary even
        // with the parse arm in place — mirrors `MembroVersaoEmpty` /
        // `EmptyChildVersion` ordering on the other two `:versao` axes.
        let mut d = Dep::simple("caixa-teia", "ignored");
        d.versao = String::new();
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::VersaoEmpty { ref nome } if nome == "caixa-teia"),
            "got {err:?}"
        );
    }

    // ── value-shape: DNS-1123 label on :deps :nome ────────────────────────

    #[test]
    fn validate_rejects_nome_with_uppercase() {
        // The fail-before-pass-after pin: a non-empty but uppercase
        // `:nome` silently passed `validate()` on every pre-gate
        // codebase because the prior shape only refused the empty
        // string. The DNS-1123 violation surfaced far downstream at
        // lacre-resolve time when the *target* caixa's `:nome` failed
        // its own gate — far from the `:deps` entry, with a diagnostic
        // naming the target rather than the dep entry that referenced
        // it. Same fail-before-pass-after fixture pinned for
        // `:membros :caixa` (3f9d7a0), `:children :caixa` (31bfa43),
        // and Caixa `:nome` (6c992f8).
        let d = Dep::simple("Caixa-Teia", "^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::NomeInvalid { ref nome, ref reason }
                    if nome == "Caixa-Teia" && reason.contains("uppercase")
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_nome_with_underscore() {
        // RFC 1123 allows `[a-z0-9-]` only; underscore is the canonical
        // "I'm thinking of Go module names / Python identifiers" leak.
        // Same fixture pinned for the peer caixa-identifier axes.
        let d = Dep::simple("caixa_teia", "^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::NomeInvalid { ref nome, ref reason }
                    if nome == "caixa_teia" && reason.contains('_')
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_nome_with_dot() {
        // A `:deps :nome` is a single DNS-1123 *label*, not a
        // subdomain — dots are rejected. The `"caixa.teia"` shape is
        // the canonical "I confused the dep name with the FQDN /
        // namespace" footgun, distinct from the legitimate
        // `:fonte :repo "github:org/caixa-teia"` axis.
        let d = Dep::simple("caixa.teia", "^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::NomeInvalid { ref nome, ref reason }
                    if nome == "caixa.teia" && reason.contains('.')
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_nome_with_leading_hyphen() {
        // RFC 1123 requires alphanumeric at both label boundaries.
        // Pinned in parity with the peer DNS-1123 fixtures.
        let d = Dep::simple("-caixa-teia", "^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::NomeInvalid { ref nome, ref reason }
                    if nome == "-caixa-teia" && reason.contains("alphanumeric")
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_nome_with_trailing_hyphen() {
        let d = Dep::simple("caixa-teia-", "^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::NomeInvalid { ref nome, ref reason }
                    if nome == "caixa-teia-" && reason.contains("alphanumeric")
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_nome_with_slash() {
        // The canonical "I copied the GitHub repo path into `:nome`
        // instead of `:fonte :repo`" typo. A `/` in the name leaks the
        // lacre-side `:repositorio` shape (`pleme-io/caixa-teia`) into
        // the local-name slot. Same fixture pinned for `:membros
        // :caixa` (3f9d7a0).
        let d = Dep::simple("pleme-io/caixa-teia", "^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::NomeInvalid { ref nome, ref reason }
                    if nome == "pleme-io/caixa-teia" && reason.contains('/')
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_nome_too_long() {
        // 64-byte label — one over the RFC 1035 / RFC 1123 label cap.
        // Built from a valid character set so the length-bound
        // diagnostic surfaces before any per-character check (the
        // order pin parallel to the per-character predicates inside
        // [`crate::render::is_dns_1123_label`]).
        let long = "a".repeat(64);
        let d = Dep::simple(&long, "^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::NomeInvalid { ref nome, ref reason }
                    if nome.len() == 64 && reason.contains("max length of 63")
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_accepts_canonical_nome_labels() {
        // Positive-control sweep — every form the K8s apiserver
        // accepts as a DNS-1123 label must round-trip through
        // validate. Covers a hyphen-bearing label, a numeric-suffix
        // label, a leading-digit label, a single-character label, and
        // a 63-byte (exactly the cap) label — the same fixture set
        // the peer `:membros :caixa` / `:children :caixa` positive
        // controls pin.
        for nome in [
            "caixa-teia",
            "caixa-resolver2",
            "2nd-tier-cache",
            "x",
            "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0",
        ] {
            Dep::simple(nome, "^0.1")
                .validate()
                .unwrap_or_else(|e| panic!("canonical label {nome:?} must validate, got {e:?}"));
        }
    }

    #[test]
    fn nome_empty_takes_precedence_over_nome_invalid() {
        // Ordering pin: `NomeEmpty` is the more self-locating
        // diagnostic on `""` and must lead — `is_dns_1123_label` is
        // only reached after the empty-check fires at the call site.
        // Mirrors `membro_caixa_empty_takes_precedence_over_invalid`
        // (3f9d7a0) on the peer caixa-identifier axis.
        let mut d = Dep::simple("placeholder", "^0.1");
        d.nome = String::new();
        assert_eq!(d.validate().unwrap_err(), DepError::NomeEmpty);
    }

    #[test]
    fn nome_invalid_fires_before_versao_empty() {
        // Ordering pin: a malformed `:nome` fires before any `:versao`
        // axis check on the *same* entry — the per-entry shape gates
        // run top-to-bottom (nome empty → nome shape → versao empty →
        // versao parse → fonte shape), so a one-entry caixa.lisp with
        // both wrong sees the name-side diagnostic first (the name is
        // the self-locating axis — without a valid name, the parse
        // diagnostic can't quote `:nome "<bad>"`). Same ordering
        // discipline as `membro_caixa_invalid_fires_before_versao_check`
        // (3f9d7a0).
        let mut d = Dep::simple("Caixa-Teia", "^0.1");
        d.versao = String::new();
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::NomeInvalid { ref nome, .. } if nome == "Caixa-Teia"),
            "got {err:?}"
        );
    }

    #[test]
    fn nome_invalid_fires_before_versao_invalid() {
        // Ordering pin: a malformed `:nome` fires before the `:versao`
        // parse-side check on the *same* entry. Pin separately from
        // the empty-versao ordering so a future re-ordering surfaces
        // here, parallel to the b0c8389 / c4213a4 trajectory.
        let d = Dep::simple("Caixa-Teia", "^^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::NomeInvalid { ref nome, .. } if nome == "Caixa-Teia"),
            "got {err:?}"
        );
    }

    #[test]
    fn nome_invalid_fires_before_fonte_invalid() {
        // Ordering pin: a malformed `:nome` fires before the `:fonte`
        // shape check on the *same* entry. The `:fonte` diagnostic
        // names the offending dep's `:nome` verbatim (via
        // `DepSource::validate(&self.nome)`), so a non-self-locating
        // name would taint the downstream diagnostic too — the gate
        // ordering keeps both diagnostics individually self-locating.
        let mut d = Dep::simple("Caixa-Teia", "^0.1");
        d.fonte = Some(DepSource::Git {
            repo: String::new(),
            tag: None,
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::NomeInvalid { ref nome, .. } if nome == "Caixa-Teia"),
            "got {err:?}"
        );
    }

    #[test]
    fn nome_invalid_diagnostic_carries_offending_name() {
        // The diagnostic-shape pin: the error names the offending
        // `:nome` value verbatim so the author can grep their
        // caixa.lisp without re-running the build, and carries a
        // non-empty `reason` from `is_dns_1123_label` so the
        // predicate's own wording flows through to the diagnostic.
        // Same shape as `MembroCaixaInvalid` (3f9d7a0),
        // `ChildCaixaInvalid` (31bfa43), `ManifestError::NomeInvalid`
        // (6c992f8) — the four DNS-1123 caixa-identifier axes now
        // share a structurally-equivalent diagnostic family.
        let d = Dep::simple("Caixa_Teia", "^0.1");
        let err = d.validate().unwrap_err();
        let DepError::NomeInvalid { nome, reason } = err else {
            panic!("expected NomeInvalid, got other variant");
        };
        assert_eq!(nome, "Caixa_Teia");
        assert!(
            !reason.is_empty(),
            "NomeInvalid `reason` must carry the predicate's wording verbatim"
        );
    }

    #[test]
    fn validate_rejects_invalid_versao_requirement() {
        // The fail-before-pass-after pin: a non-empty but malformed
        // requirement (`"^bad-version"`) silently passed every pre-gate
        // codebase because `:deps :versao` wasn't validated. The parse
        // failure surfaced far downstream at lacre-resolve time with a
        // `semver::Error` that didn't name which `:deps` entry carried
        // the typo. The new gate moves the check to caixa-build time
        // at the source caixa.lisp.
        let d = Dep::simple("caixa-teia", "^bad-version");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::VersaoInvalid { ref nome, ref versao, .. }
                    if nome == "caixa-teia" && versao == "^bad-version"
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_versao_with_double_caret_typo() {
        // `"^^0.1"` is the canonical doubled-caret typo — looks like a
        // Cargo-shaped requirement on first glance but fails the parser
        // because semver doesn't accept stacked operators. Pin this
        // adjacent-shape footgun explicitly so a future relaxation that
        // accepts "looks-canonical-but-isn't" forms surfaces here, in
        // parity with the `:membros` / `:children` fixtures.
        let d = Dep::simple("caixa-teia", "^^0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::VersaoInvalid { ref nome, ref versao, .. }
                    if nome == "caixa-teia" && versao == "^^0.1"
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_versao_with_v_prefixed_tag() {
        // `"v0.1"` is the canonical "git-tag-shape leaking into the
        // semver requirement slot" typo — an author copies the
        // publish-side git-tag string verbatim into `:versao`, but
        // Cargo's semver parser rejects the leading `v`. Same fixture
        // pinned for `:membros :versao` (9888b13) and `:children
        // :versao` (b38ff3a). (Bare `x`-glob shorthands like `^0.1.x`
        // are *accepted* by the semver crate as an `*` wildcard on the
        // patch axis — they're a Cargo-side valid shape, not a typo.)
        let d = Dep::simple("caixa-teia", "v0.1");
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::VersaoInvalid { ref nome, ref versao, .. }
                    if nome == "caixa-teia" && versao == "v0.1"
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_accepts_canonical_versao_forms() {
        // The five Cargo-shaped requirement forms `:membros :versao`
        // and `:children :versao` already accept via
        // `crate::parse_requirement` must pass the deps gate without
        // re-validating at the resolver layer. Pin every leg so a
        // future tightening of the canonical set surfaces here as a
        // test failure.
        for form in [
            "^0.1",      // caret — minor-range pin (the most common shape)
            "~0.1.2",    // tilde — patch-range pin
            "0.1.0",     // exact — single-version pin
            "*",         // wildcard — explicitly any-version
            ">=0.1, <2", // multi-range — comma-separated comparators
        ] {
            Dep::simple("caixa-teia", form)
                .validate()
                .unwrap_or_else(|e| panic!("canonical form {form:?} must validate, got {e:?}"));
        }
    }

    #[test]
    fn versao_empty_takes_precedence_over_invalid() {
        // Order pin: the existing `VersaoEmpty` diagnostic (which
        // doesn't try to parse) fires before the new `VersaoInvalid`
        // parse-side diagnostic, so an empty `:versao` keeps its
        // narrower error message — `parse_requirement("")` would
        // otherwise return `Ok(STAR)` and silently pass, but the empty
        // arm catches it first.
        let mut d = Dep::simple("caixa-teia", "ignored");
        d.versao = String::new();
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::VersaoEmpty { ref nome } if nome == "caixa-teia"),
            "got {err:?}"
        );
    }

    #[test]
    fn nome_empty_takes_precedence_over_versao_invalid() {
        // Order pin: even when `:versao` is malformed and would raise
        // its own diagnostic, `:nome ""` fires first because the
        // per-entry parse diagnostic needs a non-empty name to be
        // self-locating. Mirrors the
        // `membros_validation_runs_before_contratos_membership_check`
        // ordering on the typed-graph layer.
        let mut d = Dep::simple("placeholder", "^bad");
        d.nome = String::new();
        let err = d.validate().unwrap_err();
        assert_eq!(err, DepError::NomeEmpty);
    }

    #[test]
    fn versao_invalid_diagnostic_carries_offending_versao() {
        // The diagnostic-shape pin: the error names the offending
        // `:versao` value verbatim so the author can grep their
        // caixa.lisp without re-running the build, and carries a
        // non-empty `reason` from `semver::VersionReq::parse` so the
        // parser's own wording flows through to the diagnostic.
        let d = Dep::simple("caixa-teia", "not-a-req");
        let err = d.validate().unwrap_err();
        let DepError::VersaoInvalid {
            nome,
            versao,
            reason,
        } = err
        else {
            panic!("expected VersaoInvalid, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(versao, "not-a-req");
        assert!(
            !reason.is_empty(),
            "VersaoInvalid `reason` must carry the parser's wording verbatim"
        );
    }

    // -- :fonte value-shape gate ------------------------------------------

    fn dep_with_fonte(fonte: DepSource) -> Dep {
        let mut d = Dep::simple("caixa-teia", "^0.1");
        d.fonte = Some(fonte);
        d
    }

    #[test]
    fn validate_accepts_git_fonte_with_tag() {
        // The positive-control pin on the canonical git source — exactly
        // one of :tag/:rev/:branch set, non-empty :repo. Mirrors the
        // shape every existing caixa-resolver integration test uses.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_accepts_git_fonte_with_rev() {
        // Each of the three pin axes is independently a valid single-pin
        // shape; pin the :rev arm so a future relaxation that only
        // accepts :tag surfaces here. The value is a full 40-hex SHA-1
        // OID — the canonical `git rev-parse HEAD` emission shape the
        // `crate::render::is_git_oid` value-shape gate now requires;
        // abbreviated OIDs are ambiguous across repo history and
        // rejected at this gate (pinned separately by
        // `validate_rejects_git_fonte_with_rev_abbreviated_prefix`).
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("c0ffee0123abcdef0123456789abcdef01234567".into()),
            branch: None,
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_accepts_git_fonte_with_branch() {
        // The :branch arm is the third valid single-pin shape — pinned
        // separately so the gate-accepts-all-three-pin-axes contract is
        // a build-error to relax.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: None,
            branch: Some("main".into()),
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_accepts_path_fonte() {
        // The positive-control pin on the path source — non-empty
        // :caminho, no pin axes (paths have no commit identity). Pinned
        // so a future "paths must also pin a rev" tightening surfaces
        // here as a structural decision, not a silent break.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_rejects_git_fonte_with_empty_repo() {
        // The fail-before-pass-after pin for `(:tipo git :repo "" :tag
        // "v1")`: the empty-repo shape silently passed every pre-gate
        // codebase because `:fonte` wasn't validated. The git-clone
        // failure surfaced far downstream at lacre-resolve time with no
        // field naming which `:deps` entry carried the typo. The new
        // gate moves the check to caixa-build time at the source
        // caixa.lisp.
        let d = dep_with_fonte(DepSource::Git {
            repo: String::new(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteRepoEmpty { ref nome } if nome == "caixa-teia"),
            "got {err:?}"
        );
    }

    // -- :repo value-shape gate -------------------------------------------
    //
    // The `:fonte (:tipo git :repo …)` value flows verbatim into the
    // caixa-resolver's `git clone <repo>` subprocess. The pre-gate
    // codebase admitted any non-empty string; the new
    // [`crate::render::is_git_repo_url`] predicate gates the git-porcelain
    // URL intersection-floor at validate time, peer with the three pin
    // axes (`:tag` + `:branch` via `is_git_ref_name`, `:rev` via
    // `is_git_oid`). Every test in this section is a fail-before /
    // pass-after pin on a specific authoring footgun.

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_trailing_space() {
        // The canonical paste-from-doc footgun on `:repo` — an author
        // copies `"github:pleme-io/caixa-teia "` (trailing space) out of
        // a doc paragraph. Until this gate landed the empty-repo arm
        // passed (the string isn't empty), the resolver issued
        // `git clone 'github:pleme-io/caixa-teia '`, and the failure
        // surfaced at clone time with a quoting-confused error far from
        // the source caixa.lisp. Same paste-from-doc footgun the
        // `:tag "v0.1.0 "` gate (e70d213) closes on the peer refname
        // axis — now closed on the `:repo` URL axis too.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia ".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "github:pleme-io/caixa-teia ");
        assert!(
            reason.contains("whitespace"),
            "reason must surface the whitespace arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_starting_with_dash() {
        // The canonical CLI-argument-injection footgun at the `git clone`
        // subprocess boundary — `:repo "-upload-pack=evil"` makes git's
        // argv parser read the value as a CLI flag, escaping the
        // subprocess argument boundary. The `--` separator workaround
        // does not fix the typed slot's accepted set; the gate rejects
        // the shape upstream at validate time so the resolver never
        // invokes a `git clone -…` subprocess.
        let d = dep_with_fonte(DepSource::Git {
            repo: "-upload-pack=evil".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { repo, reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(repo, "-upload-pack=evil");
        assert!(
            reason.contains("must not start with `-`"),
            "reason must surface the leading-`-` arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_embedded_newline() {
        // The canonical paste-from-multiline-doc footgun — a `:repo`
        // string with an embedded `\n` silently breaks git's URL parser
        // and is a class of CRLF-injection at the subprocess-argument
        // boundary. Caught by the control-char arm (0x0A < 0x20).
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia\nrm -rf /".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("control character"),
            "reason must surface the control-char arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_tab() {
        // Tab is the sibling whitespace footgun (the canonical
        // copy-from-aligned-table paste); pinned separately from the
        // space arm so a future relaxation that only catches one
        // surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia\t".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteRepoShape { ref reason, .. }
                    if reason.contains("whitespace")
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_non_ascii() {
        // IDN hosts must be pre-encoded as Punycode (`xn--…`) — raw
        // non-ASCII silently breaks at git's URL parser and round-trips
        // inconsistently across NFC/NFD normalization on APFS /
        // case-folding filesystems. Same intersection-floor
        // [`is_git_ref_name`] enforces on the refname axes.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/café".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteRepoShape { ref reason, .. }
                    if reason.contains("non-ASCII")
            ),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_fragment_anchor() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // browser-address-bar footgun on `:repo`: an author copies a
        // GitHub permalink to a README anchor / line-permalink and
        // forgets to trim the `#fragment` tail. Until this arm landed
        // `:repo "https://github.com/pleme-io/caixa-teia#readme"`
        // silently passed every prior arm (no whitespace, no control
        // chars, no non-ASCII, contains a `:`, doesn't start with `-`
        // or `:`), libcurl's URL parser stripped the `#readme` tail
        // before opening the HTTPS transport, and the lacre embedded
        // the value verbatim in its per-dep BLAKE3 closure — two
        // authors whose values differ only in their fragment anchor
        // (`#readme` vs `#L42`) resolve to the byte-identical upstream
        // `git clone` but lock to two distinct lacres, defeating the
        // THEORY.md §V.2 render-determinism contract. Same value-shape
        // axis-floor every peer typed surface enforces; peer `:fonte
        // :tag` / `:fonte :branch` already reject the byte-class through
        // `is_git_ref_name`'s alphabet (refs are leaf identifiers, no
        // URL grammar admitted) and `:entrada :paths` rejects `#` as
        // part of `is_gateway_api_http_path`'s RFC-3986-reserved set.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia#readme");
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm, got {reason:?}"
        );
        assert!(
            reason.contains("fragment"),
            "reason must name the URL fragment grammar, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_flake_ref_fragment() {
        // The symmetric paste-from-Nix-flake-ref footgun — an author
        // confuses the Nix flake-reference idiom (`github:foo/
        // bar#packageName`, where `#packageName` selects a flake
        // output) with the bare git `:repo` shape. The pleme-io
        // substrate authors compose flakes downstream of caixa
        // (caixa-flake renders a flake.nix), so the cross-idiom leak
        // is the canonical near-miss: the author writes the
        // flake-ref shape into a git `:repo` slot. Pinned separately
        // from the HTTPS-anchor arm so a future relaxation that
        // narrows to one URL scheme surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia#caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm, got {reason:?}"
        );
        assert!(
            reason.contains("Nix flake"),
            "reason must name the Nix-flake-ref cross-idiom footgun, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_query_string() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // browser-address-bar footgun on `:repo` (peer with the
        // a68f818 fragment-`#` arm on the same axis). An author
        // copies a GitHub tab deep-link out of the address bar and
        // forgets to trim the `?tab=…` query tail. Until this arm
        // landed `:repo "https://github.com/pleme-io/caixa-teia?tab=readme-ov-file"`
        // silently passed every prior arm (no whitespace, no control
        // chars, no non-ASCII, no `#` fragment, contains a `:`,
        // doesn't start with `-` or `:`); GitHub silently ignored
        // the `?query` tail and served the same repo regardless;
        // the lacre embedded the value verbatim in its per-dep
        // BLAKE3 closure — two authors whose values differ only in
        // their query tail (`?tab=readme-ov-file` vs `?ref=main` vs
        // `?utm_source=twitter`) resolve to the byte-identical
        // upstream `git clone` but lock to two distinct lacres,
        // defeating the THEORY.md §V.2 render-determinism contract
        // on the same axis the `#` fragment arm closes. Same value-
        // shape axis-floor every peer typed surface enforces; peer
        // `:fonte :tag` / `:fonte :branch` already reject the byte-
        // class through `is_git_ref_name`'s alphabet (refspec glob
        // wildcards, caixa-core/src/render.rs:1426) and `:entrada
        // :paths` rejects `?` as the query separator in
        // `is_gateway_api_http_path` (caixa-core/src/render.rs:473).
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia?tab=readme-ov-file".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(
            repo,
            "https://github.com/pleme-io/caixa-teia?tab=readme-ov-file"
        );
        assert!(
            reason.contains("must not contain `?`"),
            "reason must surface the query-`?` arm, got {reason:?}"
        );
        assert!(
            reason.contains("query"),
            "reason must name the URL query grammar, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_utm_tracker() {
        // The symmetric paste-from-social-share footgun — an author
        // copies a repo URL out of a Slack unfurl / Twitter share /
        // newsletter link / Discord embed and forgets to trim the
        // `?utm_source=…` / `?utm_medium=…` / `?utm_campaign=…`
        // campaign-tracker tail. Every major social-share / unfurl /
        // newsletter platform appends these UTM parameters; the
        // canonical near-miss on the `:repo` axis. Pinned separately
        // from the GitHub-tab-deep-link arm so a future relaxation
        // that narrows to one query-parameter class surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia?utm_source=twitter&utm_campaign=launch"
                .into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `?`"),
            "reason must surface the query-`?` arm, got {reason:?}"
        );
        assert!(
            reason.contains("campaign-tracker"),
            "reason must name the campaign-tracker paste footgun, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_query_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the query-`?` arm are
        // both per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte
        // order wins. A `:repo "https://github.com/p/x#readme?ref=main"`
        // (fragment before query — unusual URL-grammar but value-
        // disjoint at byte level) carries both `#` and `?`; the `#`
        // byte appears first, so the fragment-`#` arm fires, surfacing
        // the more self-locating diagnostic on the byte the author
        // pasted earliest in the URL. Mirrors the peer cascade
        // discipline `fonte_repo_control_char_fires_before_fragment`
        // pins on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme?ref=main".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before query-`?` when \
             `#` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_control_char_fires_before_fragment() {
        // Cascade pin: the control-char arm structurally precedes the
        // fragment-`#` arm. A value like `"github:p/x\n#readme"` probes
        // positive on both arms (contains LF and `#`), but the narrower
        // POSIX-syscall-rejected / CRLF-injection-class diagnostic
        // (`control character`) wins so the author sees the more
        // self-locating arm first. Mirrors the peer cascade discipline
        // every prior `:repo` byte-class arm establishes.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia\n#readme".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("control character"),
            "reason must surface the control-char arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_embedded_backslash() {
        // The fail-before-pass-after pin for the canonical Windows-
        // file-path-confusion footgun on `:repo` (peer with the 3a4e1d7
        // backslash arm on the sibling `:caminho` path-fonte axis).
        // An author pastes a Windows Explorer address-bar / PowerShell
        // `Get-Location` output into a `file://` URL slot, producing
        // `file:///C:\Users\me\caixa-teia`. Until this arm landed the
        // value silently passed every prior arm (no whitespace, no
        // control chars, no non-ASCII, no `#`, no `?`, doesn't start
        // with `-` or `:`); libcurl's URL parser silently translates
        // `\` → `/` on some platforms and refuses it on others, so
        // the byte rides verbatim into the lacre's per-dep content-
        // address but is silently rewritten / rejected at the wire —
        // two authors whose `:repo` values differ only in backslash-
        // vs-forward-slash (`file:///C:\path` vs `file:///C:/path`)
        // resolve to the byte-identical local clone but lock to two
        // distinct BLAKE3 closures, defeating the THEORY.md §V.2
        // render-determinism contract on the same axis the `#`
        // fragment and `?` query arms close. Same value-shape axis-
        // floor every peer typed surface enforces; the `:caminho`
        // 3a4e1d7 arm closes the same byte on the path-fonte axis.
        let d = dep_with_fonte(DepSource::Git {
            repo: "file:///C:\\Users\\me\\caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "file:///C:\\Users\\me\\caixa-teia");
        assert!(
            reason.contains("must not contain `\\`"),
            "reason must surface the backslash-`\\` arm, got {reason:?}"
        );
        assert!(
            reason.contains("Windows"),
            "reason must name the Windows-path-confusion footgun, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_mangled_https_backslashes() {
        // The symmetric Win32-shell-mangled-slashes footgun — an author
        // copies `https://github.com/foo/bar` into a Win32 shell that
        // rewrites every `/` to `\` (the canonical `cmd.exe` path-
        // separator-coercion bug), pastes the result into a `:repo`
        // slot, and produces `https:\\github.com\foo\bar`. Pinned
        // separately from the `file://` Explorer-paste arm so a future
        // relaxation that narrows to one URL scheme surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https:\\\\github.com\\pleme-io\\caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `\\`"),
            "reason must surface the backslash-`\\` arm, got {reason:?}"
        );
        assert!(
            reason.contains("path separator") || reason.contains("path-segment separator"),
            "reason must name the URL path-segment separator grammar, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_backslash_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the backslash-`\` arm
        // are both per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte order
        // wins. A `:repo "https://github.com/p/x#readme\\foo"` carries
        // both `#` and `\`; the `#` byte appears first, so the fragment-
        // `#` arm fires, surfacing the more self-locating diagnostic on
        // the byte the author pasted earliest in the URL. Mirrors the
        // peer cascade discipline `fonte_repo_fragment_fires_before_query_when_fragment_first`
        // pins on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme\\foo".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before backslash-`\\` when \
             `#` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_uri_template_placeholder() {
        // The fail-before-pass-after pin for the canonical URI Template
        // (RFC 6570) placeholder footgun on `:repo`. An author copies a
        // README quick-start snippet / OpenAPI `servers:` URL / Helm
        // chart `home:` template that carries unresolved
        // `{org}` / `{repo}` placeholders and pastes the raw template
        // into the `:repo` slot, expecting the substrate to resolve the
        // placeholder downstream. Until this arm landed the value
        // silently passed every prior arm (no whitespace, no control
        // chars, no non-ASCII, no `#`, no `?`, no `\`, doesn't start
        // with `-` or `:`); libcurl percent-encodes `{` / `}` to `%7B`
        // / `%7D` on the wire, so the byte rides verbatim into the
        // lacre's per-dep content-address but round-trips inconsistently
        // between the lacre's per-dep content-address and the
        // resolver's `git clone <repo>` invocation, defeating the
        // THEORY.md §V.2 render-determinism contract on the same axis
        // the `#` fragment, `?` query, and `\` backslash arms close;
        // every git porcelain entry-point additionally fetches a
        // nonexistent literal-`{placeholder}`-named path far from the
        // source caixa.lisp.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/{org}/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/{org}/caixa-teia");
        assert!(
            reason.contains("must not contain `{`"),
            "reason must surface the open-brace `{{` arm, got {reason:?}"
        );
        assert!(
            reason.contains("URI Template") || reason.contains("RFC 6570"),
            "reason must name the RFC 6570 URI Template grammar, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_handlebars_doubled_brace() {
        // The symmetric Mustache / Handlebars doubled-brace
        // substitution-form footgun every CI / IaC templating engine
        // (Argo Workflows, Jinja2, Liquid, Vue / Angular interpolation,
        // GitHub Actions `${{ … }}` even though Actions uses `${{`) /
        // chart README quick-start snippet emits. Pinned separately
        // from the single-`{` `{org}` arm so a future relaxation that
        // narrows to one substitution-form surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/{{org}}/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `{`"),
            "reason must surface the open-brace `{{` arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_closing_brace_only() {
        // Asymmetric `}`-only shape — covers the closing-brace-by-
        // itself footgun (an author truncated `{org}/{repo}` mid-edit
        // and left a trailing `}` from the prior template fragment,
        // or pasted a value that included a closing brace from a
        // surrounding shell context). Pinned to ensure the predicate
        // refuses each brace independently rather than only when both
        // appear — a future regression that ANDs the two byte tests
        // surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia}".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `}`"),
            "reason must surface the close-brace `}}` arm, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_template_placeholder_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the template-`{` /
        // `}` arm are both per-byte arms inside the same
        // `for &b in s.as_bytes()` loop, so the byte that appears
        // first in the value's byte order wins. A `:repo
        // "https://github.com/p/x#readme{org}"` carries both `#` and
        // `{`; the `#` byte appears first, so the fragment-`#` arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Mirrors the
        // peer cascade discipline `fonte_repo_fragment_fires_before_backslash_when_fragment_first`
        // pins on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme{org}".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before template-`{{` when \
             `#` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_output_redirection() {
        // The fail-before-pass-after pin for the canonical
        // shell-output-redirection footgun on `:repo`: an author
        // pastes a shell-pipeline tail (`git clone <repo> > build.log`
        // / `… >output.txt`) into the `:repo` slot without trimming
        // the redirect. Until this arm landed the value silently
        // passed every prior arm (no whitespace, no control chars,
        // no non-ASCII, no `#`, no `?`, no `\`, no `{`/`}`, doesn't
        // start with `-` or `:`); RFC 3986 §2 lists `<` / `>` in the
        // 'delims' / 'unwise' set and the WHATWG URL spec's fragment
        // percent-encode set maps `>` → `%3E` on the wire, so the
        // byte rides verbatim into the lacre's per-dep BLAKE3 closure
        // but is silently rewritten or rejected at libcurl's URL-
        // parser layer — two authors whose values differ only in
        // their redirect tail (`>build.log` vs nothing) resolve to
        // the byte-identical upstream `git clone` but lock to two
        // distinct lacres, defeating the THEORY.md §V.2 render-
        // determinism contract. Peer with the `:caminho` axis's
        // `FonteCaminhoShellRedirection` arm (e457141) on the sibling
        // path-fonte axis, and `is_gateway_api_http_path`'s eleven-
        // byte RFC-3986-reserved set on `:entrada :paths`.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia>build.log".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia>build.log");
        assert!(
            reason.contains("must not contain `>`"),
            "reason must surface the output-redirection `>` arm, got {reason:?}"
        );
        assert!(
            reason.contains("redirection") || reason.contains("'delims'"),
            "reason must name the shell-redirection / RFC-3986-unwise rationale, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_input_redirection() {
        // The symmetric shell-input-redirection footgun — an author
        // pastes a shell-pipeline head (`git clone <input.url` /
        // `cat <README.md`) into the `:repo` slot. Pinned separately
        // from the `>`-output arm so a future relaxation that only
        // catches one of the two redirect bytes surfaces here. Peer
        // with the `:caminho` axis's `FonteCaminhoShellRedirection`
        // arm which closes both `<` and `>` under the same banner.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia<input.url".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `<`"),
            "reason must surface the input-redirection `<` arm, got {reason:?}"
        );
        assert!(
            reason.contains("RFC 3986") || reason.contains("'unwise'"),
            "reason must name the RFC 3986 'unwise' grammar, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_backtick_command_substitution() {
        // The fail-before-pass-after pin for the canonical
        // paste-from-shell-prompt-with-backticked-substitution footgun
        // on `:repo` (peer with the c4d62b3 backtick arm on the sibling
        // `:caminho` path-fonte axis). An author pastes a URL whose
        // segment carries a backticked command-substitution wrapper
        // (`` `whoami` ``, `` `git config user.name` ``, `` `pwd` ``)
        // from a doc / README quick-start snippet that expected the
        // substrate to substitute the value downstream. Until this arm
        // landed the value silently passed every prior arm (no
        // whitespace, no control chars, no non-ASCII, no `#`, no `?`,
        // no `\`, no `{`/`}`, no `<`/`>`, doesn't start with `-` or
        // `:`); RFC 3986 §2 lists the backtick byte in the 'delims' /
        // 'unwise' set and the WHATWG URL spec's fragment percent-
        // encode set maps `` ` `` → `%60` on the wire, so the byte
        // rides verbatim into the lacre's per-dep BLAKE3 closure but
        // is silently rewritten or rejected at libcurl's URL-parser
        // layer — two authors whose values differ only in their
        // backtick wrapper (`` `whoami` `` vs nothing) resolve to the
        // byte-identical upstream `git clone` but lock to two distinct
        // lacres, defeating the THEORY.md §V.2 render-determinism
        // contract. Peer with the `:caminho` axis's
        // `FonteCaminhoShellCommandSubstitution` arm (c4d62b3) on the
        // sibling path-fonte axis, and `is_gateway_api_http_path`'s
        // eleven-byte RFC-3986-reserved set on `:entrada :paths`.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/`whoami`/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/`whoami`/caixa-teia");
        assert!(
            reason.contains("must not contain `` ` ``"),
            "reason must surface the backtick command-substitution arm, got {reason:?}"
        );
        assert!(
            reason.contains("command-substitution") || reason.contains("'unwise'"),
            "reason must name the shell-command-substitution / RFC-3986-unwise rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_backtick_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the backtick command-
        // substitution arm are both per-byte arms inside the same
        // `for &b in s.as_bytes()` loop, so the byte that appears first
        // in the value's byte order wins. A `:repo
        // "https://github.com/p/x#readme/`whoami`"` carries both `#`
        // and backtick; the `#` byte appears first, so the fragment-
        // `#` arm fires, surfacing the more self-locating diagnostic
        // on the byte the author pasted earliest in the URL. Mirrors
        // the peer cascade discipline
        // `fonte_repo_fragment_fires_before_shell_redirection_when_fragment_first`
        // pins on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme/`whoami`".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before backtick when `#` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_shell_redirection_fires_before_backtick_when_redirection_first() {
        // Cascade pin: the shell-redirection `<` / `>` arm and the
        // backtick command-substitution arm are both per-byte arms
        // inside the same `for &b in s.as_bytes()` loop, so the byte
        // that appears first in the value's byte order wins. A `:repo
        // "https://github.com/p/x>build.log/`whoami`"` carries both
        // `>` and backtick; the `>` byte appears first, so the
        // shell-redirection arm fires, surfacing the more self-
        // locating diagnostic on the byte the author pasted earliest
        // in the URL. Pins the natural-order cascade so a future
        // reorder of the per-byte arms surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia>build.log/`whoami`".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `>`"),
            "reason must surface the shell-redirection `>` arm (fires before backtick when \
             `>` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_shell_redirection_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the shell-redirection
        // `<` / `>` arm are both per-byte arms inside the same
        // `for &b in s.as_bytes()` loop, so the byte that appears
        // first in the value's byte order wins. A `:repo
        // "https://github.com/p/x#readme>build.log"` carries both
        // `#` and `>`; the `#` byte appears first, so the fragment-
        // `#` arm fires, surfacing the more self-locating diagnostic
        // on the byte the author pasted earliest in the URL. Mirrors
        // the peer cascade discipline
        // `fonte_repo_fragment_fires_before_template_placeholder_when_fragment_first`
        // pins on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme>build.log".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before shell-redirection `>` when \
             `#` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_pipe() {
        // The fail-before-pass-after pin for the canonical
        // paste-from-shell-prompt-with-piped-pipeline footgun on
        // `:repo` (peer with the 124106f pipe arm on the sibling
        // `:caminho` path-fonte axis). An author pastes a shell
        // pipeline (`git clone <url> | tee build.log`,
        // `git ls-remote <url> | head`) into the `:repo` slot,
        // forgetting to trim the `| <consumer>` tail. Until this arm
        // landed the value silently passed every prior arm (no
        // whitespace, no control chars, no non-ASCII, no `#`, no `?`,
        // no `\`, no `{`/`}`, no `<`/`>`, no `` ` ``, doesn't start
        // with `-` or `:`); RFC 3986 §2 lists the pipe byte in the
        // 'unwise' set and the WHATWG URL spec's fragment percent-
        // encode set maps `|` → `%7C` on the wire, so the byte rides
        // verbatim into the lacre's per-dep BLAKE3 closure but is
        // silently rewritten or rejected at libcurl's URL-parser
        // layer — two authors whose values differ only in their pipe
        // tail (`|tee build.log` vs nothing) resolve to the byte-
        // identical upstream `git clone` but lock to two distinct
        // lacres, defeating the THEORY.md §V.2 render-determinism
        // contract. Peer with the `:caminho` axis's
        // `FonteCaminhoShellPipe` arm (124106f) on the sibling path-
        // fonte axis, and `is_gateway_api_http_path`'s eleven-byte
        // RFC-3986-reserved set on `:entrada :paths`.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia|tee build.log".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia|tee build.log");
        assert!(
            reason.contains("must not contain `|`"),
            "reason must surface the shell-pipe arm, got {reason:?}"
        );
        assert!(
            reason.contains("pipe") || reason.contains("'unwise'"),
            "reason must name the shell-pipe / RFC-3986-unwise rationale, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_pipe_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the pipe arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()` loop,
        // so the byte that appears first in the value's byte order
        // wins. A `:repo "https://github.com/p/x#readme|tee"` carries
        // both `#` and `|`; the `#` byte appears first, so the
        // fragment-`#` arm fires, surfacing the more self-locating
        // diagnostic on the byte the author pasted earliest in the
        // URL. Mirrors the peer cascade discipline
        // `fonte_repo_fragment_fires_before_backtick_when_fragment_first`
        // pins on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme|tee".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before pipe when `#` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_backtick_fires_before_pipe_when_backtick_first() {
        // Cascade pin: the backtick arm and the pipe arm are both per-
        // byte arms inside the same `for &b in s.as_bytes()` loop, so
        // the byte that appears first in the value's byte order wins.
        // A `:repo "https://github.com/p/x/`whoami`|tee"` carries both
        // `` ` `` and `|`; the backtick byte appears first, so the
        // backtick arm fires, surfacing the more self-locating
        // diagnostic on the byte the author pasted earliest in the
        // URL. Pins the natural-order cascade so a future reorder of
        // the per-byte arms surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia/`whoami`|tee".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `` ` ``"),
            "reason must surface the backtick arm (fires before pipe when `` ` `` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_command_separator() {
        // The fail-before-pass-after pin for the canonical
        // paste-from-shell-prompt-with-sequential-command-tail footgun
        // on `:repo` (peer with the 05c358e `;` arm on the sibling
        // `:caminho` path-fonte axis). An author pastes a shell
        // one-liner that chained a cleanup tail after the URL
        // (`git clone <url>; rm -rf build`, `git ls-remote <url>;
        // echo done`) into the `:repo` slot, forgetting to trim the
        // `; <cmd>` tail. Until this arm landed the value silently
        // passed every prior `is_git_repo_url` arm (no whitespace, no
        // control chars, no non-ASCII, no `#`, no `?`, no `\`, no
        // `{`/`}`, no `<`/`>`, no `` ` ``, no `|`, doesn't start with
        // `-` or `:`); RFC 3986 §2 lists `;` in the 'sub-delims' /
        // reserved set and the WHATWG URL spec's fragment percent-
        // encode set maps `;` → `%3B` on the wire, so the byte rides
        // verbatim into the lacre's per-dep BLAKE3 closure but is
        // silently rewritten at libcurl's URL-parser layer — two
        // authors whose values differ only in their sequential-command
        // tail (`; rm -rf build` vs nothing) resolve to the byte-
        // identical upstream `git clone` but lock to two distinct
        // lacres, defeating the THEORY.md §V.2 render-determinism
        // contract. Peer with the `:caminho` axis's
        // `FonteCaminhoShellSemicolon` arm (05c358e) on the sibling
        // path-fonte axis, and `is_gateway_api_http_path`'s eleven-
        // byte RFC-3986-reserved set on `:entrada :paths`.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia; rm -rf build".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia; rm -rf build");
        assert!(
            reason.contains("must not contain `;`"),
            "reason must surface the shell-command-separator arm, got {reason:?}"
        );
        assert!(
            reason.contains("sequential-command") || reason.contains("'sub-delims'"),
            "reason must name the shell-command-separator / RFC-3986-sub-delims \
             rationale, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_semicolon_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the semicolon arm are
        // both per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte
        // order wins. A `:repo "https://github.com/p/x#readme; rm"`
        // carries both `#` and `;`; the `#` byte appears first, so the
        // fragment-`#` arm fires, surfacing the more self-locating
        // diagnostic on the byte the author pasted earliest in the URL.
        // Mirrors the peer cascade discipline
        // `fonte_repo_fragment_fires_before_pipe_when_fragment_first`
        // pins on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme; rm".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before semicolon when `#` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_pipe_fires_before_semicolon_when_pipe_first() {
        // Cascade pin: the pipe arm and the semicolon arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()` loop,
        // so the byte that appears first in the value's byte order
        // wins. A `:repo "https://github.com/p/x|tee; rm"` carries
        // both `|` and `;`; the `|` byte appears first, so the
        // pipe arm fires, surfacing the more self-locating diagnostic
        // on the byte the author pasted earliest in the URL. Pins the
        // natural-order cascade so a future reorder of the per-byte
        // arms surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia|tee; rm".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `|`"),
            "reason must surface the pipe arm (fires before semicolon when `|` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_background() {
        // The fail-before-pass-after pin for the canonical
        // paste-from-shell-prompt-with-background-launch-tail footgun
        // on `:repo` (peer with the e12e4f3 `&` arm on the sibling
        // `:caminho` path-fonte axis). An author pastes a shell one-
        // liner that detached the clone into the background
        // (`git clone <url> & sleep 1`, `git clone <url> && cd …`)
        // into the `:repo` slot, forgetting to trim the `& <cmd>` /
        // `&& <cmd>` tail. Until this arm landed the value silently
        // passed every prior `is_git_repo_url` arm (no whitespace,
        // no control chars, no non-ASCII, no `#`, no `?`, no `\`,
        // no `{`/`}`, no `<`/`>`, no `` ` ``, no `|`, no `;`,
        // doesn't start with `-` or `:`); RFC 3986 §2 lists `&` in
        // the 'sub-delims' / reserved set and the WHATWG URL spec's
        // fragment percent-encode set maps `&` → `%26` on the wire,
        // so the byte rides verbatim into the lacre's per-dep
        // BLAKE3 closure but is silently rewritten at libcurl's
        // URL-parser layer — two authors whose values differ only
        // in their background-launch tail (`& sleep 1` vs nothing)
        // resolve to the byte-identical upstream `git clone` but
        // lock to two distinct lacres, defeating the THEORY.md
        // §V.2 render-determinism contract. Peer with the
        // `:caminho` axis's `FonteCaminhoShellBackground` arm
        // (e12e4f3) on the sibling path-fonte axis, and
        // `is_gateway_api_http_path`'s eleven-byte RFC-3986-
        // reserved set on `:entrada :paths`.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia&sleep".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia&sleep");
        assert!(
            reason.contains("must not contain `&`"),
            "reason must surface the shell-background / logical-AND arm, got {reason:?}"
        );
        assert!(
            reason.contains("background-task") || reason.contains("'sub-delims'"),
            "reason must name the shell-background / RFC-3986-sub-delims rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_logical_and() {
        // The fail-before-pass-after pin for the symmetric `&&`
        // logical-AND build-chain paste footgun: an author pastes
        // a `git clone <url> && cd <repo>` build-chain one-liner
        // and forgets to trim the `&& <cmd>` tail. The `&&` shape
        // is the same `&` byte twice in a row; the per-byte arm
        // fires on the first `&` it sees. Pinned separately from
        // the single-`&` background-launch shape so a future
        // diagnostic-surface change that special-cased the
        // doubled-byte form surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia&&echo".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `&`"),
            "reason must surface the shell-background / logical-AND arm on the doubled-`&&` \
             shape too, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_background_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the background-`&`
        // arm are both per-byte arms inside the same `for &b in
        // s.as_bytes()` loop, so the byte that appears first in the
        // value's byte order wins. A `:repo
        // "https://github.com/p/x#readme & sleep"` carries both `#`
        // and `&`; the `#` byte appears first, so the fragment-`#`
        // arm fires, surfacing the more self-locating diagnostic on
        // the byte the author pasted earliest in the URL. Mirrors
        // the peer cascade discipline
        // `fonte_repo_fragment_fires_before_semicolon_when_fragment_first`
        // on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme&sleep".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before background-`&` when `#` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_semicolon_fires_before_background_when_semicolon_first() {
        // Cascade pin: the semicolon arm and the background-`&` arm
        // are both per-byte arms inside the same `for &b in
        // s.as_bytes()` loop, so the byte that appears first in the
        // value's byte order wins. A `:repo
        // "https://github.com/p/x; rm & sleep"` carries both `;` and
        // `&`; the `;` byte appears first, so the semicolon arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Pins the
        // natural-order cascade so a future reorder of the per-byte
        // arms surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia;rm&sleep".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `;`"),
            "reason must surface the semicolon arm (fires before background-`&` when `;` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_variable_expansion() {
        // The fail-before-pass-after pin for the canonical
        // paste-from-shell-prompt-with-unsubstituted-variable footgun
        // on `:repo` (peer with the f4efe9c `$` arm on the sibling
        // `:caminho` path-fonte axis). An author pastes a shell one-
        // liner that referenced an environment variable
        // (`git clone https://github.com/$ORG/x`, `git clone
        // github:$USER/repo`) into the `:repo` slot, forgetting to
        // substitute the literal value at author time. Until this arm
        // landed the value silently passed every prior
        // `is_git_repo_url` arm (no whitespace, no control chars, no
        // non-ASCII, no `#`, no `?`, no `\`, no `{`/`}`, no `<`/`>`,
        // no `` ` ``, no `|`, no `;`, no `&`, doesn't start with `-`
        // or `:`); RFC 3986 §2 lists `$` in the 'sub-delims' /
        // reserved set and the WHATWG URL spec's fragment percent-
        // encode set maps `$` → `%24` on the wire, so the byte rides
        // verbatim into the lacre's per-dep BLAKE3 closure but is
        // silently rewritten at libcurl's URL-parser layer — two
        // authors whose values differ only in their `$VAR` /
        // `${VAR}` / `$(cmd)` expansion tail resolve to the byte-
        // identical upstream `git clone` but lock to two distinct
        // lacres, defeating the THEORY.md §V.2 render-determinism
        // contract. Beyond determinism, the value is a structural
        // host-layout leak: two authors with the same `:repo` slot
        // but different `$ORG` / `$HOME` / `$WORKSPACE` resolve
        // different upstreams. Peer with the `:caminho` axis's
        // `FonteCaminhoVarExpansion` arm (f4efe9c) on the sibling
        // path-fonte axis, and `is_gateway_api_http_path`'s eleven-
        // byte RFC-3986-reserved set on `:entrada :paths`.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/$ORG/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/$ORG/caixa-teia");
        assert!(
            reason.contains("must not contain `$`"),
            "reason must surface the shell-variable-expansion arm, got {reason:?}"
        );
        assert!(
            reason.contains("variable-expansion") || reason.contains("'sub-delims'"),
            "reason must name the shell-variable-expansion / RFC-3986-sub-delims \
             rationale, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_braced_variable_expansion() {
        // The fail-before-pass-after pin for the symmetric POSIX-
        // shell braced `${VAR}` expansion paste footgun: an author
        // pastes a CI-manifest line `git clone
        // https://github.com/${WORKSPACE}/x` (the canonical GitHub
        // Actions / GitLab CI / Drone shape) and forgets to
        // substitute the literal value. The `${...}` shape is the
        // same `$` byte at the leading position of the expansion;
        // the per-byte arm fires on the `$`. Pinned separately from
        // the bare-`$VAR` shape so a future diagnostic-surface
        // change that special-cased the braced form surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/${WORKSPACE}/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `$`"),
            "reason must surface the shell-variable-expansion arm on the braced `${{...}}` \
             shape too, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_var_expansion_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the var-expansion-`$`
        // arm are both per-byte arms inside the same `for &b in
        // s.as_bytes()` loop, so the byte that appears first in the
        // value's byte order wins. A `:repo
        // "https://github.com/p/x#readme$HOME"` carries both `#` and
        // `$`; the `#` byte appears first, so the fragment-`#` arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Mirrors the
        // peer cascade discipline
        // `fonte_repo_fragment_fires_before_background_when_fragment_first`
        // on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme$HOME".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before var-expansion-`$` when \
             `#` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_background_fires_before_var_expansion_when_background_first() {
        // Cascade pin: the background-`&` arm and the
        // var-expansion-`$` arm are both per-byte arms inside the
        // same `for &b in s.as_bytes()` loop, so the byte that
        // appears first in the value's byte order wins. A `:repo
        // "https://github.com/p/x&sleep$HOME"` carries both `&` and
        // `$`; the `&` byte appears first, so the background arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Pins the
        // natural-order cascade so a future reorder of the per-byte
        // arms surfaces here — `$` is the most recent byte-class arm,
        // so the cascade-pin sweep extends to cover every immediately
        // prior byte arm (`#`, `&`) firing first when ordered ahead
        // of `$` in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia&sleep$HOME".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `&`"),
            "reason must surface the background-`&` arm (fires before var-expansion-`$` when \
             `&` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_glob_wildcard() {
        // The fail-before-pass-after pin for the canonical
        // paste-from-shell-prompt glob footgun on `:repo` (peer with
        // the cf9034b `*` / `?` arm on the sibling `:caminho`
        // path-fonte axis). An author pastes a shell one-liner that
        // referenced a glob expansion (`ls
        // github.com/pleme-io/caixa-*`, `git clone
        // github:pleme-io/caixa-*`) into the `:repo` slot, forgetting
        // to substitute the literal repo name. Until this arm landed
        // the `*` byte silently passed every prior `is_git_repo_url`
        // arm (no whitespace, no control chars, no non-ASCII, no `#`,
        // no `?`, no `\`, no `{`/`}`, no `<`/`>`, no `` ` ``, no `|`,
        // no `;`, no `&`, no `$`, doesn't start with `-` or `:`); RFC
        // 3986 §2 lists `*` in the 'sub-delims' / reserved set and
        // the WHATWG URL spec's special-query percent-encode set maps
        // `*` → `%2A` on the wire, so the byte rides verbatim into
        // the lacre's per-dep BLAKE3 closure but is silently
        // rewritten at libcurl's URL-parser layer — two authors
        // whose values differ only in their asterisk presence
        // resolve to the byte-identical upstream `git clone` but
        // lock to two distinct lacres, defeating the THEORY.md §V.2
        // render-determinism contract. Peer with the `:caminho`
        // axis's `FonteCaminhoShellGlob` arm (cf9034b) on the
        // sibling path-fonte axis, and the `is_git_ref_name`
        // refspec-wildcard cascade on the `:fonte :tag` / `:branch`
        // axes.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-*".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-*");
        assert!(
            reason.contains("must not contain `*`"),
            "reason must surface the shell-glob arm, got {reason:?}"
        );
        assert!(
            reason.contains("pathname-expansion") || reason.contains("'sub-delims'"),
            "reason must name the shell-glob / pathname-expansion / \
             RFC-3986-sub-delims rationale, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_recursive_shell_glob() {
        // The fail-before-pass-after pin for the symmetric bash
        // `globstar` recursive-glob paste footgun: an author pastes
        // a `ls github.com/pleme-io/**/x` (the canonical
        // `globstar`-shopt-enabled recursive-listing tail) into the
        // `:repo` slot. The `**` shape is two `*` bytes adjacent;
        // the per-byte arm fires on the first `*`. Pinned
        // separately from the single-`*` shape so a future
        // diagnostic-surface change that special-cased the
        // double-`*` form surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/**/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `*`"),
            "reason must surface the shell-glob arm on the `**` recursive-glob shape too, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_glob_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the glob-`*` arm are
        // both per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte
        // order wins. A `:repo
        // "https://github.com/p/x#readme*tail"` carries both `#` and
        // `*`; the `#` byte appears first, so the fragment-`#` arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Mirrors the
        // peer cascade discipline
        // `fonte_repo_fragment_fires_before_var_expansion_when_fragment_first`
        // on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme*tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before glob-`*` when `#` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_var_expansion_fires_before_glob_when_var_expansion_first() {
        // Cascade pin: the var-expansion-`$` arm and the glob-`*`
        // arm are both per-byte arms inside the same `for &b in
        // s.as_bytes()` loop, so the byte that appears first in the
        // value's byte order wins. A `:repo
        // "https://github.com/p/$ORG-*"` carries both `$` and `*`;
        // the `$` byte appears first, so the var-expansion arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Pins the
        // natural-order cascade so a future reorder of the per-byte
        // arms surfaces here — `*` is the most recent byte-class
        // arm, so the cascade-pin sweep extends to cover the
        // immediately prior `$` byte arm firing first when ordered
        // ahead of `*` in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/$ORG-caixa-*".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `$`"),
            "reason must surface the var-expansion-`$` arm (fires before glob-`*` when `$` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_subshell_open_paren() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // shell-prompt subshell-grouping footgun on `:repo`. An author
        // pastes a doc / README snippet carrying a regex-alternation
        // grouping shape (`https://github.com/(foo|bar)/repo`) or a
        // dynamic-config-substitution wrapper (`$(<cmd>)`) into the
        // `:repo` slot, forgetting to substitute one literal org name.
        // Until this arm landed the `(` byte silently passed every
        // prior `is_git_repo_url` arm (no whitespace, no control
        // chars, no non-ASCII, no `#`, no `?`, no `\`, no `{`/`}`, no
        // `<`/`>`, no `` ` ``, no `|`, no `;`, no `&`, no `$`, no
        // `*`, doesn't start with `-` or `:`); RFC 3986 §2 lists `(`
        // / `)` in the 'sub-delims' / reserved set, and the WHATWG
        // URL spec's special-query percent-encode set maps `(` →
        // `%28` and `)` → `%29` on the wire, so the byte rides
        // verbatim into the lacre's per-dep BLAKE3 closure but is
        // silently rewritten at libcurl's URL-parser layer —
        // defeating the THEORY.md §V.2 render-determinism contract on
        // the same axis the prior twelve byte-class arms close.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/(foo|bar)/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/(foo|bar)/caixa-teia");
        assert!(
            reason.contains("must not contain `(`"),
            "reason must surface the subshell-open-paren arm, got {reason:?}"
        );
        assert!(
            reason.contains("subshell-grouping") || reason.contains("'sub-delims'"),
            "reason must name the shell-subshell-grouping / RFC-3986-sub-delims rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_subshell_close_paren() {
        // The symmetric arm pin on the closing `)` byte: an author
        // pastes a `$(date)` command-substitution wrapper or a
        // regex-alternation `(foo|bar)` tail into the `:repo` slot.
        // Pinned separately from the opening `(` shape so a future
        // diagnostic-surface change that only checked one boundary
        // surfaces here. The `(` byte appears earlier in the
        // canonical regex / subshell wrapper so the per-byte loop
        // fires on `(` first; this test exercises a `:repo` value
        // carrying only the closing `)` byte (no opening paren) so
        // the `)` arm fires directly — pinning the byte-class arm
        // independent of order.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia)tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `)`"),
            "reason must surface the subshell-close-paren arm on the bare `)` shape, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_subshell_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the subshell-`(` arm
        // are both per-byte arms inside the same `for &b in
        // s.as_bytes()` loop, so the byte that appears first in the
        // value's byte order wins. A `:repo
        // "https://github.com/p/x#readme(tail)"` carries both `#` and
        // `(`; the `#` byte appears first, so the fragment-`#` arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Mirrors the
        // peer cascade discipline
        // `fonte_repo_fragment_fires_before_glob_when_fragment_first`
        // on the prior `:repo` byte-class arm.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme(tail)".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before subshell-`(` when `#` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_glob_fires_before_subshell_when_glob_first() {
        // Cascade pin: the glob-`*` arm (the immediate-predecessor
        // byte-class arm, 3902a9a) and the subshell-`(` arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte
        // order wins. A `:repo
        // "https://github.com/p/x-*-(date)"` carries both `*` and
        // `(`; the `*` byte appears first, so the glob arm fires,
        // surfacing the more self-locating diagnostic on the byte
        // the author pasted earliest in the URL. Pins the natural-
        // order cascade so a future reorder of the per-byte arms
        // surfaces here — `(` is the most recent byte-class arm,
        // so the cascade-pin sweep extends to cover the immediately
        // prior `*` byte arm firing first when ordered ahead of `(`
        // in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia-*-(date)".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `*`"),
            "reason must surface the glob-`*` arm (fires before subshell-`(` when `*` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_double_quote() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // doc-shell-quoting footgun on `:repo`. An author copies a
        // README quick-start snippet (`$ git clone "https://github.com/
        // foo/bar"`) and keeps the surrounding double-quote bytes when
        // pasting into the `:repo` slot — the doc wraps the URL in
        // double quotes so the shell doesn't re-lex metachars inside,
        // but the typed slot is itself a byte-level string parser, not
        // a shell context, so the quote bytes ride into the value
        // verbatim. Until this arm landed the `"` byte silently passed
        // every prior `is_git_repo_url` arm (no whitespace, no control
        // chars, no non-ASCII, no `#`, no `?`, no `\`, no `{`/`}`, no
        // `<`/`>`, no `` ` ``, no `|`, no `;`, no `&`, no `$`, no `*`,
        // no `(`/`)`, doesn't start with `-` or `:`); RFC 3986 §2 lists
        // `"` in the strict four-byte 'delims' subset (with `<`, `>`,
        // `` ` ``) every URL parser is required to refuse or percent-
        // encode, and the WHATWG URL spec's 'C0 control percent-encode
        // set' maps `"` → `%22` on the wire, so the byte rides verbatim
        // into the lacre's per-dep BLAKE3 closure but is silently
        // rewritten at libcurl's URL-parser layer, defeating the
        // THEORY.md §V.2 render-determinism contract.
        let d = dep_with_fonte(DepSource::Git {
            repo: "\"https://github.com/pleme-io/caixa-teia\"".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "\"https://github.com/pleme-io/caixa-teia\"");
        assert!(
            reason.contains("must not contain `\"`"),
            "reason must surface the shell-double-quote arm, got {reason:?}"
        );
        assert!(
            reason.contains("double-quote") || reason.contains("'delims'"),
            "reason must name the shell-double-quote / RFC-3986-delims rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_stray_trailing_double_quote() {
        // The symmetric stray-quote tail pin: an author pastes only a
        // closing `"` from a shell-history line like `git clone
        // "https://github.com/foo/bar" && cd …` (the trim went too
        // far in one direction but not the other) into the `:repo`
        // slot. Pinned separately from the wrapped-quote shape so a
        // future diagnostic-surface change that only checked one
        // boundary (only leading, only trailing, only paired) surfaces
        // here — the per-byte arm fires anywhere `"` appears.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia\"".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `\"`"),
            "reason must surface the shell-double-quote arm on the trailing-`\"` shape, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_double_quote_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the double-quote arm
        // are both per-byte arms inside the same `for &b in
        // s.as_bytes()` loop, so the byte that appears first in the
        // value's byte order wins. A `:repo
        // "https://github.com/p/x#readme\"tail"` carries both `#` and
        // `"`; the `#` byte appears first, so the fragment-`#` arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme\"tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before double-quote when `#` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_subshell_fires_before_double_quote_when_subshell_first() {
        // Cascade pin: the subshell-`(` arm (the immediate-predecessor
        // byte-class arm, 3b99147) and the double-quote arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()` loop,
        // so the byte that appears first in the value's byte order
        // wins. A `:repo "github:p/x(date)\"tail"` carries both `(`
        // and `"`; the `(` byte appears first, so the subshell arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Pins the natural-
        // order cascade so a future reorder of the per-byte arms
        // surfaces here — `"` is the most recent byte-class arm, so
        // the cascade-pin sweep extends to cover the immediately prior
        // `(` byte arm firing first when ordered ahead of `"` in the
        // value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia(date)\"tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `(`"),
            "reason must surface the subshell-`(` arm (fires before double-quote when `(` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_single_quote() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // doc-strong-quoting footgun on `:repo`. An author copies a
        // security-conscious README quick-start snippet (`$ git clone
        // 'https://github.com/foo/bar'`) and keeps the surrounding
        // single-quote bytes when pasting into the `:repo` slot — the
        // doc strong-quotes the URL so the shell suppresses every form
        // of expansion on the bytes inside (no `$`, no backtick, no
        // glob, no word-splitting), but the typed slot is itself a
        // byte-level string parser, not a shell context, so the quote
        // bytes ride into the value verbatim. Until this arm landed the
        // `'` byte silently passed every prior `is_git_repo_url` arm
        // (no whitespace, no control chars, no non-ASCII, no `#`, no
        // `?`, no `\`, no `{`/`}`, no `<`/`>`, no `` ` ``, no `|`, no
        // `;`, no `&`, no `$`, no `*`, no `(`/`)`, no `"`, doesn't start
        // with `-` or `:`); RFC 3986 §2.2 lists `'` in the 'sub-delims'
        // set, peer with the `\"` 'delims' double-quote arm and the
        // partner ASCII shell-string-delimiter byte every byte-level
        // string parser sharing a value-shape with a shell argument
        // must refuse on a URL-shaped slot.
        let d = dep_with_fonte(DepSource::Git {
            repo: "'https://github.com/pleme-io/caixa-teia'".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "'https://github.com/pleme-io/caixa-teia'");
        assert!(
            reason.contains("must not contain `'`"),
            "reason must surface the shell-single-quote arm, got {reason:?}"
        );
        assert!(
            reason.contains("single-quote") || reason.contains("strong-quote"),
            "reason must name the shell-single-quote / strong-quote rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_english_apostrophe() {
        // The symmetric English-typography pin: an author writes
        // `:repo "github:p/repo's-fork"` (the possessive-form paste-
        // from-prose idiom every README / commit-message / chat-thread
        // reference to a repo carries) expecting the substrate to
        // coerce it to a kebab-case slug — but the byte rides into the
        // lacre verbatim. Pinned separately from the wrapped-quote
        // shape so a future diagnostic-surface change that only checked
        // the boundary positions (only leading, only trailing, only
        // paired) surfaces here — the per-byte arm fires anywhere `'`
        // appears in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/repo's-fork".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `'`"),
            "reason must surface the shell-single-quote arm on the mid-string \
             apostrophe shape, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_single_quote_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the single-quote arm
        // are both per-byte arms inside the same `for &b in
        // s.as_bytes()` loop, so the byte that appears first in the
        // value's byte order wins. A `:repo
        // "https://github.com/p/x#readme'tail"` carries both `#` and
        // `'`; the `#` byte appears first, so the fragment-`#` arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme'tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before single-quote when `#` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_double_quote_fires_before_single_quote_when_double_quote_first() {
        // Cascade pin: the double-quote-`"` arm (the immediate-predecessor
        // byte-class arm, 4267d8b) and the single-quote arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()` loop,
        // so the byte that appears first in the value's byte order
        // wins. A `:repo "github:p/x\"mid'tail"` carries both `"` and
        // `'`; the `"` byte appears first, so the double-quote arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Pins the natural-
        // order cascade so a future reorder of the per-byte arms
        // surfaces here — `'` is the most recent byte-class arm, so
        // the cascade-pin sweep extends to cover the immediately prior
        // `"` byte arm firing first when ordered ahead of `'` in the
        // value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia\"mid'tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `\"`"),
            "reason must surface the double-quote arm (fires before single-quote when `\"` \
             byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_history_expansion() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // shell-history footgun on `:repo`. An author copies a `git
        // clone <url>!sudo make install` one-liner from a README's
        // quick-start snippet, intending the trailing `!sudo` as a
        // shell-history-expansion reference but the typed slot is itself
        // a byte-level string parser, not a shell context, so the byte
        // rides into the value verbatim. Until this arm landed the `!`
        // byte silently passed every prior `is_git_repo_url` arm (no
        // whitespace, no control chars, no non-ASCII, no `#`, no `?`,
        // no `\`, no `{`/`}`, no `<`/`>`, no `` ` ``, no `|`, no `;`,
        // no `&`, no `$`, no `*`, no `(`/`)`, no `"`, no `'`, doesn't
        // start with `-` or `:`); bash with the default `histexpand`
        // mode rewrites `!command` to the most recent history entry
        // beginning with `command`, the canonical RCE-class injection
        // vector when the byte rides into a shell argument.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia!sudo".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia!sudo");
        assert!(
            reason.contains("must not contain `!`"),
            "reason must surface the shell-history-expansion arm, got {reason:?}"
        );
        assert!(
            reason.contains("history-expansion") || reason.contains("bang"),
            "reason must name the shell-history-expansion / bang rationale, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_double_bang_history_reference() {
        // The symmetric `!!` repeat-prior-command pin: an author paste-
        // trims a `git clone <url>` retry idiom from shell history that
        // expands to the previous command via `!!`. Pinned separately
        // from the wrapped `!command` shape so a future diagnostic-
        // surface change that only checked the leading or paired-bang
        // position surfaces here — the per-byte arm fires anywhere `!`
        // appears in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia!!".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `!`"),
            "reason must surface the shell-history-expansion arm on the trailing-`!!` shape, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_bang_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the bang arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()` loop,
        // so the byte that appears first in the value's byte order
        // wins. A `:repo "https://github.com/p/x#readme!tail"` carries
        // both `#` and `!`; the `#` byte appears first, so the
        // fragment-`#` arm fires, surfacing the more self-locating
        // diagnostic on the byte the author pasted earliest in the URL.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme!tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before bang when `#` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_single_quote_fires_before_bang_when_single_quote_first() {
        // Cascade pin: the single-quote-`'` arm (the immediate-predecessor
        // byte-class arm, e7a109f) and the bang arm are both per-byte
        // arms inside the same `for &b in s.as_bytes()` loop, so the
        // byte that appears first in the value's byte order wins. A
        // `:repo "github:p/x'mid!tail"` carries both `'` and `!`; the
        // `'` byte appears first, so the single-quote arm fires,
        // surfacing the more self-locating diagnostic on the byte the
        // author pasted earliest in the URL. Pins the natural-order
        // cascade so a future reorder of the per-byte arms surfaces
        // here — `!` is the most recent byte-class arm, so the
        // cascade-pin sweep extends to cover the immediately prior `'`
        // byte arm firing first when ordered ahead of `!` in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia'mid!tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `'`"),
            "reason must surface the single-quote arm (fires before bang when `'` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_list_separator_comma() {
        // The fail-before-pass-after pin for the canonical
        // list-separator-belongs-to-list-grammar footgun on `:repo`.
        // An author copies a `git clone <a>, <b>, <c>` paste-from-CSV
        // one-liner from a multi-repo bootstrap doc, intending the
        // comma to separate multiple repo entries but the typed
        // `:repo` slot names *one* repo (the list-separator belongs
        // to the `:deps` list grammar, not to the value). Until this
        // arm landed the `,` byte silently passed every prior
        // `is_git_repo_url` arm (no whitespace, no control chars, no
        // non-ASCII, no `#`, no `?`, no `\`, no `{`/`}`, no `<`/`>`,
        // no `` ` ``, no `|`, no `;`, no `&`, no `$`, no `*`, no
        // `(`/`)`, no `"`, no `'`, no `!`, doesn't start with `-` or
        // `:`); the byte rode into the lacre's per-dep content-
        // address and the resolver's `git clone <repo>` subprocess
        // invocation, where no host's repo registry resolved the
        // comma-bearing slug.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia,github:pleme-io/caixa-feira".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(
            repo,
            "github:pleme-io/caixa-teia,github:pleme-io/caixa-feira"
        );
        assert!(
            reason.contains("must not contain `,`"),
            "reason must surface the list-separator-comma arm, got {reason:?}"
        );
        assert!(
            reason.contains("list-separator") || reason.contains("sub-delims"),
            "reason must name the list-separator / RFC-3986-sub-delims rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_trailing_comma() {
        // The symmetric trailing-`,` paste-from-prose pin: an author
        // writes `:repo "github:pleme-io/caixa-feira,"` (the trailing
        // comma every README-prose list-of-projects sentence carries,
        // mistakenly retained when the slug is pasted mid-sentence)
        // expecting the substrate to coerce it to a kebab-case slug.
        // Pinned separately from the wrapped mid-token shape so a
        // future diagnostic-surface change that only checked the
        // leading or paired-comma position surfaces here — the
        // per-byte arm fires anywhere `,` appears in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-feira,".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `,`"),
            "reason must surface the list-separator-comma arm on the trailing-`,` shape, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_comma_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the comma arm are
        // both per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte
        // order wins. A `:repo "https://github.com/p/x#readme,tail"`
        // carries both `#` and `,`; the `#` byte appears first, so
        // the fragment-`#` arm fires, surfacing the more self-
        // locating diagnostic on the byte the author pasted earliest
        // in the URL.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme,tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before comma when `#` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_bang_fires_before_comma_when_bang_first() {
        // Cascade pin: the bang-`!` arm (the immediate-predecessor
        // byte-class arm, 7d53c68) and the comma arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte
        // order wins. A `:repo "github:p/x!mid,tail"` carries both
        // `!` and `,`; the `!` byte appears first, so the bang arm
        // fires, surfacing the more self-locating diagnostic on the
        // byte the author pasted earliest in the URL. Pins the
        // natural-order cascade so a future reorder of the per-byte
        // arms surfaces here — `,` is the most recent byte-class
        // arm, so the cascade-pin sweep extends to cover the
        // immediately prior `!` byte arm firing first when ordered
        // ahead of `,` in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia!mid,tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `!`"),
            "reason must surface the bang arm (fires before comma when `!` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_shell_env_var_assignment() {
        // The fail-before-pass-after pin for the canonical
        // shell-env-var-assignment-belongs-to-shell-grammar footgun
        // on `:repo`. An author copies
        // `GIT_TERMINAL_PROMPT=0 git clone <url>` (or
        // `GIT_SSL_NO_VERIFY=1 git clone <url>`, `HTTPS_PROXY=…
        // git clone <url>`, etc. — the canonical
        // git-troubleshooting README idiom for a one-shot env-var
        // scoped to the `git clone` invocation) from a shell-prompt
        // one-liner, intending the `KEY=VALUE` prefix as a shell-
        // grammar env-var assignment but the typed `:repo` slot is
        // a value parser, not a shell context, so the bytes ride
        // into the value verbatim. Until this arm landed the `=`
        // byte silently passed every prior `is_git_repo_url` arm
        // (no whitespace, no control chars, no non-ASCII, no `#`,
        // no `?`, no `\`, no `{`/`}`, no `<`/`>`, no `` ` ``, no
        // `|`, no `;`, no `&`, no `$`, no `*`, no `(`/`)`, no `"`,
        // no `'`, no `!`, no `,`, doesn't start with `-` or `:`);
        // the byte rode into the lacre's per-dep content-address
        // and the resolver's `git clone <repo>` subprocess
        // invocation, where the upstream host's git porcelain
        // fetched a literal `GIT_TERMINAL_PROMPT=0 https://…`-shaped
        // path that no host's repo registry resolves.
        let d = dep_with_fonte(DepSource::Git {
            repo: "GIT_TERMINAL_PROMPT=0 https://github.com/pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(
            repo,
            "GIT_TERMINAL_PROMPT=0 https://github.com/pleme-io/caixa-teia"
        );
        // The `=` byte at position 19 of `GIT_TERMINAL_PROMPT=0 …`
        // appears before the ` ` byte at position 21, so the `=`
        // arm fires (not the whitespace arm) — both arms guard
        // the slot, but the per-byte for-loop scans left-to-right
        // and the first matching byte wins.
        assert!(
            reason.contains("must not contain `=`"),
            "reason must surface the equals-`=` arm on the env-var-assignment \
             paste shape, got {reason:?}"
        );
        assert!(
            reason.contains("env-var-assignment") || reason.contains("KEY=VALUE"),
            "reason must name the shell-env-var-assignment rationale, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_gitconfig_url_key_prefix() {
        // The symmetric paste-from-gitconfig pin: an author copies
        // `url=https://github.com/p/x` from `git config --get-all
        // remote.origin.url` output, a `.gitconfig` `[remote
        // "origin"] url = https://…` ini-stanza paste, or a
        // `git config remote.origin.url <value>` doc snippet,
        // intending the `url=` prefix as the ini-key but the typed
        // `:repo` slot is a URL value parser, not a gitconfig
        // grammar. With no leading whitespace and no earlier-arm
        // bytes in the value, the `=` arm itself fires (rather
        // than cascading to the whitespace arm as in the env-var
        // paste shape). Pinned separately so a future diagnostic-
        // surface change that only checked the whitespace-leading
        // shape surfaces here — the per-byte arm fires anywhere
        // `=` appears in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "url=https://github.com/pleme-io/caixa-feira".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `=`"),
            "reason must surface the equals-`=` arm on the `url=…` gitconfig \
             paste shape, got {reason:?}"
        );
        assert!(
            reason.contains("key-value-separator") || reason.contains("sub-delims"),
            "reason must name the key-value-separator / RFC-3986-sub-delims \
             rationale, got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_equals_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the `=` arm are
        // both per-byte arms inside the same `for &b in s.as_bytes()`
        // loop, so the byte that appears first in the value's byte
        // order wins. A `:repo "https://github.com/p/x#readme=tail"`
        // carries both `#` and `=`; the `#` byte appears first, so
        // the fragment-`#` arm fires, surfacing the more self-
        // locating diagnostic on the byte the author pasted earliest
        // in the URL.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#readme=tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before equals when \
             `#` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_comma_fires_before_equals_when_comma_first() {
        // Cascade pin: the comma-`,` arm (the immediate-predecessor
        // byte-class arm, 775b80e) and the `=` arm are both per-byte
        // arms inside the same `for &b in s.as_bytes()` loop, so
        // the byte that appears first in the value's byte order
        // wins. A `:repo "github:p/x,mid=tail"` carries both `,`
        // and `=`; the `,` byte appears first, so the comma arm
        // fires, surfacing the more self-locating diagnostic on
        // the byte the author pasted earliest in the URL. Pins the
        // natural-order cascade so a future reorder of the per-byte
        // arms surfaces here — `=` is the most recent byte-class
        // arm, so the cascade-pin sweep extends to cover the
        // immediately prior `,` byte arm firing first when ordered
        // ahead of `=` in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia,mid=tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `,`"),
            "reason must surface the comma arm (fires before equals when `,` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_percent_encoded_space() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // browser-address-bar percent-encoded-space footgun on `:repo`.
        // An author copies `https://github.com/p/x%20test` from a
        // browser address bar (or a percent-encoded README hyperlink,
        // or a `curl --data-urlencode` shell-pipeline output)
        // intending `%20` as the URL encoding of a literal space; the
        // typed `:repo` slot already rejects the literal space byte
        // (the whitespace arm at the top of `is_git_repo_url`), so an
        // author trying to express "I really meant a space" reaches
        // for percent-encoding. Until this arm landed the `%` byte
        // silently passed every prior `is_git_repo_url` arm and rode
        // verbatim into the lacre's per-dep content-address — but
        // libcurl re-percent-encodes `%` to `%25` on the wire (since
        // `%` is reserved as the escape-sequence lead-in), so the
        // wire request becomes `https://github.com/p/x%2520test`, a
        // path the lacre's content-address never names. The classic
        // render-determinism violation on the encoding-mechanism axis
        // itself.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia%20test".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia%20test");
        assert!(
            reason.contains("must not contain `%`"),
            "reason must surface the percent-`%` arm on the percent-encoded-space \
             paste shape, got {reason:?}"
        );
        assert!(
            reason.contains("percent-encoding") || reason.contains("%25"),
            "reason must name the percent-encoding / `%25` re-encoding rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_percent_encoded_slash() {
        // The symmetric over-encoded-path-separator pin: an author
        // writes `:repo "https://github.com/p%2Fx"` intending the
        // `%2F` as the URL encoding of `/` (the canonical
        // paste-from-OpenAPI-spec / paste-from-percent-encoded-template
        // footgun every API client library and OAuth redirect-URI
        // documentation surfaces — the `/` is the URL-path-separator
        // and some templates percent-encode it to escape interpretation
        // as a path separator). The GitHub Smart-HTTP transport
        // resolves the URL's path-segment grammar before the
        // percent-decoding pass, so the value identifies a different
        // resource on the wire than the literal-`/` form the lacre's
        // content-address must agree with — two authors whose `:repo`
        // values differ only in their `/` vs `%2F` presence lock to
        // two distinct BLAKE3 closures for the byte-identical upstream
        // `git clone`. Pinned separately so a future diagnostic
        // surface that only catches the `%20` shape surfaces here too.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io%2Fcaixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `%`"),
            "reason must surface the percent-`%` arm on the over-encoded-path \
             shape, got {reason:?}"
        );
        assert!(
            reason.contains("render-determinism") || reason.contains("BLAKE3"),
            "reason must name the render-determinism / BLAKE3-closure rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_fragment_fires_before_percent_when_fragment_first() {
        // Cascade pin: the fragment-`#` arm and the `%` arm are both
        // per-byte arms inside the same `for &b in s.as_bytes()` loop,
        // so the byte that appears first in the value's byte order
        // wins. A `:repo "https://github.com/p/x#sec%20tail"` carries
        // both `#` and `%`; the `#` byte appears first, so the
        // fragment-`#` arm fires, surfacing the more self-locating
        // diagnostic on the byte the author pasted earliest in the URL.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia#sec%20tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `#`"),
            "reason must surface the fragment-`#` arm (fires before percent when \
             `#` byte appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_equals_fires_before_percent_when_equals_first() {
        // Cascade pin: the equals-`=` arm (the immediate-predecessor
        // byte-class arm, acf99af) and the `%` arm are both per-byte
        // arms inside the same `for &b in s.as_bytes()` loop, so the
        // byte that appears first in the value's byte order wins.
        // A `:repo "github:p/x=mid%20tail"` carries both `=` and `%`;
        // the `=` byte appears first, so the equals arm fires,
        // surfacing the more self-locating diagnostic on the byte the
        // author pasted earliest in the URL. Pins the natural-order
        // cascade so a future reorder of the per-byte arms surfaces
        // here — `%` is the most recent byte-class arm, so the
        // cascade-pin sweep extends to cover the immediately prior
        // `=` byte arm firing first when ordered ahead of `%` in the
        // value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia=mid%20tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `=`"),
            "reason must surface the equals arm (fires before percent when `=` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_caret_history_substitution() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // shell-history footgun on `:repo`. An author copies a
        // `git clone <url>` line from their terminal followed by a
        // bash / ksh / zsh `^typo^fix^` quick-edit-and-rerun shell-
        // history shorthand (the `^old^new^` form re-runs the prior
        // history entry with the first `old` substituted by `new`,
        // bash's default behavior on interactive sessions with
        // `set -o histexpand`), forgetting to trim the trailing
        // `^...^...` shell-history fragment from the URL value. The
        // `^` byte sits in the RFC 3986 §2 'unwise' set (peer with
        // `{`, `}`, `|`, `\\` — the strictest of the §2 reserved
        // classes), the WHATWG URL spec's 'fragment percent-encode
        // set' maps `^` → `%5E` on the wire, so the byte rides
        // verbatim into the lacre's per-dep content-address but
        // libcurl re-encodes it to `%5E` at `git clone` time — the
        // classic render-determinism violation on the same axis the
        // peer `%`, `=`, `,`, `!`, `'`, `"`, `(`, `)`, `*`, `$`,
        // `&`, `;`, `|`, backtick, `<`, `>`, `{`, `}`, `\\`, `?`,
        // `#` arms close.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia^typo^fix".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "https://github.com/pleme-io/caixa-teia^typo^fix");
        assert!(
            reason.contains("must not contain `^`"),
            "reason must surface the caret-`^` arm on the paste-from-shell-history \
             shape, got {reason:?}"
        );
        assert!(
            reason.contains("history-substitution") || reason.contains("%5E"),
            "reason must name the shell-history-substitution / `%5E` wire-encoding \
             rationale, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_carrying_caret_regex_anchor() {
        // The symmetric paste-from-doc-grep-pipeline footgun: an
        // author writes `:repo "github:p/^archived"` after copying a
        // `grep '^archived'` regex-anchor / negation idiom from a
        // doc / README quick-listing snippet, expecting the substrate
        // to coerce it to a literal repo name. The byte rides
        // verbatim into the lacre's per-dep content-address and
        // diverges from the byte-identical literal `archived` form
        // every other author authored — the canonical render-
        // determinism violation pin on the second footgun shape the
        // caret-`^` arm closes.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/^archived".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `^`"),
            "reason must surface the caret-`^` arm on the regex-anchor shape, \
             got {reason:?}"
        );
        assert!(
            reason.contains("render-determinism") || reason.contains("BLAKE3"),
            "reason must name the render-determinism / BLAKE3-closure rationale, \
             got {reason:?}"
        );
    }

    #[test]
    fn fonte_repo_percent_fires_before_caret_when_percent_first() {
        // Cascade pin: the `%` arm (the immediate-predecessor byte-
        // class arm, a323db8) and the `^` arm are both per-byte arms
        // inside the same `for &b in s.as_bytes()` loop, so the byte
        // that appears first in the value's byte order wins. A
        // `:repo "https://github.com/p/x%20mid^tail"` carries both
        // `%` and `^`; the `%` byte appears first, so the percent
        // arm fires, surfacing the more self-locating diagnostic on
        // the byte the author pasted earliest in the URL. Pins the
        // natural-order cascade so a future reorder of the per-byte
        // arms surfaces here — `^` is the most recent byte-class arm,
        // so the cascade-pin sweep extends to cover the immediately
        // prior `%` byte arm firing first when ordered ahead of `^`
        // in the value.
        let d = dep_with_fonte(DepSource::Git {
            repo: "https://github.com/pleme-io/caixa-teia%20mid^tail".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not contain `%`"),
            "reason must surface the percent arm (fires before caret when `%` byte \
             appears first in value), got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_missing_colon_separator() {
        // The "I dropped the scheme" footgun — `:repo "pleme-io/caixa-teia"`
        // (no `github:` prefix, no scheme). Every documented form
        // carries a `:` (`github:`, `https://`, `ssh://`, `git://`,
        // `file://`, or `git@host:path`); a bare `org/repo` is
        // ambiguous (`git clone` reads as a relative filesystem path
        // rather than the GitHub-shorthand expansion the author
        // probably intended) and the gate rejects the shape upstream.
        let d = dep_with_fonte(DepSource::Git {
            repo: "pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must contain a `:`"),
            "reason must surface the missing-`:` arm, got {reason:?}"
        );
        assert!(
            reason.contains("github:"),
            "reason must name the canonical `github:` shorthand prefix, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_leading_colon() {
        // The "empty scheme" footgun — `:repo ":foo"` has a zero-length
        // scheme that no git porcelain entry-point accepts. Pinned
        // separately from the missing-`:` arm because a value with a
        // leading `:` does technically contain a `:` separator; the
        // shape gate rejects on a dedicated arm so the diagnostic
        // names the specific footgun.
        let d = dep_with_fonte(DepSource::Git {
            repo: ":pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("must not start with `:`"),
            "reason must surface the leading-`:` arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_repo_too_long() {
        // The cap arm — a `:repo` value longer than
        // [`crate::render::GIT_REPO_URL_MAX_LEN`] (2048) bytes is
        // structurally untenable on every realistic landing site (the
        // resolver's `git clone` invocation, the future M4 CR
        // materializer's per-dep `repo:` axis); a value of that length
        // is almost certainly a paste-from-binary slug.
        let too_long = format!(
            "github:pleme-io/{}",
            "x".repeat(crate::render::GIT_REPO_URL_MAX_LEN)
        );
        let d = dep_with_fonte(DepSource::Git {
            repo: too_long.clone(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { reason, .. } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert!(
            reason.contains("2048"),
            "reason must name the cap, got {reason:?}"
        );
    }

    #[test]
    fn validate_accepts_canonical_git_fonte_repo_shapes() {
        // The positive-control sweep: every documented author shape on
        // the `:fonte :repo` axis ([`crate::DepSource::Git`] doc comment)
        // must pass the value-shape gate. Pinned so a future tightening
        // (e.g. forbidding `http://` in favor of `https://`-only) surfaces
        // here as a structural decision. Each form is exercised with the
        // same canonical `:tag` pin so only the `:repo` axis varies.
        for repo in [
            // The pleme-io registry-shorthand convention — `github:org/repo`.
            "github:pleme-io/caixa-teia",
            // Other host-aliased shorthands (the resolver's pluggable
            // host-prefix table).
            "gitlab:pleme-io/caixa-teia",
            "codeberg:pleme-io/caixa-teia",
            "sourcehut:~pleme-io/caixa-teia",
            // Full HTTPS URL with and without `.git` suffix.
            "https://github.com/pleme-io/caixa-teia",
            "https://github.com/pleme-io/caixa-teia.git",
            // HTTP (rare; dev / mirror).
            "http://example.com/pleme-io/caixa-teia.git",
            // SSH URL.
            "ssh://git@github.com/pleme-io/caixa-teia.git",
            "ssh://git@git.example.com:2222/pleme-io/caixa-teia.git",
            // Scp-style SSH — the canonical `git@host:path` short form.
            "git@github.com:pleme-io/caixa-teia.git",
            "git@git.example.com:team/private.git",
            // Anonymous git protocol.
            "git://git.example.com/pleme-io/caixa-teia.git",
            // Local file URL (dev path).
            "file:///tmp/caixa-teia",
        ] {
            let d = dep_with_fonte(DepSource::Git {
                repo: repo.into(),
                tag: Some("v0.1.0".into()),
                rev: None,
                branch: None,
            });
            d.validate()
                .unwrap_or_else(|e| panic!("canonical repo {repo:?} must validate, got {e:?}"));
        }
    }

    #[test]
    fn fonte_repo_empty_takes_precedence_over_shape() {
        // Order pin: the existing `FonteRepoEmpty` diagnostic (narrower
        // diagnostic; doesn't try to parse the URL shape) fires before
        // the new `FonteRepoShape` per-axis gate, so an empty `:repo`
        // keeps its narrower error message. Mirrors
        // `fonte_repo_empty_fires_before_pin_missing` (already pinned)
        // on the ordering layer.
        let d = dep_with_fonte(DepSource::Git {
            repo: String::new(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteRepoEmpty { .. }),
            "got {err:?}"
        );
    }

    #[test]
    fn fonte_repo_shape_fires_before_pin_missing() {
        // Order pin: a malformed `:repo` value on a dep with no pin set
        // surfaces the `:repo` shape diagnostic (the more self-locating
        // axis — the `:repo` is the load-bearing identity of the source;
        // a missing pin is downstream from "do we even know the repo")
        // rather than collapsing onto the pin-missing diagnostic. The
        // shape gate runs inline before the pin enumeration in
        // `DepSource::validate`.
        let d = dep_with_fonte(DepSource::Git {
            repo: "pleme-io/caixa-teia".into(), // missing `:` separator
            tag: None,
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteRepoShape { .. }),
            "got {err:?}"
        );
    }

    #[test]
    fn fonte_repo_shape_diagnostic_carries_offending_repo_verbatim() {
        // The diagnostic-shape pin: the error names the offending
        // `:repo` value verbatim plus a non-empty parser-shaped `reason`
        // so the author can grep their caixa.lisp without re-running
        // the build. Mirrors the diagnostic-shape sweep on every prior
        // value-shape gate (3f9d7a0, 6cbb900, c7d05ec, e70d213, be07fd5).
        let d = dep_with_fonte(DepSource::Git {
            repo: "pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteRepoShape { nome, repo, reason } = err else {
            panic!("expected FonteRepoShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(repo, "pleme-io/caixa-teia");
        assert!(
            !reason.is_empty(),
            "FonteRepoShape `reason` must carry the predicate's wording verbatim"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_no_pin() {
        // The fail-before-pass-after pin for the canonical
        // `(:tipo git :repo "github:pleme-io/x")` shape with no
        // :tag/:rev/:branch — until this gate landed the resolver's
        // ResolveError::MissingPin surfaced at fetch time, far from the
        // source caixa.lisp. The new gate moves the check to validate
        // time and names the offending dep.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FontePinMissing { ref nome } if nome == "caixa-teia"),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_ambiguous_tag_and_branch() {
        // The canonical "pin drift" footgun: an author writes
        // `:tag "v1"` and later adds `:branch "main"` without removing
        // the :tag, and the resolver silently picks :tag (precedence
        // :rev > :tag > :branch). The :branch was dropped with no
        // diagnostic. The gate now rejects multi-pin shapes so the
        // author makes the precedence explicit at the source.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: Some("main".into()),
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinAmbiguous { nome, pins } = err else {
            panic!("expected FontePinAmbiguous");
        };
        assert_eq!(nome, "caixa-teia");
        assert!(pins.contains(":tag"));
        assert!(pins.contains(":branch"));
        assert!(!pins.contains(":rev"));
    }

    #[test]
    fn validate_rejects_git_fonte_with_ambiguous_tag_and_rev() {
        // Sibling arm of the pin-drift footgun: :tag + :rev set
        // simultaneously. Pinned separately so a future relaxation
        // that only catches the (:tag, :branch) pair surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: Some("c0ffee".into()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinAmbiguous { nome, pins } = err else {
            panic!("expected FontePinAmbiguous");
        };
        assert_eq!(nome, "caixa-teia");
        assert!(pins.contains(":tag"));
        assert!(pins.contains(":rev"));
    }

    #[test]
    fn validate_rejects_git_fonte_with_all_three_pins() {
        // The maximal ambiguity case — every pin axis set. Pinned so a
        // future relaxation that only catches pairs surfaces here. The
        // diagnostic must enumerate every offending axis so the author
        // sees the full set, not just the first match.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: Some("c0ffee".into()),
            branch: Some("main".into()),
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinAmbiguous { nome, pins } = err else {
            panic!("expected FontePinAmbiguous");
        };
        assert_eq!(nome, "caixa-teia");
        assert!(pins.contains(":tag"));
        assert!(pins.contains(":rev"));
        assert!(pins.contains(":branch"));
    }

    #[test]
    fn validate_rejects_git_fonte_with_empty_tag_pin() {
        // The empty-pin arm: exactly one pin axis is `Some(_)`, but its
        // inner string is empty. Distinct from FontePinMissing (where
        // every axis is None) — pinned separately so a future
        // tightening collapsing them surfaces here as a structural
        // decision.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some(String::new()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinEmpty { nome, pin } = err else {
            panic!("expected FontePinEmpty");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(pin, ":tag");
    }

    #[test]
    fn validate_rejects_git_fonte_with_empty_rev_pin() {
        // Sibling arm — the empty-pin diagnostic names which axis
        // carries the empty value, so the author's grep target is
        // unambiguous.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some(String::new()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinEmpty { nome, pin } = err else {
            panic!("expected FontePinEmpty");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(pin, ":rev");
    }

    #[test]
    fn validate_rejects_path_fonte_with_empty_caminho() {
        // The fail-before-pass-after pin for `(:tipo path :caminho "")`:
        // until this gate landed the resolver's
        // ResolveError::MissingPath surfaced with `path: PathBuf("")` at
        // fetch time — not actionable. The new gate moves the check to
        // validate time and names the offending dep.
        let d = dep_with_fonte(DepSource::Path {
            caminho: String::new(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoEmpty { ref nome } if nome == "caixa-teia"),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_absolute_caminho() {
        // The fail-before-pass-after pin for the absolute-`:caminho`
        // shape: `(:tipo path :caminho "/home/me/work/caixa-teia")`.
        // Until this gate landed an absolute `:caminho` silently
        // passed validate; the lacre pipeline embedded the
        // host-specific filesystem path verbatim in its
        // content-address (`conteudo: format!("path:{caminho}")`,
        // caixa-resolver/src/resolve.rs:189), so the BLAKE3 closure
        // differed per machine — the build succeeded but two CI
        // runners with different `${HOME}` layouts emitted two
        // distinct lacres for the byte-identical caixa, silently
        // breaking the THEORY.md §V.2 render-determinism contract
        // far from the source caixa.lisp. The new gate moves the
        // check to validate time and names the offending dep +
        // caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/home/me/work/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoAbsolute { nome, caminho } = err else {
            panic!("expected FonteCaminhoAbsolute, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "/home/me/work/caixa-teia");
    }

    #[test]
    fn validate_accepts_path_fonte_with_parent_escape_caminho() {
        // The canonical sibling-workspace dep form
        // (`:caminho "../caixa-teia"`) remains accepted. The
        // absolute-path gate above is specifically narrower than the
        // shared [`crate::render::is_sandboxed_relative_path`]
        // predicate (which additionally forbids `..` traversal): a
        // local-path dep's canonical author surface is the in-tree
        // sibling-workspace path, so a full sandboxed-relative-path
        // lift would structurally reject every legitimate path-fonte
        // dep. Pinned so a future tightening to the full predicate
        // surfaces here as a structural decision, not a silent break.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_accepts_path_fonte_with_deeply_nested_relative_caminho() {
        // A multi-segment relative `:caminho`
        // (`"vendor/forks/caixa-teia"`) remains accepted — the
        // absolute-path gate brackets the host-layout-leaking shape
        // at the leading-`/` boundary only; every relative shape past
        // the empty arm continues to pass. Pinned alongside the
        // `..`-traversal positive control so a future tightening
        // surfaces the full set of legitimate relative forms here
        // rather than at a downstream consumer.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "vendor/forks/caixa-teia".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_rejects_path_fonte_with_tilde_prefix_caminho() {
        // The fail-before-pass-after pin for the tilde-expansion
        // `:caminho` shape: `(:tipo path :caminho "~/work/caixa-teia")`.
        // Until this gate landed the b94fd83 absolute arm let `~/foo`
        // through (`Path::is_absolute` returns false on a leading `~`
        // — the tilde is a shell-expansion convention, not a POSIX
        // path component), so the lacre embedded the value verbatim
        // and the resolver folded it through `Path::join` without
        // expansion, looking for a literal `./~/work/caixa-teia`
        // subdirectory and failing at resolve time with a
        // `No such file or directory` error far from the source
        // caixa.lisp. The new gate moves the check to validate time
        // and names the offending dep + caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "~/work/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoTildeExpansion { nome, caminho } = err else {
            panic!("expected FonteCaminhoTildeExpansion, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "~/work/caixa-teia");
    }

    #[test]
    fn validate_rejects_path_fonte_with_bare_tilde_caminho() {
        // The bare `~` form (canonical "I meant `$HOME` and forgot
        // the rest"): both the leading-tilde arm catches it and the
        // canonical-user-tilde shell idiom (`~alice/dev/caixa-teia`)
        // sweeps through the same arm. Pinned both to ensure the
        // gate doesn't narrow to `~/` only.
        for s in ["~", "~alice/dev/caixa-teia", "~/", "~root/work"] {
            let d = dep_with_fonte(DepSource::Path { caminho: s.into() });
            let err = d.validate().unwrap_err();
            assert!(
                matches!(err, DepError::FonteCaminhoTildeExpansion { .. }),
                "{s:?} → {err:?}",
            );
        }
    }

    #[test]
    fn validate_accepts_path_fonte_with_mid_path_tilde_caminho() {
        // The leading-`~` is the canonical shell-expansion footgun —
        // a tilde mid-path (`"../foo~bar/caixa-teia"` — the canonical
        // backup-file-suffix idiom) is a legitimate POSIX path byte
        // with no shell-expansion semantic at the leading position.
        // Pinned so the gate doesn't widen to a full no-tilde-anywhere
        // sweep that would break every legitimate-shape backup-file
        // path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo~bar/caixa-teia".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_empty_fires_before_tilde_expansion() {
        // Cascade pin: the empty arm structurally precedes the
        // tilde arm (the bytes `""` and `"~"` don't overlap), but the
        // pin establishes the precedence at the diagnostic-shape
        // level should a future codec round-trip ever produce a
        // probe-as-both value. Mirrors the peer
        // `fonte_repo_empty_fires_before_pin_missing` cascade
        // discipline.
        let d = dep_with_fonte(DepSource::Path {
            caminho: String::new(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoEmpty { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_tilde_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `validate_rejects_path_fonte_with_absolute_caminho`'s
        // payload assertion): the error's Display surfaces both the
        // offending `:nome` and the offending `:caminho` verbatim
        // so a `feira lint` run can render the diagnostic without
        // re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "~alice/dev/caixa-teia".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("~alice/dev/caixa-teia"),
            "diagnostic must quote the offending caminho: {rendered}",
        );
        assert!(
            rendered.contains('~'),
            "diagnostic must reference the tilde footgun: {rendered}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_dollar_prefix_caminho() {
        // The fail-before-pass-after pin for the shell-variable-
        // expansion `:caminho` shape: `(:tipo path :caminho
        // "$HOME/work/caixa-teia")`. Until this gate landed the
        // b94fd83 absolute arm + the a5c248e tilde arm both let
        // `$HOME/foo` through (`Path::is_absolute` returns false on
        // a leading `$` — the `$` is a shell convention, not a POSIX
        // path component; `starts_with('~')` returns false too), so
        // the lacre embedded the value verbatim and the resolver
        // folded it through `Path::join` without `$`-expansion,
        // looking for a literal `./$HOME/work/caixa-teia`
        // subdirectory and failing at resolve time with a
        // `No such file or directory` error far from the source
        // caixa.lisp. The new gate moves the check to validate time
        // and names the offending dep + caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$HOME/work/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoVarExpansion { nome, caminho } = err else {
            panic!("expected FonteCaminhoVarExpansion, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "$HOME/work/caixa-teia");
    }

    #[test]
    fn validate_rejects_path_fonte_with_dollar_brace_prefix_caminho() {
        // Sweep over every leading-`$` shape: the `${VAR}`-braced
        // form (canonical "paste-from-CI-manifest" footgun every
        // GitHub Actions / GitLab CI / Drone manifest carries on
        // `${WORKSPACE}`), the XDG idiom (`$XDG_CONFIG_HOME/caixa`,
        // canonical "I'm referencing a per-user config dir"),
        // and the bare `$` (canonical "I meant `$HOME` and forgot
        // the rest"). All shapes route through the same gate's
        // byte check. Pinned so the gate doesn't narrow to a
        // single shape (e.g. `$HOME/` only).
        for s in [
            "${HOME}/work/caixa-teia",
            "${WORKSPACE}/caixa-teia",
            "$XDG_CONFIG_HOME/caixa",
            "$",
        ] {
            let d = dep_with_fonte(DepSource::Path { caminho: s.into() });
            let err = d.validate().unwrap_err();
            assert!(
                matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
                "{s:?} → {err:?}",
            );
        }
    }

    #[test]
    fn validate_rejects_path_fonte_with_mid_path_dollar_caminho() {
        // The `$` byte is the canonical shell-variable-expansion /
        // command-substitution / arithmetic-expansion sentinel and
        // is rejected at *every* position on the `:caminho` axis: the
        // leading arm surfaces `FonteCaminhoVarExpansion`, the
        // embedded arm surfaces `FonteCaminhoShellVariableExpansion`
        // (6620f39). Pinned so a future arm doesn't narrow the gate
        // back to the leading position and re-open the paste-from-
        // shell-one-liner `"../foo$HOME/bar"` / paste-from-CI-
        // manifest `"../foo${WORKSPACE}/bar"` / paste-from-shell-
        // prompt `"../foo$(whoami)/bar"` cross-idiom-leak surface on
        // the lacre content-address (`path:{caminho}`,
        // caixa-resolver/src/resolve.rs:189).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo$bar/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellVariableExpansion { byte: b'$', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_tilde_fires_before_var_expansion() {
        // Cascade pin: the tilde arm structurally precedes the var
        // arm (the bytes `~` and `$` don't overlap at the leading
        // position), but the pin establishes the precedence at the
        // diagnostic-shape level should a future codec round-trip
        // ever produce a probe-as-both value. Mirrors the peer
        // `fonte_caminho_empty_fires_before_tilde_expansion` cascade
        // discipline on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "~/work/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoTildeExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_tilde_diagnostic_carries_offending_dep_and_caminho`'s
        // payload assertion on the immediate-predecessor arm): the
        // error's Display surfaces both the offending `:nome` and
        // the offending `:caminho` verbatim plus the `$` footgun
        // character itself so a `feira lint` run can render the
        // diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "${WORKSPACE}/caixa-teia".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("${WORKSPACE}/caixa-teia"),
            "diagnostic must quote the offending caminho: {rendered}",
        );
        assert!(
            rendered.contains('$'),
            "diagnostic must reference the dollar footgun: {rendered}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_nul() {
        // The fail-before-pass-after pin for the load-bearing NUL byte:
        // POSIX paths cannot contain `0x00` (every `std::fs` syscall
        // routes the path through `CString::new` which fails with
        // `NulError`); until this gate landed a `:caminho
        // "../caixa\0teia"` silently passed validate, the lacre
        // pipeline embedded the value verbatim, and the failure
        // surfaced at the resolver's `Path::join` → `CString::new`
        // boundary with a non-self-locating `NulError` far from the
        // source caixa.lisp. The new gate moves the check to validate
        // time and names the offending dep + caminho + offending byte
        // verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa\0teia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoControlChar {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoControlChar, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa\0teia");
        assert_eq!(byte, 0x00);
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_newline() {
        // The canonical paste-from-multiline-doc footgun on `:caminho`
        // — author copies `"../caixa-teia\n"` (trailing newline) out
        // of a multi-line code-fence or, worse, a `:caminho
        // "../caixa-teia\nrm -rf /"` value (CRLF-at-subprocess-argument
        // injection sibling on the path axis the `is_git_repo_url`
        // control-char arm already closes on `:repo`). Pinned
        // separately from the NUL arm so a future relaxation that
        // catches one but not the other surfaces here.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia\n".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoControlChar { byte, .. } = err else {
            panic!("expected FonteCaminhoControlChar, got {err:?}");
        };
        assert_eq!(byte, 0x0A);
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_carriage_return() {
        // The CRLF sibling of the LF arm — Windows-line-ending
        // paste-from-multiline-doc on a `\r\n`-terminated buffer
        // leaves a stray `\r` mid-string after the LF strip. Pinned
        // separately from the LF arm so a future relaxation that
        // only catches LF surfaces here.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia\r".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoControlChar { byte, .. } = err else {
            panic!("expected FonteCaminhoControlChar, got {err:?}");
        };
        assert_eq!(byte, 0x0D);
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_tab() {
        // The canonical paste-from-aligned-table footgun — a `\t`
        // mid-`:caminho` is invisible in most editors but rides
        // through the lacre's content-address verbatim, so two
        // paste-from-distinct-tables (one editor strips tabs, one
        // preserves them) yield divergent lacres for the byte-
        // identical-looking caixa. Pinned separately from the
        // whitespace-shaped LF/CR arms so a future relaxation that
        // narrows to line-terminator-only surfaces here.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa\tteia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoControlChar { byte, .. } = err else {
            panic!("expected FonteCaminhoControlChar, got {err:?}");
        };
        assert_eq!(byte, 0x09);
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_del() {
        // The DEL byte (`0x7F`) closes the upper-end paste-from-
        // binary-blob footgun — the gate's contract is `b < 0x20 ||
        // b == 0x7F`, matching the `is_git_repo_url` /
        // `is_git_ref_name` predicates' control-char arms. Pinned
        // separately from the lower-range arms so a future narrowing
        // to `< 0x20` only surfaces here.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa\x7fteia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoControlChar { byte, .. } = err else {
            panic!("expected FonteCaminhoControlChar, got {err:?}");
        };
        assert_eq!(byte, 0x7F);
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_high_bit_utf8() {
        // The control-byte arm targets `0x00..=0x1F` + `0x7F` only —
        // high-bit / non-ASCII UTF-8 bytes are not gated. POSIX paths
        // are opaque byte sequences and UTF-8 multi-byte sequences
        // are a legitimate filename shape (the `café-teia/foo` idiom).
        // Pinned so the gate doesn't widen to a full ASCII-only sweep
        // that would break every legitimate-shape UTF-8 path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../café-teia/foo".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_var_fires_before_control_char() {
        // Cascade pin: the var-expansion arm structurally precedes the
        // control-char arm. A value like `"$\n"` probes positive on
        // both arms (`starts_with('$')` and contains LF), but the
        // narrower leading-byte diagnostic (`FonteCaminhoVarExpansion`)
        // wins so the author sees the more self-locating shell-
        // expansion arm first. Mirrors the
        // `fonte_caminho_tilde_fires_before_var_expansion` cascade
        // discipline on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$HOME\n".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_leading_space_caminho() {
        // The fail-before-pass-after pin for the leading ASCII space
        // `:caminho` shape: `(:tipo path :caminho " ../caixa-teia")`.
        // Until this gate landed the b94fd83 absolute arm + the a5c248e
        // tilde arm + the f4efe9c var arm + the d624c8d control-byte arm
        // all let `" ../caixa-teia"` through: `Path::is_absolute` returns
        // false on a leading space (the leading byte is `0x20`, not `0x2F`),
        // `starts_with('~')` / `starts_with('$')` return false, and `0x20`
        // is not in the `0x00..=0x1F` plus `0x7F` control-byte set (the
        // four ASCII whitespace bytes `0x09` tab, `0x0A` LF, `0x0D` CR
        // are caught, but the most common whitespace `0x20` space is
        // not). The lacre embedded the value verbatim and the resolver
        // folded it through `Path::join` looking for a literal `./ ../
        // caixa-teia` subdirectory and failing at resolve time with a
        // non-self-locating `No such file or directory` error far from
        // the source caixa.lisp. The new gate moves the check to
        // validate time and names the offending dep + caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: " ../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoLeadingWhitespace { nome, caminho } = err else {
            panic!("expected FonteCaminhoLeadingWhitespace, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, " ../caixa-teia");
    }

    #[test]
    fn validate_rejects_path_fonte_with_multiple_leading_spaces_caminho() {
        // The aligned-doc paste footgun sweep: more than one leading
        // space (`"   ../caixa-teia"` — the canonical "I selected the
        // aligned column from a four-`:fonte`-entry `:deps` block"
        // paste) routes through the same gate's `starts_with(' ')`
        // byte check. Pinned so the gate doesn't narrow to a
        // single-space prefix.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "   ../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoLeadingWhitespace { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_mid_path_space_caminho() {
        // The leading-space is the canonical paste-from-aligned-doc
        // footgun — a space mid-path (`"../my dir/caixa-teia"` — the
        // canonical "I have a directory with a space in its name"
        // idiom; ASCII `0x20` is a valid POSIX filename byte) is a
        // legitimate path with no whitespace-leak semantic at the
        // non-leading position. Pinned so the gate doesn't widen to a
        // full no-space-anywhere sweep that would break every
        // legitimate-shape space-in-filename path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../my dir/caixa-teia".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_var_fires_before_leading_whitespace() {
        // Cascade pin: the var-expansion arm structurally precedes the
        // leading-whitespace arm. A value like `"$ "` would probe positive
        // on var (`starts_with('$')`) but the leading-byte arms walk
        // left-to-right so the var arm fires on the leading `$` before
        // the leading-whitespace arm probes. Mirrors the
        // `fonte_caminho_tilde_fires_before_var_expansion` cascade
        // discipline on the immediate-predecessor arms.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$VAR".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_leading_whitespace_fires_before_control_char() {
        // Cascade pin: the leading-whitespace arm structurally precedes
        // the control-char arm. A value like `" ../foo\n"` probes
        // positive on both (starts with space AND contains LF), but
        // the narrower leading-byte diagnostic
        // (`FonteCaminhoLeadingWhitespace`) wins so the author sees the
        // more self-locating paste-from-aligned-doc arm first. Mirrors
        // the `fonte_caminho_var_fires_before_control_char` cascade
        // discipline on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: " ../foo\n".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoLeadingWhitespace { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_leading_whitespace_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_var_diagnostic_carries_offending_dep_and_caminho`'s
        // payload assertion on the immediate-predecessor arm): the
        // error's Display surfaces both the offending `:nome` and the
        // offending `:caminho` verbatim, so a `feira lint` run can
        // render the diagnostic without re-parsing and the author can
        // grep their caixa.lisp for `:caminho "<value>"` and fix it in
        // one edit.
        let d = dep_with_fonte(DepSource::Path {
            caminho: " ../caixa-teia".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains(" ../caixa-teia"),
            "diagnostic must quote the offending caminho: {rendered}",
        );
        assert!(
            rendered.contains("space"),
            "diagnostic must name the space footgun: {rendered}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_control_char() {
        // Cascade pin on the sibling leading-byte arm: a leading `/`
        // value with embedded control byte (`"/etc/passwd\n"`) routes
        // through `FonteCaminhoAbsolute` not `FonteCaminhoControlChar`
        // — the host-layout-leak diagnostic is the load-bearing axis,
        // the control byte is the secondary observation. Same precedence
        // logic on every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd\n".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_leading_hyphen_caminho() {
        // The fail-before-pass-after pin for the leading-`-` CLI-arg-
        // injection `:caminho` shape sweep. Until this gate landed
        // every prior leading-byte arm passed a leading-`-` value
        // through: `Path::is_absolute` returns false on `-` (the
        // leading byte is `0x2D`, not `0x2F`), `starts_with('~')` /
        // `starts_with('$')` / `starts_with(' ')` all return false,
        // and `0x2D` sits outside the control-byte set. The lacre
        // embedded the value verbatim and the resolver folded it
        // through `Path::join` looking for a literal `./-rf` /
        // `./-C` / `./--upload-pack=…` subdirectory; the failure at
        // `Path::join` time is non-self-locating but harmless, while
        // the failure at every downstream `git -C {caminho}` /
        // `terraform -chdir={caminho}` / `find {caminho}` shell-out
        // is arbitrary-CLI-arg-injection because none of those
        // porcelains carry a `--` argument-list terminator between
        // the flag block and the path argument. The new arm moves the
        // rejection to `Caixa::from_lisp` boundary time and names
        // the offending dep + caminho verbatim.
        //
        // Sweep spans the canonical CLI-arg-injection shapes matching
        // the peer sweep on the sibling `is_git_ref_name` /
        // `is_git_repo_url` axes: short-flag `-rf` (the `rm -rf` /
        // `find -rf` reinterpretation vector), `-C` (the `git -C`
        // change-directory-config-injection paste), long-flag
        // `--upload-pack=cat /etc/passwd` (the canonical
        // arbitrary-command-execution vector on every git porcelain
        // entry point), git-config-injection `--config=core.merge=ours`,
        // and the degenerate single-byte `-` value.
        for caminho in [
            "-rf",
            "-C",
            "--upload-pack=cat /etc/passwd",
            "--config=core.merge=ours",
            "-",
        ] {
            let d = dep_with_fonte(DepSource::Path {
                caminho: caminho.into(),
            });
            let err = d.validate().unwrap_err();
            let DepError::FonteCaminhoLeadingHyphen { nome, caminho: got } = err else {
                panic!("expected FonteCaminhoLeadingHyphen for {caminho:?}, got {err:?}");
            };
            assert_eq!(nome, "caixa-teia");
            assert_eq!(got, caminho);
        }
    }

    #[test]
    fn validate_accepts_path_fonte_with_mid_path_hyphen_caminho() {
        // The leading-`-` is the canonical CLI-arg-injection footgun
        // — a `-` anywhere else in the path (`"../caixa-teia"` — the
        // canonical kebab-separator-between-alphanumeric-segments
        // shape every DNS-1123-shaped caixa name carries; `"../-hidden"`
        // — a mid-path segment starting with `-`, still a legitimate
        // POSIX filename byte at that non-leading position because the
        // subprocess reads the whole `{caminho}` value as one positional
        // argument, so only the very first byte of the composite path
        // string is at the CLI-arg-injection boundary) is a legitimate
        // path with no CLI-flag-reinterpretation semantic at the non-
        // leading position of the top-level value. Pinned so the gate
        // doesn't widen to a full no-`-`-anywhere sweep that would
        // break every legitimate-shape kebab-in-filename path (i.e.
        // essentially every sibling-workspace caixa dep).
        for caminho in [
            "../caixa-teia",
            "../caixa-teia/-hidden",
            "./my-lib",
            "../foo-bar/baz",
        ] {
            let d = dep_with_fonte(DepSource::Path {
                caminho: caminho.into(),
            });
            d.validate()
                .unwrap_or_else(|e| panic!("mid-path `-` caminho {caminho:?} must pass: {e:?}"));
        }
    }

    #[test]
    fn fonte_caminho_leading_whitespace_fires_before_leading_hyphen() {
        // Cascade pin: the leading-whitespace arm structurally precedes
        // the leading-hyphen arm. A value like `" -rf"` probes positive
        // on both (leading space AND, one byte in, a `-` — though the
        // leading-hyphen arm probes only the very first byte so it
        // wouldn't fire on this value; the pin instead documents the
        // arm order on the more common "leading space then a hyphen"
        // paste-from-aligned-doc paste-flag-shell-one-liner idiom).
        // The narrower leading-space diagnostic (the paste-from-aligned-
        // doc footgun) wins so the author sees the more self-locating
        // whitespace arm first. Mirrors the
        // `fonte_caminho_var_fires_before_leading_whitespace` cascade
        // discipline on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: " -rf".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoLeadingWhitespace { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_leading_hyphen_fires_before_control_char() {
        // Cascade pin: the leading-hyphen arm structurally precedes
        // the control-char arm. A value like `"-rf\n"` probes positive
        // on both (starts with `-` AND contains LF), but the narrower
        // leading-byte diagnostic (`FonteCaminhoLeadingHyphen`) wins so
        // the author sees the more self-locating CLI-arg-injection arm
        // first. Mirrors the
        // `fonte_caminho_leading_whitespace_fires_before_control_char`
        // cascade discipline on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "-rf\n".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoLeadingHyphen { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_leading_hyphen_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_leading_whitespace_diagnostic_carries_offending_dep_and_caminho`'s
        // payload assertion on the immediate-predecessor arm): the
        // error's Display surfaces both the offending `:nome` and the
        // offending `:caminho` verbatim plus the CLI-argument-injection
        // vocabulary, so a `feira lint` run can render the diagnostic
        // without re-parsing and the author can grep their caixa.lisp
        // for `:caminho "<value>"` and fix it in one edit.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "--upload-pack=cat /etc/passwd".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("--upload-pack=cat /etc/passwd"),
            "diagnostic must quote the offending caminho: {rendered}",
        );
        assert!(
            rendered.contains("CLI-argument-injection"),
            "diagnostic must name the CLI-argument-injection vector: {rendered}",
        );
        assert!(
            rendered.contains("`-`"),
            "diagnostic must name the offending byte: {rendered}",
        );
    }

    #[test]
    fn fonte_caminho_control_diagnostic_carries_offending_dep_caminho_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_var_diagnostic_carries_offending_dep_and_caminho`'s
        // payload assertion on the immediate-predecessor arm): the
        // error's Display surfaces the offending `:nome`, the
        // offending `:caminho` verbatim, and the offending byte in
        // hex form (`0x09` for tab) so a `feira lint` run can render
        // the diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa\tteia".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa\tteia"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x09"),
            "diagnostic must name the offending byte in hex: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_backslash() {
        // The fail-before-pass-after pin for the canonical Windows-
        // path-separator paste footgun: an author who pastes a path
        // from Windows-Explorer's `Copy as path`, PowerShell's
        // `Get-Location`, or any CMD/Cygwin/MSYS shell prompt
        // produces `..\caixa-teia`-shape values that silently passed
        // every prior arm (`Path::is_absolute("..\\caixa-teia")` is
        // false; `\` is neither a leading-byte sentinel nor a
        // control byte). On POSIX resolvers the value rides through
        // `Path::join` as a literal directory name and fails at
        // resolve time with `No such file or directory`; on Windows
        // resolvers the value resolves to the parent's sibling — two
        // distinct directories for the byte-identical caixa.lisp.
        // The new arm moves the rejection to validate time and names
        // the offending dep + caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoBackslash { nome, caminho } = err else {
            panic!("expected FonteCaminhoBackslash, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "..\\caixa-teia");
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_windows_drive_letter() {
        // The Windows drive-letter paste shape (`C:\work\caixa-teia`
        // out of Explorer / `cd`-and-`pwd`-on-Windows). On POSIX
        // hosts `Path::is_absolute("C:\\work\\caixa-teia")` returns
        // false (POSIX absolute paths start with `/`, drive letters
        // are not a POSIX concept), so the b94fd83 absolute arm
        // doesn't fire; the value contains `\` bytes that this arm
        // now catches with the more self-locating Windows-path-
        // separator diagnostic. Pinned separately from the bare
        // `..\caixa-teia` shape so a future arm that targets only
        // leading-`..\` doesn't regress the drive-letter coverage.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "C:\\work\\caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_trailing_backslash() {
        // The trailing-`\` shape (`..\caixa-teia\` — the canonical
        // PowerShell tab-completion-on-a-directory append). Pinned
        // separately from the embedded-`\` shape so the gate's
        // contract is "any `\` anywhere", not "any `\` not at end".
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia\\".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_legitimate_forward_slash() {
        // The positive-control pin: the gate targets `\` only,
        // never `/`. The canonical relative POSIX path
        // (`../caixa-teia/foo/bar`) must continue to validate cleanly
        // so legitimate nested-directory deps aren't broken. Pinned
        // so the gate doesn't accidentally widen to a "no path
        // separators at all" sweep.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/foo/bar".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_backslash() {
        // Cascade pin: the control-char arm structurally precedes the
        // backslash arm. A value like `"..\caixa\0teia"` probes
        // positive on both (`\` byte + NUL byte), but the control-
        // char diagnostic wins so the author sees the more self-
        // locating POSIX-syscall-rejected-byte diagnostic first
        // (NUL outright breaks `CString::new` at every `std::fs`
        // syscall boundary; the `\` divergence is the cross-OS-
        // separator axis). Mirrors the
        // `fonte_caminho_var_fires_before_control_char` cascade
        // discipline on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa\0teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_backslash() {
        // Cascade pin on the load-bearing leading-byte arm: a leading
        // `/` value with embedded `\` (`/etc/passwd\foo`) routes
        // through `FonteCaminhoAbsolute` not `FonteCaminhoBackslash`
        // — the host-layout-leak diagnostic is the load-bearing
        // axis, the `\` byte is the secondary observation. Same
        // precedence logic as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd\\foo".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_fires_before_backslash() {
        // Cascade pin on the var-expansion arm: a leading-`$` value
        // with embedded `\` (`$WORKSPACE\caixa-teia` — the canonical
        // PowerShell-env-var paste-from-CI-manifest footgun) routes
        // through `FonteCaminhoVarExpansion` not `FonteCaminhoBackslash`.
        // The shell-expansion diagnostic is the more self-locating
        // axis since both the leading `$` and the embedded `\`
        // are Windows-shell artifacts but the `$` is the root-cause
        // surface (an author who removes the `$` is likely to leave
        // the `\` too).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$WORKSPACE\\caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with the prior
        // `fonte_caminho_*_diagnostic_carries_*` payload assertions
        // on every preceding arm): the error's Display surfaces the
        // offending `:nome` and the offending `:caminho` verbatim
        // so a `feira lint` run can render the diagnostic without
        // re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("..\\caixa-teia"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains('\\'),
            "diagnostic must reference the backslash footgun: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_trailing_slash() {
        // The fail-before-pass-after pin for the canonical trailing-`/`
        // paste footgun: an author who shell-tab-completes a sibling
        // directory (every interactive shell — bash/zsh/fish/nushell —
        // appends `/` on tab-completing a directory) produces
        // `"../caixa-teia/"`-shape values that silently passed every
        // prior arm (the leading byte is `.`, no control bytes, no
        // backslash). `Path::join` resolves both shapes to the same
        // directory at the resolver, but the lacre embeds the value
        // verbatim and the BLAKE3 closures diverge across two
        // workstations whose authors differ only in tab-completion
        // habits.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoTrailingSlash { nome, caminho } = err else {
            panic!("expected FonteCaminhoTrailingSlash, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia/");
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_bare_dot_slash() {
        // The `"./"` shape (the canonical "I meant the caixa.lisp's own
        // directory and tab-completed it" footgun). Pinned separately
        // from the canonical `"../caixa-teia/"` shape so the gate's
        // contract is "any trailing `/`", not "trailing `/` after a leaf
        // name".
        let d = dep_with_fonte(DepSource::Path {
            caminho: "./".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoTrailingSlash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_consecutive_trailing_slashes() {
        // The `"foo//"` shape (the canonical "I pasted from a CI manifest
        // that double-templated `${VAR}/` over an already-`/`-suffixed
        // path" footgun). The gate fires on the last byte being `/`
        // regardless of how many `/` precede it; the arm contract is
        // "the value ends with `/`", structurally.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia//".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoTrailingSlash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_dotdot_trailing_slash() {
        // The `"../"` shape (the canonical "I want the parent" tab-
        // completion footgun on a bare `..` path). Pinned separately so
        // the gate doesn't accidentally narrow to "trailing `/` only on
        // multi-segment paths".
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoTrailingSlash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_internal_slashes() {
        // The positive-control pin: the gate targets the trailing byte
        // only, never internal `/` separators. The canonical nested
        // relative POSIX path (`"../caixa-teia/foo/bar"`) must continue
        // to validate cleanly so legitimate deeply-nested deps aren't
        // broken. Pinned so the gate doesn't accidentally widen to a
        // "no `/` separators anywhere" sweep that would defeat the
        // entire path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/foo/bar".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_bare_dot() {
        // The positive-control pin on the degenerate single-`.` shape
        // (the canonical "the caixa.lisp's own directory" idiom). The
        // gate fires on the trailing byte being `/`, not on the path
        // being short, so `"."` (one byte, not `/`) must continue to
        // validate cleanly.
        let d = dep_with_fonte(DepSource::Path {
            caminho: ".".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_trailing_slash() {
        // Cascade pin: the control-char arm structurally precedes the
        // trailing-slash arm. A value like `"../foo\n/"` ends in `/`
        // but the embedded LF (`0x0A`) is the load-bearing diagnostic
        // (control bytes are the paste-from-multiline-doc footgun the
        // d624c8d arm already closes). Mirrors the
        // `fonte_caminho_control_char_fires_before_backslash` cascade
        // discipline on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_trailing_slash() {
        // Cascade pin on the backslash arm: a value like `"..\foo/"`
        // ends in `/` but the embedded `\` is the load-bearing
        // diagnostic (the cross-host-OS-separator divergence vector
        // the 3a4e1d7 arm closes). Same precedence logic as the prior
        // narrower-diagnostic-first cascade.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_trailing_slash() {
        // Cascade pin on the load-bearing leading-byte arm: a leading
        // `/` value with a trailing `/` (`"/etc/passwd/"`) routes
        // through `FonteCaminhoAbsolute` not `FonteCaminhoTrailingSlash`
        // — the host-layout-leak diagnostic is the load-bearing axis,
        // the trailing `/` is the secondary observation. Same
        // precedence logic as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_trailing_slash_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with the prior
        // `fonte_caminho_*_diagnostic_carries_*` payload assertions on
        // every preceding arm): the error's Display surfaces the
        // offending `:nome` and the offending `:caminho` verbatim so a
        // `feira lint` run can render the diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia/"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("trailing"),
            "diagnostic must reference the trailing-slash footgun: {rendered:?}",
        );
    }

    // -- :caminho shell-redirection metacharacter arm -----------------------

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_gt_redirection() {
        // The fail-before-pass-after pin for the canonical output-redirection
        // paste footgun: an author copies a shell pipeline tail
        // (`"../caixa-teia>build.log"` — the canonical "I selected the whole
        // line including the `> build.log` redirect" idiom) and silently
        // passed every prior arm (`Path::is_absolute` false on `..`, no
        // control bytes, no backslash, doesn't end in `/`). The lacre
        // embedded the value verbatim, the resolver folded it through
        // `Path::join` looking for a literal `./../caixa-teia>build.log`
        // subdirectory, and the failure surfaced at resolve time with a
        // non-self-locating `No such file or directory` error. The new arm
        // moves the rejection to validate time and names the offending dep
        // + caminho + byte verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>build.log".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellRedirection {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellRedirection, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia>build.log");
        assert_eq!(byte, b'>');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_lt_redirection() {
        // The symmetric input-redirection paste shape
        // (`"../caixa-teia<input.lisp"` — the canonical "I copied a
        // `command < input.lisp` line from a tatara-lisp REPL log"
        // idiom). Pinned separately from the `>` shape so the gate's
        // contract is "any `<` or `>` anywhere", not single-byte coverage.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia<input.lisp".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellRedirection { byte, .. } = err else {
            panic!("expected FonteCaminhoShellRedirection, got {err:?}");
        };
        assert_eq!(byte, b'<');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_gt_redirection() {
        // Leading-position `>` shape (`">../caixa-teia"` — the degenerate
        // "I forgot the source side of the redirect" idiom). Pinned
        // separately from the embedded-byte shapes so the gate covers
        // every position, not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: ">../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_double_gt_append() {
        // The bash append-redirection shape (`"../caixa-teia>>build.log"` —
        // the canonical "I copied a `>>` append redirect" idiom). The arm
        // fires on the first `>` encountered; pinned so a future arm that
        // tries to distinguish `>` from `>>` doesn't break the broader
        // contract.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>>build.log".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_redirection() {
        // The positive-control pin: the gate targets only `<` / `>`,
        // never adjacent printable ASCII or POSIX-valid bytes. The
        // canonical relative POSIX path (`"../caixa-teia"`) and a
        // nested deeply-pathed variant (`"../caixa-teia/foo/bar"`) must
        // continue to validate cleanly so the gate doesn't widen to a
        // "no printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/foo/bar".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_redirection() {
        // Cascade pin on the immediate-predecessor arm: a value carrying
        // both `\` and `<` / `>` (`"..\caixa-teia>build.log"` — the
        // canonical "I pasted a Windows-shell command with output
        // redirect" footgun) routes through `FonteCaminhoBackslash` not
        // `FonteCaminhoShellRedirection`. The cross-host-OS-separator
        // divergence is the load-bearing axis (an author who removes
        // the `\` is the root-cause edit; the `>` falls away in the
        // same edit since it's downstream of the Windows-shell
        // convention).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia>build.log".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_redirection() {
        // Cascade pin on the embedded-control-byte arm: a value carrying
        // both a control byte and `<` / `>` (`"../foo\n>bar"` — the
        // canonical paste-from-multiline-doc footgun where a newline
        // landed mid-caminho) routes through `FonteCaminhoControlChar`
        // not `FonteCaminhoShellRedirection`. The POSIX-syscall-
        // rejected-byte / NUL-`CString::new`-fail diagnostic is the
        // load-bearing axis on every value that probes positive for
        // both — mirrors the cascade discipline on every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n>bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_redirection() {
        // Cascade pin on the load-bearing leading-byte arm: a leading
        // `/` value with embedded `<` / `>` (`"/etc/passwd>out"`)
        // routes through `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellRedirection` — the host-layout-leak
        // diagnostic is the load-bearing axis, the `>` byte is the
        // secondary observation. Same precedence logic as every prior
        // leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd>out".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value carrying
        // both `<` / `>` and a trailing `/` (`"../foo></"` — the
        // canonical "I tab-completed a path that already had a
        // redirect" footgun) routes through `FonteCaminhoShellRedirection`
        // not `FonteCaminhoTrailingSlash`. The embedded shell-metachar is
        // the more semantic-locating axis (an author who removes the
        // `<` / `>` typically also drops the trailing separator since
        // both are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo></".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_diagnostic_carries_offending_dep_caminho_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_control_diagnostic_carries_offending_dep_caminho_byte`'s
        // payload assertion on the closest peer arm that also carries a
        // `byte` field): the error's Display surfaces the offending
        // `:nome`, the offending `:caminho` verbatim, and the offending
        // byte in hex (`0x3c` for `<`, `0x3e` for `>`) so a `feira lint`
        // run can render the diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>build.log".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia>build.log"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x3e"),
            "diagnostic must name the offending byte in hex: {rendered:?}",
        );
        assert!(
            rendered.contains("redirection"),
            "diagnostic must name the shell-redirection footgun: {rendered:?}",
        );
    }

    // -- :caminho shell-pipe metacharacter arm ----------------------------

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_pipe() {
        // The fail-before-pass-after pin for the canonical shell-pipe
        // paste footgun: an author copies a shell-history line
        // (`"../caixa-teia | grep foo"` — the canonical "I selected
        // the whole `ls dir | grep` line out of zsh history") and
        // silently passed every prior arm (`Path::is_absolute` false
        // on `..`, no control bytes, no backslash, no `<` / `>`,
        // doesn't end in `/`). The lacre embedded the value verbatim,
        // the resolver folded it through `Path::join` looking for a
        // literal `./../caixa-teia | grep foo` subdirectory, and the
        // failure surfaced at resolve time with a non-self-locating
        // `No such file or directory` error. The new arm moves the
        // rejection to validate time and names the offending dep +
        // caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | grep foo".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellPipe { nome, caminho } = err else {
            panic!("expected FonteCaminhoShellPipe, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia | grep foo");
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_pipe() {
        // Leading-position `|` shape (`"|../caixa-teia"` — the
        // degenerate "I forgot the source side of the pipe" idiom).
        // Pinned separately from the embedded-byte shape so the gate
        // covers every position, not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "|../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_double_pipe_or() {
        // The bash short-circuit-OR shape (`"../caixa-teia||fallback"`
        // — the canonical "I copied a `cmd-a || cmd-b` fallback line"
        // idiom). The arm fires on the first `|` encountered; pinned
        // so a future arm that tries to distinguish `|` from `||`
        // doesn't break the broader contract.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia||fallback".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_pipe() {
        // The positive-control pin: the gate targets only `|`, never
        // adjacent printable ASCII or POSIX-valid bytes. The canonical
        // relative POSIX path (`"../caixa-teia"`) and a nested deeply-
        // pathed variant with adjacent printable punctuation
        // (`"../caixa-teia/sub-dir.v2"`) must continue to validate
        // cleanly so the gate doesn't widen to a "no printable
        // punctuation anywhere" sweep that would defeat the entire
        // path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_pipe() {
        // Cascade pin on the immediate-predecessor arm: a value carrying
        // both `<` / `>` and `|` (`"../caixa-teia<input|tee"` — the
        // canonical "I pasted a `cmd < input | tee` pipeline tail"
        // footgun) routes through `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellPipe`. The input/output redirection
        // metachar carries the more self-locating `byte: u8` payload
        // (it names which of `<` or `>` triggered), so the prior arm
        // wins on every probe-as-both value — same cascade discipline
        // every prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia<input|tee".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'<', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_pipe() {
        // Cascade pin on the upstream backslash arm: a value carrying
        // both `\` and `|` (`"..\caixa-teia|tee"` — the canonical
        // "I pasted a Windows-shell command with pipe to tee"
        // footgun) routes through `FonteCaminhoBackslash` not
        // `FonteCaminhoShellPipe`. The cross-host-OS-separator
        // divergence is the load-bearing axis on every probe-as-both
        // value (an author who removes the `\` is the root-cause edit;
        // the `|` falls away in the same edit since it's downstream of
        // the Windows-shell convention).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia|tee".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_pipe() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `|` (`"../foo\n|bar"` —
        // the canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho) routes through
        // `FonteCaminhoControlChar` not `FonteCaminhoShellPipe`. The
        // POSIX-syscall-rejected-byte / NUL-`CString::new`-fail
        // diagnostic is the load-bearing axis on every value that
        // probes positive for both — mirrors the cascade discipline
        // on every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n|bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_pipe() {
        // Cascade pin on the load-bearing leading-byte arm: a leading
        // `/` value with embedded `|` (`"/etc/passwd|tee"`) routes
        // through `FonteCaminhoAbsolute` not `FonteCaminhoShellPipe`
        // — the host-layout-leak diagnostic is the load-bearing axis,
        // the `|` byte is the secondary observation. Same precedence
        // logic as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd|tee".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value carrying
        // both `|` and a trailing `/` (`"../foo|tee/"` — the canonical
        // "I tab-completed a path that already had a pipeline tail"
        // footgun) routes through `FonteCaminhoShellPipe` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-metachar is
        // the more semantic-locating axis (an author who removes the
        // `|` typically also drops the trailing separator since both
        // are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo|tee/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_backslash_diagnostic_carries_offending_dep_and_caminho`
        // on the closest single-byte peer arm): the error's Display
        // surfaces the offending `:nome` and the offending `:caminho`
        // verbatim, and names the shell-pipe footgun explicitly so a
        // `feira lint` run can render the diagnostic without
        // re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | grep foo".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia | grep foo"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains('|'),
            "diagnostic must reference the pipe footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("pipe"),
            "diagnostic must name the shell-pipe footgun: {rendered:?}",
        );
    }

    // -- :caminho shell-command-separator metacharacter arm ---------------

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_semicolon() {
        // The fail-before-pass-after pin for the canonical shell-command-
        // separator paste footgun: an author copies a shell one-liner
        // (`"../caixa-teia; rm -rf build"` — the canonical "I selected the
        // whole `cd path; do-thing` chain out of a shell-history block")
        // and silently passed every prior arm (`Path::is_absolute` false
        // on `..`, no control bytes, no backslash, no `<` / `>`, no `|`,
        // doesn't end in `/`). The lacre embedded the value verbatim, the
        // resolver folded it through `Path::join` looking for a literal
        // `./../caixa-teia; rm -rf build` subdirectory, and the failure
        // surfaced at resolve time with a non-self-locating `No such file
        // or directory` error. The new arm moves the rejection to validate
        // time and names the offending dep + caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; rm -rf build".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellSemicolon { nome, caminho } = err else {
            panic!("expected FonteCaminhoShellSemicolon, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia; rm -rf build");
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_semicolon() {
        // Leading-position `;` shape (`";../caixa-teia"` — the degenerate
        // "I forgot the prior command side of the separator" idiom).
        // Pinned separately from the embedded-byte shape so the gate
        // covers every position, not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: ";../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_double_semicolon() {
        // The POSIX `case` arm `;;` terminator shape
        // (`"../caixa-teia;;next"` — the canonical "I copied a `case`
        // arm tail" idiom). The arm fires on the first `;` encountered;
        // pinned so a future arm that tries to distinguish `;` from `;;`
        // doesn't break the broader contract.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia;;next".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_semicolon() {
        // The positive-control pin: the gate targets only `;`, never
        // adjacent printable ASCII or POSIX-valid bytes. The canonical
        // relative POSIX path (`"../caixa-teia"`) and a nested deeply-
        // pathed variant with adjacent printable punctuation
        // (`"../caixa-teia/sub-dir.v2"`) must continue to validate
        // cleanly so the gate doesn't widen to a "no printable
        // punctuation anywhere" sweep that would defeat the entire
        // path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_semicolon() {
        // Cascade pin on the immediate-predecessor arm: a value carrying
        // both `|` and `;` (`"../caixa-teia | tee; rm"` — the canonical
        // "I pasted a `cmd | tee; cleanup` chain" footgun) routes through
        // `FonteCaminhoShellPipe` not `FonteCaminhoShellSemicolon`. The
        // pipeline-tail paste is the load-bearing root-cause edit on
        // every probe-as-both value (an author who removes the `|`
        // typically also drops the trailing `; cleanup` since both are
        // the same paste-from-shell-history artifact) — same cascade
        // discipline every prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | tee; rm".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_semicolon() {
        // Cascade pin on the upstream shell-redirection arm: a value
        // carrying both `<` / `>` and `;` (`"../caixa-teia>log; rm"` —
        // the canonical "I pasted a `cmd > log; cleanup` chain"
        // footgun) routes through `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellSemicolon`. The input/output redirection
        // metachar carries the more self-locating `byte: u8` payload
        // (it names which of `<` or `>` triggered), so the prior arm
        // wins on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log; rm".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_semicolon() {
        // Cascade pin on the upstream backslash arm: a value carrying
        // both `\` and `;` (`"..\caixa-teia;rm"` — the canonical "I
        // pasted a Windows-shell `cd ..\path; cleanup` chain") routes
        // through `FonteCaminhoBackslash` not `FonteCaminhoShellSemicolon`.
        // The cross-host-OS-separator divergence is the load-bearing axis
        // on every probe-as-both value (an author who removes the `\` is
        // the root-cause edit; the `;` falls away in the same edit since
        // it's downstream of the Windows-shell convention).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia;rm".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_semicolon() {
        // Cascade pin on the embedded-control-byte arm: a value carrying
        // both a control byte and `;` (`"../foo\n;bar"` — the canonical
        // paste-from-multiline-doc footgun where a newline landed mid-
        // caminho) routes through `FonteCaminhoControlChar` not
        // `FonteCaminhoShellSemicolon`. The POSIX-syscall-rejected-byte
        // / NUL-`CString::new`-fail diagnostic is the load-bearing axis
        // on every value that probes positive for both — mirrors the
        // cascade discipline on every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n;bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_semicolon() {
        // Cascade pin on the load-bearing leading-byte arm: a leading
        // `/` value with embedded `;` (`"/etc/passwd;rm"`) routes
        // through `FonteCaminhoAbsolute` not `FonteCaminhoShellSemicolon`
        // — the host-layout-leak diagnostic is the load-bearing axis,
        // the `;` byte is the secondary observation. Same precedence
        // logic as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd;rm".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value carrying
        // both `;` and a trailing `/` (`"../foo;rm/"` — the canonical
        // "I tab-completed a path that already had a `; cleanup` tail"
        // footgun) routes through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-metachar is
        // the more semantic-locating axis (an author who removes the
        // `;` typically also drops the trailing separator since both
        // are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo;rm/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_pipe_diagnostic_carries_offending_dep_and_caminho`
        // on the closest single-byte peer arm): the error's Display
        // surfaces the offending `:nome` and the offending `:caminho`
        // verbatim, and names the shell-command-separator footgun
        // explicitly so a `feira lint` run can render the diagnostic
        // without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; rm -rf build".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia; rm -rf build"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains(';'),
            "diagnostic must reference the semicolon footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("command-separator"),
            "diagnostic must name the shell-command-separator footgun: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_ampersand() {
        // The fail-before-pass-after pin for the canonical shell-
        // background-task paste footgun: an author copies a shell one-
        // liner (`"../caixa-teia & sleep 1"` — the canonical "I selected
        // the whole `cd path & sleep 1` background-launch out of a
        // shell-history block") and silently passed every prior arm
        // (`Path::is_absolute` false on `..`, no control bytes, no
        // backslash, no `<` / `>`, no `|`, no `;`, doesn't end in `/`).
        // The lacre embedded the value verbatim, the resolver folded it
        // through `Path::join` looking for a literal `./../caixa-teia &
        // sleep 1` subdirectory, and the failure surfaced at resolve
        // time with a non-self-locating `No such file or directory`
        // error. The new arm moves the rejection to validate time and
        // names the offending dep + caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & sleep 1".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellBackground { nome, caminho } = err else {
            panic!("expected FonteCaminhoShellBackground, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia & sleep 1");
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_ampersand() {
        // Leading-position `&` shape (`"&../caixa-teia"` — the
        // degenerate "I forgot the prior command side of the
        // background terminator" idiom). Pinned separately from the
        // embedded-byte shape so the gate covers every position, not
        // only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "&../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_double_ampersand() {
        // The logical-AND `&&` shape (`"../caixa-teia && make"` — the
        // canonical "I copied a `cd path && make` build chain" idiom
        // every Makefile / shell-script wraps). The arm fires on the
        // first `&` encountered; pinned so a future arm that tries to
        // distinguish `&` from `&&` doesn't break the broader contract.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia && make".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_ampersand() {
        // The positive-control pin: the gate targets only `&`, never
        // adjacent printable ASCII or POSIX-valid bytes. The canonical
        // relative POSIX path (`"../caixa-teia"`) and a nested deeply-
        // pathed variant with adjacent printable punctuation
        // (`"../caixa-teia/sub-dir.v2"`) must continue to validate
        // cleanly so the gate doesn't widen to a "no printable
        // punctuation anywhere" sweep that would defeat the entire
        // path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_background() {
        // Cascade pin on the immediate-predecessor arm: a value carrying
        // both `;` and `&` (`"../caixa-teia; rm & sleep"` — the
        // canonical "I pasted a `cmd; cleanup & sleep` chain" footgun)
        // routes through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellBackground`. The sequential-command-
        // separator paste is the more common shell-history paste idiom
        // on every probe-as-both value (an author who removes the `;`
        // typically also drops the trailing `& sleep` since both are
        // paste-from-shell-history artifacts) — same cascade discipline
        // every prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; rm & sleep".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_background() {
        // Cascade pin on the upstream shell-pipe arm: a value carrying
        // both `|` and `&` (`"../caixa-teia | tee & sleep"` — the
        // canonical "I pasted a `cmd | tee & sleep` background-pipeline
        // chain" footgun) routes through `FonteCaminhoShellPipe` not
        // `FonteCaminhoShellBackground`. The pipeline-tail paste is the
        // load-bearing root-cause edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | tee & sleep".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_background() {
        // Cascade pin on the upstream shell-redirection arm: a value
        // carrying both `>` and `&` (`"../caixa-teia>log & sleep"` —
        // the canonical "I pasted a `cmd > log & sleep` background-
        // redirect chain" footgun) routes through
        // `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellBackground`. The input/output redirection
        // metachar carries the more self-locating `byte: u8` payload
        // (it names which of `<` or `>` triggered), so the prior arm
        // wins on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log & sleep".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_background() {
        // Cascade pin on the upstream backslash arm: a value carrying
        // both `\` and `&` (`"..\caixa-teia & sleep"` — the canonical
        // "I pasted a Windows-shell `cd ..\path & sleep` background-
        // launch chain") routes through `FonteCaminhoBackslash` not
        // `FonteCaminhoShellBackground`. The cross-host-OS-separator
        // divergence is the load-bearing axis on every probe-as-both
        // value (an author who removes the `\` is the root-cause edit;
        // the `&` falls away in the same edit since it's downstream of
        // the Windows-shell convention).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia & sleep".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_background() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `&` (`"../foo\n&sleep"` —
        // the canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho) routes through
        // `FonteCaminhoControlChar` not `FonteCaminhoShellBackground`.
        // The POSIX-syscall-rejected-byte / NUL-`CString::new`-fail
        // diagnostic is the load-bearing axis on every value that
        // probes positive for both — mirrors the cascade discipline on
        // every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n&sleep".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_background() {
        // Cascade pin on the load-bearing leading-byte arm: a leading
        // `/` value with embedded `&` (`"/etc/passwd & sleep"`) routes
        // through `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellBackground` — the host-layout-leak
        // diagnostic is the load-bearing axis, the `&` byte is the
        // secondary observation. Same precedence logic as every prior
        // leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd & sleep".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value carrying
        // both `&` and a trailing `/` (`"../foo&sleep/"` — the
        // canonical "I tab-completed a path that already had a `&
        // sleep` background-launch tail" footgun) routes through
        // `FonteCaminhoShellBackground` not `FonteCaminhoTrailingSlash`.
        // The embedded shell-metachar is the more semantic-locating
        // axis (an author who removes the `&` typically also drops
        // the trailing separator since both are paste-from-shell
        // artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo&sleep/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_semicolon_diagnostic_carries_offending_dep_and_caminho`
        // on the closest single-byte peer arm): the error's Display
        // surfaces the offending `:nome` and the offending `:caminho`
        // verbatim, and names the shell-background / logical-AND
        // footgun explicitly so a `feira lint` run can render the
        // diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & sleep 1".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia & sleep 1"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains('&'),
            "diagnostic must reference the ampersand footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("background") || rendered.contains("list-AND"),
            "diagnostic must name the shell-background / logical-AND footgun: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_backtick() {
        // The fail-before-pass-after pin for the canonical shell-
        // command-substitution paste footgun: an author copies a
        // POSIX legacy backticked one-liner (`"../caixa-teia/`whoami`"`
        // — the canonical "I pasted a path that included a `pwd`
        // / `whoami` / `date` legacy command-substitution expansion
        // out of a shell-history block") and silently passed every
        // prior arm (`Path::is_absolute` false on `..`, no control
        // bytes, no `\`, no `<` / `>`, no `|`, no `;`, no `&`, doesn't
        // end in `/`). The lacre embedded the value verbatim, the
        // resolver folded it through `Path::join` looking for a
        // literal `./../caixa-teia/`whoami`` subdirectory, and the
        // failure surfaced at resolve time with a non-self-locating
        // `No such file or directory` error. The new arm moves the
        // rejection to validate time and names the offending dep +
        // caminho verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/`whoami`".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellCommandSubstitution { nome, caminho } = err else {
            panic!("expected FonteCaminhoShellCommandSubstitution, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia/`whoami`");
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_backtick() {
        // Leading-position backtick shape (``"`pwd`/caixa-teia"`` —
        // the canonical `<backtick>pwd<backtick>/path` working-
        // directory expansion shape every shell-side path-composition
        // idiom carries). Pinned separately from the embedded-byte
        // shape so the gate covers every position, not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "`pwd`/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_trailing_backtick() {
        // Trailing-position backtick shape (`"../caixa-teia`"` — the
        // degenerate "I selected an unbalanced backtick out of a
        // shell-history block" idiom that probes for the cascade's
        // last-byte handling). The trailing-`/` arm fires only on
        // last-byte `/`; an unbalanced trailing backtick must route
        // through this arm regardless of position.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_balanced_backtick_pair() {
        // The canonical balanced-pair shape (``"../<backtick>cat
        // /etc/passwd<backtick>"`` — the canonical CWE-78 shell-
        // command-injection paste idiom every shell-side hardening
        // guide enumerates first). The arm fires on the first
        // backtick encountered; pinned so a future arm that tries to
        // distinguish the opening from the closing byte doesn't break
        // the broader contract.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`cat /etc/passwd`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_backtick() {
        // The positive-control pin: the gate targets only the
        // backtick byte, never adjacent printable ASCII or POSIX-
        // valid bytes. The canonical relative POSIX path
        // (`"../caixa-teia"`) and a nested deeply-pathed variant with
        // adjacent printable punctuation
        // (`"../caixa-teia/sub-dir.v2"`) must continue to validate
        // cleanly so the gate doesn't widen to a "no printable
        // punctuation anywhere" sweep that would defeat the entire
        // path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_shell_command_substitution() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `&` and a backtick (``"../caixa-teia &
        // <backtick>sleep 1<backtick>"`` — the canonical "I pasted a
        // `cmd & <backtick>sleep N<backtick>` background-launch +
        // command-substitution chain" footgun) routes through
        // `FonteCaminhoShellBackground` not
        // `FonteCaminhoShellCommandSubstitution`. The background-
        // launch tail is the more common shell-history paste idiom
        // on every probe-as-both value — same cascade discipline
        // every prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & `sleep 1`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_command_substitution() {
        // Cascade pin on the upstream shell-semicolon arm: a value
        // carrying both `;` and a backtick (``"../caixa-teia;
        // <backtick>whoami<backtick>"`` — the canonical "I pasted a
        // `cmd; <backtick>follow-up<backtick>` sequential-chain
        // footgun) routes through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellCommandSubstitution`. The sequential-
        // command-separator paste is the load-bearing root-cause
        // edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; `whoami`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_command_substitution() {
        // Cascade pin on the upstream shell-pipe arm: a value
        // carrying both `|` and a backtick (``"../caixa-teia |
        // <backtick>tee log<backtick>"`` — the canonical pipeline-to-
        // command-substitution paste idiom) routes through
        // `FonteCaminhoShellPipe` not
        // `FonteCaminhoShellCommandSubstitution`. The pipeline-tail
        // paste is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | `tee log`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_command_substitution() {
        // Cascade pin on the upstream shell-redirection arm: a value
        // carrying both `>` and a backtick (``"../caixa-teia>log
        // <backtick>date<backtick>"`` — the canonical "I pasted a
        // `cmd > log <backtick>date<backtick>` redirect-plus-
        // substitution chain" footgun) routes through
        // `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellCommandSubstitution`. The input/output
        // redirection metachar carries the more self-locating `byte`
        // payload (it names which of `<` or `>` triggered), so the
        // prior arm wins on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log `date`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_command_substitution() {
        // Cascade pin on the upstream backslash arm: a value
        // carrying both `\` and a backtick (``"..\caixa-teia
        // <backtick>whoami<backtick>"`` — the canonical "I pasted a
        // Windows-shell `cd ..\path <backtick>whoami<backtick>`
        // chain") routes through `FonteCaminhoBackslash` not
        // `FonteCaminhoShellCommandSubstitution`. The cross-host-OS-
        // separator divergence is the load-bearing axis on every
        // probe-as-both value (an author who removes the `\` is the
        // root-cause edit; the backtick falls away in the same edit
        // since it's downstream of the Windows-shell convention).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia `whoami`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_command_substitution() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and a backtick (`"../foo\n
        // `whoami`"` — the canonical paste-from-multiline-doc
        // footgun where a newline landed mid-caminho between two
        // paste fragments) routes through `FonteCaminhoControlChar`
        // not `FonteCaminhoShellCommandSubstitution`. The POSIX-
        // syscall-rejected-byte / NUL-`CString::new`-fail diagnostic
        // is the load-bearing axis on every value that probes
        // positive for both — mirrors the cascade discipline on
        // every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n`whoami`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_command_substitution() {
        // Cascade pin on the load-bearing leading-byte arm: a
        // leading `/` value with embedded backtick (``"/etc/passwd
        // <backtick>whoami<backtick>"``) routes through
        // `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellCommandSubstitution` — the host-layout-
        // leak diagnostic is the load-bearing axis, the backtick
        // byte is the secondary observation. Same precedence logic
        // as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd `whoami`".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both a backtick and a trailing `/`
        // (``"../`whoami`/"`` — the canonical "I tab-completed a
        // path that already had a backticked `whoami` substitution
        // tail" footgun) routes through
        // `FonteCaminhoShellCommandSubstitution` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-metachar
        // is the more semantic-locating axis (an author who removes
        // the backtick typically also drops the trailing separator
        // since both are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`whoami`/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_diagnostic_carries_offending_dep_and_caminho() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_background_diagnostic_carries_offending_dep_and_caminho`
        // on the closest single-byte peer arm): the error's Display
        // surfaces the offending `:nome` and the offending `:caminho`
        // verbatim, and names the shell-command-substitution footgun
        // explicitly so a `feira lint` run can render the diagnostic
        // without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/`whoami`".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia/`whoami`"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains('`'),
            "diagnostic must reference the backtick footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("command-substitution"),
            "diagnostic must name the shell-command-substitution footgun: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_star_glob() {
        // The fail-before-pass-after pin for the canonical pathname-
        // expansion paste footgun: an author copies an `ls
        // ../caixa-teia/*` shell-listing tail into the `:caminho`
        // slot and silently passes every prior arm
        // (`Path::is_absolute` false on `..`, no control bytes, no
        // `\`, no `<` / `>`, no `|`, no `;`, no `&`, no backtick,
        // doesn't end in `/`). The lacre embedded the value
        // verbatim, the resolver folded it through `Path::join`
        // looking for a literal `./../caixa-teia/*` subdirectory,
        // and the failure surfaced at resolve time with a non-self-
        // locating `No such file or directory` error. The new arm
        // moves the rejection to validate time and names the
        // offending dep + caminho + byte verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellGlob {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellGlob, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia/*");
        assert_eq!(byte, b'*');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_question_glob() {
        // The symmetric single-char-wildcard paste shape
        // (`"../foo?"` — the canonical "I copied a `rm foo?` line
        // out of shell history" idiom). Pinned separately from the
        // `*` shape so the gate's contract is "any `*` or `?`
        // anywhere", not single-byte coverage.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo?".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellGlob { byte, .. } = err else {
            panic!("expected FonteCaminhoShellGlob, got {err:?}");
        };
        assert_eq!(byte, b'?');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_star_glob() {
        // Leading-position `*` shape (`"*/caixa-teia"` — the
        // degenerate "I selected only the wildcard prefix out of a
        // shell-glob expression" idiom). Pinned separately from the
        // embedded-byte shapes so the gate covers every position,
        // not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "*/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_double_star_recursive_glob() {
        // The bash/zsh `globstar` recursive-glob shape
        // (`"../caixa-teia/**/foo"` — the canonical "I copied a
        // `find ../caixa-teia/**/foo` recursive expansion" idiom).
        // The arm fires on the first `*` encountered; pinned so a
        // future arm that tries to distinguish single `*` from
        // double `**` doesn't break the broader contract.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/**/foo".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_dotted_extension_glob() {
        // The canonical extension-glob shape (`"../caixa-teia/*.lisp"`
        // — the "I selected `*.lisp` to mean every Lisp source file
        // in the dep root" footgun the prior arms structurally
        // cannot catch since `.` is a POSIX-valid path-component
        // byte). Pinned so the gate's contract covers the most
        // idiomatic glob-paste shape every author meets first.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*.lisp".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_glob() {
        // The positive-control pin: the gate targets only `*` /
        // `?`, never adjacent printable ASCII or POSIX-valid bytes.
        // The canonical relative POSIX path (`"../caixa-teia"`) and
        // a nested deeply-pathed variant with adjacent printable
        // punctuation (`"../caixa-teia/sub-dir.v2"`) must continue
        // to validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_fires_before_shell_glob() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both a backtick and `*` (``"../`whoami`/*"`` —
        // the canonical "I pasted a `cd <backtick>whoami<backtick>/*`
        // command-substitution + glob chain") routes through
        // `FonteCaminhoShellCommandSubstitution` not
        // `FonteCaminhoShellGlob`. The CWE-78 shell-command-
        // injection vector is the load-bearing root-cause edit on
        // every probe-as-both value — same cascade discipline every
        // prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`whoami`/*".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_shell_glob() {
        // Cascade pin on the upstream shell-background arm: a value
        // carrying both `&` and `*` (`"../caixa-teia & ls /*"` — the
        // canonical "I pasted a `cmd & ls /*` background + glob
        // chain" footgun) routes through `FonteCaminhoShellBackground`
        // not `FonteCaminhoShellGlob`. The background-launch tail is
        // the load-bearing root-cause edit on every probe-as-both
        // value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & ls /*".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_glob() {
        // Cascade pin on the upstream shell-semicolon arm: a value
        // carrying both `;` and `*` (`"../caixa-teia; rm *"` — the
        // canonical sequential-cleanup + glob paste idiom) routes
        // through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellGlob`. The sequential-command-separator
        // paste is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; rm *".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_glob() {
        // Cascade pin on the upstream shell-pipe arm: a value
        // carrying both `|` and `*` (`"../caixa-teia | ls *"` — the
        // canonical pipeline-to-glob paste idiom) routes through
        // `FonteCaminhoShellPipe` not `FonteCaminhoShellGlob`. The
        // pipeline-tail paste is the load-bearing root-cause edit
        // on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | ls *".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_glob() {
        // Cascade pin on the upstream shell-redirection arm: a value
        // carrying both `>` and `*` (`"../caixa-teia>log *"` — the
        // canonical "I pasted a `cmd > log *` redirect-plus-glob
        // chain" footgun) routes through
        // `FonteCaminhoShellRedirection` not `FonteCaminhoShellGlob`.
        // The input/output redirection metachar carries the more
        // self-locating `byte` payload (it names which of `<` or `>`
        // triggered), so the prior arm wins on every probe-as-both
        // value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log *".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_glob() {
        // Cascade pin on the upstream backslash arm: a value
        // carrying both `\` and `*` (`"..\caixa-teia\*"` — the
        // canonical "I pasted a Windows-shell `cd ..\path\*` glob
        // expression" footgun) routes through
        // `FonteCaminhoBackslash` not `FonteCaminhoShellGlob`. The
        // cross-host-OS-separator divergence is the load-bearing
        // axis on every probe-as-both value (an author who removes
        // the `\` is the root-cause edit; the `*` falls away in the
        // same edit since it's downstream of the Windows-shell
        // convention).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia\\*".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_glob() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `*` (`"../foo\n*"` — the
        // canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho between two paste fragments)
        // routes through `FonteCaminhoControlChar` not
        // `FonteCaminhoShellGlob`. The POSIX-syscall-rejected-byte /
        // NUL-`CString::new`-fail diagnostic is the load-bearing
        // axis on every value that probes positive for both —
        // mirrors the cascade discipline on every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n*".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_glob() {
        // Cascade pin on the load-bearing leading-byte arm: a
        // leading `/` value with embedded `*` (`"/etc/*"`) routes
        // through `FonteCaminhoAbsolute` not `FonteCaminhoShellGlob`
        // — the host-layout-leak diagnostic is the load-bearing
        // axis, the glob byte is the secondary observation. Same
        // precedence logic as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/*".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_glob_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both `*` and a trailing `/` (`"../foo*/"` — the
        // canonical "I tab-completed a path that already had a
        // glob-expansion tail" footgun) routes through
        // `FonteCaminhoShellGlob` not `FonteCaminhoTrailingSlash`.
        // The embedded shell-metachar is the more semantic-locating
        // axis (an author who removes the `*` typically also drops
        // the trailing separator since both are paste-from-shell
        // artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo*/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_glob_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_redirection_diagnostic_*` on the
        // closest two-byte peer arm): the error's Display surfaces
        // the offending `:nome`, the offending `:caminho` verbatim,
        // the offending byte's hex / character form, and names the
        // shell-glob / pathname-expansion footgun explicitly so a
        // `feira lint` run can render the diagnostic without
        // re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*.lisp".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia/*.lisp"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x2a"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("glob"),
            "diagnostic must name the shell-glob footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("pathname-expansion"),
            "diagnostic must reference the POSIX pathname-expansion vocabulary: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_modern_command_substitution() {
        // The fail-before-pass-after pin for the canonical modern-Bourne
        // command-substitution paste footgun: an author copies a
        // `cd ../caixa-teia/$(date)/build` shell-history one-liner whose
        // `$(<cmd>)` expansion would land the current date as a
        // subdirectory name and silently passed every prior arm
        // (`Path::is_absolute` false on `..`, no control bytes, no `\`,
        // no `<` / `>`, no `|`, no `;`, no `&`, no backtick, no `*` /
        // `?`, doesn't end in `/`; the leading-`$` f4efe9c
        // `FonteCaminhoVarExpansion` arm doesn't fire because the `$`
        // sits mid-path). The lacre embedded the value verbatim, the
        // resolver folded it through `Path::join` looking for a literal
        // `./../caixa-teia/$(date)/build` subdirectory, and the failure
        // surfaced at resolve time with a non-self-locating `No such
        // file or directory` error. The new arm moves the rejection to
        // validate time and names the offending dep + caminho + byte
        // verbatim. The arm fires on the first `(` encountered (the
        // opening byte of `$(date)`).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/$(date)/build".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellSubshellGrouping {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellSubshellGrouping, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia/$(date)/build");
        assert_eq!(byte, b'(');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_close_paren() {
        // The symmetric close-paren paste shape (`"../caixa-teia)"` —
        // the degenerate "I selected an unbalanced closing paren out of
        // a shell-history block" idiom that probes for the cascade's
        // last-byte handling on a value carrying only the closing byte).
        // Pinned separately from the open-paren shape so the gate's
        // contract is "any `(` or `)` anywhere", not single-byte
        // coverage. Mirrors the peer `validate_rejects_path_fonte_with_\
        // caminho_carrying_question_glob` shape on the immediate-
        // predecessor `FonteCaminhoShellGlob` arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia)".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellSubshellGrouping { byte, .. } = err else {
            panic!("expected FonteCaminhoShellSubshellGrouping, got {err:?}");
        };
        assert_eq!(byte, b')');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_open_paren() {
        // Leading-position `(` shape (`"(cd foo)/caixa-teia"` — the
        // canonical "I selected a `(cd foo)` subshell-grouping prefix
        // out of a `(cd foo) && cmd` shell-history one-liner" idiom).
        // Pinned separately from the embedded-byte shape so the gate
        // covers every position, not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "(cd foo)/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_balanced_subshell_grouping_pair() {
        // The canonical balanced-pair shape (`"../(pwd)/caixa-teia"`
        // — the canonical "I copied a `(pwd)` working-directory-probe
        // subshell-grouping idiom every shell-history block carries"
        // footgun). The value carries no other cascade-preceding
        // shell metachar (`&` / `;` / `|` / `<` / `>` / backtick /
        // `*` / `?`) so the arm fires on the first `(` encountered;
        // pinned so a future arm that tries to distinguish the
        // opening from the closing byte doesn't break the broader
        // contract. Mirrors the peer
        // `validate_rejects_path_fonte_with_caminho_carrying_balanced_\
        // backtick_pair` shape on the upstream `FonteCaminhoShell\
        // CommandSubstitution` arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../(pwd)/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_subshell_grouping() {
        // The positive-control pin: the gate targets only `(` / `)`,
        // never adjacent printable ASCII or POSIX-valid bytes. The
        // canonical relative POSIX path (`"../caixa-teia"`) and a
        // nested deeply-pathed variant with adjacent printable
        // punctuation (`"../caixa-teia/sub-dir.v2"`) must continue to
        // validate cleanly so the gate doesn't widen to a "no printable
        // punctuation anywhere" sweep that would defeat the entire
        // path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_glob_fires_before_shell_subshell_grouping() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `*` and `(` (`"../caixa-teia/*(date)"` — the
        // canonical "I pasted a glob expansion followed by a
        // subshell-grouping tail" footgun) routes through
        // `FonteCaminhoShellGlob` not
        // `FonteCaminhoShellSubshellGrouping`. The pathname-expansion
        // shape is the more common shell-history paste idiom on every
        // probe-as-both value — same cascade discipline every prior
        // `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*(date)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_fires_before_shell_subshell_grouping() {
        // Cascade pin on the upstream shell-command-substitution arm: a
        // value carrying both a backtick and `(` (``"../`whoami`/$(date)"``
        // — the canonical "I pasted a legacy-backtick + modern-paren
        // command-substitution chain" footgun) routes through
        // `FonteCaminhoShellCommandSubstitution` not
        // `FonteCaminhoShellSubshellGrouping`. The CWE-78 shell-
        // command-injection vector is the load-bearing root-cause edit
        // on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`whoami`/$(date)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_shell_subshell_grouping() {
        // Cascade pin on the upstream shell-background arm: a value
        // carrying both `&` and `(` (`"../caixa-teia & (cd foo)"` —
        // the canonical "I pasted a `cmd & (cd foo)` background-launch
        // + subshell-grouping chain" footgun) routes through
        // `FonteCaminhoShellBackground` not
        // `FonteCaminhoShellSubshellGrouping`. The background-launch
        // tail is the load-bearing root-cause edit on every probe-as-
        // both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & (cd foo)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_subshell_grouping() {
        // Cascade pin on the upstream shell-semicolon arm: a value
        // carrying both `;` and `(` (`"../caixa-teia; (cd foo)"` —
        // the canonical sequential-cleanup + subshell-grouping paste
        // idiom) routes through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellSubshellGrouping`. The sequential-command-
        // separator paste is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; (cd foo)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_subshell_grouping() {
        // Cascade pin on the upstream shell-pipe arm: a value carrying
        // both `|` and `(` (`"../caixa-teia | (tee log)"` — the
        // canonical pipeline-to-subshell-grouping paste idiom) routes
        // through `FonteCaminhoShellPipe` not
        // `FonteCaminhoShellSubshellGrouping`. The pipeline-tail paste
        // is the load-bearing root-cause edit on every probe-as-both
        // value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | (tee log)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_subshell_grouping() {
        // Cascade pin on the upstream shell-redirection arm: a value
        // carrying both `>` and `(` (`"../caixa-teia>log (cd foo)"` —
        // the canonical "I pasted a `cmd > log (cd foo)` redirect-
        // plus-subshell-grouping chain" footgun) routes through
        // `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellSubshellGrouping`. The input/output
        // redirection metachar carries the more self-locating `byte`
        // payload (it names which of `<` or `>` triggered), so the
        // prior arm wins on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log (cd foo)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_subshell_grouping() {
        // Cascade pin on the upstream backslash arm: a value carrying
        // both `\` and `(` (`"..\caixa-teia\(cd foo)"` — the canonical
        // "I pasted a Windows-shell `cd ..\path\(cmd)` chain") routes
        // through `FonteCaminhoBackslash` not
        // `FonteCaminhoShellSubshellGrouping`. The cross-host-OS-
        // separator divergence is the load-bearing axis on every
        // probe-as-both value (an author who removes the `\` is the
        // root-cause edit; the `(` falls away in the same edit since
        // it's downstream of the Windows-shell convention).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia\\(cd foo)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_subshell_grouping() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `(` (`"../foo\n(cd bar)"` —
        // the canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho between two paste fragments)
        // routes through `FonteCaminhoControlChar` not
        // `FonteCaminhoShellSubshellGrouping`. The POSIX-syscall-
        // rejected-byte / NUL-`CString::new`-fail diagnostic is the
        // load-bearing axis on every value that probes positive for
        // both — mirrors the cascade discipline on every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n(cd bar)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_subshell_grouping() {
        // Cascade pin on the load-bearing leading-byte arm: a leading
        // `/` value with embedded `(` (`"/etc/(cd foo)"`) routes
        // through `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellSubshellGrouping` — the host-layout-leak
        // diagnostic is the load-bearing axis, the subshell-grouping
        // byte is the secondary observation. Same precedence logic as
        // every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/(cd foo)".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_expansion_fires_before_shell_subshell_grouping() {
        // Cascade pin on the upstream leading-`$` var-expansion arm: a
        // value carrying both a leading `$` and a `(` (`"$(date)/\
        // caixa-teia"` — the canonical "I pasted a `$(date)` modern-
        // command-substitution at the head of a sibling-workspace
        // path" footgun) routes through `FonteCaminhoVarExpansion` not
        // `FonteCaminhoShellSubshellGrouping`. The leading-byte
        // shell-variable-expansion is the more self-locating diagnostic
        // on values that probe as both — same load-bearing-leading-
        // byte cascade discipline every prior `:caminho` arm
        // establishes. Closing both halves of `$(<cmd>)` structurally
        // (leading `$` here, trailing `)` on the new arm) excludes the
        // entire modern Bourne command-substitution surface from the
        // typed `:caminho` accepted set; the cascade preserves the
        // narrower leading-byte diagnostic on values that probe both
        // halves at the canonical leading position.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$(date)/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_subshell_grouping_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value carrying
        // both `(` and a trailing `/` (`"../(cd foo)/"` — the canonical
        // "I tab-completed a path that already had a subshell-grouping
        // expansion tail" footgun) routes through
        // `FonteCaminhoShellSubshellGrouping` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-metachar is
        // the more semantic-locating axis (an author who removes the
        // `(` typically also drops the trailing separator since both
        // are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../(cd foo)/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_subshell_grouping_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_glob_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the closest two-byte peer arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the shell-subshell-grouping footgun explicitly so a
        // `feira lint` run can render the diagnostic without re-
        // parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/$(date)/build".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia/$(date)/build"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x28"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("subshell-grouping"),
            "diagnostic must name the shell-subshell-grouping footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("command-substitution"),
            "diagnostic must reference the `$(<cmd>)` command-substitution vocabulary: \
             {rendered:?}",
        );
    }

    // ── shell-brace-expansion / URI-Template-placeholder arm ───────────
    //
    // Peer with the prior `FonteCaminhoShellSubshellGrouping` (`(` /
    // `)`) byte-pair arm: the same per-byte cascade with the same
    // self-locating `byte: u8` diagnostic on the orthogonal `{` /
    // `}` brace-expansion / URI-Template placeholder axis. The peer
    // [`crate::render::is_git_repo_url`] (42d8f9d) closes the same
    // byte pair on the sibling `:fonte :repo` axis under the same
    // banner.

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_brace_expansion_fan_across_siblings() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // shell-history brace-expansion footgun: an author copies a
        // `cd ../{caixa-teia,caixa-helm}/build` shell-history one-
        // liner whose `{a,b}` brace expansion fans across two siblings
        // and silently passed every prior arm (`Path::is_absolute`
        // false on `..`, no control bytes, no `\`, no `<` / `>`, no
        // `|`, no `;`, no `&`, no backtick, no `*` / `?`, no `(` /
        // `)`, doesn't end in `/`; the leading-`$` f4efe9c
        // `FonteCaminhoVarExpansion` arm doesn't fire because the
        // value starts with `..` not `$`). The lacre embedded the
        // value verbatim, the resolver folded it through `Path::join`
        // looking for a literal `./../{caixa-teia,caixa-helm}/build`
        // subdirectory, and the failure surfaced at resolve time with
        // a non-self-locating `No such file or directory` error. The
        // new arm moves the rejection to validate time and names the
        // offending dep + caminho + byte verbatim. The arm fires on
        // the first `{` encountered.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../{caixa-teia,caixa-helm}/build".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellBraceExpansion {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellBraceExpansion, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../{caixa-teia,caixa-helm}/build");
        assert_eq!(byte, b'{');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_close_brace() {
        // The symmetric close-brace paste shape (`"../caixa-teia}"` —
        // the degenerate "I selected an unbalanced closing brace out
        // of a shell-history block" idiom that probes for the
        // cascade's last-byte handling on a value carrying only the
        // closing byte). Pinned separately from the open-brace shape
        // so the gate's contract is "any `{` or `}` anywhere", not
        // single-byte coverage. Mirrors the peer
        // `validate_rejects_path_fonte_with_caminho_carrying_close_paren`
        // shape on the immediate-predecessor `FonteCaminhoShellSubshellGrouping`
        // arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia}".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellBraceExpansion { byte, .. } = err else {
            panic!("expected FonteCaminhoShellBraceExpansion, got {err:?}");
        };
        assert_eq!(byte, b'}');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_open_brace() {
        // Leading-position `{` shape (`"{caixa-teia,caixa-helm}/build"`
        // — the canonical "I selected a `{a,b}` brace-expansion prefix
        // out of a shell-history one-liner" idiom). Pinned separately
        // from the embedded-byte shape so the gate covers every
        // position, not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "{caixa-teia,caixa-helm}/build".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_uri_template_placeholder() {
        // The canonical URI-Template / Mustache / Helm doubled-brace
        // placeholder shape (`"../{{org}}/caixa-teia"` — the canonical
        // "I copied a `https://github.com/{{org}}/caixa-teia` README
        // quick-start / OpenAPI spec / Helm chart `home:` template
        // and forgot to substitute the placeholder" footgun). The arm
        // fires on the first `{` encountered; pinned so the gate's
        // coverage extends from the bare-brace shell-history shape to
        // the doubled-brace URI-Template / templating-engine shape.
        // Mirrors the peer 42d8f9d `is_git_repo_url` arm on the
        // sibling `:fonte :repo` axis.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../{{org}}/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_brace_range_expansion() {
        // The canonical bash brace-range-expansion shape (`"../caixa-
        // v{1..10}"` — the `{1..10}` sequence expansion every bash /
        // zsh `for i in {1..10}; do …; done` idiom uses, the symmetric
        // sequence-range form to the `{a,b,c}` comma-separated form).
        // The arm fires on the first `{` encountered; pinned so the
        // gate's coverage extends from the comma-separated form to
        // the integer-range form.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-v{1..10}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_brace_expansion() {
        // The positive-control pin: the gate targets only `{` / `}`,
        // never adjacent printable ASCII or POSIX-valid bytes. The
        // canonical relative POSIX path (`"../caixa-teia"`) and a
        // nested deeply-pathed variant with adjacent printable
        // punctuation (`"../caixa-teia/sub-dir.v2"`) must continue to
        // validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface. Peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_subshell_grouping`
        // on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_subshell_grouping_fires_before_shell_brace_expansion() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `(` and `{` (`"../(cd foo)/{a,b}"` — the
        // canonical "I pasted a subshell-grouping followed by a
        // brace-expansion tail" footgun) routes through
        // `FonteCaminhoShellSubshellGrouping` not
        // `FonteCaminhoShellBraceExpansion`. The subshell-grouping
        // shape is the more semantic-locating axis on every probe-
        // as-both value because it closes both halves of the modern
        // Bourne `$(<cmd>)` command-substitution surface — same
        // cascade discipline every prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../(cd foo)/{a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_glob_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream shell-glob arm: a value carrying
        // both `*` and `{` (`"../caixa-teia/*{a,b}"` — the canonical
        // "I pasted a glob expansion followed by a brace-expansion
        // tail" footgun) routes through `FonteCaminhoShellGlob` not
        // `FonteCaminhoShellBraceExpansion`. The pathname-expansion
        // shape is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*{a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream shell-command-substitution arm:
        // a value carrying both a backtick and `{` (``"../`whoami`/{a,b}"``
        // — the canonical "I pasted a legacy-backtick command-
        // substitution followed by a brace-expansion fan-out" footgun)
        // routes through `FonteCaminhoShellCommandSubstitution` not
        // `FonteCaminhoShellBraceExpansion`. The CWE-78 shell-
        // command-injection vector is the load-bearing root-cause
        // edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`whoami`/{a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream shell-background arm: a value
        // carrying both `&` and `{` (`"../caixa-teia & {a,b}"` — the
        // canonical "I pasted a `cmd & {fork-fan}` background-launch
        // + brace-expansion chain" footgun) routes through
        // `FonteCaminhoShellBackground` not
        // `FonteCaminhoShellBraceExpansion`. The background-launch
        // tail is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & {a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream shell-semicolon arm: a value
        // carrying both `;` and `{` (`"../caixa-teia; {a,b}"` — the
        // canonical sequential-cleanup + brace-expansion paste
        // idiom) routes through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellBraceExpansion`. The sequential-command-
        // separator paste is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; {a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream shell-pipe arm: a value
        // carrying both `|` and `{` (`"../caixa-teia | {tee,cat}"`
        // — the canonical pipeline-to-brace-expansion paste idiom)
        // routes through `FonteCaminhoShellPipe` not
        // `FonteCaminhoShellBraceExpansion`. The pipeline-tail paste
        // is the load-bearing root-cause edit on every probe-as-
        // both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | {tee,cat}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream shell-redirection arm: a value
        // carrying both `>` and `{` (`"../caixa-teia>log {a,b}"` —
        // the canonical "I pasted a `cmd > log {a,b}` redirect-
        // plus-brace-expansion chain" footgun) routes through
        // `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellBraceExpansion`. The input/output
        // redirection metachar carries the more self-locating
        // `byte` payload, so the prior arm wins on every probe-
        // as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log {a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream backslash arm: a value
        // carrying both `\` and `{` (`"..\caixa-teia\{a,b}"` — the
        // canonical "I pasted a Windows-shell `cd ..\path\{a,b}`
        // chain") routes through `FonteCaminhoBackslash` not
        // `FonteCaminhoShellBraceExpansion`. The cross-host-OS-
        // separator divergence is the load-bearing axis on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia\\{a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_brace_expansion() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `{` (`"../foo\n{a,b}"` —
        // the canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho between two paste fragments)
        // routes through `FonteCaminhoControlChar` not
        // `FonteCaminhoShellBraceExpansion`. The POSIX-syscall-
        // rejected-byte / NUL-`CString::new`-fail diagnostic is the
        // load-bearing axis on every value that probes positive for
        // both — mirrors the cascade discipline on every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n{a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_brace_expansion() {
        // Cascade pin on the load-bearing leading-byte arm: a
        // leading `/` value with embedded `{` (`"/etc/{a,b}"`)
        // routes through `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellBraceExpansion` — the host-layout-leak
        // diagnostic is the load-bearing axis, the brace-expansion
        // byte is the secondary observation. Same precedence logic
        // as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/{a,b}".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_expansion_fires_before_shell_brace_expansion() {
        // Cascade pin on the upstream leading-`$` var-expansion
        // arm: a value carrying both a leading `$` and a `{`
        // (`"${ORG}/caixa-teia"` — the canonical "I pasted a
        // `${ORG}` shell-variable + curly-brace expansion at the
        // head of a sibling-workspace path" footgun) routes through
        // `FonteCaminhoVarExpansion` not
        // `FonteCaminhoShellBraceExpansion`. The leading-byte
        // shell-variable-expansion is the more self-locating
        // diagnostic on values that probe as both — same
        // load-bearing-leading-byte cascade discipline every prior
        // `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "${ORG}/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_brace_expansion_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both `{` and a trailing `/`
        // (`"../{caixa-teia,caixa-helm}/"` — the canonical "I
        // tab-completed a path that already had a brace-expansion
        // expansion tail" footgun) routes through
        // `FonteCaminhoShellBraceExpansion` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-metachar
        // is the more semantic-locating axis (an author who removes
        // the `{` typically also drops the trailing separator since
        // both are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../{caixa-teia,caixa-helm}/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_brace_expansion_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_subshell_grouping_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the closest two-byte peer arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the shell-brace-expansion / URI-Template footgun
        // explicitly so a `feira lint` run can render the diagnostic
        // without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../{caixa-teia,caixa-helm}/build".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../{caixa-teia,caixa-helm}/build"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x7b"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("brace-expansion"),
            "diagnostic must name the shell-brace-expansion footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("URI Template"),
            "diagnostic must reference the RFC-6570 URI-Template-placeholder vocabulary: \
             {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_bracket_glob_character_class() {
        // The canonical paste-from-shell-history bracket-glob /
        // character-class footgun: an author copies a
        // `cd ../caixa-[a-z]/build` shell-history one-liner whose
        // `[a-z]` POSIX glob character-class matches every lowercase-
        // ASCII-suffix sibling caixa directory and silently passed
        // every prior arm (`Path::is_absolute` false on `..`, no
        // control bytes, no `\`, no `<` / `>`, no `|`, no `;`, no
        // `&`, no backtick, no `*` / `?`, no `(` / `)`, no `{` /
        // `}`, doesn't end in `/`; the leading-`$` f4efe9c
        // `FonteCaminhoVarExpansion` arm doesn't fire because the
        // value starts with `..` not `$`). The lacre embedded the
        // value verbatim, the resolver folded it through
        // `Path::join` looking for a literal `./../caixa-[a-z]/
        // build` subdirectory, and the failure surfaced at resolve
        // time with a non-self-locating `No such file or directory`
        // error. The new arm moves the rejection to validate time
        // and names the offending dep + caminho + byte verbatim.
        // The arm fires on the first `[` encountered.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-[a-z]/build".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellBracketExpansion {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellBracketExpansion, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-[a-z]/build");
        assert_eq!(byte, b'[');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_close_bracket() {
        // The symmetric close-bracket paste shape (`"../caixa-teia]"`
        // — the degenerate "I selected an unbalanced closing bracket
        // out of a glob character-class block" idiom that probes for
        // the cascade's last-byte handling on a value carrying only
        // the closing byte). Pinned separately from the open-bracket
        // shape so the gate's contract is "any `[` or `]` anywhere",
        // not single-byte coverage. Mirrors the peer
        // `validate_rejects_path_fonte_with_caminho_carrying_close_brace`
        // shape on the immediate-predecessor
        // `FonteCaminhoShellBraceExpansion` arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia]".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellBracketExpansion { byte, .. } = err else {
            panic!("expected FonteCaminhoShellBracketExpansion, got {err:?}");
        };
        assert_eq!(byte, b']');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_open_bracket() {
        // Leading-position `[` shape (`"[caixa-teia]/build"` — the
        // canonical "I selected a `[caixa-teia]` TOML-table-header /
        // glob-character-class prefix out of an aligned config /
        // shell-history one-liner" idiom). Pinned separately from
        // the embedded-byte shape so the gate covers every position,
        // not only mid-path.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "[caixa-teia]/build".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBracketExpansion { byte: b'[', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_toml_inline_array() {
        // The canonical TOML inline-array / YAML flow-sequence
        // paste shape (`"../[\"a\", \"b\"]/caixa-teia"` — the
        // canonical "I copied a `features = [\"a\", \"b\"]` TOML
        // inline-array out of a sibling-Cargo manifest" cross-idiom
        // leak; the symmetric YAML flow-sequence form `paths: [/a,
        // /b]` paste-from-values.yaml shape carries the same
        // bracket pair). The arm fires on the first `[` encountered;
        // pinned so the gate's coverage extends from the bare-
        // bracket glob-character-class shape to the TOML / YAML /
        // JSON array-literal shape.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../[\"a\", \"b\"]/caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBracketExpansion { byte: b'[', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_shell_test_builtin() {
        // The canonical POSIX `test` / `[` builtin command paste
        // shape (`"../[ -d caixa-teia ]"` — the `[ <expr> ]` shell-
        // script conditional every paste-from-shell-script idiom
        // carries; bash's `[[ <expr> ]]` extended-test grammar
        // would surface the same byte pair). The arm fires on the
        // first `[` encountered; pinned so the gate's coverage
        // extends from the embedded-glob-character-class shape to
        // the leading-`test`-builtin / extended-test form.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../[ -d caixa-teia ]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBracketExpansion { byte: b'[', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_bracket_expansion() {
        // The positive-control pin: the gate targets only `[` /
        // `]`, never adjacent printable ASCII or POSIX-valid bytes.
        // The canonical relative POSIX path (`"../caixa-teia"`) and
        // a nested deeply-pathed variant with adjacent printable
        // punctuation (`"../caixa-teia/sub-dir.v2"`) must continue
        // to validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface. Peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_brace_expansion`
        // on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_brace_expansion_fires_before_shell_bracket_expansion() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `{` and `[` (`"../{a,b}[ch]"` — the
        // canonical "I pasted a brace-expansion fan followed by a
        // glob-character-class tail" footgun) routes through
        // `FonteCaminhoShellBraceExpansion` not
        // `FonteCaminhoShellBracketExpansion`. The brace-expansion
        // fan is the load-bearing root-cause edit on every
        // probe-as-both value because the bracket-class tail
        // typically rides on a prior brace-expansion expansion;
        // same cascade discipline every prior `:caminho` arm
        // establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../{a,b}[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_subshell_grouping_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream shell-subshell-grouping arm:
        // a value carrying both `(` and `[` (`"../(cd foo)/[ch]"` —
        // the canonical "I pasted a subshell-grouping followed by
        // a glob-character-class tail" footgun) routes through
        // `FonteCaminhoShellSubshellGrouping` not
        // `FonteCaminhoShellBracketExpansion`. The modern Bourne
        // `$(<cmd>)` command-substitution boundary is the load-
        // bearing axis on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../(cd foo)/[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_glob_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream shell-glob arm: a value
        // carrying both `*` and `[` (`"../caixa-teia/*[ch]"` — the
        // canonical "I pasted a `*.[ch]` C-source-file glob whose
        // unbounded `*` precedes the bracket character-class"
        // footgun) routes through `FonteCaminhoShellGlob` not
        // `FonteCaminhoShellBracketExpansion`. The unbounded
        // pathname-expansion sentinel is the load-bearing root-
        // cause edit on every probe-as-both value — the unbounded
        // `*` carries the more aggressive expansion vector than
        // the bounded `[ch]` class, so the prior arm wins.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream shell-command-substitution
        // arm: a value carrying both a backtick and `[`
        // (``"../`whoami`/[ch]"`` — the canonical "I pasted a
        // legacy-backtick command-substitution followed by a
        // glob-character-class tail" footgun) routes through
        // `FonteCaminhoShellCommandSubstitution` not
        // `FonteCaminhoShellBracketExpansion`. The CWE-78 shell-
        // command-injection vector is the load-bearing root-cause
        // edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`whoami`/[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream shell-background arm: a
        // value carrying both `&` and `[` (`"../caixa-teia & [ch]"`
        // — the canonical "I pasted a `cmd & [glob]` background-
        // launch + bracket-class chain" footgun) routes through
        // `FonteCaminhoShellBackground` not
        // `FonteCaminhoShellBracketExpansion`. The background-
        // launch tail is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & [ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream shell-semicolon arm: a value
        // carrying both `;` and `[` (`"../caixa-teia; [ch]"` — the
        // canonical sequential-cleanup + bracket-class paste
        // idiom) routes through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellBracketExpansion`. The sequential-
        // command-separator paste is the load-bearing root-cause
        // edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; [ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream shell-pipe arm: a value
        // carrying both `|` and `[` (`"../caixa-teia | [tee]"` —
        // the canonical pipeline-to-bracket-class paste idiom)
        // routes through `FonteCaminhoShellPipe` not
        // `FonteCaminhoShellBracketExpansion`. The pipeline-tail
        // paste is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | [tee]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream shell-redirection arm: a
        // value carrying both `>` and `[` (`"../caixa-teia>log
        // [ch]"` — the canonical "I pasted a `cmd > log [glob]`
        // redirect-plus-bracket chain" footgun) routes through
        // `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellBracketExpansion`. The input/output
        // redirection metachar carries the more self-locating
        // `byte` payload, so the prior arm wins on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log [ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream backslash arm: a value
        // carrying both `\` and `[` (`"..\caixa-teia\[ch]"` — the
        // canonical "I pasted a Windows-shell `cd ..\path\[glob]`
        // chain") routes through `FonteCaminhoBackslash` not
        // `FonteCaminhoShellBracketExpansion`. The cross-host-OS-
        // separator divergence is the load-bearing axis on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia\\[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_bracket_expansion() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `[` (`"../foo\n[ch]"` —
        // the canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho between two paste fragments)
        // routes through `FonteCaminhoControlChar` not
        // `FonteCaminhoShellBracketExpansion`. The POSIX-syscall-
        // rejected-byte / NUL-`CString::new`-fail diagnostic is
        // the load-bearing axis on every value that probes
        // positive for both — mirrors the cascade discipline on
        // every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_bracket_expansion() {
        // Cascade pin on the load-bearing leading-byte arm: a
        // leading `/` value with embedded `[` (`"/etc/[ch]"`)
        // routes through `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellBracketExpansion` — the host-layout-
        // leak diagnostic is the load-bearing axis, the bracket-
        // expansion byte is the secondary observation. Same
        // precedence logic as every prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_expansion_fires_before_shell_bracket_expansion() {
        // Cascade pin on the upstream leading-`$` var-expansion
        // arm: a value carrying both a leading `$` and a `[`
        // (`"$DIR/[ch]"` — the canonical "I pasted a `$DIR` shell-
        // variable + bracket-class at the head of a sibling-
        // workspace path" footgun) routes through
        // `FonteCaminhoVarExpansion` not
        // `FonteCaminhoShellBracketExpansion`. The leading-byte
        // shell-variable-expansion is the more self-locating
        // diagnostic on values that probe as both — same
        // load-bearing-leading-byte cascade discipline every
        // prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$DIR/[ch]".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_bracket_expansion_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both `[` and a trailing `/` (`"../[a-z]/"` —
        // the canonical "I tab-completed a path that already had
        // a bracket-glob-character-class expansion tail" footgun)
        // routes through `FonteCaminhoShellBracketExpansion` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-metachar
        // is the more semantic-locating axis (an author who
        // removes the `[` typically also drops the trailing
        // separator since both are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../[a-z]/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBracketExpansion { byte: b'[', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_bracket_expansion_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_brace_expansion_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the closest two-byte peer arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the shell-bracket-expansion / glob-character-class
        // footgun explicitly so a `feira lint` run can render the
        // diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-[a-z]/build".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-[a-z]/build"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x5b"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("bracket-expansion"),
            "diagnostic must name the shell-bracket-expansion footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("glob-character-class"),
            "diagnostic must reference the POSIX glob-character-class vocabulary: \
             {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_single_quote_grouping() {
        // The canonical paste-from-shell-history strong-quoted
        // sibling-workspace-path footgun: an author copies a
        // `cd '../caixa-teia'` shell-history one-liner whose strong-
        // quoting preserved the path across a whitespace paste
        // boundary and silently passed every prior arm
        // (`Path::is_absolute` false on `'..`, no control bytes, no
        // `\`, no `<` / `>`, no `|`, no `;`, no `&`, no backtick, no
        // `*` / `?`, no `(` / `)`, no `{` / `}`, no `[` / `]`,
        // doesn't end in `/`; the leading-`$` f4efe9c
        // `FonteCaminhoVarExpansion` arm doesn't fire because the
        // value starts with `'` not `$`). The lacre embedded the
        // value verbatim, the resolver folded it through
        // `Path::join` looking for a literal `./'../caixa-teia'`
        // subdirectory, and the failure surfaced at resolve time
        // with a non-self-locating `No such file or directory`
        // error. The new arm moves the rejection to validate time
        // and names the offending dep + caminho + byte verbatim.
        // The arm fires on the first `'` encountered.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "'../caixa-teia'".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellQuoteGrouping {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellQuoteGrouping, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "'../caixa-teia'");
        assert_eq!(byte, b'\'');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_double_quote_grouping() {
        // The symmetric weak-quoted paste shape (`"\"../caixa-teia\""`
        // — the canonical paste-from-JSON-config / paste-from-YAML-
        // flow-scalar / paste-from-TOML-basic-string / paste-from-
        // tatara-lisp-string-literal cross-idiom leak). Pinned
        // separately from the single-quote shape so the gate's
        // contract is "any `'` or `\"` anywhere", not single-byte
        // coverage. Mirrors the peer
        // `validate_rejects_path_fonte_with_caminho_carrying_close_bracket`
        // shape on the immediate-predecessor
        // `FonteCaminhoShellBracketExpansion` arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "\"../caixa-teia\"".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellQuoteGrouping { byte, .. } = err else {
            panic!("expected FonteCaminhoShellQuoteGrouping, got {err:?}");
        };
        assert_eq!(byte, b'"');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_double_quote() {
        // Embedded-position `"` shape (`"../\"caixa-teia\""` — the
        // canonical "I pasted a JSON key-value pair fragment into
        // the middle of the path" idiom). Pinned separately from
        // the leading-byte shape so the gate covers every position,
        // not only leading.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../\"caixa-teia\"".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellQuoteGrouping { byte: b'"', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_yaml_flow_scalar_paste() {
        // The canonical YAML double-quoted flow-scalar cross-idiom
        // leak shape (`"path: \"../caixa-teia\""` — the "I copied a
        // `path: \"...\"` YAML flow-scalar entry out of an aligned
        // values.yaml / K8s manifest and dropped it verbatim into
        // the `:caminho` slot including the `path: ` key prefix"
        // paste-idiom). The arm fires on the first `"` encountered;
        // pinned so the gate's coverage extends from the bare-quote
        // paste shape to the aligned-YAML-manifest cross-idiom-leak
        // shape.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "path: \"../caixa-teia\"".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellQuoteGrouping { byte: b'"', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_quote_grouping() {
        // The positive-control pin: the gate targets only `'` /
        // `"`, never adjacent printable ASCII or POSIX-valid bytes.
        // The canonical relative POSIX path (`"../caixa-teia"`) and
        // a nested deeply-pathed variant with adjacent printable
        // punctuation (`"../caixa-teia/sub-dir.v2"`) must continue
        // to validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface. Peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_bracket_expansion`
        // on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_bracket_expansion_fires_before_shell_quote_grouping() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `[` and `'` (`"../[a-z]'x'"` — the canonical
        // "I pasted a glob-character-class followed by a strong-
        // quoted literal tail" footgun) routes through
        // `FonteCaminhoShellBracketExpansion` not
        // `FonteCaminhoShellQuoteGrouping`. The glob-character-class
        // expansion is the load-bearing root-cause edit on every
        // probe-as-both value; same cascade discipline every prior
        // `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../[a-z]'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBracketExpansion { byte: b'[', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_brace_expansion_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-brace-expansion arm: a
        // value carrying both `{` and `'` (`"../{a,b}'x'"` — the
        // canonical "I pasted a brace-expansion fan followed by a
        // strong-quoted literal tail" footgun) routes through
        // `FonteCaminhoShellBraceExpansion` not
        // `FonteCaminhoShellQuoteGrouping`. The brace-expansion fan
        // is the load-bearing root-cause edit on every probe-as-
        // both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../{a,b}'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_subshell_grouping_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-subshell-grouping arm:
        // a value carrying both `(` and `'` (`"../(cd foo)/'x'"` —
        // the canonical "I pasted a subshell-grouping followed by
        // a strong-quoted literal tail" footgun) routes through
        // `FonteCaminhoShellSubshellGrouping` not
        // `FonteCaminhoShellQuoteGrouping`. The modern Bourne
        // `$(<cmd>)` command-substitution boundary is the load-
        // bearing axis on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../(cd foo)/'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_glob_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-glob arm: a value
        // carrying both `*` and `'` (`"../caixa-teia/*'x'"` — the
        // canonical "I pasted a `*` unbounded pathname-expansion
        // followed by a strong-quoted literal tail" footgun) routes
        // through `FonteCaminhoShellGlob` not
        // `FonteCaminhoShellQuoteGrouping`. The unbounded pathname-
        // expansion sentinel is the load-bearing root-cause edit
        // on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-command-substitution
        // arm: a value carrying both a backtick and `'`
        // (``"../`whoami`/'x'"`` — the canonical "I pasted a
        // legacy-backtick command-substitution followed by a
        // strong-quoted literal tail" footgun) routes through
        // `FonteCaminhoShellCommandSubstitution` not
        // `FonteCaminhoShellQuoteGrouping`. The CWE-78 shell-
        // command-injection vector is the load-bearing root-cause
        // edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`whoami`/'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-background arm: a value
        // carrying both `&` and `'` (`"../caixa-teia & 'x'"` — the
        // canonical "I pasted a `cmd & 'literal'` background-launch
        // + quote chain" footgun) routes through
        // `FonteCaminhoShellBackground` not
        // `FonteCaminhoShellQuoteGrouping`. The background-launch
        // tail is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia & 'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-semicolon arm: a value
        // carrying both `;` and `'` (`"../caixa-teia; 'x'"` — the
        // canonical sequential-cleanup + quote paste idiom) routes
        // through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellQuoteGrouping`. The sequential-command-
        // separator paste is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia; 'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-pipe arm: a value
        // carrying both `|` and `'` (`"../caixa-teia | 'x'"` — the
        // canonical pipeline-to-quoted-literal paste idiom) routes
        // through `FonteCaminhoShellPipe` not
        // `FonteCaminhoShellQuoteGrouping`. The pipeline-tail paste
        // is the load-bearing root-cause edit on every probe-as-
        // both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia | 'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream shell-redirection arm: a
        // value carrying both `>` and `'` (`"../caixa-teia>log 'x'"`
        // — the canonical "I pasted a `cmd > log 'literal'`
        // redirect-plus-quote chain" footgun) routes through
        // `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellQuoteGrouping`. The input/output
        // redirection metachar carries the more self-locating
        // `byte` payload, so the prior arm wins on every probe-as-
        // both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log 'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream backslash arm: a value
        // carrying both `\` and `'` (`"..\caixa-teia\'x'"` — the
        // canonical "I pasted a Windows-shell `cd ..\path\'literal'`
        // chain" footgun) routes through `FonteCaminhoBackslash`
        // not `FonteCaminhoShellQuoteGrouping`. The cross-host-OS-
        // separator divergence is the load-bearing axis on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia\\'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_quote_grouping() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `'` (`"../foo\n'x'"` —
        // the canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho between two paste fragments)
        // routes through `FonteCaminhoControlChar` not
        // `FonteCaminhoShellQuoteGrouping`. The POSIX-syscall-
        // rejected-byte / NUL-`CString::new`-fail diagnostic is
        // the load-bearing axis on every value that probes
        // positive for both — mirrors the cascade discipline on
        // every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_quote_grouping() {
        // Cascade pin on the load-bearing leading-byte arm: a
        // leading `/` value with embedded `'` (`"/etc/'x'"`) routes
        // through `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellQuoteGrouping` — the host-layout-leak
        // diagnostic is the load-bearing axis, the quote byte is
        // the secondary observation. Same precedence logic as every
        // prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_expansion_fires_before_shell_quote_grouping() {
        // Cascade pin on the upstream leading-`$` var-expansion
        // arm: a value carrying both a leading `$` and a `'`
        // (`"$DIR/'x'"` — the canonical "I pasted a `$DIR` shell-
        // variable + quoted literal at the head of a sibling-
        // workspace path" footgun) routes through
        // `FonteCaminhoVarExpansion` not
        // `FonteCaminhoShellQuoteGrouping`. The leading-byte
        // shell-variable-expansion is the more self-locating
        // diagnostic on values that probe as both — same
        // load-bearing-leading-byte cascade discipline every
        // prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$DIR/'x'".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_quote_grouping_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both `'` and a trailing `/` (`"../'caixa-teia'/"`
        // — the canonical "I tab-completed a path whose strong-
        // quoted body already carried the quoting from a shell-
        // history paste" footgun) routes through
        // `FonteCaminhoShellQuoteGrouping` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-metachar
        // is the more semantic-locating axis (an author who removes
        // the `'` typically also drops the trailing separator since
        // both are paste-from-shell artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../'caixa-teia'/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellQuoteGrouping { byte: b'\'', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_quote_grouping_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_bracket_expansion_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the closest two-byte peer arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the shell-quote-grouping / cross-config-DSL-string-
        // literal-delimiter footgun explicitly so a `feira lint`
        // run can render the diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "'../caixa-teia'".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("'../caixa-teia'"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x27"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("quote-grouping"),
            "diagnostic must name the shell-quote-grouping footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("string-literal"),
            "diagnostic must reference the cross-config-DSL string-literal-delimiter \
             vocabulary: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_shell_comment_lead() {
        // The canonical paste-from-shell-history-with-trailing-
        // annotation footgun: an author pastes a `cd ../caixa-teia
        // # legacy sibling` shell-history one-liner whose unquoted `#`
        // comment-lead separates the path from an inline annotation.
        // The POSIX shell trims the annotation to `../caixa-teia`
        // (POSIX.1-2017 §2.3 Token Recognition step 6), but
        // `Path::is_absolute` returns false on `..`, `#` is neither
        // a leading-byte sentinel nor a control byte nor `\` nor
        // `<` / `>` nor `|` nor `;` nor `&` nor backtick nor `*` /
        // `?` nor `(` / `)` nor `{` / `}` nor `[` / `]` nor `'` /
        // `"`, and the value's last byte isn't `/` — so the value
        // silently passed every prior arm. The resolver folded the
        // value through `Path::join` looking for a literal
        // `./../caixa-teia # legacy sibling` subdirectory and the
        // failure surfaced at resolve time with a non-self-locating
        // `No such file or directory` error. The new arm moves the
        // rejection to validate time and names the offending dep +
        // caminho + byte verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia # legacy sibling".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellComment {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellComment, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia # legacy sibling");
        assert_eq!(byte, b'#');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_yaml_comment_paste() {
        // The symmetric YAML flow-scalar / values.yaml / K8s-manifest
        // cross-idiom-leak shape (`"../caixa-teia  # pin"` — the
        // canonical "I copied a `path: ../caixa-teia  # pin` YAML
        // scalar-plus-comment entry out of an aligned values.yaml and
        // dropped it verbatim into the `:caminho` slot" paste-idiom).
        // Pinned separately from the shell-history shape so the
        // gate's coverage extends from the single-space `#` shape to
        // the YAML-canonical double-space `  #` shape. YAML 1.2 §6.6
        // requires the `#` to be preceded by whitespace to lex as a
        // comment (bare `foo#bar` is a single scalar); the double-
        // space paste from an aligned manifest is the canonical
        // shape.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia  # pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellComment { byte: b'#', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_url_fragment_anchor() {
        // The URL-fragment-identifier paste shape
        // (`"../caixa-teia#readme"` — the canonical
        // paste-from-browser-address-bar permalink shape where the
        // browser preserved the `#anchor` tail on the copy). Pinned
        // separately from the whitespace-separated shell / YAML
        // comment shapes so the gate covers the unpadded RFC 3986
        // §3.5 fragment-delimiter position too, not only positions
        // preceded by unquoted whitespace. Peer with the immediate-
        // sibling `is_git_repo_url` arm on the `:fonte :repo` axis
        // (a68f818) which closes the same byte under the same URL-
        // fragment-identifier banner.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia#readme".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellComment { byte: b'#', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_shell_comment() {
        // Leading-position `#` shape (`"#../caixa-teia"` — the
        // "I copied a shell-comment-out entry from a commented-out
        // dep row" footgun). Pinned separately from the embedded
        // shapes so the gate covers every position, not only
        // whitespace-preceded / mid-value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "#../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellComment { byte: b'#', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_shell_comment() {
        // The positive-control pin: the gate targets only `#`,
        // never adjacent printable ASCII or POSIX-valid bytes. The
        // canonical relative POSIX path (`"../caixa-teia"`) and a
        // nested deeply-pathed variant with adjacent printable
        // punctuation (`"../caixa-teia/sub-dir.v2"`) must continue
        // to validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface. Peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_quote_grouping`
        // on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_quote_grouping_fires_before_shell_comment() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `'` and `#` (`"../'x'#pin"` — the canonical
        // "I pasted a strong-quoted literal followed by a URL-
        // fragment permalink tail" footgun) routes through
        // `FonteCaminhoShellQuoteGrouping` not
        // `FonteCaminhoShellComment`. The shell-string-literal-
        // delimiter is the load-bearing root-cause edit on every
        // probe-as-both value; same cascade discipline every prior
        // `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../'x'#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellQuoteGrouping { byte: b'\'', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_bracket_expansion_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-bracket-expansion arm:
        // a value carrying both `[` and `#` (`"../[a-z]#pin"` — the
        // canonical "I pasted a glob-character-class followed by a
        // URL-fragment tail" footgun) routes through
        // `FonteCaminhoShellBracketExpansion` not
        // `FonteCaminhoShellComment`. The glob-character-class
        // expansion is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../[a-z]#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBracketExpansion { byte: b'[', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_brace_expansion_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-brace-expansion arm: a
        // value carrying both `{` and `#` (`"../{a,b}#pin"` — the
        // canonical "I pasted a brace-expansion fan followed by a
        // URL-fragment tail" footgun) routes through
        // `FonteCaminhoShellBraceExpansion` not
        // `FonteCaminhoShellComment`. The brace-expansion fan is the
        // load-bearing root-cause edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../{a,b}#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_subshell_grouping_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-subshell-grouping arm:
        // a value carrying both `(` and `#` (`"../(cd foo)#pin"` —
        // the canonical "I pasted a subshell-grouping followed by a
        // URL-fragment tail" footgun) routes through
        // `FonteCaminhoShellSubshellGrouping` not
        // `FonteCaminhoShellComment`. The modern Bourne `$(<cmd>)`
        // command-substitution boundary is the load-bearing axis on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../(cd foo)#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_glob_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-glob arm: a value
        // carrying both `*` and `#` (`"../caixa-teia/*#pin"` — the
        // canonical "I pasted a `*` unbounded pathname-expansion
        // followed by a URL-fragment tail" footgun) routes through
        // `FonteCaminhoShellGlob` not `FonteCaminhoShellComment`.
        // The unbounded pathname-expansion sentinel is the load-
        // bearing root-cause edit on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/*#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellGlob { byte: b'*', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_command_substitution_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-command-substitution
        // arm: a value carrying both a backtick and `#`
        // (``"../`whoami`#pin"`` — the canonical "I pasted a
        // legacy-backtick command-substitution followed by a URL-
        // fragment tail" footgun) routes through
        // `FonteCaminhoShellCommandSubstitution` not
        // `FonteCaminhoShellComment`. The CWE-78 shell-command-
        // injection vector is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../`whoami`#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellCommandSubstitution { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_background_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-background arm: a value
        // carrying both `&` and `#` (`"../caixa-teia&pin#tail"` —
        // the canonical "I pasted a `cmd &` background-launch
        // followed by a URL-fragment tail" footgun) routes through
        // `FonteCaminhoShellBackground` not
        // `FonteCaminhoShellComment`. The background-launch tail is
        // the load-bearing root-cause edit on every probe-as-both
        // value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia&pin#tail".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellBackground { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_semicolon_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-semicolon arm: a value
        // carrying both `;` and `#` (`"../caixa-teia;pin#tail"` —
        // the canonical sequential-cleanup + URL-fragment paste
        // idiom) routes through `FonteCaminhoShellSemicolon` not
        // `FonteCaminhoShellComment`. The sequential-command-
        // separator paste is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia;pin#tail".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellSemicolon { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_pipe_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-pipe arm: a value
        // carrying both `|` and `#` (`"../caixa-teia|pin#tail"` —
        // the canonical pipeline-to-URL-fragment paste idiom) routes
        // through `FonteCaminhoShellPipe` not
        // `FonteCaminhoShellComment`. The pipeline-tail paste is
        // the load-bearing root-cause edit on every probe-as-both
        // value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia|pin#tail".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellPipe { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_redirection_fires_before_shell_comment() {
        // Cascade pin on the upstream shell-redirection arm: a
        // value carrying both `>` and `#` (`"../caixa-teia>log#pin"`
        // — the canonical "I pasted a `cmd > log` redirect followed
        // by a URL-fragment tail" footgun) routes through
        // `FonteCaminhoShellRedirection` not
        // `FonteCaminhoShellComment`. The input/output redirection
        // metachar carries the more self-locating `byte` payload,
        // so the prior arm wins on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia>log#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellRedirection { byte: b'>', .. }
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_shell_comment() {
        // Cascade pin on the upstream backslash arm: a value
        // carrying both `\` and `#` (`"..\caixa-teia#pin"` — the
        // canonical "I pasted a Windows-shell path followed by a
        // URL-fragment tail" footgun) routes through
        // `FonteCaminhoBackslash` not `FonteCaminhoShellComment`.
        // The cross-host-OS-separator divergence is the load-
        // bearing axis on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa-teia#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_shell_comment() {
        // Cascade pin on the embedded-control-byte arm: a value
        // carrying both a control byte and `#` (`"../foo\n#pin"` —
        // the canonical paste-from-multiline-doc footgun where a
        // newline landed mid-caminho between the path and an
        // annotation) routes through `FonteCaminhoControlChar` not
        // `FonteCaminhoShellComment`. The POSIX-syscall-rejected-
        // byte diagnostic is the load-bearing axis on every value
        // that probes positive for both — mirrors the cascade
        // discipline on every prior arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo\n#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_shell_comment() {
        // Cascade pin on the load-bearing leading-byte arm: a
        // leading `/` value with embedded `#` (`"/etc/foo#pin"`)
        // routes through `FonteCaminhoAbsolute` not
        // `FonteCaminhoShellComment` — the host-layout-leak
        // diagnostic is the load-bearing axis, the fragment byte is
        // the secondary observation. Same precedence logic as every
        // prior leading-byte arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/foo#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_expansion_fires_before_shell_comment() {
        // Cascade pin on the upstream leading-`$` var-expansion
        // arm: a value carrying both a leading `$` and a `#`
        // (`"$DIR/foo#pin"` — the canonical "I pasted a `$DIR`
        // shell-variable at the head of a sibling-workspace path
        // followed by a URL-fragment tail" footgun) routes through
        // `FonteCaminhoVarExpansion` not `FonteCaminhoShellComment`.
        // The leading-byte shell-variable-expansion is the more
        // self-locating diagnostic on values that probe as both.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$DIR/foo#pin".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_comment_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both `#` and a trailing `/`
        // (`"../caixa-teia#pin/"` — the canonical "I tab-completed
        // a URL-fragment-carrying path" footgun) routes through
        // `FonteCaminhoShellComment` not
        // `FonteCaminhoTrailingSlash`. The embedded fragment /
        // comment-lead byte is the more semantic-locating axis (an
        // author who removes the `#pin` fragment typically also
        // drops the trailing separator since both are paste-from-
        // URL / paste-from-shell-tab-completion artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia#pin/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellComment { byte: b'#', .. },),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_comment_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_quote_grouping_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the immediate-predecessor arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the shell-comment / URL-fragment-identifier /
        // YAML-comment cross-config-DSL footgun explicitly so a
        // `feira lint` run can render the diagnostic without
        // re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia#readme".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia#readme"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x23"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("shell-comment") || rendered.contains("comment-lead"),
            "diagnostic must name the shell-comment footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("fragment") || rendered.contains("URL-fragment"),
            "diagnostic must reference the URL-fragment-identifier vocabulary: \
             {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_url_percent_encoded_space() {
        // The canonical paste-from-browser-address-bar percent-
        // encoded-space footgun: an author copies `../caixa%20teia`
        // out of a URL-encoded README hyperlink / browser address
        // bar / percent-encoded permalink expecting `%20` to decode
        // to a literal space at the filesystem layer. POSIX
        // `std::path::Path` treats `%` as a literal path-component
        // byte, so `Path::join` looks for a literal
        // `./../caixa%20teia` subdirectory. `Path::is_absolute`
        // returns false on `..`, `%` is neither a leading-byte
        // sentinel nor a control byte nor `\` nor `<` / `>` nor
        // `|` nor `;` nor `&` nor backtick nor `*` / `?` nor `(` /
        // `)` nor `{` / `}` nor `[` / `]` nor `'` / `"` nor `#`,
        // and the value's last byte isn't `/` — so the value
        // silently passed every prior arm. The new arm moves the
        // rejection to validate time and names the offending dep +
        // caminho + byte verbatim.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa%20teia".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoUrlPercentEncoding {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoUrlPercentEncoding, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa%20teia");
        assert_eq!(byte, b'%');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_url_percent_encoded_slash() {
        // The over-encoded path-separator shape (`"../caixa%2Fteia"`
        // intending the `%2F` as the URL encoding of `/`) locks a
        // `path:../caixa%2Fteia` BLAKE3 closure that diverges from
        // the byte-identical `path:../caixa/teia` form. Pinned
        // separately from the space-encoded shape so the gate's
        // coverage extends past the single canonical `%20` example
        // to any two-hex-digit percent-encoded sequence.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa%2Fteia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoUrlPercentEncoding { byte: b'%', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_lone_percent() {
        // The lone-`%` malformed-escape shape (`"../caixa-teia%foo"`
        // where `%` isn't followed by two hex digits) — every
        // WHATWG-conformant URL parser rejects the value at parse
        // time per RFC 3986 §2.1, but the byte would silently ride
        // into the lacre before the resolver subprocess crosses the
        // URL-parser boundary. Pinned separately from the well-
        // formed `%HH` shapes so the gate covers every percent-
        // occurrence, not only strictly-conformant escapes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia%foo".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoUrlPercentEncoding { byte: b'%', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_leading_yaml_directive() {
        // The YAML-directive-lead paste shape (`"%YAML/../caixa-teia"`
        // — the canonical paste-from-top-of-doc YAML directive
        // block cross-idiom leak per YAML 1.2 §6.8.1). Pinned
        // separately from embedded shapes so the gate covers the
        // leading-position `%` too, not only mid-value occurrences.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "%YAML/../caixa-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoUrlPercentEncoding { byte: b'%', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_printf_format_specifier() {
        // The printf-format-specifier paste shape
        // (`"../caixa-%s-teia"` — the canonical paste-from-shell-
        // diagnostic-one-liner `printf "path=%s\n" ...` idiom, CWE-
        // 134 format-string-injection vector). Pinned separately
        // from the URL-encoding shapes so the gate's rationale
        // extends past the RFC 3986 axis to the C / POSIX printf
        // format-directive-lead axis.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-%s-teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoUrlPercentEncoding { byte: b'%', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_percent() {
        // The positive-control pin: the gate targets only `%`,
        // never adjacent printable ASCII or POSIX-valid bytes. The
        // canonical relative POSIX path (`"../caixa-teia"`) and a
        // nested deeply-pathed variant with adjacent printable
        // punctuation (`"../caixa-teia/sub-dir.v2"`) must continue
        // to validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface. Peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_shell_comment`
        // on the immediate-predecessor arm.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_comment_fires_before_url_percent_encoding() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `#` and `%` (`"../caixa-teia#pin%20"` — the
        // canonical "I pasted a URL-fragment permalink followed by a
        // percent-encoded space tail" footgun) routes through
        // `FonteCaminhoShellComment` not
        // `FonteCaminhoUrlPercentEncoding`. The URL-fragment-
        // identifier is the load-bearing downstream-truncation edit
        // on every probe-as-both value; same cascade discipline
        // every prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia#pin%20".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoShellComment { byte: b'#', .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_quote_grouping_fires_before_url_percent_encoding() {
        // Cascade pin on the upstream shell-quote-grouping arm: a
        // value carrying both `'` and `%` (`"../'x'%20teia"` — the
        // canonical "I pasted a strong-quoted literal followed by
        // a percent-encoded space" footgun) routes through
        // `FonteCaminhoShellQuoteGrouping` not
        // `FonteCaminhoUrlPercentEncoding`. The shell-string-
        // literal-delimiter is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../'x'%20teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellQuoteGrouping { byte: b'\'', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_backslash_fires_before_url_percent_encoding() {
        // Cascade pin on the upstream backslash arm: a value
        // carrying both `\` and `%` (`"..\\caixa%20teia"` — the
        // canonical "I pasted a Windows-shell path followed by a
        // percent-encoded space" footgun) routes through
        // `FonteCaminhoBackslash` not
        // `FonteCaminhoUrlPercentEncoding`. The cross-host-OS-
        // separator divergence is the load-bearing root-cause edit
        // on every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "..\\caixa%20teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoBackslash { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_control_char_fires_before_url_percent_encoding() {
        // Cascade pin on the upstream control-char arm: a value
        // carrying both a NUL byte and `%` (`"../caixa\0%20teia"` —
        // the canonical "I pasted a paste-from-binary-blob path
        // followed by a percent-encoded space" footgun) routes
        // through `FonteCaminhoControlChar` not
        // `FonteCaminhoUrlPercentEncoding`. The POSIX-syscall-
        // rejected byte is the load-bearing root-cause edit on
        // every probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa\0%20teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoControlChar { byte: 0x00, .. },),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_absolute_fires_before_url_percent_encoding() {
        // Cascade pin on the upstream absolute-path arm: a value
        // that's both absolute and carries `%` (`"/etc/passwd%20"`
        // — the canonical "I pasted an absolute path with a
        // percent-encoded space tail" footgun) routes through
        // `FonteCaminhoAbsolute` not
        // `FonteCaminhoUrlPercentEncoding`. The host-layout-leak is
        // the load-bearing root-cause edit on every probe-as-both
        // value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "/etc/passwd%20".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoAbsolute { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_var_expansion_fires_before_url_percent_encoding() {
        // Cascade pin on the upstream var-expansion arm: a value
        // starting with `$` and carrying `%` (`"$HOME/caixa%20teia"`
        // — the canonical "I pasted a `$HOME`-rooted path with a
        // percent-encoded space" footgun) routes through
        // `FonteCaminhoVarExpansion` not
        // `FonteCaminhoUrlPercentEncoding`. The shell-variable-
        // expansion is the load-bearing root-cause edit on every
        // probe-as-both value.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$HOME/caixa%20teia".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_url_percent_encoding_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both `%` and a trailing `/`
        // (`"../caixa%20teia/"` — the canonical "I tab-completed a
        // percent-encoded-space-carrying path" footgun) routes
        // through `FonteCaminhoUrlPercentEncoding` not
        // `FonteCaminhoTrailingSlash`. The embedded percent-
        // encoding-escape byte is the more semantic-locating axis
        // (an author who decodes the `%20` to a literal space is
        // likely to also tab-strip the trailing separator since
        // both are paste-from-URL / paste-from-shell-tab-completion
        // artifacts).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa%20teia/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoUrlPercentEncoding { byte: b'%', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_url_percent_encoding_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_comment_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the immediate-predecessor arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the URL-percent-encoding-escape / printf-format-
        // specifier footgun explicitly so a `feira lint` run can
        // render the diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa%20teia".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa%20teia"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x25"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("percent-encoding") || rendered.contains("percent-encoded"),
            "diagnostic must name the URL-percent-encoding-escape footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("printf") || rendered.contains("format-specifier"),
            "diagnostic must reference the printf-format-specifier vocabulary: \
             {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_var_expansion() {
        // The canonical embedded-`$` shell-variable-expansion paste
        // shape (`"../foo$HOME/bar"` — an author copies a partially-
        // substituted shell one-liner where the leading segment is a
        // literal `../foo` while the mid segment carries the un-
        // substituted `$HOME` template). The leading-`$` position is
        // already gated by the f4efe9c leading-byte arm which routes
        // through `FonteCaminhoVarExpansion`; this arm closes the
        // last positional gap on `$` — every position on the axis is
        // structurally rejected.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo$HOME/bar".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellVariableExpansion {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellVariableExpansion, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../foo$HOME/bar");
        assert_eq!(byte, b'$');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_braced_var_expansion() {
        // The symmetric braced-CI-manifest paste shape
        // (`"../foo${WORKSPACE}/bar"` — the canonical paste-from-
        // GitHub-Actions-workflow / paste-from-`.gitlab-ci.yml`
        // footgun). Pinned separately from the bare-`$VAR` shape so
        // the gate covers both POSIX shell §2.6 Parameter Expansion
        // syntactic forms, not only the unbraced variant. The
        // embedded `{` byte in `${...}` is also caught by the 598b770
        // shell-brace-expansion arm but that arm fires earlier in
        // the cascade — the `$` arm's coverage extends to `${...}`
        // structurally, so the diagnostic asserted here is the
        // brace-expansion one (which is a valid outcome; the point
        // of the pin is that the value never survives validation).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo${WORKSPACE}/bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellBraceExpansion { byte: b'{', .. }
                    | DepError::FonteCaminhoShellVariableExpansion { byte: b'$', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_command_substitution() {
        // The paste-from-shell-prompt command-substitution idiom
        // (`"../foo$(whoami)/bar"`). Pinned separately from the bare-
        // `$VAR` shape so the gate's rationale extends to POSIX shell
        // §2.6.3 Command Substitution (the modern `$(<cmd>)` form; the
        // legacy `` `<cmd>` `` form is already closed by the c370458
        // backtick arm). The embedded `(` byte in `$(...)` is also
        // caught structurally by the 0633c91 shell-subshell-grouping
        // arm which fires earlier in the cascade — the diagnostic
        // asserted here is either outcome, since both structurally
        // reject the value; the point of the pin is that the value
        // never survives validation.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo$(whoami)/bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellSubshellGrouping { byte: b'(', .. }
                    | DepError::FonteCaminhoShellVariableExpansion { byte: b'$', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_embedded_positional_parameter() {
        // The paste-from-`Makefile` / paste-from-SQL-migration bare-
        // `$1` positional-parameter shape (`"../foo$1/bar"` — a Make
        // automatic-variable `$1` or a PostgreSQL bind-parameter `$1`
        // idiom copied into a caminho template). None of the prior
        // shell-metachar arms cover this shape (`1` is a bare digit;
        // no `(` / `{` / letter follows the `$`), so the arm is the
        // sole gate on the shape.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo$1/bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellVariableExpansion { byte: b'$', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_dollar() {
        // The positive-control pin (peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_percent`
        // on the immediate-predecessor arm): the gate targets only
        // `$`, never adjacent printable ASCII or POSIX-valid bytes.
        // A relative POSIX path carrying dashes / dots / slashes /
        // digits (`"../caixa-teia/sub-dir.v2"`) must continue to
        // validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_var_expansion_fires_before_shell_variable_expansion() {
        // Cascade pin on the leading-`$` sibling arm at line 540: a
        // value starting with `$` and carrying an embedded `$` too
        // (`"$HOME/foo$WORKSPACE/bar"` — the canonical "I pasted a
        // fully-templated CI path with two un-substituted variables")
        // routes through `FonteCaminhoVarExpansion` not
        // `FonteCaminhoShellVariableExpansion`. The leading-byte
        // host-layout-leak is the load-bearing self-locating axis
        // (the leading position dominates the semantic-locating
        // rationale on every probe-as-both value); the embedded
        // arm's positional-agnostic sweep catches only values whose
        // leading byte doesn't route through the earlier leading-
        // byte arms.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "$HOME/foo$WORKSPACE/bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteCaminhoVarExpansion { .. }),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_url_percent_encoding_fires_before_shell_variable_expansion() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both `%` and embedded `$` (`"../foo%20$HOME/bar"`
        // — the canonical "I pasted a percent-encoded space adjacent
        // to a `$HOME` template") routes through
        // `FonteCaminhoUrlPercentEncoding` not
        // `FonteCaminhoShellVariableExpansion`. The URL-percent-
        // encoding-escape byte is the more semantic-locating axis
        // (the paste-from-browser-address-bar shape is the load-
        // bearing self-locating edit); same cascade discipline every
        // prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo%20$HOME/bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoUrlPercentEncoding { byte: b'%', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_variable_expansion_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value
        // carrying both embedded `$` and a trailing `/`
        // (`"../foo$HOME/bar/"` — the canonical "I tab-completed a
        // `$HOME`-template-carrying path") routes through
        // `FonteCaminhoShellVariableExpansion` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-variable-
        // expansion byte is the more semantic-locating axis on
        // probe-as-both values (an author who substitutes the
        // `$HOME` template with a literal value is likely to also
        // tab-strip the trailing separator).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo$HOME/bar/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellVariableExpansion { byte: b'$', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_variable_expansion_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_url_percent_encoding_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the immediate-predecessor arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the shell-variable-expansion / command-substitution
        // footgun explicitly so a `feira lint` run can render the
        // diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo$HOME/bar".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../foo$HOME/bar"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x24"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("variable-expansion") || rendered.contains("variable expansion"),
            "diagnostic must name the shell-variable-expansion footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("command-substitution") || rendered.contains("command substitution"),
            "diagnostic must reference the command-substitution vocabulary: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_shell_history_expansion() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // shell-history footgun on `:caminho`. An author copies a `cd
        // ../caixa-teia && !sudo make install` one-liner from a quick-
        // start README, intending the trailing `!sudo` as a shell-
        // history-expansion reference but the typed slot is itself a
        // byte-level string parser, not a shell context, so the byte
        // rides into the value verbatim. Until this arm landed the `!`
        // byte silently passed every prior `:caminho` cascade arm
        // (`!` isn't `\` / `<` / `>` / `|` / `;` / `&` / backtick /
        // `*` / `?` / `(` / `)` / `{` / `}` / `[` / `]` / `'` / `"` /
        // `#` / `%` / `$`); bash with the default `histexpand` mode
        // rewrites `!command` to the most recent history entry
        // beginning with `command`, the canonical RCE-class injection
        // vector when the byte rides into a shell argument executed
        // under `bash -i` (the operator-notebook interactive shell).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia!sudo".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellHistoryExpansion {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellHistoryExpansion, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../caixa-teia!sudo");
        assert_eq!(byte, b'!');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_double_bang_history_reference() {
        // The symmetric `!!` repeat-prior-command paste idiom (peer with
        // `validate_rejects_git_fonte_with_repo_carrying_double_bang_history_reference`
        // on `is_git_repo_url`). Pinned separately from the wrapped
        // `!command` shape so a future diagnostic-surface change that
        // only checked the leading or paired-bang position surfaces
        // here — the per-byte arm fires anywhere `!` appears in the
        // value, including at consecutive positions in the middle.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo!!/bar".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellHistoryExpansion { byte: b'!', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_trailing_enthusiasm_bang() {
        // The English-typography enthusiasm-form paste-from-prose
        // idiom: an author writes `:caminho "../caixa-teia!"`
        // expecting the substrate to coerce it to a kebab-case slug.
        // Pinned separately from the `!<word>` shell-history shape so
        // the gate's rationale extends to the paste-from-prose surface
        // (the same rationale the peer `is_git_repo_url` bang arm at
        // 7d53c68 covers). None of the prior shell-metachar arms cover
        // this shape (no `!<word>` reference and no `!!` repeat), so
        // the arm is the sole gate on the shape.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia!".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellHistoryExpansion { byte: b'!', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_bang() {
        // The positive-control pin (peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_dollar`
        // on the immediate-predecessor arm): the gate targets only
        // `!`, never adjacent printable ASCII or POSIX-valid bytes.
        // A relative POSIX path carrying dashes / dots / slashes /
        // digits (`"../caixa-teia/sub-dir.v2"`) must continue to
        // validate cleanly so the gate doesn't widen to a "no
        // printable punctuation anywhere" sweep that would defeat
        // the entire path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub-dir.v2".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_variable_expansion_fires_before_shell_history_expansion() {
        // Cascade pin on the immediate-predecessor arm: a value
        // carrying both embedded `$` and `!` (`"../foo$HOME/bar!sudo"`
        // — the canonical "I pasted a `$HOME`-templated path adjacent
        // to a trailing `!sudo` history-expansion") routes through
        // `FonteCaminhoShellVariableExpansion` not
        // `FonteCaminhoShellHistoryExpansion`. The shell-variable-
        // expansion byte is the more semantic-locating axis on
        // probe-as-both values (the paste-from-CI-manifest-with-`$VAR`-
        // template shape is the load-bearing self-locating edit);
        // same cascade discipline every prior `:caminho` arm
        // establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo$HOME/bar!sudo".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellVariableExpansion { byte: b'$', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_history_expansion_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value carrying
        // both embedded `!` and a trailing `/` (`"../caixa-teia!sudo/"`
        // — the canonical "I tab-completed a `!sudo`-carrying path")
        // routes through `FonteCaminhoShellHistoryExpansion` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-history-
        // expansion byte is the more semantic-locating axis on probe-
        // as-both values (an author who removes the `!sudo` history
        // reference is likely to also tab-strip the trailing separator).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia!sudo/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellHistoryExpansion { byte: b'!', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_history_expansion_diagnostic_carries_offending_dep_caminho_and_byte() {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_variable_expansion_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the immediate-predecessor arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex / character form, and
        // names the shell-history-expansion / bang-operator footgun
        // explicitly so a `feira lint` run can render the diagnostic
        // without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia!sudo".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../caixa-teia!sudo"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x21"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("history-expansion") || rendered.contains("history expansion"),
            "diagnostic must name the shell-history-expansion footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("bang"),
            "diagnostic must reference the bang-operator vocabulary: {rendered:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_shell_history_substitution() {
        // The fail-before-pass-after pin for the canonical paste-from-
        // shell-history-quick-substitution footgun on `:caminho`. An
        // author copies a `git clone <bad-url>` line from their terminal,
        // corrects it via bash's `^bad^good` quick-substitution history
        // operator (bash reference §9.3, `set -o histexpand` mode's
        // default for interactive sessions), and pastes the trailing
        // `^bad^good` substitution fragment into a `:caminho` value
        // without trimming the leading `git clone` prefix — the byte
        // rides into the manifest verbatim. Until this arm landed the
        // `^` byte silently passed every prior `:caminho` cascade arm
        // (`^` isn't `\` / `<` / `>` / `|` / `;` / `&` / backtick / `*`
        // / `?` / `(` / `)` / `{` / `}` / `[` / `]` / `'` / `"` / `#` /
        // `%` / `$` / `!`); bash with the default `histexpand` mode
        // rewrites the prior command's `bad` string to `good` and re-
        // executes it, the paired-operator half of the `set -o
        // histexpand` feature the peer `!` arm already closes the prefix
        // half of. The peer `is_git_repo_url` axis rejects the byte at
        // 49e142f under the same shell-history-substitution / RFC-3986-
        // unwise banner.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo^bad^good".into(),
        });
        let err = d.validate().unwrap_err();
        let DepError::FonteCaminhoShellHistorySubstitution {
            nome,
            caminho,
            byte,
        } = err
        else {
            panic!("expected FonteCaminhoShellHistorySubstitution, got {err:?}");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(caminho, "../foo^bad^good");
        assert_eq!(byte, b'^');
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_regex_negation_anchor() {
        // The symmetric paste-from-doc-grep-pipeline footgun (peer with
        // `validate_rejects_git_fonte_with_repo_carrying_caret_regex_anchor`
        // on `is_git_repo_url`). An author copies a `grep '^archived'`
        // regex-anchor / negation idiom from a doc snippet and the byte
        // rides in verbatim. Pinned separately from the `^old^new^`
        // quick-substitution shape so a future diagnostic-surface change
        // that only checked the paired-caret history-substitution
        // position surfaces here — the per-byte arm fires anywhere `^`
        // appears in the value, including at a solitary leading-of-
        // segment position.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo/^archived".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellHistorySubstitution { byte: b'^', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_rejects_path_fonte_with_caminho_carrying_trailing_history_substitution_open() {
        // The trailing-`^` history-substitution-open shape — an author
        // starts typing a `^bad^good` quick-substitution but pastes only
        // the leading `^` sentinel before context-switching (a bash-
        // reference §9.3 valid histexpand prefix on its own — even a
        // solitary `^` on the prior command's whole re-execution shape).
        // Pinned separately from the `^old^new^` full-form and the leading-
        // of-segment `^archived` regex-anchor shape so the gate's
        // rationale extends to the paste-from-shell-history-with-only-
        // the-first-byte-selected surface. None of the prior shell-
        // metachar arms cover this shape.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia^".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellHistorySubstitution { byte: b'^', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn validate_accepts_path_fonte_with_caminho_carrying_no_caret() {
        // The positive-control pin (peer with
        // `validate_accepts_path_fonte_with_caminho_carrying_no_bang`
        // on the immediate-predecessor arm): the gate targets only
        // `^`, never adjacent printable ASCII or POSIX-valid bytes.
        // A relative POSIX path carrying dashes / dots / slashes /
        // digits / underscore (`"../caixa-teia/sub_v2.rc"`) must
        // continue to validate cleanly so the gate doesn't widen to
        // a "no printable punctuation anywhere" sweep that would
        // defeat the entire path-fonte author surface.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../caixa-teia/sub_v2.rc".into(),
        });
        d.validate().unwrap();
    }

    #[test]
    fn fonte_caminho_shell_history_expansion_fires_before_shell_history_substitution() {
        // Cascade pin on the immediate-predecessor arm: a value carrying
        // both embedded `!` and `^` (`"../foo!sudo^bad^good"` — the
        // canonical "I pasted a `!sudo` history-reference next to a
        // `^bad^good` quick-substitution") routes through
        // `FonteCaminhoShellHistoryExpansion` not
        // `FonteCaminhoShellHistorySubstitution`. The `!` prefix form is
        // the more semantic-locating axis on probe-as-both values (an
        // author who removes the `!sudo` reference is likely to also
        // strip the paired `^` substitution fragment); same cascade
        // discipline every prior `:caminho` arm establishes.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo!sudo^bad^good".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellHistoryExpansion { byte: b'!', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_history_substitution_fires_before_trailing_slash() {
        // Cascade pin on the immediate-successor arm: a value carrying
        // both embedded `^` and a trailing `/` (`"../foo^bad^good/"` —
        // the canonical "I tab-completed a `^bad^good`-carrying path")
        // routes through `FonteCaminhoShellHistorySubstitution` not
        // `FonteCaminhoTrailingSlash`. The embedded shell-history-
        // substitution byte is the more semantic-locating axis on probe-
        // as-both values (an author who removes the `^bad^good`
        // substitution fragment is likely to also tab-strip the trailing
        // separator).
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo^bad^good/".into(),
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::FonteCaminhoShellHistorySubstitution { byte: b'^', .. },
            ),
            "got {err:?}",
        );
    }

    #[test]
    fn fonte_caminho_shell_history_substitution_diagnostic_carries_offending_dep_caminho_and_byte()
    {
        // Diagnostic-shape pin (peer with
        // `fonte_caminho_shell_history_expansion_diagnostic_carries_offending_dep_caminho_and_byte`
        // on the immediate-predecessor arm): the error's Display
        // surfaces the offending `:nome`, the offending `:caminho`
        // verbatim, the offending byte's hex form, and names the
        // shell-history-substitution / RFC-3986-'unwise' / regex-
        // negation footgun explicitly so a `feira lint` run can render
        // the diagnostic without re-parsing.
        let d = dep_with_fonte(DepSource::Path {
            caminho: "../foo^bad^good".into(),
        });
        let rendered = d.validate().unwrap_err().to_string();
        assert!(
            rendered.contains("caixa-teia"),
            "diagnostic must name the offending dep: {rendered}",
        );
        assert!(
            rendered.contains("../foo^bad^good"),
            "diagnostic must quote the offending caminho verbatim: {rendered:?}",
        );
        assert!(
            rendered.contains("0x5e") || rendered.contains("0x5E"),
            "diagnostic must surface the offending byte hex: {rendered:?}",
        );
        assert!(
            rendered.contains("history-substitution") || rendered.contains("history substitution"),
            "diagnostic must name the shell-history-substitution footgun: {rendered:?}",
        );
        assert!(
            rendered.contains("unwise"),
            "diagnostic must reference the RFC-3986 'unwise' set vocabulary: {rendered:?}",
        );
    }

    #[test]
    fn fonte_repo_empty_fires_before_pin_missing() {
        // Order pin: empty `:repo` is the more self-locating diagnostic
        // (every git source needs a repo; the pin discussion is
        // secondary), so it fires before the pin-missing arm even when
        // both are violated. Mirrors the
        // `nome_empty_takes_precedence_over_versao_invalid` ordering
        // discipline on the per-entry layer.
        let d = dep_with_fonte(DepSource::Git {
            repo: String::new(),
            tag: None,
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::FonteRepoEmpty { .. }),
            "got {err:?}"
        );
    }

    #[test]
    fn fonte_pin_missing_fires_before_pin_empty() {
        // Order pin: a fully-None pin set is structurally distinct from
        // a Some(empty) pin — the first surfaces as FontePinMissing
        // (no axis chosen), the second as FontePinEmpty (axis chosen
        // but value blank). Pin the disjoint relationship so a future
        // unification collapses to one variant only as a structural
        // decision.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: None,
            branch: None,
        });
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::FontePinMissing { .. }
        ));
    }

    #[test]
    fn nome_empty_takes_precedence_over_fonte_invalid() {
        // Order pin: a per-entry diagnostic without a non-empty :nome
        // can't be self-locating, so :nome "" fires first even when
        // :fonte is also malformed. Mirrors
        // `nome_empty_takes_precedence_over_versao_invalid` on the
        // adjacent axis.
        let mut d = dep_with_fonte(DepSource::Git {
            repo: String::new(),
            tag: None,
            rev: None,
            branch: None,
        });
        d.nome = String::new();
        assert_eq!(d.validate().unwrap_err(), DepError::NomeEmpty);
    }

    #[test]
    fn versao_invalid_takes_precedence_over_fonte_invalid() {
        // Order pin: the :versao parse-side diagnostic is narrower than
        // the :fonte shape diagnostic — a malformed :versao always names
        // the parser's reason, which is more actionable than the
        // :fonte gate's "the pins are wrong" wording. Pin the ordering
        // so a re-ordering surfaces here.
        let mut d = dep_with_fonte(DepSource::Git {
            repo: String::new(),
            tag: None,
            rev: None,
            branch: None,
        });
        d.versao = "v0.1".into();
        let err = d.validate().unwrap_err();
        assert!(
            matches!(err, DepError::VersaoInvalid { ref nome, .. } if nome == "caixa-teia"),
            "got {err:?}"
        );
    }

    #[test]
    fn fonte_invalid_diagnostic_carries_offending_nome() {
        // The diagnostic-shape pin: every :fonte error variant names
        // the offending dep's :nome verbatim, so the author can grep
        // caixa.lisp for the `:nome "<n>"` block and fix it in one
        // edit. Cover all seven variants so a future variant addition
        // forces a parallel diagnostic-shape decision.
        for (case, fonte) in [
            (
                "repo-empty",
                DepSource::Git {
                    repo: String::new(),
                    tag: Some("v1".into()),
                    rev: None,
                    branch: None,
                },
            ),
            (
                "repo-shape",
                DepSource::Git {
                    repo: "github:p/x ".into(),
                    tag: Some("v1".into()),
                    rev: None,
                    branch: None,
                },
            ),
            (
                "pin-missing",
                DepSource::Git {
                    repo: "github:p/x".into(),
                    tag: None,
                    rev: None,
                    branch: None,
                },
            ),
            (
                "pin-ambiguous",
                DepSource::Git {
                    repo: "github:p/x".into(),
                    tag: Some("v1".into()),
                    rev: None,
                    branch: Some("main".into()),
                },
            ),
            (
                "pin-empty",
                DepSource::Git {
                    repo: "github:p/x".into(),
                    tag: Some(String::new()),
                    rev: None,
                    branch: None,
                },
            ),
            (
                "caminho-empty",
                DepSource::Path {
                    caminho: String::new(),
                },
            ),
            (
                "caminho-absolute",
                DepSource::Path {
                    caminho: "/home/me/work/caixa-teia".into(),
                },
            ),
        ] {
            let d = dep_with_fonte(fonte);
            let msg = d
                .validate()
                .expect_err(&format!("{case}: expected fonte error"))
                .to_string();
            assert!(
                msg.contains("\"caixa-teia\""),
                "{case}: diagnostic must quote the offending :nome verbatim, got {msg:?}"
            );
        }
    }

    // -- :tag / :branch value-shape gate ----------------------------------

    #[test]
    fn validate_rejects_git_fonte_with_tag_carrying_trailing_space() {
        // The canonical paste-from-doc footgun on `:tag` — author
        // copies `"v0.1.0 "` (trailing space) out of a release-notes
        // paragraph. Until this gate landed the empty-pin arm passed
        // (the string isn't empty), the resolver issued
        // `git fetch <remote> tag 'v0.1.0 '`, and the failure
        // surfaced at clone time with a quoting-confused git error
        // far from the source caixa.lisp. The new gate moves the
        // check to caixa-build time and names the offending dep +
        // pin + value verbatim.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0 ".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            nome,
            pin,
            value,
            reason,
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(pin, ":tag");
        assert_eq!(value, "v0.1.0 ");
        assert!(
            reason.contains("whitespace"),
            "reason must surface the whitespace arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_tag_carrying_lock_suffix() {
        // The `.lock` suffix is git's atomic-rename guard for
        // in-flight ref updates — a refname ending in `.lock` is
        // unwritable on disk. Pinned separately from the whitespace
        // arm so a future relaxation that admits one but not the
        // other surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0.lock".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":tag");
        assert_eq!(value, "v0.1.0.lock");
        assert!(
            reason.contains(".lock"),
            "reason must surface the .lock arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_branch_carrying_embedded_space() {
        // The canonical "branch name with spaces" footgun (`feature
        // foo`, `release branch`) — git's refname parser rejects raw
        // whitespace, and the failure surfaces at `git checkout
        // 'feature foo'` time with a quoting-confused error far from
        // the source caixa.lisp. Pinned on the `:branch` axis so the
        // gate-applies-to-both-:tag-and-:branch contract is a build-
        // error to relax.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: None,
            branch: Some("feature/foo bar".into()),
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":branch");
        assert_eq!(value, "feature/foo bar");
        assert!(
            reason.contains("whitespace"),
            "reason must surface the whitespace arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_branch_carrying_qualified_prefix() {
        // The `refs/heads/main` shape — the canonical "I copied the
        // fully-qualified ref out of `git show-ref` instead of the
        // leaf" footgun. The caixa-resolver prepends `refs/heads/`
        // at clone time, so this resolves to a literal ref named
        // `refs/heads/refs/heads/main` on disk; the silent double-
        // prefix is the load-bearing reason to gate at validate.
        // The diagnostic must enumerate the leaf the author probably
        // meant (`"main"`) so the fix is one edit.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: None,
            branch: Some("refs/heads/main".into()),
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":branch");
        assert_eq!(value, "refs/heads/main");
        assert!(
            reason.contains("fully-qualified"),
            "reason must surface the qualified-prefix arm, got {reason:?}"
        );
        assert!(
            reason.contains("\"main\""),
            "reason must quote the leaf the author probably meant, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_tag_carrying_qualified_prefix() {
        // Sibling arm of the qualified-prefix gate on the `:tag`
        // axis (`refs/tags/v0.1.0` — same `git show-ref` output-leak
        // footgun). Pinned separately so a future relaxation that
        // only catches the `:branch` arm surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("refs/tags/v0.1.0".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":tag");
        assert_eq!(value, "refs/tags/v0.1.0");
        assert!(
            reason.contains("fully-qualified"),
            "reason must surface the qualified-prefix arm, got {reason:?}"
        );
        assert!(
            reason.contains("\"v0.1.0\""),
            "reason must quote the leaf the author probably meant, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_branch_named_at() {
        // The bare `@` is git's alias for `HEAD`; a `:branch "@"` is
        // unsourceable. Pinned so a future relaxation that admits
        // any single-character refname surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: None,
            branch: Some("@".into()),
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape { pin, value, .. } = err else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":branch");
        assert_eq!(value, "@");
    }

    #[test]
    fn validate_rejects_git_fonte_with_tag_carrying_double_dot() {
        // Git's `<rev1>..<rev2>` range grammar reserves `..` —
        // a `:tag "../escape"` (path-traversal-shaped slug) silently
        // passes parse and surfaces as a refname-parse error or, on
        // older git, a literal `../escape` checkout that escapes the
        // refs/ directory tree. Pinned separately from the
        // qualified-prefix arm so a future relaxation that catches
        // one but not the other surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("../escape".into()),
            rev: None,
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape { pin, value, .. } = err else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":tag");
        assert_eq!(value, "../escape");
    }

    #[test]
    fn validate_accepts_git_fonte_with_hierarchical_branch() {
        // The positive-control pin: hierarchical refnames with one or
        // more `/` separators (the `feature/foo` / `user/jdoe/feat`
        // canonical idiom) round-trip through the gate. Pinned
        // separately from the leaf-`"main"` positive control so a
        // future tightening that rejects all multi-component refnames
        // surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: None,
            branch: Some("feature/checkout-rewrite".into()),
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_accepts_git_fonte_with_prerelease_tag() {
        // The positive-control pin: semver pre-release shape
        // (`v0.1.0-alpha.1`) — the in-component dot is allowed
        // (only consecutive `..` and trailing `.` are rejected), the
        // mid-component hyphen is allowed. Pinned separately from
        // the bare-`"v0.1.0"` positive control so a future tightening
        // that rejects pre-release tags surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0-alpha.1".into()),
            rev: None,
            branch: None,
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_rejects_git_fonte_with_rev_carrying_refname_unfriendly_value() {
        // The `:rev` axis is routed through `crate::render::is_git_oid`
        // (a SHA's character set is `[0-9a-f]`, not a refname's), so a
        // value with refname-shape punctuation (here, a `:` mid-string
        // — would be a refname violation under `is_git_ref_name` too)
        // is rejected at the OID-shape gate. The two predicates
        // partition the `:fonte` pin axes structurally: an `:rev` value
        // that's a valid refname (`:rev "main"`, `:rev "v0.1.0"`) is
        // *still* rejected here because every refname character outside
        // `[0-9a-f]` fails the OID gate. Same shape as
        // `fonte_pin_shape_diagnostic_carries_offending_nome_pin_value`
        // on the refname-shaped axes — the diagnostic names the
        // offending dep + pin + value verbatim. The flip-from-accept
        // case the prior `:tag`/`:branch` gate left as a "future axis"
        // (e70d213) — now landed.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("c0ffee:notarefname".into()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            nome,
            pin,
            value,
            reason,
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(nome, "caixa-teia");
        assert_eq!(pin, ":rev");
        assert_eq!(value, "c0ffee:notarefname");
        assert!(
            !reason.is_empty(),
            "FontePinShape `reason` must carry the predicate's wording verbatim"
        );
    }

    #[test]
    fn validate_accepts_git_fonte_with_rev_full_sha1() {
        // The positive-control pin on the SHA-1 OID width: exactly 40
        // lowercase hex characters — the canonical `git rev-parse HEAD`
        // emission on a SHA-1-hashed repository (the default on every
        // pre-2.42 git and the canonical pleme-io substrate hash).
        // Pinned separately from the SHA-256 positive control so a
        // future tightening that only admits one width surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("0123456789abcdef0123456789abcdef01234567".into()),
            branch: None,
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_accepts_git_fonte_with_rev_full_sha256() {
        // The positive-control pin on the SHA-256 OID width: exactly
        // 64 lowercase hex characters — `git`'s
        // `extensions.objectFormat = sha256` emission (GA since Git
        // 2.42 / Oct 2023). The substrate admits either canonical
        // width so an `:rev` authored against a SHA-256-hashed
        // upstream round-trips through the gate without per-repo
        // configuration. Pinned separately from the SHA-1 positive
        // control so a future tightening that drops one width surfaces
        // here as a structural decision.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef".into()),
            branch: None,
        });
        d.validate().unwrap();
    }

    #[test]
    fn validate_rejects_git_fonte_with_rev_abbreviated_prefix() {
        // The canonical `git log --short` / `git rev-parse --short HEAD`
        // paste-from-release-notes footgun: a 7-char prefix (git's
        // default `core.abbrev`) silently passes string emptiness
        // checks and resolves to one commit today, but becomes ambiguous
        // tomorrow as the repo grows. Until this gate landed the empty-
        // pin arm passed (the string isn't empty) and the resolver
        // accepted the prefix through git's separate prefix-lookup pass
        // — defeating the reproducibility contract `:rev` carries vs.
        // `:tag` / `:branch`. The new gate moves the check to caixa-
        // build time and names the offending dep + pin + value verbatim.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("c0ffee0".into()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":rev");
        assert_eq!(value, "c0ffee0");
        assert!(
            reason.contains("abbreviated") || reason.contains("ambiguous"),
            "reason must surface the abbreviation arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_rev_uppercase_hex() {
        // The canonical "I pasted the SHA in uppercase" footgun: `git
        // porcelain` emits OIDs lowercase exclusively, so an uppercase-
        // bearing `:rev` round-trips inconsistently across the
        // resolver's `git fetch <remote> <:rev>` ↔ `git rev-parse HEAD`
        // equality-check pipeline and fails the lacre's content-
        // addressing probe with a confusing case-only diff. Pinned
        // separately from the non-hex arm so a future relaxation that
        // admits one but not the other surfaces here.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("DEADBEEFCAFEBABE0123456789ABCDEF01234567".into()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":rev");
        assert_eq!(value, "DEADBEEFCAFEBABE0123456789ABCDEF01234567");
        assert!(
            reason.contains("uppercase"),
            "reason must surface the uppercase arm, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_rev_refname_value() {
        // The cross-axis mis-slot footgun: `:rev "main"` — the author
        // conflated `:rev` (hex commit ID, immutable) and `:branch`
        // (mutable ref pointing at whatever HEAD is today). Until this
        // gate landed the resolver silently dispatched on the value
        // shape ("`main` doesn't look like a SHA, fall back to
        // refname"), defeating the `:rev` reproducibility contract.
        // The new gate rejects every non-hex value on the `:rev` axis,
        // so the `:rev`/`:branch` boundary is structurally enforced —
        // a refname in the `:rev` slot is a build error, not a
        // resolver-time silent reinterpretation.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("main".into()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":rev");
        assert_eq!(value, "main");
        // 4 chars `main` fails the length arm before the character arm,
        // so the diagnostic surfaces the abbreviation wording (same
        // path the `c0ffee0` 7-char fixture lands on); the structural
        // assertion is just that the `:rev "main"` value is rejected.
        assert!(
            !reason.is_empty(),
            "FontePinShape reason must be non-empty for refname-shaped :rev"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_rev_tag_shaped_value() {
        // Sibling cross-axis mis-slot: `:rev "v0.1.0"` — the author
        // conflated `:rev` and `:tag`. Pinned separately from the
        // `:rev "main"` (`:branch` mis-slot) arm so a future relaxation
        // that catches one but not the other surfaces here. The
        // length arm fires first (6 chars ≠ 40 ≠ 64); the structural
        // assertion is just that the cross-axis mis-slot is a build
        // error, regardless of which sub-arm surfaces the diagnostic
        // (`is_git_oid` rejects at the first violation; longer
        // tag-shape values would hit the non-hex arm instead).
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some("v0.1.0".into()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":rev");
        assert_eq!(value, "v0.1.0");
        assert!(
            !reason.is_empty(),
            "FontePinShape reason must be non-empty for tag-shaped :rev"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_rev_too_long() {
        // Boundary case on the upper end: 41 hex chars — one past the
        // SHA-1 width, well below the SHA-256 width. Pin so a future
        // relaxation that admits "long enough to be a SHA" without
        // matching either canonical width surfaces here. The diagnostic
        // names the offending length verbatim so the author's grep
        // target is unambiguous (either trim one char or paste the
        // full SHA-256).
        let too_long: String = "0".repeat(41);
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some(too_long.clone()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":rev");
        assert_eq!(value, too_long);
        assert!(
            reason.contains("41"),
            "reason must surface the offending length verbatim, got {reason:?}"
        );
    }

    #[test]
    fn validate_rejects_git_fonte_with_rev_carrying_whitespace() {
        // The canonical paste-from-doc footgun on `:rev` — author
        // copies `"deadbeefcafe…0123 "` (trailing space) out of a
        // commit-message paragraph. Until this gate landed the empty-
        // pin arm passed (the string isn't empty), the resolver issued
        // `git fetch <remote> 'deadbeef… '` and the failure surfaced at
        // clone time with a quoting-confused git error far from the
        // source caixa.lisp. The new gate moves the check to caixa-
        // build time. Length is 41 (40 hex + space) so the length arm
        // fires first — pinned separately from the pure-length arm to
        // ensure the diagnostic surfaces *some* parser wording, not
        // silently pass through.
        let with_space = "0123456789abcdef0123456789abcdef01234567 ".to_string();
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: None,
            rev: Some(with_space.clone()),
            branch: None,
        });
        let err = d.validate().unwrap_err();
        let DepError::FontePinShape {
            pin, value, reason, ..
        } = err
        else {
            panic!("expected FontePinShape, got other variant");
        };
        assert_eq!(pin, ":rev");
        assert_eq!(value, with_space);
        assert!(
            !reason.is_empty(),
            "FontePinShape reason must be non-empty for whitespace-bearing :rev"
        );
    }

    #[test]
    fn fonte_pin_shape_diagnostic_carries_offending_nome_pin_value_for_rev() {
        // Diagnostic-shape pin on the `:rev` axis: every FontePinShape
        // variant on this axis names the offending dep's `:nome` + the
        // `:rev` axis + the offending value verbatim, so the author's
        // grep target is the literal `:rev "<value>"` block in
        // caixa.lisp. Sibling of the `fonte_pin_shape_diagnostic_
        // carries_offending_nome_pin_value` test on the refname-shaped
        // (`:tag` / `:branch`) axes.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:p/x".into(),
            tag: None,
            rev: Some("not-a-sha".into()),
            branch: None,
        });
        let msg = d
            .validate()
            .expect_err(":rev: expected FontePinShape")
            .to_string();
        assert!(
            msg.contains("\"caixa-teia\""),
            ":rev: diagnostic must quote the offending :nome verbatim, got {msg:?}"
        );
        assert!(
            msg.contains(":rev"),
            ":rev: diagnostic must name the offending pin axis, got {msg:?}"
        );
        assert!(
            msg.contains("not-a-sha"),
            ":rev: diagnostic must quote the offending value verbatim, got {msg:?}"
        );
    }

    #[test]
    fn fonte_pin_empty_fires_before_pin_shape() {
        // Order pin: a `Some("")` `:tag` is the more self-locating
        // diagnostic (the author chose an axis but left it blank;
        // grep is unambiguous), so it fires before the shape gate
        // even when both arms would match. Pinned so a future
        // reordering surfaces here. Mirrors the
        // `fonte_repo_empty_fires_before_pin_missing` ordering
        // discipline on the peer per-axis arms.
        let d = dep_with_fonte(DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some(String::new()),
            rev: None,
            branch: None,
        });
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::FontePinEmpty { ref pin, .. } if pin == ":tag"
        ));
    }

    #[test]
    fn fonte_pin_shape_fires_after_repo_empty() {
        // Order pin: `:repo ""` is the more self-locating axis
        // (every git source needs a repo; the per-pin shape gate is
        // secondary), so the repo-empty arm fires before the
        // per-pin shape arm even when both are violated. Pinned so
        // a future reordering surfaces here. Mirrors
        // `fonte_repo_empty_fires_before_pin_missing` on the
        // adjacent axis pair.
        let d = dep_with_fonte(DepSource::Git {
            repo: String::new(),
            tag: Some("v0.1.0 ".into()),
            rev: None,
            branch: None,
        });
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::FonteRepoEmpty { .. }
        ));
    }

    #[test]
    fn fonte_pin_shape_diagnostic_carries_offending_nome_pin_value() {
        // Diagnostic-shape pin across both refname-shaped axes
        // (`:tag` + `:branch`): every `FontePinShape` variant names
        // the offending dep's `:nome` + the offending pin axis + the
        // offending value verbatim, so the author's grep target is
        // unambiguous (the literal `:tag "<value>"` / `:branch
        // "<value>"` lands in caixa.lisp with quotes). Cover both
        // pin axes so a future variant addition forces a parallel
        // diagnostic-shape decision.
        for (pin_label, fonte) in [
            (
                ":tag",
                DepSource::Git {
                    repo: "github:p/x".into(),
                    tag: Some("v0.1.0~1".into()),
                    rev: None,
                    branch: None,
                },
            ),
            (
                ":branch",
                DepSource::Git {
                    repo: "github:p/x".into(),
                    tag: None,
                    rev: None,
                    branch: Some("feature/foo*".into()),
                },
            ),
        ] {
            let d = dep_with_fonte(fonte);
            let msg = d
                .validate()
                .expect_err(&format!("{pin_label}: expected FontePinShape"))
                .to_string();
            assert!(
                msg.contains("\"caixa-teia\""),
                "{pin_label}: diagnostic must quote the offending :nome verbatim, got {msg:?}"
            );
            assert!(
                msg.contains(pin_label),
                "{pin_label}: diagnostic must name the offending pin axis, got {msg:?}"
            );
        }
    }

    #[test]
    fn git_source_json_round_trip() {
        let src = DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        };
        let s = serde_json::to_string(&src).unwrap();
        assert!(s.contains(&format!(
            r#""{tipo}":"{git}""#,
            tipo = crate::render::DEP_SOURCE_KEY_TIPO,
            git = crate::render::DEP_SOURCE_TIPO_GIT,
        )));
        assert!(s.contains(r#""repo":"github:pleme-io/caixa-teia""#));
        assert!(s.contains(r#""tag":"v0.1.0""#));
        assert!(!s.contains("rev"));
        assert!(!s.contains("branch"));
        let round: DepSource = serde_json::from_str(&s).unwrap();
        assert_eq!(round, src);
    }

    // ── DEP_SOURCE_{KEY_TIPO,TIPO_GIT,TIPO_PATH} drift-detection ────────
    //
    // The `#[serde(tag = "tipo", rename_all = "lowercase")]` derive
    // attribute on [`DepSource`] pins three load-bearing byte-sequences
    // that flow into every serialized `Dep.fonte` block: the outer
    // discriminator-key `"tipo"` the `tag = "tipo"` attribute names, and
    // the two admitted variant-tag values `"git"` / `"path"` the
    // `rename_all = "lowercase"` attribute pins as the discriminator's
    // closed-set arms. The three pin tests below round-trip a
    // fully-populated variant of each arm through
    // [`serde_json::to_value`] and assert each canonical byte-sequence
    // appears at its axis — pins a hypothetical future
    // `tag = "type"` / `tag = "source_type"` typo, a `rename_all`
    // rebrand (`"UPPERCASE"` / `"snake_case"` / `"kebab-case"`), or a
    // Rust-side variant rename (`Git` → `Repository`, `Path` → `Local`)
    // at build time rather than at fetch time when the resolver's
    // `Dep.fonte` dispatch silently fails to match on the drifted
    // discriminator. Same "serialize-and-check" discipline the peer
    // `M2_LIMITS_KEY_*`, `M2_BEHAVIOR_KEY_ON_*`, `SUPERVISOR_KEY_*`,
    // and `MEMBRO_KEY_*` drift-detection pins carry — extended here
    // to the last `#[serde(tag = ..., rename_all = ...)]` discriminator
    // family in caixa-core lacking a lifted peer.

    #[test]
    fn dep_source_git_serde_keys_match_lifted_dep_source_key_consts() {
        // Fail-before-pass-after: a future `tag = "type"` at the derive
        // attribute would serialize under `"type":"git"`, and this test
        // would trip because `"tipo"` no longer appears at the emitted
        // discriminator key. A future `rename_all = "kebab-case"` /
        // `"snake_case"` (both no-ops on `Git` since it lacks internal
        // word boundaries) is caught by the sibling
        // `dep_source_path_serde_keys_match_lifted_dep_source_key_consts`
        // pin below (Path has no internal boundary either but the pair
        // catches any per-arm inconsistency). A future variant rename
        // `Git` → `Repository` would emit `"tipo":"repository"` and
        // trip this pin.
        let src = DepSource::Git {
            repo: "github:pleme-io/caixa-teia".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        };
        let json = serde_json::to_value(&src).unwrap();
        let obj = json.as_object().expect("Git serializes as a JSON object");
        assert_eq!(
            obj.get(crate::render::DEP_SOURCE_KEY_TIPO)
                .and_then(serde_json::Value::as_str),
            Some(crate::render::DEP_SOURCE_TIPO_GIT),
            "DepSource::Git must serialize the tipo discriminator at DEP_SOURCE_KEY_TIPO \
             with value DEP_SOURCE_TIPO_GIT — attribute drift or variant rename \
             detected in {json}"
        );
    }

    #[test]
    fn dep_source_path_serde_keys_match_lifted_dep_source_key_consts() {
        // Fail-before-pass-after: a future variant rename `Path` →
        // `Local` / `Filesystem` would emit `"tipo":"local"` and trip
        // this pin. A per-consumer disambiguation as the `defcaixa`
        // macro stabilizes ("caminho" → "path" for English-uniformity)
        // is scoped to the inner field key, not the discriminator; this
        // pin is orthogonal to that and catches only the outer
        // discriminator drift.
        let src = DepSource::Path {
            caminho: "../caixa-teia".into(),
        };
        let json = serde_json::to_value(&src).unwrap();
        let obj = json.as_object().expect("Path serializes as a JSON object");
        assert_eq!(
            obj.get(crate::render::DEP_SOURCE_KEY_TIPO)
                .and_then(serde_json::Value::as_str),
            Some(crate::render::DEP_SOURCE_TIPO_PATH),
            "DepSource::Path must serialize the tipo discriminator at DEP_SOURCE_KEY_TIPO \
             with value DEP_SOURCE_TIPO_PATH — attribute drift or variant rename \
             detected in {json}"
        );
    }

    #[test]
    fn dep_source_key_consts_are_pairwise_distinct() {
        // Cross-axis collapse detector: a hypothetical future edit that
        // accidentally set two of the three consts to the same byte
        // (`DEP_SOURCE_TIPO_GIT = "path"` typo matching a peer arm) would
        // pass every per-arm serialize pin above but silently collapse
        // the discriminator's closed-set arms onto one another; this pin
        // catches the collapse at build time.
        assert_ne!(
            crate::render::DEP_SOURCE_KEY_TIPO,
            crate::render::DEP_SOURCE_TIPO_GIT,
        );
        assert_ne!(
            crate::render::DEP_SOURCE_KEY_TIPO,
            crate::render::DEP_SOURCE_TIPO_PATH,
        );
        assert_ne!(
            crate::render::DEP_SOURCE_TIPO_GIT,
            crate::render::DEP_SOURCE_TIPO_PATH,
        );
    }

    #[test]
    fn dep_source_tipo_variant_consts_are_ascii_lowercase_shape() {
        // Shape pin against `rename_all` drift: the two variant-tag
        // consts must be ASCII-lowercase-only to match the
        // `rename_all = "lowercase"` attribute the derive uses; a future
        // rebrand to `"UPPERCASE"` / `"PascalCase"` at the attribute
        // would emit `"GIT"` / `"Git"` instead and trip this pin.
        for (label, s) in [
            ("DEP_SOURCE_TIPO_GIT", crate::render::DEP_SOURCE_TIPO_GIT),
            ("DEP_SOURCE_TIPO_PATH", crate::render::DEP_SOURCE_TIPO_PATH),
        ] {
            assert!(!s.is_empty(), "{label} must not be empty");
            assert!(
                s.bytes().all(|b| b.is_ascii_lowercase()),
                "{label} must be ASCII-lowercase-only (matching \
                 rename_all = \"lowercase\"), got {s:?}",
            );
        }
    }

    // ── per-entry :caracteristicas set-not-multiset gate ────────────
    //
    // Every Vec-keyed-by-name authoring surface on the typed Caixa
    // surface that identifies its entries by a name field now uniformly
    // closes the set-not-multiset discipline at build time (cite
    // `validate_caracteristicas`'s peer-axis enumeration). The
    // `:caracteristicas` axis is per-`Dep`: the feature-toggle slot is
    // set-shaped (a feature is either enabled or not — there is no
    // `feature × 2` semantic), so two entries naming the same feature
    // are a redundant declaration the caixa-resolver's lacre pipeline
    // would silently dedup at resolve time. The empty-feature arm
    // closes the parallel "operationally-meaningless value" axis on
    // the same slot. Same linear-walk + `HashSet` + first-collision
    // shape every peer set gate uses; same empty-first cascade every
    // peer per-entry shape + duplicate gate uses (the empty-feature
    // axis is the more-actionable defect since two `""` entries would
    // both report `caracteristica: ""` under a duplicate-first
    // ordering, with no way to distinguish the offending site).

    fn dep_with_features(features: &[&str]) -> Dep {
        Dep {
            nome: "caixa-teia".into(),
            versao: "^0.1".into(),
            fonte: None,
            opcional: false,
            caracteristicas: features.iter().map(|s| (*s).into()).collect(),
        }
    }

    #[test]
    fn validate_rejects_empty_caracteristica() {
        // Fail-before-pass-after pin: every pre-gate codebase accepted
        // `(:caracteristicas (""))` cleanly (the `Vec<String>` field
        // imposed no per-entry shape contract), the dep validated, and
        // the empty feature would have reached the future caixa-resolver
        // lacre pipeline as a no-op feature enable — silently dropping
        // the author's intent far from the source `caixa.lisp`. The new
        // gate surfaces the structural defect at the typed-validate
        // surface with a self-locating diagnostic naming the offending
        // dep's `:nome`.
        let d = dep_with_features(&[""]);
        assert!(
            matches!(d.validate().unwrap_err(), DepError::CaracteristicaEmpty { ref nome } if nome == "caixa-teia"),
            "expected CaracteristicaEmpty, got {:?}",
            d.validate(),
        );
    }

    #[test]
    fn validate_rejects_duplicate_caracteristica() {
        // Fail-before-pass-after pin on the set-not-multiset arm: the
        // feature-toggle slot is set-shaped, so `(:caracteristicas
        // ("http" "http"))` is a redundant declaration the lacre
        // pipeline dedupes silently at resolve time. The diagnostic
        // names the offending dep + the colliding feature verbatim so
        // the author can grep their caixa.lisp for `:caracteristicas`
        // and fix it in one edit. First-collision determinism is
        // pinned separately below.
        let d = dep_with_features(&["http", "http"]);
        assert!(
            matches!(
                d.validate().unwrap_err(),
                DepError::CaracteristicaDuplicate { ref nome, ref caracteristica }
                    if nome == "caixa-teia" && caracteristica == "http"
            ),
            "expected CaracteristicaDuplicate, got {:?}",
            d.validate(),
        );
    }

    #[test]
    fn validate_accepts_distinct_caracteristicas() {
        // The canonical authoring shape — every feature distinct — must
        // remain a clean pass (positive control sweep). Covers the
        // canonical kebab-case feature names a target caixa typically
        // declares.
        dep_with_features(&["http", "json", "tls"])
            .validate()
            .unwrap();
    }

    #[test]
    fn validate_accepts_single_caracteristica() {
        // Single-element list is the minimum non-empty shape; passes
        // the gate as the identity of the duplicate check (no second
        // entry to collide with).
        dep_with_features(&["http"]).validate().unwrap();
    }

    #[test]
    fn validate_accepts_empty_caracteristicas_list() {
        // The bare-dep authoring shape (`Dep::simple` / `Dep::git`)
        // produces `caracteristicas: Vec::new()`; the empty list is
        // the gate's empty-set identity and passes vacuously. Pin
        // this so a future tightening that requires ≥1 feature
        // surfaces here as a test failure rather than a silent
        // contract narrowing.
        Dep::simple("caixa-teia", "^0.1").validate().unwrap();
        assert!(dep_with_features(&[]).validate().is_ok());
    }

    #[test]
    fn validate_caracteristica_empty_fires_before_duplicate() {
        // Empty-first cascade: an entry with an empty feature *and*
        // duplicate entries surfaces the empty diagnostic first. The
        // empty-feature axis is the more-actionable defect since
        // `caracteristica: ""` is unambiguous; under duplicate-first
        // ordering the diagnostic could report the empty string from
        // either of two empty entries with no way to distinguish.
        // Mirrors the peer empty-before-duplicate ordering
        // discipline every per-entry shape + duplicate gate establishes
        // (`SupervisorSpec::validate`'s `EmptyChildName` arm before
        // `DuplicateChildCaixa`, `validate_membros`'s
        // `MembroCaixaEmpty` arm before `MembroDuplicate`).
        let d = dep_with_features(&["", "http", "http"]);
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::CaracteristicaEmpty { .. }
        ));
    }

    #[test]
    fn validate_caracteristica_duplicate_first_collision_determinism() {
        // Three matching entries: the second occurrence surfaces the
        // diagnostic (the second is the first *collision* — the first
        // entry is the establishing one, not a duplicate). Mirrors
        // every peer first-collision posture
        // (`SupervisorError::DuplicateChildCaixa` reports the second
        // collision, `AplicacaoError::MembroDuplicate` reports the
        // second, `DepError::DuplicateNome` reports the second).
        // Pinning this so a future shortcut that flips to last-
        // collision (or non-deterministic) surfaces here.
        let d = dep_with_features(&["http", "http", "http"]);
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::CaracteristicaDuplicate { ref caracteristica, .. } if caracteristica == "http"
        ));
    }

    #[test]
    fn validate_per_entry_shape_fires_before_caracteristicas() {
        // Per-entry shape precedence: a dep with a malformed `:nome`
        // (uppercase) AND duplicate `:caracteristicas` surfaces the
        // narrower `NomeInvalid` diagnostic first, not the set-gate
        // diagnostic. The `:nome` is the self-locating axis (every
        // diagnostic from the caracteristicas gate quotes the
        // offending dep's `:nome` to anchor the grep target —
        // surfacing the malformed name first keeps that anchor
        // valid). Same precedence shape every peer per-entry-shape
        // arm establishes against its peer set-gate
        // (`validate_deps_per_entry_validate_fires_before_duplicate_in_deps`
        // on the cross-entry `:nome` axis).
        let d = Dep {
            nome: "Caixa-Teia".into(), // uppercase — DNS-1123 violation
            versao: "^0.1".into(),
            fonte: None,
            opcional: false,
            caracteristicas: vec!["http".into(), "http".into()],
        };
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::NomeInvalid { .. }
        ));
    }

    // ── per-entry :caracteristicas value-shape gate ──────────────────
    //
    // Until this gate landed `:caracteristicas` only refused the empty
    // string and cross-entry duplicates: a non-empty distinct but
    // structurally invalid feature name silently passed validate and the
    // failure surfaced at `cargo metadata` time as Cargo's
    // `restricted_names::validate_feature_name` parser rejection, far from
    // the source `caixa.lisp` with no field naming which `:deps` entry's
    // `:caracteristicas` carried the typo. The lifted predicate makes the
    // Cargo-feature-name-grammar intersection-floor a substrate-level
    // invariant at validate time. Same trajectory as the eight peer
    // value-shape predicates each typed surface downstream of a structured
    // grammar already follows.

    #[test]
    fn validate_rejects_caracteristica_with_leading_plus() {
        // Fail-before-pass-after pin on the canonical Cargo
        // `+<feature>` activation-form-in-feature-name-slot footgun.
        // Cargo's `[dependencies.<dep>.features]` list grammar accepts
        // `+optional-feature` as an enablement of a previously-disabled
        // feature; pasting that activation form into `:caracteristicas`
        // (which names the feature itself) silently passed pre-gate and
        // failed at `cargo metadata` parse time.
        let d = dep_with_features(&["+http"]);
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::CaracteristicaInvalid { ref nome, ref caracteristica, .. }
                    if nome == "caixa-teia" && caracteristica == "+http"
            ),
            "expected CaracteristicaInvalid, got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_caracteristica_with_leading_hyphen() {
        // Fail-before-pass-after pin on the leading-hyphen footgun. `-`
        // is a legitimate continuation character (kebab-case feature
        // names like `runtime-tokio` pass) but Cargo rejects it at the
        // start; the structural defect — and its CLI-argument-injection
        // adjacency at any downstream Cargo subprocess invocation — is
        // closed at validate time, not at `cargo metadata` time.
        let d = dep_with_features(&["-json"]);
        let err = d.validate().unwrap_err();
        assert!(
            matches!(
                err,
                DepError::CaracteristicaInvalid { ref caracteristica, .. } if caracteristica == "-json"
            ),
            "expected CaracteristicaInvalid, got {err:?}"
        );
    }

    #[test]
    fn validate_rejects_caracteristica_with_leading_dot() {
        // Fail-before-pass-after pin on the leading-dot footgun. `.` is
        // a legitimate continuation character (version-suffix shapes
        // like `feat.v2` pass) but the leading-dot form is the
        // canonical dotted-version-suffix-as-feature-name confusion.
        let d = dep_with_features(&[".feat"]);
        let err = d.validate().unwrap_err();
        assert!(matches!(
            err,
            DepError::CaracteristicaInvalid { ref caracteristica, .. } if caracteristica == ".feat"
        ));
    }

    #[test]
    fn validate_rejects_caracteristica_with_whitespace() {
        // Fail-before-pass-after pin on the embedded-whitespace footgun:
        // a feature name with a space inside is structurally a multi-
        // token blob (the canonical paste-from-doc footgun, or an
        // accidental `"http server"` where the author meant
        // `"http-server"`).
        let d = dep_with_features(&["http feature"]);
        let err = d.validate().unwrap_err();
        assert!(matches!(
            err,
            DepError::CaracteristicaInvalid { ref caracteristica, .. } if caracteristica == "http feature"
        ));
    }

    #[test]
    fn validate_rejects_caracteristica_with_comma() {
        // Fail-before-pass-after pin on the embedded-comma footgun:
        // the list-separator-belongs-to-the-list-grammar
        // miscomprehension where the author writes
        // `:caracteristicas ("http,json")` intending two features but
        // the `Vec<String>` field consumes the bare token as one entry.
        let d = dep_with_features(&["http,json"]);
        let err = d.validate().unwrap_err();
        assert!(matches!(
            err,
            DepError::CaracteristicaInvalid { ref caracteristica, .. } if caracteristica == "http,json"
        ));
    }

    #[test]
    fn validate_rejects_caracteristica_with_slash() {
        // Fail-before-pass-after pin on the embedded-slash footgun:
        // Cargo's `dep/feat` namespaced-dep syntax applies inside
        // `[dependencies.<dep>.features]` list entries that already
        // name the parent dep (so the syntax says "enable feature
        // `feat` on a transitive dep `dep`"); `:caracteristicas` is
        // per-dep already (a sibling slot on the `Dep` itself), so the
        // segment separator within an entry must be `-`, `_`, `+`,
        // or `.`. The diagnostic remediation points at the canonical
        // Cargo namespaced-dep discipline.
        let d = dep_with_features(&["http/json"]);
        let err = d.validate().unwrap_err();
        assert!(matches!(
            err,
            DepError::CaracteristicaInvalid { ref caracteristica, .. } if caracteristica == "http/json"
        ));
    }

    #[test]
    fn validate_rejects_caracteristica_with_non_ascii() {
        // Fail-before-pass-after pin on the un-percent-encoded non-ASCII
        // byte footgun: NFC-vs-NFD normalization across filesystems
        // silently rewrites the feature-key, breaking the lacre's
        // content-addressing invariant. Pinned at a canonical
        // smart-quote-paste shape (`café`) where the raw `é` byte is the
        // documented APFS round-trip break.
        let d = dep_with_features(&["caf\u{e9}"]);
        let err = d.validate().unwrap_err();
        assert!(matches!(
            err,
            DepError::CaracteristicaInvalid { ref caracteristica, .. } if caracteristica == "caf\u{e9}"
        ));
    }

    #[test]
    fn validate_rejects_caracteristica_with_control_character() {
        // Fail-before-pass-after pin on the embedded-control-character
        // footgun: a CR/LF or any 0x00..0x1F / 0x7F byte landing in a
        // feature name is the canonical paste-from-multiline-doc
        // footgun the predicate's reason wording specifically calls out.
        let d = dep_with_features(&["http\njson"]);
        let err = d.validate().unwrap_err();
        assert!(matches!(err, DepError::CaracteristicaInvalid { .. }));
    }

    #[test]
    fn validate_accepts_canonical_caracteristicas_shapes() {
        // Positive control sweep: every canonical Cargo feature name
        // shape the pleme-io ecosystem uses must still pass. Mirrors
        // the substrate-side `cargo_feature_name_accepts_canonical_forms`
        // sweep — drift between either landing site and the predicate's
        // accepted set is a build error visible at this pair of tests,
        // not a per-renderer "this passed validate but failed at
        // cargo metadata time" surprise on the next acceptance.
        for s in [
            "http",
            "json",
            "derive",
            "serde_json",
            "runtime-tokio",
            "tokio.full",
            "v0.1",
            "http+json",
            "_internal",
            "__private",
            "default",
            "rt-multi-thread",
            "feat.v2",
        ] {
            let d = dep_with_features(&[s]);
            d.validate().unwrap_or_else(|e| {
                panic!("canonical Cargo feature name {s:?} must pass validate: {e:?}")
            });
        }
    }

    #[test]
    fn validate_caracteristica_empty_fires_before_invalid() {
        // Cascade precedence pin: an entry list with both an empty
        // feature AND an invalid-shape feature surfaces the
        // `CaracteristicaEmpty` arm first (the empty value carries no
        // self-locating data — `caracteristica: ""` is the diagnostic
        // with no way to anchor a grep target — so closing the empty
        // axis first preserves the per-entry-shape diagnostic's
        // self-locating discipline). Same empty-first cascade every
        // peer per-entry shape gate establishes
        // (`SupervisorSpec::validate`'s `EmptyChildName` before
        // `ChildCaixaInvalid`, `validate_membros`'s `MembroCaixaEmpty`
        // before `MembroCaixaInvalid`).
        let d = dep_with_features(&["", "+http"]);
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::CaracteristicaEmpty { .. }
        ));
    }

    #[test]
    fn validate_caracteristica_invalid_fires_before_duplicate() {
        // Per-entry-shape precedence pin: an entry list with the same
        // invalid feature shape declared twice surfaces the
        // `CaracteristicaInvalid` diagnostic on the first entry, not
        // the `CaracteristicaDuplicate` on the second collision. The
        // per-entry shape gate fires before the cross-entry set gate
        // — same precedence shape every peer two-arm-plus-set gate
        // establishes (`SupervisorSpec::validate`'s
        // `ChildCaixaInvalid` before `DuplicateChildCaixa`,
        // `validate_membros`'s `MembroCaixaInvalid` before
        // `MembroDuplicate`, `Dep::validate`'s `NomeInvalid` before
        // cross-list `DuplicateNome`).
        let d = dep_with_features(&["+http", "+http"]);
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::CaracteristicaInvalid { ref caracteristica, .. } if caracteristica == "+http"
        ));
    }

    #[test]
    fn validate_rejects_caracteristica_at_65_byte_boundary() {
        // Boundary pin on the 64-byte cap — both the boundary-accepting
        // case and the boundary-exceeding case in one place, so a
        // future cap shift surfaces both arms simultaneously, mirroring
        // the peer `cargo_feature_name_rejects_at_65_byte_boundary`
        // predicate-level pin at the dep-axis landing site.
        let max_ok = "a".repeat(64);
        dep_with_features(&[&max_ok])
            .validate()
            .unwrap_or_else(|e| panic!("64-byte feature name must pass: {e:?}"));
        let too_long = "a".repeat(65);
        let d = dep_with_features(&[&too_long]);
        assert!(matches!(
            d.validate().unwrap_err(),
            DepError::CaracteristicaInvalid { .. }
        ));
    }

    // ── self-dep cross-slot gate ─────────────────────────────────────

    #[test]
    fn validate_no_self_dep_rejects_self_in_deps() {
        // A caixa whose `:deps` lists its own `:nome` is a one-node
        // cycle in the lacre closure's dep-graph traversal — rejected,
        // naming the parent and the offending list tag.
        let deps = vec![
            Dep::simple("caixa-teia", "^0.1"),
            Dep::simple("orquestra", "^0.1"),
        ];
        let err = validate_no_self_dep(&deps, &[], "orquestra").unwrap_err();
        assert!(
            matches!(err, DepError::DepIsSelf { ref nome, list } if nome == "orquestra" && list == crate::render::DEP_AUTHOR_KEY_DEPS),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_no_self_dep_rejects_self_in_deps_dev() {
        // Same gate on the `:deps-dev` axis — neither dep list is a
        // second-class citizen on the self-edge invariant.
        let deps_dev = vec![Dep::simple("orquestra", "^0.1")];
        let err = validate_no_self_dep(&[], &deps_dev, "orquestra").unwrap_err();
        assert!(
            matches!(err, DepError::DepIsSelf { ref nome, list } if nome == "orquestra" && list == crate::render::DEP_AUTHOR_KEY_DEPS_DEV),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_no_self_dep_deps_fires_before_deps_dev() {
        // Walk order pin: a caixa that self-references on both lists
        // surfaces the `:deps` arm first — the load-bearing axis the
        // lacre closure resolves at every build. Mirrors the canonical
        // [`Caixa::validate_deps`] cascade (`:deps` → `:deps-dev`).
        let deps = vec![Dep::simple("orquestra", "^0.1")];
        let deps_dev = vec![Dep::simple("orquestra", "^0.2")];
        let err = validate_no_self_dep(&deps, &deps_dev, "orquestra").unwrap_err();
        assert!(
            matches!(err, DepError::DepIsSelf { ref nome, list } if nome == "orquestra" && list == crate::render::DEP_AUTHOR_KEY_DEPS),
            "got {err:?}"
        );
    }

    #[test]
    fn validate_no_self_dep_accepts_distinct_names() {
        // Positive control: every dep names a distinct caixa. The
        // canonical author surface — peer of
        // [`validate_no_self_supervision_accepts_distinct_children`].
        let deps = vec![
            Dep::simple("caixa-teia", "^0.1"),
            Dep::simple("caixa-arch", "^0.1"),
        ];
        let deps_dev = vec![Dep::simple("caixa-test", "^0.1")];
        validate_no_self_dep(&deps, &deps_dev, "orquestra").unwrap();
    }

    #[test]
    fn validate_no_self_dep_empty_lists_pass() {
        // A caixa with no declared deps has nothing to self-reference —
        // the gate is vacuously satisfied. Peer of
        // [`validate_no_self_supervision_empty_children_is_ok`].
        validate_no_self_dep(&[], &[], "orquestra").unwrap();
    }

    #[test]
    fn validate_no_self_dep_diagnostic_carries_offending_list_and_nome() {
        // Diagnostic-shape pin (peer with
        // [`validate_no_self_supervision`]'s diagnostic): the error's
        // Display surfaces both the offending list tag and the
        // parent's `:nome` verbatim, so the author can grep their
        // caixa.lisp for the offending block in one edit. Names
        // `:bibliotecas` / `:exe` / `:servicos` as the corrective
        // surface — every legitimate "I want to use code from this
        // caixa" intent routes through one of those three slots.
        let deps_dev = vec![Dep::simple("orquestra", "^0.1")];
        let rendered = validate_no_self_dep(&[], &deps_dev, "orquestra")
            .unwrap_err()
            .to_string();
        assert!(
            rendered.contains(crate::render::DEP_AUTHOR_KEY_DEPS_DEV),
            "diagnostic must name the offending list tag: {rendered}",
        );
        assert!(
            rendered.contains("orquestra"),
            "diagnostic must quote the parent caixa name: {rendered}",
        );
        assert!(
            rendered.contains(":bibliotecas"),
            "diagnostic must point at the corrective code-surface slot: {rendered}",
        );
    }

    #[test]
    fn validate_no_self_dep_accepts_coincidental_substring_match() {
        // Identity is exact-string equality, not substring — a dep
        // named `"orquestra-helper"` is a distinct caixa even when the
        // parent is `"orquestra"`. Pin the exact-match discipline so a
        // future relaxation that uses `contains` surfaces here, peer
        // with the supervision-tree and Aplicacao-membership gates
        // which all use exact-string equality on the typed identity.
        let deps = vec![Dep::simple("orquestra-helper", "^0.1")];
        validate_no_self_dep(&deps, &[], "orquestra").unwrap();
    }

    // ── drift-detection: DEP_AUTHOR_KEY_{DEPS,DEPS_DEV} pin ─────────────

    #[test]
    fn dep_author_key_consts_pin_canonical_kebab_case_labels() {
        // Scalar-value pin: the two author-facing kebab-case labels the
        // `(defcaixa … :deps ((…)) :deps-dev ((…)))` surface admits on
        // the two-list dep-graph slot axis, one arm per typed slot.
        // Mirrors the peer scalar-value pin the sibling
        // [`crate::M2_AUTHOR_KEY_LIMITS`] /
        // [`crate::M2_AUTHOR_KEY_BEHAVIOR`] /
        // [`crate::M2_AUTHOR_KEY_UPGRADE_FROM`] (f49c8b0) M2 top-level
        // author-labels, [`crate::M3_AUTHOR_KEY_MEMBROS`] etc.
        // (882f498) M3 top-level author-labels, and
        // [`crate::SUPERVISOR_AUTHOR_KEY_ESTRATEGIA`] etc. (be40492)
        // Supervisor top-level author-labels carry, so every kind-scoped
        // typed-slot-family axis routes through one canonical per-arm
        // declaration.
        //
        // A future rebrand (`:deps` → `:dependencies` matching Cargo's
        // verbatim key, `:deps-dev` → `:dev-dependencies` matching the
        // same, `:deps` / `:deps-dev` → `:runtime-deps` / `:dev-deps`
        // for symmetry) lands as an edit to exactly one const, and
        // every consumer that reaches for the label picks it up at
        // build time rather than at runtime as a downstream mismatch on
        // a `DepError::DuplicateNome { list: … }` diagnostic far from
        // the rename's commit.
        assert_eq!(crate::render::DEP_AUTHOR_KEY_DEPS, ":deps");
        assert_eq!(crate::render::DEP_AUTHOR_KEY_DEPS_DEV, ":deps-dev");
    }

    #[test]
    fn dep_author_key_consts_are_pairwise_distinct() {
        // Distinct-labels pin: the two `:deps` / `:deps-dev` labels
        // must not collapse onto one byte-string. A future copy-paste
        // slip that renamed both consts to the same value (or a rebrand
        // that dropped the `-dev` suffix from one but not the other)
        // would leave every `DepError::DuplicateNome { list: … }`
        // diagnostic naming an unattributable list — the linter would
        // route the author to the wrong caixa.lisp block, or the
        // cross-list precedence gate
        // (`validate_deps_duplicate_in_deps_fires_before_duplicate_in_deps_dev`)
        // would surface a `:deps`-tagged diagnostic on a `:deps-dev`
        // duplicate. Peer of the sibling
        // `m2_author_key_consts_are_pairwise_distinct`-shape gates the
        // other top-level kind-scoped slot-family axes carry
        // (implicitly held by their different byte-values today).
        assert_ne!(
            crate::render::DEP_AUTHOR_KEY_DEPS,
            crate::render::DEP_AUTHOR_KEY_DEPS_DEV,
            "DEP_AUTHOR_KEY_{{DEPS,DEPS_DEV}} consts must be pairwise-distinct \
             so a `DepError::DuplicateNome {{ list: … }}` diagnostic \
             self-locates the offending block in the author's caixa.lisp",
        );
    }

    #[test]
    fn validate_no_self_dep_routes_through_lifted_dep_author_key_consts() {
        // Production-through-const pin: the two per-arm list tags
        // [`validate_no_self_dep`] threads onto the `list:` field of a
        // returned [`DepError::DepIsSelf`] route through the lifted
        // [`crate::DEP_AUTHOR_KEY_DEPS`] /
        // [`crate::DEP_AUTHOR_KEY_DEPS_DEV`] consts. A future drift at
        // the walker (a rename that reaches one arm but not the const,
        // or vice versa) surfaces here at build time rather than at
        // runtime as a `feira lint` diagnostic naming the wrong list
        // tag. Mirror of the peer
        // [`crate::Caixa::declared_servico_slots`] production tagger
        // pin (f49c8b0) on the sibling M2 top-level slot axis, extended
        // onto the two-list dep-graph gate.
        let deps = vec![Dep::simple("orquestra", "^0.1")];
        let err = validate_no_self_dep(&deps, &[], "orquestra").unwrap_err();
        let DepError::DepIsSelf { list, .. } = err else {
            panic!("expected DepIsSelf from :deps walk");
        };
        assert_eq!(list, crate::render::DEP_AUTHOR_KEY_DEPS);

        let deps_dev = vec![Dep::simple("orquestra", "^0.1")];
        let err = validate_no_self_dep(&[], &deps_dev, "orquestra").unwrap_err();
        let DepError::DepIsSelf { list, .. } = err else {
            panic!("expected DepIsSelf from :deps-dev walk");
        };
        assert_eq!(list, crate::render::DEP_AUTHOR_KEY_DEPS_DEV);
    }

    // ── Dep::nome accessor pins ───────────────────────────────────────
    //
    // Three coherence pins on the lifted `Dep::nome` accessor: byte-equal
    // projection over the plain-shorthand / explicit-git / explicit-path
    // fixture triad the [`Dep`] docstring lists (so the accessor's
    // accept-set is exercised across every author-surface `:fonte`
    // shape); by-borrow pointer identity so the projection stays
    // zero-copy at every consumer site; and validate-composition through
    // the [`validate_no_self_dep`] cross-slot gate reading its
    // parent-name equality check through the lifted accessor rather than
    // the raw field.

    #[test]
    fn dep_nome_returns_declared_nome_across_fonte_shapes() {
        // Plain-shorthand form (`:fonte None`).
        assert_eq!(Dep::simple("caixa-teia", "^0.1").nome(), "caixa-teia");
        // Explicit git-source form with a tag pin — same accessor path.
        assert_eq!(
            Dep::git("caixa-teia", "^0.1", "github:pleme-io/caixa-teia", "v0.1.0").nome(),
            "caixa-teia",
        );
        // Explicit path-source form.
        assert_eq!(
            Dep {
                nome: "caixa-teia".to_string(),
                versao: "0.1.0".to_string(),
                fonte: Some(DepSource::Path {
                    caminho: "../caixa-teia".to_string(),
                }),
                opcional: false,
                caracteristicas: Vec::new(),
            }
            .nome(),
            "caixa-teia",
        );
        // The empty-string `:nome` sentinel (which [`Dep::validate`]
        // refuses through the [`DepError::NomeEmpty`] arm) still round-
        // trips as an empty `&str` through the accessor — the accessor is
        // a projection, not a gate; the gate is [`Dep::validate`].
        assert_eq!(Dep::simple("", "^0.1").nome(), "");
    }

    #[test]
    fn dep_nome_is_by_borrow_pointer_identity() {
        // Zero-copy pin: the accessor must borrow into the field's own
        // storage, not clone. If a future rewrite regresses to
        // `self.nome.clone().leak()` or an owned-buffer shape, the two
        // pointers diverge and this pin fails at build time.
        let d = Dep::simple("caixa-teia", "^0.1");
        assert!(std::ptr::eq(d.nome().as_ptr(), d.nome.as_ptr()));
    }

    // ── Dep::versao_requirement accessor pins ─────────────────────────
    //
    // Three coherence pins on the lifted `Dep::versao_requirement`
    // accessor: byte-equal projection over the plain-shorthand /
    // explicit-git / explicit-path fixture triad the [`Dep`] docstring
    // lists plus the empty-sentinel that round-trips as `""` (the accessor
    // is a projection, not a gate; the gate is [`Dep::validate`]); by-
    // borrow pointer identity so the projection stays zero-copy at every
    // consumer site; and validate-composition through the
    // [`crate::render::require_valid_versao_requirement`] cascade reading
    // its requirement-shape check through the lifted accessor rather than
    // the raw field.
    #[test]
    fn dep_versao_requirement_returns_declared_versao_across_fonte_shapes() {
        // Plain-shorthand form (`:fonte None`).
        assert_eq!(
            Dep::simple("caixa-teia", "^0.1").versao_requirement(),
            "^0.1",
        );
        // Explicit git-source form with a tag pin — same accessor path.
        assert_eq!(
            Dep::git(
                "caixa-teia",
                "~0.1.2",
                "github:pleme-io/caixa-teia",
                "v0.1.0"
            )
            .versao_requirement(),
            "~0.1.2",
        );
        // Explicit path-source form.
        assert_eq!(
            Dep {
                nome: "caixa-teia".to_string(),
                versao: "0.1.0".to_string(),
                fonte: Some(DepSource::Path {
                    caminho: "../caixa-teia".to_string(),
                }),
                opcional: false,
                caracteristicas: Vec::new(),
            }
            .versao_requirement(),
            "0.1.0",
        );
        // The wildcard requirement (`"*"`) — the shorthand
        // `parse_requirement` accepts as `VersionReq::STAR` — round-trips
        // verbatim through the accessor as `"*"`, same byte-shape the
        // author wrote.
        assert_eq!(Dep::simple("caixa-teia", "*").versao_requirement(), "*");
        // The empty-string `:versao` sentinel (which [`Dep::validate`]
        // refuses through the [`DepError::VersaoEmpty`] arm) still round-
        // trips as an empty `&str` through the accessor — the accessor is
        // a projection, not a gate; the gate is [`Dep::validate`]. Peer
        // of the sibling [`Dep::nome`] empty-sentinel round-trip pin.
        assert_eq!(Dep::simple("caixa-teia", "").versao_requirement(), "");
    }

    #[test]
    fn dep_versao_requirement_is_by_borrow_pointer_identity() {
        // Zero-copy pin: the accessor must borrow into the field's own
        // storage, not clone. If a future rewrite regresses to
        // `self.versao.clone().leak()` or an owned-buffer shape, the two
        // pointers diverge and this pin fails at build time. Peer of the
        // sibling [`Dep::nome`] pointer-identity pin — same by-borrow
        // discipline extended onto the requirement-carrying axis.
        let d = Dep::simple("caixa-teia", "^0.1");
        assert!(std::ptr::eq(
            d.versao_requirement().as_ptr(),
            d.versao.as_ptr(),
        ));
    }

    #[test]
    fn dep_validate_reads_requirement_through_accessor() {
        // Composition pin: the [`Dep::validate`]
        // [`crate::render::require_valid_versao_requirement`] cascade
        // consumes the requirement string through the lifted accessor —
        // both the requirement-gate input and the
        // [`DepError::VersaoInvalid`] error-body carrier route through
        // `self.versao_requirement()`. A valid requirement passes
        // (positive control); a malformed-but-non-empty requirement fails
        // and the diagnostic quotes the offending byte-string verbatim
        // (same shape the accessor projects), so a future regression that
        // detoured the requirement carrier through a different byte-
        // string (say the parsed `VersionReq`'s `Display`, or a
        // normalized rewrite) would surface here at build time. The
        // empty-`:versao` arm fires the [`DepError::VersaoEmpty`] variant
        // ahead of the parse arm, pinning the empty-first cascade the
        // accessor's `""` sentinel round-trip acknowledges.
        Dep::simple("caixa-teia", "^0.1").validate().unwrap();
        let err = Dep::simple("caixa-teia", "v0.1").validate().unwrap_err();
        assert!(
            matches!(
                &err,
                DepError::VersaoInvalid {
                    nome,
                    versao,
                    ..
                } if nome == "caixa-teia" && versao == "v0.1",
            ),
            "expected VersaoInvalid quoting the accessor-projected requirement, got {err:?}",
        );
        let err = Dep::simple("caixa-teia", "").validate().unwrap_err();
        assert!(
            matches!(
                &err,
                DepError::VersaoEmpty { nome } if nome == "caixa-teia",
            ),
            "expected VersaoEmpty from the empty-first arm, got {err:?}",
        );
    }

    // ── Dep::fonte accessor pins ──────────────────────────────────────
    //
    // Three coherence pins on the lifted `Dep::fonte` accessor: byte-
    // equal projection over the plain-shorthand (`:fonte None`) /
    // explicit-git-tag / explicit-path fixture triad the [`Dep`]
    // docstring lists (so the accessor's accept-set is exercised across
    // every author-surface `:fonte` shape and both `DepSource` variants);
    // pointer identity so the borrowed reference points into the field's
    // own `Option<DepSource>` storage (not a cloned side-buffer); and
    // validate-composition through the [`Dep::validate`] gate reading
    // its per-`:fonte` [`DepSource::validate`] delegation through the
    // lifted accessor rather than the raw `if let Some(ref fonte) =
    // self.fonte` bracket.

    #[test]
    fn dep_fonte_returns_declared_source_across_shapes() {
        // Plain-shorthand form — `:fonte` omitted, accessor projects
        // the `None` partition the resolver-side default-fill treats
        // as "resolve through `github:<default-org>/<nome>`".
        assert!(Dep::simple("caixa-teia", "^0.1").fonte().is_none());
        // Explicit git-source form with a tag pin — same accessor path.
        let git = Dep::git("caixa-teia", "^0.1", "github:pleme-io/caixa-teia", "v0.1.0");
        match git.fonte() {
            Some(DepSource::Git {
                repo,
                tag,
                rev,
                branch,
            }) => {
                assert_eq!(repo, "github:pleme-io/caixa-teia");
                assert_eq!(tag.as_deref(), Some("v0.1.0"));
                assert!(rev.is_none());
                assert!(branch.is_none());
            }
            other => panic!("expected explicit git :fonte, got {other:?}"),
        }
        // Explicit path-source form — the dev-only local-filesystem
        // arm the [`Dep`] docstring's third fixture carries.
        let path = Dep {
            nome: "caixa-teia".to_string(),
            versao: "0.1.0".to_string(),
            fonte: Some(DepSource::Path {
                caminho: "../caixa-teia".to_string(),
            }),
            opcional: false,
            caracteristicas: Vec::new(),
        };
        match path.fonte() {
            Some(DepSource::Path { caminho }) => {
                assert_eq!(caminho, "../caixa-teia");
            }
            other => panic!("expected explicit path :fonte, got {other:?}"),
        }
    }

    #[test]
    fn dep_fonte_is_by_borrow_pointer_identity() {
        // Zero-copy pin: the accessor must borrow into the field's own
        // `Option<DepSource>` storage, not clone into a side buffer. If
        // a future rewrite regresses to `self.fonte.clone()` or an
        // owned-buffer shape, the two pointers diverge and this pin
        // fails at build time. Peer of the sibling per-`Dep` [`Dep::nome`]
        // (eba2cde) / [`Dep::versao_requirement`] (05529b1) pointer-
        // identity pins — same by-borrow discipline extended onto the
        // outer-`Dep` `Option<&Composite>` composite-reference axis.
        let d = Dep::git("caixa-teia", "^0.1", "github:pleme-io/caixa-teia", "v0.1.0");
        let accessed = d.fonte().expect("git :fonte present") as *const DepSource;
        let raw = d.fonte.as_ref().expect("git :fonte present") as *const DepSource;
        assert!(std::ptr::eq(accessed, raw));
    }

    #[test]
    fn dep_validate_reads_fonte_through_accessor() {
        // Composition pin: [`Dep::validate`]'s per-`:fonte`
        // [`DepSource::validate`] delegation consumes the typed slot
        // through the lifted accessor — an author-omitted `:fonte`
        // still passes the outer gate (positive control), an explicit
        // well-formed git source with exactly one pin passes, and a
        // malformed git source (empty `:repo`) surfaces the
        // [`DepError::FonteRepoEmpty`] variant quoting the offending
        // dep's `:nome` verbatim so a future regression that detoured
        // the `:fonte` delegation through a different path (say a
        // per-scope override projector) would surface here at build
        // time. Peer of the sibling
        // `dep_validate_reads_requirement_through_accessor` composition
        // pin on the `:versao` axis.
        // Positive control 1: no `:fonte` at all.
        Dep::simple("caixa-teia", "^0.1").validate().unwrap();
        // Positive control 2: well-formed git source.
        Dep::git("caixa-teia", "^0.1", "github:pleme-io/caixa-teia", "v0.1.0")
            .validate()
            .unwrap();
        // Negative control: empty `:repo` — the accessor still returns
        // `Some(&DepSource::Git { repo: "", … })` and the delegated
        // `DepSource::validate` gate raises the typed carrier.
        let bad = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: Some(DepSource::Git {
                repo: String::new(),
                tag: Some("v0.1.0".to_string()),
                rev: None,
                branch: None,
            }),
            opcional: false,
            caracteristicas: Vec::new(),
        };
        let err = bad.validate().unwrap_err();
        assert!(
            matches!(
                &err,
                DepError::FonteRepoEmpty { nome } if nome == "caixa-teia",
            ),
            "expected FonteRepoEmpty from the accessor-routed :fonte gate, got {err:?}",
        );
    }

    #[test]
    fn validate_no_self_dep_reads_parent_equality_through_accessor() {
        // Composition pin: the cross-slot [`validate_no_self_dep`] gate
        // rejects a `:deps` entry whose `:nome` equals the parent caixa's
        // own `:nome` through the lifted accessor rather than the raw
        // field. Fails-before-passes-after: with the accessor lifted the
        // gate reads its equality check through `dep.nome() ==
        // parent_nome` on both the `:deps` and `:deps-dev` traversals, so
        // the diagnostic still names the offending list tag as expected.
        let deps = vec![Dep::simple("orquestra", "^0.1")];
        let err = validate_no_self_dep(&deps, &[], "orquestra").unwrap_err();
        assert!(matches!(
            err,
            DepError::DepIsSelf {
                ref nome,
                list,
            } if nome == "orquestra" && list == crate::render::DEP_AUTHOR_KEY_DEPS,
        ));
        let deps_dev = vec![Dep::simple("orquestra", "^0.1")];
        let err = validate_no_self_dep(&[], &deps_dev, "orquestra").unwrap_err();
        assert!(matches!(
            err,
            DepError::DepIsSelf {
                ref nome,
                list,
            } if nome == "orquestra" && list == crate::render::DEP_AUTHOR_KEY_DEPS_DEV,
        ));
        // A non-matching `:nome` passes through the accessor gate.
        let deps = vec![Dep::simple("caixa-teia", "^0.1")];
        validate_no_self_dep(&deps, &[], "orquestra").unwrap();
    }

    // ── Dep::caracteristicas accessor pins ────────────────────────────
    //
    // Three coherence pins on the lifted `Dep::caracteristicas` accessor:
    // byte-equal projection over the default-empty / single-entry /
    // multi-entry fixture triad (so the accessor's accept-set is
    // exercised across every author-surface `:caracteristicas` shape,
    // matching the peer sibling family's fixture-triad discipline); by-
    // borrow pointer identity so the projection stays zero-copy at every
    // consumer site; and validate-composition through the
    // [`Dep::validate_caracteristicas`] gate reading its per-entry
    // linear walk through the lifted accessor rather than the raw
    // `for c in &self.caracteristicas` bracket.

    #[test]
    fn dep_caracteristicas_returns_declared_features_across_shapes() {
        // Default-empty form — the [`Dep::simple`] constructor's
        // `Vec::new()` fill; the accessor projects the empty slice
        // verbatim (no `None` collapse).
        assert!(
            Dep::simple("caixa-teia", "^0.1")
                .caracteristicas()
                .is_empty(),
        );
        // Single-entry form — the canonical Cargo-shaped one-feature
        // enable ([`crate::render::is_cargo_feature_name`] accepts the
        // `"http"` byte-string as a valid feature name).
        let one = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: None,
            opcional: false,
            caracteristicas: vec!["http".to_string()],
        };
        assert_eq!(one.caracteristicas(), &["http".to_string()]);
        // Multi-entry form — the substrate's set-shaped multi-feature
        // enable, exercising the accessor over a length-two slice with
        // no duplicate collapse.
        let two = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: None,
            opcional: false,
            caracteristicas: vec!["http".to_string(), "json".to_string()],
        };
        assert_eq!(
            two.caracteristicas(),
            &["http".to_string(), "json".to_string()],
        );
    }

    #[test]
    fn dep_caracteristicas_is_by_borrow_pointer_identity() {
        // Zero-copy pin: the accessor must borrow into the field's own
        // `Vec<String>` storage, not clone into a side buffer. If a
        // future rewrite regresses to `self.caracteristicas.clone()` or
        // an owned-buffer shape, the two pointers diverge and this pin
        // fails at build time. Peer of the sibling per-`Dep`
        // [`Dep::nome`] (eba2cde) / [`Dep::versao_requirement`] (05529b1)
        // / [`Dep::fonte`] (d65d1bf) pointer-identity pins — same by-
        // borrow discipline extended onto the outer-`Dep` `&[String]`
        // slice-projection axis.
        let d = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: None,
            opcional: false,
            caracteristicas: vec!["http".to_string(), "json".to_string()],
        };
        assert!(std::ptr::eq(
            d.caracteristicas().as_ptr(),
            d.caracteristicas.as_ptr(),
        ));
    }

    #[test]
    fn dep_validate_reads_caracteristicas_through_accessor() {
        // Composition pin: [`Dep::validate_caracteristicas`]'s per-entry
        // linear walk consumes the feature-toggle list through the
        // lifted accessor — a well-formed `:caracteristicas` set passes
        // (positive control), an empty-string entry surfaces the
        // [`DepError::CaracteristicaEmpty`] variant quoting the offending
        // `Dep::nome`, and a within-list duplicate surfaces the
        // [`DepError::CaracteristicaDuplicate`] variant so a future
        // regression that detoured the walk through a different byte-
        // string list (say a per-scope override projector) would surface
        // here at build time. Peer of the sibling
        // `dep_validate_reads_fonte_through_accessor` /
        // `dep_validate_reads_requirement_through_accessor` composition
        // pins on the `:fonte` / `:versao` axes.
        // Positive control: two distinct well-formed feature names pass.
        Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: None,
            opcional: false,
            caracteristicas: vec!["http".to_string(), "json".to_string()],
        }
        .validate()
        .unwrap();
        // Negative control 1: empty-string feature-name entry — the
        // accessor still returns `&[""]` and the walk raises the typed
        // empty-first carrier.
        let err = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: None,
            opcional: false,
            caracteristicas: vec![String::new()],
        }
        .validate()
        .unwrap_err();
        assert!(
            matches!(
                &err,
                DepError::CaracteristicaEmpty { nome } if nome == "caixa-teia",
            ),
            "expected CaracteristicaEmpty from the accessor-routed walk, got {err:?}",
        );
        // Negative control 2: within-list duplicate — the accessor's
        // slice view carries both entries, and the walk's dedup arm
        // raises the typed duplicate carrier quoting the offending
        // feature name verbatim.
        let err = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: None,
            opcional: false,
            caracteristicas: vec!["http".to_string(), "http".to_string()],
        }
        .validate()
        .unwrap_err();
        assert!(
            matches!(
                &err,
                DepError::CaracteristicaDuplicate {
                    nome,
                    caracteristica,
                } if nome == "caixa-teia" && caracteristica == "http",
            ),
            "expected CaracteristicaDuplicate from the accessor-routed dedup, got {err:?}",
        );
    }

    // ── Dep::opcional accessor pins ───────────────────────────────────
    //
    // Two coherence pins on the lifted `Dep::opcional` accessor: byte-
    // equal projection over the default-`false` / explicit-`true`
    // fixture pair across the plain-shorthand (`:fonte None`) / explicit-
    // git-tag / explicit-path fixture triad the [`Dep`] docstring lists,
    // exercising the accessor's accept-set over every author-surface
    // `:fonte` shape × every author-surface `:opcional` shape; and by-
    // `Copy` idempotency so the projection stays value-return (no
    // silent detour to a fresh `&bool` borrow that would introduce a
    // lifetime on the return type the plain-`Copy`-scalar axis's `bool`
    // shape elides). No composition pin — `:opcional` does not
    // participate in [`Dep::validate`] (an opcional dep with any bool
    // value is validate-accepted; the missing-source arm is a resolver-
    // side runtime dispatch, not a build-time refusal), so the axis
    // reduces to the value-shape + `Copy` pin pair the peer
    // [`crate::Caixa::max_restarts`] / [`crate::Caixa::estrategia`]
    // outer-`Option<Copy>` accessor pins already carry.

    #[test]
    fn dep_opcional_returns_declared_opcional_across_fonte_shapes() {
        // Default-`false` form via the [`Dep::simple`] constructor —
        // the accessor projects the `false` bit the default-fill sets.
        assert!(!Dep::simple("caixa-teia", "^0.1").opcional());
        // Default-`false` form via the [`Dep::git`] constructor — same
        // default fill; the accessor projects `false` regardless of the
        // `:fonte` arm.
        assert!(!Dep::git("caixa-teia", "^0.1", "github:pleme-io/caixa-teia", "v0.1.0").opcional(),);
        // Explicit-`true` form × plain-shorthand `:fonte` — the
        // canonical author-surface "this dep may be missing" shape.
        let plain_true = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: None,
            opcional: true,
            caracteristicas: Vec::new(),
        };
        assert!(plain_true.opcional());
        // Explicit-`true` form × explicit git-source — the accessor
        // projects the bit verbatim regardless of the `:fonte` arm.
        let git_true = Dep {
            nome: "caixa-teia".to_string(),
            versao: "^0.1".to_string(),
            fonte: Some(DepSource::Git {
                repo: "github:pleme-io/caixa-teia".to_string(),
                tag: Some("v0.1.0".to_string()),
                rev: None,
                branch: None,
            }),
            opcional: true,
            caracteristicas: Vec::new(),
        };
        assert!(git_true.opcional());
        // Explicit-`true` form × explicit path-source — the dev-only
        // local-filesystem arm the [`Dep`] docstring's third fixture
        // carries.
        let path_true = Dep {
            nome: "caixa-teia".to_string(),
            versao: "0.1.0".to_string(),
            fonte: Some(DepSource::Path {
                caminho: "../caixa-teia".to_string(),
            }),
            opcional: true,
            caracteristicas: Vec::new(),
        };
        assert!(path_true.opcional());
    }

    #[test]
    fn dep_opcional_projects_bool_by_copy() {
        // The by-`Copy` pin: [`Dep::opcional`] returns `bool` by value
        // (`bool: Copy`) — the accessor does not borrow `&self` past
        // the call (no lifetime on the return type), and calling the
        // accessor twice on the same [`Dep`] must yield discriminant-
        // equal values (idempotent, no side effects on `&self`). Peer
        // of the sibling outer-`Caixa` `Option<Copy>` by-`Copy`
        // `max_restarts_projects_option_by_copy` (eba5211) /
        // `estrategia_projects_option_by_copy` (ed04d3c) pins on the
        // outer-`Caixa` altitude — extended here to the outer-`Dep`
        // altitude's plain-`Copy` `bool` axis. The `Copy` discipline
        // replaces the pointer-equality claim the sibling per-`Dep`
        // by-borrow pins (`dep_nome_is_by_borrow_pointer_identity`
        // eba2cde, `dep_versao_requirement_is_by_borrow_pointer_identity`
        // 05529b1, `dep_fonte_is_by_borrow_pointer_identity` d65d1bf,
        // `dep_caracteristicas_is_by_borrow_pointer_identity` 9197944)
        // carry (a fresh `Copy` of a `Copy` discriminant is definitionally
        // the same discriminant, so the axis reduces to discriminant
        // equality).
        //
        // Pins against a future silent detour that returned a fresh
        // `&bool` reference (which would type-check but silently
        // introduce a borrow of `&self` past the call, collapsing the
        // load-bearing "no lifetime on the return type" `Copy`
        // projection the plain-`Copy`-scalar axis's `bool` shape
        // carries) or a stale-read side effect that flipped the outer
        // discriminant on successive calls.
        for opcional in [false, true] {
            let d = Dep {
                nome: "caixa-teia".to_string(),
                versao: "^0.1".to_string(),
                fonte: None,
                opcional,
                caracteristicas: Vec::new(),
            };
            let first = d.opcional();
            let second = d.opcional();
            assert_eq!(
                first, second,
                "Dep::opcional must be idempotent — two successive calls \
                 on the same &self must return the same bool",
            );
            assert_eq!(
                first, opcional,
                "Dep::opcional must return :opcional verbatim by Copy — \
                 got {first}, expected {opcional}",
            );
            assert_eq!(
                d.opcional(),
                d.opcional,
                "Dep::opcional accessor and self.opcional field access \
                 must byte-equal — a bit-flip drift would silently split \
                 the paired resolver-side drop-vs-error dispatch from \
                 the storage-side default-fill the [`Dep::simple`] / \
                 [`Dep::git`] constructor pair carries",
            );
        }
    }

    // ── DepSource::sole_pin — sole-set git-pin accessor ─────────────────

    #[test]
    fn sole_pin_returns_none_for_path_source() {
        // A path source carries no git-ref, so `sole_pin()` returns
        // `None` structurally — the sibling arm every git-fetching
        // consumer partitions off before reaching for a git-ref. Pins
        // the Path-arm branch of the accessor against a future silent
        // detour that treats a `Self::Path` as an unpinned-git source
        // and returns the wrong "no pin" signal (e.g. the empty string,
        // or a hard-coded `Some("HEAD")` matching the caixa-crd
        // path-arm `git_ref` fill).
        let s = DepSource::Path {
            caminho: "../local-caixa".to_string(),
        };
        assert_eq!(s.sole_pin(), None);
    }

    #[test]
    fn sole_pin_returns_none_for_unpinned_git_source() {
        // The [`DepSource::default_github`] shorthand shape carries no
        // pin — every `tag`/`rev`/`branch` is `None`, and `sole_pin()`
        // returns `None`. This is the shape caixa-resolver's `fetch_dep`
        // materializes when the author omits `:fonte` entirely, then
        // hands to `fetch_git` which raises `ResolveError::MissingPin`
        // on the `None` arm — the accessor's return matches the arm
        // the resolver's diagnostic keys off.
        let s = DepSource::default_github("pleme-io", "caixa-teia");
        assert_eq!(s.sole_pin(), None);
    }

    #[test]
    fn sole_pin_returns_rev_when_only_rev_is_set() {
        let s = DepSource::Git {
            repo: "github:o/x".into(),
            tag: None,
            rev: Some("deadbeefcafebabe1234567890abcdef12345678".into()),
            branch: None,
        };
        assert_eq!(
            s.sole_pin(),
            Some("deadbeefcafebabe1234567890abcdef12345678")
        );
    }

    #[test]
    fn sole_pin_returns_tag_when_only_tag_is_set() {
        let s = DepSource::Git {
            repo: "github:o/x".into(),
            tag: Some("v0.1.0".into()),
            rev: None,
            branch: None,
        };
        assert_eq!(s.sole_pin(), Some("v0.1.0"));
    }

    #[test]
    fn sole_pin_returns_branch_when_only_branch_is_set() {
        let s = DepSource::Git {
            repo: "github:o/x".into(),
            tag: None,
            rev: None,
            branch: Some("main".into()),
        };
        assert_eq!(s.sole_pin(), Some("main"));
    }

    #[test]
    fn sole_pin_precedence_rev_beats_tag_and_branch() {
        // Precedence: rev > tag > branch. Validate() rejects
        // multiple-pin shapes, but the accessor's precedence is defined
        // for pre-validate consumers (the resolver's `MissingPin`
        // diagnostic path, the caixa-crd round-trip's default `"main"`
        // fallback) and as defense-in-depth if the gate is ever
        // bypassed. Pins the same precedence caixa-resolver's
        // `fetch_git` and caixa-crd's `dep_into_ref` already apply
        // inline.
        let s = DepSource::Git {
            repo: "github:o/x".into(),
            tag: Some("v1".into()),
            rev: Some("deadbeefcafebabe1234567890abcdef12345678".into()),
            branch: Some("main".into()),
        };
        assert_eq!(
            s.sole_pin(),
            Some("deadbeefcafebabe1234567890abcdef12345678")
        );
    }

    #[test]
    fn sole_pin_precedence_tag_beats_branch_when_no_rev() {
        let s = DepSource::Git {
            repo: "github:o/x".into(),
            tag: Some("v1".into()),
            rev: None,
            branch: Some("main".into()),
        };
        assert_eq!(s.sole_pin(), Some("v1"));
    }

    #[test]
    fn sole_pin_byte_equals_inline_rev_or_tag_or_branch_cascade() {
        // Fail-before-pass-after byte-parity pin: the substrate accessor
        // must return byte-identical to the inline
        // `rev.as_deref().or(tag.as_deref()).or(branch.as_deref())`
        // cascade both caixa-resolver's `fetch_git` and caixa-crd's
        // `dep_into_ref` open-coded pre-lift. Trips at caixa-core build
        // time if the accessor's precedence silently drifts from the
        // consumer-side cascade — the exact drift this lift converges
        // to one substrate primitive to close structurally.
        //
        // Iterates through the 2^3 = 8 combinations of (tag, rev,
        // branch) each-either-`None`-or-`Some`, so every arm of the
        // precedence cascade lands under the pin. `validate()` refuses
        // the 4 multi-pin combinations, but the accessor's return is
        // defined on all 8.
        let vals = [Some("R".to_string()), None];
        for tag in &vals {
            for rev in &vals {
                for branch in &vals {
                    let s = DepSource::Git {
                        repo: "github:o/x".into(),
                        tag: tag.clone(),
                        rev: rev.clone(),
                        branch: branch.clone(),
                    };
                    // The exact inline cascade the two pre-lift
                    // consumer sites hand-rolled, byte-for-byte.
                    let expected = rev.as_deref().or(tag.as_deref()).or(branch.as_deref());
                    assert_eq!(
                        s.sole_pin(),
                        expected,
                        "sole_pin() must byte-equal \
                         rev.or(tag).or(branch) for \
                         (tag={tag:?}, rev={rev:?}, branch={branch:?}) — \
                         a drift would silently split caixa-resolver's \
                         fetch_git checkout target from caixa-crd's \
                         dep_into_ref git_ref fill",
                    );
                }
            }
        }
    }
}