caixa-flux 0.1.40

caixa-flux — typed renderer that emits FluxCD GitOps fragments from a Caixa manifest. Aggregator path: a single entry for the cluster's programs.yaml (consumed by lareira-fleet-programs). Cluster-bundle path: GitRepository + HelmRelease + Kustomization for one-time per-cluster wiring.
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
//! caixa-flux — typed renderer that emits the FluxCD-side fragments a
//! caixa Servico needs in the cluster's GitOps tree.
//!
//! Same naming convention as [`caixa_helm`] (renders per-program Helm
//! charts) and [`caixa_flake`] (renders flake.nix): `caixa-<target>` =
//! "Rust crate that takes a typed [`Caixa`] and emits the canonical
//! source for `<target>`".
//!
//! ## Two paths, two surfaces
//!
//! Per `theory/META-FRAMEWORK.md` §I, two equally-canonical ways exist
//! to deploy a caixa Servico:
//!
//! 1. **Aggregator path** ([`programs_yaml_entry`]) — the cluster has
//!    exactly one `lareira-fleet-programs` HelmRelease whose values
//!    contain a `programs:` array. Adding a Servico = adding one entry
//!    to that array. **Higher leverage** — one HelmRelease handles the
//!    whole fleet's worth of caixas, fewer reconciler events, simpler
//!    cluster surface. This is what `feira deploy` uses by default.
//!
//! 2. **Bundle path** ([`cluster_bundle`]) — emit a fresh `GitRepository`
//!    + `HelmRelease` + `Kustomization` trio for the caixa's own per-
//!    program chart (rendered by `caixa-helm`). Used for one-off /
//!    isolated services where the aggregator overhead is undesirable
//!    (e.g. alpha workloads with non-standard images, breakglass tooling).
//!
//! ## V0 contract
//!
//! ```rust,ignore
//! use caixa_core::Caixa;
//! use caixa_flux::programs_yaml_entry;
//!
//! let caixa = Caixa::from_lisp(src)?;
//! let cu_yaml: serde_yaml::Value =
//!     serde_yaml::from_str(std::fs::read_to_string("servicos/hello-rio.computeunit.yaml")?)?;
//! let entry: serde_yaml::Value = programs_yaml_entry(&caixa, &cu_yaml)?;
//! // → { name: hello-rio, namespace: tatara-system, module: { source: ... }, ... }
//! ```
//!
//! ## What this is NOT
//!
//! - Not a Flux CLI wrapper — bytes only.
//! - Not the operator deploy bundle — that lives in `pleme-io/caixa/operator-flux/`.
//! - Not an installer — `feira deploy` orchestrates the I/O of writing
//!   to a GitOps repo + opening a PR.

#![allow(clippy::module_name_repetitions)]

use caixa_core::{Caixa, MappingExt, kube_metadata_str_field, lareira_chart_name};
use serde::{Deserialize, Serialize};
use thiserror::Error;

/// Errors caixa-flux can raise.
#[derive(Debug, Error)]
pub enum Error {
    /// The caixa's `:kind` doesn't match what `caixa-flux` targets
    /// (this renderer only emits `programs.yaml` entries +
    /// `GitRepository`/`HelmRelease`/`Kustomization` bundles for
    /// `:kind Servico`). Lifted from a prior `NotAServico(CaixaKind)`
    /// arm to wrap [`caixa_core::KindMismatch`] so the diagnostic
    /// names the offending caixa's `:nome` (not just its kind),
    /// shared verbatim with `caixa-helm` and `caixa-mesh`.
    #[error("{0}")]
    NotAServico(#[from] caixa_core::KindMismatch),
    /// The caixa's `:servicos` list doesn't carry exactly one entry —
    /// the V0 contract every Servico-kind caixa satisfies (one
    /// ComputeUnit YAML pointer per Servico, matching the one
    /// programs.yaml entry / cluster bundle this renderer emits).
    /// Lifted from a prior `UnsupportedServicoCount(usize)` arm to
    /// wrap [`caixa_core::ServicoCountMismatch`] so the diagnostic
    /// names the offending caixa's `:nome` (not just the count),
    /// shared verbatim with `caixa-helm` (the peer per-Servico
    /// renderer running the same V0 invariant on the
    /// `lareira-<nome>` chart-dir axis).
    #[error("{0}")]
    UnsupportedServicoCount(#[from] caixa_core::ServicoCountMismatch),
    #[error("computeunit yaml missing required field: {0}")]
    MissingField(&'static str),
    #[error("yaml: {0}")]
    Yaml(#[from] serde_yaml::Error),
    #[error("render: {0}")]
    Render(#[from] caixa_core::RenderError),
}

/// Default cluster-wide namespace for caixa Servicos when the
/// computeunit doesn't pin its own. Re-export of the canonical
/// [`caixa_core::DEFAULT_NAMESPACE`] so the namespace string lives in
/// exactly one place across every renderer — caixa-flux's
/// programs.yaml / GitRepository / HelmRelease / Kustomization
/// emitters and caixa-mesh's programs fan-out / CiliumNetworkPolicy /
/// Gateway / HTTPRoute emitters now consult the same `&'static str`,
/// so a future per-cluster-namespace rebrand is a one-line edit on
/// the canonical [`caixa_core::DEFAULT_NAMESPACE`] declaration, not a
/// coordinated rewrite across this crate, caixa-mesh, and every
/// future per-target renderer the substrate adds.
pub use caixa_core::DEFAULT_NAMESPACE;

/// Canonical Flux v2 `spec.interval` reconcile-poll cadence default the
/// substrate seeds into every per-caixa `cluster_bundle` CR triplet.
/// Re-export of the canonical [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`]
/// so the Flux v2 controller-side reconcile-cadence default scalar-value
/// string lives in exactly one place across every caixa renderer —
/// [`ClusterBundleOpts::for_caixa`]'s per-caixa default seed (the sole
/// production-code site the prior inline `"10m"` scalar-value literal sat
/// at, seeding the [`ClusterBundleOpts::interval`] field that
/// [`cluster_bundle`]'s three per-CR format-string templates thread
/// through their [`FLUX_KEY_INTERVAL`]-keyed `spec.interval` axis
/// verbatim) now consults the same `&'static str`, so a future substrate-
/// side reconcile-cadence migration (`"10m"` → `"5m"` on lower-latency-
/// poll optimizations, `"10m"` → `"15m"` on cost-optimized clusters where
/// per-CR source-controller poll cost outweighs reconcile-freshness
/// gains — coordinated with the upstream Flux v2 project's per-controller
/// tuning cycle) is a one-line edit on the canonical
/// [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] declaration, not a
/// coordinated rewrite across the [`ClusterBundleOpts`] default seed and
/// every future per-target renderer the substrate adds. Pairs with the
/// sibling [`FLUX_KEY_INTERVAL`] re-export on the same per-CR
/// `spec.interval` scalar-axis — the key half of the per-CR scalar-key/
/// scalar-value pair lives at [`FLUX_KEY_INTERVAL`], the value half's
/// substrate-side default seed lives here. Same shape as the sibling
/// [`caixa_core::DEFAULT_NAMESPACE`] / [`caixa_core::DEFAULT_LIBRARY_NAME`]
/// / [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] /
/// [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`] re-exports on the peer
/// canonical-substrate-default-load-bearing-scalar surface.
pub use caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL;

/// Canonical Flux v2 `HelmRelease.spec.chart.spec.chart` per-CR chart-
/// directory-in-GitRepository-source sub-path default the substrate seeds
/// into every per-caixa `helmrelease.yaml` document. Re-export of the
/// canonical [`caixa_core::DEFAULT_FLUX_CHART_SOURCE_SUBPATH`] so the
/// Flux v2 helm-controller-side per-CR chart-directory-in-git-source
/// default scalar-value lives in exactly one place across every caixa
/// renderer — [`ClusterBundleOpts::for_caixa`]'s per-caixa default seed
/// (the sole production-code site the prior inline `"chart".into()`
/// scalar-value literal sat at, seeding the [`ClusterBundleOpts::chart_path`]
/// field that [`cluster_bundle`]'s `helmrelease.yaml` format-string
/// template threads through its [`FLUX_HELMCHART_TEMPLATE_KEY_CHART`]-
/// keyed `spec.chart.spec.chart` axis verbatim) now consults the same
/// `&'static str`, so a future substrate-side chart-directory-in-git-
/// source rebrand (`"chart"` → `"charts"` once a per-caixa multi-chart
/// layout lands and the substrate publishes N sibling `lareira-<nome>/`
/// charts under one git repository, `"chart"` → `"helm"` on a cross-
/// language convention alignment with sibling wasm-runtime substrates,
/// `"chart"` → `"deploy"` on a per-caixa-deploy-directory naming
/// migration) is a one-line edit on the canonical
/// [`caixa_core::DEFAULT_FLUX_CHART_SOURCE_SUBPATH`] declaration, not a
/// coordinated rewrite across the [`ClusterBundleOpts`] default seed and
/// every future per-target renderer the substrate adds. Pairs with the
/// sibling [`FLUX_HELMCHART_TEMPLATE_KEY_CHART`] re-export on the same
/// per-CR `spec.chart.spec.chart` scalar-axis — the key half of the per-
/// CR scalar-key/scalar-value pair lives at
/// [`FLUX_HELMCHART_TEMPLATE_KEY_CHART`], the value half's substrate-side
/// default seed lives here. Same shape as the sibling
/// [`caixa_core::DEFAULT_NAMESPACE`] / [`caixa_core::DEFAULT_LIBRARY_NAME`]
/// / [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] /
/// [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] /
/// [`caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] /
/// [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`] re-exports on the peer
/// canonical-substrate-default-load-bearing-scalar surface.
pub use caixa_core::DEFAULT_FLUX_CHART_SOURCE_SUBPATH;

/// Canonical Flux v2 `HelmRelease.spec.{install,upgrade}.remediation.retries`
/// bounded retry-count default the substrate seeds into every per-caixa
/// `helmrelease.yaml` document. Re-export of the canonical
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] so the
/// Flux v2 helm-controller-side remediation-retries default scalar-value
/// lives in exactly one place across every caixa renderer —
/// [`cluster_bundle`]'s `helmrelease.yaml` format-string template's two
/// production-code retry-cap sites (the prior inline `retries: 3`
/// scalar-value literal under the `install.remediation` sub-block + the
/// second inline `retries: 3` scalar-value literal under the
/// `upgrade.remediation` sub-block) now both consume the same `u32` at
/// emit time through one `{retries_default}` named-arg interpolation, so
/// a future substrate-side retry-ceiling migration (`3` → `5` once per-
/// caixa idempotency invariants tighten, `3` → `1` on hardened per-caixa
/// pipelines where a failed apply should escalate to operator-attention
/// rather than mask under further retries — coordinated with the
/// upstream Flux v2 project's per-controller tuning cycle) is a one-line
/// edit on the canonical
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`]
/// declaration, not a coordinated rewrite across the two per-CR
/// remediation-retries sites. Before this lift the two axes carried
/// independently-inlined `retries: 3` literals in the sibling
/// `install.remediation.retries` / `upgrade.remediation.retries`
/// positions of the [`cluster_bundle`] `helmrelease.yaml` format-string
/// template — any future retry-ceiling migration on one axis without a
/// coordinated edit on the other would have silently split the
/// substrate's canonical retry-ceiling between the install-path (first-
/// time chart applies) and the upgrade-path (every subsequent per-
/// caixa-version re-apply the same `HelmRelease` gates), with no field
/// naming the ceiling-drift root cause. Pairs with the sibling
/// [`DEFAULT_FLUX_RECONCILE_INTERVAL`] re-export on the same canonical-
/// Flux-v2-per-CR-substrate-default surface — the reconcile-poll cadence
/// default names how often the helm-controller re-evaluates per-CR
/// desired state, and this retry-cap names how many times a per-
/// evaluation Helm action is allowed to fail-and-retry before it stops.
/// Same shape as the sibling [`caixa_core::DEFAULT_NAMESPACE`] /
/// [`caixa_core::DEFAULT_LIBRARY_NAME`] /
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] /
/// [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] /
/// [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`] re-exports on the peer
/// canonical-substrate-default-load-bearing-scalar surface.
pub use caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT;

/// Canonical Flux v2 `HelmRelease.spec.{install,upgrade}.remediation.retries`
/// leaf scalar-key — re-export of the canonical
/// [`caixa_core::FLUX_HELMRELEASE_KEY_RETRIES`] so the Flux v2
/// helm-controller-side per-CR remediation-retries leaf-scalar-key lives
/// in exactly one place across every caixa renderer. Peer to the sibling
/// [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] (30dcdae) scalar-
/// value half of the same `(leaf-key, scalar-value)` per-path retry-cap
/// declaration pair — extends the drift-closing discipline the scalar-
/// value lift established from the value the leaf holds onto the leaf-
/// key itself. Two production emit sites (this crate's [`cluster_bundle`]
/// `helmrelease.yaml` format-string template's install-path retry-cap
/// leaf under the [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`]-valued
/// sub-block + the sibling upgrade-path retry-cap leaf under the same
/// scalar-value, both threading the same `&'static str` through a
/// `{retries_key}` named-arg interpolation) plus two test-fixture
/// navigation sites in `mod tests` (the install-path
/// [`cluster_bundle_helmrelease_install_remediation_retries_pins_lifted_default`]
/// pin's `.get("retries")` probe + the sibling upgrade-path
/// [`cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default`]
/// pin's peer probe) now consult the same `&'static str`. Until this
/// lift landed the axis carried four inline `retries` literals across
/// the two production emit sites and the two test-fixture navigation
/// sites; a future hypothetical Flux v3 rename (`attempts` /
/// `maxRetries` / `retryCount`) on any production-emit site without a
/// coordinated edit on the sibling navigation sites would have silently
/// stripped the retry-cap declaration from the emitted `remediation:`
/// sub-block, letting the helm-controller fall back to the Flux v2
/// upstream default rather than the substrate's chosen ceiling with no
/// diagnostic naming the leaf-key-drift root cause. Same shape as the
/// sibling [`FLUX_KEY_SOURCE_REF`] (236ef01) / [`FLUX_KEY_CHART`] /
/// [`FLUX_KEY_VALUES`] / [`FLUX_KEY_INTERVAL`] /
/// [`FLUX_KEY_HEALTH_CHECKS`] lifts on the peer per-CR container-axis-
/// key surface — extends the discipline from the container-axis keys
/// that nest per-CR sub-blocks onto a leaf-scalar-key at the bottom of
/// a two-level nested per-path retry-cap declaration.
pub use caixa_core::FLUX_HELMRELEASE_KEY_RETRIES;

/// Canonical Flux v2 `HelmRelease.spec.{install,upgrade}.remediation`
/// sub-container-axis-key — re-export of the canonical
/// [`caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATION`] so the Flux v2
/// helm-controller-side per-CR remediation sub-container-axis-key lives
/// in exactly one place across every caixa renderer. Peer to the sibling
/// [`FLUX_HELMRELEASE_KEY_RETRIES`] (a12f9fc) leaf-scalar-key half + the
/// sibling [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] (30dcdae)
/// scalar-value half of the same
/// `(container-axis-key, leaf-scalar-key, scalar-value)` per-path retry-
/// cap declaration triple — closes the parent-container-axis-key axis on
/// the same per-path retry-cap declaration, so all three halves now live
/// in one place. Two production emit sites (this crate's
/// [`cluster_bundle`] `helmrelease.yaml` format-string template's
/// install-path remediation sub-block-header + the sibling upgrade-path
/// remediation sub-block-header, both threading the same `&'static str`
/// through a `{remediation_key}` named-arg interpolation) plus two test-
/// fixture navigation sites in `mod tests` (the install-path
/// [`cluster_bundle_helmrelease_install_remediation_retries_pins_lifted_default`]
/// pin's `.get(FLUX_HELMRELEASE_KEY_REMEDIATION)` probe + the sibling
/// upgrade-path
/// [`cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default`]
/// pin's peer probe) now consult the same `&'static str`. Until this
/// lift landed the axis carried four inline `remediation` literals across
/// the two production emit sites and the two test-fixture navigation
/// sites; a future hypothetical Flux v3 rename (`recovery` /
/// `retryPolicy` / `errorHandling`) on any production-emit site without
/// a coordinated edit on the sibling navigation sites would have
/// silently stripped the whole per-path remediation sub-block from the
/// emitted `HelmRelease` CR, letting the helm-controller fall back to
/// the Flux v2 upstream defaults for the whole remediation surface
/// rather than the substrate's chosen ceiling with no diagnostic naming
/// the sub-container-key-drift root cause. Same shape as the sibling
/// [`FLUX_HELMRELEASE_KEY_RETRIES`] (a12f9fc) leaf-scalar-key half plus
/// the peer [`FLUX_KEY_SOURCE_REF`] (236ef01) / [`FLUX_KEY_CHART`] /
/// [`FLUX_KEY_VALUES`] / [`FLUX_KEY_INTERVAL`] /
/// [`FLUX_KEY_HEALTH_CHECKS`] container-axis-key lifts on the peer per-
/// CR container-axis-key surface — extends the discipline from the
/// leaf-scalar-key at the bottom of the two-level nested per-path
/// retry-cap declaration onto the sub-container-axis-key one level up.
pub use caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATION;

/// Canonical Flux v2 `HelmRelease.spec.install` per-CR helm-action-phase
/// discriminator parent-container-axis-key — re-export of the canonical
/// [`caixa_core::FLUX_HELMRELEASE_KEY_INSTALL`] so the Flux v2 helm-
/// controller-side per-CR install-path phase-discriminator parent-
/// container-axis-key lives in exactly one place across every caixa
/// renderer. Pairs with the sibling [`FLUX_HELMRELEASE_KEY_UPGRADE`]
/// per-CR helm-action-phase discriminator parent-container-axis-key on
/// the peer per-CR upgrade-path phase. Peer to the sibling
/// [`FLUX_HELMRELEASE_KEY_REMEDIATION`] (6fe4e7e) sub-container-axis-key
/// hosted beneath both parent-container-axis-keys +
/// [`FLUX_HELMRELEASE_KEY_RETRIES`] (a12f9fc) leaf-scalar-key +
/// [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] (30dcdae) scalar-
/// value halves of the same `(parent-container-key, sub-container-key,
/// leaf-key, scalar-value)` per-path retry-cap declaration quartet —
/// closes the parent-container-axis-key axis on the same per-path retry-
/// cap declaration quartet, so all four halves now live in one place.
/// One production emit site (this crate's [`cluster_bundle`]
/// `helmrelease.yaml` format-string template's install-path sub-block-
/// header, threading the same `&'static str` through a new
/// `{install_key}` named-arg interpolation) plus one test-fixture
/// navigation site in `mod tests` (the install-path
/// [`cluster_bundle_helmrelease_install_remediation_retries_pins_lifted_default`]
/// pin's `.get(FLUX_HELMRELEASE_KEY_INSTALL)` probe) now consult the
/// same `&'static str`. Until this lift landed the axis carried two
/// inline `install` literals across the one production emit site and
/// the one test-fixture navigation site; a future hypothetical Flux v3
/// rename (`initialize` / `apply` / `create` / `first-run`) on the
/// production-emit site without a coordinated edit on the sibling
/// navigation site would have silently stripped the whole install-path
/// per-CR phase block from the emitted `HelmRelease` CR, letting the
/// helm-controller fall back to the Flux v2 upstream defaults for the
/// whole install-path phase surface (the `createNamespace: true` seeder
/// never fires, the per-CR retry-cap ceiling silently drops off the
/// emitted document) rather than the substrate's chosen per-CR install-
/// path knob-set with no diagnostic naming the phase-discriminator-drift
/// root cause. Same shape as the sibling
/// [`FLUX_HELMRELEASE_KEY_REMEDIATION`] (6fe4e7e) sub-container-axis-key +
/// [`FLUX_HELMRELEASE_KEY_RETRIES`] (a12f9fc) leaf-scalar-key + the peer
/// [`FLUX_KEY_SOURCE_REF`] (236ef01) / [`FLUX_KEY_CHART`] /
/// [`FLUX_KEY_VALUES`] / [`FLUX_KEY_INTERVAL`] /
/// [`FLUX_KEY_HEALTH_CHECKS`] container-axis-key lifts on the peer per-
/// CR container-axis-key surface — extends the discipline from the sub-
/// container-axis-key one level up onto the parent-container-axis-key
/// hosting it, so the four-level nested `spec.install.remediation
/// .retries` declaration now resolves through four lifted `&'static str`
/// / `u32` values.
pub use caixa_core::FLUX_HELMRELEASE_KEY_INSTALL;

/// Canonical Flux v2 `HelmRelease.spec.upgrade` per-CR helm-action-phase
/// discriminator parent-container-axis-key — re-export of the canonical
/// [`caixa_core::FLUX_HELMRELEASE_KEY_UPGRADE`] so the Flux v2 helm-
/// controller-side per-CR upgrade-path phase-discriminator parent-
/// container-axis-key lives in exactly one place across every caixa
/// renderer. Pairs with the sibling [`FLUX_HELMRELEASE_KEY_INSTALL`]
/// per-CR helm-action-phase discriminator parent-container-axis-key on
/// the peer per-CR install-path phase. Peer to the sibling
/// [`FLUX_HELMRELEASE_KEY_REMEDIATION`] (6fe4e7e) sub-container-axis-key
/// hosted beneath both parent-container-axis-keys. One production emit
/// site (this crate's [`cluster_bundle`] `helmrelease.yaml` format-
/// string template's upgrade-path sub-block-header, threading the same
/// `&'static str` through a new `{upgrade_key}` named-arg interpolation)
/// plus one test-fixture navigation site in `mod tests` (the upgrade-
/// path
/// [`cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default`]
/// pin's `.get(FLUX_HELMRELEASE_KEY_UPGRADE)` probe) now consult the
/// same `&'static str`. Until this lift landed the axis carried two
/// inline `upgrade` literals across the one production emit site and
/// the one test-fixture navigation site; a future hypothetical Flux v3
/// rename (`reapply` / `reconcile` / `update` / `promote`) on the
/// production-emit site without a coordinated edit on the sibling
/// navigation site would have silently stripped the whole upgrade-path
/// per-CR phase block from the emitted `HelmRelease` CR, letting the
/// helm-controller fall back to the Flux v2 upstream defaults for the
/// whole upgrade-path phase surface (the substrate's
/// `remediateLastFailure: true` toggle never fires, the per-CR retry-
/// cap ceiling silently drops off the emitted document) rather than the
/// substrate's chosen per-CR upgrade-path knob-set with no diagnostic
/// naming the phase-discriminator-drift root cause. Same shape as the
/// sibling [`FLUX_HELMRELEASE_KEY_INSTALL`] parent-container-axis-key
/// on the peer per-CR install-path phase — pairs with the install-path
/// re-export to close the per-CR helm-action-phase discriminator
/// parent-container-axis-key pair across both per-CR phases the helm-
/// controller reconciles between.
pub use caixa_core::FLUX_HELMRELEASE_KEY_UPGRADE;

/// Canonical Flux v2 `HelmRelease.spec.upgrade.remediation.remediateLastFailure`
/// upgrade-path-only per-CR remediation-toggle leaf-scalar-key — re-export
/// of the canonical [`caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`]
/// so the Flux v2 helm-controller-side upgrade-path per-CR remediation-
/// toggle leaf-scalar-key lives in exactly one place across every caixa
/// renderer. Sibling to the peer [`FLUX_HELMRELEASE_KEY_RETRIES`] per-CR
/// retry-cap leaf-scalar-key at the same per-CR upgrade-path per-CR
/// remediation sub-container position — closes the
/// `spec.upgrade.remediation.{retries, remediateLastFailure}` per-path
/// remediation-block leaf-scalar-key pair the substrate seeds into every
/// emitted per-caixa `HelmRelease` CR on the upgrade-path per-CR
/// remediation block. One production emit site (this crate's
/// [`cluster_bundle`] `helmrelease.yaml` format-string template's
/// upgrade-path remediation-toggle leaf under the sibling
/// [`FLUX_HELMRELEASE_KEY_REMEDIATION`]-container-keyed sub-block,
/// threading the same `&'static str` through a new
/// `{remediate_last_failure_key}` named-arg interpolation) plus one test-
/// fixture navigation site in `mod tests` (the upgrade-path
/// [`cluster_bundle_helmrelease_upgrade_remediation_remediate_last_failure_pins_lifted_true`]
/// pin's `.get(FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE)` probe) now
/// consult the same `&'static str`. Until this lift landed the axis
/// carried the load-bearing `remediateLastFailure` bytes inline at the
/// one production emit site; a future hypothetical Flux v3 rename
/// (`rollbackOnFailure` / `remediateOnFailure` / `recoverLastFailure`)
/// on the production-emit site without a coordinated edit on every
/// per-renderer consumer the absorption roadmap surfaces (the M4
/// `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's per-Aplicacao
/// `HelmRelease` synthesis) would have silently dropped the substrate's
/// chosen post-retry-exhaustion rollback semantic from every emitted
/// per-caixa `HelmRelease` document — the helm-controller would then
/// leave every terminally-failed upgrade in the failed state without
/// rolling back to the prior last-known-good release the substrate's
/// "no chart apply leaves a per-caixa CR in a stalled, unremediated
/// state" MESH-COMPOSITION.md §V guarantee mandates, with no diagnostic
/// naming the remediation-toggle-drift root cause far from the source
/// caixa.lisp / the renderer's format-string template. Same shape as
/// the sibling [`FLUX_HELMRELEASE_KEY_RETRIES`] (a12f9fc) leaf-scalar-
/// key + the peer [`FLUX_HELMRELEASE_KEY_REMEDIATION`] (6fe4e7e) sub-
/// container-axis-key + [`FLUX_HELMRELEASE_KEY_INSTALL`] /
/// [`FLUX_HELMRELEASE_KEY_UPGRADE`] (7767c26) parent-container-axis-key
/// pair lifts on the peer per-CR remediation-surface leaf-scalar-key /
/// container-axis-key surface — extends the discipline from the sibling
/// retry-cap leaf-scalar-key onto the co-resident remediation-toggle
/// leaf-scalar-key at the same `spec.upgrade.remediation.*` position.
pub use caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE;

/// Canonical Flux v2 `HelmRelease.spec.upgrade.remediation.remediateLastFailure`
/// upgrade-path-only per-CR remediation-toggle scalar-value default the
/// substrate seeds into every per-caixa `helmrelease.yaml` document at the
/// paired [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`] leaf-scalar-key
/// axis. Re-export of the canonical
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT`] so the
/// Flux v2 helm-controller-side per-CR upgrade-path per-CR post-retry-
/// exhaustion-rollback-toggle scalar-value default lives in exactly one
/// place across every caixa renderer — [`cluster_bundle`]'s
/// `helmrelease.yaml` format-string template's per-CR upgrade-path
/// remediation-toggle scalar under the [`FLUX_HELMRELEASE_KEY_UPGRADE`]-
/// keyed sub-block (the sole production-code site the prior inline
/// `remediateLastFailure: true` scalar-value literal sat at, alongside the
/// [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`]-keyed leaf-scalar-key
/// half of the same `(leaf-key, scalar-value)` pair) now threads the same
/// `bool` through a `{remediate_last_failure_default}` named-arg
/// interpolation, so a future substrate-side toggle migration (`true` →
/// `false` on a per-cluster class where terminally-failed upgrades must
/// escalate to operator-attention rather than mask under an auto-rollback
/// pipeline; a per-caixa opt-out slot the ABSORPTION-ROADMAP.md M4 typed-
/// slot trajectory adds once the substrate grows a `:upgrade
/// :remediate-last-failure` author-side toggle) is a one-line edit on the
/// canonical [`caixa_core::FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT`]
/// declaration, not a coordinated rewrite across the emit site + every
/// future per-target renderer the substrate adds. Pairs with the sibling
/// [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`] re-export on the same
/// per-CR `spec.upgrade.remediation.remediateLastFailure` scalar-axis —
/// the key half of the per-CR scalar-key/scalar-value pair lives at
/// [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`], the value half's
/// substrate-side default seed lives here. Same shape as the sibling
/// [`FLUX_KUSTOMIZATION_PRUNE_DEFAULT`] (ea857d8) scalar-value default
/// re-export on the peer per-CR `Kustomization` garbage-collection-toggle
/// axis — that default names whether the per-CR `Kustomization` reconcile
/// loop sweeps orphaned resources at all, and this default names whether
/// the per-CR `HelmRelease` upgrade-path remediation loop rolls back to
/// the prior last-known-good release once the retry-cap ceiling is
/// exhausted. Both are substrate-side policy choices the operator
/// inherits when the per-caixa [`ClusterBundleOpts`] doesn't pin an
/// override, and both must move together on any coordinated substrate-
/// side Flux v2 per-CR tuning-cycle promotion. Until this lift landed the
/// axis carried an inline `true` scalar-value literal at the sole
/// production-code call site plus the sibling test-fixture navigation
/// site ([`cluster_bundle_helmrelease_upgrade_remediation_remediate_last_failure_pins_lifted_true`]
/// pin's `assert!(remediate_last_failure)` predicate) — two occurrences
/// of the same load-bearing Flux-v2-per-CR-upgrade-path-remediation-
/// toggle-scalar-value convention, drift-prone by construction ahead of
/// the third occurrence the M4 `mesh.pleme.io/v1alpha1/Aplicacao` CR
/// materializer's per-Aplicacao `HelmRelease` synthesis will surface.
/// Same shape as the sibling [`caixa_core::DEFAULT_NAMESPACE`] /
/// [`caixa_core::DEFAULT_LIBRARY_NAME`] /
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] /
/// [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] /
/// [`caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] /
/// [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`] /
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] /
/// [`caixa_core::FLUX_KUSTOMIZATION_PRUNE_DEFAULT`] re-exports on the peer
/// canonical-substrate-default-load-bearing-scalar surface.
pub use caixa_core::FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT;

/// Canonical Flux v2 `HelmRelease.spec.install.createNamespace` install-path-
/// only per-CR namespace-seeder-toggle leaf-scalar-key — re-export of the
/// canonical [`caixa_core::FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] so the
/// Flux v2 helm-controller-side install-path per-CR namespace-seeder-toggle
/// leaf-scalar-key lives in exactly one place across every caixa renderer.
/// Peer to the sibling [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`]
/// (96581b7) upgrade-path-only per-CR remediation-toggle leaf-scalar-key at
/// the mirror-symmetric parent-container-axis-key position — closes the
/// `spec.{install.createNamespace, upgrade.remediation.remediateLastFailure}`
/// per-path per-CR phase-specific toggle leaf-scalar-key pair the substrate
/// seeds into every emitted per-caixa `HelmRelease` CR. One production emit
/// site (this crate's [`cluster_bundle`] `helmrelease.yaml` format-string
/// template's install-path namespace-seeder-toggle leaf under the sibling
/// [`FLUX_HELMRELEASE_KEY_INSTALL`]-container-keyed sub-block, threading
/// the same `&'static str` through a new `{create_namespace_key}` named-
/// arg interpolation) plus one test-fixture navigation site in `mod tests`
/// (the install-path
/// [`cluster_bundle_helmrelease_install_create_namespace_pins_lifted_true`]
/// pin's `.get(FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE)` probe) now consult
/// the same `&'static str`. Until this lift landed the axis carried the
/// load-bearing `createNamespace` bytes inline at the one production emit
/// site; a future hypothetical Flux v3 rename (`createTargetNamespace` /
/// `seedNamespace` / `provisionNamespace`) on the production-emit site
/// without a coordinated edit on every per-renderer consumer the
/// absorption roadmap surfaces (the M4 `mesh.pleme.io/v1alpha1/Aplicacao`
/// CR materializer's per-Aplicacao `HelmRelease` synthesis) would have
/// silently dropped the substrate's chosen first-apply namespace-seeder
/// semantic from every emitted per-caixa `HelmRelease` document — the
/// helm-controller would then refuse every first-time per-caixa chart
/// apply against a fresh cluster whose target namespace has not been
/// pre-provisioned by an out-of-band pipeline the substrate's "no per-
/// caixa Servico apply is blocked on manual namespace preprovisioning"
/// MESH-COMPOSITION.md §V install-path-fluency guarantee mandates, with no
/// diagnostic naming the seeder-toggle-drift root cause far from the
/// source caixa.lisp / the renderer's format-string template. Same shape
/// as the sibling [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`] (96581b7)
/// upgrade-path-only per-CR remediation-toggle leaf-scalar-key +
/// [`FLUX_HELMRELEASE_KEY_RETRIES`] (a12f9fc) leaf-scalar-key + peer
/// [`FLUX_HELMRELEASE_KEY_REMEDIATION`] (6fe4e7e) sub-container-axis-key +
/// [`FLUX_HELMRELEASE_KEY_INSTALL`] / [`FLUX_HELMRELEASE_KEY_UPGRADE`]
/// (7767c26) parent-container-axis-key pair lifts on the peer per-CR
/// HelmRelease-spec surface — extends the discipline from the sibling
/// upgrade-path-only per-CR remediation-toggle onto the mirror install-
/// path-only per-CR namespace-seeder-toggle at the `spec.install.*`
/// position mirroring the peer's `spec.upgrade.remediation.*` position.
pub use caixa_core::FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE;

/// Canonical Flux v2 `HelmRelease.spec.install.createNamespace` install-path-
/// only per-CR namespace-seeder-toggle scalar-value default the substrate
/// seeds into every per-caixa `helmrelease.yaml` document at the paired
/// [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] leaf-scalar-key axis. Re-
/// export of the canonical
/// [`caixa_core::FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT`] so the Flux
/// v2 helm-controller-side per-CR install-path per-CR namespace-seeder-
/// toggle scalar-value default lives in exactly one place across every
/// caixa renderer — [`cluster_bundle`]'s `helmrelease.yaml` format-
/// string template's per-CR install-path namespace-seeder-toggle scalar
/// under the [`FLUX_HELMRELEASE_KEY_INSTALL`]-keyed sub-block (the sole
/// production-code site the prior inline `createNamespace: true` scalar-
/// value literal sat at, alongside the [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`]-
/// keyed leaf-scalar-key half of the same `(leaf-key, scalar-value)`
/// pair) now threads the same `bool` through a `{create_namespace_default}`
/// named-arg interpolation, so a future substrate-side toggle migration
/// (`true` → `false` on hardened per-cluster classes where namespace
/// provisioning is an out-of-band operator gate; a per-caixa opt-out
/// slot the ABSORPTION-ROADMAP.md M4 typed-slot trajectory adds once the
/// substrate grows a `:install :create-namespace` author-side toggle) is
/// a one-line edit on the canonical
/// [`caixa_core::FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT`] declaration,
/// not a coordinated rewrite across the emit site + every future per-
/// target renderer the substrate adds. Pairs with the sibling
/// [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] re-export on the same per-CR
/// `spec.install.createNamespace` scalar-axis — the key half of the
/// per-CR scalar-key/scalar-value pair lives at
/// [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`], the value half's substrate-
/// side default seed lives here. Peer with the sibling
/// [`FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT`] mirror-symmetric
/// upgrade-path-only scalar-value default + the sibling
/// [`FLUX_KUSTOMIZATION_PRUNE_DEFAULT`] (ea857d8) scalar-value default
/// on the peer canonical-Flux-v2-per-CR-substrate-default surface — the
/// three defaults name the substrate's canonical (install-path
/// namespace-seeder) / (upgrade-path post-retry-exhaustion rollback) /
/// (garbage-collection-toggle) toggle triple across the per-caixa
/// `HelmRelease` and `Kustomization` co-resident CRs. All three are
/// substrate-side policy choices the operator inherits when the per-
/// caixa [`ClusterBundleOpts`] doesn't pin an override, and all three
/// must move together on any coordinated substrate-side Flux v2 per-CR
/// tuning-cycle promotion. Until this lift landed the axis carried an
/// inline `true` scalar-value literal at the sole production-code call
/// site plus the sibling test-fixture navigation site
/// ([`cluster_bundle_helmrelease_install_create_namespace_pins_lifted_true`]
/// pin's `assert!(create_namespace)` predicate) — two occurrences of the
/// same load-bearing Flux-v2-per-CR-install-path-namespace-seeder-
/// toggle-scalar-value convention, drift-prone by construction ahead of
/// the third occurrence the M4 `mesh.pleme.io/v1alpha1/Aplicacao` CR
/// materializer's per-Aplicacao `HelmRelease` synthesis will surface.
/// Same shape as the sibling [`caixa_core::DEFAULT_NAMESPACE`] /
/// [`caixa_core::DEFAULT_LIBRARY_NAME`] /
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] /
/// [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] /
/// [`caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] /
/// [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`] /
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] /
/// [`caixa_core::FLUX_KUSTOMIZATION_PRUNE_DEFAULT`] /
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT`]
/// re-exports on the peer canonical-substrate-default-load-bearing-
/// scalar surface.
pub use caixa_core::FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT;

/// Canonical Flux v2 `Kustomization.spec.prune` per-CR garbage-collection-
/// toggle leaf-scalar-key — re-export of the canonical
/// [`caixa_core::FLUX_KUSTOMIZATION_KEY_PRUNE`] so the Flux v2 kustomize-
/// controller-side per-CR garbage-collection-toggle leaf-scalar-key lives
/// in exactly one place across every caixa renderer. Peer to the sibling
/// [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] (ba9ab8b) install-path-only
/// per-CR namespace-seeder-toggle leaf-scalar-key on the co-resident
/// per-caixa `HelmRelease` CR — extends the per-CR-toggle leaf-scalar-key
/// discipline from the co-resident per-caixa `HelmRelease` CR spec surface
/// onto the co-resident per-caixa `Kustomization` CR spec surface at the
/// mirror-symmetric top-level `spec.prune` position. One production emit
/// site (this crate's [`cluster_bundle`] `kustomization.yaml` format-
/// string template's per-CR garbage-collection-toggle leaf under the
/// top-level `spec` position, threading the same `&'static str` through a
/// new `{prune_key}` named-arg interpolation) plus one test-fixture
/// navigation site in `mod tests` (the per-CR
/// [`cluster_bundle_kustomization_prune_pins_lifted_true`] pin's
/// `.get(FLUX_KUSTOMIZATION_KEY_PRUNE)` probe) now consult the same
/// `&'static str`. Until this lift landed the axis carried the load-
/// bearing `prune` bytes inline at the one production emit site; a
/// future hypothetical Flux v3 rename (`garbageCollect` / `sweep` /
/// `pruneOrphaned` / `deleteOrphans`) on the production-emit site
/// without a coordinated edit on every per-renderer consumer the
/// absorption roadmap surfaces (the M4 `mesh.pleme.io/v1alpha1/Aplicacao`
/// CR materializer's per-Aplicacao `Kustomization` synthesis) would have
/// silently dropped the substrate's chosen sweep-what-you-removed
/// semantic from every emitted per-caixa `Kustomization` document — the
/// kustomize-controller would then leave every per-caixa resource the
/// source manifest set previously reconciled but no longer carries
/// dangling in the cluster the substrate's "the cluster's per-caixa live
/// state converges to the caixa's tatara-lisp source-of-truth on every
/// reconcile — resources the source no longer carries are swept by the
/// kustomize-controller, not left dangling" CAIXA-SDLC.md §V author-to-
/// live-convergence guarantee mandates, with no diagnostic naming the
/// toggle-drift root cause far from the source caixa.lisp / the
/// renderer's format-string template. Same shape as the sibling
/// [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] (ba9ab8b) install-path-only
/// per-CR namespace-seeder-toggle leaf-scalar-key +
/// [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`] (96581b7) upgrade-
/// path-only per-CR remediation-toggle leaf-scalar-key +
/// [`FLUX_HELMRELEASE_KEY_RETRIES`] (a12f9fc) leaf-scalar-key + peer
/// [`FLUX_HELMRELEASE_KEY_REMEDIATION`] (6fe4e7e) sub-container-axis-key
/// + [`FLUX_HELMRELEASE_KEY_INSTALL`] / [`FLUX_HELMRELEASE_KEY_UPGRADE`]
/// (7767c26) parent-container-axis-key pair lifts on the peer per-CR
/// HelmRelease-spec surface — extends the discipline from the co-
/// resident per-`HelmRelease`-CR spec surface onto the co-resident per-
/// `Kustomization`-CR spec surface at the mirror-symmetric top-level
/// `spec.prune` position.
pub use caixa_core::FLUX_KUSTOMIZATION_KEY_PRUNE;

/// Canonical Flux v2 `Kustomization.spec.prune` per-CR garbage-collection-
/// toggle scalar-value default the substrate seeds into every per-caixa
/// `kustomization.yaml` document at the paired
/// [`FLUX_KUSTOMIZATION_KEY_PRUNE`] leaf-scalar-key axis. Re-export of
/// the canonical [`caixa_core::FLUX_KUSTOMIZATION_PRUNE_DEFAULT`] so the
/// Flux v2 kustomize-controller-side per-CR garbage-collection-toggle
/// scalar-value default lives in exactly one place across every caixa
/// renderer — [`cluster_bundle`]'s `kustomization.yaml` format-string
/// template's per-CR garbage-collection-toggle scalar under the top-level
/// `spec` position (the sole production-code site the prior inline
/// `prune: true` scalar-value literal sat at, alongside the
/// [`FLUX_KUSTOMIZATION_KEY_PRUNE`]-keyed leaf-scalar-key half of the
/// same `(leaf-key, scalar-value)` pair) now threads the same `bool`
/// through a `{prune_default}` named-arg interpolation, so a future
/// substrate-side toggle migration (`true` → `false` on a cluster class
/// where a human is expected to prune orphaned resources by hand once
/// per-cluster policy grows an "operator-driven cleanup" mode; a per-
/// caixa opt-out slot the ABSORPTION-ROADMAP.md M4 typed-slot
/// trajectory adds once the substrate grows a `:kustomization :prune`
/// author-side toggle) is a one-line edit on the canonical
/// [`caixa_core::FLUX_KUSTOMIZATION_PRUNE_DEFAULT`] declaration, not a
/// coordinated rewrite across the emit site + every future per-target
/// renderer the substrate adds. Pairs with the sibling
/// [`FLUX_KUSTOMIZATION_KEY_PRUNE`] re-export on the same per-CR
/// `spec.prune` scalar-axis — the key half of the per-CR scalar-key /
/// scalar-value pair lives at [`FLUX_KUSTOMIZATION_KEY_PRUNE`], the
/// value half's substrate-side default seed lives here. Same shape as
/// the sibling [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] (30dcdae)
/// scalar-value default re-export on the peer per-CR HelmRelease
/// remediation retry-cap axis — that default names the per-path per-CR
/// remediation retry ceiling, and this default names whether the
/// per-CR reconcile loop sweeps orphaned resources at all. Both are
/// substrate-side policy choices the operator inherits when the per-
/// caixa [`ClusterBundleOpts`] doesn't pin an override, and both must
/// move together on any coordinated substrate-side Flux v2 per-CR
/// tuning-cycle promotion. Until this lift landed the axis carried an
/// inline `true` scalar-value literal at the sole production-code call
/// site plus the sibling test-fixture navigation site
/// ([`cluster_bundle_kustomization_prune_pins_lifted_true`] pin's
/// `assert!(prune)` predicate) — two occurrences of the same load-
/// bearing Flux-v2-per-CR-garbage-collection-toggle-scalar-value
/// convention, drift-prone by construction ahead of the third
/// occurrence the M4 `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's
/// per-Aplicacao `Kustomization` synthesis will surface. Same shape as
/// the sibling [`caixa_core::DEFAULT_NAMESPACE`] /
/// [`caixa_core::DEFAULT_LIBRARY_NAME`] /
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] /
/// [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] /
/// [`caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] /
/// [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`] /
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`]
/// re-exports on the peer canonical-substrate-default-load-bearing-
/// scalar surface.
pub use caixa_core::FLUX_KUSTOMIZATION_PRUNE_DEFAULT;

/// Canonical substrate-side default for the
/// `HelmRelease.spec.values.<library>.enabled` child-chart-enablement
/// toggle scalar every [`cluster_bundle`]-emitted `helmrelease.yaml`
/// document seeds under its per-`{library_name}` values-overlay wrap
/// to force-on the paired [`caixa_core::DEFAULT_LIBRARY_NAME`] child
/// chart at the per-cluster `HelmRelease`-side apply step — re-export
/// of the canonical [`caixa_core::CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT`]
/// so the substrate-side child-chart-enablement-toggle scalar-value
/// default lives in exactly one place across every caixa renderer.
/// Pairs with the sibling [`caixa_core::HELM_VALUES_KEY_ENABLED`]
/// leaf-scalar-key half of the `(leaf-key, scalar-value)`
/// per-values-overlay child-chart-enablement-toggle declaration pair.
///
/// Peer with the sibling [`FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT`]
/// (be1904b), [`FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT`]
/// (be1904b), [`FLUX_KUSTOMIZATION_PRUNE_DEFAULT`] (ea857d8), and
/// [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`]
/// scalar-value defaults on the peer canonical-Flux-v2-per-CR-
/// substrate-default surface — the four sibling scalar-value defaults
/// name per-CR toggle-shape axes at the `HelmRelease.spec.install.*` /
/// `HelmRelease.spec.upgrade.*` / `HelmRelease.spec.upgrade.remediation.retries`
/// / `Kustomization.spec.prune` sub-block positions, and this scalar-
/// value default names the child-chart-enablement toggle at the deeper
/// `HelmRelease.spec.values.<library>.enabled` values-overlay position.
///
/// Until this lift landed the axis carried an inline `true` scalar-value
/// literal at the sole production-code call site (the `{enabled_key}: true`
/// leaf inside [`cluster_bundle`]'s `helmrelease.yaml` format-string
/// template's per-`{library_name}` wrap position) plus its paired
/// test-fixture navigation site's `Some(true)` assertion — two
/// occurrences of the same load-bearing values-overlay child-chart-
/// enablement-toggle-scalar-value convention, drift-prone by construction
/// ahead of the third occurrence the M4
/// `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's per-Aplicacao
/// `HelmRelease` synthesis will surface.
pub use caixa_core::CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT;

/// Canonical Flux v2 `Kustomization.spec.path` per-CR source-sub-tree
/// leaf-scalar-key — re-export of the canonical
/// [`caixa_core::FLUX_KUSTOMIZATION_KEY_PATH`] so the Flux v2 kustomize-
/// controller-side per-CR source-sub-tree leaf-scalar-key lives in
/// exactly one place across every caixa renderer. Peer to the sibling
/// co-resident [`FLUX_KUSTOMIZATION_KEY_PRUNE`] (8ec7917) per-CR
/// garbage-collection-toggle leaf-scalar-key on the same top-level
/// `spec` position of the emitted per-caixa `Kustomization` CR — extends
/// the per-`Kustomization`-CR-spec leaf-scalar-key discipline from the
/// co-resident garbage-collection-toggle axis onto the co-resident
/// source-sub-tree axis at the mirror-symmetric top-level `spec.path`
/// position. One production emit site (this crate's [`cluster_bundle`]
/// `kustomization.yaml` format-string template's per-CR source-sub-tree
/// leaf under the top-level `spec` position, threading the same
/// `&'static str` through a new `{path_key}` named-arg interpolation)
/// plus one test-fixture navigation site in `mod tests` (the per-CR
/// [`cluster_bundle_kustomization_path_pins_lifted_sub_tree`] pin's
/// `.get(FLUX_KUSTOMIZATION_KEY_PATH)` probe) now consult the same
/// `&'static str`. Until this lift landed the axis carried the load-
/// bearing `path` bytes inline at the one production emit site; a
/// future hypothetical Flux v3 rename (`sourcePath` / `manifestsPath` /
/// `sourceRoot`) on the production-emit site without a coordinated edit
/// on every per-renderer consumer the absorption roadmap surfaces (the
/// M4 `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's per-
/// Aplicacao `Kustomization` synthesis) would have silently unbound
/// every emitted per-caixa `Kustomization` from its paired per-caixa
/// sub-tree of the pleme-io k8s repository — the Flux v2 kustomize-
/// controller would then either reconcile the whole GitRepository root
/// (defaulting to `./` when the CR omits the leaf, pulling every
/// unrelated cluster's manifests through the wrong per-caixa
/// `Kustomization`) or refuse to reconcile at all (parking the CR at
/// `BuildFailed` naming the missing sub-tree far from the source
/// `caixa.lisp` / the renderer's format-string template).
pub use caixa_core::FLUX_KUSTOMIZATION_KEY_PATH;

/// Canonical substrate-side per-cluster / per-caixa
/// `Kustomization.spec.path` source-sub-tree scalar composer — re-export
/// of the canonical [`caixa_core::flux_kustomization_source_subtree`]
/// so the `./clusters/<cluster>/services/<nome>` GitRepository-relative
/// directory-tree seed every emitted per-caixa `kustomization.yaml`
/// document mounts under its lifted [`FLUX_KUSTOMIZATION_KEY_PATH`]
/// leaf-scalar-key lives at one composer across every caixa renderer.
///
/// Peer to [`FLUX_KUSTOMIZATION_KEY_PATH`] (613d7ed) — the leaf-scalar-
/// key half of the `spec.path` `(key, value)` per-CR pair — on the
/// paired value-half axis. Until this lift landed the two-axis
/// composition (the `./clusters/` per-cluster prefix + the `/services/`
/// per-caixa infix) sat as a verbatim inline
/// `format!("./clusters/{cluster}/services/{name}")` at the sole
/// [`cluster_bundle`] `kustomization.yaml` format-string production
/// emit site plus a mirror-symmetric verbatim inline
/// `format!("./clusters/{cluster}/services/{name}", …)` at its paired
/// `cluster_bundle_kustomization_path_pins_lifted_sub_tree` test-fixture
/// navigation site, with no compile-time link between the two sites and
/// no compile-time link ahead of the second production-emit occurrence
/// the M4 `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's per-
/// Aplicacao `Kustomization` synthesis will surface. Both sites now
/// consult the same canonical composer, so a future substrate-side
/// directory-tree axis rebrand (`clusters/` → `environments/` for a
/// multi-env-per-cluster axis extension, `services/` → `servicos/` for
/// a portuguese-canonical directory-name migration matching the sibling
/// `:servicos` slot spelling, a per-tenant scoping prefix for multi-
/// tenant Aplicacao hosting) is one edit at the composer, not a
/// coordinated sweep across every renderer's `spec.path` emit site.
/// Same shape as the sibling [`caixa_core::oci_chart_ref`] /
/// [`caixa_core::cilium_network_policy_name`] /
/// [`caixa_core::gateway_api_http_route_name`] composer re-exports on
/// the peer substrate-side canonical-load-bearing-scalar-that-consumers-
/// key-off axis.
pub use caixa_core::flux_kustomization_source_subtree;

/// Canonical Flux v2 `Kustomization.spec.timeout` per-CR reconcile
/// wall-clock cap leaf-scalar-key — re-export of the canonical
/// [`caixa_core::FLUX_KUSTOMIZATION_KEY_TIMEOUT`] so the Flux v2
/// kustomize-controller-side per-CR reconcile wall-clock cap leaf-
/// scalar-key lives in exactly one place across every caixa
/// renderer. Peer to the co-resident
/// [`FLUX_KUSTOMIZATION_KEY_PATH`] (613d7ed) per-CR source-sub-tree
/// leaf-scalar-key and [`FLUX_KUSTOMIZATION_KEY_PRUNE`] (8ec7917)
/// per-CR garbage-collection-toggle leaf-scalar-key on the same top-
/// level `spec` position of the emitted per-caixa `Kustomization` CR
/// — extends the per-`Kustomization`-CR-spec leaf-scalar-key
/// discipline from the co-resident source-sub-tree and garbage-
/// collection-toggle axes onto the co-resident reconcile wall-clock
/// cap axis at the mirror-symmetric top-level `spec.timeout`
/// position. One production emit site (this crate's
/// [`cluster_bundle`] `kustomization.yaml` format-string template's
/// per-CR reconcile wall-clock cap leaf under the top-level `spec`
/// position, threading the same `&'static str` through a new
/// `{timeout_key}` named-arg interpolation) plus one test-fixture
/// navigation site in `mod tests` (the per-CR
/// [`cluster_bundle_kustomization_timeout_pins_lifted_default`] pin's
/// `.get(FLUX_KUSTOMIZATION_KEY_TIMEOUT)` probe) now consult the same
/// `&'static str`. Until this lift landed the axis carried the load-
/// bearing `timeout` bytes inline at the one production emit site; a
/// future hypothetical Flux v3 rename (`deadline` / `reconcileTimeout`
/// / `maxDuration`) on the production-emit site without a coordinated
/// edit on every per-renderer consumer the absorption roadmap
/// surfaces (the M4 `mesh.pleme.io/v1alpha1/Aplicacao` CR
/// materializer's per-Aplicacao `Kustomization` synthesis) would have
/// silently stripped the substrate's chosen reconcile-ceiling
/// declaration from every emitted per-caixa `Kustomization` document
/// — the Flux v2 kustomize-controller would then fall back to the
/// upstream Flux v2 controller-side default cap, letting a
/// persistently-failing per-caixa manifest apply consume kustomize-
/// controller reconcile-loop cycles past the substrate's chosen
/// ceiling with no field naming the leaf-key-drift root cause far
/// from the source `caixa.lisp` / the renderer's format-string
/// template. Pairs with the sibling
/// [`DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] scalar-value half of the
/// same `(leaf-key, scalar-value)` per-path reconcile-ceiling-
/// declaration pair. Same shape as the sibling
/// [`FLUX_KUSTOMIZATION_KEY_PATH`] (613d7ed) /
/// [`FLUX_KUSTOMIZATION_KEY_PRUNE`] (8ec7917) /
/// [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`] (96581b7) /
/// [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] (ba9ab8b) leaf-scalar-
/// key re-exports on the peer per-Flux-v2-CR-spec-leaf-scalar-key
/// surface.
pub use caixa_core::FLUX_KUSTOMIZATION_KEY_TIMEOUT;

/// Canonical Flux v2 `Kustomization.spec.timeout` per-CR reconcile
/// wall-clock cap default the substrate seeds into every per-caixa
/// `kustomization.yaml` document. Re-export of the canonical
/// [`caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] so the Flux v2
/// kustomize-controller-side per-CR reconcile-ceiling default scalar-
/// value lives in exactly one place across every caixa renderer —
/// [`cluster_bundle`]'s `kustomization.yaml` format-string template's
/// sole production-code emit site (the prior inline `timeout: 5m`
/// scalar-value literal under the top-level `spec` position, keyed by
/// the sibling [`FLUX_KUSTOMIZATION_KEY_TIMEOUT`] leaf-scalar-key)
/// now consumes the same `&'static str` at emit time through one
/// `{timeout_default}` named-arg interpolation, so a future
/// substrate-side reconcile-ceiling migration (`"5m"` → `"3m"` on
/// faster per-caixa idempotency-checkpoint cadence, `"5m"` → `"10m"`
/// on larger per-caixa manifest sets — coordinated with the sibling
/// [`DEFAULT_FLUX_RECONCILE_INTERVAL`] reconcile-poll cadence tuning
/// cycle) is a one-line edit on the canonical
/// [`caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] declaration, not
/// a coordinated rewrite across the emit site + every future per-CR
/// reconcile-cap consumer the substrate adds. Pairs with the sibling
/// [`FLUX_KUSTOMIZATION_KEY_TIMEOUT`] re-export on the same per-CR
/// `spec.timeout` scalar-axis — the key half of the per-CR scalar-
/// key/scalar-value pair lives at [`FLUX_KUSTOMIZATION_KEY_TIMEOUT`],
/// the value half's substrate-side default seed lives here. Same
/// shape as the sibling [`DEFAULT_FLUX_RECONCILE_INTERVAL`] (908180f)
/// / [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] (30dcdae) re-
/// exports on the peer canonical-substrate-default-load-bearing-
/// scalar surface.
pub use caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT;

/// Canonical FluxCD installation namespace — re-export of the lifted
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] so the load-bearing
/// string lives in exactly one place across every consumer of the
/// rendered `kustomization.yaml`'s `metadata.namespace` and
/// `spec.sourceRef.name` axes. Both axes are the same conceptual "Flux
/// installation namespace" the `flux bootstrap` pipeline names; until
/// this lift landed they sat as two inline `flux-system` literals inside
/// [`cluster_bundle`]'s `kustomization.yaml` format-string template, and
/// any future per-edition Flux-installation-namespace rebrand on one
/// without a coordinated edit on the other would have silently emitted a
/// `Kustomization` outside the bootstrap controller's watch window or a
/// dangling `sourceRef`. Same shape as the
/// [`caixa_core::DEFAULT_NAMESPACE`] (a085b26) /
/// [`caixa_core::DEFAULT_LIBRARY_NAME`] (41438dc) /
/// [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`] (0a6a602) lifts on the peer
/// canonical-load-bearing-string surface.
pub use caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE;

/// Canonical FluxCD `HelmRelease` CRD `apiVersion` — re-export of the
/// lifted [`caixa_core::FLUX_HELMRELEASE_API_VERSION`] so the load-bearing
/// string lives in exactly one place across the rendered Flux bundle's
/// `helmrelease.yaml` document `apiVersion` axis + the rendered
/// `kustomization.yaml` document's `spec.healthChecks[].apiVersion` axis.
/// Both axes are the same conceptual "Flux v2 `HelmRelease` CRD group/
/// version" load-bearing string and must move together on any future
/// upstream Flux v3 migration; until this lift landed they sat as four
/// inline `helm.toolkit.fluxcd.io/v2` literals (two render-side at lines
/// 455, 504 + two test-fixture-side at lines 928, 970), and any future
/// per-Flux-v3-migration version bump on one without a coordinated edit
/// on the other would have silently routed the rendered `HelmRelease`
/// outside the controller's `Watches` (controller-side: never reconciled,
/// every dependent chart frozen at last-applied state) or made the
/// `Kustomization`'s health-check dangle (apply-side: the per-resource
/// health-gate never resolves, the parent Kustomization sits perpetually
/// in `Reconciling`). Same shape as the
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] (7197d38) lift on the
/// sibling Flux-installation-namespace axis.
pub use caixa_core::FLUX_HELMRELEASE_API_VERSION;

/// Canonical FluxCD `GitRepository` CRD `apiVersion` — re-export of the
/// lifted [`caixa_core::FLUX_GITREPOSITORY_API_VERSION`] so the load-bearing
/// string lives in exactly one place across the rendered Flux bundle's
/// `gitrepository.yaml` document `apiVersion` axis. Until this lift landed
/// the axis sat as an inline `source.toolkit.fluxcd.io/v1` literal at line
/// 436 of this crate's [`cluster_bundle`] format-string template, and any
/// future per-Flux-v3-migration version bump on this axis without a
/// coordinated edit on the sibling [`FLUX_HELMRELEASE_API_VERSION`] axis
/// would have silently routed the rendered `GitRepository` outside the
/// Flux v2 `source-controller`'s `Watches` (controller-side: never
/// reconciled, the dependent HelmRelease's `chart: sourceRef` dangles,
/// every per-Servico apply silently comes up with the prior reconciled
/// state). Same shape as the [`FLUX_HELMRELEASE_API_VERSION`] (55f0fd9) /
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] (7197d38) lifts on the
/// sibling Flux-v2-load-bearing-string axis.
pub use caixa_core::FLUX_GITREPOSITORY_API_VERSION;

/// Canonical FluxCD `Kustomization` CRD `apiVersion` — re-export of the
/// lifted [`caixa_core::FLUX_KUSTOMIZATION_API_VERSION`] so the load-
/// bearing string lives in exactly one place across the rendered Flux
/// bundle's `kustomization.yaml` document `apiVersion` axis. Completes
/// the Flux v2 controller-triplet (source-controller +
/// helm-controller + kustomize-controller) lift alongside the sibling
/// [`FLUX_GITREPOSITORY_API_VERSION`] (8a6c8a3) and
/// [`FLUX_HELMRELEASE_API_VERSION`] (55f0fd9) re-exports — every
/// per-controller CRD-group/version is now a typed substrate-side
/// `&'static str` consumed through one `pub use caixa_core::FLUX_*`
/// re-export.
///
/// Until this lift landed the axis sat as an inline
/// `kustomize.toolkit.fluxcd.io/v1` literal in this crate's
/// [`cluster_bundle`] `kustomization.yaml` format-string template,
/// and any future per-Flux-v3-migration version bump on this axis
/// without a coordinated edit on the sibling
/// [`FLUX_HELMRELEASE_API_VERSION`] / [`FLUX_GITREPOSITORY_API_VERSION`]
/// axes (the Flux v2 controller triplet's CRD group/versions move
/// together upstream) would have silently routed the rendered
/// `Kustomization` outside the Flux v2 `kustomize-controller`'s
/// `Watches` (apply-side: the parent Kustomization is never
/// reconciled, every dependent `HelmRelease` / `GitRepository` it
/// keys off sits perpetually un-applied at the cluster). Same shape
/// as the [`FLUX_GITREPOSITORY_API_VERSION`] (8a6c8a3) /
/// [`FLUX_HELMRELEASE_API_VERSION`] (55f0fd9) /
/// [`caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`] (7197d38) lifts on
/// the sibling Flux-v2-load-bearing-string axis.
pub use caixa_core::FLUX_KUSTOMIZATION_API_VERSION;

/// Canonical FluxCD `GitRepository` CRD `kind` discriminator — re-export
/// of the lifted [`caixa_core::FLUX_KIND_GIT_REPOSITORY`] so the load-
/// bearing string lives in exactly one place across the three rendered
/// Flux bundle axes that name the same K8s CRD discriminator:
///
///   - the rendered `gitrepository.yaml` document's top-level `kind`
///     axis (the GitRepository CR's own discriminator);
///   - the rendered `helmrelease.yaml` document's
///     `spec.chart.spec.sourceRef.kind` axis (pointing back at the
///     sibling GitRepository this chart sources from);
///   - the rendered `kustomization.yaml` document's `spec.sourceRef.kind`
///     axis (pointing back at the cluster's bootstrap GitRepository).
///
/// Until this lift landed the three axes sat as three inline
/// `GitRepository` literals across the [`cluster_bundle`] `gitrepo` +
/// `helmrelease` + `kustomization` format-string templates (caixa-flux
/// /src/lib.rs:505, 556, 591). The apiserver-side CRD resolution
/// contract is the `(apiVersion, kind)` tuple keyed against the
/// registered `CustomResourceDefinition`; a typo at any one of the three
/// call sites would have silently dangled the corresponding `sourceRef`
/// at apply time (the `helm-controller` never resolves a chart for the
/// HelmRelease, the `kustomize-controller` never reconciles the parent
/// Kustomization, every per-Servico apply silently comes up with the
/// prior reconciled state) with no diagnostic naming the kind-drift root
/// cause far from the source caixa.lisp. Same shape as the
/// [`FLUX_GITREPOSITORY_API_VERSION`] (8a6c8a3) /
/// [`FLUX_HELMRELEASE_API_VERSION`] (55f0fd9) /
/// [`FLUX_KUSTOMIZATION_API_VERSION`] (d2dd1b1) lifts on the sibling
/// apiVersion half of the same `(apiVersion, kind)` CRD-lookup tuple —
/// extends the discipline from the apiVersion axis of the Flux v2
/// source-controller CRD onto its kind axis.
pub use caixa_core::FLUX_KIND_GIT_REPOSITORY;

/// Canonical FluxCD `HelmRelease` CRD `kind` discriminator — re-export
/// of the lifted [`caixa_core::FLUX_KIND_HELM_RELEASE`] so the load-
/// bearing string lives in exactly one place across the two rendered
/// Flux bundle axes that name the same K8s CRD discriminator:
///
///   - the rendered `helmrelease.yaml` document's top-level `kind`
///     axis (the HelmRelease CR's own discriminator);
///   - the rendered `kustomization.yaml` document's
///     `spec.healthChecks[].kind` axis (pointing back at the sibling
///     HelmRelease the Kustomization health-gates on before declaring
///     its own reconcile complete).
///
/// Until this lift landed the two axes sat as two inline `HelmRelease`
/// literals across the [`cluster_bundle`] `helmrelease` + `kustomization`
/// format-string templates (caixa-flux/src/lib.rs:580, 631). The
/// apiserver-side CRD resolution contract is the `(apiVersion, kind)`
/// tuple keyed against the registered `CustomResourceDefinition`; a
/// typo at either of the two call sites would have silently lost the
/// apply-side resolution (top-level `kind` typos surface as "no kind
/// 'X' is registered" at apply parse time; the nested
/// `healthChecks[].kind` typo silently dangles the parent
/// Kustomization at `Reconciling` forever) with no diagnostic naming
/// the kind-drift root cause far from the source caixa.lisp. Same
/// shape as the [`FLUX_KIND_GIT_REPOSITORY`] (dbbcf29) /
/// [`FLUX_HELMRELEASE_API_VERSION`] (55f0fd9) /
/// [`FLUX_GITREPOSITORY_API_VERSION`] (8a6c8a3) /
/// [`FLUX_KUSTOMIZATION_API_VERSION`] (d2dd1b1) lifts on the sibling
/// Flux-v2-load-bearing-string axes — extends the kind-axis discipline
/// from the Flux v2 source-controller CRD onto the sibling Flux v2
/// helm-controller CRD.
pub use caixa_core::FLUX_KIND_HELM_RELEASE;

/// Canonical FluxCD `Kustomization` CRD `kind` discriminator — re-export
/// of the lifted [`caixa_core::FLUX_KIND_KUSTOMIZATION`] so the load-
/// bearing string lives in exactly one place across the rendered Flux
/// bundle's `Kustomization`-naming axis:
///
///   - the rendered `kustomization.yaml` document's top-level `kind`
///     axis (the Kustomization CR's own discriminator).
///
/// Until this lift landed the axis sat as an inline `Kustomization`
/// literal inside the [`cluster_bundle`] `kustomization` format-string
/// template (caixa-flux/src/lib.rs:651). The apiserver-side CRD
/// resolution contract is the `(apiVersion, kind)` tuple keyed against
/// the registered `CustomResourceDefinition`; a typo at this call site
/// would have surfaced at apply parse time as a non-self-locating "no
/// kind 'Kustomizaton' is registered for version
/// 'kustomize.toolkit.fluxcd.io/v1'" error, with the rendered parent
/// Kustomization never reconciling and every downstream per-Servico
/// `dependsOn` chain freezing at the kustomize-controller's CRD-lookup
/// boundary. Same shape as the [`FLUX_KIND_GIT_REPOSITORY`] (dbbcf29) /
/// [`FLUX_KIND_HELM_RELEASE`] (e24ea3c) /
/// [`FLUX_KUSTOMIZATION_API_VERSION`] (d2dd1b1) /
/// [`FLUX_GITREPOSITORY_API_VERSION`] (8a6c8a3) /
/// [`FLUX_HELMRELEASE_API_VERSION`] (55f0fd9) lifts on the sibling
/// Flux-v2-load-bearing-string axes — extends the kind-axis discipline
/// from the Flux v2 source-controller + helm-controller CRDs onto the
/// sibling Flux v2 kustomize-controller CRD, completing the
/// canonical-Flux-v2-CRD-kind-discriminator lift across the
/// source/helm/kustomize controller triplet.
pub use caixa_core::FLUX_KIND_KUSTOMIZATION;

/// Canonical Flux v2 per-`HelmRelease` inline-chart-template container-
/// axis key every `caixa-flux`-emitted `HelmRelease` document nests its
/// per-CR chart-template block under (`spec.chart` on `HelmRelease`). Re-
/// export of the canonical [`caixa_core::FLUX_KEY_CHART`] so the load-
/// bearing Flux-v2-helm-controller-side per-`HelmRelease` chart-template
/// container-axis key lives in exactly one place across every caixa
/// renderer — the sweep converts this crate's one production-code call
/// site (the [`cluster_bundle`] `helmrelease.yaml` format-string
/// template's baked `chart:\n` container-axis key nesting the
/// `HelmChartTemplate` sub-document whose peer sibling lifted
/// [`FLUX_KEY_SOURCE_REF`] source-reference container-axis + inner
/// chart-name-scalar reach through) plus the two test-fixture
/// `.get("chart")` navigation sites in `mod tests` that probe the
/// emitted `spec.chart.spec.sourceRef.kind` pin onto the re-export. A
/// future Flux v3 rebrand of the per-`HelmRelease` chart-template
/// container-axis key (a hypothetical upstream fluxcd/flux2 rename from
/// `chart` to `Chart` / `chartTemplate` / `helmChart` / `chartRef`,
/// coordinated with the upstream project's per-version deprecation
/// cycle) now lands at one const rather than scattered across the one
/// emit-side format-string template + two test-fixture probe sites.
/// Same "the typed constant lives in one place" discipline the peer
/// [`FLUX_KEY_SOURCE_REF`] + [`FLUX_KEY_VALUES`] re-exports enforce on
/// the sibling Flux v2 per-`HelmRelease` body-key surfaces — completes
/// the triplet of Flux v2 per-`HelmRelease` `spec.*` body-key constants
/// (`spec.chart` + `spec.chart.spec.sourceRef` + `spec.values`) the
/// `cluster_bundle` renderer threads through its `helmrelease.yaml`
/// format-string template.
pub use caixa_core::FLUX_KEY_CHART;

/// Canonical Flux v2 `HelmChartTemplate.spec.chart` per-CR chart-NAME-
/// reference leaf-scalar-axis key every `caixa-flux`-emitted
/// `HelmRelease` document nests inside the parent [`FLUX_KEY_CHART`]
/// container-axis (a nested [`KUBE_KEY_SPEC`] axis inside that
/// container hosts this leaf plus its sibling [`FLUX_KEY_SOURCE_REF`]
/// per-CR source-reference triple). Re-export of the canonical
/// [`caixa_core::FLUX_HELMCHART_TEMPLATE_KEY_CHART`] so the load-
/// bearing Flux-v2-helm-controller-side per-`HelmChartTemplate` chart-
/// NAME reference leaf-scalar-axis key lives in exactly one place
/// across every caixa renderer — the sweep converts this crate's one
/// production-code call site (the [`cluster_bundle`] `helmrelease.yaml`
/// format-string template's baked `chart: {chart_path}` leaf-scalar-
/// axis interpolation the peer sibling lifted [`FLUX_KEY_SOURCE_REF`]
/// source-reference triple's per-CR source-artifact publishes) onto
/// the re-export.
///
/// A future Flux v3 rebrand of the per-`HelmChartTemplate` chart-NAME
/// reference leaf-scalar-axis key (a hypothetical upstream fluxcd/flux2
/// rename from `chart` to `Chart` / `chartRef` / `chartName`,
/// coordinated with the upstream project's per-version deprecation
/// cycle) now lands at one const rather than scattered across the one
/// emit-side format-string template site. Same "the typed constant
/// lives in one place" discipline the peer [`FLUX_KEY_CHART`] +
/// [`FLUX_KEY_SOURCE_REF`] + [`FLUX_KEY_VALUES`] re-exports enforce
/// on the sibling Flux v2 per-`HelmRelease` body-key surfaces —
/// completes the per-`HelmRelease` chart-template `(spec.chart →
/// spec.chart.spec.chart + spec.chart.spec.sourceRef)` axis chain by
/// descending one level beneath the parent container-axis re-export
/// the sibling [`FLUX_KEY_CHART`] anchors.
///
/// Deliberate axis-independence discipline with the parent
/// [`FLUX_KEY_CHART`] container-axis re-export: both re-exports carry
/// the same underlying `"chart"` string today but name distinct schema
/// axes on the same CRD group (a container-axis parent vs a leaf-
/// scalar grandchild inside it), so the two `pub use` re-exports stay
/// sibling constants at the rustc symbol-name axis rather than
/// coalescing onto one canonical declaration. Peer to the deliberate
/// [`CILIUM_KEY_PATH`] / [`caixa_core::GATEWAY_API_KEY_PATH`] axis-
/// independence discipline the two-CRD-groups-sharing-a-string
/// sibling `"path"` re-exports established on the peer canonical-
/// axis-independence surface.
pub use caixa_core::FLUX_HELMCHART_TEMPLATE_KEY_CHART;

/// Canonical Flux v2 per-`HelmRelease`/`Kustomization` source-reference
/// container-axis key every `caixa-flux`-emitted bundle document mounts
/// its per-CR source-of-truth `(kind, name, namespace)` reference triple
/// under (`spec.chart.spec.sourceRef` on `HelmRelease`, `spec.sourceRef`
/// on `Kustomization`). Re-export of the canonical
/// [`caixa_core::FLUX_KEY_SOURCE_REF`] so the load-bearing Flux-v2-source-
/// controller-side per-CR source-reference container-axis key lives in
/// exactly one place across every caixa renderer — the sweep converts
/// this crate's two production emit sites (the [`cluster_bundle`]
/// `helmrelease.yaml` format-string template's baked
/// `spec.chart.spec.sourceRef:\n` sub-block header + the sibling
/// `kustomization.yaml` format-string template's baked
/// `spec.sourceRef:\n` sub-block header, both now threaded through a
/// `{source_ref_key}` named-arg interpolation on the lifted const, closing
/// the last two open production sites for this axis) plus the five
/// test-fixture `.get("sourceRef")` navigation sites in `mod tests` (the
/// `helmrelease.yaml` `spec.chart.spec.sourceRef.kind` pin, the
/// `kustomization.yaml` `spec.sourceRef.name` + `spec.sourceRef.kind`
/// pins under the paired [`DEFAULT_FLUX_SYSTEM_NAMESPACE`] +
/// [`FLUX_KIND_GIT_REPOSITORY`] canonical-string axes, and the two
/// cross-axis triplet pins that traverse both bundle documents to
/// pin the sibling `GitRepository`-kind axis triplet against one
/// canonical string) onto the re-export. A future Flux v3 rebrand of
/// the per-CR source-reference container-axis key (a hypothetical
/// upstream fluxcd/flux2 rename from `sourceRef` to `source` /
/// `sourceReference` / `sourceOf`, coordinated with the upstream
/// project's per-version deprecation cycle) now lands at one const
/// rather than scattered across the two per-CR format-string templates
/// + five test-fixture probe sites. Same "the typed constant lives in
/// one place" discipline the peer [`FLUX_KIND_GIT_REPOSITORY`] /
/// [`FLUX_KIND_HELM_RELEASE`] / [`FLUX_KIND_KUSTOMIZATION`] +
/// [`FLUX_HELMRELEASE_API_VERSION`] / [`FLUX_GITREPOSITORY_API_VERSION`]
/// / [`FLUX_KUSTOMIZATION_API_VERSION`] re-exports enforce on the
/// sibling canonical-Flux-v2-load-bearing-string surfaces.
pub use caixa_core::FLUX_KEY_SOURCE_REF;

/// Canonical Flux v2 per-`HelmRelease` values-override block-body-axis
/// key every `caixa-flux`-emitted `HelmRelease` document nests its per-
/// cluster value overrides under (`spec.values` on `HelmRelease`). Re-
/// export of the canonical [`caixa_core::FLUX_KEY_VALUES`] so the load-
/// bearing Flux-v2-helm-controller-side per-`HelmRelease` values-
/// override block-body-axis key lives in exactly one place across every
/// caixa renderer — the sweep converts this crate's one production-code
/// call site (the [`cluster_bundle`] `helmrelease.yaml` format-string
/// template's baked `values:\n` key beside the sibling lifted
/// [`DEFAULT_LIBRARY_NAME`] wrap key + [`HELM_VALUES_KEY_ENABLED`]
/// enable-toggle) plus the [`upsert_into_helmrelease_programs`]
/// upsert-path's `spec.values.programs[]` write-side navigation onto the
/// re-export, and threads three test-fixture `.get("values")` block-
/// body-axis probe sites in `mod tests` through the same const. A
/// future Flux v3 rebrand of the per-`HelmRelease` values-override
/// block-body-axis key (a hypothetical upstream fluxcd/flux2 rename
/// from `values` to `Values` / `chartValues` / `overrides`, coordinated
/// with the upstream project's per-version deprecation cycle) now lands
/// at one const rather than scattered across the one emit-side format-
/// string template + one upsert-side write-side navigation + three
/// test-fixture probe sites. Same "the typed constant lives in one
/// place" discipline the peer [`FLUX_KEY_SOURCE_REF`] +
/// [`FLUX_KIND_GIT_REPOSITORY`] / [`FLUX_KIND_HELM_RELEASE`] /
/// [`FLUX_KIND_KUSTOMIZATION`] + [`FLUX_HELMRELEASE_API_VERSION`] /
/// [`FLUX_GITREPOSITORY_API_VERSION`] / [`FLUX_KUSTOMIZATION_API_VERSION`]
/// re-exports enforce on the sibling canonical-Flux-v2-load-bearing-
/// string surfaces.
pub use caixa_core::FLUX_KEY_VALUES;

/// Canonical Flux v2 per-`Kustomization` health-gate reference-list
/// container-axis key every `caixa-flux`-emitted `kustomization.yaml`
/// document mounts its per-sibling-`HelmRelease` health-probe list under
/// (`spec.healthChecks` on `Kustomization`). Re-export of the canonical
/// [`caixa_core::FLUX_KEY_HEALTH_CHECKS`] so the load-bearing Flux-v2-
/// kustomize-controller-side per-`Kustomization` health-gate reference-
/// list container-axis key lives in exactly one place across every caixa
/// renderer — the sweep converts this crate's one production-code call
/// site (the [`cluster_bundle`] `kustomization.yaml` format-string
/// template's baked `healthChecks:\n` container-axis key nesting the
/// per-entry `[]NamespacedObjectKindReference` list whose peer sibling
/// lifted [`FLUX_HELMRELEASE_API_VERSION`] per-entry `apiVersion` axis +
/// [`FLUX_KIND_HELM_RELEASE`] per-entry `kind` axis the health-gate
/// references) plus the three test-fixture `.get("healthChecks")`
/// navigation sites in `mod tests` that probe the emitted per-entry
/// `apiVersion` + `kind` pin onto the re-export. A future Flux v3 rebrand
/// of the per-`Kustomization` health-gate reference-list container-axis
/// key (a hypothetical upstream fluxcd/flux2 rename from `healthChecks`
/// to `HealthChecks` / `healthchecks` / `healthcheck` / `health_checks`
/// / `probes`, coordinated with the upstream project's per-version
/// deprecation cycle) now lands at one const rather than scattered across
/// the one emit-side format-string template + three test-fixture probe
/// sites. Same "the typed constant lives in one place" discipline the
/// peer [`FLUX_KEY_SOURCE_REF`] + [`FLUX_KEY_CHART`] + [`FLUX_KEY_VALUES`]
/// re-exports enforce on the sibling Flux v2 per-`HelmRelease` +
/// per-`Kustomization` body-key surfaces — completes the quartet of Flux
/// v2 `spec.*` body-key constants (`spec.chart` + `spec.chart.spec.sourceRef`
/// + `spec.values` + `spec.healthChecks`) the `cluster_bundle` renderer
/// threads through its two format-string templates.
pub use caixa_core::FLUX_KEY_HEALTH_CHECKS;

/// Canonical Flux v2 per-CR reconcile-poll cadence scalar-axis key every
/// `caixa-flux`-emitted Flux document (`GitRepository`, `HelmRelease`,
/// `Kustomization`) declares its per-CR `spec.interval` reconcile cadence
/// under. Re-export of the canonical [`caixa_core::FLUX_KEY_INTERVAL`] so
/// the load-bearing Flux-v2-controller-triplet-side per-CR reconcile-poll
/// cadence scalar-axis key lives in exactly one place across every caixa
/// renderer — the sweep converts this crate's three production-code call
/// sites (the [`cluster_bundle`] `gitrepository.yaml` + `helmrelease.yaml`
/// + `kustomization.yaml` format-string templates' baked `interval:`
/// scalar-axis keys, one per Flux v2 CRD kind, nested alongside the peer
/// sibling lifted per-CR `apiVersion` + `kind` axis re-exports on this
/// crate — [`FLUX_GITREPOSITORY_API_VERSION`] + [`FLUX_KIND_GIT_REPOSITORY`]
/// on the source-controller CRD, [`FLUX_HELMRELEASE_API_VERSION`] +
/// [`FLUX_KIND_HELM_RELEASE`] on the helm-controller CRD, and
/// [`FLUX_KUSTOMIZATION_API_VERSION`] + [`FLUX_KIND_KUSTOMIZATION`] on the
/// kustomize-controller CRD) onto the re-export. A future Flux v3 rebrand
/// of the per-CR reconcile-poll cadence scalar-axis key (a hypothetical
/// upstream fluxcd/flux2 rename from `interval` to `Interval` / `period`
/// / `cadence` / `pollInterval` / `reconcileInterval`, coordinated with
/// the upstream project's per-version deprecation cycle) now lands at one
/// const rather than scattered across three per-CR emit-side format-string
/// template sites. Same "the typed constant lives in one place" discipline
/// the peer [`FLUX_KEY_SOURCE_REF`] + [`FLUX_KEY_CHART`] + [`FLUX_KEY_VALUES`]
/// + [`FLUX_KEY_HEALTH_CHECKS`] re-exports enforce on the sibling Flux v2
/// per-CR body-key surfaces — extends the per-CR body-key lift trajectory
/// onto the sibling *cross-CR-shared* reconcile-poll cadence scalar-axis
/// every Flux v2 controller reads to bind its per-CR poll cycle.
pub use caixa_core::FLUX_KEY_INTERVAL;

/// Canonical Flux v2 per-`GitRepository` `spec.ref.tag` git-tag-
/// selector scalar-axis key every [`cluster_bundle`]-rendered
/// `gitrepository.yaml` document declares on the tag-arm of the
/// [`GitRefSpec`] discriminated-union. Re-export of the canonical
/// [`caixa_core::FLUX_GITREPOSITORY_REF_KEY_TAG`] so the sub-selector
/// byte-string lives in exactly one place: the two consumer sites
/// (the YAML emit-side `gitref_field` composer and the human-readable
/// `tag_human` narrator prose) both now read through the lifted
/// [`GitRefSpec::ref_field_name`] dispatch that maps the tag-arm of
/// the discriminated-union onto this canonical scalar. Pairs with
/// [`FLUX_GITREPOSITORY_REF_KEY_BRANCH`] +
/// [`FLUX_GITREPOSITORY_REF_KEY_COMMIT`] on the sibling per-shape arms
/// of the same FluxCD source-controller `GitRepository.spec.ref`
/// discriminated-union axis — three consts, one per arm, one canonical
/// dispatch. See the caixa-core docstring for the full lift rationale.
pub use caixa_core::FLUX_GITREPOSITORY_REF_KEY_TAG;

/// Canonical Flux v2 per-`GitRepository` `spec.ref.branch` git-branch-
/// selector scalar-axis key — peer of [`FLUX_GITREPOSITORY_REF_KEY_TAG`]
/// on the branch-arm of the [`GitRefSpec`] discriminated-union.
/// Re-export of [`caixa_core::FLUX_GITREPOSITORY_REF_KEY_BRANCH`]; see
/// [`FLUX_GITREPOSITORY_REF_KEY_TAG`] for the full lift rationale.
pub use caixa_core::FLUX_GITREPOSITORY_REF_KEY_BRANCH;

/// Canonical Flux v2 per-`GitRepository` `spec.ref.commit` git-commit-
/// selector scalar-axis key — peer of [`FLUX_GITREPOSITORY_REF_KEY_TAG`]
/// on the commit-arm of the [`GitRefSpec`] discriminated-union.
/// Re-export of [`caixa_core::FLUX_GITREPOSITORY_REF_KEY_COMMIT`]; see
/// [`FLUX_GITREPOSITORY_REF_KEY_TAG`] for the full lift rationale.
pub use caixa_core::FLUX_GITREPOSITORY_REF_KEY_COMMIT;

/// Canonical Flux v2 per-`GitRepository` `spec.ref` ref-selection
/// discriminated-union parent container-axis key every
/// [`cluster_bundle`]-rendered `gitrepository.yaml` document mounts
/// its per-shape `{tag, branch, commit}` sub-selector arm under.
/// Re-export of the canonical
/// [`caixa_core::FLUX_GITREPOSITORY_KEY_REF`] so the container-axis
/// byte-string lives in exactly one place across every consumer:
/// the writer-side `cluster_bundle` `gitrepo` template composer's
/// `ref:` sub-block header (the sole production emission site the
/// prior inline `"ref:"` literal sat at) + the peer test-fixture
/// `.get("ref")` sub-selector traversal (the sole test-side reader
/// site the prior inline `"ref"` literal sat at) both now navigate
/// through the same `&'static str`. Nests one level above the
/// sibling [`FLUX_GITREPOSITORY_REF_KEY_TAG`] /
/// [`FLUX_GITREPOSITORY_REF_KEY_BRANCH`] /
/// [`FLUX_GITREPOSITORY_REF_KEY_COMMIT`] per-shape arm sub-selector
/// triple it wraps — the parent container-axis KEY now moves
/// through one lifted const alongside its already-lifted per-shape
/// arm sub-selector-KEY triple, so a future Flux v3 sub-schema
/// rebrand (an upstream `fluxcd/flux2` rename of the ref-selection
/// container-axis from `spec.ref` to `spec.gitRef` /
/// `spec.source.ref`) lands as one const edit coordinated with the
/// sibling per-shape arm lifts. See the caixa-core docstring for the
/// full lift rationale.
pub use caixa_core::FLUX_GITREPOSITORY_KEY_REF;

/// Canonical Flux v2 per-`GitRepository` `spec.url` remote-repo-URL
/// leaf-scalar-axis key every [`cluster_bundle`]-rendered
/// `gitrepository.yaml` document declares. Re-export of the canonical
/// [`caixa_core::FLUX_GITREPOSITORY_KEY_URL`] so the byte-string lives
/// in exactly one place: the writer-side `cluster_bundle` `gitrepo`
/// template composer's `url:` sub-key (the sole production emission
/// site the prior inline `"url:"` literal sat at). Sibling to the
/// already-lifted [`FLUX_GITREPOSITORY_KEY_REF`] on the peer per-CR
/// `spec.ref` container-axis surface — these two constants together
/// with the reconcile-cadence [`FLUX_KEY_INTERVAL`] enumerate the
/// canonical `GitRepository.spec.*` per-CR sub-block key surface
/// caixa-flux emits today. See the caixa-core docstring for the full
/// lift rationale.
pub use caixa_core::FLUX_GITREPOSITORY_KEY_URL;

/// Canonical Flux v2 per-cluster-bundle `HelmRelease` document filename
/// every [`cluster_bundle`]-rendered `BundleFile` carries at its per-file
/// `path` axis — re-export of the lifted
/// [`caixa_core::FLUX_HELMRELEASE_YAML_FILENAME`] so the fixed filename
/// the cluster-side FluxCD `kustomize-controller` looks up when it opens
/// the per-Servico bundle directory lives in exactly one place across
/// every caixa renderer. The single source of truth all thirteen
/// consumers reach for — one production [`cluster_bundle`] `BundleFile`
/// assembly's `HelmRelease` document `path` axis plus a dozen test-side
/// round-trip navigators that reach into the rendered bundle by the
/// same filename to pin per-CR body-axis emission — now consult the
/// same `&'static str`. Pin the equality + `&'static` static-data
/// identity so any local re-introduction of a sibling `pub const
/// FLUX_HELMRELEASE_YAML_FILENAME: &str = "…"` at this crate is a
/// build-time test failure naming the offending drift, not a silent
/// FluxCD `kustomize-controller` "no `HelmRelease` document found under
/// this bundle" reroute at cluster-side reconcile time far from the
/// drift site. Peer to the [`HELM_CHART_YAML_FILENAME`]
/// (`caixa_core::HELM_CHART_YAML_FILENAME`, c2c99b0) /
/// [`HELM_VALUES_YAML_FILENAME`] (`caixa_core::HELM_VALUES_YAML_FILENAME`,
/// 9a980ba) re-exports on the sibling Helm-chart-directory filename
/// surfaces — pivots the canonical-filename single-sourcing discipline
/// from the per-Helm-chart-directory metadata / values file axes onto
/// the sibling per-Flux-v2-bundle `HelmRelease` document filename axis
/// this crate's [`cluster_bundle`] renders.
pub use caixa_core::FLUX_HELMRELEASE_YAML_FILENAME;

/// Canonical Flux v2 per-cluster-bundle `GitRepository` document
/// filename every [`cluster_bundle`]-rendered `BundleFile` carries at
/// its per-file `path` axis — re-export of the lifted
/// [`caixa_core::FLUX_GITREPOSITORY_YAML_FILENAME`] so the fixed
/// filename the cluster-side FluxCD `source-controller` looks up when
/// it opens the per-Servico bundle directory lives in exactly one
/// place across every caixa renderer. Pairs with the sibling
/// [`FLUX_HELMRELEASE_YAML_FILENAME`] +
/// [`FLUX_KUSTOMIZATION_YAML_FILENAME`] re-exports to close the
/// per-bundle `(gitrepository, helmrelease, kustomization)` filename
/// axis triple every rendered cluster bundle carries — the single
/// source of truth all nine consumers reach for (one production
/// [`cluster_bundle`] `BundleFile` assembly's `GitRepository`
/// document `path` axis plus eight test-side round-trip navigators
/// that reach into the rendered bundle by the same filename to pin
/// per-CR body-axis emission) now consult the same `&'static str`.
/// Pin the equality + `&'static` static-data identity so any local
/// re-introduction of a sibling `pub const
/// FLUX_GITREPOSITORY_YAML_FILENAME: &str = "…"` at this crate is a
/// build-time test failure naming the offending drift, not a silent
/// FluxCD `source-controller` "no `GitRepository` document found
/// under this bundle" reroute at cluster-side reconcile time far
/// from the drift site. Peer to the sibling
/// [`FLUX_HELMRELEASE_YAML_FILENAME`] (ba7b0b2) re-export — extends
/// the canonical-Flux-v2-bundle-filename lifted-const discipline from
/// the middle coordinate of the filename triple onto its first
/// coordinate.
pub use caixa_core::FLUX_GITREPOSITORY_YAML_FILENAME;

/// Canonical Flux v2 per-cluster-bundle `Kustomization` document
/// filename every [`cluster_bundle`]-rendered `BundleFile` carries at
/// its per-file `path` axis — re-export of the lifted
/// [`caixa_core::FLUX_KUSTOMIZATION_YAML_FILENAME`] so the fixed
/// filename the cluster-side FluxCD `kustomize-controller` looks up
/// when it opens the per-Servico bundle directory lives in exactly
/// one place across every caixa renderer. Pairs with the sibling
/// [`FLUX_GITREPOSITORY_YAML_FILENAME`] +
/// [`FLUX_HELMRELEASE_YAML_FILENAME`] re-exports to close the
/// per-bundle `(gitrepository, helmrelease, kustomization)` filename
/// axis triple every rendered cluster bundle carries — the single
/// source of truth all sixteen consumers reach for (one production
/// [`cluster_bundle`] `BundleFile` assembly's `Kustomization`
/// document `path` axis plus fifteen test-side round-trip navigators
/// that reach into the rendered bundle by the same filename to pin
/// per-CR body-axis emission) now consult the same `&'static str`.
/// Pin the equality + `&'static` static-data identity so any local
/// re-introduction of a sibling `pub const
/// FLUX_KUSTOMIZATION_YAML_FILENAME: &str = "…"` at this crate is a
/// build-time test failure naming the offending drift, not a silent
/// FluxCD `kustomize-controller` "no `Kustomization` document found
/// under this bundle" reroute at cluster-side reconcile time far
/// from the drift site. Peer to the sibling
/// [`FLUX_HELMRELEASE_YAML_FILENAME`] (ba7b0b2) +
/// [`FLUX_GITREPOSITORY_YAML_FILENAME`] (this commit) re-exports —
/// closes the canonical-Flux-v2-bundle-filename lifted-const
/// discipline on the third coordinate of the filename triple.
pub use caixa_core::FLUX_KUSTOMIZATION_YAML_FILENAME;

/// Canonical Helm library-chart name every `lareira-<nome>` chart
/// depends on — re-export of the lifted [`caixa_core::DEFAULT_LIBRARY_NAME`]
/// so the load-bearing string lives in exactly one place across every
/// caixa renderer. The wrap key the `cluster_bundle` `helmrelease.yaml`
/// template uses under `spec.values.<library>:` to thread the per-cluster
/// overrides through to the rendered chart's dep block must match the
/// peer `caixa-helm` chart's `dependencies[0].name` axis exactly
/// (Helm's per-dep alias convention scopes values under the dep's
/// `name:` when no `alias:` is set), and both axes now consult the same
/// `&'static str`. Same shape as the [`caixa_core::DEFAULT_NAMESPACE`]
/// (a085b26) / [`caixa_core::DEFAULT_SERVICO_PORT`] (1e22add) lifts on
/// the peer canonical-K8s-axis-constant surface.
pub use caixa_core::DEFAULT_LIBRARY_NAME;

/// Canonical `pleme-computeunit` library-chart values-block enable-toggle
/// key — re-export of the lifted [`caixa_core::HELM_VALUES_KEY_ENABLED`]
/// so the values-block enable-toggle every rendered `HelmRelease` /
/// upstream `values.yaml` carries under its [`DEFAULT_LIBRARY_NAME`] wrap
/// key lives in exactly one place across every caixa renderer. The single
/// production-code call site consuming it is [`cluster_bundle`]'s
/// `helmrelease.yaml` format-string template (formerly an inline
/// `enabled: true\n` literal at `caixa-flux/src/lib.rs:844`); the peer
/// test-side round-trip navigator
/// (`cluster_bundle_helmrelease_wraps_library_values_under_lifted_default_library_name`)
/// also consults the re-export so a rebrand of the library-chart's per-
/// values enable-toggle axis lands at one const and reaches every
/// consumer by construction. A drifted local
/// `pub const HELM_VALUES_KEY_ENABLED: &str = "…"` (or any sibling per-
/// renderer variant that inlined a stale `"enabled"` / `"enable"` /
/// `"disabled"` literal) would silently emit a `HelmRelease` whose per-
/// cluster override lands under one key while
/// [`caixa_helm::build_values_yaml`]'s default-off toggle inside the
/// rendered `values.yaml` lands under another — Helm's per-values merge
/// treats them as sibling scalars, the enable-toggle the library chart's
/// own template consults never sees the flip, and the workload silently
/// comes up with the library chart's admission-time defaults instead of
/// the per-cluster override the operator set. Same shape as the
/// [`DEFAULT_LIBRARY_NAME`] / [`KUBE_KEY_SPEC`] / [`FLUX_HELMRELEASE_API_VERSION`]
/// re-exports on the sibling canonical-Helm-load-bearing-string /
/// canonical-K8s-CR-body-key / canonical-Flux-CRD-apiVersion axes.
pub use caixa_core::HELM_VALUES_KEY_ENABLED;

/// Canonical K8s CR top-level `spec` key. Re-export of the canonical
/// [`caixa_core::KUBE_KEY_SPEC`] so the per-kind body key lives in
/// exactly one place across every caixa renderer — caixa-flux's
/// `programs_yaml_entry` (the upstream ComputeUnit YAML's
/// `spec.*` axis the rendered programs.yaml entry splices from),
/// `upsert_into_helmrelease_programs` (the canonical
/// `spec.values.programs[]` path the `lareira-fleet-programs`
/// HelmRelease keys the per-Servico entry list under), and each of the
/// three [`cluster_bundle`] format-string templates' four `spec:`
/// YAML label positions (`gitrepository.yaml` top-level +
/// `helmrelease.yaml` top-level + `helmrelease.yaml` `spec.chart.spec`
/// nested + `kustomization.yaml` top-level) all consult the same
/// `&'static str` as the peer caixa-mesh / caixa-helm renderers'
/// `KUBE_KEY_SPEC` re-exports. The prior inline `"spec"` literals at
/// the production-code call sites would have let a typo on one site
/// (e.g. `"Spec"`, `"specs"`, `"spec_"`) silently emit a
/// programs.yaml entry that no `lareira-fleet-programs` schema
/// validator recognizes; the `Error::MissingField("spec")` paths now
/// thread the same `&'static str` through the diagnostic surface so
/// the error message stays byte-identical to the key it failed to
/// find. Same shape as the [`FLUX_HELMRELEASE_API_VERSION`] /
/// [`DEFAULT_LIBRARY_NAME`] re-exports on the sibling
/// canonical-Flux-load-bearing-string axes. Peer with the sibling
/// [`KUBE_KEY_METADATA`] / [`KUBE_KEY_KIND`] /
/// [`KUBE_KEY_API_VERSION`] re-exports on the other three canonical
/// K8s-CR top-level block-scope label axes the `cluster_bundle`
/// format-string templates thread through named-arg interpolation.
pub use caixa_core::KUBE_KEY_SPEC;

/// Canonical K8s CR top-level `metadata` key. Re-export of the canonical
/// [`caixa_core::KUBE_KEY_METADATA`] so the per-kind metadata block key
/// lives in exactly one place across every caixa renderer — caixa-flux's
/// `programs_yaml_entry` (the upstream ComputeUnit YAML's `metadata.namespace`
/// axis the rendered programs.yaml entry's `namespace` field reads from)
/// now consults the same `&'static str` as the peer caixa-mesh renderer's
/// `KUBE_KEY_METADATA` re-export. The prior inline `"metadata"` literals
/// at the production-code + drift-detection call sites would have let a
/// typo on one site (e.g. `"Metadata"`, `"meta-data"`, `"medadata"`)
/// silently miss the ComputeUnit's `metadata.namespace` lookup and fall
/// back to `DEFAULT_NAMESPACE` even when the ComputeUnit YAML pinned a
/// distinct target namespace; the lift routes every K8s-CR-top-level-
/// metadata-axis retrieval through the same `&'static str` so drift
/// between any two sites becomes a single-edit fix at the caixa-core
/// const definition. Same shape as the [`KUBE_KEY_SPEC`] re-export on
/// the sibling K8s-CR top-level-spec-axis.
pub use caixa_core::KUBE_KEY_METADATA;

/// Canonical K8s CR top-level `kind` key. Re-export of the canonical
/// [`caixa_core::KUBE_KEY_KIND`] so the per-CR-kind-axis discriminator
/// key lives in exactly one place across every caixa renderer —
/// caixa-flux's `cluster_bundle` drift-detection pins that traverse the
/// rendered `gitrepository.yaml` / `helmrelease.yaml` / `kustomization.yaml`
/// documents to assert the top-level `kind` + nested `sourceRef.kind`
/// / `healthChecks[].kind` axes bind to the lifted
/// [`FLUX_KIND_GIT_REPOSITORY`] / [`FLUX_KIND_HELM_RELEASE`] /
/// [`FLUX_KIND_KUSTOMIZATION`] discriminators now consult the same
/// `&'static str` as the peer caixa-mesh renderer's `KUBE_KEY_KIND`
/// re-export (615a13d). The prior inline `"kind"` literals at every
/// drift-detection cross-axis-pin call site in this crate would have let
/// a typo on any one site (e.g. `"Kind"`, `"kinds"`, `"knid"`) silently
/// miss the per-CR kind-axis retrieval — the equality assertion would
/// then compare `None` against `Some("GitRepository")` /
/// `Some("HelmRelease")` / `Some("Kustomization")` rather than the
/// expected discriminator, masking the sibling `FLUX_KIND_*` re-export
/// drift the pin was meant to catch under a `.expect("… present")` panic
/// on the missing `.and_then` chain. The lift routes every K8s-CR-
/// top-level-kind-axis retrieval through the same `&'static str` so
/// drift between any two sites becomes a single-edit fix at the
/// caixa-core const definition. Same shape as the [`KUBE_KEY_SPEC`] +
/// [`KUBE_KEY_METADATA`] re-exports on the sibling K8s-CR top-level-spec
/// / top-level-metadata axes — completes the per-K8s-CR top-level
/// `(spec, metadata, kind)` axis re-export triple every rendered Flux
/// bundle document navigates.
pub use caixa_core::KUBE_KEY_KIND;

/// Canonical K8s CR top-level `apiVersion` key. Re-export of the
/// canonical [`caixa_core::KUBE_KEY_API_VERSION`] so the per-CR-
/// group/version-axis discriminator key lives in exactly one place
/// across every caixa renderer — caixa-flux's [`cluster_bundle`]
/// drift-detection pins that traverse the rendered
/// `gitrepository.yaml` / `helmrelease.yaml` / `kustomization.yaml`
/// documents to assert the top-level `apiVersion` axis + the
/// `kustomization.yaml`'s nested `spec.healthChecks[].apiVersion`
/// axis bind to the lifted [`FLUX_GITREPOSITORY_API_VERSION`] /
/// [`FLUX_HELMRELEASE_API_VERSION`] / [`FLUX_KUSTOMIZATION_API_VERSION`]
/// controller-triplet CRD-group/versions now consult the same
/// `&'static str` as the sibling [`KUBE_KEY_SPEC`] / [`KUBE_KEY_METADATA`]
/// / [`KUBE_KEY_KIND`] re-exports on the peer K8s-CR top-level axes.
/// The prior inline `"apiVersion"` literals at every drift-detection
/// cross-axis-pin call site in this crate would have let a typo on
/// any one site (e.g. `"ApiVersion"`, `"api_version"`, `"apiversion"`,
/// `"apiVer"`) silently miss the per-CR apiVersion-axis retrieval —
/// the equality assertion would then compare `None` against
/// `Some("source.toolkit.fluxcd.io/v1")` /
/// `Some("helm.toolkit.fluxcd.io/v2")` /
/// `Some("kustomize.toolkit.fluxcd.io/v1")` rather than the expected
/// controller-triplet CRD-group/version, masking the sibling
/// `FLUX_*_API_VERSION` re-export drift the pin was meant to catch
/// under a `.expect("… present")` panic on the missing `.and_then`
/// chain. The lift routes every K8s-CR top-level-apiVersion-axis
/// retrieval through the same `&'static str` so drift between any
/// two sites becomes a single-edit fix at the caixa-core const
/// definition, extending the discipline the sibling [`KUBE_KEY_SPEC`]
/// / [`KUBE_KEY_METADATA`] / [`KUBE_KEY_KIND`] re-exports establish
/// onto the last of the four K8s-CR top-level axes (`apiVersion`,
/// `kind`, `metadata`, `spec`) every rendered Flux v2 bundle
/// document declares — completes the per-K8s-CR top-level
/// `(apiVersion, kind, metadata, spec)` axis re-export quartet
/// across this crate.
pub use caixa_core::KUBE_KEY_API_VERSION;

/// Canonical K8s CR `metadata.namespace` key. Re-export of the canonical
/// [`caixa_core::KUBE_KEY_NAMESPACE`] so the per-CR namespace-axis key
/// lives in exactly one place across every caixa renderer — caixa-flux's
/// [`programs_yaml_entry`] threads the ComputeUnit YAML's
/// `metadata.namespace` retrieval and the emitted `programs:[]` entry's
/// isomorphic `namespace:` field (the `lareira-fleet-programs` chart's
/// per-Servico namespace axis, populated verbatim from the ComputeUnit's
/// `metadata.namespace` per the docstring on `programs_yaml_entry` above)
/// through this key, [`cluster_bundle`]'s rendered `kustomization.yaml`
/// drift-detection pin traverses the emitted document's
/// `metadata.namespace` axis to assert it binds to the lifted
/// [`DEFAULT_FLUX_SYSTEM_NAMESPACE`] (the bootstrap kustomize-
/// controller's watch window) through this same key, and each of the
/// three [`cluster_bundle`] format-string templates' five `namespace:`
/// YAML label positions — `gitrepository.yaml` top-level
/// `metadata.namespace`, `helmrelease.yaml` top-level
/// `metadata.namespace` + nested `spec.chart.spec.sourceRef.namespace`,
/// `kustomization.yaml` top-level `metadata.namespace` + nested
/// `spec.healthChecks[].namespace` — thread this `&'static str`
/// through named-arg interpolation instead of the prior five inline
/// `namespace:` label literals.
///
/// The prior inline `"namespace"` literals at the production-code
/// (`programs_yaml_entry` read + write) and drift-detection call sites
/// would have let a typo on any one site (e.g. `"Namespace"`,
/// `"name space"`, `"namesapce"`, the canonical transposition) silently
/// miss the ComputeUnit's `metadata.namespace` lookup and fall back to
/// [`DEFAULT_NAMESPACE`] even when the ComputeUnit YAML pinned a
/// distinct target namespace, or write a `namesapce:` key that no
/// `lareira-fleet-programs` schema validator recognizes, or mask a
/// drifted [`DEFAULT_FLUX_SYSTEM_NAMESPACE`] regression by returning
/// `None` from the `.get("namesapce")` retrieval so the equality
/// assertion never sees the true axis value under the `.expect(…)`
/// panic on the missing `.and_then` chain. The lift routes every
/// K8s-CR-`metadata.namespace`-axis retrieval / emission through the
/// same `&'static str` so drift between any two sites becomes a
/// single-edit fix at the caixa-core const definition. Same shape as
/// the [`KUBE_KEY_METADATA`] / [`KUBE_KEY_SPEC`] / [`KUBE_KEY_KIND`] /
/// [`KUBE_KEY_API_VERSION`] re-exports on the sibling K8s-CR top-level
/// axes — extends the discipline the top-level `(apiVersion, kind,
/// metadata, spec)` axis re-export quartet establishes onto the
/// canonical `metadata.namespace` nested axis every rendered Flux v2
/// bundle document navigates.
pub use caixa_core::KUBE_KEY_NAMESPACE;

/// Canonical K8s CR `metadata.name` key. Re-export of the canonical
/// [`caixa_core::KUBE_KEY_NAME`] so the per-CR name-axis key lives in
/// exactly one place across every caixa renderer. Each of the three
/// [`cluster_bundle`] format-string templates' six `name:` YAML label
/// positions — `gitrepository.yaml` top-level `metadata.name`,
/// `helmrelease.yaml` top-level `metadata.name` + nested
/// `spec.chart.spec.sourceRef.name`, `kustomization.yaml` top-level
/// `metadata.name` + nested `spec.sourceRef.name` + nested
/// `spec.healthChecks[].name` — thread this `&'static str` through
/// named-arg interpolation instead of the prior six inline `name:`
/// label literals.
///
/// The prior inline `"name"` literals at the production-side call
/// sites would have let a typo on any one site (e.g. `"Name"`,
/// `"nane"`, `"nam"`, the canonical transposition) silently emit a
/// document whose per-CR `metadata.name` axis the apiserver-side
/// ObjectMeta parser cannot key on — the `helm-controller` /
/// `source-controller` / `kustomize-controller` would then treat the
/// rendered document as an anonymous CR (or the apiserver would
/// reject the apply with a schema-validation error naming the wrong
/// key), with no field naming the label-drift root cause far from
/// the source caixa.lisp. Now the emit-side and retrieval-side both
/// consult one substrate-owned `&'static str`, and the raw-byte-
/// label pin structurally forbids the emit format-string from
/// drifting away from the canonical key without failing at test
/// time. Same shape as the [`KUBE_KEY_NAMESPACE`] /
/// [`KUBE_KEY_METADATA`] / [`KUBE_KEY_SPEC`] / [`KUBE_KEY_KIND`] /
/// [`KUBE_KEY_API_VERSION`] re-exports on the sibling K8s-CR
/// canonical-key axes — extends the discipline the top-level
/// `(apiVersion, kind, metadata, spec)` axis re-export quartet +
/// the sibling `metadata.namespace` nested-axis re-export establish
/// onto the paired `metadata.name` nested axis every rendered Flux
/// v2 bundle document navigates as the other half of the `(name,
/// namespace)` ObjectMeta / sourceRef / healthCheck identity-pair.
pub use caixa_core::KUBE_KEY_NAME;

/// Local re-export of [`caixa_core::FLEET_PROGRAMS_KEY_PROGRAMS`] —
/// the canonical `lareira-fleet-programs` values-schema array key
/// (`programs:` — the exact YAML key the fleet-programs library chart
/// reads under `.Values.programs[]` to iterate one `ComputeUnit` CR per
/// entry). This crate's two writer-side upsert paths
/// ([`upsert_into_helmrelease_programs`] on the aggregator-HelmRelease
/// shape, [`upsert_into_programs_yaml`] on the bare-values.yaml shape)
/// both anchor on this key when walking the entry sequence to
/// match-by-name-and-replace-or-append. Re-exported here so the two
/// production sites' `values_map.entry(Value::String(<key>.into()))` /
/// `programs_yaml.get(<key>)` navigation reads from the same
/// `&'static str` as every peer consumer (and every future fleet-
/// programs schema-key consumer — the M4 `app-operator` per-Aplicacao
/// reconciler, the future `feira app deploy --apply` writer-side
/// aggregator merge). Same re-export shape as the peer
/// [`KUBE_KEY_NAMESPACE`] / [`KUBE_KEY_METADATA`] / [`KUBE_KEY_SPEC`]
/// / [`KUBE_KEY_KIND`] / [`KUBE_KEY_API_VERSION`] surfaces on the
/// sibling K8s-CR canonical-key axes — extends the discipline the
/// K8s-CR key re-export quintet establishes onto the canonical
/// fleet-programs schema top-level axis.
pub use caixa_core::FLEET_PROGRAMS_KEY_PROGRAMS;

/// Local re-export of [`caixa_core::FLEET_PROGRAMS_KEY_NAME`] — the
/// canonical `lareira-fleet-programs` values-schema per-entry name
/// discriminator key (`name:` — the exact YAML key the fleet-programs
/// library chart's `range .Values.programs` step reads per-entry to
/// key each rendered `ComputeUnit` CR's `metadata.name` off). Peer of
/// the sibling [`FLEET_PROGRAMS_KEY_PROGRAMS`] top-level array-key
/// re-export on the same fleet-programs schema — that one carries the
/// `programs:` array key both writer verbs upsert into, this one
/// carries the per-entry name-axis both writer verbs walk that array
/// by (and both emit-side entry builders — this crate's
/// [`programs_yaml_entry`] and the peer [`caixa_mesh::programs_for_aplicacao`]
/// — write the per-entry name-axis at).
///
/// This crate's three writer-side sites anchor on this key:
/// [`programs_yaml_entry`]'s emit-side `entry.insert(<key>.into(), …)`
/// call (seeding the per-entry name-axis from the Caixa's `nome`),
/// [`upsert_into_helmrelease_programs`]'s two `new_entry.get(<key>)`
/// / `slot.get(<key>)` navigations + `Error::MissingField(<key>)`
/// diagnostic on the aggregator-HelmRelease shape, and
/// [`upsert_into_programs_yaml`]'s peer three-site (extract + match +
/// `MissingField`) shape on the bare-values.yaml shape. All three
/// verbs now read from the same `&'static str` as every peer
/// consumer (and every future fleet-programs schema-key consumer —
/// the M4 `app-operator` per-Aplicacao reconciler, the future
/// `feira app deploy --apply` writer-side aggregator merge, the peer
/// [`caixa_mesh::programs_for_aplicacao`] per-`:membros` emit-side
/// name-axis). Same re-export shape as the peer
/// [`FLEET_PROGRAMS_KEY_PROGRAMS`] / [`KUBE_KEY_NAMESPACE`] /
/// [`KUBE_KEY_METADATA`] / [`KUBE_KEY_SPEC`] / [`KUBE_KEY_KIND`] /
/// [`KUBE_KEY_API_VERSION`] surfaces on the sibling fleet-programs /
/// K8s-CR canonical-key axes — extends the discipline the K8s-CR key
/// re-export quintet + the sibling fleet-programs top-level array-
/// key re-export establish onto the canonical fleet-programs schema
/// per-entry name-discriminator axis.
pub use caixa_core::FLEET_PROGRAMS_KEY_NAME;

/// Local re-export of the canonical
/// [`caixa_core::COMPUTEUNIT_SPEC_KEY_MODULE`] — the
/// `wasm.pleme.io/v1alpha1/ComputeUnit` CRD per-CR wasm-module-reference
/// `spec.module` sub-block key every rendered `programs[]` entry
/// splices verbatim from the upstream ComputeUnit YAML's `spec.module`
/// (per the docstring on [`programs_yaml_entry`] above), so the
/// `lareira-fleet-programs` library chart's per-Servico module-source
/// axis binds to the exact source the caixa.lisp's `:servicos`
/// fixture pins. Four per-entry drift-detection navigators in this
/// crate's test module (the `programs_yaml_entry_round_trips` per-key
/// pair + the `upsert_helmrelease_replaces_existing` /
/// `upsert_into_programs_yaml` per-`module.source` navigators)
/// now consult the same `&'static str` as the peer caixa-helm
/// per-values navigators' module-source axis. Same re-export shape
/// as the peer [`FLEET_PROGRAMS_KEY_NAME`] / [`KUBE_KEY_NAMESPACE`]
/// surfaces on the sibling canonical-fleet-programs-schema-key /
/// canonical-K8s-CR-key axes — extends the discipline the M2-typed-
/// slot / fleet-programs schema / K8s-CR key re-export families
/// establish onto the substrate-side ComputeUnit-CRD per-`spec.*`
/// sub-block axis. See [`caixa_core::COMPUTEUNIT_SPEC_KEY_MODULE`]
/// for the full lift rationale.
pub use caixa_core::COMPUTEUNIT_SPEC_KEY_MODULE;

/// Local re-export of the canonical
/// [`caixa_core::COMPUTEUNIT_SPEC_KEY_TRIGGER`] — the
/// `wasm.pleme.io/v1alpha1/ComputeUnit` CRD per-CR invocation-shape
/// `spec.trigger` sub-block key every rendered `programs[]` entry
/// splices verbatim from the upstream ComputeUnit YAML's
/// `spec.trigger`. Peer of [`COMPUTEUNIT_SPEC_KEY_MODULE`] on the same
/// ComputeUnit CRD per-`spec.*` sub-block axis. See
/// [`caixa_core::COMPUTEUNIT_SPEC_KEY_TRIGGER`] for the full lift
/// rationale.
pub use caixa_core::COMPUTEUNIT_SPEC_KEY_TRIGGER;

/// Local re-export of the canonical
/// [`caixa_core::COMPUTEUNIT_SPEC_KEY_CAPABILITIES`] — the
/// `wasm.pleme.io/v1alpha1/ComputeUnit` CRD per-CR WASI-capability-list
/// `spec.capabilities` sub-block key every rendered `programs[]` entry
/// splices verbatim from the upstream ComputeUnit YAML's
/// `spec.capabilities`. Peer of [`COMPUTEUNIT_SPEC_KEY_MODULE`] and
/// [`COMPUTEUNIT_SPEC_KEY_TRIGGER`] on the same ComputeUnit CRD
/// per-`spec.*` sub-block axis — completes the substrate-side
/// ComputeUnit-CRD per-`spec.*` sub-block re-export triple in this
/// crate. See [`caixa_core::COMPUTEUNIT_SPEC_KEY_CAPABILITIES`] for
/// the full lift rationale.
pub use caixa_core::COMPUTEUNIT_SPEC_KEY_CAPABILITIES;

/// Local re-export of the canonical
/// [`caixa_core::COMPUTEUNIT_MODULE_KEY_SOURCE`] — the
/// `wasm.pleme.io/v1alpha1/ComputeUnit` CRD nested
/// `spec.module.source` per-CR wasm-component-reference leaf-scalar
/// sub-block key every rendered `programs[]` entry carries under the
/// parent [`COMPUTEUNIT_SPEC_KEY_MODULE`] block to name the exact
/// OCI / git / file wasm-component artifact the M2.5 wasm-engine
/// instantiator loads at Servico bring-up. Three per-`module.source`
/// drift-detection navigators in this crate's test module
/// (`programs_yaml_entry_round_trips`'s per-entry
/// `.get(COMPUTEUNIT_SPEC_KEY_MODULE).and_then(|m| m.get(…))`
/// present-check + `upsert_into_programs_yaml`'s cross-upsert
/// readback + `upsert_into_helmrelease_programs`'s peer
/// `HelmRelease`-wrapped `spec.values.programs[]` cross-upsert
/// readback) now consult the same `&'static str` — extends the
/// discipline the peer [`COMPUTEUNIT_SPEC_KEY_MODULE`] /
/// [`COMPUTEUNIT_SPEC_KEY_TRIGGER`] / [`COMPUTEUNIT_SPEC_KEY_CAPABILITIES`]
/// top-level-`spec.*` re-exports establish one level deeper onto the
/// nested `spec.module.*` leaf-scalar-axis. See
/// [`caixa_core::COMPUTEUNIT_MODULE_KEY_SOURCE`] for the full lift
/// rationale.
pub use caixa_core::COMPUTEUNIT_MODULE_KEY_SOURCE;

/// Local re-export of the canonical
/// [`caixa_core::servico_spec_and_m2_overlay_entries`] — the composed
/// per-Servico value-block splice helper this crate's
/// [`programs_yaml_entry`] and the peer
/// [`caixa_helm::build_values_yaml`] both now route their two-step
/// `spec.*` field-splice + M2 typed-slot overlay through. The single
/// production-code call site consuming it is
/// [`programs_yaml_entry`]'s inner splice loop (formerly two hand-
/// written for-loops chained around `string_keyed_entries` +
/// `servico_m2_overlay`); re-exported so the shared composition
/// contract lives in exactly one place across both per-Servico
/// renderers — a future author reading `caixa_flux::programs_yaml_entry`
/// finds the composition helper immediately without an extra `use
/// caixa_core::…` line, and a rebrand of the composition axis (e.g. a
/// swap of the `or_insert` precedence rule) reaches both renderers
/// through one canonical `&'static` function pointer. Same shape as
/// the peer render-side helper re-exports on the sibling
/// canonical-composed-primitive axes.
pub use caixa_core::servico_spec_and_m2_overlay_entries;

/// Render a single `programs:[]` array entry for the cluster's
/// `lareira-fleet-programs` HelmRelease values.
///
/// The output is `serde_yaml::Value::Mapping`, so callers can splice
/// it into an existing `programs:` array without re-parsing the
/// containing structure. Schema is enforced by
/// `lareira-fleet-programs/values.schema.json` (`#/definitions/program`).
///
/// Pulls:
/// - `name` from `caixa.nome`
/// - `namespace` from `computeunit.metadata.namespace` (or `DEFAULT_NAMESPACE`)
/// - [`COMPUTEUNIT_SPEC_KEY_MODULE`] / [`COMPUTEUNIT_SPEC_KEY_TRIGGER`] /
///   [`COMPUTEUNIT_SPEC_KEY_CAPABILITIES`] / `config` / `resources`
///   from `computeunit.spec.*` (verbatim — schemas already match)
pub fn programs_yaml_entry(
    caixa: &Caixa,
    computeunit_yaml: &serde_yaml::Value,
) -> Result<serde_yaml::Value, Error> {
    caixa_core::require_v0_servico_shape::<Error>(caixa)?;

    let spec = computeunit_yaml
        .get(KUBE_KEY_SPEC)
        .ok_or(Error::MissingField(KUBE_KEY_SPEC))?;

    let namespace = kube_metadata_str_field(computeunit_yaml, KUBE_KEY_NAMESPACE)
        .unwrap_or(DEFAULT_NAMESPACE)
        .to_string();

    let mut entry = serde_yaml::Mapping::new();
    // Route the per-entry `name:` `String`-carry through the typed
    // [`caixa_core::Caixa::nome`] accessor (`caixa.nome().to_string()`)
    // instead of the raw `caixa.nome.clone()` field access — sibling
    // convergence to the peer 54bf2f3 caixa-mesh
    // `programs_for_aplicacao` / `cilium_network_policies` /
    // `gateway_routes` three-site converge on the same axis on the
    // sibling renderer crate. Every future extension of the accessor
    // (an M4 namespace-qualified rewrite the CR materializer applies
    // per-CR, a per-cluster alias table pinned through a future
    // `:placement`-scoped slot, the `:nome-suffix` overlay
    // MESH-COMPOSITION §III.2 acknowledges) reaches this emit site
    // through the accessor by construction. Pinned by the drift-
    // detection test
    // [`programs_yaml_entry_name_field_routes_through_caixa_nome_accessor`]
    // in the tests module.
    entry.insert_string(FLEET_PROGRAMS_KEY_NAME, caixa.nome().to_string());
    entry.insert_string(KUBE_KEY_NAMESPACE, namespace);

    // Two-step per-Servico value-block splice — the `spec.*` field
    // splice (module / trigger / capabilities / config / resources /
    // serviceAccount) and the M2 typed-slot overlay (limits / behavior
    // / upgradeFrom, `or_insert` semantics so `spec.*` wins on
    // collision) now route through the canonical
    // [`caixa_core::servico_spec_and_m2_overlay_entries`] composition
    // helper — the two prior inline for-loops chained around
    // `string_keyed_entries` + `servico_m2_overlay` this call site
    // (and the peer [`caixa_helm::build_values_yaml`] site) each
    // re-derived collapse onto one canonical composition, so a future
    // change to the per-Servico splice / overlay shape (the M4 typed
    // per-edge policy overlay slot addition MESH-COMPOSITION §III.2
    // #3 acknowledges, a change to the precedence rule once per-
    // Aplicacao operator overrides land, a canonicalization pass on
    // the merged key set) reaches both renderers by construction
    // instead of a coordinated two-file rewrite. See the helper's
    // docstring for the full lift rationale and the byte-shape
    // guarantee (spec.* keys preserved in source-Mapping insertion
    // order; M2 slots appended in canonical BTreeMap-key ordering at
    // every M2 key not already claimed by spec.*).
    for (k, v) in caixa_core::servico_spec_and_m2_overlay_entries(caixa, spec)? {
        entry.entry_str_key(&k).or_insert(v);
    }

    Ok(serde_yaml::Value::Mapping(entry))
}

/// Insert/upsert an entry into a `programs:` array nested under
/// the canonical fleet-manifest path: `spec.values.programs[]` in a
/// `HelmRelease` document. The pleme-io convention puts the fleet's
/// program list inside a HelmRelease (consumed by `lareira-fleet-programs`),
/// not at the top level. Same upsert semantics as
/// [`upsert_into_programs_yaml`] — match by `name`, replace in place,
/// otherwise append.
pub fn upsert_into_helmrelease_programs(
    helmrelease: serde_yaml::Value,
    new_entry: serde_yaml::Value,
) -> Result<(serde_yaml::Value, bool), Error> {
    let serde_yaml::Value::Mapping(mut root) = helmrelease else {
        return Err(Error::MissingField(
            "expected mapping at root of HelmRelease",
        ));
    };

    let spec = root
        .get_mut(KUBE_KEY_SPEC)
        .ok_or(Error::MissingField(KUBE_KEY_SPEC))?;
    let serde_yaml::Value::Mapping(spec_map) = spec else {
        return Err(Error::MissingField("spec must be a mapping"));
    };
    let values_map = spec_map
        .entry_or_default_mapping(FLUX_KEY_VALUES)
        .ok_or(Error::MissingField("spec.values must be a mapping"))?;
    let arr = values_map
        .entry_or_default_sequence(FLEET_PROGRAMS_KEY_PROGRAMS)
        .ok_or(Error::MissingField(
            "spec.values.programs must be a sequence",
        ))?;

    let inserted = caixa_core::upsert_named_entry(arr, new_entry, FLEET_PROGRAMS_KEY_NAME, || {
        Error::MissingField(FLEET_PROGRAMS_KEY_NAME)
    })?;

    Ok((serde_yaml::Value::Mapping(root), inserted))
}

/// Insert/upsert an entry into a `programs:` array of an existing
/// values.yaml structure.
///
/// Idempotent: if an entry with the same `name` exists, replaces it
/// in-place (preserving order). If not, appends. Returns the modified
/// document. Operates on `Value` so callers can round-trip via
/// `serde_yaml::from_str` / `to_string` without losing structure.
///
/// Returns the modified `programs_yaml` plus a `bool` indicating
/// whether the entry was a new insert (`true`) or a replacement (`false`).
pub fn upsert_into_programs_yaml(
    programs_yaml: serde_yaml::Value,
    new_entry: serde_yaml::Value,
) -> Result<(serde_yaml::Value, bool), Error> {
    let serde_yaml::Value::Mapping(mut root) = programs_yaml else {
        return Err(Error::MissingField(
            "expected mapping at root of values.yaml",
        ));
    };

    let arr = root
        .entry_or_default_sequence(FLEET_PROGRAMS_KEY_PROGRAMS)
        .ok_or(Error::MissingField("programs must be a sequence"))?;

    let inserted = caixa_core::upsert_named_entry(arr, new_entry, FLEET_PROGRAMS_KEY_NAME, || {
        Error::MissingField(FLEET_PROGRAMS_KEY_NAME)
    })?;

    Ok((serde_yaml::Value::Mapping(root), inserted))
}

// ── Cluster bundle (one-off / standalone path) ──────────────────────────

/// Inputs for [`cluster_bundle`].
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClusterBundleOpts {
    /// Cluster name — drives output paths (e.g. `rio`, `mar`).
    pub cluster: String,
    /// Namespace for the rendered HelmRelease.
    pub namespace: String,
    /// Reconcile interval string (Helm/Flux duration like `"10m"`).
    pub interval: String,
    /// Path to the chart inside the source repo (default: `chart/`).
    pub chart_path: String,
    /// Source git URL.
    pub git_url: String,
    /// Source git ref (branch or tag).
    pub git_ref: GitRefSpec,
}

#[derive(Debug, Clone, Serialize, Deserialize, gen_platform::IsVariant)]
#[serde(rename_all = "camelCase")]
pub enum GitRefSpec {
    Tag(String),
    Branch(String),
    Commit(String),
}

impl GitRefSpec {
    /// The FluxCD source-controller `GitRepository.spec.ref.<field>`
    /// sub-selector scalar-axis key this variant renders under — the
    /// per-arm dispatch onto the canonical lifted
    /// [`FLUX_GITREPOSITORY_REF_KEY_TAG`] /
    /// [`FLUX_GITREPOSITORY_REF_KEY_BRANCH`] /
    /// [`FLUX_GITREPOSITORY_REF_KEY_COMMIT`] byte-string trio the
    /// caixa-core substrate owns.
    ///
    /// Both consumer sites in [`cluster_bundle`] (the `gitref_field`
    /// YAML emit-side composer and the sibling `tag_human`
    /// human-readable narrator prose) now route through this dispatch,
    /// closing the 2-site duplication of the prior inline
    /// `format!("    {arm}: {v:?}")` + `format!("{arm} {v}")` match
    /// blocks that each open-coded the three-way arm-shape mapping
    /// side-by-side. Same "one canonical dispatch per typed axis"
    /// discipline the peer [`caixa_core::WitTarget::payload_pair`]
    /// (6788ed6) established on the sibling `:contratos` payload-arm
    /// dispatch surface — a future `GitRefSpec` variant addition
    /// (FluxCD's source-controller `spec.ref` schema exposes further
    /// `semver` / `name` sub-selectors this V0 shape stops short of)
    /// becomes exactly one new match-arm here (a compile-time
    /// exhaustiveness error otherwise), not a coordinated three-way
    /// rewrite of both format-string templates + every downstream
    /// consumer that reaches for the per-arm sub-selector key.
    #[must_use]
    pub const fn ref_field_name(&self) -> &'static str {
        match self {
            GitRefSpec::Tag(_) => FLUX_GITREPOSITORY_REF_KEY_TAG,
            GitRefSpec::Branch(_) => FLUX_GITREPOSITORY_REF_KEY_BRANCH,
            GitRefSpec::Commit(_) => FLUX_GITREPOSITORY_REF_KEY_COMMIT,
        }
    }

    /// The underlying scalar the variant carries — the tag / branch /
    /// commit value the FluxCD source-controller feeds into its
    /// per-CR git-source clone refspec. Peer of [`Self::ref_field_name`]
    /// on the same per-variant dispatch: both consumer sites in
    /// [`cluster_bundle`] pair the sub-selector key with the paired
    /// scalar to compose the rendered `spec.ref.<field>: <value>`
    /// YAML sub-block + the sibling `<field> <value>` narrator prose,
    /// so the pair moves together on any future variant addition.
    #[must_use]
    pub fn ref_value(&self) -> &str {
        match self {
            GitRefSpec::Tag(t) | GitRefSpec::Branch(t) | GitRefSpec::Commit(t) => t.as_str(),
        }
    }
}

impl ClusterBundleOpts {
    /// Sensible defaults for a per-program standalone bundle.
    #[must_use]
    pub fn for_caixa(caixa: &Caixa, cluster: impl Into<String>) -> Self {
        Self {
            cluster: cluster.into(),
            namespace: DEFAULT_NAMESPACE.into(),
            interval: DEFAULT_FLUX_RECONCILE_INTERVAL.into(),
            chart_path: DEFAULT_FLUX_CHART_SOURCE_SUBPATH.into(),
            git_url: caixa.repositorio().map(str::to_owned).unwrap_or_else(|| {
                // Canonical typed `&str`-read of the per-`Caixa`
                // `:nome` universal-axis DNS-1123-label caixa-identity
                // scalar into the `:repositorio`-null pleme-org
                // github URL fallback composer. Peer of the sibling
                // 22461ef (caixa-helm) / 980c059 (caixa-mesh)
                // `caixa.nome()` converges on the co-resident
                // non-`.clone()` `&str`/Display raw-field-access axis
                // of `Caixa::nome` in the other two substrate-side
                // renderers and the sibling 4a363bf `caixa.nome().to_string()`
                // converge on the co-resident `String`-carry axis on
                // `Caixa::nome` in this crate — this extends the
                // "one typed dispatch on the substrate primitive,
                // thin projections at each consumer" discipline onto
                // the last unlifted non-`.clone()` raw-field-access
                // axis of `Caixa::nome` in caixa-flux, so every
                // substrate-side renderer (caixa-helm, caixa-flux,
                // caixa-mesh) now owns every projection of the
                // `Caixa::nome` axis through the typed accessor,
                // `.clone()` `String`-carry and `&str`/Display
                // raw-field-access alike.
                format!(
                    "https://github.com/{org}/{nome}",
                    org = caixa_core::DEFAULT_PLEME_GIT_ORG,
                    nome = caixa.nome(),
                )
            }),
            git_ref: GitRefSpec::Tag(format!(
                "{prefix}{versao}",
                prefix = caixa_core::DEFAULT_PUBLISH_TAG_PREFIX,
                versao = caixa.versao(),
            )),
        }
    }
}

/// One file of the cluster bundle — `(path, contents)` pair every
/// [`cluster_bundle`]-rendered Flux v2 CR YAML document lands at.
///
/// Type-aliased to the canonical [`caixa_core::RenderedFile`] so the
/// substrate-side "one rendered leaf artifact" shape lives at one
/// struct definition across every per-target renderer — the peer
/// [`caixa_helm::ChartFile`] alias resolves to the same canonical, so
/// a future rebrand on either axis (a per-artifact hash / provenance
/// field addition, a per-artifact write-mode discriminator once
/// per-cluster-writer sandboxing lands) lands at one caixa-core `pub
/// struct RenderedFile` edit and reaches both crates by construction.
/// Prior to this lift both crates carried an inline `pub struct
/// <Xxx>File { pub path: PathBuf, pub contents: String }` with
/// identical `#[derive(Debug, Clone, PartialEq, Eq)]` shapes and no
/// per-type impls; a future per-target renderer (`caixa-otel`, the
/// future `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer, the
/// future per-Supervisor reconciler renderer) would have carried a
/// third and fourth clone of the same record. Type aliases preserve
/// every existing struct-literal construction site
/// (`BundleFile { path, contents }`), every field-access site (`f.path`,
/// `f.contents`), and every derive-fed navigator by construction —
/// Rust type aliases inherit the aliased type's `#[derive]`-generated
/// `Debug`/`Clone`/`PartialEq`/`Eq` impls with no per-alias glue.
pub type BundleFile = caixa_core::RenderedFile;

/// Cluster bundle: the FluxCD trio for a standalone caixa deploy.
///
/// Three YAMLs:
///   gitrepository.yaml — points at the caixa's source repo at a tag
///   helmrelease.yaml   — uses the per-program chart from caixa-helm
///   kustomization.yaml — the Flux Kustomization that staples them
///
/// Written under `<cluster>/services/<caixa-name>/` by `feira deploy`.
///
/// V0 contract: every `:kind Servico` caixa carries exactly one
/// `:servicos` entry (one ComputeUnit YAML pointer per Servico,
/// matching the one `lareira-<nome>` Helm chart `caixa-helm` renders
/// and the one HelmRelease this bundle's `helmrelease.yaml` points at).
/// The pair [`caixa_core::require_kind`] + [`caixa_core::require_single_servico`]
/// is the canonical per-Servico-renderer entry-point gate axis the peer
/// [`programs_yaml_entry`] (the aggregator path) and
/// [`caixa_helm::render_chart_for_servico`] (the per-program chart path)
/// both run; until this gate landed `cluster_bundle` ran only the kind
/// half of the pair, so a Servico-kind caixa with a non-singleton
/// `:servicos` list silently passed the bundle render and the failure
/// surfaced at the chart-render layer (`caixa-helm` refused the input
/// with `UnsupportedServicoCount`) far from the source `caixa.lisp` and
/// far from the deploy-path entry point — the canonical "the V0
/// invariant is enforced at every per-Servico renderer entry except
/// this one" footgun the prior 06b2981 lift commit's body named when
/// it called the pair "the canonical V0-shape gate pair for the Servico
/// kind, in one place". Same shape every peer per-Servico-renderer
/// entry-point uses ([`programs_yaml_entry`] at the aggregator path,
/// [`caixa_helm::render_chart_for_servico`] at the per-program chart
/// path).
pub fn cluster_bundle(caixa: &Caixa, opts: &ClusterBundleOpts) -> Result<Vec<BundleFile>, Error> {
    caixa_core::require_v0_servico_shape::<Error>(caixa)?;

    // Route the per-bundle `let name` `String`-carry through the typed
    // [`caixa_core::Caixa::nome`] accessor (`caixa.nome().to_string()`)
    // instead of the raw `caixa.nome.clone()` field access — the one
    // `let name` binding threads into every downstream
    // `metadata.name` axis this fn emits (the `GitRepository`
    // top-level `metadata.name`, the `HelmRelease` top-level
    // `metadata.name` + nested `spec.chart.spec.sourceRef.name`, the
    // `Kustomization` top-level `metadata.name` + nested
    // `spec.healthChecks[0].name`, plus the
    // [`flux_kustomization_source_subtree`] composer's per-caixa
    // sub-tree scalar), so this single accessor edit shifts every
    // per-CR name-axis derivation onto the typed dispatch at once.
    // Sibling convergence to the peer 54bf2f3 caixa-mesh three-site
    // converge on the same axis on the sibling renderer crate. Pinned
    // by the drift-detection tests
    // [`cluster_bundle_gitrepository_metadata_name_routes_through_caixa_nome_accessor`],
    // [`cluster_bundle_helmrelease_metadata_name_routes_through_caixa_nome_accessor`],
    // and
    // [`cluster_bundle_kustomization_metadata_name_routes_through_caixa_nome_accessor`]
    // in the tests module.
    let name = caixa.nome().to_string();
    let chart_name = lareira_chart_name(&name);

    // The per-variant sub-selector key (`tag` / `branch` / `commit`)
    // + its paired scalar (the tag / branch / commit value) now route
    // through the canonical [`GitRefSpec::ref_field_name`] +
    // [`GitRefSpec::ref_value`] dispatch, closing the 2-site
    // duplication the prior inline per-variant `format!("    <arm>:
    // {v:?}")` match block open-coded side-by-side with the sibling
    // `tag_human` narrator prose block. Byte-identical output to the
    // prior 3-arm inline `format!`s: `{value:?}` on `&str` renders
    // the same shape as `{v:?}` on `String` (both call the same
    // `Debug` impl at the identical stack position).
    let gitref_field = format!(
        "    {field}: {value:?}",
        field = opts.git_ref.ref_field_name(),
        value = opts.git_ref.ref_value(),
    );

    let gitrepo = format!(
        "---\n\
         # Source — pinned to {tag_human}, rendered by caixa-flux.\n\
         {api_version_key}: {api_version}\n\
         {kind_key}: {kind}\n\
         {metadata_key}:\n  \
           {name_key}: {name}\n  \
           {namespace_key}: {namespace}\n\
         {spec_key}:\n  \
           {interval_key}: {interval}\n  \
           {url_key}: {url}\n  \
           {ref_key}:\n\
         {gitref_field}\n",
        api_version_key = KUBE_KEY_API_VERSION,
        api_version = FLUX_GITREPOSITORY_API_VERSION,
        kind_key = KUBE_KEY_KIND,
        kind = FLUX_KIND_GIT_REPOSITORY,
        metadata_key = KUBE_KEY_METADATA,
        name_key = KUBE_KEY_NAME,
        namespace_key = KUBE_KEY_NAMESPACE,
        spec_key = KUBE_KEY_SPEC,
        tag_human = format!(
            "{field} {value}",
            field = opts.git_ref.ref_field_name(),
            value = opts.git_ref.ref_value(),
        ),
        name = name,
        namespace = opts.namespace,
        interval_key = FLUX_KEY_INTERVAL,
        interval = opts.interval,
        url_key = FLUX_GITREPOSITORY_KEY_URL,
        url = opts.git_url,
        ref_key = FLUX_GITREPOSITORY_KEY_REF,
        gitref_field = gitref_field,
    );

    // The values wrap key under `spec.values.<library>:` must match the
    // peer caixa-helm chart's `dependencies[0].name` axis exactly —
    // Helm's per-dep alias convention scopes values under the
    // dependency's `name:` when no `alias:` is set, so a wrap-key drift
    // silently routes the per-cluster `enabled: true` override nowhere
    // at `helm template` / `helm install` time. Both axes now consult
    // the same lifted [`caixa_core::DEFAULT_LIBRARY_NAME`] constant
    // (`caixa-helm`'s `RenderOpts::library_name` defaults to the same
    // re-export), so a future per-edition library-chart rebrand reaches
    // both consumers through one `&'static str` by construction. Peer
    // with the [`DEFAULT_NAMESPACE`] (a085b26) /
    // [`DEFAULT_SERVICO_PORT`] (1e22add) lifts on the sibling
    // canonical-K8s-axis-constant surface — duplicated load-bearing
    // string axes lifted to one source of truth.
    let helmrelease = format!(
        "---\n\
         # HelmRelease consumes the chart caixa-helm renders for this\n\
         # caixa Servico. Per-cluster values are injected here.\n\
         {api_version_key}: {api_version}\n\
         {kind_key}: {kind}\n\
         {metadata_key}:\n  \
           {name_key}: {name}\n  \
           {namespace_key}: {namespace}\n\
         {spec_key}:\n  \
           {interval_key}: {interval}\n  \
           {chart_key}:\n    \
             {spec_key}:\n      \
               {chart_name_key}: {chart_path}\n      \
               {source_ref_key}:\n        \
                 {kind_key}: {source_kind}\n        \
                 {name_key}: {name}\n        \
                 {namespace_key}: {namespace}\n  \
           {install_key}:\n    \
             {create_namespace_key}: {create_namespace_default}\n    \
             {remediation_key}:\n      \
               {retries_key}: {retries_default}\n  \
           {upgrade_key}:\n    \
             {remediation_key}:\n      \
               {retries_key}: {retries_default}\n      \
               {remediate_last_failure_key}: {remediate_last_failure_default}\n  \
           {values_key}:\n    \
             {library_name}:\n      \
               {enabled_key}: {lareira_enabled_default}\n",
        api_version_key = KUBE_KEY_API_VERSION,
        api_version = FLUX_HELMRELEASE_API_VERSION,
        kind_key = KUBE_KEY_KIND,
        kind = FLUX_KIND_HELM_RELEASE,
        source_kind = FLUX_KIND_GIT_REPOSITORY,
        metadata_key = KUBE_KEY_METADATA,
        name_key = KUBE_KEY_NAME,
        namespace_key = KUBE_KEY_NAMESPACE,
        spec_key = KUBE_KEY_SPEC,
        name = name,
        namespace = opts.namespace,
        interval_key = FLUX_KEY_INTERVAL,
        interval = opts.interval,
        chart_key = FLUX_KEY_CHART,
        chart_name_key = FLUX_HELMCHART_TEMPLATE_KEY_CHART,
        chart_path = opts.chart_path,
        source_ref_key = FLUX_KEY_SOURCE_REF,
        values_key = FLUX_KEY_VALUES,
        library_name = DEFAULT_LIBRARY_NAME,
        enabled_key = HELM_VALUES_KEY_ENABLED,
        retries_default = FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT,
        retries_key = FLUX_HELMRELEASE_KEY_RETRIES,
        remediation_key = FLUX_HELMRELEASE_KEY_REMEDIATION,
        install_key = FLUX_HELMRELEASE_KEY_INSTALL,
        upgrade_key = FLUX_HELMRELEASE_KEY_UPGRADE,
        remediate_last_failure_key = FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE,
        remediate_last_failure_default = FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT,
        create_namespace_key = FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE,
        create_namespace_default = FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT,
        lareira_enabled_default = CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT,
    );

    // The `spec.path` per-CR source-sub-tree scalar composes through
    // the canonical [`flux_kustomization_source_subtree`] helper
    // (re-exported from [`caixa_core::flux_kustomization_source_subtree`]),
    // so the substrate's canonical per-cluster / per-caixa GitRepository-
    // relative directory-tree seed (`./clusters/<cluster>/services/<nome>`)
    // lives at one composer instead of a verbatim inline
    // `format!("./clusters/{cluster}/services/{name}")` at this emit site.
    // Threaded through a `{source_subtree}` named-arg interpolation on
    // the paired `{path_key}` leaf-scalar-key emit. Peer to the sibling
    // [`caixa_core::oci_chart_ref`] / [`caixa_core::cilium_network_policy_name`]
    // / [`caixa_core::gateway_api_http_route_name`] canonical-composer
    // re-exports on the substrate-side canonical-load-bearing-scalar
    // axis.
    let source_subtree = flux_kustomization_source_subtree(&opts.cluster, &name);

    let kustomization = format!(
        "---\n\
         # Flux Kustomization that pins the GitRepository + HelmRelease.\n\
         # Paired path: pleme-io/k8s/clusters/{cluster}/services/{name}/\n\
         {api_version_key}: {kustomization_api_version}\n\
         {kind_key}: {kind}\n\
         {metadata_key}:\n  \
           {name_key}: {name}\n  \
           {namespace_key}: {flux_system}\n\
         {spec_key}:\n  \
           {interval_key}: {interval}\n  \
           {prune_key}: {prune_default}\n  \
           {source_ref_key}:\n    \
             {kind_key}: {source_kind}\n    \
             {name_key}: {flux_system}\n  \
           {path_key}: {source_subtree}\n  \
           {health_checks_key}:\n    \
             - {api_version_key}: {api_version}\n      \
               {kind_key}: {health_kind}\n      \
               {name_key}: {name}\n      \
               {namespace_key}: {namespace}\n  \
           {timeout_key}: {timeout_default}\n",
        api_version_key = KUBE_KEY_API_VERSION,
        kustomization_api_version = FLUX_KUSTOMIZATION_API_VERSION,
        kind_key = KUBE_KEY_KIND,
        kind = FLUX_KIND_KUSTOMIZATION,
        source_kind = FLUX_KIND_GIT_REPOSITORY,
        health_kind = FLUX_KIND_HELM_RELEASE,
        metadata_key = KUBE_KEY_METADATA,
        name_key = KUBE_KEY_NAME,
        namespace_key = KUBE_KEY_NAMESPACE,
        spec_key = KUBE_KEY_SPEC,
        api_version = FLUX_HELMRELEASE_API_VERSION,
        name = name,
        namespace = opts.namespace,
        interval_key = FLUX_KEY_INTERVAL,
        interval = opts.interval,
        cluster = opts.cluster,
        flux_system = DEFAULT_FLUX_SYSTEM_NAMESPACE,
        source_ref_key = FLUX_KEY_SOURCE_REF,
        health_checks_key = FLUX_KEY_HEALTH_CHECKS,
        prune_key = FLUX_KUSTOMIZATION_KEY_PRUNE,
        prune_default = FLUX_KUSTOMIZATION_PRUNE_DEFAULT,
        path_key = FLUX_KUSTOMIZATION_KEY_PATH,
        timeout_key = FLUX_KUSTOMIZATION_KEY_TIMEOUT,
        timeout_default = DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT,
        source_subtree = source_subtree,
    );
    // chart_name is reserved for a future kustomization.yaml `resources:`
    // entry pointing at the rendered Chart.yaml; not yet wired.
    let _ = chart_name;

    // Each per-CR YAML leaf routes through the canonical
    // [`caixa_core::RenderedFile::new`] `impl Into<PathBuf>` /
    // `impl Into<String>` constructor (re-exported by the peer
    // [`BundleFile`] alias since Rust inherent methods travel through
    // type aliases to the aliased type at name resolution). The prior
    // three inline `BundleFile { path: std::path::PathBuf::from(
    // FILENAME_CONST), contents: <body> }` blocks each re-derived the
    // same `PathBuf::from(&str)` wrap + the same two-field assembly —
    // a byte-identical duplicate of the peer
    // [`caixa_helm::render_chart_for_servico_with`] `Chart.yaml` /
    // `values.yaml` / `README.md` chart-directory trio's three
    // per-artifact emit sites. Sweeping both trios onto
    // [`RenderedFile::new`] collapses the six substrate-side
    // per-artifact-construction sites onto one canonical constructor
    // so a future rebrand on the record shape (a per-artifact hash /
    // provenance field addition, a per-artifact write-mode discriminator
    // once per-cluster-writer sandboxing lands, the
    // [`caixa_core::is_sandboxed_relative_path`] discipline the
    // [`caixa_core::RenderedFile`] docstring acknowledges is not yet
    // run at emit time) reaches every per-target renderer through one
    // caixa-core edit instead of a coordinated six-site rewrite.
    Ok(vec![
        BundleFile::new(FLUX_GITREPOSITORY_YAML_FILENAME, gitrepo),
        BundleFile::new(FLUX_HELMRELEASE_YAML_FILENAME, helmrelease),
        BundleFile::new(FLUX_KUSTOMIZATION_YAML_FILENAME, kustomization),
    ])
}

#[cfg(test)]
mod tests {
    use super::*;
    use caixa_core::{
        Caixa, CaixaKind, M2_BEHAVIOR_KEY_ON_INIT, M2_KEY_BEHAVIOR, M2_KEY_LIMITS,
        M2_KEY_UPGRADE_FROM, M2_LIMITS_KEY_CPU, M2_LIMITS_KEY_MEMORY, M2_UPGRADE_FROM_KEY_FROM,
        kube_root_str_field,
    };

    fn sample_caixa() -> Caixa {
        Caixa {
            nome: "hello-rio".into(),
            versao: "0.1.0".into(),
            kind: CaixaKind::Servico,
            edicao: Some("2026".into()),
            descricao: Some("Canonical Rust→wasm32-wasip2 caixa Servico.".into()),
            repositorio: Some("https://github.com/pleme-io/hello-rio".into()),
            licenca: Some("MIT".into()),
            autores: vec!["pleme-io".into()],
            etiquetas: vec!["hello-world".into()],
            deps: vec![],
            deps_dev: vec![],
            exe: vec![],
            bibliotecas: vec![],
            servicos: vec!["servicos/hello-rio.computeunit.yaml".into()],
            limits: None,
            behavior: None,
            upgrade_from: vec![],
            estrategia: None,
            max_restarts: None,
            restart_window: None,
            children: vec![],
            membros: vec![],
            contratos: vec![],
            politicas: None,
            placement: None,
            entrada: None,
            ci: None,
        }
    }

    fn sample_cu_yaml() -> serde_yaml::Value {
        serde_yaml::from_str(
            r#"
apiVersion: wasm.pleme.io/v1alpha1
kind: ComputeUnit
metadata:
  name: hello-rio
  namespace: tatara-system
spec:
  module:
    source: oci://ghcr.io/pleme-io/hello-rio:v0.1.0
  trigger:
    service:
      port: 8080
      paths: ["/", "/hello", "/healthz"]
  capabilities:
    - http-in:0.0.0.0:8080
    - env
"#,
        )
        .unwrap()
    }

    #[test]
    fn default_namespace_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub const DEFAULT_NAMESPACE` was lifted to a
        // re-export of [`caixa_core::DEFAULT_NAMESPACE`] so the
        // namespace string lives in exactly one place across every
        // caixa renderer (caixa-flux + caixa-mesh today, every future
        // per-target renderer the substrate adds). Pin the equality
        // here so any local re-introduction of a sibling `pub const
        // DEFAULT_NAMESPACE: &str = "…"` (the canonical drift footgun
        // that motivated this lift, with the prior caixa-mesh doc-
        // comment explicitly acknowledging the duplication) is a
        // build-time test failure naming the offending drift, not a
        // silent apply-time CiliumNetworkPolicy / Gateway / HTTPRoute
        // `endpointSelector` namespace mismatch dropping every L7
        // contrato flow far from the source rebrand commit. Peer to
        // `caixa_mesh::tests::default_namespace_re_export_points_at_caixa_core_canonical`
        // on the sibling renderer crate.
        caixa_core::assert_str_reexport_identity(
            "DEFAULT_NAMESPACE",
            DEFAULT_NAMESPACE,
            caixa_core::DEFAULT_NAMESPACE,
        );
    }

    #[test]
    fn default_flux_reconcile_interval_re_export_points_at_caixa_core_canonical() {
        // The renderer's `DEFAULT_FLUX_RECONCILE_INTERVAL` was lifted
        // from the inline `"10m"` scalar-value literal at
        // [`ClusterBundleOpts::for_caixa`]'s per-caixa default seed (the
        // sole production-code site the substrate seeds into the
        // [`ClusterBundleOpts::interval`] field that [`cluster_bundle`]'s
        // three per-CR format-string templates thread through their
        // [`FLUX_KEY_INTERVAL`]-keyed `spec.interval` axis verbatim) to a
        // re-export of [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] so
        // the Flux v2 controller-side reconcile-cadence default scalar-
        // value string lives in exactly one place across every caixa
        // renderer. Pin the equality + static-data identity here so any
        // local re-introduction of a sibling `pub const
        // DEFAULT_FLUX_RECONCILE_INTERVAL: &str = "…"` (the canonical
        // drift footgun where a sibling local `pub const` could happen
        // to carry the same string at the source while pointing at a
        // different `&'static` allocation) is a build-time test failure
        // naming the offending drift, not a silent apply-time symptom —
        // the prior inline shape would have let a substrate-side
        // reconcile-cadence migration without a coordinated caixa-core
        // edit silently seed per-caixa Flux v2 CRs at a drifted per-CR
        // reconcile-schedule, splitting the substrate's per-caixa
        // convergence-freshness contract across renderer versions with
        // no diagnostic naming the cadence-drift root cause. Peer to
        // [`default_namespace_re_export_points_at_caixa_core_canonical`]
        // on the sibling canonical-substrate-default-load-bearing-
        // scalar re-export surface.
        caixa_core::assert_str_reexport_identity(
            "DEFAULT_FLUX_RECONCILE_INTERVAL",
            DEFAULT_FLUX_RECONCILE_INTERVAL,
            caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL,
        );
    }

    #[test]
    fn cluster_bundle_opts_for_caixa_seeds_interval_from_lifted_default() {
        // Fail-before-pass-after pin: the substrate's per-caixa default
        // seed for [`ClusterBundleOpts::interval`] must resolve to the
        // lifted [`DEFAULT_FLUX_RECONCILE_INTERVAL`] verbatim. Before the
        // lift the field carried an inline `"10m"` literal at the sole
        // production-code call site (the [`ClusterBundleOpts::for_caixa`]
        // per-caixa default builder); a future substrate-side
        // reconcile-cadence migration on the canonical
        // [`caixa_core::DEFAULT_FLUX_RECONCILE_INTERVAL`] declaration
        // that failed to reach this seed site would silently split the
        // substrate's per-caixa Flux v2 convergence-freshness contract
        // between the operator-facing canonical default and the per-
        // caixa `cluster_bundle` renderer's seeded reconcile-schedule,
        // freezing every per-caixa Flux v2 CR at the drifted cadence
        // far from the rebrand commit's source. Pin the identity here
        // so a regression that re-introduces an inline literal at the
        // seed site surfaces at build time on this test's failure. Peer
        // to the sibling
        // [`cluster_bundle_every_flux_cr_carries_lifted_flux_key_interval_scalar`]
        // pin on the per-CR `spec.interval` axis — that test pins the
        // rendered scalar agrees with `opts.interval`, this test pins
        // `opts.interval`'s substrate-side seed agrees with the lifted
        // canonical default.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        assert_eq!(
            opts.interval, DEFAULT_FLUX_RECONCILE_INTERVAL,
            "the substrate's per-caixa Flux v2 reconcile-cadence default \
             seed must resolve to the lifted \
             `DEFAULT_FLUX_RECONCILE_INTERVAL` scalar — drift here \
             silently splits the substrate's per-caixa convergence-\
             freshness contract between the operator-facing canonical \
             default and the per-caixa seeded reconcile-schedule"
        );
    }

    #[test]
    fn default_flux_chart_source_subpath_re_export_points_at_caixa_core_canonical() {
        // The renderer's `DEFAULT_FLUX_CHART_SOURCE_SUBPATH` was lifted
        // from the inline `"chart".into()` scalar-value literal at
        // [`ClusterBundleOpts::for_caixa`]'s per-caixa default seed (the
        // sole production-code site the substrate seeds into the
        // [`ClusterBundleOpts::chart_path`] field that [`cluster_bundle`]'s
        // `helmrelease.yaml` format-string template threads through its
        // [`FLUX_HELMCHART_TEMPLATE_KEY_CHART`]-keyed `spec.chart.spec.chart`
        // axis verbatim) to a re-export of
        // [`caixa_core::DEFAULT_FLUX_CHART_SOURCE_SUBPATH`] so the Flux v2
        // helm-controller-side chart-directory-in-GitRepository-source
        // default scalar-value string lives in exactly one place across
        // every caixa renderer. Pin the equality + static-data identity
        // here so any local re-introduction of a sibling `pub const
        // DEFAULT_FLUX_CHART_SOURCE_SUBPATH: &str = "…"` (the canonical
        // drift footgun where a sibling local `pub const` could happen to
        // carry the same string at the source while pointing at a
        // different `&'static` allocation) is a build-time test failure
        // naming the offending drift, not a silent apply-time symptom —
        // the prior inline shape would have let a substrate-side chart-
        // directory-in-git-source migration without a coordinated caixa-
        // core edit silently seed per-caixa `HelmRelease` CRs at a
        // drifted per-CR chart-directory pointer, splitting the
        // substrate's per-caixa chart-open contract with the Flux v2
        // helm-controller across renderer versions with no diagnostic
        // naming the sub-path-drift root cause (the source-controller
        // would then either fail to open the paired per-caixa chart
        // directory or, worse, silently open a stale sibling directory
        // the drifted scalar happens to name). Peer to
        // [`default_flux_reconcile_interval_re_export_points_at_caixa_core_canonical`]
        // on the sibling canonical-substrate-default-load-bearing-
        // scalar re-export surface.
        caixa_core::assert_str_reexport_identity(
            "DEFAULT_FLUX_CHART_SOURCE_SUBPATH",
            DEFAULT_FLUX_CHART_SOURCE_SUBPATH,
            caixa_core::DEFAULT_FLUX_CHART_SOURCE_SUBPATH,
        );
    }

    #[test]
    fn cluster_bundle_opts_for_caixa_seeds_chart_path_from_lifted_default() {
        // Fail-before-pass-after pin: the substrate's per-caixa default
        // seed for [`ClusterBundleOpts::chart_path`] must resolve to the
        // lifted [`DEFAULT_FLUX_CHART_SOURCE_SUBPATH`] verbatim. Before
        // the lift the field carried an inline `"chart".into()` literal
        // at the sole production-code call site (the
        // [`ClusterBundleOpts::for_caixa`] per-caixa default builder); a
        // future substrate-side chart-directory-in-git-source migration
        // on the canonical
        // [`caixa_core::DEFAULT_FLUX_CHART_SOURCE_SUBPATH`] declaration
        // that failed to reach this seed site would silently split the
        // substrate's per-caixa Flux v2 chart-open contract between the
        // operator-facing canonical default and the per-caixa
        // `cluster_bundle` renderer's seeded chart-directory pointer,
        // freezing every per-caixa `HelmRelease` CR at the drifted sub-
        // path far from the rebrand commit's source. Pin the identity
        // here so a regression that re-introduces an inline literal at
        // the seed site surfaces at build time on this test's failure.
        // Peer to the sibling
        // [`cluster_bundle_opts_for_caixa_seeds_interval_from_lifted_default`]
        // pin on the co-resident per-caixa Flux v2 CR substrate-default
        // seed surface — that test pins `opts.interval`'s substrate-side
        // seed agrees with the lifted canonical default, this test pins
        // `opts.chart_path`'s substrate-side seed agrees with the peer
        // lifted canonical default.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        assert_eq!(
            opts.chart_path, DEFAULT_FLUX_CHART_SOURCE_SUBPATH,
            "the substrate's per-caixa Flux v2 chart-directory-in-git-\
             source default seed must resolve to the lifted \
             `DEFAULT_FLUX_CHART_SOURCE_SUBPATH` scalar — drift here \
             silently splits the substrate's per-caixa chart-open \
             contract between the operator-facing canonical default \
             and the per-caixa seeded chart-directory pointer"
        );
    }

    #[test]
    fn cluster_bundle_opts_for_caixa_git_url_fallback_routes_through_caixa_nome_accessor() {
        // Fail-before-pass-after pin: the substrate's per-caixa
        // `:repositorio`-null pleme-org github URL fallback composer
        // inside [`ClusterBundleOpts::for_caixa`] must derive its
        // trailing `<nome>` path segment through the typed
        // [`caixa_core::Caixa::nome`] accessor, not the raw
        // `caixa.nome` field access. Before this converge the
        // fallback branch carried a raw `nome = caixa.nome` Display
        // of the underlying `String` field into the `format!("https://\
        // github.com/{org}/{nome}", ...)` template, bypassing the
        // typed dispatch every peer per-Caixa identity consumer in
        // caixa-helm / caixa-mesh already routes through — the
        // canonical drift-footgun shape where a future
        // `Caixa::nome`-accessor extension (a per-cluster alias
        // table the operator pins through a future `:placement`-
        // scoped slot, an M4 namespace-qualified rewrite the CR
        // materializer applies per-CR, the future `:nome-suffix`
        // overlay MESH-COMPOSITION §III.2 acknowledges) would land
        // on the accessor but never reach this emit site, silently
        // splitting the parent-Caixa identity between the
        // FluxCD `GitRepository` `spec.url` `<org>/<nome>` clone
        // target this fallback composes and every other per-Caixa
        // identity consumer the caixa-helm / caixa-mesh renderers
        // emit — the source-controller would then clone from a
        // wrong-name pleme-org repository, silently freezing every
        // `:repositorio`-null caixa's Flux v2 clone target at the
        // pre-extension name and orphaning the paired `HelmRelease`
        // `chart: sourceRef` from the actual per-caixa git source
        // the substrate resolves through the accessor. Pin the
        // equality on the constructed `opts.git_url` so a regression
        // that re-inlines `caixa.nome` at the fallback site
        // surfaces here as a build-time test failure rather than as
        // a silent deploy-time `GitRepository` reconcile loop. Peer
        // to the sibling `cluster_bundle_default_git_tag_uses_lifted_caixa_core_prefix`
        // pin on the co-resident `git_ref` axis of the same
        // `ClusterBundleOpts::for_caixa` composer surface, and to
        // the sibling 22461ef (caixa-helm) / 980c059 (caixa-mesh)
        // `caixa.nome()` converge pins on the peer non-`.clone()`
        // raw-field-access axis of `Caixa::nome` in the other two
        // substrate-side renderers.
        let mut caixa = sample_caixa();
        caixa.repositorio = None;
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        let expected = format!(
            "https://github.com/{org}/{nome}",
            org = caixa_core::DEFAULT_PLEME_GIT_ORG,
            nome = caixa.nome(),
        );
        assert_eq!(
            opts.git_url, expected,
            "the substrate's per-caixa `:repositorio`-null pleme-org \
             github URL fallback composer must derive its trailing \
             `<nome>` path segment through the typed \
             `caixa_core::Caixa::nome` accessor — a regression that \
             re-inlines `caixa.nome` at the fallback site silently \
             splits the parent-Caixa identity between the FluxCD \
             `GitRepository` `spec.url` `<org>/<nome>` clone target \
             and every other per-Caixa identity consumer the sibling \
             caixa-helm / caixa-mesh renderers emit"
        );
    }

    #[test]
    fn flux_helmrelease_remediation_retries_default_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`
        // was lifted from the two production-code duplicated inline
        // `retries: 3` scalar-value literals inside [`cluster_bundle`]'s
        // `helmrelease.yaml` format-string template (the install-path
        // `install.remediation.retries` site + the upgrade-path
        // `upgrade.remediation.retries` site) to a re-export of
        // [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] so
        // the Flux v2 helm-controller-side per-CR remediation-retries
        // default scalar-value lives in exactly one place across every
        // caixa renderer. Pin the equality here so any local
        // re-introduction of a sibling `pub const
        // FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT: u32 = <n>` (the
        // canonical drift footgun where a sibling local `pub const`
        // could happen to carry a different value while the rest of the
        // codebase keeps consuming the caixa-core canonical) is a
        // build-time test failure naming the offending drift, not a
        // silent apply-time symptom — the prior duplicated inline shape
        // would have let a substrate-side retry-ceiling migration on the
        // canonical caixa-core declaration without a coordinated caixa-
        // flux edit silently seed per-caixa Flux v2 `HelmRelease` CRs at
        // a drifted per-path remediation-retries schedule, splitting the
        // substrate's canonical retry-ceiling between the install-path
        // and the upgrade-path with no diagnostic naming the ceiling-
        // drift root cause. Peer to
        // [`default_flux_reconcile_interval_re_export_points_at_caixa_core_canonical`]
        // on the sibling canonical-substrate-default-load-bearing-scalar
        // re-export surface.
        assert_eq!(
            FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT,
            caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT,
            "`caixa_flux::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT` \
             must be the value-identical re-export of the canonical \
             `caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT` — \
             drift here silently splits the substrate's per-caixa Flux \
             v2 `HelmRelease` remediation-retries ceiling between the \
             canonical caixa-core declaration and the renderer's threaded \
             seed"
        );
    }

    #[test]
    fn flux_helmrelease_key_retries_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_HELMRELEASE_KEY_RETRIES`
        // is the single source of truth for the Flux v2 per-CR
        // remediation-retries leaf-scalar-key baked into both the
        // install-path + upgrade-path `retries:` sub-block leaf-headers
        // of the [`cluster_bundle`] `helmrelease.yaml` format-string
        // template (both threading the same `&'static str` through the
        // new `{retries_key}` named-arg interpolation) plus the two
        // test-fixture navigation sites in `mod tests` that probe the
        // rendered document at `.get(FLUX_HELMRELEASE_KEY_RETRIES)`. Pin
        // the equality (and the static-data identity, peer with the
        // sibling
        // [`flux_helmrelease_remediation_retries_default_re_export_points_at_caixa_core_canonical`]
        // pin on the scalar-value half of the same
        // `(leaf-key, scalar-value)` per-path retry-cap declaration
        // pair) so any local re-introduction of a sibling
        // `pub const FLUX_HELMRELEASE_KEY_RETRIES: &str = "…"` (the
        // canonical drift footgun this lift closes — the load-bearing
        // Flux-v2-helm-controller-side per-CR remediation-retries leaf-
        // scalar-key across four prior inlined occurrences — two
        // production emit sites in the `cluster_bundle` `helmrelease.yaml`
        // format-string template plus two test-fixture navigation sites,
        // lifted to one re-export at the caixa-core boundary) is a
        // build-time test failure naming the offending drift, not a
        // silent apply-time symptom (a stripped `retries:` leaf letting
        // the helm-controller fall back to the Flux v2 upstream default).
        assert_eq!(
            FLUX_HELMRELEASE_KEY_RETRIES,
            caixa_core::FLUX_HELMRELEASE_KEY_RETRIES
        );
        assert!(
            std::ptr::eq(
                FLUX_HELMRELEASE_KEY_RETRIES.as_ptr(),
                caixa_core::FLUX_HELMRELEASE_KEY_RETRIES.as_ptr(),
            ),
            "FLUX_HELMRELEASE_KEY_RETRIES must be a re-export of \
             caixa_core::FLUX_HELMRELEASE_KEY_RETRIES, not a sibling `pub const` \
             that happens to carry the same string — drift between the two is \
             the canonical footgun this lift closes"
        );
    }

    #[test]
    fn flux_helmrelease_key_remediation_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATION`
        // is the single source of truth for the Flux v2 per-CR
        // remediation sub-container-axis-key baked into both the
        // install-path + upgrade-path `remediation:` sub-block-header
        // lines of the [`cluster_bundle`] `helmrelease.yaml` format-
        // string template (both threading the same `&'static str`
        // through the new `{remediation_key}` named-arg interpolation)
        // plus the two test-fixture navigation sites in `mod tests` that
        // probe the rendered document at
        // `.get(FLUX_HELMRELEASE_KEY_REMEDIATION)`. Pin the equality
        // (and the static-data identity, peer with the sibling
        // [`flux_helmrelease_key_retries_re_export_points_at_caixa_core_canonical`]
        // pin on the leaf-scalar-key half of the same
        // `(container-axis-key, leaf-scalar-key, scalar-value)` per-path
        // retry-cap declaration triple) so any local re-introduction of
        // a sibling `pub const FLUX_HELMRELEASE_KEY_REMEDIATION: &str =
        // "…"` (the canonical drift footgun this lift closes — the
        // load-bearing Flux-v2-helm-controller-side per-CR remediation
        // sub-container-axis-key across four prior inlined occurrences —
        // two production emit sites in the `cluster_bundle`
        // `helmrelease.yaml` format-string template plus two test-
        // fixture navigation sites, lifted to one re-export at the
        // caixa-core boundary) is a build-time test failure naming the
        // offending drift, not a silent apply-time symptom (a stripped
        // whole-remediation sub-block letting the helm-controller fall
        // back to the Flux v2 upstream defaults for the whole per-path
        // remediation surface).
        caixa_core::assert_str_reexport_identity(
            "FLUX_HELMRELEASE_KEY_REMEDIATION",
            FLUX_HELMRELEASE_KEY_REMEDIATION,
            caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATION,
        );
    }

    #[test]
    fn flux_helmrelease_key_remediation_pins_canonical_remediation_string() {
        // Bridge-arm pin: the lifted [`FLUX_HELMRELEASE_KEY_REMEDIATION`]
        // constant resolves to the canonical `"remediation"` string
        // today, and both rendered Flux v2 `HelmRelease` per-path per-CR
        // sub-block-headers must spell it out verbatim. Pin the literal
        // here (peer with the sibling
        // [`flux_helmrelease_key_retries_pins_canonical_retries_string`]-shape
        // canonical-default arm on the sibling per-CR leaf-scalar-key
        // surface + the peer
        // [`flux_key_source_ref_pins_canonical_source_ref_string`]-shape
        // canonical-default arm on the peer per-CR container-axis-key
        // surface) so a future rebrand of the lifted constant (Flux v3
        // rename like `recovery` / `retryPolicy` / `errorHandling` —
        // upstream Flux v3 roadmap candidates that would land the same
        // per-CR retry-cap semantics under a different sub-container-
        // axis-key) surfaces here as a coordinated edit-point.
        assert_eq!(FLUX_HELMRELEASE_KEY_REMEDIATION, "remediation");
    }

    #[test]
    fn flux_helmrelease_key_install_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_HELMRELEASE_KEY_INSTALL`
        // is the single source of truth for the Flux v2 per-CR install-
        // path helm-action-phase discriminator parent-container-axis-key
        // baked into the `install:` sub-block-header line of the
        // [`cluster_bundle`] `helmrelease.yaml` format-string template
        // (threading the same `&'static str` through the new
        // `{install_key}` named-arg interpolation) plus the one test-
        // fixture navigation site in `mod tests` that probes the
        // rendered document at `.get(FLUX_HELMRELEASE_KEY_INSTALL)`. Pin
        // the equality (and the static-data identity, peer with the
        // sibling
        // [`flux_helmrelease_key_remediation_re_export_points_at_caixa_core_canonical`]
        // pin on the sub-container-axis-key half of the same
        // `(parent-container-key, sub-container-key, leaf-key, scalar-
        // value)` per-path retry-cap declaration quartet) so any local
        // re-introduction of a sibling `pub const
        // FLUX_HELMRELEASE_KEY_INSTALL: &str = "…"` (the canonical drift
        // footgun this lift closes — the load-bearing Flux-v2-helm-
        // controller-side per-CR install-path phase-discriminator
        // parent-container-axis-key across two prior inlined occurrences —
        // one production emit site in the `cluster_bundle`
        // `helmrelease.yaml` format-string template plus one test-
        // fixture navigation site, lifted to one re-export at the caixa-
        // core boundary) is a build-time test failure naming the
        // offending drift, not a silent apply-time symptom (a stripped
        // whole-install-path per-CR phase block letting the helm-
        // controller fall back to the Flux v2 upstream defaults for the
        // whole install-path phase surface).
        caixa_core::assert_str_reexport_identity(
            "FLUX_HELMRELEASE_KEY_INSTALL",
            FLUX_HELMRELEASE_KEY_INSTALL,
            caixa_core::FLUX_HELMRELEASE_KEY_INSTALL,
        );
    }

    #[test]
    fn flux_helmrelease_key_install_pins_canonical_install_string() {
        // Bridge-arm pin: the lifted [`FLUX_HELMRELEASE_KEY_INSTALL`]
        // constant resolves to the canonical `"install"` string today,
        // and the rendered Flux v2 `HelmRelease` per-CR install-path
        // phase sub-block-header must spell it out verbatim. Pin the
        // literal here (peer with the sibling
        // [`flux_helmrelease_key_remediation_pins_canonical_remediation_string`]-shape
        // canonical-default arm on the sibling per-CR sub-container-
        // axis-key surface + the sibling
        // [`flux_helmrelease_key_retries_pins_canonical_retries_string`]-shape
        // canonical-default arm on the sibling per-CR leaf-scalar-key
        // surface) so a future rebrand of the lifted constant (Flux v3
        // rename like `initialize` / `apply` / `create` / `first-run` —
        // upstream Flux v3 roadmap candidates that would land the same
        // per-CR first-time chart apply phase semantics under a
        // different parent-container-axis-key) surfaces here as a
        // coordinated edit-point.
        assert_eq!(FLUX_HELMRELEASE_KEY_INSTALL, "install");
    }

    #[test]
    fn flux_helmrelease_key_upgrade_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_HELMRELEASE_KEY_UPGRADE`
        // is the single source of truth for the Flux v2 per-CR upgrade-
        // path helm-action-phase discriminator parent-container-axis-key
        // baked into the `upgrade:` sub-block-header line of the
        // [`cluster_bundle`] `helmrelease.yaml` format-string template
        // (threading the same `&'static str` through the new
        // `{upgrade_key}` named-arg interpolation) plus the one test-
        // fixture navigation site in `mod tests` that probes the
        // rendered document at `.get(FLUX_HELMRELEASE_KEY_UPGRADE)`. Pin
        // the equality (and the static-data identity, peer with the
        // sibling
        // [`flux_helmrelease_key_install_re_export_points_at_caixa_core_canonical`]
        // pin on the peer install-path phase-discriminator half of the
        // same per-CR helm-action-phase discriminator parent-container-
        // axis-key pair) so any local re-introduction of a sibling
        // `pub const FLUX_HELMRELEASE_KEY_UPGRADE: &str = "…"` is a
        // build-time test failure naming the offending drift, not a
        // silent apply-time symptom (a stripped whole-upgrade-path per-
        // CR phase block letting the helm-controller fall back to the
        // Flux v2 upstream defaults for the whole upgrade-path phase
        // surface, silently dropping the substrate's
        // `remediateLastFailure: true` toggle + the per-CR retry-cap
        // ceiling from every per-version chart re-apply).
        caixa_core::assert_str_reexport_identity(
            "FLUX_HELMRELEASE_KEY_UPGRADE",
            FLUX_HELMRELEASE_KEY_UPGRADE,
            caixa_core::FLUX_HELMRELEASE_KEY_UPGRADE,
        );
    }

    #[test]
    fn flux_helmrelease_key_upgrade_pins_canonical_upgrade_string() {
        // Bridge-arm pin: the lifted [`FLUX_HELMRELEASE_KEY_UPGRADE`]
        // constant resolves to the canonical `"upgrade"` string today,
        // and the rendered Flux v2 `HelmRelease` per-CR upgrade-path
        // phase sub-block-header must spell it out verbatim. Pin the
        // literal here (peer with the sibling
        // [`flux_helmrelease_key_install_pins_canonical_install_string`]-shape
        // canonical-default arm on the peer per-CR install-path phase-
        // discriminator surface) so a future rebrand of the lifted
        // constant (Flux v3 rename like `reapply` / `reconcile` /
        // `update` / `promote` — upstream Flux v3 roadmap candidates
        // that would land the same per-CR per-version chart re-apply
        // phase semantics under a different parent-container-axis-key)
        // surfaces here as a coordinated edit-point.
        assert_eq!(FLUX_HELMRELEASE_KEY_UPGRADE, "upgrade");
    }

    #[test]
    fn flux_helmrelease_key_retries_pins_canonical_retries_string() {
        // Bridge-arm pin: the lifted [`FLUX_HELMRELEASE_KEY_RETRIES`]
        // constant resolves to the canonical `"retries"` string today,
        // and both rendered Flux v2 `HelmRelease` per-path retry-cap
        // leaf sub-block headers must spell it out verbatim. Pin the
        // literal here (peer with the sibling
        // [`flux_key_source_ref_pins_canonical_source_ref_string`]-shape
        // canonical-default arm on the sibling per-CR container-axis-key
        // surface) so a future rebrand of the lifted constant (Flux v3
        // rename like `attempts` / `maxRetries` / `retryCount` — the
        // upstream Gateway-API-side `spec.rules[].retry.attempts` leaf
        // already uses `attempts` on the sibling `GATEWAY_API_KEY_ATTEMPTS`
        // axis, an independent CRD group's evolution the two `pub const`
        // declarations stay sibling constants against) surfaces here as
        // a coordinated edit-point.
        assert_eq!(FLUX_HELMRELEASE_KEY_RETRIES, "retries");
    }

    #[test]
    fn cluster_bundle_helmrelease_install_remediation_retries_pins_lifted_default() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`
        // document's `spec.install.remediation.retries` scalar must
        // resolve to the lifted
        // [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] verbatim.
        // Before the lift the axis carried an inline `retries: 3`
        // scalar-value literal at the sole production-code call site
        // (the install-path `install.remediation.retries` position of
        // the [`cluster_bundle`] `helmrelease.yaml` format-string
        // template); a future substrate-side retry-ceiling migration on
        // the canonical
        // [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`]
        // declaration that failed to reach this emit site would
        // silently split the substrate's canonical retry-ceiling
        // between the operator-facing canonical default and the per-
        // caixa `helmrelease.yaml` install-path retry cap the helm-
        // controller consumes at first-time chart apply time. Pin the
        // identity here so a regression that re-introduces an inline
        // literal at the emit site surfaces at build time on this
        // test's failure. Peer to the sibling
        // [`cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default`]
        // pin on the upgrade-path retry-cap sibling axis — that test
        // pins the rendered upgrade-path scalar agrees with the lifted
        // default, this test pins the rendered install-path scalar
        // agrees with the same.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let install_retries = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_HELMRELEASE_KEY_INSTALL))
            .and_then(|i| i.get(FLUX_HELMRELEASE_KEY_REMEDIATION))
            .and_then(|r| r.get(FLUX_HELMRELEASE_KEY_RETRIES))
            .and_then(|v| v.as_u64())
            .expect(
                "spec.install.remediation.retries scalar present; drift on \
                 this axis silently splits the substrate's canonical retry-\
                 ceiling between the install-path first-time chart apply and \
                 the canonical `FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`",
            );
        assert_eq!(
            install_retries,
            u64::from(FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT),
            "spec.install.remediation.retries must carry the lifted \
             `FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT` scalar — \
             drift here silently splits the substrate's canonical retry-\
             ceiling between the operator-facing canonical default and \
             the install-path retry cap the Flux v2 helm-controller \
             consumes at first-time chart apply time"
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`
        // document's `spec.upgrade.remediation.retries` scalar must
        // resolve to the lifted
        // [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] verbatim.
        // Before the lift the axis carried a second inline `retries: 3`
        // scalar-value literal at the sole production-code call site
        // (the upgrade-path `upgrade.remediation.retries` position of
        // the [`cluster_bundle`] `helmrelease.yaml` format-string
        // template, sibling to the install-path retry-cap the peer
        // [`cluster_bundle_helmrelease_install_remediation_retries_pins_lifted_default`]
        // pin covers); a future substrate-side retry-ceiling migration
        // on the canonical
        // [`caixa_core::FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`]
        // declaration that failed to reach this emit site would
        // silently split the substrate's canonical retry-ceiling
        // between the operator-facing canonical default and the per-
        // caixa `helmrelease.yaml` upgrade-path retry cap the helm-
        // controller consumes on every subsequent per-version chart re-
        // apply the same `HelmRelease` CR gates. Pin the identity here
        // so a regression that re-introduces an inline literal at the
        // emit site surfaces at build time on this test's failure. Peer
        // to the sibling
        // [`cluster_bundle_helmrelease_install_remediation_retries_pins_lifted_default`]
        // pin on the install-path retry-cap sibling axis — closing the
        // per-path retry-cap sweep the caixa-core lift established.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let upgrade_retries = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_HELMRELEASE_KEY_UPGRADE))
            .and_then(|u| u.get(FLUX_HELMRELEASE_KEY_REMEDIATION))
            .and_then(|r| r.get(FLUX_HELMRELEASE_KEY_RETRIES))
            .and_then(|v| v.as_u64())
            .expect(
                "spec.upgrade.remediation.retries scalar present; drift on \
                 this axis silently splits the substrate's canonical retry-\
                 ceiling between the upgrade-path per-version chart re-apply \
                 and the canonical `FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`",
            );
        assert_eq!(
            upgrade_retries,
            u64::from(FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT),
            "spec.upgrade.remediation.retries must carry the lifted \
             `FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT` scalar — \
             drift here silently splits the substrate's canonical retry-\
             ceiling between the operator-facing canonical default and \
             the upgrade-path retry cap the Flux v2 helm-controller \
             consumes on every subsequent per-caixa-version chart re-apply"
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_upgrade_remediation_remediate_last_failure_pins_lifted_true() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`
        // document's `spec.upgrade.remediation.remediateLastFailure`
        // upgrade-path-only per-CR remediation-toggle leaf-scalar-key must
        // resolve to `true` verbatim under the lifted
        // [`FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`] leaf-key. Before
        // the lift the axis carried an inline `remediateLastFailure: true`
        // leaf-scalar-key literal at the sole production-code call site
        // (the upgrade-path `upgrade.remediation.remediateLastFailure`
        // position of the [`cluster_bundle`] `helmrelease.yaml` format-
        // string template, sibling to the upgrade-path retry-cap the peer
        // [`cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default`]
        // pin covers); a future substrate-side rebrand on the canonical
        // [`caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`]
        // declaration that failed to reach this emit site would silently
        // strip the substrate's chosen post-retry-exhaustion rollback
        // semantic from every emitted per-caixa `HelmRelease` document —
        // the Flux v2 helm-controller would then leave every terminally-
        // failed upgrade in the failed state without rolling back to the
        // prior last-known-good release the substrate's "no chart apply
        // leaves a per-caixa CR in a stalled, unremediated state"
        // MESH-COMPOSITION.md §V guarantee mandates. Pin the identity
        // here so a regression that re-introduces an inline literal at
        // the emit site — or a rebrand on the canonical const that fails
        // to reach the emit site — surfaces at build time on this test's
        // failure. Peer to the sibling
        // [`cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default`]
        // pin on the upgrade-path retry-cap sibling axis — closes the
        // `spec.upgrade.remediation.{retries, remediateLastFailure}` leaf-
        // scalar-key pair the substrate seeds under the upgrade-path per-
        // CR remediation sub-container.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let remediate_last_failure = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_HELMRELEASE_KEY_UPGRADE))
            .and_then(|u| u.get(FLUX_HELMRELEASE_KEY_REMEDIATION))
            .and_then(|r| r.get(FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE))
            .and_then(|v| v.as_bool())
            .expect(
                "spec.upgrade.remediation.remediateLastFailure boolean scalar \
                 present; drift on this axis silently drops the substrate's \
                 chosen post-retry-exhaustion rollback semantic from every \
                 emitted per-caixa `HelmRelease` document, leaving every \
                 terminally-failed upgrade in the failed state without \
                 rolling back to the prior last-known-good release",
            );
        assert_eq!(
            remediate_last_failure, FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT,
            "spec.upgrade.remediation.remediateLastFailure must carry the \
             lifted `FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT` \
             scalar — drift silently splits the substrate's canonical \
             post-retry-exhaustion rollback semantic between the operator-\
             facing canonical default and the per-caixa `HelmRelease` \
             document's per-CR upgrade-path remediation-toggle the Flux \
             v2 helm-controller's per-CR upgrade-path remediation loop \
             keys off to trigger the prior-release rollback pipeline once \
             the paired retry-cap ceiling has been exhausted, and every \
             terminally-failed per-caixa upgrade sits in the failed state \
             indefinitely with no diagnostic naming the remediation-\
             toggle-drift root cause"
        );
    }

    #[test]
    fn flux_helmrelease_key_remediate_last_failure_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE` was
        // lifted from the production-code inline `remediateLastFailure`
        // literal at the sole `cluster_bundle` `helmrelease.yaml` format-
        // string template's upgrade-path per-CR remediation-toggle leaf-
        // scalar-key emit site + the test-fixture navigation site the
        // sibling
        // [`cluster_bundle_helmrelease_upgrade_remediation_remediate_last_failure_pins_lifted_true`]
        // pin opens onto the rendered document, to a re-export of
        // [`caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE`] so
        // the canonical Flux v2 per-CR upgrade-path per-CR remediation-
        // toggle leaf-scalar-key lives in exactly one place across every
        // caixa renderer. Pin the equality + static-data identity here
        // so any local re-introduction of a sibling
        // `pub const FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE: &str = "…"`
        // at this crate (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation) is
        // a build-time test failure naming the offending drift. Peer to
        // [`flux_helmrelease_key_retries_re_export_points_at_caixa_core_canonical`]
        // on the sibling per-CR retry-cap leaf-scalar-key re-export axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE",
            FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE,
            caixa_core::FLUX_HELMRELEASE_KEY_REMEDIATE_LAST_FAILURE,
        );
    }

    #[test]
    fn flux_helmrelease_remediate_last_failure_default_re_export_matches_caixa_core_canonical_value()
     {
        // The renderer's `FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT`
        // was lifted from the production-code inline `true` scalar-value
        // literal at the sole `cluster_bundle` `helmrelease.yaml` format-
        // string template's per-CR upgrade-path remediation-toggle scalar-
        // value emit site (the `remediateLastFailure: true` leaf inside
        // the per-CR `spec.upgrade.remediation` sub-block) + the test-
        // fixture navigation site the sibling
        // [`cluster_bundle_helmrelease_upgrade_remediation_remediate_last_failure_pins_lifted_true`]
        // pin's `assert!(remediate_last_failure)` predicate opened onto
        // the rendered document, to a re-export of
        // [`caixa_core::FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT`]
        // so the canonical Flux v2 per-CR upgrade-path per-CR remediation-
        // toggle scalar-value default lives in exactly one place across
        // every caixa renderer. Pin the value-equality here so any local
        // re-introduction of a sibling
        // `pub const FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT: bool = …`
        // at this crate (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry a drifted value) is a
        // build-time test failure naming the offending drift. Peer to
        // [`flux_helmrelease_key_remediate_last_failure_re_export_points_at_caixa_core_canonical`]
        // on the paired leaf-scalar-key half of the same `(key, value)`
        // per-CR `spec.upgrade.remediation.remediateLastFailure` pair —
        // the key half's re-export identity lives at the sibling
        // `assert_str_reexport_identity` pin, the value half's canonical
        // `bool` seed lives here. Same shape as the sibling
        // [`flux_kustomization_prune_default_re_export_matches_caixa_core_canonical_value`]
        // pin on the peer per-`Kustomization`-CR garbage-collection-
        // toggle scalar-value default axis.
        assert_eq!(
            FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT,
            caixa_core::FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT,
            "FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT re-export \
             must resolve to the canonical caixa_core value — drift \
             silently splits the substrate's canonical post-retry-\
             exhaustion rollback default between the two `pub const` \
             declarations, and every rendered per-caixa `helmrelease.yaml` \
             would emit a different per-CR upgrade-path remediation-toggle \
             scalar than every downstream consumer (the future M4 \
             `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's per-\
             Aplicacao `HelmRelease` synthesis, the future admission-\
             webhook floor) reads at admit / reconcile time"
        );
        assert!(
            FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT,
            "FLUX_HELMRELEASE_REMEDIATE_LAST_FAILURE_DEFAULT must remain \
             `true` — the substrate's canonical \"no chart apply leaves \
             a per-caixa CR in a stalled, unremediated state\" \
             (MESH-COMPOSITION.md §V) guarantee requires every emitted \
             per-caixa `HelmRelease` opt into the helm-controller's per-CR \
             upgrade-path post-retry-exhaustion rollback pipeline; a drift \
             to `false` here silently leaves every terminally-failed \
             upgrade parked at `Ready: False` without rolling back to the \
             prior last-known-good release"
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_install_create_namespace_pins_lifted_true() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`
        // document's `spec.install.createNamespace` install-path-only
        // per-CR namespace-seeder-toggle leaf-scalar-key must resolve to
        // `true` verbatim under the lifted
        // [`FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] leaf-key. Before the
        // lift the axis carried an inline `createNamespace: true` leaf-
        // scalar-key literal at the sole production-code call site (the
        // install-path `install.createNamespace` position of the
        // [`cluster_bundle`] `helmrelease.yaml` format-string template,
        // mirror-symmetric to the upgrade-path remediation-toggle the peer
        // [`cluster_bundle_helmrelease_upgrade_remediation_remediate_last_failure_pins_lifted_true`]
        // pin covers); a future substrate-side rebrand on the canonical
        // [`caixa_core::FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`]
        // declaration that failed to reach this emit site would silently
        // strip the substrate's chosen first-apply namespace-seeder
        // semantic from every emitted per-caixa `HelmRelease` document —
        // the Flux v2 helm-controller would then refuse every first-time
        // per-caixa chart apply against a fresh cluster whose target
        // namespace has not been pre-provisioned by an out-of-band
        // pipeline the substrate's "no per-caixa Servico apply is blocked
        // on manual namespace preprovisioning" MESH-COMPOSITION.md §V
        // install-path-fluency guarantee mandates. Pin the identity here
        // so a regression that re-introduces an inline literal at the
        // emit site — or a rebrand on the canonical const that fails to
        // reach the emit site — surfaces at build time on this test's
        // failure. Peer to the sibling
        // [`cluster_bundle_helmrelease_upgrade_remediation_remediate_last_failure_pins_lifted_true`]
        // pin on the mirror-symmetric upgrade-path per-CR remediation-
        // toggle axis — closes the
        // `spec.{install.createNamespace, upgrade.remediation.remediateLastFailure}`
        // per-CR phase-specific toggle leaf-scalar-key pair the substrate
        // seeds under mirror-symmetric parent-container-axis-keys.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let create_namespace = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_HELMRELEASE_KEY_INSTALL))
            .and_then(|i| i.get(FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE))
            .and_then(|v| v.as_bool())
            .expect(
                "spec.install.createNamespace boolean scalar present; drift \
                 on this axis silently drops the substrate's chosen first-\
                 apply namespace-seeder semantic from every emitted per-\
                 caixa `HelmRelease` document, leaving every first-time \
                 per-caixa chart apply against a fresh cluster refused by \
                 the helm-controller because the target namespace was not \
                 pre-provisioned by an out-of-band pipeline",
            );
        assert_eq!(
            create_namespace, FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT,
            "spec.install.createNamespace must carry the lifted \
             `FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT` scalar — drift \
             silently splits the substrate's canonical first-apply \
             namespace-seeder semantic between the operator-facing \
             canonical default and the per-caixa `HelmRelease` document's \
             per-CR install-path namespace-seeder-toggle the Flux v2 \
             helm-controller's per-CR install-path pre-apply loop keys \
             off to materialize the target namespace before the first \
             chart apply, and every first-time per-caixa Servico chart \
             apply against a fresh cluster is refused with no diagnostic \
             naming the seeder-toggle-drift root cause"
        );
    }

    #[test]
    fn flux_helmrelease_key_create_namespace_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE` was
        // lifted from the production-code inline `createNamespace`
        // literal at the sole `cluster_bundle` `helmrelease.yaml` format-
        // string template's install-path per-CR namespace-seeder-toggle
        // leaf-scalar-key emit site + the test-fixture navigation site
        // the sibling
        // [`cluster_bundle_helmrelease_install_create_namespace_pins_lifted_true`]
        // pin opens onto the rendered document, to a re-export of
        // [`caixa_core::FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE`] so the
        // canonical Flux v2 per-CR install-path per-CR namespace-seeder-
        // toggle leaf-scalar-key lives in exactly one place across every
        // caixa renderer. Pin the equality + static-data identity here so
        // any local re-introduction of a sibling
        // `pub const FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE: &str = "…"`
        // at this crate (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation) is
        // a build-time test failure naming the offending drift. Peer to
        // [`flux_helmrelease_key_remediate_last_failure_re_export_points_at_caixa_core_canonical`]
        // on the sibling mirror-symmetric upgrade-path-only per-CR
        // remediation-toggle leaf-scalar-key re-export axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE",
            FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE,
            caixa_core::FLUX_HELMRELEASE_KEY_CREATE_NAMESPACE,
        );
    }

    #[test]
    fn flux_helmrelease_create_namespace_default_re_export_matches_caixa_core_canonical_value() {
        // The renderer's `FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT` was
        // lifted from the production-code inline `true` scalar-value
        // literal at the sole `cluster_bundle` `helmrelease.yaml` format-
        // string template's per-CR install-path namespace-seeder-toggle
        // scalar-value emit site (the `createNamespace: true` leaf inside
        // the per-CR `spec.install` sub-block) + the test-fixture
        // navigation site the sibling
        // [`cluster_bundle_helmrelease_install_create_namespace_pins_lifted_true`]
        // pin's `assert!(create_namespace)` predicate opened onto the
        // rendered document, to a re-export of
        // [`caixa_core::FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT`] so
        // the canonical Flux v2 per-CR install-path per-CR namespace-
        // seeder-toggle scalar-value default lives in exactly one place
        // across every caixa renderer. Pin the value-equality here so any
        // local re-introduction of a sibling
        // `pub const FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT: bool = …`
        // at this crate (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry a drifted value) is a
        // build-time test failure naming the offending drift. Peer to
        // [`flux_helmrelease_key_create_namespace_re_export_points_at_caixa_core_canonical`]
        // on the paired leaf-scalar-key half of the same `(key, value)`
        // per-CR `spec.install.createNamespace` pair — the key half's
        // re-export identity lives at the sibling
        // `assert_str_reexport_identity` pin, the value half's canonical
        // `bool` seed lives here. Same shape as the sibling
        // [`flux_helmrelease_remediate_last_failure_default_re_export_matches_caixa_core_canonical_value`]
        // pin on the peer mirror-symmetric upgrade-path-only per-CR
        // remediation-toggle scalar-value default axis.
        assert_eq!(
            FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT,
            caixa_core::FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT,
            "FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT re-export must \
             resolve to the canonical caixa_core value — drift silently \
             splits the substrate's canonical first-apply namespace-\
             seeder default between the two `pub const` declarations, \
             and every rendered per-caixa `helmrelease.yaml` would emit a \
             different per-CR install-path namespace-seeder-toggle scalar \
             than every downstream consumer (the future M4 \
             `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's per-\
             Aplicacao `HelmRelease` synthesis, the future admission-\
             webhook floor) reads at admit / reconcile time"
        );
        assert!(
            FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT,
            "FLUX_HELMRELEASE_CREATE_NAMESPACE_DEFAULT must remain `true` \
             — the substrate's canonical \"no per-caixa Servico apply is \
             blocked on manual namespace preprovisioning\" \
             (MESH-COMPOSITION.md §V install-path-fluency) guarantee \
             requires every emitted per-caixa `HelmRelease` opt into the \
             helm-controller's per-CR install-path pre-apply namespace-\
             seeder pipeline; a drift to `false` here silently refuses \
             every first-time per-caixa chart apply against a fresh \
             cluster whose target namespace has not been pre-provisioned \
             by an out-of-band pipeline"
        );
    }

    #[test]
    fn cluster_bundle_lareira_enabled_default_re_export_matches_caixa_core_canonical_value() {
        // The renderer's `CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT` was
        // lifted from the production-code inline `true` scalar-value
        // literal at the sole `cluster_bundle` `helmrelease.yaml` format-
        // string template's per-values-overlay child-chart-enablement-
        // toggle scalar-value emit site (the `enabled: true` leaf inside
        // the per-`{library_name}` values-overlay wrap under
        // `spec.values`) + the test-fixture navigation site the sibling
        // `cluster_bundle_helmrelease_wrap_key_pins_canonical_pleme_computeunit_string`
        // pin's `Some(true)` `.and_then(|v| v.as_bool())` predicate
        // opened onto the rendered document, to a re-export of
        // [`caixa_core::CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT`] so the
        // canonical substrate-side child-chart-enablement-toggle
        // scalar-value default lives in exactly one place across every
        // caixa renderer. Pin the value-equality here so any local
        // re-introduction of a sibling
        // `pub const CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT: bool = …`
        // at this crate (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry a drifted value) is a
        // build-time test failure naming the offending drift. Peer to
        // `helm_values_key_enabled_re_export_points_at_caixa_core_canonical`
        // on the paired leaf-scalar-key half of the same
        // `(key, value)` per-values-overlay
        // `spec.values.<library>.enabled` pair — the key half's
        // re-export identity lives at the sibling
        // `assert_str_reexport_identity` pin, the value half's canonical
        // `bool` seed lives here. Same shape as the sibling
        // [`flux_helmrelease_create_namespace_default_re_export_matches_caixa_core_canonical_value`]
        // /
        // [`flux_helmrelease_remediate_last_failure_default_re_export_matches_caixa_core_canonical_value`]
        // /
        // [`flux_kustomization_prune_default_re_export_matches_caixa_core_canonical_value`]
        // pins on the peer canonical-Flux-v2-per-CR-substrate-default
        // re-export axes.
        assert_eq!(
            CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT,
            caixa_core::CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT,
            "CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT re-export must \
             resolve to the canonical caixa_core value — drift silently \
             splits the substrate's canonical force-on-under-composition \
             child-chart-enablement default between the two `pub const` \
             declarations, and every rendered per-caixa `helmrelease.yaml` \
             would emit a different per-values-overlay child-chart-\
             enablement toggle than every downstream consumer (the future \
             M4 `mesh.pleme.io/v1alpha1/Aplicacao` CR materializer's per-\
             Aplicacao `HelmRelease` synthesis) reads at admit / reconcile \
             time"
        );
        assert!(
            CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT,
            "CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT must remain `true` — \
             the `cluster_bundle` composition path is the substrate-side \
             opt-in path where the operator has already asserted per-caixa \
             cluster-scoped ownership by materializing a per-caixa \
             GitRepository + HelmRelease + Kustomization trio, so the \
             overlay must force the child chart on by seeding \
             `enabled: true` under the `values.<library>` wrap; a drift to \
             `false` here silently no-ops every per-caixa lareira child \
             chart at the per-cluster `HelmRelease` apply step, leaving \
             the paired standalone-chart-side `enabled: false` per-chart \
             default un-overridden"
        );
    }

    #[test]
    fn cluster_bundle_kustomization_prune_pins_lifted_true() {
        // Fail-before-pass-after pin: the rendered `kustomization.yaml`
        // document's `spec.prune` per-CR garbage-collection-toggle leaf-
        // scalar-key must resolve to `true` verbatim under the lifted
        // [`FLUX_KUSTOMIZATION_KEY_PRUNE`] leaf-key. Before the lift the
        // axis carried an inline `prune: true` leaf-scalar-key literal
        // at the sole production-code call site (the top-level `spec`
        // position of the [`cluster_bundle`] `kustomization.yaml`
        // format-string template, mirror-symmetric to the per-caixa
        // `HelmRelease` CR install-path-only namespace-seeder-toggle the
        // peer
        // [`cluster_bundle_helmrelease_install_create_namespace_pins_lifted_true`]
        // pin covers on the co-resident per-caixa `HelmRelease` CR); a
        // future substrate-side rebrand on the canonical
        // [`caixa_core::FLUX_KUSTOMIZATION_KEY_PRUNE`] declaration that
        // failed to reach this emit site would silently strip the
        // substrate's chosen sweep-what-you-removed semantic from every
        // emitted per-caixa `Kustomization` document — the Flux v2
        // kustomize-controller would then leave every per-caixa
        // resource the source manifest set previously reconciled but no
        // longer carries dangling in the cluster the substrate's "the
        // cluster's per-caixa live state converges to the caixa's
        // tatara-lisp source-of-truth on every reconcile — resources
        // the source no longer carries are swept by the kustomize-
        // controller, not left dangling" CAIXA-SDLC.md §V author-to-
        // live-convergence guarantee mandates. Pin the identity here so
        // a regression that re-introduces an inline literal at the emit
        // site — or a rebrand on the canonical const that fails to
        // reach the emit site — surfaces at build time on this test's
        // failure. Peer to the sibling
        // [`cluster_bundle_helmrelease_install_create_namespace_pins_lifted_true`]
        // pin on the co-resident per-`HelmRelease`-CR install-path per-
        // CR namespace-seeder-toggle axis — extends the per-CR-toggle
        // leaf-scalar-key discipline from the co-resident per-
        // `HelmRelease`-CR spec surface onto the co-resident per-
        // `Kustomization`-CR spec surface at the mirror-symmetric top-
        // level `spec.prune` position.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let ks = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&ks.contents).expect("kustomization.yaml parses as YAML");
        let prune = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KUSTOMIZATION_KEY_PRUNE))
            .and_then(|v| v.as_bool())
            .expect(
                "spec.prune boolean scalar present; drift on this axis \
                 silently drops the substrate's chosen sweep-what-you-\
                 removed semantic from every emitted per-caixa \
                 `Kustomization` document, leaving per-caixa resources \
                 the source manifest set previously reconciled but no \
                 longer carries dangling in the cluster",
            );
        assert_eq!(
            prune, FLUX_KUSTOMIZATION_PRUNE_DEFAULT,
            "spec.prune must carry the lifted \
             `FLUX_KUSTOMIZATION_PRUNE_DEFAULT` scalar — drift silently \
             splits the substrate's canonical sweep-what-you-removed \
             semantic between the operator-facing canonical default and \
             the per-caixa `Kustomization` document's per-CR garbage-\
             collection-toggle the Flux v2 kustomize-controller's per-CR \
             reconcile loop keys off to garbage-collect per-caixa resources \
             removed from the source manifest set between reconciles, and \
             every per-caixa `Kustomization` reconcile leaves orphaned \
             resources dangling in the cluster with no diagnostic naming \
             the toggle-drift root cause"
        );
    }

    #[test]
    fn flux_kustomization_prune_default_re_export_matches_caixa_core_canonical_value() {
        // The renderer's `FLUX_KUSTOMIZATION_PRUNE_DEFAULT` was lifted
        // from the production-code inline `true` scalar-value literal at
        // the sole `cluster_bundle` `kustomization.yaml` format-string
        // template's per-CR garbage-collection-toggle scalar-value emit
        // site (the `prune: true` leaf inside the top-level `spec`
        // position) + the test-fixture navigation site the sibling
        // [`cluster_bundle_kustomization_prune_pins_lifted_true`] pin's
        // `assert!(prune)` predicate opened onto the rendered document,
        // to a re-export of [`caixa_core::FLUX_KUSTOMIZATION_PRUNE_DEFAULT`]
        // so the canonical Flux v2 per-CR garbage-collection-toggle
        // scalar-value default lives in exactly one place across every
        // caixa renderer. Pin the value-equality here so any local re-
        // introduction of a sibling
        // `pub const FLUX_KUSTOMIZATION_PRUNE_DEFAULT: bool = …` at this
        // crate (the canonical drift footgun where a sibling local
        // `pub const` could happen to carry a drifted value) is a build-
        // time test failure naming the offending drift. Peer to
        // [`flux_kustomization_key_prune_re_export_points_at_caixa_core_canonical`]
        // on the paired leaf-scalar-key half of the same `(key, value)`
        // per-CR `spec.prune` pair — the key half's re-export identity
        // lives at the sibling `assert_str_reexport_identity` pin, the
        // value half's canonical `bool` seed lives here. Same shape as
        // the sibling
        // [`cluster_bundle_helmrelease_install_remediation_retries_pins_lifted_default`]
        // / [`cluster_bundle_helmrelease_upgrade_remediation_retries_pins_lifted_default`]
        // pins on the peer per-CR HelmRelease remediation retry-cap
        // scalar-value default axis — that default names the per-path
        // per-CR remediation retry ceiling, and this default names
        // whether the per-CR reconcile loop sweeps orphaned resources
        // at all.
        assert_eq!(
            FLUX_KUSTOMIZATION_PRUNE_DEFAULT,
            caixa_core::FLUX_KUSTOMIZATION_PRUNE_DEFAULT,
            "FLUX_KUSTOMIZATION_PRUNE_DEFAULT re-export must resolve to \
             the canonical caixa_core value — drift silently splits the \
             substrate's canonical sweep-what-you-removed default \
             between the two `pub const` declarations, and every rendered \
             per-caixa `kustomization.yaml` would emit a different \
             per-CR garbage-collection-toggle scalar than every downstream \
             consumer (the future M4 `mesh.pleme.io/v1alpha1/Aplicacao` \
             CR materializer's per-Aplicacao `Kustomization` synthesis, \
             the future admission-webhook floor) reads at admit / \
             reconcile time"
        );
        assert!(
            FLUX_KUSTOMIZATION_PRUNE_DEFAULT,
            "FLUX_KUSTOMIZATION_PRUNE_DEFAULT must remain `true` — the \
             substrate's canonical sweep-what-you-removed semantic \
             (CAIXA-SDLC.md §V author-to-live-convergence guarantee) \
             requires every emitted per-caixa `Kustomization` opt into \
             the kustomize-controller's per-CR resource-tracking \
             garbage-collection loop; a drift to `false` here silently \
             leaves orphaned resources dangling in every cluster the \
             substrate reconciles into"
        );
    }

    #[test]
    fn flux_kustomization_key_prune_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_KUSTOMIZATION_KEY_PRUNE` was lifted from
        // the production-code inline `prune` literal at the sole
        // `cluster_bundle` `kustomization.yaml` format-string template's
        // per-CR garbage-collection-toggle leaf-scalar-key emit site +
        // the test-fixture navigation site the sibling
        // [`cluster_bundle_kustomization_prune_pins_lifted_true`] pin
        // opens onto the rendered document, to a re-export of
        // [`caixa_core::FLUX_KUSTOMIZATION_KEY_PRUNE`] so the canonical
        // Flux v2 per-CR garbage-collection-toggle leaf-scalar-key lives
        // in exactly one place across every caixa renderer. Pin the
        // equality + static-data identity here so any local re-
        // introduction of a sibling
        // `pub const FLUX_KUSTOMIZATION_KEY_PRUNE: &str = "…"` at this
        // crate (the canonical drift footgun where a sibling local
        // `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation)
        // is a build-time test failure naming the offending drift. Peer
        // to
        // [`flux_helmrelease_key_create_namespace_re_export_points_at_caixa_core_canonical`]
        // on the sibling co-resident per-`HelmRelease`-CR install-path-
        // only per-CR namespace-seeder-toggle leaf-scalar-key re-export
        // axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KUSTOMIZATION_KEY_PRUNE",
            FLUX_KUSTOMIZATION_KEY_PRUNE,
            caixa_core::FLUX_KUSTOMIZATION_KEY_PRUNE,
        );
    }

    #[test]
    fn cluster_bundle_kustomization_path_pins_lifted_sub_tree() {
        // Fail-before-pass-after pin: the rendered `kustomization.yaml`
        // document's `spec.path` per-CR source-sub-tree leaf-scalar-key
        // must resolve to the canonical per-cluster / per-caixa sub-
        // tree path seed verbatim under the lifted
        // [`FLUX_KUSTOMIZATION_KEY_PATH`] leaf-key. Before the lift the
        // axis carried an inline `path: ./clusters/<cluster>/services/<name>`
        // leaf-scalar-key literal at the sole production-code call
        // site (the top-level `spec` position of the [`cluster_bundle`]
        // `kustomization.yaml` format-string template, mirror-symmetric
        // to the co-resident per-`Kustomization`-CR garbage-collection-
        // toggle the sibling
        // [`cluster_bundle_kustomization_prune_pins_lifted_true`] pin
        // covers). A future substrate-side rebrand on the canonical
        // [`caixa_core::FLUX_KUSTOMIZATION_KEY_PATH`] declaration that
        // failed to reach this emit site would silently unbind every
        // emitted per-caixa `Kustomization` from its paired per-caixa
        // sub-tree of the pleme-io k8s repository — the Flux v2
        // kustomize-controller would then either reconcile the whole
        // GitRepository root (when the CR omits the leaf, the
        // controller defaults to `./`, pulling every unrelated cluster's
        // manifests through the wrong per-caixa `Kustomization`) or
        // refuse to reconcile at all (when the leaf points at a path
        // the GitRepository doesn't carry, the CR sits perpetually at
        // `BuildFailed`). Pin the identity here so a regression that
        // re-introduces an inline literal at the emit site — or a
        // rebrand on the canonical const that fails to reach the emit
        // site — surfaces at build time on this test's failure. Peer
        // to the sibling
        // [`cluster_bundle_kustomization_prune_pins_lifted_true`] pin
        // on the co-resident per-`Kustomization`-CR garbage-collection-
        // toggle axis — extends the per-`Kustomization`-CR-spec leaf-
        // scalar-key discipline from the co-resident garbage-
        // collection-toggle onto the co-resident source-sub-tree
        // pointer at the mirror-symmetric top-level `spec.path`
        // position.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let ks = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&ks.contents).expect("kustomization.yaml parses as YAML");
        let path = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KUSTOMIZATION_KEY_PATH))
            .and_then(|v| v.as_str())
            .expect(
                "spec.path string scalar present; drift on this axis \
                 silently unbinds every per-caixa Kustomization from \
                 its paired per-caixa sub-tree of the pleme-io k8s \
                 repository, and the kustomize-controller either \
                 defaults to reconciling the GitRepository root or \
                 refuses to reconcile at all",
            );
        // Route the per-caixa `:nome` axis-projection through the
        // substrate-canonical [`Caixa::nome`] `&str`-return accessor
        // rather than the raw `&sample_caixa().nome` `&String`-borrow
        // of the underlying field, so a future rebrand of the
        // top-level [`Caixa`] `:nome` universal-axis storage (a
        // pre-parsed `CaixaName`-newtype cache the accessor could
        // materialize behind the same `&str` return contract, a
        // per-cluster `:placement`-scoped nome overlay the caixa-
        // operator reconciles ahead of dispatch) reaches this
        // fixture-navigation site through the one accessor edit at
        // the canonical `caixa-core` declaration rather than a
        // coordinated rewrite that includes this file too. Peer to
        // the sibling
        // [`cluster_bundle_kustomization_spec_path_uses_lifted_composer`]
        // pin below on the paired composer-equivalence test-fixture
        // navigation site — both halves of the `sample_caixa()`
        // per-`:nome` fixture-navigation axis now route through the
        // one typed dispatch on the substrate primitive.
        let expected = flux_kustomization_source_subtree(&opts.cluster, sample_caixa().nome());
        assert_eq!(
            path, expected,
            "spec.path must carry the substrate's canonical per-cluster \
             / per-caixa sub-tree seed — drift silently unbinds every \
             per-caixa Kustomization from its paired sub-tree of the \
             pleme-io k8s repository"
        );
    }

    #[test]
    fn flux_kustomization_key_path_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_KUSTOMIZATION_KEY_PATH` was lifted from
        // the production-code inline `path` literal at the sole
        // `cluster_bundle` `kustomization.yaml` format-string template's
        // per-CR source-sub-tree leaf-scalar-key emit site + the test-
        // fixture navigation site the sibling
        // [`cluster_bundle_kustomization_path_pins_lifted_sub_tree`] pin
        // opens onto the rendered document, to a re-export of
        // [`caixa_core::FLUX_KUSTOMIZATION_KEY_PATH`] so the canonical
        // Flux v2 per-CR source-sub-tree leaf-scalar-key lives in
        // exactly one place across every caixa renderer. Pin the
        // equality + static-data identity here so any local re-
        // introduction of a sibling
        // `pub const FLUX_KUSTOMIZATION_KEY_PATH: &str = "…"` at this
        // crate (the canonical drift footgun where a sibling local
        // `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation)
        // is a build-time test failure naming the offending drift.
        // Peer to
        // [`flux_kustomization_key_prune_re_export_points_at_caixa_core_canonical`]
        // on the sibling co-resident per-`Kustomization`-CR garbage-
        // collection-toggle leaf-scalar-key re-export axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KUSTOMIZATION_KEY_PATH",
            FLUX_KUSTOMIZATION_KEY_PATH,
            caixa_core::FLUX_KUSTOMIZATION_KEY_PATH,
        );
    }

    #[test]
    fn flux_kustomization_source_subtree_re_export_matches_caixa_core_canonical_output() {
        // The renderer's `flux_kustomization_source_subtree` was lifted
        // from the verbatim inline
        // `format!("./clusters/{cluster}/services/{name}")` at the sole
        // `cluster_bundle` `kustomization.yaml` format-string production
        // emit site + a mirror-symmetric verbatim inline
        // `format!("./clusters/{cluster}/services/{name}", …)` at the
        // paired `cluster_bundle_kustomization_path_pins_lifted_sub_tree`
        // test-fixture navigation site, to a re-export of
        // [`caixa_core::flux_kustomization_source_subtree`]. Pin the
        // output-shape equality here on representative fixtures so any
        // local re-introduction of a sibling
        // `pub fn flux_kustomization_source_subtree(...)` shadow at this
        // crate (the canonical drift footgun where a sibling local
        // `pub fn` could happen to produce the same byte-shape at the
        // source while diverging on either axis of the composition) is
        // a build-time test failure naming the offending drift. Peer to
        // [`flux_kustomization_key_path_re_export_points_at_caixa_core_canonical`]
        // on the paired leaf-scalar-key half of the same `(key, value)`
        // per-CR `spec.path` pair — the key half's re-export identity
        // lives at the sibling `assert_str_reexport_identity` pin, the
        // value half's canonical composition lives here. Same shape as
        // the sibling composer re-export identity pins the
        // [`caixa_mesh::cilium_network_policy_name`] and
        // [`caixa_mesh::gateway_api_http_route_name`] re-exports carry
        // at their crate's `mod tests` — every composer re-export in
        // the substrate reaches the canonical `caixa-core` function
        // through one `pub use` and the test-side output-shape identity
        // pin closes the "sibling `pub fn` shadow" footgun by
        // construction.
        assert_eq!(
            flux_kustomization_source_subtree("rio", "hello-rio"),
            caixa_core::flux_kustomization_source_subtree("rio", "hello-rio"),
        );
        assert_eq!(
            flux_kustomization_source_subtree("rio", "hello-rio"),
            "./clusters/rio/services/hello-rio",
        );
        assert_eq!(
            flux_kustomization_source_subtree("paris", "cart"),
            caixa_core::flux_kustomization_source_subtree("paris", "cart"),
        );
    }

    #[test]
    fn cluster_bundle_kustomization_spec_path_uses_lifted_composer() {
        // Composition pin: the `spec.path` scalar emitted by
        // `cluster_bundle` for every per-caixa `kustomization.yaml`
        // document must byte-equal the output of the lifted
        // [`flux_kustomization_source_subtree`] composer with the same
        // `(cluster, nome)` arguments — so a future refactor of the
        // composer's internals (per-cluster prefix rebrand, per-caixa
        // infix rebrand, multi-tenant scoping prefix) reaches the
        // renderer through the one function-pointer edit at the
        // canonical `caixa-core` declaration, and any rewrite of the
        // format-string template's `{path_key}: {source_subtree}` emit
        // site that desynchronizes from the composer fires here at
        // build-time rather than silently splitting the writer-side
        // sub-tree seed at emit time. Peer to
        // [`cluster_bundle_kustomization_path_pins_lifted_sub_tree`]
        // above on the paired output-shape assertion — that pin locks
        // the emitted `spec.path` scalar against the composer's output;
        // this pin locks the equivalence to the composer with the
        // ClusterBundleOpts's `cluster` axis threaded through, so a
        // regression that pinned one axis at the emit site while
        // leaving the peer axis inline surfaces on either half.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let ks = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&ks.contents).expect("kustomization.yaml parses as YAML");
        let emitted = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KUSTOMIZATION_KEY_PATH))
            .and_then(|v| v.as_str())
            .expect("spec.path string scalar present")
            .to_owned();
        // Route the per-caixa `:nome` axis-projection through the
        // substrate-canonical [`Caixa::nome`] `&str`-return accessor
        // rather than the raw `&sample_caixa().nome` `&String`-borrow
        // of the underlying field — sibling to the peer
        // [`cluster_bundle_kustomization_path_pins_lifted_sub_tree`]
        // pin's own accessor route at the paired output-shape
        // assertion site. Closes the last pair of unlifted raw
        // `sample_caixa().nome` field-access sites in the caixa-flux
        // test suite; the twin `(cluster, nome)`-argument-pair
        // `flux_kustomization_source_subtree` fixture-navigation half
        // of the per-caixa `:nome` axis now uniformly routes through
        // the substrate primitive.
        let composed = flux_kustomization_source_subtree(&opts.cluster, sample_caixa().nome());
        assert_eq!(
            emitted, composed,
            "spec.path emit must byte-equal the lifted \
             flux_kustomization_source_subtree composer's output — drift \
             at either half silently splits the per-cluster / per-caixa \
             sub-tree seed axis at emit time from the canonical composer"
        );
    }

    #[test]
    fn sample_caixa_nome_accessor_byte_equals_raw_field() {
        // Byte-parity pin: [`Caixa::nome`]'s `&str`-return accessor
        // must project the same bytes as the raw `sample_caixa().nome`
        // `String`-field access on the shared per-test [`sample_caixa`]
        // fixture the caixa-flux test-suite's per-`cluster_bundle`
        // `spec.path` composer-equivalence pins
        // ([`cluster_bundle_kustomization_path_pins_lifted_sub_tree`],
        // [`cluster_bundle_kustomization_spec_path_uses_lifted_composer`])
        // navigate through. Guards the paired-site convergence that
        // just routed both fixture-navigation halves through the
        // accessor rather than the raw field: a future implementation
        // of [`Caixa::nome`] that returned a differently-bytewidth
        // projection (a cached `CaixaName` newtype's `Display` value,
        // an operator-side normalized ASCII-lowered projection) would
        // silently split the composer's fixture-navigation input from
        // the storage-side field the [`crate::cluster_bundle`]
        // production emit path still reads from at the peer
        // `format!(…, name = &caixa.nome, …)` production site (which
        // itself already reaches through [`Caixa::nome`]'s accessor
        // — see caixa-flux/src/lib.rs:2135) — this pin surfaces the
        // drift at build-time rather than at a downstream
        // `kubectl get kustomization` audit on the fleet.
        //
        // Same byte-parity-pin discipline the sibling caixa-crd
        // `round_trip_preserves_core_fields` test-side accessor
        // convergence (1a160cd) added to lock its own per-`Caixa`
        // scalar-accessor family against the raw field-access at the
        // paired serde round-trip fixture — extended here onto the
        // caixa-flux `sample_caixa()` fixture's per-`:nome`
        // scalar-accessor axis.
        let fixture = sample_caixa();
        assert_eq!(
            fixture.nome(),
            fixture.nome.as_str(),
            "Caixa::nome() must borrow the same bytes as the raw \
             `nome: String` field storage; any implementation drift \
             here silently splits every caixa-flux composer-fixture \
             navigation site that routes through the accessor from \
             the storage-side field the peer production emit path \
             still reads verbatim"
        );
    }

    #[test]
    fn cluster_bundle_kustomization_timeout_pins_lifted_default() {
        // Fail-before-pass-after pin: the rendered `kustomization.yaml`
        // document's `spec.timeout` per-CR reconcile wall-clock cap
        // leaf-scalar-key must resolve to the canonical
        // [`DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] scalar-value verbatim
        // under the lifted [`FLUX_KUSTOMIZATION_KEY_TIMEOUT`] leaf-key.
        // Before the lift the axis carried an inline `timeout: 5m` leaf-
        // scalar literal at the sole production-code call site (the
        // top-level `spec` position of the [`cluster_bundle`]
        // `kustomization.yaml` format-string template, sibling to the
        // co-resident per-`Kustomization`-CR source-sub-tree pointer
        // the peer [`cluster_bundle_kustomization_path_pins_lifted_sub_tree`]
        // pin covers). A future substrate-side rebrand on either half
        // of the canonical `(FLUX_KUSTOMIZATION_KEY_TIMEOUT,
        // DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT)` pair that failed to
        // reach this emit site would silently strip the substrate's
        // chosen reconcile-ceiling declaration from every emitted per-
        // caixa `Kustomization` document — the Flux v2 kustomize-
        // controller would then fall back to the upstream Flux v2
        // controller-side default cap (which the upstream project
        // ships tuned for the average upstream Flux-managed manifest
        // set, not the substrate's per-caixa idempotency-checkpoint
        // cadence the peer
        // [`FLUX_HELMRELEASE_REMEDIATION_RETRIES_DEFAULT`] retry-
        // ceiling and [`DEFAULT_FLUX_RECONCILE_INTERVAL`] reconcile-
        // poll cadence are jointly tuned against), letting a
        // persistently-failing per-caixa manifest apply consume
        // kustomize-controller reconcile-loop cycles past the
        // substrate's chosen ceiling with no field naming the timeout-
        // drift root cause. Pin the identity here so a regression that
        // re-introduces an inline literal at the emit site — or a
        // rebrand on either canonical const that fails to reach the
        // emit site — surfaces at build time on this test's failure.
        // Peer to the sibling
        // [`cluster_bundle_kustomization_path_pins_lifted_sub_tree`]
        // and [`cluster_bundle_kustomization_prune_pins_lifted_true`]
        // pins on the co-resident per-`Kustomization`-CR spec surface
        // axes — extends the per-`Kustomization`-CR-spec leaf-scalar-
        // key/scalar-value discipline from the co-resident source-
        // sub-tree pointer and garbage-collection-toggle onto the co-
        // resident reconcile wall-clock cap at the mirror-symmetric
        // top-level `spec.timeout` position.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let ks = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&ks.contents).expect("kustomization.yaml parses as YAML");
        let timeout = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KUSTOMIZATION_KEY_TIMEOUT))
            .and_then(|v| v.as_str())
            .expect(
                "spec.timeout string scalar present; drift on this axis \
                 silently strips the substrate's chosen reconcile-ceiling \
                 declaration from every emitted per-caixa `Kustomization` \
                 document, letting the kustomize-controller fall back to \
                 the upstream Flux v2 controller-side default cap",
            );
        assert_eq!(
            timeout, DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT,
            "spec.timeout must carry the substrate's canonical Flux v2 \
             per-`Kustomization`-CR reconcile wall-clock cap seed — drift \
             silently strips the substrate's chosen reconcile-ceiling \
             declaration from every emitted per-caixa `Kustomization` \
             document"
        );
    }

    #[test]
    fn flux_kustomization_key_timeout_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_KUSTOMIZATION_KEY_TIMEOUT` was lifted
        // from the production-code inline `timeout` literal at the
        // sole `cluster_bundle` `kustomization.yaml` format-string
        // template's per-CR reconcile wall-clock cap leaf-scalar-key
        // emit site + the test-fixture navigation site the sibling
        // [`cluster_bundle_kustomization_timeout_pins_lifted_default`]
        // pin opens onto the rendered document, to a re-export of
        // [`caixa_core::FLUX_KUSTOMIZATION_KEY_TIMEOUT`] so the
        // canonical Flux v2 per-CR reconcile wall-clock cap leaf-
        // scalar-key lives in exactly one place across every caixa
        // renderer. Pin the equality + static-data identity here so
        // any local re-introduction of a sibling
        // `pub const FLUX_KUSTOMIZATION_KEY_TIMEOUT: &str = "…"` at
        // this crate (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry the same string at
        // the source while pointing at a different `&'static`
        // allocation) is a build-time test failure naming the
        // offending drift. Peer to
        // [`flux_kustomization_key_path_re_export_points_at_caixa_core_canonical`]
        // and
        // [`flux_kustomization_key_prune_re_export_points_at_caixa_core_canonical`]
        // on the sibling co-resident per-`Kustomization`-CR spec
        // surface re-export axes.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KUSTOMIZATION_KEY_TIMEOUT",
            FLUX_KUSTOMIZATION_KEY_TIMEOUT,
            caixa_core::FLUX_KUSTOMIZATION_KEY_TIMEOUT,
        );
    }

    #[test]
    fn default_flux_kustomization_timeout_re_export_points_at_caixa_core_canonical() {
        // The renderer's `DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT` was
        // lifted from the production-code inline `5m` scalar-value
        // literal at the sole `cluster_bundle` `kustomization.yaml`
        // format-string template's per-CR reconcile wall-clock cap
        // emit site, to a re-export of
        // [`caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT`] so the
        // canonical Flux v2 per-CR reconcile wall-clock cap default
        // scalar-value lives in exactly one place across every caixa
        // renderer. Pin the equality + static-data identity here so
        // any local re-introduction of a sibling
        // `pub const DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT: &str = "…"`
        // at this crate (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry the same string at
        // the source while pointing at a different `&'static`
        // allocation) is a build-time test failure naming the
        // offending drift. Peer to
        // [`default_flux_reconcile_interval_re_export_points_at_caixa_core_canonical`]
        // on the sibling canonical-Flux-v2-per-CR-substrate-default-
        // scalar re-export axis.
        caixa_core::assert_str_reexport_identity(
            "DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT",
            DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT,
            caixa_core::DEFAULT_FLUX_KUSTOMIZATION_TIMEOUT,
        );
    }

    #[test]
    fn kube_key_spec_re_export_points_at_caixa_core_canonical() {
        // The renderer's `KUBE_KEY_SPEC` was lifted from the
        // production-code inline `"spec"` literals at the two K8s-CR
        // top-level-spec-axis call sites (`programs_yaml_entry`'s
        // `computeunit_yaml.get("spec")` ComputeUnit-side spec read +
        // its matching `Error::MissingField("spec")` diagnostic;
        // `upsert_into_helmrelease_programs`'s `root.get_mut("spec")`
        // HelmRelease-side spec mutate + its matching
        // `Error::MissingField("spec")` diagnostic) to a re-export of
        // [`caixa_core::KUBE_KEY_SPEC`] so the canonical K8s-CR
        // top-level spec-axis string lives in exactly one place across
        // every caixa renderer. Pin the equality + static-data
        // identity here so any local re-introduction of a sibling
        // `pub const KUBE_KEY_SPEC: &str = "…"` (the canonical drift
        // footgun where a sibling local `pub const` could happen to
        // carry the same string at the source while pointing at a
        // different `&'static` allocation) is a build-time test
        // failure naming the offending drift. Peer to
        // [`default_namespace_re_export_points_at_caixa_core_canonical`]
        // on the sibling re-export axis +
        // `caixa_mesh::tests::kube_key_spec_re_export_points_at_caixa_core_canonical`
        // on the sibling renderer crate.
        caixa_core::assert_str_reexport_identity(
            "KUBE_KEY_SPEC",
            KUBE_KEY_SPEC,
            caixa_core::KUBE_KEY_SPEC,
        );
    }

    #[test]
    fn kube_key_metadata_re_export_points_at_caixa_core_canonical() {
        // The renderer's `KUBE_KEY_METADATA` was lifted from the
        // production-code inline `"metadata"` literal at
        // `programs_yaml_entry`'s `computeunit_yaml.get("metadata")`
        // ComputeUnit-side metadata read + the drift-detection pin at
        // `cluster_bundle_kustomization_carries_flux_system_namespace_axes`'s
        // `parsed.get("metadata")` rendered-kustomization traversal, to a
        // re-export of [`caixa_core::KUBE_KEY_METADATA`] so the canonical
        // K8s-CR top-level metadata-axis string lives in exactly one
        // place across every caixa renderer. Pin the equality +
        // static-data identity here so any local re-introduction of a
        // sibling `pub const KUBE_KEY_METADATA: &str = "…"` (the
        // canonical drift footgun where a sibling local `pub const`
        // could happen to carry the same string at the source while
        // pointing at a different `&'static` allocation) is a build-time
        // test failure naming the offending drift. Peer to
        // [`kube_key_spec_re_export_points_at_caixa_core_canonical`] on
        // the sibling K8s-CR top-level-spec-axis re-export +
        // `caixa_mesh::tests::kube_key_metadata_re_export_points_at_caixa_core_canonical`
        // on the sibling renderer crate.
        caixa_core::assert_str_reexport_identity(
            "KUBE_KEY_METADATA",
            KUBE_KEY_METADATA,
            caixa_core::KUBE_KEY_METADATA,
        );
    }

    #[test]
    fn kube_key_kind_re_export_points_at_caixa_core_canonical() {
        // The renderer's `KUBE_KEY_KIND` was lifted from eleven inline
        // `"kind"` literals at the test-side K8s-CR top-level-kind-axis
        // retrieval calls that navigate the rendered `cluster_bundle`
        // multi-file sequence to isolate each per-`(GitRepository,
        // HelmRelease, Kustomization)` document's top-level-kind
        // discriminator plus its nested `spec.chart.spec.sourceRef.kind`
        // (helmrelease) / `spec.sourceRef.kind` (kustomization) /
        // `spec.healthChecks[].kind` (kustomization) drift-detection
        // pins, to a re-export of [`caixa_core::KUBE_KEY_KIND`] so the
        // canonical K8s-CR top-level kind-discriminator axis string
        // lives in exactly one place across every caixa renderer. Pin
        // the equality + static-data identity here so any local
        // re-introduction of a sibling `pub const KUBE_KEY_KIND: &str
        // = "…"` (the canonical drift footgun where a sibling local
        // `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation)
        // is a build-time test failure naming the offending drift, not
        // a silent apply-time symptom — the prior shape would have let
        // a typo on any one sibling `pub const` declaration silently
        // miss the per-CR kind retrieval so the drift-detection
        // `.get(KUBE_KEY_KIND).and_then(|n| n.as_str()) == Some(…)`
        // predicate the sibling `FLUX_KIND_*` re-export pins rest on
        // would compare against `None` under the trailing
        // `.expect("… present")` panic and mask the true sibling
        // `FLUX_KIND_*` axis drift. Peer to
        // [`kube_key_spec_re_export_points_at_caixa_core_canonical`] +
        // [`kube_key_metadata_re_export_points_at_caixa_core_canonical`]
        // on the sibling K8s-CR top-level-spec / top-level-metadata
        // axis re-exports + `caixa_mesh::tests::kube_key_kind_re_export_points_at_caixa_core_canonical`
        // (615a13d) on the sibling renderer crate — completes the
        // per-K8s-CR top-level `(spec, metadata, kind)` axis re-export
        // triple every rendered Flux bundle document navigates.
        caixa_core::assert_str_reexport_identity(
            "KUBE_KEY_KIND",
            KUBE_KEY_KIND,
            caixa_core::KUBE_KEY_KIND,
        );
    }

    #[test]
    fn kube_key_api_version_re_export_points_at_caixa_core_canonical() {
        // The renderer's `KUBE_KEY_API_VERSION` was lifted from four
        // inline `"apiVersion"` literals at the test-side K8s-CR
        // top-level-apiVersion-axis retrieval calls that navigate the
        // rendered `cluster_bundle` multi-file sequence to isolate each
        // per-`(GitRepository, HelmRelease, Kustomization)` document's
        // top-level-apiVersion axis plus the `kustomization.yaml`'s
        // nested `spec.healthChecks[].apiVersion` drift-detection pin,
        // to a re-export of [`caixa_core::KUBE_KEY_API_VERSION`] so the
        // canonical K8s-CR top-level apiVersion-axis string lives in
        // exactly one place across every caixa renderer. Pin the
        // equality + static-data identity here so any local
        // re-introduction of a sibling `pub const KUBE_KEY_API_VERSION:
        // &str = "…"` (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry the same string at
        // the source while pointing at a different `&'static`
        // allocation) is a build-time test failure naming the offending
        // drift, not a silent apply-time symptom — the prior shape
        // would have let a typo on any one sibling `pub const`
        // declaration silently miss the per-CR apiVersion retrieval so
        // the drift-detection `.get(KUBE_KEY_API_VERSION).and_then(|n|
        // n.as_str()) == Some(…)` predicate the sibling
        // `FLUX_*_API_VERSION` re-export pins rest on would compare
        // against `None` under the trailing `.expect("… present")`
        // panic and mask the true sibling `FLUX_*_API_VERSION` axis
        // drift. Peer to
        // [`kube_key_spec_re_export_points_at_caixa_core_canonical`] +
        // [`kube_key_metadata_re_export_points_at_caixa_core_canonical`]
        // + [`kube_key_kind_re_export_points_at_caixa_core_canonical`]
        // on the sibling K8s-CR top-level-spec / top-level-metadata /
        // top-level-kind axis re-exports — completes the per-K8s-CR
        // top-level `(apiVersion, kind, metadata, spec)` axis
        // re-export quartet every rendered Flux v2 bundle document
        // navigates.
        caixa_core::assert_str_reexport_identity(
            "KUBE_KEY_API_VERSION",
            KUBE_KEY_API_VERSION,
            caixa_core::KUBE_KEY_API_VERSION,
        );
    }

    #[test]
    fn kube_key_namespace_re_export_points_at_caixa_core_canonical() {
        // The renderer's `KUBE_KEY_NAMESPACE` was lifted from five inline
        // `"namespace"` literals — the two production-code call sites in
        // `programs_yaml_entry` (the ComputeUnit YAML's
        // `metadata.namespace` retrieval that feeds the emitted
        // `programs:[]` entry's isomorphic `namespace:` field, and the
        // write-side entry-key emission the `lareira-fleet-programs`
        // schema keys the per-Servico namespace off) plus the three
        // test-side drift-detection call sites (the two
        // `programs_yaml_entry` round-trip pins asserting the emitted
        // entry's `namespace:` field spells `tatara-system` on the
        // metadata-carried path and [`DEFAULT_NAMESPACE`] on the
        // fallback path, and the `cluster_bundle_kustomization_carries_\
        // flux_system_namespace_axes` pin asserting the rendered
        // `kustomization.yaml` document's `metadata.namespace` axis
        // binds to the lifted [`DEFAULT_FLUX_SYSTEM_NAMESPACE`]) — to
        // a re-export of [`caixa_core::KUBE_KEY_NAMESPACE`] so the
        // canonical K8s-CR `metadata.namespace` axis string lives in
        // exactly one place across every caixa renderer. Pin the
        // equality + static-data identity here so any local
        // re-introduction of a sibling `pub const KUBE_KEY_NAMESPACE:
        // &str = "…"` (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry the same string at
        // the source while pointing at a different `&'static`
        // allocation) is a build-time test failure naming the
        // offending drift, not a silent apply-time symptom — the prior
        // shape would have let a typo on any one sibling `pub const`
        // declaration silently miss the ComputeUnit's
        // `metadata.namespace` lookup and fall back to
        // [`DEFAULT_NAMESPACE`] even when the ComputeUnit YAML pinned
        // a distinct target namespace, or mask the sibling
        // [`DEFAULT_FLUX_SYSTEM_NAMESPACE`] drift the
        // `kustomization.yaml`-side pin was meant to catch under the
        // `.expect("kustomization.yaml present")` panic on the missing
        // `.and_then` chain. Peer to
        // [`kube_key_spec_re_export_points_at_caixa_core_canonical`] /
        // [`kube_key_metadata_re_export_points_at_caixa_core_canonical`]
        // / [`kube_key_kind_re_export_points_at_caixa_core_canonical`]
        // / [`kube_key_api_version_re_export_points_at_caixa_core_canonical`]
        // on the sibling K8s-CR top-level `(spec, metadata, kind,
        // apiVersion)` axis re-exports — extends the discipline the
        // top-level quartet establishes onto the canonical
        // `metadata.namespace` nested axis every rendered Flux v2
        // bundle document navigates.
        caixa_core::assert_str_reexport_identity(
            "KUBE_KEY_NAMESPACE",
            KUBE_KEY_NAMESPACE,
            caixa_core::KUBE_KEY_NAMESPACE,
        );
    }

    #[test]
    fn fleet_programs_key_programs_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLEET_PROGRAMS_KEY_PROGRAMS` was lifted from
        // the two inline `"programs"` production-code call sites
        // (`upsert_into_helmrelease_programs` at
        // `values_map.entry(Value::String("programs".into()))` on the
        // aggregator-HelmRelease shape, `upsert_into_programs_yaml` at
        // `let programs_key = Value::String("programs".into())` on the
        // bare-values.yaml shape) — the two writer-side upsert paths
        // that walk `HelmRelease.spec.values.programs[]` /
        // top-level `programs[]` to match-by-name-and-replace-or-append.
        // Both now navigate through the same `&'static str` as every
        // peer consumer, re-exported to a re-export of
        // [`caixa_core::FLEET_PROGRAMS_KEY_PROGRAMS`] so the canonical
        // `lareira-fleet-programs` values-schema array key lives in
        // exactly one place across every caixa renderer + consumer.
        // Pin the equality + static-data identity here so any local
        // re-introduction of a sibling `pub const FLEET_PROGRAMS_KEY_PROGRAMS:
        // &str = "…"` (the canonical drift footgun where a sibling
        // local `pub const` could happen to carry the same string at
        // the source while pointing at a different `&'static`
        // allocation) is a build-time test failure naming the offending
        // drift, not a silent apply-time symptom — the prior shape
        // would have let a typo on any one sibling `pub const`
        // declaration silently emit an entry under one key while the
        // peer-side upsert probed a different key, and the aggregator's
        // `range .Values.programs` would then iterate an empty sequence
        // (every `ComputeUnit` CR silently vanishing from the cluster's
        // fleet). Peer to
        // [`kube_key_namespace_re_export_points_at_caixa_core_canonical`]
        // /
        // [`kube_key_spec_re_export_points_at_caixa_core_canonical`] /
        // [`kube_key_metadata_re_export_points_at_caixa_core_canonical`]
        // /
        // [`kube_key_kind_re_export_points_at_caixa_core_canonical`] /
        // [`kube_key_api_version_re_export_points_at_caixa_core_canonical`]
        // on the sibling K8s-CR top-level axis re-exports — extends
        // the discipline the K8s-CR key re-export quintet establishes
        // onto the canonical fleet-programs schema top-level axis
        // (`programs:`) every rendered aggregator-HelmRelease /
        // bare-values.yaml document navigates.
        caixa_core::assert_str_reexport_identity(
            "FLEET_PROGRAMS_KEY_PROGRAMS",
            FLEET_PROGRAMS_KEY_PROGRAMS,
            caixa_core::FLEET_PROGRAMS_KEY_PROGRAMS,
        );
    }

    #[test]
    fn fleet_programs_key_name_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLEET_PROGRAMS_KEY_NAME` was lifted from the
        // three inline `"name"` production-code call sites in
        // [`programs_yaml_entry`] (emit-side per-Servico entry.insert
        // seeded from `caixa.nome`), [`upsert_into_helmrelease_programs`]
        // (writer-side `new_entry.get("name")` / `slot.get("name")` +
        // `Error::MissingField("name")` triplet on the aggregator-
        // HelmRelease shape), and [`upsert_into_programs_yaml`] (writer-
        // side peer triplet on the bare-values.yaml shape) — every
        // fleet-programs per-entry name-axis read + write + missing-
        // field diagnostic across the two writer-side upsert paths and
        // the one emit-side entry builder now navigates through the
        // same `&'static str` re-exported to a re-export of
        // [`caixa_core::FLEET_PROGRAMS_KEY_NAME`] so the canonical
        // `lareira-fleet-programs` values-schema per-entry name-
        // discriminator key lives in exactly one place across every
        // caixa renderer + consumer. Pin the equality + static-data
        // identity here so any local re-introduction of a sibling
        // `pub const FLEET_PROGRAMS_KEY_NAME: &str = "…"` (the canonical
        // drift footgun where a sibling local `pub const` could happen
        // to carry the same string at the source while pointing at a
        // different `&'static` allocation) is a build-time test failure
        // naming the offending drift, not a silent apply-time symptom —
        // the prior shape would have let a typo on any one sibling
        // `pub const` declaration silently emit an entry under one key
        // while the peer-side upsert probed a different key, and the
        // aggregator's `range .Values.programs` would then iterate
        // entries whose per-entry name-axis the library chart's
        // `metadata.name` templating reads as empty (or match against
        // the wrong entry on upsert), collapsing every rendered
        // `ComputeUnit` CR at the aggregator's name-keyed reduce step.
        // Peer to
        // [`fleet_programs_key_programs_re_export_points_at_caixa_core_canonical`]
        // on the sibling fleet-programs top-level array-key re-export
        // + [`kube_key_namespace_re_export_points_at_caixa_core_canonical`]
        // / [`kube_key_spec_re_export_points_at_caixa_core_canonical`]
        // on the peer K8s-CR canonical-key re-export surfaces —
        // extends the discipline the K8s-CR key re-export quintet +
        // the sibling fleet-programs top-level array-key re-export
        // establish onto the canonical fleet-programs schema per-entry
        // name-discriminator axis.
        caixa_core::assert_str_reexport_identity(
            "FLEET_PROGRAMS_KEY_NAME",
            FLEET_PROGRAMS_KEY_NAME,
            caixa_core::FLEET_PROGRAMS_KEY_NAME,
        );
    }

    #[test]
    fn computeunit_spec_key_module_re_export_points_at_caixa_core_canonical() {
        // The renderer's `COMPUTEUNIT_SPEC_KEY_MODULE` was lifted from
        // the four inline `"module"` test-side call sites in this
        // crate (`programs_yaml_entry_round_trips`'s per-entry
        // `entry.get("module")` present-check + its per-
        // `module.source` nested navigator, plus
        // `upsert_helmrelease_replaces_existing` /
        // `upsert_into_programs_yaml`'s per-`module.source` cross-
        // upsert readback navigators) — every per-Servico ComputeUnit
        // CRD `spec.module` sub-block readback across the four
        // drift-detection navigators now navigates through the same
        // `&'static str` re-exported to a re-export of
        // [`caixa_core::COMPUTEUNIT_SPEC_KEY_MODULE`]. Pin the
        // equality + static-data identity here so any local re-
        // introduction of a sibling `pub const COMPUTEUNIT_SPEC_KEY_MODULE:
        // &str = "…"` is a build-time test failure naming the
        // offending drift, not a silent apply-time symptom. Peer to
        // [`fleet_programs_key_programs_re_export_points_at_caixa_core_canonical`]
        // /
        // [`kube_key_spec_re_export_points_at_caixa_core_canonical`]
        // on the sibling fleet-programs / K8s-CR-key re-export
        // surfaces — extends the discipline the K8s-CR / fleet-
        // programs key re-export families establish onto the
        // substrate-side ComputeUnit-CRD per-`spec.*` sub-block axis.
        caixa_core::assert_str_reexport_identity(
            "COMPUTEUNIT_SPEC_KEY_MODULE",
            COMPUTEUNIT_SPEC_KEY_MODULE,
            caixa_core::COMPUTEUNIT_SPEC_KEY_MODULE,
        );
    }

    #[test]
    fn computeunit_spec_key_trigger_re_export_points_at_caixa_core_canonical() {
        // Peer to
        // [`computeunit_spec_key_module_re_export_points_at_caixa_core_canonical`]
        // on the same ComputeUnit-CRD per-`spec.*` sub-block re-export
        // surface — pins the per-Servico invocation-shape sub-block
        // key's identity on the same trajectory.
        caixa_core::assert_str_reexport_identity(
            "COMPUTEUNIT_SPEC_KEY_TRIGGER",
            COMPUTEUNIT_SPEC_KEY_TRIGGER,
            caixa_core::COMPUTEUNIT_SPEC_KEY_TRIGGER,
        );
    }

    #[test]
    fn computeunit_spec_key_capabilities_re_export_points_at_caixa_core_canonical() {
        // Peer to
        // [`computeunit_spec_key_module_re_export_points_at_caixa_core_canonical`]
        // and
        // [`computeunit_spec_key_trigger_re_export_points_at_caixa_core_canonical`]
        // on the same ComputeUnit-CRD per-`spec.*` sub-block re-export
        // surface — completes the substrate-side ComputeUnit-CRD
        // per-`spec.*` sub-block re-export triple in this crate on the
        // WASI-capability-token-list axis.
        caixa_core::assert_str_reexport_identity(
            "COMPUTEUNIT_SPEC_KEY_CAPABILITIES",
            COMPUTEUNIT_SPEC_KEY_CAPABILITIES,
            caixa_core::COMPUTEUNIT_SPEC_KEY_CAPABILITIES,
        );
    }

    #[test]
    fn computeunit_module_key_source_re_export_points_at_caixa_core_canonical() {
        // The renderer's `COMPUTEUNIT_MODULE_KEY_SOURCE` was lifted
        // from the three inline `"source"` test-side call sites in
        // this crate — `programs_yaml_entry_round_trips`'s per-entry
        // `.get(COMPUTEUNIT_SPEC_KEY_MODULE).and_then(|m| m.get("source"))`
        // present-check + `upsert_replaces_existing_entry`'s per-
        // `arr[0].get(COMPUTEUNIT_SPEC_KEY_MODULE).get("source")`
        // cross-upsert readback + `upsert_helmrelease_inserts_under_spec_values_programs`'s
        // peer `HelmRelease`-wrapped `spec.values.programs[]` cross-
        // upsert readback. Every per-Servico ComputeUnit-CRD
        // `spec.module.source` leaf-scalar readback across the three
        // drift-detection navigators now navigates through the same
        // `&'static str` re-exported to a re-export of
        // [`caixa_core::COMPUTEUNIT_MODULE_KEY_SOURCE`]. Pin the
        // equality + static-data identity here so any local re-
        // introduction of a sibling `pub const COMPUTEUNIT_MODULE_KEY_SOURCE:
        // &str = "…"` is a build-time test failure naming the
        // offending drift, not a silent apply-time symptom. Peer to
        // [`computeunit_spec_key_module_re_export_points_at_caixa_core_canonical`]
        // on the same ComputeUnit-CRD family — extends the re-export-
        // identity gate one level deeper from the top-level `spec.*`
        // container-axis surface onto the nested `spec.module.*`
        // leaf-scalar-axis.
        caixa_core::assert_str_reexport_identity(
            "COMPUTEUNIT_MODULE_KEY_SOURCE",
            COMPUTEUNIT_MODULE_KEY_SOURCE,
            caixa_core::COMPUTEUNIT_MODULE_KEY_SOURCE,
        );
    }

    #[test]
    fn programs_yaml_entry_round_trips() {
        let entry = programs_yaml_entry(&sample_caixa(), &sample_cu_yaml()).unwrap();
        assert_eq!(
            entry.get(FLEET_PROGRAMS_KEY_NAME).and_then(|n| n.as_str()),
            Some("hello-rio")
        );
        assert_eq!(
            entry.get(KUBE_KEY_NAMESPACE).and_then(|n| n.as_str()),
            Some(DEFAULT_NAMESPACE)
        );
        assert!(entry.get(COMPUTEUNIT_SPEC_KEY_MODULE).is_some());
        assert!(entry.get(COMPUTEUNIT_SPEC_KEY_TRIGGER).is_some());
        assert!(entry.get(COMPUTEUNIT_SPEC_KEY_CAPABILITIES).is_some());
        assert!(
            entry
                .get(COMPUTEUNIT_SPEC_KEY_MODULE)
                .and_then(|m| m.get(COMPUTEUNIT_MODULE_KEY_SOURCE))
                .is_some(),
            "module.source must propagate verbatim"
        );
    }

    #[test]
    fn programs_yaml_entry_falls_back_to_default_namespace() {
        // A computeunit without metadata.namespace should default.
        let cu: serde_yaml::Value = serde_yaml::from_str(
            r#"
apiVersion: wasm.pleme.io/v1alpha1
kind: ComputeUnit
metadata:
  name: hello-rio
spec:
  module:
    source: oci://ghcr.io/pleme-io/hello-rio:v0.1.0
"#,
        )
        .unwrap();
        let entry = programs_yaml_entry(&sample_caixa(), &cu).unwrap();
        assert_eq!(
            entry.get(KUBE_KEY_NAMESPACE).and_then(|n| n.as_str()),
            Some(DEFAULT_NAMESPACE)
        );
    }

    #[test]
    fn programs_yaml_entry_refuses_non_servico() {
        let mut c = sample_caixa();
        c.kind = CaixaKind::Biblioteca;
        c.servicos = vec![];
        let err = programs_yaml_entry(&c, &sample_cu_yaml()).unwrap_err();
        assert!(matches!(err, Error::NotAServico(_)));
    }

    #[test]
    fn kind_mismatch_error_names_offending_caixa_nome() {
        // Pinning the lifted [`caixa_core::KindMismatch`] view's
        // load-bearing property: a kind-mismatched caixa surfaces a
        // diagnostic that *names the offending caixa* (`hello-rio`),
        // not just the rejected kind. Before the lift the renderer
        // raised `Error::NotAServico(CaixaKind::Biblioteca)` whose
        // Display said "caixa :kind must be Servico for caixa-flux
        // rendering, got Biblioteca" — the user had to grep their
        // source tree for which caixa.lisp triggered it. After the
        // lift the wrapped KindMismatch carries the `:nome`, the
        // renderer's `#[error("{0}")]` arm prints it through, and
        // the diagnostic is self-locating.
        let mut c = sample_caixa();
        c.kind = CaixaKind::Biblioteca;
        c.servicos = vec![];
        let err = programs_yaml_entry(&c, &sample_cu_yaml()).unwrap_err();
        let msg = format!("{err}");
        assert!(
            msg.contains("hello-rio"),
            "kind-mismatch diagnostic must name the offending caixa nome \
             (got: {msg:?})"
        );
        assert!(
            msg.contains("Servico"),
            "diagnostic must name the expected kind (got: {msg:?})"
        );
        assert!(
            msg.contains("Biblioteca"),
            "diagnostic must name the actual kind (got: {msg:?})"
        );
    }

    #[test]
    fn cluster_bundle_kind_mismatch_names_offending_caixa_nome() {
        // The second kind-checking call site in caixa-flux —
        // [`cluster_bundle`] — must surface the same lifted diagnostic
        // shape. Pinning so a future divergence between
        // `programs_yaml_entry` and `cluster_bundle` (e.g. one
        // re-inlines the kind check, the other uses `require_kind`)
        // surfaces here as a test failure rather than as a silent
        // diagnostic regression on the deploy path.
        let mut c = sample_caixa();
        c.kind = CaixaKind::Aplicacao;
        c.servicos = vec![];
        let opts = ClusterBundleOpts::for_caixa(&c, "rio");
        let err = cluster_bundle(&c, &opts).unwrap_err();
        let msg = format!("{err}");
        assert!(
            msg.contains("hello-rio"),
            "cluster_bundle's kind-mismatch must also name the caixa \
             nome (got: {msg:?})"
        );
        match err {
            Error::NotAServico(km) => {
                assert_eq!(km.nome, "hello-rio");
                assert_eq!(km.expected, CaixaKind::Servico);
                assert_eq!(km.actual, CaixaKind::Aplicacao);
            }
            other => panic!("expected Error::NotAServico, got {other:?}"),
        }
    }

    #[test]
    fn servico_count_mismatch_carries_typed_view_with_nome() {
        // Peer to the [`KindMismatch`]-lift pin above on the V0
        // `:servicos`-singularity axis: a Servico-kind caixa whose
        // `:servicos` list is non-singleton fails
        // [`programs_yaml_entry`] with the renderer's
        // `Error::UnsupportedServicoCount` variant wrapping the typed
        // [`caixa_core::ServicoCountMismatch`] view (carrying the
        // offending caixa's `:nome` + the actual count). Before the
        // lift the variant carried only `usize` — the user had to grep
        // their source tree for which `caixa.lisp` triggered it; after
        // the lift the wrapped typed view names the offending caixa
        // verbatim. Pins both the variant routing (via `#[from]`) and
        // the typed payload so a future refactor can't silently switch
        // back to the raw-`usize` payload (which would regress the
        // shared-shape contract with caixa-helm on the peer
        // `lareira-<nome>` chart-dir path).
        let mut c = sample_caixa();
        c.servicos = vec![
            "servicos/hello-rio.computeunit.yaml".into(),
            "servicos/extra.computeunit.yaml".into(),
        ];
        let err = programs_yaml_entry(&c, &sample_cu_yaml()).unwrap_err();
        match err {
            Error::UnsupportedServicoCount(scm) => {
                assert_eq!(scm.nome, "hello-rio");
                assert_eq!(scm.count, 2);
            }
            other => panic!("expected Error::UnsupportedServicoCount, got {other:?}"),
        }
    }

    #[test]
    fn servico_count_mismatch_diagnostic_names_offending_caixa_nome() {
        // The renderer's `#[error("{0}")] UnsupportedServicoCount(
        // #[from] ServicoCountMismatch)` arm prints the typed view's
        // Display through verbatim, so the offending caixa's `:nome`
        // appears in the rendered diagnostic on both the
        // `programs_yaml_entry` and `cluster_bundle` paths. Pinning the
        // self-locating property end-to-end so a future refactor that
        // re-wraps the variant in a Display impl that drops the
        // `:nome` surfaces here as a test failure rather than as
        // silent fragmentation across the two flux deploy paths. Peer
        // to `cluster_bundle_kind_mismatch_names_offending_caixa_nome`
        // on the sibling V0 Servico-shape axis.
        let mut c = sample_caixa();
        c.servicos = vec![];
        let err = programs_yaml_entry(&c, &sample_cu_yaml()).unwrap_err();
        let msg = format!("{err}");
        assert!(
            msg.contains("hello-rio"),
            ":servicos-count-mismatch diagnostic must name the offending caixa nome \
             (got: {msg:?})"
        );
        assert!(
            msg.contains("0"),
            "diagnostic must name the actual count (got: {msg:?})"
        );
        assert!(
            msg.contains(":servicos"),
            "diagnostic must name the offending field axis (got: {msg:?})"
        );
    }

    #[test]
    fn cluster_bundle_servico_count_mismatch_carries_typed_view_with_nome() {
        // Peer to `cluster_bundle_kind_mismatch_names_offending_caixa_nome`
        // on the sibling V0 `:servicos`-singularity axis. The second
        // per-Servico renderer entry-point in caixa-flux —
        // [`cluster_bundle`] — must surface the same lifted
        // [`caixa_core::ServicoCountMismatch`] view the peer
        // [`programs_yaml_entry`] path already pins on the sibling V0
        // gate axis. Until this gate landed `cluster_bundle` ran only
        // the [`require_kind`] half of the V0-shape gate pair, so a
        // Servico-kind caixa whose `:servicos` list is non-singleton
        // silently passed the bundle render and the failure surfaced at
        // the chart-render layer (`caixa-helm` refused the same input
        // with `UnsupportedServicoCount`) far from the deploy-path
        // entry-point — the canonical "the V0 invariant is enforced at
        // every per-Servico renderer entry except this one" footgun.
        // Pins both the variant routing (via `#[from]`) and the typed
        // payload so a future refactor that re-inlines a raw count
        // check, or strips the `require_single_servico` call from this
        // path, surfaces here as a test failure rather than as silent
        // fragmentation across the two flux deploy paths.
        let mut c = sample_caixa();
        c.servicos = vec![
            "servicos/hello-rio.computeunit.yaml".into(),
            "servicos/extra.computeunit.yaml".into(),
        ];
        let opts = ClusterBundleOpts::for_caixa(&c, "rio");
        let err = cluster_bundle(&c, &opts).unwrap_err();
        match err {
            Error::UnsupportedServicoCount(scm) => {
                assert_eq!(scm.nome, "hello-rio");
                assert_eq!(scm.count, 2);
            }
            other => panic!("expected Error::UnsupportedServicoCount, got {other:?}"),
        }
    }

    #[test]
    fn cluster_bundle_servico_count_mismatch_diagnostic_names_offending_caixa_nome() {
        // End-to-end Display pin on the [`cluster_bundle`] path —
        // peer of `servico_count_mismatch_diagnostic_names_offending_caixa_nome`
        // on the sibling [`programs_yaml_entry`] path. The rendered
        // diagnostic must name the offending caixa's `:nome`, the
        // actual count, and the `:servicos` field axis verbatim on
        // both per-Servico renderer entry-points in caixa-flux. Peer
        // to `cluster_bundle_kind_mismatch_names_offending_caixa_nome`
        // on the sibling V0 kind-shape axis — both V0 gate arms now
        // pin their self-locating diagnostic shape end-to-end through
        // the bundle path.
        let mut c = sample_caixa();
        c.servicos = vec![];
        let opts = ClusterBundleOpts::for_caixa(&c, "rio");
        let err = cluster_bundle(&c, &opts).unwrap_err();
        let msg = format!("{err}");
        assert!(
            msg.contains("hello-rio"),
            "cluster_bundle's :servicos-count-mismatch must name the offending caixa nome \
             (got: {msg:?})"
        );
        assert!(
            msg.contains("0"),
            "diagnostic must name the actual count (got: {msg:?})"
        );
        assert!(
            msg.contains(":servicos"),
            "diagnostic must name the offending field axis (got: {msg:?})"
        );
    }

    #[test]
    fn upsert_inserts_new_entry() {
        let initial: serde_yaml::Value = serde_yaml::from_str(
            r#"
enabled: true
defaultNamespace: tatara-system
programs: []
"#,
        )
        .unwrap();
        let entry = programs_yaml_entry(&sample_caixa(), &sample_cu_yaml()).unwrap();
        let (modified, inserted) = upsert_into_programs_yaml(initial, entry).unwrap();
        assert!(inserted, "first time should be insert");
        let arr = modified
            .get(FLEET_PROGRAMS_KEY_PROGRAMS)
            .unwrap()
            .as_sequence()
            .unwrap();
        assert_eq!(arr.len(), 1);
        assert_eq!(
            arr[0].get(FLEET_PROGRAMS_KEY_NAME).and_then(|n| n.as_str()),
            Some("hello-rio")
        );
    }

    #[test]
    fn upsert_replaces_existing_entry() {
        let initial: serde_yaml::Value = serde_yaml::from_str(
            r#"
enabled: true
defaultNamespace: tatara-system
programs:
  - name: hello-rio
    namespace: tatara-system
    module:
      source: oci://ghcr.io/pleme-io/hello-rio:v0.0.1
  - name: other
    namespace: tatara-system
    module: { source: github:foo/bar }
"#,
        )
        .unwrap();
        let entry = programs_yaml_entry(&sample_caixa(), &sample_cu_yaml()).unwrap();
        let (modified, inserted) = upsert_into_programs_yaml(initial, entry).unwrap();
        assert!(!inserted, "second time should be replace");
        let arr = modified
            .get(FLEET_PROGRAMS_KEY_PROGRAMS)
            .unwrap()
            .as_sequence()
            .unwrap();
        assert_eq!(arr.len(), 2, "no new entry added");
        let updated_module = arr[0]
            .get(COMPUTEUNIT_SPEC_KEY_MODULE)
            .unwrap()
            .get(COMPUTEUNIT_MODULE_KEY_SOURCE)
            .and_then(|s| s.as_str());
        assert_eq!(
            updated_module,
            Some("oci://ghcr.io/pleme-io/hello-rio:v0.1.0")
        );
    }

    #[test]
    fn upsert_helmrelease_inserts_under_spec_values_programs() {
        let initial: serde_yaml::Value = serde_yaml::from_str(
            r#"
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: rio-fleet-programs
  namespace: tatara-system
spec:
  interval: 30m
  chart:
    spec:
      chart: lareira-fleet-programs
  values:
    enabled: true
    defaultNamespace: tatara-system
    programs:
      - name: existing
        module: { source: github:foo/bar }
"#,
        )
        .unwrap();
        let entry = programs_yaml_entry(&sample_caixa(), &sample_cu_yaml()).unwrap();
        let (modified, inserted) = upsert_into_helmrelease_programs(initial, entry).unwrap();
        assert!(inserted);
        let arr = modified
            .get(KUBE_KEY_SPEC)
            .unwrap()
            .get(FLUX_KEY_VALUES)
            .unwrap()
            .get(FLEET_PROGRAMS_KEY_PROGRAMS)
            .unwrap()
            .as_sequence()
            .unwrap();
        assert_eq!(arr.len(), 2);
        assert_eq!(
            arr[1].get(FLEET_PROGRAMS_KEY_NAME).and_then(|n| n.as_str()),
            Some("hello-rio")
        );
    }

    #[test]
    fn upsert_helmrelease_replaces_existing() {
        let initial: serde_yaml::Value = serde_yaml::from_str(
            r#"
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata: { name: rio-fleet-programs }
spec:
  values:
    programs:
      - name: hello-rio
        module: { source: oci://ghcr.io/pleme-io/hello-rio:v0.0.1 }
      - name: other
        module: { source: github:foo/bar }
"#,
        )
        .unwrap();
        let entry = programs_yaml_entry(&sample_caixa(), &sample_cu_yaml()).unwrap();
        let (modified, inserted) = upsert_into_helmrelease_programs(initial, entry).unwrap();
        assert!(!inserted);
        let arr = modified
            .get(KUBE_KEY_SPEC)
            .unwrap()
            .get(FLUX_KEY_VALUES)
            .unwrap()
            .get(FLEET_PROGRAMS_KEY_PROGRAMS)
            .unwrap()
            .as_sequence()
            .unwrap();
        assert_eq!(arr.len(), 2);
        let updated = arr[0]
            .get(COMPUTEUNIT_SPEC_KEY_MODULE)
            .unwrap()
            .get(COMPUTEUNIT_MODULE_KEY_SOURCE)
            .and_then(|s| s.as_str());
        assert_eq!(updated, Some("oci://ghcr.io/pleme-io/hello-rio:v0.1.0"));
    }

    #[test]
    fn limits_slot_propagates_into_programs_yaml_entry() {
        use caixa_core::LimitsSpec;
        use std::time::Duration;
        let mut c = sample_caixa();
        c.limits = Some(LimitsSpec {
            memory: Some(64 * 1024 * 1024),
            fuel: Some(1_000_000),
            wall_clock: Some(Duration::from_secs(30)),
            cpu: Some(500),
        });
        let entry = programs_yaml_entry(&c, &sample_cu_yaml()).unwrap();
        let limits = entry.get(M2_KEY_LIMITS).expect("limits propagates");
        assert_eq!(
            limits.get(M2_LIMITS_KEY_MEMORY).and_then(|m| m.as_str()),
            Some("64MiB")
        );
        assert_eq!(
            limits.get(M2_LIMITS_KEY_CPU).and_then(|m| m.as_str()),
            Some("500m")
        );
    }

    #[test]
    fn behavior_slot_propagates_into_programs_yaml_entry() {
        use caixa_core::BehaviorSpec;
        use std::path::PathBuf;
        let mut c = sample_caixa();
        c.behavior = Some(BehaviorSpec {
            on_init: Some(PathBuf::from("lib/init.lisp")),
            on_state_change: Some(PathBuf::from("lib/migrations.lisp")),
            ..Default::default()
        });
        let entry = programs_yaml_entry(&c, &sample_cu_yaml()).unwrap();
        let behavior = entry.get(M2_KEY_BEHAVIOR).expect("behavior propagates");
        assert_eq!(
            behavior
                .get(M2_BEHAVIOR_KEY_ON_INIT)
                .and_then(|v| v.as_str()),
            Some("lib/init.lisp")
        );
    }

    #[test]
    fn upgrade_from_slot_propagates_into_programs_yaml_entry() {
        use caixa_core::{UpgradeFromEntry, UpgradeInstruction};
        let mut c = sample_caixa();
        c.upgrade_from = vec![UpgradeFromEntry {
            from: "0.0.9".into(),
            instructions: vec![UpgradeInstruction::SoftPurge {
                module: "hello-rio-old".into(),
            }],
        }];
        let entry = programs_yaml_entry(&c, &sample_cu_yaml()).unwrap();
        let upgrade_from = entry
            .get(M2_KEY_UPGRADE_FROM)
            .and_then(|u| u.as_sequence())
            .expect("upgradeFrom propagates as a sequence");
        assert_eq!(upgrade_from.len(), 1);
        assert_eq!(
            upgrade_from[0]
                .get(M2_UPGRADE_FROM_KEY_FROM)
                .and_then(|f| f.as_str()),
            Some("0.0.9")
        );
    }

    #[test]
    fn empty_m2_slots_do_not_appear_in_programs_yaml_entry() {
        // Forward-compat invariant: a Servico with no M2 slots emits a
        // programs.yaml entry that's structurally identical to V0
        // (no extra keys).
        let entry = programs_yaml_entry(&sample_caixa(), &sample_cu_yaml()).unwrap();
        assert!(entry.get(M2_KEY_LIMITS).is_none());
        assert!(entry.get(M2_KEY_BEHAVIOR).is_none());
        assert!(entry.get(M2_KEY_UPGRADE_FROM).is_none());
    }

    #[test]
    fn cluster_bundle_three_files() {
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        assert_eq!(files.len(), 3);
        let names: Vec<_> = files
            .iter()
            .map(|f| f.path.to_string_lossy().to_string())
            .collect();
        assert!(names.contains(&FLUX_GITREPOSITORY_YAML_FILENAME.to_string()));
        assert!(names.contains(&FLUX_HELMRELEASE_YAML_FILENAME.to_string()));
        assert!(names.contains(&FLUX_KUSTOMIZATION_YAML_FILENAME.to_string()));

        let kust = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .unwrap();
        assert!(kust.contents.contains("./clusters/rio/services/hello-rio"));

        let gitrepo = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .unwrap();
        assert!(gitrepo.contents.contains("v0.1.0"));
    }

    #[test]
    fn default_library_name_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::DEFAULT_LIBRARY_NAME` is
        // the single source of truth for the Helm library-chart wrap
        // key the `cluster_bundle` `helmrelease.yaml` template scopes
        // the per-cluster `enabled: true` override under. Pin the
        // equality (and the static-data identity, peer with the
        // sibling `default_namespace_re_export_points_at_caixa_core_canonical`
        // pin) so any local re-introduction of a sibling `pub const
        // DEFAULT_LIBRARY_NAME: &str = "…"` (the canonical drift
        // footgun this lift closes — two production-code consumers of
        // the same load-bearing Helm library-chart name across
        // caixa-helm + caixa-flux, lifted to one re-export at the
        // caixa-core boundary) is a build-time test failure naming
        // the offending drift, not a silent apply-time wrap-key
        // mismatch routing the per-cluster override nowhere. Peer to
        // `caixa_helm::tests::default_library_name_re_export_points_at_caixa_core_canonical`
        // on the sibling renderer crate.
        caixa_core::assert_str_reexport_identity(
            "DEFAULT_LIBRARY_NAME",
            DEFAULT_LIBRARY_NAME,
            caixa_core::DEFAULT_LIBRARY_NAME,
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_values_wrap_key_uses_lifted_constant() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`'s
        // `spec.values.<library>:` wrap key — the scope under which
        // per-cluster overrides like `enabled: true` reach the
        // dependent library chart at `helm template` / `helm install`
        // time — must spell out the lifted [`DEFAULT_LIBRARY_NAME`]
        // verbatim. Before the lift this site carried an inline
        // `pleme-computeunit:` literal in the format string; a future
        // per-edition library-chart rebrand (the substrate forking
        // `pleme-computeunit` to `<registry>-computeunit` for a per-
        // cluster image-registry mirror, or to `aplicacao-computeunit`
        // for the M4 typed-Aplicacao renderer's sibling library chart,
        // or any per-tenant variant the absorption-roadmap names) on
        // the sibling caixa-helm `RenderOpts::library_name` axis
        // without a coordinated edit here would have silently routed
        // the per-cluster override nowhere — the cluster's apply would
        // come up with the library chart's defaults, far from the
        // rebrand commit's source.
        //
        // The pin is structural: parse the rendered YAML and assert
        // the wrap key under `spec.values` equals the lifted constant.
        // A regression that re-introduces an inline literal surfaces
        // as a key mismatch (the inline literal would survive, but
        // the lifted-constant-keyed assertion would fail).
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let values = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_VALUES))
            .and_then(|v| v.as_mapping())
            .expect("spec.values mapping present");
        assert!(
            values.get(DEFAULT_LIBRARY_NAME).is_some(),
            "spec.values must wrap under the lifted DEFAULT_LIBRARY_NAME \
             ({DEFAULT_LIBRARY_NAME:?}); a drifted literal here silently \
             routes per-cluster overrides nowhere at helm template time"
        );
        // The wrapped block must carry the canonical `enabled: true`
        // overlay — the per-cluster override the bundle path threads
        // through. Pin the round-trip so a refactor that hoists the
        // overlay out of the wrap can't silently drop it.
        let wrapped = values
            .get(DEFAULT_LIBRARY_NAME)
            .and_then(|v| v.as_mapping())
            .expect("wrapped library mapping");
        assert_eq!(
            wrapped
                .get(HELM_VALUES_KEY_ENABLED)
                .and_then(|v| v.as_bool()),
            Some(CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT),
            "cluster_bundle helmrelease.yaml `spec.values.<library>.enabled` \
             overlay must resolve to the lifted \
             CLUSTER_BUNDLE_LAREIRA_ENABLED_DEFAULT — a drifted inline \
             literal here would silently disagree with the substrate-side \
             child-chart force-on-under-composition seed"
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_wrap_key_pins_canonical_pleme_computeunit_string() {
        // Bridge-arm pin: the lifted [`DEFAULT_LIBRARY_NAME`] constant
        // resolves to the canonical `"pleme-computeunit"` string today,
        // and the rendered `helmrelease.yaml`'s wrap key must spell
        // it out verbatim. Pin the literal here (peer with the
        // [`caixa_helm::tests::values_yaml_wraps_under_pleme_computeunit_key`]
        // canonical-default arm on the chart-render side) so a future
        // rebrand of the lifted constant surfaces here as a coordinated
        // edit-point — same trajectory as the
        // `default_servico_port_constant_pins_canonical_8080_literal`
        // bridge-arm pin in caixa-core.
        assert_eq!(DEFAULT_LIBRARY_NAME, "pleme-computeunit");
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .unwrap();
        assert!(
            hr.contents.contains("pleme-computeunit:"),
            "helmrelease.yaml must spell the canonical library-chart wrap \
             key under spec.values (got: {contents:?})",
            contents = hr.contents
        );
    }

    #[test]
    fn helm_values_key_enabled_re_export_points_at_caixa_core_canonical() {
        // The renderer's `HELM_VALUES_KEY_ENABLED` was lifted from the
        // production-code inline `enabled: true\n` fragment inside
        // [`cluster_bundle`]'s `helmrelease.yaml` format-string template
        // (formerly `caixa-flux/src/lib.rs:844`) plus its test-side
        // round-trip navigator
        // (`cluster_bundle_helmrelease_values_wrap_key_uses_lifted_constant`,
        // where `.get("enabled")`
        // isolated the per-cluster override the bundle path threads
        // through) to a re-export of
        // [`caixa_core::HELM_VALUES_KEY_ENABLED`] so the canonical
        // `pleme-computeunit` library-chart values-block enable-toggle
        // key lives in exactly one place across every caixa renderer.
        // Pin the equality + `&'static` static-data identity here so any
        // local re-introduction of a sibling
        // `pub const HELM_VALUES_KEY_ENABLED: &str = "…"` at this crate
        // — the canonical drift footgun where a sibling local
        // `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation —
        // is a build-time test failure naming the offending drift, not
        // a silent per-values enable-toggle reroute at `helm template` /
        // `helm install` time far from the drift site. Peer to
        // [`default_library_name_re_export_points_at_caixa_core_canonical`]
        // / [`kube_key_spec_re_export_points_at_caixa_core_canonical`] on
        // the sibling re-export axes +
        // `caixa_helm::tests::helm_values_key_enabled_re_export_points_at_caixa_core_canonical`
        // on the peer per-Servico-chart renderer crate.
        caixa_core::assert_str_reexport_identity(
            "HELM_VALUES_KEY_ENABLED",
            HELM_VALUES_KEY_ENABLED,
            caixa_core::HELM_VALUES_KEY_ENABLED,
        );
    }

    #[test]
    fn default_flux_system_namespace_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE`
        // is the single source of truth for the FluxCD installation
        // namespace both axes of the rendered `kustomization.yaml`
        // document (`metadata.namespace` and `spec.sourceRef.name`)
        // consume. Pin the equality (and the static-data identity, peer
        // with the sibling
        // `default_namespace_re_export_points_at_caixa_core_canonical` /
        // `default_library_name_re_export_points_at_caixa_core_canonical`
        // pins) so any local re-introduction of a sibling `pub const
        // DEFAULT_FLUX_SYSTEM_NAMESPACE: &str = "…"` (the canonical
        // drift footgun this lift closes — two production-code
        // consumers of the same load-bearing FluxCD-installation-
        // namespace inside the kustomization template, lifted to one
        // re-export at the caixa-core boundary) is a build-time test
        // failure naming the offending drift, not a silent apply-time
        // `Kustomization`-outside-controller-watch-window / dangling-
        // `sourceRef` reconciliation freeze.
        caixa_core::assert_str_reexport_identity(
            "DEFAULT_FLUX_SYSTEM_NAMESPACE",
            DEFAULT_FLUX_SYSTEM_NAMESPACE,
            caixa_core::DEFAULT_FLUX_SYSTEM_NAMESPACE,
        );
    }

    #[test]
    fn cluster_bundle_kustomization_uses_lifted_flux_system_namespace() {
        // Fail-before-pass-after pin: the rendered `kustomization.yaml`'s
        // `metadata.namespace` and `spec.sourceRef.name` axes — the two
        // physical sites the inline `flux-system` literal previously
        // sat at (caixa-flux/src/lib.rs:477, 483 in the prior shape) —
        // must both resolve to the lifted
        // [`DEFAULT_FLUX_SYSTEM_NAMESPACE`] verbatim. Before this lift
        // the kustomization template carried two inline `flux-system`
        // literals; a future per-cluster Flux installation rebrand on
        // either axis without a coordinated edit on the other would have
        // silently emitted a `Kustomization` outside the bootstrap
        // controller's watch window (the `kustomize-controller` watches
        // the installation namespace by default) or a dangling
        // `spec.sourceRef.name` pointing at a `GitRepository` that
        // doesn't exist in the rebranded namespace.
        //
        // The pin is structural: parse the rendered YAML and assert
        // each of the two axes equals the lifted constant by value. A
        // regression that re-introduces an inline literal at either
        // axis surfaces here as a key mismatch (the inline literal
        // would survive, but the lifted-constant-keyed assertion would
        // fail when the lift's value changes).
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kust = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kust.contents).expect("kustomization.yaml parses as YAML");
        assert_eq!(
            kube_metadata_str_field(&parsed, KUBE_KEY_NAMESPACE),
            Some(DEFAULT_FLUX_SYSTEM_NAMESPACE),
            "kustomization.yaml metadata.namespace must spell the lifted \
             DEFAULT_FLUX_SYSTEM_NAMESPACE ({DEFAULT_FLUX_SYSTEM_NAMESPACE:?}); \
             a drifted literal here silently places the Kustomization outside \
             the bootstrap kustomize-controller's watch window"
        );
        assert_eq!(
            parsed
                .get(KUBE_KEY_SPEC)
                .and_then(|s| s.get(FLUX_KEY_SOURCE_REF))
                .and_then(|r| r.get("name"))
                .and_then(|n| n.as_str()),
            Some(DEFAULT_FLUX_SYSTEM_NAMESPACE),
            "kustomization.yaml spec.sourceRef.name must spell the lifted \
             DEFAULT_FLUX_SYSTEM_NAMESPACE ({DEFAULT_FLUX_SYSTEM_NAMESPACE:?}); \
             a drifted literal here dangles the reference at a GitRepository \
             that doesn't exist in the rebranded installation namespace"
        );
    }

    #[test]
    fn cluster_bundle_kustomization_pins_canonical_flux_system_string() {
        // Bridge-arm pin: the lifted [`DEFAULT_FLUX_SYSTEM_NAMESPACE`]
        // constant resolves to the canonical `"flux-system"` string
        // today, and both rendered `kustomization.yaml` axes must spell
        // it out verbatim. Pin the literal here (peer with the
        // [`default_flux_system_namespace_pins_canonical_value`]
        // canonical-default arm in caixa-core, and with
        // [`cluster_bundle_helmrelease_wrap_key_pins_canonical_pleme_computeunit_string`]
        // on the sibling `DEFAULT_LIBRARY_NAME` axis) so a future
        // rebrand of the lifted constant surfaces here as a coordinated
        // edit-point, same trajectory as the
        // `default_servico_port_constant_pins_canonical_8080_literal`
        // bridge-arm pin in caixa-core.
        assert_eq!(DEFAULT_FLUX_SYSTEM_NAMESPACE, "flux-system");
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kust = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .unwrap();
        assert!(
            kust.contents.contains("namespace: flux-system\n"),
            "kustomization.yaml must spell the canonical FluxCD \
             installation namespace at metadata.namespace (got: {contents:?})",
            contents = kust.contents
        );
        assert!(
            kust.contents.contains("name: flux-system\n"),
            "kustomization.yaml must spell the canonical FluxCD \
             installation namespace at spec.sourceRef.name (got: {contents:?})",
            contents = kust.contents
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_uses_lifted_flux_api_version() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`
        // `apiVersion` axis — the load-bearing Flux v2 CRD-group/version
        // declaration the `helm-controller` watches — must resolve to the
        // lifted [`FLUX_HELMRELEASE_API_VERSION`] verbatim. Before this
        // lift the helmrelease template carried an inline
        // `helm.toolkit.fluxcd.io/v2` literal; a future upstream Flux v3
        // migration on this axis without a coordinated edit on the
        // sibling kustomization `healthChecks[].apiVersion` (the second
        // render-side occurrence the same lift threads through) would
        // have silently routed the rendered `HelmRelease` outside the
        // controller's `Watches` and broken at apply time with a non-
        // self-locating "no kind 'HelmRelease' is registered for version
        // 'helm.toolkit.fluxcd.io/v2beta2'" error. Peer with
        // [`cluster_bundle_kustomization_uses_lifted_flux_system_namespace`]
        // on the sibling [`DEFAULT_FLUX_SYSTEM_NAMESPACE`] lift.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        assert_eq!(
            kube_root_str_field(&parsed, KUBE_KEY_API_VERSION),
            Some(FLUX_HELMRELEASE_API_VERSION),
            "helmrelease.yaml apiVersion must spell the lifted \
             FLUX_HELMRELEASE_API_VERSION ({FLUX_HELMRELEASE_API_VERSION:?}); \
             a drifted literal here routes the HelmRelease outside the Flux v2 \
             helm-controller's Watches",
        );
    }

    #[test]
    fn cluster_bundle_kustomization_health_check_uses_lifted_flux_api_version() {
        // Sibling-axis pin to
        // `cluster_bundle_helmrelease_uses_lifted_flux_api_version`: the
        // rendered `kustomization.yaml`'s `spec.healthChecks[].apiVersion`
        // axis is the Flux v2 contract pairing the parent Kustomization's
        // per-resource health-gate to the sibling HelmRelease's CRD
        // group/version. Both axes must resolve to the same lifted
        // constant by value — a future upstream Flux v3 migration on
        // either axis without a coordinated edit on the other would
        // have silently dangled the health-check (apply-side: the per-
        // resource health-gate never resolves, the parent Kustomization
        // sits perpetually in `Reconciling`).
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kust = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kust.contents).expect("kustomization.yaml parses as YAML");
        let health_checks = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_HEALTH_CHECKS))
            .and_then(|h| h.as_sequence())
            .expect("kustomization.yaml spec.healthChecks present");
        assert!(
            !health_checks.is_empty(),
            "kustomization.yaml spec.healthChecks must carry at least one \
             entry — the rendered Kustomization gates on its sibling \
             HelmRelease's health by construction",
        );
        for (i, entry) in health_checks.iter().enumerate() {
            assert_eq!(
                kube_root_str_field(entry, KUBE_KEY_API_VERSION),
                Some(FLUX_HELMRELEASE_API_VERSION),
                "kustomization.yaml spec.healthChecks[{i}].apiVersion must \
                 spell the lifted FLUX_HELMRELEASE_API_VERSION \
                 ({FLUX_HELMRELEASE_API_VERSION:?}); a drifted literal here \
                 dangles the per-resource health-gate at apply time",
            );
        }
    }

    #[test]
    fn cluster_bundle_helmrelease_pins_canonical_flux_v2_api_version_string() {
        // Bridge-arm pin: the lifted [`FLUX_HELMRELEASE_API_VERSION`]
        // constant resolves to the canonical
        // `"helm.toolkit.fluxcd.io/v2"` string today, and both rendered
        // axes (helmrelease.yaml apiVersion + kustomization.yaml
        // healthChecks[].apiVersion) must spell it out verbatim. Pin the
        // literal here (peer with the
        // [`flux_helmrelease_api_version_pins_canonical_value`] canonical-
        // default arm in caixa-core, and with
        // [`cluster_bundle_kustomization_pins_canonical_flux_system_string`]
        // on the sibling `DEFAULT_FLUX_SYSTEM_NAMESPACE` axis) so a
        // future Flux v3 migration of the lifted constant surfaces here
        // as a coordinated edit-point.
        assert_eq!(FLUX_HELMRELEASE_API_VERSION, "helm.toolkit.fluxcd.io/v2");
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .unwrap();
        assert!(
            hr.contents
                .contains("apiVersion: helm.toolkit.fluxcd.io/v2\n"),
            "helmrelease.yaml must spell the canonical Flux v2 HelmRelease \
             apiVersion at the top-level apiVersion axis (got: {contents:?})",
            contents = hr.contents,
        );
        let kust = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .unwrap();
        assert!(
            kust.contents
                .contains("apiVersion: helm.toolkit.fluxcd.io/v2\n"),
            "kustomization.yaml must spell the canonical Flux v2 HelmRelease \
             apiVersion at spec.healthChecks[].apiVersion (got: {contents:?})",
            contents = kust.contents,
        );
    }

    #[test]
    fn cluster_bundle_default_git_tag_uses_lifted_caixa_core_prefix() {
        // Fail-before-pass-after pin: the [`ClusterBundleOpts::for_caixa`]
        // constructor's default `git_ref: GitRefSpec::Tag(...)` must
        // compose the lifted [`caixa_core::DEFAULT_PUBLISH_TAG_PREFIX`]
        // against the caixa's `:versao` — not an inline `"v"` byte the
        // peer `feira publish` `--prefix` default and this deploy-side
        // default could silently drift on.
        //
        // Until this lift landed the deploy-side carried a `format!("v{}",
        // caixa.versao)` literal while the writer-side (caixa-feira/src/cmd/publish.rs:22)
        // carried a clap `default_value = "v"` literal — two production-code
        // consumers of the same git-tag-naming convention on the same
        // git remote axis, drift-prone by construction. A future
        // Zig-style-tag rebrand on one side (e.g. moving the publisher to
        // `release/<versao>` once a sibling forge convention lands)
        // without a coordinated edit here would silently emit a tag the
        // FluxCD `GitRepository` reconciler can't resolve — the
        // dependent `HelmRelease`'s `chart: sourceRef` would never
        // converge and every per-Servico apply would silently come up
        // with the prior reconciled state, with the failure surfacing
        // far from the rebrand commit's source at
        // `kubectl describe gitrepository` time.
        //
        // Pin the equality on the constructed `GitRefSpec::Tag` body and
        // on the rendered `gitrepository.yaml`'s `ref: { tag: ... }`
        // field so a regression that re-inlines the `"v"` literal at
        // either layer (this constructor or the format-string in
        // [`cluster_bundle`]) surfaces here as a build-time test failure
        // rather than as a silent deploy-time `GitRepository` reconcile
        // loop. Peer to the sibling [`caixa-feira`]
        // `publish_prefix_default_pins_lifted_caixa_core_constant` test
        // closing the same drift on the writer-side.
        let caixa = sample_caixa();
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        match &opts.git_ref {
            GitRefSpec::Tag(tag) => {
                assert!(
                    tag.starts_with(caixa_core::DEFAULT_PUBLISH_TAG_PREFIX),
                    "default git_ref tag must start with the lifted \
                     caixa_core::DEFAULT_PUBLISH_TAG_PREFIX (got: {tag:?})"
                );
                assert_eq!(
                    tag,
                    &format!(
                        "{prefix}{versao}",
                        prefix = caixa_core::DEFAULT_PUBLISH_TAG_PREFIX,
                        versao = caixa.versao(),
                    ),
                    "default git_ref tag must compose the lifted prefix \
                     against the caixa's :versao verbatim"
                );
            }
            other => panic!("expected GitRefSpec::Tag, got {other:?}"),
        }
        let files = cluster_bundle(&caixa, &opts).unwrap();
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .expect("gitrepository.yaml present");
        let expected_tag = format!(
            "{prefix}{versao}",
            prefix = caixa_core::DEFAULT_PUBLISH_TAG_PREFIX,
            versao = caixa.versao(),
        );
        assert!(
            gr.contents.contains(&format!("tag: {expected_tag:?}")),
            "gitrepository.yaml must spell the lifted-prefix-composed tag \
             at ref.tag (expected: {expected_tag:?}, got: {contents:?})",
            contents = gr.contents
        );
    }

    #[test]
    fn cluster_bundle_default_git_tag_versao_routes_through_caixa_versao_accessor() {
        // Emit-path pin: the per-`ClusterBundleOpts::for_caixa`
        // constructor's default `git_ref: GitRefSpec::Tag(...)` body
        // and the paired `gitrepository.yaml`'s `ref.tag` scalar must
        // derive their terminal `{versao}` byte-string through the
        // typed [`caixa_core::Caixa::versao`] accessor byte-for-byte.
        // Before this converge the emit site carried a raw
        // `caixa.versao` `Display` field-access into the
        // `format!("{prefix}{versao}", ...)` template, bypassing the
        // typed dispatch. Sibling of the 05a7701 (caixa-helm)
        // `Caixa::versao` Display-axis converge — this closes the
        // co-resident `Caixa::versao` Display-axis in caixa-flux the
        // sibling 4a363bf `Caixa::nome` `String`-carry axis and
        // 162e2e2 `Caixa::nome` `&str`/Display-axis converges in
        // this crate already closed on the peer `Caixa::nome`
        // primitive, so caixa-flux now owns every projection of the
        // `Caixa::versao` axis through the typed accessor.
        //
        // A future extension of the accessor (a SemVer-2
        // build-metadata canonicalization pass, an OCI-tag
        // normalization the M4 registry-alignment slot lands, a
        // per-edition pre-release-tag overlay dispatched through
        // `Caixa::edicao`) that landed on the accessor but not on
        // this emit site would silently split the FluxCD
        // `GitRepository` clone-target `ref.tag` from every other
        // per-Caixa version-identity consumer (the peer caixa-helm
        // Chart.yaml `version:` / `appVersion:` and README `Origin`
        // line, the paired `feira publish` git-tag `v{versao}`
        // emit) — the source-controller would then resolve a
        // pre-extension git tag while the paired `HelmRelease` /
        // Chart.yaml / README carried the post-extension form,
        // silently freezing every deployed chart at the wrong
        // per-caixa git snapshot. Pin the equality on the
        // constructed `GitRefSpec::Tag` body and on the rendered
        // `gitrepository.yaml`'s `ref: { tag: ... }` field so a
        // regression that re-inlines the raw `caixa.versao` field
        // access at either layer (this constructor or the
        // format-string in [`cluster_bundle`]) surfaces here as a
        // build-time test failure rather than as a silent
        // deploy-time `GitRepository` reconcile loop.
        let caixa = sample_caixa();
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        let expected_tag = format!(
            "{prefix}{versao}",
            prefix = caixa_core::DEFAULT_PUBLISH_TAG_PREFIX,
            versao = caixa.versao(),
        );
        match &opts.git_ref {
            GitRefSpec::Tag(tag) => assert_eq!(
                tag, &expected_tag,
                "default git_ref tag must derive its `{{versao}}` \
                 scalar through the typed `caixa_core::Caixa::versao` \
                 accessor — a regression that re-inlines \
                 `caixa.versao` at the constructor site silently \
                 splits the FluxCD `GitRepository` clone-target \
                 `ref.tag` from every other per-Caixa \
                 version-identity consumer"
            ),
            other => panic!("expected GitRefSpec::Tag, got {other:?}"),
        }
        let files = cluster_bundle(&caixa, &opts).unwrap();
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .expect("gitrepository.yaml present");
        assert!(
            gr.contents.contains(&format!("tag: {expected_tag:?}")),
            "gitrepository.yaml must spell the accessor-derived tag \
             at ref.tag (expected: {expected_tag:?}, got: {contents:?}) \
             — a regression that re-inlines `caixa.versao` at the \
             [`cluster_bundle`] format-string site silently splits \
             the on-disk Flux v2 `GitRepository` YAML from the \
             substrate's per-caixa version-identity dispatch",
            contents = gr.contents
        );
    }

    #[test]
    fn flux_gitrepository_api_version_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_GITREPOSITORY_API_VERSION`
        // is the single source of truth for the Flux v2 `GitRepository`
        // CRD-group/version the rendered `gitrepository.yaml` document
        // declares at its `apiVersion` axis. Pin the equality (and the
        // static-data identity, peer with the sibling
        // `default_flux_system_namespace_re_export_points_at_caixa_core_canonical` /
        // `default_library_name_re_export_points_at_caixa_core_canonical`
        // pins) so any local re-introduction of a sibling `pub const
        // FLUX_GITREPOSITORY_API_VERSION: &str = "…"` (the canonical drift
        // footgun this lift closes — one production-code consumer of the
        // load-bearing Flux v2 `GitRepository` CRD-group/version inside
        // the gitrepository template, lifted to one re-export at the
        // caixa-core boundary) is a build-time test failure naming the
        // offending drift, not a silent apply-time `GitRepository`-
        // outside-controller-watch-window reconciliation freeze.
        caixa_core::assert_str_reexport_identity(
            "FLUX_GITREPOSITORY_API_VERSION",
            FLUX_GITREPOSITORY_API_VERSION,
            caixa_core::FLUX_GITREPOSITORY_API_VERSION,
        );
    }

    #[test]
    fn cluster_bundle_gitrepository_uses_lifted_flux_api_version() {
        // Fail-before-pass-after pin: the rendered `gitrepository.yaml`
        // `apiVersion` axis — the load-bearing Flux v2 CRD-group/version
        // declaration the `source-controller` watches — must resolve to the
        // lifted [`FLUX_GITREPOSITORY_API_VERSION`] verbatim. Before this
        // lift the gitrepository template carried an inline
        // `source.toolkit.fluxcd.io/v1` literal; a future upstream Flux v3
        // migration on this axis without a coordinated edit on the sibling
        // [`FLUX_HELMRELEASE_API_VERSION`] axis (the Flux v2 controller-
        // triple shares the `.toolkit.fluxcd.io` root and promotes together
        // on each major bump) would have silently routed the rendered
        // `GitRepository` outside the controller's `Watches` and broken at
        // apply time with a non-self-locating "no kind 'GitRepository' is
        // registered for version 'source.toolkit.fluxcd.io/v1beta2'"
        // error. Peer with
        // [`cluster_bundle_helmrelease_uses_lifted_flux_api_version`] on
        // the sibling [`FLUX_HELMRELEASE_API_VERSION`] lift.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .expect("gitrepository.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&gr.contents).expect("gitrepository.yaml parses as YAML");
        assert_eq!(
            kube_root_str_field(&parsed, KUBE_KEY_API_VERSION),
            Some(FLUX_GITREPOSITORY_API_VERSION),
            "gitrepository.yaml apiVersion must spell the lifted \
             FLUX_GITREPOSITORY_API_VERSION ({FLUX_GITREPOSITORY_API_VERSION:?}); \
             a drifted literal here routes the GitRepository outside the Flux v2 \
             source-controller's Watches",
        );
    }

    #[test]
    fn cluster_bundle_gitrepository_pins_canonical_flux_v1_api_version_string() {
        // Bridge-arm pin: the lifted [`FLUX_GITREPOSITORY_API_VERSION`]
        // constant resolves to the canonical
        // `"source.toolkit.fluxcd.io/v1"` string today, and the rendered
        // `gitrepository.yaml`'s `apiVersion` axis must spell it out
        // verbatim. Pin the literal here (peer with the
        // [`flux_gitrepository_api_version_pins_canonical_value`]
        // canonical-default arm in caixa-core, and with
        // [`cluster_bundle_helmrelease_pins_canonical_flux_v2_api_version_string`]
        // on the sibling `FLUX_HELMRELEASE_API_VERSION` axis) so a future
        // Flux v3 migration of the lifted constant surfaces here as a
        // coordinated edit-point.
        assert_eq!(
            FLUX_GITREPOSITORY_API_VERSION,
            "source.toolkit.fluxcd.io/v1"
        );
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .unwrap();
        assert!(
            gr.contents
                .contains("apiVersion: source.toolkit.fluxcd.io/v1\n"),
            "gitrepository.yaml must spell the canonical Flux v2 GitRepository \
             apiVersion at the top-level apiVersion axis (got: {contents:?})",
            contents = gr.contents,
        );
    }

    #[test]
    fn flux_kustomization_api_version_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KUSTOMIZATION_API_VERSION`
        // is the single source of truth for the Flux v2 `Kustomization`
        // CRD-group/version the rendered `kustomization.yaml` document
        // declares at its `apiVersion` axis. Pin the equality (and the
        // static-data identity, peer with the sibling
        // [`flux_gitrepository_api_version_re_export_points_at_caixa_core_canonical`]
        // / [`default_flux_system_namespace_re_export_points_at_caixa_core_canonical`]
        // pins) so any local re-introduction of a sibling `pub const
        // FLUX_KUSTOMIZATION_API_VERSION: &str = "…"` (the canonical drift
        // footgun this lift closes — one production-code consumer of the
        // load-bearing Flux v2 `Kustomization` CRD-group/version inside
        // the kustomization template, lifted to one re-export at the
        // caixa-core boundary) is a build-time test failure naming the
        // offending drift, not a silent apply-time `Kustomization`-
        // outside-controller-watch-window reconciliation freeze.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KUSTOMIZATION_API_VERSION",
            FLUX_KUSTOMIZATION_API_VERSION,
            caixa_core::FLUX_KUSTOMIZATION_API_VERSION,
        );
    }

    #[test]
    fn cluster_bundle_kustomization_uses_lifted_flux_api_version() {
        // Fail-before-pass-after pin: the rendered `kustomization.yaml`
        // top-level `apiVersion` axis — the load-bearing Flux v2
        // CRD-group/version declaration the `kustomize-controller`
        // watches — must resolve to the lifted
        // [`FLUX_KUSTOMIZATION_API_VERSION`] verbatim. Before this lift
        // the kustomization template carried an inline
        // `kustomize.toolkit.fluxcd.io/v1` literal; a future upstream
        // Flux v3 migration on this axis without a coordinated edit on
        // the sibling [`FLUX_HELMRELEASE_API_VERSION`] /
        // [`FLUX_GITREPOSITORY_API_VERSION`] axes (the Flux v2
        // controller triplet shares the `.toolkit.fluxcd.io` root and
        // promotes together on each major bump) would have silently
        // routed the rendered `Kustomization` outside the controller's
        // `Watches` and broken at apply time with a non-self-locating
        // "no kind 'Kustomization' is registered for version
        // 'kustomize.toolkit.fluxcd.io/v1beta2'" error. Peer with
        // [`cluster_bundle_helmrelease_uses_lifted_flux_api_version`] /
        // [`cluster_bundle_gitrepository_uses_lifted_flux_api_version`]
        // on the sibling Flux-CRD-axis lifts.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kz = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kz.contents).expect("kustomization.yaml parses as YAML");
        assert_eq!(
            kube_root_str_field(&parsed, KUBE_KEY_API_VERSION),
            Some(FLUX_KUSTOMIZATION_API_VERSION),
            "kustomization.yaml apiVersion must spell the lifted \
             FLUX_KUSTOMIZATION_API_VERSION ({FLUX_KUSTOMIZATION_API_VERSION:?}); \
             a drifted literal here routes the Kustomization outside the Flux v2 \
             kustomize-controller's Watches",
        );
    }

    #[test]
    fn cluster_bundle_kustomization_pins_canonical_flux_v1_api_version_string() {
        // Bridge-arm pin: the lifted [`FLUX_KUSTOMIZATION_API_VERSION`]
        // constant resolves to the canonical
        // `"kustomize.toolkit.fluxcd.io/v1"` string today, and the
        // rendered `kustomization.yaml`'s top-level `apiVersion` axis
        // must spell it out verbatim. Pin the literal here (peer with
        // the [`flux_kustomization_api_version_pins_canonical_value`]
        // canonical-default arm in caixa-core, and with
        // [`cluster_bundle_helmrelease_pins_canonical_flux_v2_api_version_string`]
        // / [`cluster_bundle_gitrepository_pins_canonical_flux_v1_api_version_string`]
        // on the sibling `FLUX_HELMRELEASE_API_VERSION` /
        // `FLUX_GITREPOSITORY_API_VERSION` axes) so a future Flux v3
        // migration of the lifted constant surfaces here as a
        // coordinated edit-point.
        assert_eq!(
            FLUX_KUSTOMIZATION_API_VERSION,
            "kustomize.toolkit.fluxcd.io/v1"
        );
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kz = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .unwrap();
        assert!(
            kz.contents
                .contains("apiVersion: kustomize.toolkit.fluxcd.io/v1\n"),
            "kustomization.yaml must spell the canonical Flux v2 Kustomization \
             apiVersion at the top-level apiVersion axis (got: {contents:?})",
            contents = kz.contents,
        );
    }

    #[test]
    fn cluster_bundle_every_flux_cr_carries_top_level_api_version_label_from_lifted_key() {
        // Fail-before-pass-after production-side sweep pin: every one of
        // the three rendered Flux bundle files' top-level `apiVersion:`
        // YAML label — the load-bearing per-CR CRD-group/version-axis
        // label naming the exact key the apiserver's `RESTMapper` reads
        // to resolve each CR's registered `CustomResourceDefinition` —
        // must byte-compose the lifted [`KUBE_KEY_API_VERSION`] verbatim
        // as its label prefix. Before this sweep the three
        // [`cluster_bundle`] format-string templates carried four inline
        // `apiVersion:` YAML label literals (gitrepository.yaml top-level
        // + helmrelease.yaml top-level + kustomization.yaml top-level +
        // kustomization.yaml `spec.healthChecks[].apiVersion`) side-by-
        // side with their `{api_version}`-interpolated value axes; a
        // future rebrand of the lifted [`KUBE_KEY_API_VERSION`] const
        // (or a coordinated K8s-API-conventions per-major-version
        // discriminator promotion) had to reach every inline label site
        // in lockstep, or the emit-side silently kept the pre-rebrand
        // label byte while the per-CR body-key retrieval sites (already
        // routed through [`KUBE_KEY_API_VERSION`]) rebranded — the two
        // sides would then disagree on the label byte, and every
        // downstream apiserver-side `RESTMapper` lookup on the rendered
        // CR would silently miss its per-CR CRD-group/version
        // registration with no field naming the label-drift root cause
        // far from the source caixa.lisp. Peer to
        // [`cluster_bundle_helmrelease_uses_lifted_flux_api_version`] /
        // [`cluster_bundle_gitrepository_uses_lifted_flux_api_version`] /
        // [`cluster_bundle_kustomization_uses_lifted_flux_api_version`]
        // on the sibling per-CR `.get(KUBE_KEY_API_VERSION)` retrieval-
        // side pins one level below the raw-byte label-axis this pin
        // gates.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let label_prefix = format!("{KUBE_KEY_API_VERSION}: ");
        for filename in [
            FLUX_GITREPOSITORY_YAML_FILENAME,
            FLUX_HELMRELEASE_YAML_FILENAME,
            FLUX_KUSTOMIZATION_YAML_FILENAME,
        ] {
            let f = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(filename))
                .unwrap_or_else(|| panic!("{filename} present"));
            assert!(
                f.contents.contains(&label_prefix),
                "{filename} must carry the top-level {label_prefix:?} YAML label \
                 composed from the lifted KUBE_KEY_API_VERSION ({KUBE_KEY_API_VERSION:?}); \
                 a drifted inline label here silently rebrands the per-CR \
                 CRD-group/version-axis discriminator away from the lifted key \
                 (got: {contents:?})",
                contents = f.contents,
            );
        }
    }

    #[test]
    fn cluster_bundle_every_flux_cr_carries_top_level_kind_label_from_lifted_key() {
        // Fail-before-pass-after production-side sweep pin: every one of
        // the three rendered Flux bundle files' top-level `kind:` YAML
        // label — the load-bearing per-CR CRD-`kind`-discriminator-axis
        // label naming the exact key the apiserver's `RESTMapper` reads
        // to resolve each CR's registered `CustomResourceDefinition`
        // against the sibling `apiVersion:` half of the `(apiVersion,
        // kind)` CRD-lookup tuple — must byte-compose the lifted
        // [`KUBE_KEY_KIND`] verbatim as its label prefix. Before this
        // sweep the three [`cluster_bundle`] format-string templates
        // carried six inline `kind:` YAML label literals
        // (gitrepository.yaml top-level + helmrelease.yaml top-level +
        // helmrelease.yaml `spec.chart.spec.sourceRef.kind` +
        // kustomization.yaml top-level + kustomization.yaml
        // `spec.sourceRef.kind` + kustomization.yaml
        // `spec.healthChecks[].kind`) side-by-side with their
        // `{kind}` / `{source_kind}` / `{health_kind}`-interpolated
        // value axes; a future rebrand of the lifted [`KUBE_KEY_KIND`]
        // const (or a coordinated K8s-API-conventions per-major-version
        // discriminator promotion) had to reach every inline label site
        // in lockstep, or the emit-side silently kept the pre-rebrand
        // label byte while the per-CR body-key retrieval sites (already
        // routed through [`KUBE_KEY_KIND`] via `kube_root_str_field` /
        // `kube_kind_is`) rebranded — the two sides would then disagree
        // on the label byte, and every downstream apiserver-side
        // `RESTMapper` / Flux-controller-side `Watches` predicate on the
        // rendered CR would silently miss its per-CR CRD-`kind` match
        // with no field naming the label-drift root cause far from the
        // source caixa.lisp. Peer to
        // [`cluster_bundle_every_flux_cr_carries_top_level_api_version_label_from_lifted_key`]
        // on the sibling apiVersion half of the same `(apiVersion, kind)`
        // CRD-lookup tuple — extends the production-side raw-byte-label-
        // sweep discipline established there onto the sibling
        // discriminator-half's raw-byte label position, so the two
        // halves of the tuple's label axes both consume the same
        // substrate-owned `&'static str` by construction.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let label_prefix = format!("{KUBE_KEY_KIND}: ");
        for filename in [
            FLUX_GITREPOSITORY_YAML_FILENAME,
            FLUX_HELMRELEASE_YAML_FILENAME,
            FLUX_KUSTOMIZATION_YAML_FILENAME,
        ] {
            let f = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(filename))
                .unwrap_or_else(|| panic!("{filename} present"));
            assert!(
                f.contents.contains(&label_prefix),
                "{filename} must carry the top-level {label_prefix:?} YAML label \
                 composed from the lifted KUBE_KEY_KIND ({KUBE_KEY_KIND:?}); \
                 a drifted inline label here silently rebrands the per-CR \
                 CRD-`kind`-discriminator-axis away from the lifted key \
                 (got: {contents:?})",
                contents = f.contents,
            );
        }
    }

    #[test]
    fn cluster_bundle_every_flux_cr_carries_top_level_metadata_label_from_lifted_key() {
        // Fail-before-pass-after production-side sweep pin: every one of
        // the three rendered Flux bundle files' top-level `metadata:`
        // YAML label — the load-bearing per-CR block-scope key naming
        // the exact axis the apiserver reads to resolve each CR's
        // ObjectMeta (`.metadata.name` / `.metadata.namespace` /
        // `.metadata.labels` / `.metadata.annotations`) against the
        // sibling `spec:` half of the top-level `(metadata, spec)`
        // K8s-CR-shape pair — must byte-compose the lifted
        // [`KUBE_KEY_METADATA`] verbatim as its label prefix. Before
        // this sweep the three [`cluster_bundle`] format-string
        // templates carried three inline `metadata:` YAML label
        // literals (gitrepository.yaml top-level +
        // helmrelease.yaml top-level + kustomization.yaml top-level)
        // side-by-side with their `name: {name}` / `namespace:
        // {namespace}` children; a future rebrand of the lifted
        // [`KUBE_KEY_METADATA`] const (or a coordinated
        // K8s-API-conventions per-major-version ObjectMeta-block-key
        // promotion) had to reach every inline label site in lockstep,
        // or the emit-side silently kept the pre-rebrand label byte
        // while the per-CR body-key retrieval sites (already routed
        // through [`KUBE_KEY_METADATA`] via `kube_metadata_str_field`)
        // rebranded — the two sides would then disagree on the label
        // byte, and every downstream apiserver-side ObjectMeta parser
        // on the rendered CR would silently miss its per-CR
        // `metadata.name` / `metadata.namespace` lookup with no field
        // naming the label-drift root cause far from the source
        // caixa.lisp. Peer to
        // [`cluster_bundle_every_flux_cr_carries_top_level_kind_label_from_lifted_key`]
        // (ef2c7ef) /
        // [`cluster_bundle_every_flux_cr_carries_top_level_api_version_label_from_lifted_key`]
        // (6d3cbf0) on the sibling `kind:` / `apiVersion:` halves of
        // the same top-level K8s-CR shape — extends the production-
        // side raw-byte-label-sweep discipline established there onto
        // the sibling ObjectMeta-block-scope label position, so the
        // three top-level K8s-CR body-block label axes all consume
        // the same substrate-owned `&'static str`s by construction.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let label_prefix = format!("{KUBE_KEY_METADATA}:");
        for filename in [
            FLUX_GITREPOSITORY_YAML_FILENAME,
            FLUX_HELMRELEASE_YAML_FILENAME,
            FLUX_KUSTOMIZATION_YAML_FILENAME,
        ] {
            let f = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(filename))
                .unwrap_or_else(|| panic!("{filename} present"));
            assert!(
                f.contents.contains(&label_prefix),
                "{filename} must carry the top-level {label_prefix:?} YAML label \
                 composed from the lifted KUBE_KEY_METADATA ({KUBE_KEY_METADATA:?}); \
                 a drifted inline label here silently rebrands the per-CR \
                 ObjectMeta-block-scope axis away from the lifted key \
                 (got: {contents:?})",
                contents = f.contents,
            );
        }
    }

    #[test]
    fn cluster_bundle_every_flux_cr_carries_top_level_spec_label_from_lifted_key() {
        // Fail-before-pass-after production-side sweep pin: every one of
        // the three rendered Flux bundle files' top-level `spec:` YAML
        // label — the load-bearing per-CR block-scope key naming the
        // exact axis the apiserver reads to resolve each CR's payload
        // (`.spec.interval` / `.spec.url` / `.spec.chart.spec.*` /
        // `.spec.sourceRef` / `.spec.path` / `.spec.healthChecks` /
        // `.spec.timeout` / `.spec.install` / `.spec.upgrade` /
        // `.spec.values` / `.spec.prune`) against the sibling
        // `metadata:` half of the top-level `(metadata, spec)` K8s-CR-
        // shape pair — must byte-compose the lifted [`KUBE_KEY_SPEC`]
        // verbatim as its label prefix. Before this sweep the three
        // [`cluster_bundle`] format-string templates carried four inline
        // `spec:` YAML label literals (gitrepository.yaml top-level +
        // helmrelease.yaml top-level + helmrelease.yaml
        // `spec.chart.spec` nested + kustomization.yaml top-level)
        // side-by-side with their per-CR `interval:` / `url:` /
        // `chart:` / `sourceRef:` / `install:` / `upgrade:` / `values:`
        // / `path:` / `healthChecks:` / `timeout:` children; a future
        // rebrand of the lifted [`KUBE_KEY_SPEC`] const (or a
        // coordinated K8s-API-conventions per-major-version body-block-
        // key promotion) had to reach every inline label site in
        // lockstep, or the emit-side silently kept the pre-rebrand
        // label byte while the retrieval-side per-CR body-key readers
        // (already routed through [`KUBE_KEY_SPEC`] via caixa-core's
        // `servico_spec_and_m2_overlay_entries` / caixa-flux's
        // `programs_yaml_entry` / caixa-mesh's per-CNP/HTTPRoute walks)
        // rebranded — the two sides would then disagree on the label
        // byte, and every downstream apiserver-side spec-block parser
        // on the rendered CR would silently miss its per-CR
        // `spec.interval` / `spec.url` / `spec.chart` / `spec.sourceRef`
        // / `spec.install` / `spec.upgrade` / `spec.values` /
        // `spec.path` / `spec.healthChecks` / `spec.timeout` lookup
        // with no field naming the label-drift root cause far from the
        // source caixa.lisp. Peer to
        // [`cluster_bundle_every_flux_cr_carries_top_level_metadata_label_from_lifted_key`]
        // (83ce571) /
        // [`cluster_bundle_every_flux_cr_carries_top_level_kind_label_from_lifted_key`]
        // (ef2c7ef) /
        // [`cluster_bundle_every_flux_cr_carries_top_level_api_version_label_from_lifted_key`]
        // (6d3cbf0) on the sibling `metadata:` / `kind:` / `apiVersion:`
        // halves of the same top-level K8s-CR shape — closes the
        // fourth (and final) canonical K8s-CR top-level block-scope
        // label axis under the same production-side raw-byte-label-
        // sweep discipline the prior three commits established, so
        // every top-level K8s-CR body-block label position across the
        // whole `cluster_bundle` render surface consumes the same
        // substrate-owned `&'static str`s by construction.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let label_prefix = format!("{KUBE_KEY_SPEC}:");
        for filename in [
            FLUX_GITREPOSITORY_YAML_FILENAME,
            FLUX_HELMRELEASE_YAML_FILENAME,
            FLUX_KUSTOMIZATION_YAML_FILENAME,
        ] {
            let f = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(filename))
                .unwrap_or_else(|| panic!("{filename} present"));
            assert!(
                f.contents.contains(&label_prefix),
                "{filename} must carry the top-level {label_prefix:?} YAML label \
                 composed from the lifted KUBE_KEY_SPEC ({KUBE_KEY_SPEC:?}); \
                 a drifted inline label here silently rebrands the per-CR \
                 spec-block-scope axis away from the lifted key \
                 (got: {contents:?})",
                contents = f.contents,
            );
        }
    }

    #[test]
    fn cluster_bundle_every_flux_cr_carries_metadata_namespace_label_from_lifted_key() {
        // Fail-before-pass-after production-side sweep pin: every one
        // of the three rendered Flux bundle files' `namespace:` YAML
        // label positions — the load-bearing per-CR-`metadata.namespace`
        // axis the apiserver reads to route each CR into its target
        // namespace (`gitrepository.yaml` top-level +
        // `helmrelease.yaml` top-level + `helmrelease.yaml`
        // `spec.chart.spec.sourceRef.namespace` nested + `kustomization.yaml`
        // top-level + `kustomization.yaml`
        // `spec.healthChecks[].namespace` nested) against the sibling
        // `name:` half of the ObjectMeta / sourceRef / healthCheck
        // `(name, namespace)` identity-pair — must byte-compose the
        // lifted [`KUBE_KEY_NAMESPACE`] verbatim as its label prefix.
        // Before this sweep the three [`cluster_bundle`] format-string
        // templates carried five inline `namespace:` YAML label
        // literals side-by-side with the sibling per-CR `name:` half
        // of every `(name, namespace)` identity-pair emission; a
        // future rebrand of the lifted [`KUBE_KEY_NAMESPACE`] const
        // (or a coordinated K8s-API-conventions per-major-version
        // ObjectMeta-key promotion) had to reach every inline label
        // site in lockstep, or the emit-side silently kept the pre-
        // rebrand label byte while the retrieval-side per-CR
        // `metadata.namespace` readers (already routed through
        // [`KUBE_KEY_NAMESPACE`] via caixa-core's
        // `kube_metadata_str_field` walks + this crate's
        // `programs_yaml_entry` upstream ComputeUnit YAML retrieval +
        // `cluster_bundle`'s rendered `kustomization.yaml` drift-
        // detection pin) rebranded — the two sides would then
        // disagree on the label byte, and every downstream apiserver-
        // side ObjectMeta parser on the rendered CR would silently
        // miss its per-CR `metadata.namespace` lookup and route the
        // resource into `default` (or whatever fallback the calling
        // controller supplies) with no field naming the label-drift
        // root cause far from the source caixa.lisp. Peer to
        // [`cluster_bundle_every_flux_cr_carries_top_level_metadata_label_from_lifted_key`]
        // (83ce571) /
        // [`cluster_bundle_every_flux_cr_carries_top_level_kind_label_from_lifted_key`]
        // (ef2c7ef) /
        // [`cluster_bundle_every_flux_cr_carries_top_level_api_version_label_from_lifted_key`]
        // (6d3cbf0) /
        // [`cluster_bundle_every_flux_cr_carries_top_level_spec_label_from_lifted_key`]
        // (ed23a31) on the sibling `metadata:` / `kind:` /
        // `apiVersion:` / `spec:` halves of the top-level K8s-CR
        // shape — extends the same production-side raw-byte-label-
        // sweep discipline onto the canonical `metadata.namespace`
        // nested axis every rendered Flux v2 bundle document
        // navigates, so every `namespace:` label position across the
        // whole `cluster_bundle` render surface consumes the same
        // substrate-owned `&'static str` by construction.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let label_prefix = format!("{KUBE_KEY_NAMESPACE}:");
        for filename in [
            FLUX_GITREPOSITORY_YAML_FILENAME,
            FLUX_HELMRELEASE_YAML_FILENAME,
            FLUX_KUSTOMIZATION_YAML_FILENAME,
        ] {
            let f = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(filename))
                .unwrap_or_else(|| panic!("{filename} present"));
            assert!(
                f.contents.contains(&label_prefix),
                "{filename} must carry the {label_prefix:?} YAML label \
                 composed from the lifted KUBE_KEY_NAMESPACE ({KUBE_KEY_NAMESPACE:?}); \
                 a drifted inline label here silently rebrands the per-CR \
                 metadata.namespace axis away from the lifted key \
                 (got: {contents:?})",
                contents = f.contents,
            );
        }
    }

    #[test]
    fn cluster_bundle_every_flux_cr_carries_metadata_name_label_from_lifted_key() {
        // Fail-before-pass-after production-side sweep pin: every one
        // of the three rendered Flux bundle files' `name:` YAML label
        // positions — the load-bearing per-CR-`metadata.name` axis the
        // apiserver-side ObjectMeta parser keys each rendered CR off
        // (`gitrepository.yaml` top-level +
        // `helmrelease.yaml` top-level +
        // `helmrelease.yaml` `spec.chart.spec.sourceRef.name` nested +
        // `kustomization.yaml` top-level +
        // `kustomization.yaml` `spec.sourceRef.name` nested +
        // `kustomization.yaml` `spec.healthChecks[].name` nested)
        // against the sibling `namespace:` half of the ObjectMeta /
        // sourceRef / healthCheck `(name, namespace)` identity-pair —
        // must byte-compose the lifted [`KUBE_KEY_NAME`] verbatim as
        // its label prefix. Before this sweep the three
        // [`cluster_bundle`] format-string templates carried six
        // inline `name:` YAML label literals side-by-side with the
        // sibling per-CR `namespace:` half of every `(name,
        // namespace)` identity-pair emission; a future rebrand of the
        // lifted [`KUBE_KEY_NAME`] const (or a coordinated K8s-API-
        // conventions per-major-version ObjectMeta-key promotion) had
        // to reach every inline label site in lockstep, or the emit-
        // side silently kept the pre-rebrand label byte while the
        // retrieval-side per-CR `metadata.name` readers (already
        // routed through [`KUBE_KEY_NAME`] via caixa-core's
        // `kube_metadata_str_field` walks + this crate's
        // `programs_yaml_entry` upstream ComputeUnit YAML retrieval)
        // rebranded — the two sides would then disagree on the label
        // byte, and every downstream apiserver-side ObjectMeta parser
        // on the rendered CR would treat the document as an anonymous
        // CR (or the apiserver would reject the apply with a schema-
        // validation error naming the wrong key) with no field naming
        // the label-drift root cause far from the source caixa.lisp.
        // Peer to
        // [`cluster_bundle_every_flux_cr_carries_metadata_namespace_label_from_lifted_key`]
        // (743e5cd) on the sibling `namespace:` half of the
        // ObjectMeta / sourceRef / healthCheck `(name, namespace)`
        // identity-pair — extends the same production-side raw-byte-
        // label-sweep discipline onto the paired `metadata.name`
        // nested axis every rendered Flux v2 bundle document
        // navigates, so every `name:` label position across the whole
        // `cluster_bundle` render surface consumes the same
        // substrate-owned `&'static str` by construction.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let label_prefix = format!("{KUBE_KEY_NAME}:");
        for filename in [
            FLUX_GITREPOSITORY_YAML_FILENAME,
            FLUX_HELMRELEASE_YAML_FILENAME,
            FLUX_KUSTOMIZATION_YAML_FILENAME,
        ] {
            let f = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(filename))
                .unwrap_or_else(|| panic!("{filename} present"));
            assert!(
                f.contents.contains(&label_prefix),
                "{filename} must carry the {label_prefix:?} YAML label \
                 composed from the lifted KUBE_KEY_NAME ({KUBE_KEY_NAME:?}); \
                 a drifted inline label here silently rebrands the per-CR \
                 metadata.name axis away from the lifted key \
                 (got: {contents:?})",
                contents = f.contents,
            );
        }
    }

    #[test]
    fn flux_kind_git_repository_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KIND_GIT_REPOSITORY` is
        // the single source of truth for the Flux v2 `GitRepository` CRD
        // `kind` discriminator the rendered Flux bundle's three
        // `GitRepository`-naming axes declare (the `gitrepository.yaml`
        // top-level `kind`, the `helmrelease.yaml`
        // `spec.chart.spec.sourceRef.kind`, and the `kustomization.yaml`
        // `spec.sourceRef.kind`). Pin the equality (and the static-data
        // identity, peer with the sibling
        // [`flux_gitrepository_api_version_re_export_points_at_caixa_core_canonical`]
        // / [`flux_kustomization_api_version_re_export_points_at_caixa_core_canonical`]
        // pins) so any local re-introduction of a sibling `pub const
        // FLUX_KIND_GIT_REPOSITORY: &str = "…"` (the canonical drift
        // footgun this lift closes — three production-code consumers of
        // the load-bearing Flux v2 `GitRepository` CRD `kind`
        // discriminator inside the cluster_bundle templates, lifted to one
        // re-export at the caixa-core boundary) is a build-time test
        // failure naming the offending drift, not a silent apply-time
        // `helm-controller` chart-resolution dangle.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KIND_GIT_REPOSITORY",
            FLUX_KIND_GIT_REPOSITORY,
            caixa_core::FLUX_KIND_GIT_REPOSITORY,
        );
    }

    #[test]
    fn cluster_bundle_gitrepository_kind_uses_lifted_flux_kind_git_repository() {
        // Fail-before-pass-after pin: the rendered `gitrepository.yaml`
        // top-level `kind` axis — the load-bearing K8s CRD discriminator
        // the Flux v2 `source-controller` resolves the rendered document
        // against — must resolve to the lifted
        // [`FLUX_KIND_GIT_REPOSITORY`] verbatim. Before this lift the
        // gitrepository template carried an inline `GitRepository`
        // literal at one of three sibling production-code call sites
        // across the cluster_bundle templates; the apiserver-side CRD
        // resolution contract is the `(apiVersion, kind)` tuple keyed
        // against the registered `CustomResourceDefinition`, so drift on
        // the kind axis is exactly as load-bearing as drift on the
        // sibling [`FLUX_GITREPOSITORY_API_VERSION`] axis (a future Flux
        // v3 rebrand on this axis without a coordinated edit on the
        // sibling sourceRef.kind axes silently lands the rendered
        // `GitRepository` outside the source-controller's `Watches`).
        // Peer with [`cluster_bundle_gitrepository_uses_lifted_flux_api_version`]
        // on the sibling apiVersion half of the same CRD-lookup tuple.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .expect("gitrepository.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&gr.contents).expect("gitrepository.yaml parses as YAML");
        assert_eq!(
            kube_root_str_field(&parsed, KUBE_KEY_KIND),
            Some(FLUX_KIND_GIT_REPOSITORY),
            "gitrepository.yaml top-level kind must spell the lifted \
             FLUX_KIND_GIT_REPOSITORY ({FLUX_KIND_GIT_REPOSITORY:?}); a drifted \
             literal here routes the GitRepository outside the Flux v2 \
             source-controller's CRD registration",
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_source_ref_kind_uses_lifted_flux_kind_git_repository() {
        // Sibling-axis pin to
        // `cluster_bundle_gitrepository_kind_uses_lifted_flux_kind_git_repository`:
        // the rendered `helmrelease.yaml`'s `spec.chart.spec.sourceRef.kind`
        // axis is the Flux v2 contract pairing the HelmRelease's chart-
        // source resolution to the sibling GitRepository's CRD
        // discriminator. Both axes must resolve to the same lifted
        // constant by value — a future Flux v3 rebrand on either axis
        // without a coordinated edit on the other would have silently
        // dangled the HelmRelease's chart sourceRef (apply-side: the
        // `helm-controller` never resolves a chart for the HelmRelease,
        // the rendered Servico chart never reconciles), with the failure
        // surfacing far from the rebrand commit's source at
        // `kubectl describe helmrelease` time. This is the one of the
        // three call sites whose drift the apiserver can't self-locate
        // (top-level kind typos surface as "no kind 'X' is registered"
        // at apply parse time; a nested sourceRef.kind typo silently
        // dangles a controller-side reference).
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let source_ref_kind = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_CHART))
            .and_then(|c| c.get(KUBE_KEY_SPEC))
            .and_then(|s| s.get(FLUX_KEY_SOURCE_REF))
            .and_then(|r| r.get(KUBE_KEY_KIND))
            .and_then(|k| k.as_str())
            .expect("helmrelease.yaml spec.chart.spec.sourceRef.kind present");
        assert_eq!(
            source_ref_kind, FLUX_KIND_GIT_REPOSITORY,
            "helmrelease.yaml spec.chart.spec.sourceRef.kind must spell the \
             lifted FLUX_KIND_GIT_REPOSITORY ({FLUX_KIND_GIT_REPOSITORY:?}); a \
             drifted literal here dangles the HelmRelease's chart sourceRef \
             at the Flux v2 source-controller's CRD registration",
        );
    }

    #[test]
    fn cluster_bundle_kustomization_source_ref_kind_uses_lifted_flux_kind_git_repository() {
        // Sibling-axis pin to
        // `cluster_bundle_gitrepository_kind_uses_lifted_flux_kind_git_repository`
        // / `cluster_bundle_helmrelease_source_ref_kind_uses_lifted_flux_kind_git_repository`:
        // the rendered `kustomization.yaml`'s `spec.sourceRef.kind` axis is
        // the Flux v2 contract pairing the parent Kustomization's source
        // resolution to the cluster's bootstrap GitRepository's CRD
        // discriminator (paired with [`DEFAULT_FLUX_SYSTEM_NAMESPACE`] on
        // the namespace axis). Completes the three-axis pin set so any
        // local re-introduction of an inline `GitRepository` literal at
        // any one of the three rendered Flux bundle axes is a build-time
        // test failure, not a silent apply-time dangling-sourceRef
        // reconciliation freeze.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kz = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kz.contents).expect("kustomization.yaml parses as YAML");
        let source_ref_kind = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_SOURCE_REF))
            .and_then(|r| r.get(KUBE_KEY_KIND))
            .and_then(|k| k.as_str())
            .expect("kustomization.yaml spec.sourceRef.kind present");
        assert_eq!(
            source_ref_kind, FLUX_KIND_GIT_REPOSITORY,
            "kustomization.yaml spec.sourceRef.kind must spell the lifted \
             FLUX_KIND_GIT_REPOSITORY ({FLUX_KIND_GIT_REPOSITORY:?}); a drifted \
             literal here dangles the parent Kustomization's sourceRef at \
             the Flux v2 source-controller's CRD registration",
        );
    }

    #[test]
    fn cluster_bundle_three_git_repository_kind_axes_share_one_lifted_constant() {
        // Cross-axis triplet invariant: the three rendered Flux bundle
        // axes that name the Flux v2 `GitRepository` CRD discriminator
        // (gitrepository.yaml top-level kind, helmrelease.yaml
        // spec.chart.spec.sourceRef.kind, kustomization.yaml
        // spec.sourceRef.kind) all consult one lifted `&'static str`.
        // The apiserver-side CRD resolution contract is the
        // `(apiVersion, kind)` tuple keyed against the registered
        // `CustomResourceDefinition`; the three axes must move
        // together on any future Flux v3 CRD rename (e.g. `GitSource`)
        // for the rendered HelmRelease's chart sourceRef + the parent
        // Kustomization's sourceRef to bind to the sibling
        // GitRepository's renamed kind discriminator. Peer to the
        // sibling [`flux_controller_triplet_api_versions_share_toolkit_fluxcd_io_root`]
        // cross-axis pin on the apiVersion half of the same CRD-lookup
        // tuple.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();

        let gr_kind = serde_yaml::from_str::<serde_yaml::Value>(
            &files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
                .unwrap()
                .contents,
        )
        .unwrap()
        .get(KUBE_KEY_KIND)
        .and_then(|v| v.as_str())
        .map(String::from)
        .unwrap();

        let hr_source_kind = serde_yaml::from_str::<serde_yaml::Value>(
            &files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
                .unwrap()
                .contents,
        )
        .unwrap()
        .get(KUBE_KEY_SPEC)
        .and_then(|s| s.get(FLUX_KEY_CHART))
        .and_then(|c| c.get(KUBE_KEY_SPEC))
        .and_then(|s| s.get(FLUX_KEY_SOURCE_REF))
        .and_then(|r| r.get(KUBE_KEY_KIND))
        .and_then(|v| v.as_str())
        .map(String::from)
        .unwrap();

        let kz_source_kind = serde_yaml::from_str::<serde_yaml::Value>(
            &files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
                .unwrap()
                .contents,
        )
        .unwrap()
        .get(KUBE_KEY_SPEC)
        .and_then(|s| s.get(FLUX_KEY_SOURCE_REF))
        .and_then(|r| r.get(KUBE_KEY_KIND))
        .and_then(|v| v.as_str())
        .map(String::from)
        .unwrap();

        assert_eq!(gr_kind, FLUX_KIND_GIT_REPOSITORY);
        assert_eq!(hr_source_kind, FLUX_KIND_GIT_REPOSITORY);
        assert_eq!(kz_source_kind, FLUX_KIND_GIT_REPOSITORY);
        assert_eq!(
            gr_kind, hr_source_kind,
            "gitrepository.yaml top-level kind and helmrelease.yaml \
             spec.chart.spec.sourceRef.kind must spell the same lifted \
             constant — drift here dangles the HelmRelease's chart sourceRef"
        );
        assert_eq!(
            gr_kind, kz_source_kind,
            "gitrepository.yaml top-level kind and kustomization.yaml \
             spec.sourceRef.kind must spell the same lifted constant — \
             drift here dangles the parent Kustomization's sourceRef"
        );
    }

    #[test]
    fn flux_kind_helm_release_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KIND_HELM_RELEASE` is
        // the single source of truth for the Flux v2 `HelmRelease` CRD
        // `kind` discriminator the rendered Flux bundle's two
        // `HelmRelease`-naming axes declare (the `helmrelease.yaml`
        // top-level `kind`, the `kustomization.yaml`
        // `spec.healthChecks[].kind`). Pin the equality (and the
        // static-data identity, peer with the sibling
        // [`flux_kind_git_repository_re_export_points_at_caixa_core_canonical`]
        // pin) so any local re-introduction of a sibling `pub const
        // FLUX_KIND_HELM_RELEASE: &str = "…"` (the canonical drift
        // footgun this lift closes — two production-code consumers of
        // the load-bearing Flux v2 `HelmRelease` CRD `kind`
        // discriminator inside the cluster_bundle templates, lifted to
        // one re-export at the caixa-core boundary) is a build-time
        // test failure naming the offending drift, not a silent
        // apply-time `helm-controller` resolution dangle or a
        // perpetually-`Reconciling` parent Kustomization.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KIND_HELM_RELEASE",
            FLUX_KIND_HELM_RELEASE,
            caixa_core::FLUX_KIND_HELM_RELEASE,
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_kind_uses_lifted_flux_kind_helm_release() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`
        // top-level `kind` axis — the load-bearing K8s CRD discriminator
        // the Flux v2 `helm-controller` resolves the rendered document
        // against — must resolve to the lifted
        // [`FLUX_KIND_HELM_RELEASE`] verbatim. Before this lift the
        // helmrelease template carried an inline `HelmRelease` literal
        // at one of two sibling production-code call sites across the
        // cluster_bundle templates; the apiserver-side CRD resolution
        // contract is the `(apiVersion, kind)` tuple keyed against the
        // registered `CustomResourceDefinition`, so drift on the kind
        // axis is exactly as load-bearing as drift on the sibling
        // [`FLUX_HELMRELEASE_API_VERSION`] axis (a future Flux v3
        // rebrand on this axis without a coordinated edit on the
        // sibling healthChecks[].kind axis silently lands the rendered
        // `HelmRelease` outside the helm-controller's `Watches`).
        // Peer with [`cluster_bundle_helmrelease_uses_lifted_flux_api_version`]
        // on the sibling apiVersion half of the same CRD-lookup tuple,
        // and with
        // [`cluster_bundle_gitrepository_kind_uses_lifted_flux_kind_git_repository`]
        // on the sibling Flux-v2 source-controller CRD kind axis.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        assert_eq!(
            kube_root_str_field(&parsed, KUBE_KEY_KIND),
            Some(FLUX_KIND_HELM_RELEASE),
            "helmrelease.yaml top-level kind must spell the lifted \
             FLUX_KIND_HELM_RELEASE ({FLUX_KIND_HELM_RELEASE:?}); a drifted \
             literal here routes the HelmRelease outside the Flux v2 \
             helm-controller's CRD registration",
        );
    }

    #[test]
    fn cluster_bundle_kustomization_health_check_kind_uses_lifted_flux_kind_helm_release() {
        // Sibling-axis pin to
        // `cluster_bundle_helmrelease_kind_uses_lifted_flux_kind_helm_release`:
        // the rendered `kustomization.yaml`'s
        // `spec.healthChecks[].kind` axis is the Flux v2 contract
        // pairing the parent Kustomization's per-resource health gate
        // to the sibling HelmRelease's CRD discriminator. Both axes
        // must resolve to the same lifted constant by value — a
        // future Flux v3 rebrand on either axis without a coordinated
        // edit on the other would have silently pinned the parent
        // Kustomization at `Reconciling` forever (apply-side: the
        // `kustomize-controller` perpetually re-evaluates an
        // unmatched health gate, the Kustomization never declares
        // its reconcile complete, every downstream `dependsOn` chain
        // freezes), with the failure surfacing far from the rebrand
        // commit's source at `kubectl describe kustomization` time.
        // This is one of the two call sites whose drift the
        // apiserver can't self-locate (top-level kind typos surface
        // as "no kind 'X' is registered" at apply parse time; a
        // healthChecks[].kind typo silently dangles a controller-side
        // health gate). Completes the two-axis pin set so any local
        // re-introduction of an inline `HelmRelease` literal at
        // either of the two rendered Flux bundle axes is a
        // build-time test failure, not a silent apply-time stuck-
        // Reconciling reconciliation freeze.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kz = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kz.contents).expect("kustomization.yaml parses as YAML");
        let health_checks = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_HEALTH_CHECKS))
            .and_then(|h| h.as_sequence())
            .expect("kustomization.yaml spec.healthChecks present");
        assert!(
            !health_checks.is_empty(),
            "kustomization.yaml spec.healthChecks must carry at least one \
             entry — the HelmRelease health gate is the canonical pleme-io \
             Flux bundle invariant"
        );
        let health_kind = health_checks[0]
            .get(KUBE_KEY_KIND)
            .and_then(|k| k.as_str())
            .expect("kustomization.yaml spec.healthChecks[0].kind present");
        assert_eq!(
            health_kind, FLUX_KIND_HELM_RELEASE,
            "kustomization.yaml spec.healthChecks[0].kind must spell the \
             lifted FLUX_KIND_HELM_RELEASE ({FLUX_KIND_HELM_RELEASE:?}); a \
             drifted literal here dangles the parent Kustomization at \
             `Reconciling` forever at the Flux v2 kustomize-controller's \
             health-gate evaluation",
        );
    }

    #[test]
    fn cluster_bundle_two_helm_release_kind_axes_share_one_lifted_constant() {
        // Cross-axis pair invariant: the two rendered Flux bundle axes
        // that name the Flux v2 `HelmRelease` CRD discriminator
        // (helmrelease.yaml top-level kind, kustomization.yaml
        // spec.healthChecks[].kind) both consult one lifted
        // `&'static str`. The apiserver-side CRD resolution contract
        // is the `(apiVersion, kind)` tuple keyed against the
        // registered `CustomResourceDefinition`; the two axes must
        // move together on any future Flux v3 CRD rename (e.g.
        // `ChartRelease`) for the parent Kustomization's health gate
        // to bind to the sibling HelmRelease's renamed kind
        // discriminator. Peer to the sibling
        // [`cluster_bundle_three_git_repository_kind_axes_share_one_lifted_constant`]
        // cross-axis pin on the Flux v2 source-controller CRD kind
        // axis.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();

        let hr_kind = serde_yaml::from_str::<serde_yaml::Value>(
            &files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
                .unwrap()
                .contents,
        )
        .unwrap()
        .get(KUBE_KEY_KIND)
        .and_then(|v| v.as_str())
        .map(String::from)
        .unwrap();

        let kz_health_kind = serde_yaml::from_str::<serde_yaml::Value>(
            &files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
                .unwrap()
                .contents,
        )
        .unwrap()
        .get(KUBE_KEY_SPEC)
        .and_then(|s| s.get(FLUX_KEY_HEALTH_CHECKS))
        .and_then(|h| h.as_sequence())
        .and_then(|seq| seq.first())
        .and_then(|e| e.get(KUBE_KEY_KIND))
        .and_then(|v| v.as_str())
        .map(String::from)
        .unwrap();

        assert_eq!(hr_kind, FLUX_KIND_HELM_RELEASE);
        assert_eq!(kz_health_kind, FLUX_KIND_HELM_RELEASE);
        assert_eq!(
            hr_kind, kz_health_kind,
            "helmrelease.yaml top-level kind and kustomization.yaml \
             spec.healthChecks[].kind must spell the same lifted constant \
             — drift here dangles the parent Kustomization's health gate \
             at the Flux v2 kustomize-controller"
        );
    }

    #[test]
    fn flux_kind_kustomization_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KIND_KUSTOMIZATION` is
        // the single source of truth for the Flux v2 `Kustomization` CRD
        // `kind` discriminator the rendered Flux bundle's
        // `Kustomization`-naming axis declares (the `kustomization.yaml`
        // top-level `kind`). Pin the equality (and the static-data
        // identity, peer with the sibling
        // [`flux_kind_git_repository_re_export_points_at_caixa_core_canonical`]
        // /
        // [`flux_kind_helm_release_re_export_points_at_caixa_core_canonical`]
        // pins) so any local re-introduction of a sibling
        // `pub const FLUX_KIND_KUSTOMIZATION: &str = "…"` (the canonical
        // drift footgun this lift closes — the load-bearing Flux v2
        // `Kustomization` CRD `kind` discriminator inside the
        // cluster_bundle template, lifted to one re-export at the
        // caixa-core boundary) is a build-time test failure naming the
        // offending drift, not a silent apply-time
        // `kustomize-controller` CRD-lookup miss that perpetually
        // freezes the rendered parent Kustomization and every
        // downstream per-Servico `dependsOn` chain.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KIND_KUSTOMIZATION",
            FLUX_KIND_KUSTOMIZATION,
            caixa_core::FLUX_KIND_KUSTOMIZATION,
        );
    }

    #[test]
    fn flux_key_source_ref_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KEY_SOURCE_REF` is the
        // single source of truth for the Flux v2 per-`HelmRelease` /
        // `Kustomization` source-reference container-axis key the
        // rendered bundle documents mount their per-CR `(kind, name,
        // namespace)` reference triple under. Pin the equality (and the
        // static-data identity, peer with the sibling
        // [`flux_kind_git_repository_re_export_points_at_caixa_core_canonical`]
        // / [`flux_kind_helm_release_re_export_points_at_caixa_core_canonical`]
        // / [`flux_kind_kustomization_re_export_points_at_caixa_core_canonical`]
        // pins on the sibling per-CRD kind-discriminator surface) so any
        // local re-introduction of a sibling `pub const
        // FLUX_KEY_SOURCE_REF: &str = "…"` (the canonical drift footgun
        // where a sibling local `pub const` could happen to carry the
        // same string at the source while pointing at a different
        // `&'static` allocation) is a build-time test failure naming
        // the offending drift, not a silent apply-time dangling-
        // sourceRef reconciliation freeze (a rebrand on this axis
        // without a coordinated caixa-core edit silently dangles both
        // the `HelmRelease.spec.chart.spec.sourceRef` chart resolution
        // + the parent `Kustomization.spec.sourceRef` source resolution
        // at the Flux v2 source-controller's CRD registration; the
        // dependent per-Servico `dependsOn` chain freezes at apply time
        // with no field naming the container-axis-drift root cause).
        // Closes the sibling re-export identity axis on the same
        // trajectory the peer per-CRD-`kind`-discriminator pins carry.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KEY_SOURCE_REF",
            FLUX_KEY_SOURCE_REF,
            caixa_core::FLUX_KEY_SOURCE_REF,
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_spec_chart_spec_source_ref_key_pins_lifted_flux_key_source_ref() {
        // Production-emit pin traversing a rendered `helmrelease.yaml`
        // document via parsed YAML: the `spec.chart.spec.sourceRef:\n`
        // sub-block header key baked into the [`cluster_bundle`]
        // `helmrelease.yaml` format-string template — the container-axis
        // key nesting the Flux v2 `HelmChartTemplate`'s per-CR
        // source-of-truth `(kind, name, namespace)` reference triple —
        // must resolve at the lifted [`FLUX_KEY_SOURCE_REF`] verbatim
        // byte-value. Before this sweep the site inlined `sourceRef:\n`
        // as a literal beside its sibling lifted `{chart_key}:` /
        // `{values_key}:` axes; a caixa-core rebrand of the const would
        // silently drift the probe path (`.get(FLUX_KEY_SOURCE_REF)`)
        // away from the emit path (baked `sourceRef:\n`), and a future
        // Flux v3 rename would land in the const while the emit-side
        // format-string template silently kept the old byte sequence.
        // The sweep threads the const through a `{source_ref_key}`
        // named-arg interpolation so both paths consult one
        // `&'static str`; this pin traverses the rendered document at
        // the lifted-const-keyed navigation and asserts a populated
        // sub-mapping (the `(kind, name, namespace)` triple) resolves
        // there, verifying that the emit path spells the exact const
        // byte-value. A regression that re-introduces an inline literal
        // in the format-string template surfaces as a `None` at the
        // lifted-const-keyed lookup. Peer to the sibling
        // [`cluster_bundle_kustomization_spec_source_ref_key_pins_lifted_flux_key_source_ref`]
        // pin closing the second production emit site on the same
        // container-axis, and to the sibling
        // [`cluster_bundle_helmrelease_values_block_uses_lifted_flux_key_values`]
        // pin on the sibling per-`HelmRelease` body-key surface.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let source_ref = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_CHART))
            .and_then(|c| c.get(KUBE_KEY_SPEC))
            .and_then(|s| s.get(FLUX_KEY_SOURCE_REF))
            .and_then(|r| r.as_mapping())
            .expect("spec.chart.spec.<FLUX_KEY_SOURCE_REF> mapping present");
        assert!(
            !source_ref.is_empty(),
            "spec.chart.spec.<FLUX_KEY_SOURCE_REF> ({FLUX_KEY_SOURCE_REF:?}) \
             must carry the `(kind, name, namespace)` reference triple; drift \
             on this container-axis key silently dangles the HelmRelease's \
             chart resolution at the Flux v2 source-controller's CRD \
             registration"
        );
    }

    #[test]
    fn cluster_bundle_kustomization_spec_source_ref_key_pins_lifted_flux_key_source_ref() {
        // Production-emit pin traversing a rendered `kustomization.yaml`
        // document via parsed YAML: the `spec.sourceRef:\n` sub-block
        // header key baked into the [`cluster_bundle`]
        // `kustomization.yaml` format-string template — the
        // container-axis key nesting the parent `Kustomization`'s
        // source-of-truth `(kind, name)` reference pair pointing back at
        // the cluster's bootstrap `GitRepository` — must resolve at the
        // lifted [`FLUX_KEY_SOURCE_REF`] verbatim byte-value. Before
        // this sweep the site inlined `sourceRef:\n` as a literal
        // beside its sibling lifted `{interval_key}:` /
        // `{health_checks_key}:` axes; a caixa-core rebrand of the
        // const would silently drift the probe path away from the emit
        // path, and a future Flux v3 rename would land in the const
        // while this format-string template silently kept the old byte
        // sequence. The sweep threads the const through a
        // `{source_ref_key}` named-arg interpolation so both paths
        // consult one `&'static str`; this pin traverses the rendered
        // document at the lifted-const-keyed navigation and asserts a
        // populated sub-mapping resolves there. A regression that
        // re-introduces an inline literal surfaces as a `None` at the
        // lifted-const-keyed lookup. Peer to the sibling
        // [`cluster_bundle_helmrelease_spec_chart_spec_source_ref_key_pins_lifted_flux_key_source_ref`]
        // pin closing the first production emit site on the same
        // container-axis, together closing the two-site production
        // emit sweep the peer [`FLUX_KEY_SOURCE_REF`] doc block calls
        // out.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kz = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kz.contents).expect("kustomization.yaml parses as YAML");
        let source_ref = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_SOURCE_REF))
            .and_then(|r| r.as_mapping())
            .expect("spec.<FLUX_KEY_SOURCE_REF> mapping present");
        assert!(
            !source_ref.is_empty(),
            "spec.<FLUX_KEY_SOURCE_REF> ({FLUX_KEY_SOURCE_REF:?}) must \
             carry the `(kind, name)` reference pair pointing at the \
             cluster's bootstrap GitRepository; drift on this \
             container-axis key silently dangles the parent \
             Kustomization's source resolution at the Flux v2 \
             source-controller's CRD registration"
        );
    }

    #[test]
    fn flux_key_values_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KEY_VALUES` is the
        // single source of truth for the Flux v2 per-`HelmRelease`
        // values-override block-body-axis key the rendered
        // `helmrelease.yaml` nests its per-cluster override YAML under.
        // Pin the equality (and the static-data identity, peer with the
        // sibling
        // [`flux_key_source_ref_re_export_points_at_caixa_core_canonical`]
        // pin on the sibling Flux v2 per-CR container-axis-key surface)
        // so any local re-introduction of a sibling `pub const
        // FLUX_KEY_VALUES: &str = "…"` (the canonical drift footgun
        // where a sibling local `pub const` could happen to carry the
        // same string at the source while pointing at a different
        // `&'static` allocation) is a build-time test failure naming
        // the offending drift, not a silent apply-time per-cluster-
        // override-routed-nowhere reconciliation (a rebrand on this
        // axis without a coordinated caixa-core edit silently routes
        // the per-cluster override YAML nowhere at Helm-render time;
        // the workload silently comes up with the referenced chart's
        // admission-time defaults, far from the source `caixa.lisp` /
        // the renderer's format-string template). Closes the sibling
        // re-export identity axis on the same trajectory the peer
        // [`flux_key_source_ref_re_export_points_at_caixa_core_canonical`]
        // pin carries.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KEY_VALUES",
            FLUX_KEY_VALUES,
            caixa_core::FLUX_KEY_VALUES,
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_values_block_uses_lifted_flux_key_values() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`'s
        // top-level `spec.values` block-body-axis key — the scope under
        // which per-cluster overrides reach the referenced chart at
        // Flux v2 `helm-controller` reconcile time — must resolve to the
        // lifted [`FLUX_KEY_VALUES`] verbatim. Before the lift this
        // site carried an inline `values:\n` literal in the format
        // string; a future Flux v3 rebrand on this axis (a hypothetical
        // upstream fluxcd/flux2 rename from `values` to `Values` /
        // `chartValues` / `overrides`, coordinated with the upstream
        // project's per-version deprecation cycle) without a
        // coordinated edit here would have silently routed the per-
        // cluster override YAML nowhere at `helm-controller` reconcile
        // time — the workload's per-cluster overrides never reach the
        // referenced chart, and the apply comes up with the chart's
        // admission-time defaults far from the rebrand commit's source.
        //
        // The pin is structural: parse the rendered YAML and assert the
        // per-`HelmRelease` values-override block-body-axis key resolves
        // under the lifted constant (not `.get("values")` — that is the
        // sibling literal-shape probe the peer test at line 1955 pins;
        // this test asserts the lifted-const-keyed navigation carries a
        // populated mapping under it). A regression that re-introduces
        // an inline literal in the format-string template surfaces as a
        // `None` at the lifted-const-keyed lookup (the inline literal
        // would survive, but the lifted-const-keyed assertion would
        // fail). Peer to the sibling
        // [`cluster_bundle_helmrelease_values_wrap_key_uses_lifted_constant`]
        // pin on the sibling per-`HelmRelease` inner-wrap-key surface
        // — extends the canonical-Flux-v2-per-`HelmRelease`-values-
        // navigation lift from the wrap-key axis onto the outer block-
        // body-axis this test targets.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let values = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_VALUES))
            .and_then(|v| v.as_mapping())
            .expect("spec.<FLUX_KEY_VALUES> mapping present");
        assert!(
            !values.is_empty(),
            "spec.<FLUX_KEY_VALUES> ({FLUX_KEY_VALUES:?}) must carry \
             at least the lifted-[`DEFAULT_LIBRARY_NAME`]-wrapped per-\
             cluster override block; drift on this block-body-axis key \
             silently routes overrides nowhere at helm-controller \
             reconcile time"
        );
    }

    #[test]
    fn cluster_bundle_kustomization_kind_uses_lifted_flux_kind_kustomization() {
        // Fail-before-pass-after pin: the rendered `kustomization.yaml`
        // top-level `kind` axis — the load-bearing K8s CRD discriminator
        // the Flux v2 `kustomize-controller` resolves the rendered
        // document against — must resolve to the lifted
        // [`FLUX_KIND_KUSTOMIZATION`] verbatim. Before this lift the
        // kustomization template carried an inline `Kustomization`
        // literal; the apiserver-side CRD resolution contract is the
        // `(apiVersion, kind)` tuple keyed against the registered
        // `CustomResourceDefinition`, so drift on the kind axis is
        // exactly as load-bearing as drift on the sibling
        // [`FLUX_KUSTOMIZATION_API_VERSION`] axis (a future Flux v3
        // rebrand on this axis without a coordinated edit on the
        // sibling apiVersion axis silently lands the rendered
        // `Kustomization` outside the kustomize-controller's `Watches`
        // and surfaces at apply parse time as a non-self-locating
        // "no kind 'Kustomization' is registered" error far from the
        // rebrand commit's source). Peer with
        // [`cluster_bundle_kustomization_uses_lifted_flux_kustomization_api_version`]
        // on the sibling apiVersion half of the same CRD-lookup tuple,
        // and with
        // [`cluster_bundle_helmrelease_kind_uses_lifted_flux_kind_helm_release`]
        // /
        // [`cluster_bundle_gitrepository_kind_uses_lifted_flux_kind_git_repository`]
        // on the sibling Flux v2 controller-triplet CRD kind axes.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kz = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kz.contents).expect("kustomization.yaml parses as YAML");
        assert_eq!(
            kube_root_str_field(&parsed, KUBE_KEY_KIND),
            Some(FLUX_KIND_KUSTOMIZATION),
            "kustomization.yaml top-level kind must spell the lifted \
             FLUX_KIND_KUSTOMIZATION ({FLUX_KIND_KUSTOMIZATION:?}); a drifted \
             literal here routes the Kustomization outside the Flux v2 \
             kustomize-controller's CRD registration",
        );
    }

    #[test]
    fn flux_key_chart_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KEY_CHART` is the
        // single source of truth for the Flux v2 per-`HelmRelease`
        // chart-template container-axis key the rendered
        // `helmrelease.yaml` nests its per-CR `HelmChartTemplate`
        // sub-document under. Pin the equality (and the static-data
        // identity, peer with the sibling
        // [`flux_key_source_ref_re_export_points_at_caixa_core_canonical`]
        // / [`flux_key_values_re_export_points_at_caixa_core_canonical`]
        // pins on the sibling Flux v2 per-`HelmRelease` body-key
        // surfaces) so any local re-introduction of a sibling `pub
        // const FLUX_KEY_CHART: &str = "…"` (the canonical drift
        // footgun where a sibling local `pub const` could happen to
        // carry the same string at the source while pointing at a
        // different `&'static` allocation) is a build-time test
        // failure naming the offending drift, not a silent apply-
        // time dangling-chart-template reconciliation freeze (a
        // rebrand on this axis without a coordinated caixa-core edit
        // silently dangles the `HelmRelease.spec.chart` chart-
        // template resolution at the Flux v2 helm-controller's CRD
        // registration; the referenced chart never resolves and the
        // per-Servico workload freezes at apply time with no field
        // naming the container-axis-drift root cause). Closes the
        // sibling re-export identity axis on the same trajectory the
        // peer per-CR body-key pins carry.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KEY_CHART",
            FLUX_KEY_CHART,
            caixa_core::FLUX_KEY_CHART,
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_chart_block_uses_lifted_flux_key_chart() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`'s
        // top-level `spec.chart` container-axis key — the scope under
        // which the Flux v2 `HelmChartTemplate` sub-document lives (the
        // `HelmChartTemplate.spec` block that carries the chart-name
        // leaf, source-of-truth reference triple, and per-CR reconcile
        // cadence the Flux v2 `helm-controller`'s per-CR reconcile loop
        // reads to source the referenced chart at Helm-render time) —
        // must resolve to the lifted [`FLUX_KEY_CHART`] verbatim.
        // Before the lift this site carried an inline `chart:\n`
        // literal in the format string; a future Flux v3 rebrand on
        // this axis (a hypothetical upstream fluxcd/flux2 rename from
        // `chart` to `Chart` / `chartTemplate` / `helmChart` /
        // `chartRef`, coordinated with the upstream project's per-
        // version deprecation cycle) without a coordinated edit here
        // would have silently dangled the whole chart-template block
        // at `helm-controller` reconcile time — the workload's
        // referenced chart never resolves, and the apply freezes at
        // the CRD-registration boundary far from the rebrand commit's
        // source.
        //
        // The pin is structural: parse the rendered YAML and assert
        // the per-`HelmRelease` chart-template container-axis key
        // resolves under the lifted constant with a populated
        // `HelmChartTemplate.spec` sub-mapping under it. A regression
        // that re-introduces an inline literal in the format-string
        // template surfaces as a `None` at the lifted-const-keyed
        // lookup. Peer to the sibling
        // [`cluster_bundle_helmrelease_values_block_uses_lifted_flux_key_values`]
        // pin on the sibling per-`HelmRelease` values-override block-
        // body-axis surface — extends the canonical-Flux-v2-per-
        // `HelmRelease`-body-key lifted-const-keyed pin discipline
        // from the values-override block-body-axis onto the sibling
        // chart-template container-axis this test targets.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let chart = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_CHART))
            .and_then(|v| v.as_mapping())
            .expect("spec.<FLUX_KEY_CHART> mapping present");
        assert!(
            !chart.is_empty(),
            "spec.<FLUX_KEY_CHART> ({FLUX_KEY_CHART:?}) must carry \
             at least the nested `HelmChartTemplate.spec` sub-document; \
             drift on this container-axis key silently dangles the \
             whole chart-template block at helm-controller reconcile time"
        );
    }

    #[test]
    fn flux_helmchart_template_key_chart_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_HELMCHART_TEMPLATE_KEY_CHART`
        // is the single source of truth for the Flux v2 per-`HelmChartTemplate`
        // chart-NAME reference leaf-scalar-axis key the rendered
        // `helmrelease.yaml`'s `spec.chart.spec.chart` leaf-scalar-
        // valued field carries the chart-artifact name at the
        // helm-controller's per-CR reconcile-time chart-lookup axis.
        // Pin the equality (and the static-data identity, peer with
        // the sibling [`flux_key_chart_re_export_points_at_caixa_core_canonical`]
        // pin on the parent container-axis re-export the leaf-scalar-
        // axis nests inside) so any local re-introduction of a sibling
        // `pub const FLUX_HELMCHART_TEMPLATE_KEY_CHART: &str = "…"`
        // (the canonical drift footgun this lift closes — the one
        // production-code call site the `cluster_bundle`
        // `helmrelease.yaml` format-string template threaded the
        // chart-NAME leaf-scalar-key through, lifted to one re-export
        // at the caixa-core boundary) is a build-time test failure
        // naming the offending drift, not a silent apply-time
        // "chart 'unknown' not found in <source>" reconciliation
        // dangle the CRD's OpenAPI extra-property schema permits at
        // the apiserver.
        caixa_core::assert_str_reexport_identity(
            "FLUX_HELMCHART_TEMPLATE_KEY_CHART",
            FLUX_HELMCHART_TEMPLATE_KEY_CHART,
            caixa_core::FLUX_HELMCHART_TEMPLATE_KEY_CHART,
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_chart_name_leaf_uses_lifted_flux_helmchart_template_key_chart() {
        // Fail-before-pass-after pin: the rendered `helmrelease.yaml`'s
        // per-`HelmChartTemplate.spec.chart` chart-NAME reference
        // leaf-scalar-valued field — the load-bearing chart-lookup
        // scalar the Flux v2 helm-controller resolves the referenced
        // chart artifact through the sibling `sourceRef` triple's
        // source at reconcile time by — must resolve under the lifted
        // [`FLUX_HELMCHART_TEMPLATE_KEY_CHART`] leaf-scalar-axis key
        // and carry the `ClusterBundleOpts.chart_path` value verbatim.
        // Before this lift the leaf site carried an inline `chart:`
        // literal at the `cluster_bundle` `helmrelease.yaml` format-
        // string template's chart-name-leaf interpolation site — a
        // future Flux v3 rebrand on this axis (a hypothetical upstream
        // fluxcd/flux2 rename from `chart` to `Chart` / `chartRef` /
        // `chartName`) without a coordinated edit on the canonical
        // caixa-core const would have silently dangled the chart-
        // artifact resolution at the helm-controller's per-CR
        // reconcile-time chart-lookup with a non-self-locating
        // "chart 'unknown' not found in <source>" error far from the
        // rebrand commit's source. Peer to
        // [`cluster_bundle_helmrelease_chart_block_uses_lifted_flux_key_chart`]
        // on the parent container-axis surface — extends the pin
        // discipline one level beneath by asserting the chart-NAME
        // leaf-scalar under the container-axis carries the lifted
        // constant.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let chart_name = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_CHART))
            .and_then(|c| c.get(KUBE_KEY_SPEC))
            .and_then(|s| s.get(FLUX_HELMCHART_TEMPLATE_KEY_CHART))
            .and_then(|n| n.as_str())
            .expect("spec.chart.spec.<FLUX_HELMCHART_TEMPLATE_KEY_CHART> scalar present");
        assert_eq!(
            chart_name,
            opts.chart_path,
            "spec.chart.spec.<FLUX_HELMCHART_TEMPLATE_KEY_CHART> \
             ({FLUX_HELMCHART_TEMPLATE_KEY_CHART:?}) leaf-scalar must carry the \
             ClusterBundleOpts.chart_path verbatim ({expected:?}); a drifted \
             key here silently dangles the chart-artifact resolution at the \
             Flux v2 helm-controller's per-CR reconcile-time chart-lookup axis",
            expected = opts.chart_path,
        );
    }

    #[test]
    fn flux_key_health_checks_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KEY_HEALTH_CHECKS` is
        // the single source of truth for the Flux v2 per-`Kustomization`
        // health-gate reference-list container-axis key the rendered
        // `kustomization.yaml` nests its per-entry
        // `[]NamespacedObjectKindReference` list under. Pin the
        // equality (and the static-data identity, peer with the sibling
        // [`flux_key_source_ref_re_export_points_at_caixa_core_canonical`]
        // / [`flux_key_chart_re_export_points_at_caixa_core_canonical`]
        // / [`flux_key_values_re_export_points_at_caixa_core_canonical`]
        // pins on the sibling Flux v2 body-key surfaces) so any local
        // re-introduction of a sibling `pub const FLUX_KEY_HEALTH_CHECKS:
        // &str = "…"` (the canonical drift footgun where a sibling local
        // `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation) is
        // a build-time test failure naming the offending drift, not a
        // silent apply-time dangling-health-gate reconciliation freeze
        // (a rebrand on this axis without a coordinated caixa-core edit
        // silently dangles the `Kustomization.spec.healthChecks` health-
        // gate at the Flux v2 kustomize-controller's per-CR reconcile
        // loop; the parent Kustomization stays at `Reconciling` forever
        // and the dependent per-cluster fleet-programs upsert chain
        // never sees `Ready=True` at apply time with no field naming
        // the container-axis-drift root cause). Closes the sibling re-
        // export identity axis on the same trajectory the peer per-CR
        // body-key pins carry — completes the quartet.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KEY_HEALTH_CHECKS",
            FLUX_KEY_HEALTH_CHECKS,
            caixa_core::FLUX_KEY_HEALTH_CHECKS,
        );
    }

    #[test]
    fn cluster_bundle_kustomization_health_checks_block_uses_lifted_flux_key_health_checks() {
        // Fail-before-pass-after pin: the rendered `kustomization.yaml`'s
        // top-level `spec.healthChecks` container-axis key — the scope
        // under which the Flux v2 `[]NamespacedObjectKindReference` list
        // lives (the per-entry `(apiVersion, kind, name, namespace)`
        // triples the Flux v2 `kustomize-controller`'s per-CR reconcile
        // loop reads to gate the parent Kustomization's `Ready=True`
        // transition on the referenced sibling `HelmRelease` reaching its
        // `HelmReleaseReady=True` condition) — must resolve to the
        // lifted [`FLUX_KEY_HEALTH_CHECKS`] verbatim. Before the lift
        // this site carried an inline `healthChecks:\n` literal in the
        // `kustomization` format string; a future Flux v3 rebrand on
        // this axis (a hypothetical upstream fluxcd/flux2 rename from
        // `healthChecks` to `HealthChecks` / `healthchecks` /
        // `healthcheck` / `health_checks` / `probes`, coordinated with
        // the upstream project's per-version deprecation cycle) without
        // a coordinated edit here would have silently dangled the whole
        // health-gate reference-list at `kustomize-controller` reconcile
        // time — the parent Kustomization stays at `Reconciling`
        // forever, and the dependent per-cluster fleet-programs upsert
        // chain never sees `Ready=True` far from the rebrand commit's
        // source.
        //
        // The pin is structural: parse the rendered YAML and assert the
        // per-`Kustomization` health-gate reference-list container-axis
        // key resolves under the lifted constant with a non-empty
        // sequence under it. A regression that re-introduces an inline
        // literal in the format-string template surfaces as a `None` at
        // the lifted-const-keyed lookup. Peer to the sibling
        // [`cluster_bundle_helmrelease_chart_block_uses_lifted_flux_key_chart`]
        // / [`cluster_bundle_helmrelease_values_block_uses_lifted_flux_key_values`]
        // pins on the sibling per-`HelmRelease` body-key surfaces —
        // extends the canonical-Flux-v2-body-key lifted-const-keyed pin
        // discipline from the per-`HelmRelease` triplet onto the sibling
        // per-`Kustomization` `spec.healthChecks` reference-list
        // container-axis this test targets, completing the quartet.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        let kz = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&kz.contents).expect("kustomization.yaml parses as YAML");
        let health_checks = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_KEY_HEALTH_CHECKS))
            .and_then(|v| v.as_sequence())
            .expect("spec.<FLUX_KEY_HEALTH_CHECKS> sequence present");
        assert!(
            !health_checks.is_empty(),
            "spec.<FLUX_KEY_HEALTH_CHECKS> ({FLUX_KEY_HEALTH_CHECKS:?}) must \
             carry at least one `[]NamespacedObjectKindReference` entry; \
             drift on this container-axis key silently dangles the whole \
             health-gate at kustomize-controller reconcile time and freezes \
             the parent Kustomization at `Reconciling`"
        );
    }

    #[test]
    fn flux_key_interval_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_KEY_INTERVAL` is the
        // single source of truth for the Flux v2 per-CR reconcile-poll
        // cadence scalar-axis key the three rendered Flux documents
        // (`gitrepository.yaml`, `helmrelease.yaml`, `kustomization.yaml`)
        // each carry as their `spec.interval` scalar. Pin the equality
        // (and the static-data identity, peer with the sibling
        // [`flux_key_source_ref_re_export_points_at_caixa_core_canonical`]
        // / [`flux_key_chart_re_export_points_at_caixa_core_canonical`]
        // / [`flux_key_values_re_export_points_at_caixa_core_canonical`]
        // / [`flux_key_health_checks_re_export_points_at_caixa_core_canonical`]
        // pins on the sibling Flux v2 per-CR body-key surfaces) so any
        // local re-introduction of a sibling `pub const FLUX_KEY_INTERVAL:
        // &str = "…"` (the canonical drift footgun where a sibling local
        // `pub const` could happen to carry the same string at the
        // source while pointing at a different `&'static` allocation) is
        // a build-time test failure naming the offending drift, not a
        // silent apply-time three-way reconcile freeze (a rebrand on
        // this axis without a coordinated caixa-core edit silently drops
        // the per-CR reconcile schedule from all three Flux v2
        // controllers' per-CR watch registrations simultaneously — the
        // referenced Git source never re-polls / the referenced chart
        // never re-templates / the parent Kustomization never re-applies
        // at upstream drift, freezing the whole cluster's per-`caixa`
        // per-cluster bundle at the last-applied snapshot with no field
        // naming the axis-drift root cause). Closes the re-export
        // identity axis on the same trajectory the peer per-CR body-key
        // pins carry — extends the discipline from the per-CR body-key
        // quartet onto the sibling cross-CR-shared reconcile-poll cadence
        // scalar-axis every Flux v2 controller reads.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KEY_INTERVAL",
            FLUX_KEY_INTERVAL,
            caixa_core::FLUX_KEY_INTERVAL,
        );
    }

    #[test]
    fn flux_gitrepository_ref_key_tag_re_export_points_at_caixa_core_canonical() {
        // The renderer's `pub use caixa_core::FLUX_GITREPOSITORY_REF_KEY_TAG`
        // is the single source of truth for the FluxCD source-controller
        // `GitRepository.spec.ref.tag` sub-selector scalar-axis key the
        // rendered `gitrepository.yaml` document declares on the tag-arm
        // of the [`GitRefSpec`] discriminated-union. Pin the equality +
        // `&'static` static-data identity so any local re-introduction
        // of a sibling `pub const FLUX_GITREPOSITORY_REF_KEY_TAG: &str
        // = "…"` at this crate is a build-time test failure naming the
        // offending drift, not a silent apply-time `GitRepository`
        // sub-selector reroute at cluster-side reconcile time. Peer to
        // [`flux_key_interval_re_export_points_at_caixa_core_canonical`]
        // on the sibling per-CR body-key surface — pivots the
        // canonical-lifted-const single-sourcing discipline onto the
        // per-`GitRepository`-`spec.ref`-sub-selector axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_GITREPOSITORY_REF_KEY_TAG",
            FLUX_GITREPOSITORY_REF_KEY_TAG,
            caixa_core::FLUX_GITREPOSITORY_REF_KEY_TAG,
        );
    }

    #[test]
    fn flux_gitrepository_ref_key_branch_re_export_points_at_caixa_core_canonical() {
        // Peer of
        // [`flux_gitrepository_ref_key_tag_re_export_points_at_caixa_core_canonical`]
        // on the branch-arm of the FluxCD source-controller
        // `GitRepository.spec.ref` discriminated-union axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_GITREPOSITORY_REF_KEY_BRANCH",
            FLUX_GITREPOSITORY_REF_KEY_BRANCH,
            caixa_core::FLUX_GITREPOSITORY_REF_KEY_BRANCH,
        );
    }

    #[test]
    fn flux_gitrepository_ref_key_commit_re_export_points_at_caixa_core_canonical() {
        // Peer of
        // [`flux_gitrepository_ref_key_tag_re_export_points_at_caixa_core_canonical`]
        // on the commit-arm of the FluxCD source-controller
        // `GitRepository.spec.ref` discriminated-union axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_GITREPOSITORY_REF_KEY_COMMIT",
            FLUX_GITREPOSITORY_REF_KEY_COMMIT,
            caixa_core::FLUX_GITREPOSITORY_REF_KEY_COMMIT,
        );
    }

    #[test]
    fn flux_gitrepository_key_ref_re_export_points_at_caixa_core_canonical() {
        // Bridge-arm pin: the re-exported FLUX_GITREPOSITORY_KEY_REF
        // resolves to the canonical `"ref"` byte + `&'static`
        // allocation from caixa-core, closing the local-`pub const`-
        // shadow footgun where a sibling `pub const
        // FLUX_GITREPOSITORY_KEY_REF: &str = "…"` in this crate could
        // silently carry the same string at the source while pointing
        // at a different `&'static` allocation. Peer of the sibling
        // [`flux_gitrepository_ref_key_tag_re_export_points_at_caixa_core_canonical`]
        // / [`flux_gitrepository_ref_key_branch_re_export_points_at_caixa_core_canonical`]
        // / [`flux_gitrepository_ref_key_commit_re_export_points_at_caixa_core_canonical`]
        // pins on the sibling per-shape arm axes of the FluxCD source-
        // controller `GitRepository.spec.ref` discriminated-union — closes
        // the parent-container-axis KEY pin above the already-pinned
        // per-shape arm sub-selector-KEY triple, so the whole per-
        // `GitRepository` `spec.ref` sub-schema (parent container-axis
        // KEY + per-shape arm sub-selector-KEY triple) now navigates
        // through four caixa-core `&'static str`s pinned in coordination.
        caixa_core::assert_str_reexport_identity(
            "FLUX_GITREPOSITORY_KEY_REF",
            FLUX_GITREPOSITORY_KEY_REF,
            caixa_core::FLUX_GITREPOSITORY_KEY_REF,
        );
    }

    #[test]
    fn cluster_bundle_gitrepository_spec_ref_key_pins_lifted_flux_gitrepository_key_ref() {
        // Production-emit pin: traverse a rendered `gitrepository.yaml`
        // document's `spec` block and assert the ref-selection
        // discriminated-union parent container-axis is keyed by the
        // *lifted* FLUX_GITREPOSITORY_KEY_REF (`"ref"`) verbatim — the
        // load-bearing per-`GitRepository` `spec.ref` container-axis
        // KEY the FluxCD source-controller reads to source the per-CR
        // git-clone refspec. Before the lift the writer template
        // carried an inline `ref:\n` literal at the sole
        // `format!("… spec:\n  ref:\n{gitref_field}\n", …)` call in
        // `cluster_bundle`; a typo there (`"gitRef:"` / `"Ref:"` /
        // `"revision:"` / `"source:"`) would have silently landed a
        // `GitRepository` whose ref-selection container-axis the CRD
        // schema validator drops as unknown at admission, and every
        // downstream `HelmRelease` / `Kustomization` bundle document
        // that resolves through the sibling
        // `HelmRelease.spec.chart.spec.sourceRef` reference would have
        // silently dangled at the FluxCD apply chain with no field
        // naming the container-axis-drift root cause. Peer of the
        // sibling per-shape arm sub-selector-KEY test
        // [`cluster_bundle_gitrepository_ref_key_dispatches_per_variant_onto_lifted_consts`]
        // on the peer per-arm scalar-axis surface — closes the parent
        // container-axis pin above the already-pinned per-shape arm
        // sub-selector-KEY triple.
        let caixa = sample_caixa();
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        let files = cluster_bundle(&caixa, &opts).expect("bundle renders");
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .expect("gitrepository.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&gr.contents).expect("gitrepository.yaml parses as YAML");
        assert!(
            parsed
                .get(KUBE_KEY_SPEC)
                .and_then(|s| s.get(FLUX_GITREPOSITORY_KEY_REF))
                .is_some(),
            "rendered gitrepository.yaml must carry its ref-selection \
             container-axis at the lifted FLUX_GITREPOSITORY_KEY_REF key \
             verbatim (got: {:?})",
            gr.contents
        );
    }

    #[test]
    fn flux_gitrepository_key_url_re_export_points_at_caixa_core_canonical() {
        // Bridge-arm pin: the re-exported FLUX_GITREPOSITORY_KEY_URL
        // resolves to the canonical `"url"` byte + `&'static`
        // allocation from caixa-core, closing the local-`pub const`-
        // shadow footgun where a sibling `pub const
        // FLUX_GITREPOSITORY_KEY_URL: &str = "…"` in this crate could
        // silently carry the same string at the source while pointing
        // at a different `&'static` allocation. Peer of the sibling
        // [`flux_gitrepository_key_ref_re_export_points_at_caixa_core_canonical`]
        // pin on the sibling per-CR `spec.ref` container-axis re-export
        // surface — closes the second per-`GitRepository` sub-block
        // key re-export identity pin, extending the discipline from
        // the container-axis surface onto the leaf-scalar remote-URL
        // axis.
        caixa_core::assert_str_reexport_identity(
            "FLUX_GITREPOSITORY_KEY_URL",
            FLUX_GITREPOSITORY_KEY_URL,
            caixa_core::FLUX_GITREPOSITORY_KEY_URL,
        );
    }

    #[test]
    fn cluster_bundle_gitrepository_spec_url_key_pins_lifted_flux_gitrepository_key_url() {
        // Production-emit pin: traverse a rendered `gitrepository.yaml`
        // document's `spec` block and assert the remote-repo-URL leaf-
        // scalar-axis is keyed by the *lifted*
        // FLUX_GITREPOSITORY_KEY_URL (`"url"`) verbatim — the load-
        // bearing per-`GitRepository` `spec.url` leaf-scalar-axis KEY
        // the FluxCD source-controller reads to source the per-CR
        // git-remote clone target. Before the lift the writer template
        // carried an inline `url: {url}\n` literal at the sole
        // `format!(…)` call in `cluster_bundle`'s gitrepo composer;
        // a typo there (`"URL:"` / `"gitUrl:"` / `"repository:"` /
        // `"repo:"`) would have silently landed a `GitRepository`
        // whose CRD schema validator drops the URL field as unknown
        // at admission, the per-Servico artifact would never populate,
        // and every downstream `HelmRelease` / `Kustomization` bundle
        // document would silently no-op at reconcile time with an
        // empty artifact. Peer of the sibling per-container-axis KEY
        // test
        // [`cluster_bundle_gitrepository_spec_ref_key_pins_lifted_flux_gitrepository_key_ref`]
        // on the peer `spec.ref` container-axis surface — extends the
        // per-CR sub-block key pin discipline from the ref-selection
        // container-axis onto the remote-URL leaf-scalar-axis.
        let caixa = sample_caixa();
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        let files = cluster_bundle(&caixa, &opts).expect("bundle renders");
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .expect("gitrepository.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&gr.contents).expect("gitrepository.yaml parses as YAML");
        let url = parsed
            .get(KUBE_KEY_SPEC)
            .and_then(|s| s.get(FLUX_GITREPOSITORY_KEY_URL))
            .and_then(|u| u.as_str())
            .expect(
                "rendered gitrepository.yaml must carry its remote-URL leaf-scalar \
                 axis at the lifted FLUX_GITREPOSITORY_KEY_URL key verbatim",
            );
        assert!(
            !url.is_empty(),
            "spec.url leaf-scalar must resolve to a non-empty git-remote clone \
             target — a drifted key would collapse the readback to None, an \
             empty string would break the source-controller's per-CR clone step"
        );
    }

    #[test]
    fn gitrefspec_ref_field_name_dispatches_per_variant_onto_lifted_consts() {
        // The [`GitRefSpec::ref_field_name`] method routes each variant
        // onto the paired canonical
        // [`FLUX_GITREPOSITORY_REF_KEY_TAG`] /
        // [`FLUX_GITREPOSITORY_REF_KEY_BRANCH`] /
        // [`FLUX_GITREPOSITORY_REF_KEY_COMMIT`] const via a compile-
        // time-exhaustive match — closes the drift surface where a
        // future variant addition or per-arm rebrand could silently
        // desynchronize the YAML emit-side + human-readable narrator
        // consumer sites from the sub-selector-key axis. Pin the
        // per-variant dispatch identity so a refactor that swaps two
        // arms' const references silently at the method-impl site
        // fires as a build-time test failure, not as a
        // `spec.ref.<wrong-key>` reroute at cluster-apply time.
        assert_eq!(
            GitRefSpec::Tag("v0.1.0".into()).ref_field_name(),
            FLUX_GITREPOSITORY_REF_KEY_TAG,
        );
        assert_eq!(
            GitRefSpec::Branch("main".into()).ref_field_name(),
            FLUX_GITREPOSITORY_REF_KEY_BRANCH,
        );
        assert_eq!(
            GitRefSpec::Commit("deadbeef".into()).ref_field_name(),
            FLUX_GITREPOSITORY_REF_KEY_COMMIT,
        );
    }

    #[test]
    fn gitrefspec_ref_value_extracts_underlying_scalar_per_variant() {
        // Peer of
        // [`gitrefspec_ref_field_name_dispatches_per_variant_onto_lifted_consts`]:
        // the [`GitRefSpec::ref_value`] method extracts the underlying
        // scalar the variant carries (tag / branch / commit value)
        // through a single collapsed match — the byte-string the
        // FluxCD source-controller feeds into its per-CR git-source
        // clone refspec. Both consumer sites in [`cluster_bundle`]
        // pair the sub-selector key with this scalar; pin the
        // per-variant extraction identity so a refactor that mixes
        // the arms (a spurious `.to_ascii_lowercase()` in one arm,
        // a lifetime-inversion that clones the payload as a scratch
        // `String`) surfaces as a build-time test failure.
        assert_eq!(GitRefSpec::Tag("v0.1.0".into()).ref_value(), "v0.1.0");
        assert_eq!(GitRefSpec::Branch("main".into()).ref_value(), "main");
        assert_eq!(
            GitRefSpec::Commit("deadbeef".into()).ref_value(),
            "deadbeef",
        );
    }

    #[test]
    fn gitrefspec_is_variant_predicates_partition_the_arm_set() {
        // Fail-before-pass-after pin on the [`gen_platform::IsVariant`]
        // derive: for each of the three [`GitRefSpec`] arms exactly one
        // of the generated `is_tag` / `is_branch` / `is_commit`
        // predicates returns `true` and the other two return `false`.
        // Prior to this derive there were no per-arm arm-discriminator
        // predicates on this crate's closed-set FluxCD-source-controller
        // `spec.ref` discriminated-union — every future consumer that
        // wanted to test "is this a tag ref (drives the substrate's
        // canonical publish-tag axis every `feira publish` verb writes)
        // vs. a branch/commit ref (the two escape hatches for
        // pre-release / bisect / breakglass reconcile flows)" had to
        // reach for a hand-rolled `matches!(git_ref, GitRefSpec::Tag(_))`
        // that expressed no compile-time link back to the sibling
        // [`Self::ref_field_name`] / [`Self::ref_value`] arm-dispatch
        // methods on the substrate primitive. A future arm addition
        // (FluxCD's source-controller `spec.ref` schema exposes further
        // `semver` / `name` sub-selectors this V0 shape stops short of,
        // per the sibling [`GitRefSpec::ref_field_name`] docstring's
        // trajectory bullet) that grew the enum but forgot to grow one
        // of the paired arm-discriminator sites would silently
        // desynchronize the peers' arm-set from the enum's true arm-set
        // — a bug the compile-time-exhaustive `match` arms on the paired
        // methods catch, but a hand-rolled `matches!` at a downstream
        // consumer would not.
        //
        // Peer of the sibling [`caixa_core::CaixaKind`] (7f6aa98) /
        // [`caixa_core::CaixaDialeto`] (fc65b96) /
        // [`caixa_core::supervisor::RestartStrategy`] /
        // [`caixa_core::supervisor::RestartPolicy`] /
        // [`caixa_core::upgrade::UpgradeInstruction`] /
        // [`caixa_core::render::PathShapeViolation`] (efc0326) /
        // [`caixa_lint::Severity`] (650a1e9) /
        // [`caixa_arch::report::InvariantKind`] (5226ad5) /
        // [`caixa_arch::ArchVerdict`] (94dafa6) /
        // [`caixa_provedor::ferrite::FerriteRuntime`] (e9829fd) /
        // [`caixa_theme::Semantic`] (b55fa6b) /
        // [`caixa_ast::NodeKind`] (7f6aa98) /
        // [`caixa_core::aplicacao::PlacementStrategy`] /
        // [`caixa_core::aplicacao::RateLimitUnit`] /
        // [`caixa_core::aplicacao::WitTarget`] /
        // [`caixa_core::dep::DepList`] /
        // [`caixa_lint::FixSafety`] (732a791) `IsVariant` derives on the
        // peer closed-set typed-enum discriminator axes — first
        // cross-crate closed-set typed-enum outside caixa-core to
        // converge onto the same one-typed-dispatch-per-variant
        // discipline, and the first `String`-carrying-variant closed-
        // set discriminator on the FluxCD source-controller axis to
        // reach it.
        let rows: [(GitRefSpec, [bool; 3]); 3] = [
            (GitRefSpec::Tag("v0.1.0".into()), [true, false, false]),
            (GitRefSpec::Branch("main".into()), [false, true, false]),
            (GitRefSpec::Commit("deadbeef".into()), [false, false, true]),
        ];
        for (variant, expected) in rows {
            let observed = [variant.is_tag(), variant.is_branch(), variant.is_commit()];
            assert_eq!(
                observed, expected,
                "GitRefSpec::{variant:?} is_* predicates must partition \
                 the arm set (tag, branch, commit); got {observed:?}"
            );
        }
    }

    #[test]
    fn gitrefspec_is_variant_predicates_agree_with_matches() {
        // Byte-equal pin on the [`gen_platform::IsVariant`]-derive-
        // generated per-arm predicates: for every [`GitRefSpec`] variant
        // the derived `is_tag()` / `is_branch()` / `is_commit()` method
        // returns exactly what a hand-rolled
        // `matches!(git_ref, GitRefSpec::Tag(_) | Branch(_) | Commit(_))`
        // returns. Pins the derive-emitted method-body shape against
        // the `matches!` macro shape so a future accidental derive-macro
        // update (or a hand-rolled `impl` that shadows one of the
        // derive-generated methods) that silently inverted the predicate
        // (`self.is_tag()` returning `true` on `GitRefSpec::Branch(_)`
        // and vice versa) surfaces at caixa-flux build time rather than
        // as a downstream consumer's silent misclassification of the
        // per-CR git-source shape at reconcile time. Peer to the
        // sibling [`caixa_core::render::path_shape_violation_is_variant_predicates_agree_with_matches`]
        // (efc0326) predicate-vs-matches byte-parity pin on the closed-
        // set typed-enum discriminator axis.
        let variants = [
            GitRefSpec::Tag("v0.1.0".into()),
            GitRefSpec::Branch("main".into()),
            GitRefSpec::Commit("deadbeef".into()),
        ];
        for variant in variants {
            assert_eq!(
                variant.is_tag(),
                matches!(variant, GitRefSpec::Tag(_)),
                "GitRefSpec::{variant:?}.is_tag() must agree with \
                 matches!(_, GitRefSpec::Tag(_))",
            );
            assert_eq!(
                variant.is_branch(),
                matches!(variant, GitRefSpec::Branch(_)),
                "GitRefSpec::{variant:?}.is_branch() must agree with \
                 matches!(_, GitRefSpec::Branch(_))",
            );
            assert_eq!(
                variant.is_commit(),
                matches!(variant, GitRefSpec::Commit(_)),
                "GitRefSpec::{variant:?}.is_commit() must agree with \
                 matches!(_, GitRefSpec::Commit(_))",
            );
        }
    }

    #[test]
    fn cluster_bundle_gitref_field_composes_lifted_dispatch_byte_shape() {
        // Fail-before-pass-after emission-side pin: the rendered
        // `gitrepository.yaml` document's `spec.ref` sub-block byte-
        // shape matches the composition of the canonical lifted
        // [`GitRefSpec::ref_field_name`] +
        // [`GitRefSpec::ref_value`] dispatch pair against the prior
        // inline `format!("    {arm}: {v:?}")` per-arm match block,
        // for every arm of the [`GitRefSpec`] discriminated-union.
        // Byte-identical output to the prior 3-arm inline match
        // (`{v:?}` on `&str` renders the same shape as `{v:?}` on
        // `String`) — the composition equation
        // `format!("    {field}: {value:?}", ...)` reduces to
        // `format!("    tag: {t:?}")` / `format!("    branch: {b:?}")`
        // / `format!("    commit: {c:?}")` per arm by construction.
        // Peer to the sibling
        // [`cluster_bundle_default_git_tag_uses_lifted_caixa_core_prefix`]
        // emission-side pin on the tag-arm — pivots the discipline
        // from the tag-value axis (the prior lift closed) onto the
        // sub-selector-key axis (this lift closes) so the pair of
        // pins closes both coordinates of the `spec.ref.<key>:
        // <value>` sub-block.
        let cases = [
            (GitRefSpec::Tag("v0.1.0".into()), "    tag: \"v0.1.0\""),
            (GitRefSpec::Branch("main".into()), "    branch: \"main\""),
            (
                GitRefSpec::Commit("deadbeef".into()),
                "    commit: \"deadbeef\"",
            ),
        ];
        for (git_ref, expected) in cases {
            let composed = format!(
                "    {field}: {value:?}",
                field = git_ref.ref_field_name(),
                value = git_ref.ref_value(),
            );
            assert_eq!(
                composed, expected,
                "GitRefSpec::{git_ref:?} must compose to the prior \
                 inline byte-shape via the lifted dispatch",
            );
        }
    }

    #[test]
    fn cluster_bundle_gitref_narrator_composes_lifted_dispatch_byte_shape() {
        // Peer of
        // [`cluster_bundle_gitref_field_composes_lifted_dispatch_byte_shape`]
        // on the sibling `tag_human` narrator-prose axis in
        // [`cluster_bundle`] — pins the byte-shape of the `<arm>
        // <value>` operator-facing narrator prose the rendered
        // `gitrepository.yaml` document's leading `# Source — pinned
        // to <tag_human>` comment quotes. Byte-identical output to
        // the prior 3-arm inline `format!("{arm} {v}")` per-variant
        // match block by construction.
        let cases = [
            (GitRefSpec::Tag("v0.1.0".into()), "tag v0.1.0"),
            (GitRefSpec::Branch("main".into()), "branch main"),
            (GitRefSpec::Commit("deadbeef".into()), "commit deadbeef"),
        ];
        for (git_ref, expected) in cases {
            let composed = format!(
                "{field} {value}",
                field = git_ref.ref_field_name(),
                value = git_ref.ref_value(),
            );
            assert_eq!(
                composed, expected,
                "GitRefSpec::{git_ref:?} narrator prose must compose \
                 to the prior inline byte-shape via the lifted dispatch",
            );
        }
    }

    #[test]
    fn cluster_bundle_gitrepo_yaml_carries_lifted_sub_selector_keys() {
        // End-to-end emission-side pin: for every arm of
        // [`GitRefSpec`], the rendered `gitrepository.yaml` document's
        // `spec.ref` sub-block declares the sub-selector under the
        // canonical lifted [`FLUX_GITREPOSITORY_REF_KEY_TAG`] /
        // [`FLUX_GITREPOSITORY_REF_KEY_BRANCH`] /
        // [`FLUX_GITREPOSITORY_REF_KEY_COMMIT`] key — pin the presence
        // + value round-trip through the rendered YAML so a regression
        // that re-inlines the sub-selector key at the emit site
        // surfaces here as a test failure rather than as a silent
        // FluxCD source-controller sub-block reroute at reconcile
        // time. Peer to the sibling
        // [`cluster_bundle_default_git_tag_uses_lifted_caixa_core_prefix`]
        // pin that closes the sibling per-arm value axis on the
        // tag-arm.
        let caixa = sample_caixa();
        let cases: [(GitRefSpec, &str, &str); 3] = [
            (
                GitRefSpec::Tag("v0.1.0".into()),
                FLUX_GITREPOSITORY_REF_KEY_TAG,
                "v0.1.0",
            ),
            (
                GitRefSpec::Branch("main".into()),
                FLUX_GITREPOSITORY_REF_KEY_BRANCH,
                "main",
            ),
            (
                GitRefSpec::Commit("deadbeef".into()),
                FLUX_GITREPOSITORY_REF_KEY_COMMIT,
                "deadbeef",
            ),
        ];
        for (git_ref, expected_key, expected_value) in cases {
            let mut opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
            opts.git_ref = git_ref.clone();
            let files = cluster_bundle(&caixa, &opts).expect("bundle renders");
            let gr = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
                .expect("gitrepository.yaml present");
            let parsed: serde_yaml::Value =
                serde_yaml::from_str(&gr.contents).expect("gitrepository.yaml parses as YAML");
            let sub_selector = parsed
                .get(KUBE_KEY_SPEC)
                .and_then(|s| s.get(FLUX_GITREPOSITORY_KEY_REF))
                .and_then(|r| r.get(expected_key))
                .and_then(|v| v.as_str())
                .unwrap_or_else(|| {
                    panic!(
                        "spec.ref.{expected_key:?} missing or non-string \
                         for GitRefSpec::{git_ref:?}: {contents:?}",
                        contents = gr.contents,
                    )
                });
            assert_eq!(
                sub_selector, expected_value,
                "spec.ref.{expected_key:?} must carry the paired \
                 scalar for GitRefSpec::{git_ref:?}",
            );
        }
    }

    #[test]
    fn flux_helmrelease_yaml_filename_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_HELMRELEASE_YAML_FILENAME` was lifted from
        // the thirteen production + test-side inline `"helmrelease.yaml"`
        // / `PathBuf::from("helmrelease.yaml")` /
        // `names.contains(&"helmrelease.yaml".to_string())` literals
        // across [`cluster_bundle`]'s per-`BundleFile` `HelmRelease`
        // document `path` emit site + every test-side round-trip
        // navigator that reaches into the rendered bundle by the
        // `HelmRelease` document filename to a re-export of
        // [`caixa_core::FLUX_HELMRELEASE_YAML_FILENAME`] so the Flux v2
        // per-cluster-bundle `HelmRelease` document filename lives in
        // exactly one place across every caixa renderer. Pin the equality
        // + `&'static` static-data identity here so any local
        // re-introduction of a sibling `pub const
        // FLUX_HELMRELEASE_YAML_FILENAME: &str = "…"` at this crate — the
        // canonical drift footgun where a sibling local `pub const` could
        // happen to carry the same string at the source while pointing
        // at a different `&'static` allocation — is a build-time test
        // failure naming the offending drift, not a silent FluxCD
        // `kustomize-controller` "no `HelmRelease` document found under
        // this bundle" reroute at cluster-side reconcile time far from
        // the drift site. Peer to
        // [`flux_key_interval_re_export_points_at_caixa_core_canonical`]
        // on the sibling per-CR body-key surface, and to the
        // [`caixa_helm::HELM_CHART_YAML_FILENAME`] (c2c99b0) /
        // [`caixa_helm::HELM_VALUES_YAML_FILENAME`] (9a980ba) re-exports
        // on the sibling Helm-chart-directory filename surfaces — pivots
        // the canonical-filename single-sourcing discipline from the
        // per-Helm-chart-directory metadata / values file axes onto the
        // sibling per-Flux-v2-bundle `HelmRelease` document filename
        // axis this crate's [`cluster_bundle`] renders.
        caixa_core::assert_str_reexport_identity(
            "FLUX_HELMRELEASE_YAML_FILENAME",
            FLUX_HELMRELEASE_YAML_FILENAME,
            caixa_core::FLUX_HELMRELEASE_YAML_FILENAME,
        );
    }

    #[test]
    fn flux_gitrepository_yaml_filename_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_GITREPOSITORY_YAML_FILENAME` was lifted
        // from the nine production + test-side inline
        // `"gitrepository.yaml"` / `PathBuf::from("gitrepository.yaml")`
        // / `names.contains(&"gitrepository.yaml".to_string())` literals
        // across [`cluster_bundle`]'s per-`BundleFile` `GitRepository`
        // document `path` emit site + every test-side round-trip
        // navigator that reaches into the rendered bundle by the
        // `GitRepository` document filename to a re-export of
        // [`caixa_core::FLUX_GITREPOSITORY_YAML_FILENAME`] so the Flux v2
        // per-cluster-bundle `GitRepository` document filename lives in
        // exactly one place across every caixa renderer. Pin the
        // equality + `&'static` static-data identity here so any local
        // re-introduction of a sibling `pub const
        // FLUX_GITREPOSITORY_YAML_FILENAME: &str = "…"` at this crate —
        // the canonical drift footgun where a sibling local `pub const`
        // could happen to carry the same string at the source while
        // pointing at a different `&'static` allocation — is a
        // build-time test failure naming the offending drift, not a
        // silent FluxCD `source-controller` "no `GitRepository`
        // document found under this bundle" reroute at cluster-side
        // reconcile time far from the drift site. Peer to
        // [`flux_helmrelease_yaml_filename_re_export_points_at_caixa_core_canonical`]
        // on the sibling per-`HelmRelease`-document filename surface —
        // extends the canonical-Flux-v2-bundle-filename lifted-const
        // discipline from the middle coordinate of the filename triple
        // onto its first coordinate.
        caixa_core::assert_str_reexport_identity(
            "FLUX_GITREPOSITORY_YAML_FILENAME",
            FLUX_GITREPOSITORY_YAML_FILENAME,
            caixa_core::FLUX_GITREPOSITORY_YAML_FILENAME,
        );
    }

    #[test]
    fn flux_kustomization_yaml_filename_re_export_points_at_caixa_core_canonical() {
        // The renderer's `FLUX_KUSTOMIZATION_YAML_FILENAME` was lifted
        // from the sixteen production + test-side inline
        // `"kustomization.yaml"` /
        // `PathBuf::from("kustomization.yaml")` /
        // `names.contains(&"kustomization.yaml".to_string())` literals
        // across [`cluster_bundle`]'s per-`BundleFile` `Kustomization`
        // document `path` emit site + every test-side round-trip
        // navigator that reaches into the rendered bundle by the
        // `Kustomization` document filename to a re-export of
        // [`caixa_core::FLUX_KUSTOMIZATION_YAML_FILENAME`] so the
        // Flux v2 per-cluster-bundle `Kustomization` document filename
        // lives in exactly one place across every caixa renderer. Pin
        // the equality + `&'static` static-data identity here so any
        // local re-introduction of a sibling `pub const
        // FLUX_KUSTOMIZATION_YAML_FILENAME: &str = "…"` at this crate —
        // the canonical drift footgun where a sibling local `pub const`
        // could happen to carry the same string at the source while
        // pointing at a different `&'static` allocation — is a
        // build-time test failure naming the offending drift, not a
        // silent FluxCD `kustomize-controller` "no `Kustomization`
        // document found under this bundle" reroute at cluster-side
        // reconcile time far from the drift site. Peer to
        // [`flux_helmrelease_yaml_filename_re_export_points_at_caixa_core_canonical`]
        // + [`flux_gitrepository_yaml_filename_re_export_points_at_caixa_core_canonical`]
        // on the sibling per-`HelmRelease` / per-`GitRepository`
        // document filename surfaces — closes the canonical-Flux-v2-
        // bundle-filename lifted-const discipline on the third
        // coordinate of the filename triple.
        caixa_core::assert_str_reexport_identity(
            "FLUX_KUSTOMIZATION_YAML_FILENAME",
            FLUX_KUSTOMIZATION_YAML_FILENAME,
            caixa_core::FLUX_KUSTOMIZATION_YAML_FILENAME,
        );
    }

    #[test]
    fn cluster_bundle_every_flux_cr_carries_lifted_flux_key_interval_scalar() {
        // Fail-before-pass-after pin: every rendered Flux v2 document in
        // the `cluster_bundle` triplet (`gitrepository.yaml`,
        // `helmrelease.yaml`, `kustomization.yaml`) must resolve its
        // `spec.interval` reconcile-poll cadence scalar under the lifted
        // [`FLUX_KEY_INTERVAL`] verbatim. Before the lift each of the
        // three sites carried an inline `interval:` literal in its
        // per-CR format string; a future Flux v3 rebrand on this axis (a
        // hypothetical upstream fluxcd/flux2 rename from `interval` to
        // `Interval` / `period` / `cadence` / `pollInterval` /
        // `reconcileInterval`, coordinated with the upstream project's
        // per-version deprecation cycle) without a coordinated edit at
        // any one of the three emit sites would have silently dropped
        // the per-CR reconcile schedule from the affected Flux v2
        // controller's per-CR watch registration — the referenced Git
        // source never re-polls / the referenced chart never re-templates
        // / the parent Kustomization never re-applies at upstream drift,
        // freezing the whole cluster's per-`caixa` per-cluster bundle at
        // the last-applied snapshot far from the rebrand commit's source.
        //
        // The pin is structural: parse each rendered YAML document in
        // the triplet and assert the per-CR reconcile-poll cadence
        // scalar-axis key resolves under the lifted constant with a
        // non-empty string scalar under it. A regression that re-introduces
        // an inline literal at any of the three emit sites surfaces as a
        // `None` at the lifted-const-keyed lookup on that document. Peer
        // to the sibling
        // [`cluster_bundle_helmrelease_chart_block_uses_lifted_flux_key_chart`]
        // /
        // [`cluster_bundle_helmrelease_values_block_uses_lifted_flux_key_values`]
        // /
        // [`cluster_bundle_kustomization_health_checks_block_uses_lifted_flux_key_health_checks`]
        // pins on the sibling per-CR body-key surfaces — extends the
        // canonical-Flux-v2-body-key lifted-const-keyed pin discipline
        // from the per-CR body-key quartet onto the sibling cross-CR-
        // shared reconcile-poll cadence scalar-axis this test targets.
        let opts = ClusterBundleOpts::for_caixa(&sample_caixa(), "rio");
        let files = cluster_bundle(&sample_caixa(), &opts).unwrap();
        for filename in [
            FLUX_GITREPOSITORY_YAML_FILENAME,
            FLUX_HELMRELEASE_YAML_FILENAME,
            FLUX_KUSTOMIZATION_YAML_FILENAME,
        ] {
            let doc = files
                .iter()
                .find(|f| f.path == std::path::PathBuf::from(filename))
                .unwrap_or_else(|| panic!("{filename} present"));
            let parsed: serde_yaml::Value = serde_yaml::from_str(&doc.contents)
                .unwrap_or_else(|_| panic!("{filename} parses as YAML"));
            let interval = parsed
                .get(KUBE_KEY_SPEC)
                .and_then(|s| s.get(FLUX_KEY_INTERVAL))
                .and_then(|v| v.as_str())
                .unwrap_or_else(|| {
                    panic!(
                        "{filename} spec.<FLUX_KEY_INTERVAL> ({FLUX_KEY_INTERVAL:?}) \
                         scalar present; drift on this axis silently drops the \
                         per-CR reconcile schedule from the Flux v2 controller's \
                         per-CR watch registration",
                    )
                });
            assert!(
                !interval.is_empty(),
                "{filename} spec.<FLUX_KEY_INTERVAL> ({FLUX_KEY_INTERVAL:?}) must \
                 carry a non-empty duration scalar; the Flux v2 controller's \
                 per-CR reconcile loop rejects an empty cadence at admission",
            );
            // The renderer threads opts.interval through every CR
            // verbatim (the same [`ClusterBundleOpts::interval`] field
            // for the whole per-cluster bundle); pin that the emitted
            // scalar agrees with the opts-side input so a future
            // refactor that per-CR-overrides the cadence surfaces here
            // rather than as a silent per-CR reconcile-schedule split.
            assert_eq!(
                interval, opts.interval,
                "{filename} spec.<FLUX_KEY_INTERVAL> ({FLUX_KEY_INTERVAL:?}) \
                 must carry the same duration scalar the [`ClusterBundleOpts`] \
                 seeded — drift here silently splits the per-CR reconcile \
                 schedule across the three Flux v2 controllers",
            );
        }
    }

    #[test]
    fn bundle_file_alias_resolves_to_caixa_core_rendered_file() {
        // Type-alias identity pin: the [`BundleFile`] alias at this
        // crate's boundary resolves to the canonical
        // [`caixa_core::RenderedFile`] the substrate-side "one rendered
        // leaf artifact" shape lives at. `let _: BundleFile = <a
        // RenderedFile>` type-checks *iff* [`BundleFile`] is the
        // aliased canonical (not a sibling pub-struct re-declaration
        // that happens to carry the same field pair — that would
        // compile past the struct-literal navigators below but fail
        // this assignment). A drifted local `pub struct BundleFile
        // { pub path: PathBuf, pub contents: String }` at this crate —
        // the canonical drift footgun that would carry the same
        // field pair at the source while pointing at a different
        // struct definition — trips this pin at caixa-flux build time
        // rather than surfacing as a downstream `caixa_core::RenderedFile`
        // consumer refusing a `BundleFile`-shaped value at type-check
        // time far from the drift commit.
        let canonical: caixa_core::RenderedFile = caixa_core::RenderedFile {
            path: std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME),
            contents: String::new(),
        };
        let aliased: BundleFile = canonical.clone();
        assert_eq!(aliased, canonical);
        // Struct-literal construction still resolves through the alias
        // — the pre-lift `BundleFile { path, contents }` shape at every
        // production emit site (three sites in [`cluster_bundle`])
        // continues to compile, and the derive tuple travels through
        // the alias.
        let via_alias = BundleFile {
            path: std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME),
            contents: "kind: HelmRelease\n".to_string(),
        };
        assert_eq!(
            via_alias.path.to_string_lossy(),
            FLUX_HELMRELEASE_YAML_FILENAME
        );
    }

    #[test]
    fn bundle_file_new_constructor_travels_through_alias_to_canonical() {
        // Inherent-method-through-alias pin: the canonical
        // [`caixa_core::RenderedFile::new`] `impl Into<PathBuf>` /
        // `impl Into<String>` constructor every per-CR YAML leaf in
        // [`cluster_bundle`] now routes through resolves at
        // `BundleFile::new(…)` — Rust inherent methods travel through
        // a `pub type BundleFile = caixa_core::RenderedFile` alias to
        // the aliased canonical at name resolution, so a drifted
        // local `pub struct BundleFile { pub path: PathBuf, pub
        // contents: String }` at this crate would carry the field
        // pair the sibling type-alias-identity pin above still
        // accepts (both records share `pub path` / `pub contents`
        // shape) while dropping the constructor — the three sweep
        // sites in [`cluster_bundle`] would stop compiling and the
        // failing calls would name `BundleFile` directly, making the
        // drift-source unambiguous. This test pins the constructor's
        // per-alias reachability + the byte-identical record shape
        // against a `FLUX_GITREPOSITORY_YAML_FILENAME`-keyed probe so
        // the pin fires at caixa-flux build time.
        let via_alias_new: BundleFile =
            BundleFile::new(FLUX_GITREPOSITORY_YAML_FILENAME, "kind: GitRepository\n");
        let via_canonical_new = caixa_core::RenderedFile::new(
            FLUX_GITREPOSITORY_YAML_FILENAME,
            String::from("kind: GitRepository\n"),
        );
        assert_eq!(via_alias_new, via_canonical_new);
        assert_eq!(
            via_alias_new.path,
            std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME),
        );
        assert_eq!(via_alias_new.contents, "kind: GitRepository\n");
    }

    #[test]
    fn programs_yaml_entry_name_field_routes_through_caixa_nome_accessor() {
        // Fail-before-pass-after pin: the emit-side `name:` scalar the
        // aggregator-path [`programs_yaml_entry`] writes into the
        // per-Servico values-schema entry at
        // `entry[FLEET_PROGRAMS_KEY_NAME]` must derive from the typed
        // [`caixa_core::Caixa::nome`] accessor byte-for-byte. Before
        // this converge the emit site carried a raw
        // `caixa.nome.clone()` field access at
        // [`programs_yaml_entry`]'s per-entry name-insert position —
        // the sole production-code `String`-carry from `Caixa::nome`
        // on this fn's emit path — and a future extension of the
        // accessor (an M4 namespace-qualified rewrite the CR
        // materializer applies per-CR, a per-cluster alias table
        // pinned through a future `:placement`-scoped slot, the
        // `:nome-suffix` overlay MESH-COMPOSITION §III.2 acknowledges)
        // that landed on the accessor but not on this emit site would
        // silently split the substrate-operator-side aggregator's
        // per-entry `name:` axis (the discriminator
        // [`caixa_core::upsert_named_entry`] keys off on every peer
        // append / replace, and the substrate operator's fleet-programs
        // reconciler groups per-Servico HelmRelease materialization by)
        // from every peer read-side consumer of `Caixa::nome`
        // (`lareira_chart_name` chart-directory composer,
        // `flux_kustomization_source_subtree` per-caixa sub-tree
        // composer, the error-path diagnostic
        // [`caixa_core::KindMismatch`] names the offending caixa's
        // `:nome` through). Byte-equal today (the accessor is
        // `&self.nome`); the pin catches any future accessor
        // extension whose emit-side write regresses to the raw field.
        // Peer to
        // [`caixa_mesh::tests::programs_for_aplicacao_entry_aplicacao_routes_through_caixa_nome_accessor`]
        // on the sibling mesh-side fleet-programs-aggregator emit
        // path.
        let caixa = sample_caixa();
        let entry = programs_yaml_entry(&caixa, &sample_cu_yaml()).unwrap();
        let emitted = entry
            .get(FLEET_PROGRAMS_KEY_NAME)
            .and_then(|n| n.as_str())
            .expect(
                "programs.yaml entry must carry a `name:` scalar — drift here \
                 silently splits the substrate-operator-side fleet-programs \
                 aggregator's per-entry identity from every peer read-side \
                 consumer of `Caixa::nome`",
            );
        assert_eq!(
            emitted,
            caixa.nome(),
            "programs.yaml `entry[FLEET_PROGRAMS_KEY_NAME]` must derive from \
             the typed `caixa_core::Caixa::nome` accessor byte-for-byte — a \
             regression that re-inlines `caixa.nome.clone()` at the emit site \
             silently splits the aggregator-path per-entry `name:` axis from \
             every future accessor extension (namespace-qualified rewrite, \
             per-cluster alias table, `:nome-suffix` overlay) that lands on \
             the accessor",
        );
    }

    #[test]
    fn cluster_bundle_gitrepository_metadata_name_routes_through_caixa_nome_accessor() {
        // Fail-before-pass-after pin: the emit-side `metadata.name`
        // scalar the bundle-path [`cluster_bundle`] writes into the
        // `GitRepository` CR document must derive from the typed
        // [`caixa_core::Caixa::nome`] accessor byte-for-byte. Before
        // this converge the emit site carried a raw
        // `let name = caixa.nome.clone()` field access at
        // [`cluster_bundle`]'s per-bundle name-binding position — the
        // sole production-code `String`-carry the fn threads into
        // every downstream `metadata.name` axis it emits — so a future
        // extension of the accessor that landed on the accessor but
        // not on this emit site would silently split the source-
        // controller-side `GitRepository` CR's per-Servico identity
        // (the axis the paired `HelmRelease`
        // `spec.chart.spec.sourceRef.name` binds through) from every
        // peer read-side consumer of `Caixa::nome`. Peer to
        // [`cluster_bundle_helmrelease_metadata_name_routes_through_caixa_nome_accessor`]
        // and
        // [`cluster_bundle_kustomization_metadata_name_routes_through_caixa_nome_accessor`]
        // on the sibling per-CR emit-position pins.
        let caixa = sample_caixa();
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        let files = cluster_bundle(&caixa, &opts).unwrap();
        let gr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_GITREPOSITORY_YAML_FILENAME))
            .expect("gitrepository.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&gr.contents).expect("gitrepository.yaml parses as YAML");
        let emitted = kube_metadata_str_field(&parsed, KUBE_KEY_NAME).expect(
            "gitrepository.yaml `metadata.name` scalar present — drift here \
             silently orphans the source-controller-side per-Servico \
             GitRepository CR from every peer `spec.sourceRef.name` binding",
        );
        assert_eq!(
            emitted,
            caixa.nome(),
            "gitrepository.yaml `metadata.name` must derive from the typed \
             `caixa_core::Caixa::nome` accessor byte-for-byte — a regression \
             that re-inlines `caixa.nome.clone()` at the per-bundle \
             `let name` binding silently splits the source-controller-side \
             per-Servico GitRepository CR's identity from every future \
             accessor extension (namespace-qualified rewrite, per-cluster \
             alias table, `:nome-suffix` overlay) that lands on the accessor",
        );
    }

    #[test]
    fn cluster_bundle_helmrelease_metadata_name_routes_through_caixa_nome_accessor() {
        // Fail-before-pass-after pin: the emit-side `metadata.name`
        // scalar the bundle-path [`cluster_bundle`] writes into the
        // `HelmRelease` CR document must derive from the typed
        // [`caixa_core::Caixa::nome`] accessor byte-for-byte. Same
        // single-source `let name = caixa.nome()` binding as the
        // peer GitRepository / Kustomization sibling pins — this test
        // pins the derived `HelmRelease` `metadata.name` axis (the
        // discriminator the Flux v2 helm-controller keys per-Servico
        // reconciliation off, and the axis the paired Kustomization
        // `spec.healthChecks[0].name` health-checks binds through).
        // Peer to
        // [`cluster_bundle_gitrepository_metadata_name_routes_through_caixa_nome_accessor`]
        // and
        // [`cluster_bundle_kustomization_metadata_name_routes_through_caixa_nome_accessor`]
        // on the sibling per-CR emit-position pins.
        let caixa = sample_caixa();
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        let files = cluster_bundle(&caixa, &opts).unwrap();
        let hr = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_HELMRELEASE_YAML_FILENAME))
            .expect("helmrelease.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&hr.contents).expect("helmrelease.yaml parses as YAML");
        let emitted = kube_metadata_str_field(&parsed, KUBE_KEY_NAME).expect(
            "helmrelease.yaml `metadata.name` scalar present — drift here \
             silently orphans the helm-controller-side per-Servico \
             HelmRelease CR from every peer Kustomization \
             `spec.healthChecks[].name` binding",
        );
        assert_eq!(
            emitted,
            caixa.nome(),
            "helmrelease.yaml `metadata.name` must derive from the typed \
             `caixa_core::Caixa::nome` accessor byte-for-byte — a regression \
             that re-inlines `caixa.nome.clone()` at the per-bundle \
             `let name` binding silently splits the helm-controller-side \
             per-Servico HelmRelease CR's identity from every future \
             accessor extension (namespace-qualified rewrite, per-cluster \
             alias table, `:nome-suffix` overlay) that lands on the accessor",
        );
    }

    #[test]
    fn cluster_bundle_kustomization_metadata_name_routes_through_caixa_nome_accessor() {
        // Fail-before-pass-after pin: the emit-side `metadata.name`
        // scalar the bundle-path [`cluster_bundle`] writes into the
        // `Kustomization` CR document must derive from the typed
        // [`caixa_core::Caixa::nome`] accessor byte-for-byte. Same
        // single-source `let name = caixa.nome()` binding as the
        // peer GitRepository / HelmRelease sibling pins — this test
        // pins the derived `Kustomization` `metadata.name` axis (the
        // discriminator the Flux v2 kustomize-controller keys per-
        // Servico prune / reconcile decisions off). Peer to
        // [`cluster_bundle_gitrepository_metadata_name_routes_through_caixa_nome_accessor`]
        // and
        // [`cluster_bundle_helmrelease_metadata_name_routes_through_caixa_nome_accessor`]
        // on the sibling per-CR emit-position pins.
        let caixa = sample_caixa();
        let opts = ClusterBundleOpts::for_caixa(&caixa, "rio");
        let files = cluster_bundle(&caixa, &opts).unwrap();
        let k = files
            .iter()
            .find(|f| f.path == std::path::PathBuf::from(FLUX_KUSTOMIZATION_YAML_FILENAME))
            .expect("kustomization.yaml present");
        let parsed: serde_yaml::Value =
            serde_yaml::from_str(&k.contents).expect("kustomization.yaml parses as YAML");
        let emitted = kube_metadata_str_field(&parsed, KUBE_KEY_NAME).expect(
            "kustomization.yaml `metadata.name` scalar present — drift here \
             silently splits the kustomize-controller-side per-Servico \
             Kustomization CR's prune / reconcile decisions from every peer \
             HelmRelease CR's paired identity",
        );
        assert_eq!(
            emitted,
            caixa.nome(),
            "kustomization.yaml `metadata.name` must derive from the typed \
             `caixa_core::Caixa::nome` accessor byte-for-byte — a regression \
             that re-inlines `caixa.nome.clone()` at the per-bundle \
             `let name` binding silently splits the kustomize-controller-\
             side per-Servico Kustomization CR's identity from every future \
             accessor extension (namespace-qualified rewrite, per-cluster \
             alias table, `:nome-suffix` overlay) that lands on the accessor",
        );
    }
}