elanous 0.2.43 → 0.2.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (706) hide show
  1. package/README.md +3 -3
  2. package/apps/pwa/out/404/index.html +1 -1
  3. package/apps/pwa/out/404.html +1 -1
  4. package/apps/pwa/out/_next/static/chunks/05181998.4f8efaf00572ba3b.js +122 -0
  5. package/apps/pwa/out/_next/static/chunks/1100-c0c1d80f649e121b.js +1 -0
  6. package/apps/pwa/out/_next/static/chunks/113.80a933f7c75c98f4.js +24 -0
  7. package/apps/pwa/out/_next/static/chunks/1170.2b91e0702fae25c2.js +1 -0
  8. package/apps/pwa/out/_next/static/chunks/120-0c4a26e7eedc1bb9.js +1 -0
  9. package/apps/pwa/out/_next/static/chunks/1279.d5c20b1a56b736bf.js +149 -0
  10. package/apps/pwa/out/_next/static/chunks/1372.9db49566ed0e4c02.js +104 -0
  11. package/apps/pwa/out/_next/static/chunks/{8062-7cd0bcc7f01455ba.js → 1395-be70dd3408dec106.js} +3 -3
  12. package/apps/pwa/out/_next/static/chunks/1449-4665277ec241284f.js +1 -0
  13. package/apps/pwa/out/_next/static/chunks/1473.ac3cee48c1d82bc6.js +1 -0
  14. package/apps/pwa/out/_next/static/chunks/1510.7b4ce4032d06097c.js +148 -0
  15. package/apps/pwa/out/_next/static/chunks/1575.33a2d7d2be3d23f9.js +1 -0
  16. package/apps/pwa/out/_next/static/chunks/1728-d9808a0d6be6aa40.js +1 -0
  17. package/apps/pwa/out/_next/static/chunks/{d96660fb.cbc21a2a88539dbb.js → 17673afb.ba8b2d0410a4be97.js} +7 -7
  18. package/apps/pwa/out/_next/static/chunks/{5824.da9527b15a3221e5.js → 2021.7d4dfac25daed3bc.js} +1 -1
  19. package/apps/pwa/out/_next/static/chunks/2128.368c63f8816ffc35.js +1 -0
  20. package/apps/pwa/out/_next/static/chunks/2272-2179b64be6512dcf.js +1 -0
  21. package/apps/pwa/out/_next/static/chunks/2282-7f396efa367b707d.js +1 -0
  22. package/apps/pwa/out/_next/static/chunks/{7900.096f455c7c1efc53.js → 2313.444bed0db65aadb0.js} +2 -2
  23. package/apps/pwa/out/_next/static/chunks/{2073-ba274e00e4f9efb4.js → 2408-017e04049c99038f.js} +1 -1
  24. package/apps/pwa/out/_next/static/chunks/2433.1108dd9eb7f009c0.js +1 -0
  25. package/apps/pwa/out/_next/static/chunks/2474-ce5b82a664d581f2.js +1 -0
  26. package/apps/pwa/out/_next/static/chunks/2532.376ea6de59f7c4f0.js +1 -0
  27. package/apps/pwa/out/_next/static/chunks/256.2a8e008d30947074.js +1 -0
  28. package/apps/pwa/out/_next/static/chunks/27.a383feedd4b99367.js +74 -0
  29. package/apps/pwa/out/_next/static/chunks/{6540.c7bef57ad8f90a87.js → 2767.71eaafcf158c9e24.js} +3 -3
  30. package/apps/pwa/out/_next/static/chunks/279-9a8b620470792271.js +1 -0
  31. package/apps/pwa/out/_next/static/chunks/{3113.d7472bbc27d580c7.js → 2791.6620db26a28b4ad4.js} +1 -1
  32. package/apps/pwa/out/_next/static/chunks/2831-6d9d315a32b98961.js +1 -0
  33. package/apps/pwa/out/_next/static/chunks/292.06ca375a02c7830b.js +1 -0
  34. package/apps/pwa/out/_next/static/chunks/2955-056d5f1facf64dd7.js +1 -0
  35. package/apps/pwa/out/_next/static/chunks/2979-9c9f85d058367133.js +1 -0
  36. package/apps/pwa/out/_next/static/chunks/2993.e25197cd7fb4e2e5.js +1 -0
  37. package/apps/pwa/out/_next/static/chunks/29a68040.431a2da0564d7724.js +1 -0
  38. package/apps/pwa/out/_next/static/chunks/{5930.8b4df3b46c32b05a.js → 3131.e7063655797e9743.js} +1 -1
  39. package/apps/pwa/out/_next/static/chunks/314-db68d7268a1f99aa.js +1 -0
  40. package/apps/pwa/out/_next/static/chunks/316.76984e210cf33c21.js +62 -0
  41. package/apps/pwa/out/_next/static/chunks/3255-80f60feecd5db880.js +1 -0
  42. package/apps/pwa/out/_next/static/chunks/3271.938bf60213f6cd17.js +8 -0
  43. package/apps/pwa/out/_next/static/chunks/3325-9699faf5a5294830.js +1 -0
  44. package/apps/pwa/out/_next/static/chunks/3418-f1ea6c6c710d5b94.js +1 -0
  45. package/apps/pwa/out/_next/static/chunks/342.050ac4b1738dfa5c.js +94 -0
  46. package/apps/pwa/out/_next/static/chunks/{9810-2543267050e58b82.js → 3545-5642d5df0667bcac.js} +1 -1
  47. package/apps/pwa/out/_next/static/chunks/3615-322e67bfc3b6907e.js +1 -0
  48. package/apps/pwa/out/_next/static/chunks/3805-5c39a4bf5012fe86.js +1 -0
  49. package/apps/pwa/out/_next/static/chunks/3892.b8cde90082048d8c.js +1 -0
  50. package/apps/pwa/out/_next/static/chunks/3900.b581090764d62bfb.js +1 -0
  51. package/apps/pwa/out/_next/static/chunks/3907.097fcec8956b021d.js +1 -0
  52. package/apps/pwa/out/_next/static/chunks/4110.8f14b59381558d7d.js +32 -0
  53. package/apps/pwa/out/_next/static/chunks/422.33fde3dd808ec96d.js +115 -0
  54. package/apps/pwa/out/_next/static/chunks/4512-11a489cb5444ef52.js +1 -0
  55. package/apps/pwa/out/_next/static/chunks/4537-2c8089e830054a19.js +1 -0
  56. package/apps/pwa/out/_next/static/chunks/{8967-7dfebf710c9dec9d.js → 4548-afc498c924849db3.js} +1 -1
  57. package/apps/pwa/out/_next/static/chunks/4588.3b7994fe28615549.js +23 -0
  58. package/apps/pwa/out/_next/static/chunks/4621-dcc3be02b7262bbe.js +1 -0
  59. package/apps/pwa/out/_next/static/chunks/4680-53705a02f53bd359.js +1 -0
  60. package/apps/pwa/out/_next/static/chunks/4705-16e4a3603923253d.js +1 -0
  61. package/apps/pwa/out/_next/static/chunks/4731.460c7a05f812951a.js +1 -0
  62. package/apps/pwa/out/_next/static/chunks/{3694.e0099884345f0198.js → 4818.6fdc817b8b12788a.js} +1 -1
  63. package/apps/pwa/out/_next/static/chunks/4875-dbc3d55494aa15bb.js +1 -0
  64. package/apps/pwa/out/_next/static/chunks/4890-100ef7fd2852528a.js +1 -0
  65. package/apps/pwa/out/_next/static/chunks/497.e875b212a877dc91.js +1 -0
  66. package/apps/pwa/out/_next/static/chunks/5106-1d9854b2e07d263b.js +1 -0
  67. package/apps/pwa/out/_next/static/chunks/{3091.a5a4143dea33d197.js → 5136.062e5b4ac043384f.js} +1 -1
  68. package/apps/pwa/out/_next/static/chunks/5190.7cb2cf1274606639.js +1 -0
  69. package/apps/pwa/out/_next/static/chunks/5290.80a8cd7d37adf0b4.js +1 -0
  70. package/apps/pwa/out/_next/static/chunks/543.67803b0449dc628e.js +1 -0
  71. package/apps/pwa/out/_next/static/chunks/5464-f8193c7ae973d9d1.js +1 -0
  72. package/apps/pwa/out/_next/static/chunks/5501.43770a36d11760e4.js +1 -0
  73. package/apps/pwa/out/_next/static/chunks/5672.2616c24baee6bb2f.js +34 -0
  74. package/apps/pwa/out/_next/static/chunks/5745-8a56d7701139e416.js +1 -0
  75. package/apps/pwa/out/_next/static/chunks/5757.eae58c9553985765.js +79 -0
  76. package/apps/pwa/out/_next/static/chunks/5848-9c1a3b9533bd0031.js +1 -0
  77. package/apps/pwa/out/_next/static/chunks/{8986.8e2e4efbfa655c59.js → 5987.3693cba0f39fc644.js} +1 -1
  78. package/apps/pwa/out/_next/static/chunks/{6944.309f4e3ea54d1537.js → 6006.3dcd594182d0cedb.js} +1 -1
  79. package/apps/pwa/out/_next/static/chunks/{aa57532f.510551854ff239b1.js → 607d4dc1.a4c4988d2c164d64.js} +1 -1
  80. package/apps/pwa/out/_next/static/chunks/6166-b2fc7231dee53e86.js +1 -0
  81. package/apps/pwa/out/_next/static/chunks/6250.7667f92b4d4465fb.js +1 -0
  82. package/apps/pwa/out/_next/static/chunks/{114.2b90424d1a3ce84c.js → 6293.4e33bcd25fa7fe80.js} +1 -1
  83. package/apps/pwa/out/_next/static/chunks/6312.11884f8b6fc01317.js +1 -0
  84. package/apps/pwa/out/_next/static/chunks/6329.cfe619f9146ddb60.js +287 -0
  85. package/apps/pwa/out/_next/static/chunks/6610-f0510f329e6c15e8.js +1 -0
  86. package/apps/pwa/out/_next/static/chunks/6840.046ad6790da728d9.js +1 -0
  87. package/apps/pwa/out/_next/static/chunks/6851.700470acf99ed58b.js +1 -0
  88. package/apps/pwa/out/_next/static/chunks/{0ad6802e.ae7afb63fdcb4491.js → 6c31d3a0.7f6d7568c2b7f9cc.js} +1 -1
  89. package/apps/pwa/out/_next/static/chunks/{5789.2da35c258292e1e5.js → 7134.373f7059f13a9ea9.js} +1 -1
  90. package/apps/pwa/out/_next/static/chunks/{1406.a1dc2ab6f8449374.js → 7216.dc82684f78870505.js} +2 -2
  91. package/apps/pwa/out/_next/static/chunks/{5564.9e72532188f57586.js → 7327.5bc587cdfbb7468b.js} +4 -4
  92. package/apps/pwa/out/_next/static/chunks/{8861-cc1fa1c7b920fa8e.js → 7340-55af4d0198f3c218.js} +1 -1
  93. package/apps/pwa/out/_next/static/chunks/7385.23cc541c89c2fa98.js +286 -0
  94. package/apps/pwa/out/_next/static/chunks/{5963-c4d8469c52a0828b.js → 7631-673b883cfbbcaed1.js} +1 -1
  95. package/apps/pwa/out/_next/static/chunks/7746.17ee8fc1f87b774f.js +1 -0
  96. package/apps/pwa/out/_next/static/chunks/{2573.387a707f6f9d720c.js → 7756.ba59333b9f5eb5b1.js} +2 -2
  97. package/apps/pwa/out/_next/static/chunks/7763.a7579952c4e6f1b4.js +1 -0
  98. package/apps/pwa/out/_next/static/chunks/8045.a714469921e805dd.js +1 -0
  99. package/apps/pwa/out/_next/static/chunks/{5394.5dabeb0c62293a28.js → 8073.57b55743909e9013.js} +2 -2
  100. package/apps/pwa/out/_next/static/chunks/8126.e5237d43a372cf65.js +1 -0
  101. package/apps/pwa/out/_next/static/chunks/81a72ea7-19d3ed13dbaabf14.js +1 -0
  102. package/apps/pwa/out/_next/static/chunks/8269-782b63932e10a2ae.js +1 -0
  103. package/apps/pwa/out/_next/static/chunks/8385-931a72cc6864b91f.js +1 -0
  104. package/apps/pwa/out/_next/static/chunks/8541-6801e6237710c920.js +1 -0
  105. package/apps/pwa/out/_next/static/chunks/8572.c425a14dcf1ffeb0.js +1 -0
  106. package/apps/pwa/out/_next/static/chunks/867-2d1e981b0167c29a.js +1 -0
  107. package/apps/pwa/out/_next/static/chunks/8723.ca926aacbbf3ac7f.js +1 -0
  108. package/apps/pwa/out/_next/static/chunks/8747.eeb006b94dad5759.js +41 -0
  109. package/apps/pwa/out/_next/static/chunks/895.5f73e50705fe1830.js +226 -0
  110. package/apps/pwa/out/_next/static/chunks/{5866.366966af47fdde5d.js → 8993.bbf6810d7afa70bf.js} +1 -1
  111. package/apps/pwa/out/_next/static/chunks/{c7945435-b44d4dbe90ba0dcb.js → 8f44ce90-05842a3e94de7716.js} +1 -1
  112. package/apps/pwa/out/_next/static/chunks/9066.629ebf156fcd2ab1.js +27 -0
  113. package/apps/pwa/out/_next/static/chunks/9133-06cf65777241d447.js +1 -0
  114. package/apps/pwa/out/_next/static/chunks/{3903.3ef4656c67572764.js → 9160.83b3cab34166c934.js} +1 -1
  115. package/apps/pwa/out/_next/static/chunks/{5628.6ddb2d5ffba4ff4c.js → 919.c8775745cc88225f.js} +4 -4
  116. package/apps/pwa/out/_next/static/chunks/{0966f8a1.745fcd44f64a87ea.js → 9270078e.402279bc985895b9.js} +1 -1
  117. package/apps/pwa/out/_next/static/chunks/9397.b3fbfb372280934a.js +1 -0
  118. package/apps/pwa/out/_next/static/chunks/{3402.44b565b314f2263c.js → 9605.c828819da413e8e0.js} +1 -1
  119. package/apps/pwa/out/_next/static/chunks/9635.f8d12ec73885ac29.js +1 -0
  120. package/apps/pwa/out/_next/static/chunks/{2144.25b292396712196d.js → 9695.d086738c907a0c2c.js} +2 -2
  121. package/apps/pwa/out/_next/static/chunks/{3072.01338851ca21a6f7.js → 9748.2866a5c59dbe980c.js} +2 -2
  122. package/apps/pwa/out/_next/static/chunks/9828.e6e68b558c521de6.js +24 -0
  123. package/apps/pwa/out/_next/static/chunks/{5154.5f56dc3902e3d275.js → 9893.7a7b6edae64e8ead.js} +2 -2
  124. package/apps/pwa/out/_next/static/chunks/9a51175e.fccb3ff43e50adbc.js +1 -0
  125. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-bedb21eab48baf18.js +1 -0
  126. package/apps/pwa/out/_next/static/chunks/app/approvals/page-07762315735dd0b2.js +1 -0
  127. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-03f85a9f0a258ea8.js +1 -0
  128. package/apps/pwa/out/_next/static/chunks/app/board/page-e845d6c10f91d76b.js +1 -0
  129. package/apps/pwa/out/_next/static/chunks/app/botlab/page-fb3631f9f3a50179.js +1 -0
  130. package/apps/pwa/out/_next/static/chunks/app/bots/page-00f6e3c7a80a9bce.js +1 -0
  131. package/apps/pwa/out/_next/static/chunks/app/ceo/page-971a0c0861b98018.js +1 -0
  132. package/apps/pwa/out/_next/static/chunks/app/chat/page-651d5b7636a46cf6.js +1 -0
  133. package/apps/pwa/out/_next/static/chunks/app/consult/page-d02ad543024d8341.js +1 -0
  134. package/apps/pwa/out/_next/static/chunks/app/control/page-bb376bd8355baae6.js +1 -0
  135. package/apps/pwa/out/_next/static/chunks/app/decisions/page-28c4bec75794d1bd.js +1 -0
  136. package/apps/pwa/out/_next/static/chunks/app/design-check/page-2123da599d50838a.js +1 -0
  137. package/apps/pwa/out/_next/static/chunks/app/editor/page-2955f93723dcc402.js +1 -0
  138. package/apps/pwa/out/_next/static/chunks/app/exec/page-9223ba698a2a0188.js +1 -0
  139. package/apps/pwa/out/_next/static/chunks/app/field/{page-6b8b4267bab0a677.js → page-e81094cf3567e2f2.js} +1 -1
  140. package/apps/pwa/out/_next/static/chunks/app/healthz/route-bedb21eab48baf18.js +1 -0
  141. package/apps/pwa/out/_next/static/chunks/app/inside/page-7d654302ac3b3a4e.js +1 -0
  142. package/apps/pwa/out/_next/static/chunks/app/intake/page-2bc02d4bee167db4.js +1 -0
  143. package/apps/pwa/out/_next/static/chunks/app/layout-617df2f350b6d863.js +1 -0
  144. package/apps/pwa/out/_next/static/chunks/app/live/{page-eff819f0c2d5e084.js → page-499ad36f9c8d105c.js} +1 -1
  145. package/apps/pwa/out/_next/static/chunks/app/live-run/page-09acff44586be1c2.js +1 -0
  146. package/apps/pwa/out/_next/static/chunks/app/loops/page-5c18c95a9bd1c524.js +1 -0
  147. package/apps/pwa/out/_next/static/chunks/app/market/page-b7e45df4c89eda9d.js +1 -0
  148. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-9bd9e634f324e2d8.js +1 -0
  149. package/apps/pwa/out/_next/static/chunks/app/morning/{page-9ee28f7df07428ea.js → page-895823d15c5776c7.js} +1 -1
  150. package/apps/pwa/out/_next/static/chunks/app/not-found-76d702791c75b6f5.js +1 -0
  151. package/apps/pwa/out/_next/static/chunks/app/observatory/page-89cdfe958d836563.js +1 -0
  152. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-65718fff9f43051d.js +1 -0
  153. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-f0d6a675eb513720.js +1 -0
  154. package/apps/pwa/out/_next/static/chunks/app/ops/resources/page-a0d5bffbf9203c00.js +1 -0
  155. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-9890ca9c1b120cf1.js +1 -0
  156. package/apps/pwa/out/_next/static/chunks/app/outputs/page-bb9cf5e9622532a0.js +1 -0
  157. package/apps/pwa/out/_next/static/chunks/app/page-44dfa774fa7c5533.js +1 -0
  158. package/apps/pwa/out/_next/static/chunks/app/reflection/page-93c8c51d77053d35.js +1 -0
  159. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-716bdba6d2ad3fcd.js +1 -0
  160. package/apps/pwa/out/_next/static/chunks/app/sessions/page-0f04eeda9894b67d.js +1 -0
  161. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-3835d43c61fa1af6.js +1 -0
  162. package/apps/pwa/out/_next/static/chunks/app/settings/page-41e8ba9c4feab48e.js +1 -0
  163. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-eedf8d31ba99ca9f.js +1 -0
  164. package/apps/pwa/out/_next/static/chunks/app/setup/layout-bedb21eab48baf18.js +1 -0
  165. package/apps/pwa/out/_next/static/chunks/app/setup/page-241ed1c971bfa1ac.js +1 -0
  166. package/apps/pwa/out/_next/static/chunks/app/share/page-93e2ce2a6e871642.js +1 -0
  167. package/apps/pwa/out/_next/static/chunks/app/showroom/page-561cf4fce14c622c.js +1 -0
  168. package/apps/pwa/out/_next/static/chunks/app/tasks/page-b71cab2d1ba15c2c.js +1 -0
  169. package/apps/pwa/out/_next/static/chunks/app/term/page-f86e352129f64ac6.js +1 -0
  170. package/apps/pwa/out/_next/static/chunks/app/today/page-5b0bd68768085bdb.js +1 -0
  171. package/apps/pwa/out/_next/static/chunks/app/trace/page-a6003c82802c5e93.js +1 -0
  172. package/apps/pwa/out/_next/static/chunks/app/vault/page-122887bd22818e86.js +1 -0
  173. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/{page-b4396321238798ec.js → page-a5e2267da13cac6d.js} +1 -1
  174. package/apps/pwa/out/_next/static/chunks/app/workflows/page-abac2741a74c7e0f.js +1 -0
  175. package/apps/pwa/out/_next/static/chunks/app/workspace/page-cc3091a30e35cbde.js +1 -0
  176. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-1b5ef5aad6c1eefc.js +1 -0
  177. package/apps/pwa/out/_next/static/chunks/{cb0f8df8.09a4a6be97e3fc5f.js → c0a97b40.42e62d6352afa9df.js} +1 -1
  178. package/apps/pwa/out/_next/static/chunks/{3557ac4a.c8931684475018ad.js → e866a15a.97493b74d66f48b3.js} +1 -1
  179. package/apps/pwa/out/_next/static/chunks/framework-52efbeade0c028ac.js +1 -0
  180. package/apps/pwa/out/_next/static/chunks/main-app-365b194cc7ba42f7.js +1 -0
  181. package/apps/pwa/out/_next/static/chunks/main-dc781b21621cd6de.js +1 -0
  182. package/apps/pwa/out/_next/static/chunks/pages/_app-c69e53f764eae97b.js +1 -0
  183. package/apps/pwa/out/_next/static/chunks/pages/_error-bd8106d7e595dfc3.js +1 -0
  184. package/apps/pwa/out/_next/static/chunks/webpack-e3f77df212a70fcb.js +1 -0
  185. package/apps/pwa/out/_next/static/css/700f225938e9488f.css +1 -0
  186. package/apps/pwa/out/_next/static/fMFwB4C7VwMRiuFGZdGVs/_buildManifest.js +1 -0
  187. package/apps/pwa/out/approvals/index.html +1 -1
  188. package/apps/pwa/out/approvals/index.txt +23 -23
  189. package/apps/pwa/out/autopilot/index.html +1 -1
  190. package/apps/pwa/out/autopilot/index.txt +23 -23
  191. package/apps/pwa/out/board/index.html +1 -1
  192. package/apps/pwa/out/board/index.txt +23 -23
  193. package/apps/pwa/out/botlab/index.html +1 -1
  194. package/apps/pwa/out/botlab/index.txt +22 -22
  195. package/apps/pwa/out/bots/index.html +1 -1
  196. package/apps/pwa/out/bots/index.txt +22 -22
  197. package/apps/pwa/out/ceo/index.html +1 -1
  198. package/apps/pwa/out/ceo/index.txt +23 -23
  199. package/apps/pwa/out/chat/index.html +1 -1
  200. package/apps/pwa/out/chat/index.txt +22 -22
  201. package/apps/pwa/out/consult/index.html +1 -1
  202. package/apps/pwa/out/consult/index.txt +23 -23
  203. package/apps/pwa/out/control/index.html +1 -1
  204. package/apps/pwa/out/control/index.txt +23 -23
  205. package/apps/pwa/out/decisions/index.html +1 -1
  206. package/apps/pwa/out/decisions/index.txt +22 -22
  207. package/apps/pwa/out/design-check/index.html +1 -1
  208. package/apps/pwa/out/design-check/index.txt +23 -23
  209. package/apps/pwa/out/editor/index.html +1 -1
  210. package/apps/pwa/out/editor/index.txt +23 -23
  211. package/apps/pwa/out/exec/index.html +1 -1
  212. package/apps/pwa/out/exec/index.txt +23 -23
  213. package/apps/pwa/out/field/index.html +1 -1
  214. package/apps/pwa/out/field/index.txt +23 -23
  215. package/apps/pwa/out/healthz +1 -1
  216. package/apps/pwa/out/index.html +1 -1
  217. package/apps/pwa/out/index.txt +22 -22
  218. package/apps/pwa/out/inside/index.html +1 -1
  219. package/apps/pwa/out/inside/index.txt +22 -22
  220. package/apps/pwa/out/intake/index.html +1 -1
  221. package/apps/pwa/out/intake/index.txt +23 -23
  222. package/apps/pwa/out/live/index.html +1 -1
  223. package/apps/pwa/out/live/index.txt +23 -23
  224. package/apps/pwa/out/live-run/index.html +1 -1
  225. package/apps/pwa/out/live-run/index.txt +23 -23
  226. package/apps/pwa/out/loops/index.html +1 -1
  227. package/apps/pwa/out/loops/index.txt +22 -22
  228. package/apps/pwa/out/market/index.html +1 -1
  229. package/apps/pwa/out/market/index.txt +22 -22
  230. package/apps/pwa/out/missions/placeholder/index.html +1 -1
  231. package/apps/pwa/out/missions/placeholder/index.txt +22 -22
  232. package/apps/pwa/out/morning/index.html +1 -1
  233. package/apps/pwa/out/morning/index.txt +23 -23
  234. package/apps/pwa/out/observatory/index.html +1 -1
  235. package/apps/pwa/out/observatory/index.txt +23 -23
  236. package/apps/pwa/out/ops/checklist/index.html +1 -1
  237. package/apps/pwa/out/ops/checklist/index.txt +22 -22
  238. package/apps/pwa/out/ops/release/index.html +1 -1
  239. package/apps/pwa/out/ops/release/index.txt +22 -22
  240. package/apps/pwa/out/ops/resources/index.html +1 -0
  241. package/apps/pwa/out/ops/resources/index.txt +30 -0
  242. package/apps/pwa/out/ops/seats/index.html +1 -1
  243. package/apps/pwa/out/ops/seats/index.txt +22 -22
  244. package/apps/pwa/out/outputs/index.html +1 -1
  245. package/apps/pwa/out/outputs/index.txt +22 -22
  246. package/apps/pwa/out/reflection/index.html +1 -1
  247. package/apps/pwa/out/reflection/index.txt +23 -23
  248. package/apps/pwa/out/scheduler/index.html +1 -1
  249. package/apps/pwa/out/scheduler/index.txt +23 -23
  250. package/apps/pwa/out/sessions/index.html +1 -1
  251. package/apps/pwa/out/sessions/index.txt +22 -22
  252. package/apps/pwa/out/settings/devices/index.html +1 -1
  253. package/apps/pwa/out/settings/devices/index.txt +23 -23
  254. package/apps/pwa/out/settings/index.html +1 -1
  255. package/apps/pwa/out/settings/index.txt +23 -23
  256. package/apps/pwa/out/setup/done/index.html +1 -1
  257. package/apps/pwa/out/setup/done/index.txt +23 -23
  258. package/apps/pwa/out/setup/index.html +1 -1
  259. package/apps/pwa/out/setup/index.txt +23 -23
  260. package/apps/pwa/out/share/index.html +1 -1
  261. package/apps/pwa/out/share/index.txt +23 -23
  262. package/apps/pwa/out/showroom/index.html +1 -1
  263. package/apps/pwa/out/showroom/index.txt +22 -22
  264. package/apps/pwa/out/tasks/index.html +1 -1
  265. package/apps/pwa/out/tasks/index.txt +23 -23
  266. package/apps/pwa/out/term/index.html +1 -1
  267. package/apps/pwa/out/term/index.txt +23 -23
  268. package/apps/pwa/out/today/index.html +1 -1
  269. package/apps/pwa/out/today/index.txt +23 -23
  270. package/apps/pwa/out/trace/index.html +1 -1
  271. package/apps/pwa/out/trace/index.txt +23 -23
  272. package/apps/pwa/out/vault/index.html +1 -1
  273. package/apps/pwa/out/vault/index.txt +23 -23
  274. package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
  275. package/apps/pwa/out/workflows/chat-ui/index.txt +23 -23
  276. package/apps/pwa/out/workflows/index.html +1 -1
  277. package/apps/pwa/out/workflows/index.txt +23 -23
  278. package/apps/pwa/out/workspace/index.html +1 -1
  279. package/apps/pwa/out/workspace/index.txt +23 -23
  280. package/apps/pwa/out/worktrees/index.html +1 -1
  281. package/apps/pwa/out/worktrees/index.txt +23 -23
  282. package/docs/goal-context/01-goal-authoring-checks.md +1 -0
  283. package/graphs/overlays/README.md +6 -0
  284. package/graphs/release/release-loop.yaml +33 -17
  285. package/graphs/steward/README.md +9 -0
  286. package/graphs/steward/entrance-dispatch-shadow.yaml +23 -0
  287. package/graphs/steward/recipes.yaml +3 -0
  288. package/graphs/units/verbs/make-doc.yaml +1 -0
  289. package/graphs/video/README.md +38 -0
  290. package/graphs/video/explainer-line.yaml +20 -7
  291. package/package.json +2 -1
  292. package/scripts/bench-metering-plan.ts +229 -0
  293. package/scripts/demo/demo1104-parallel-host.ts +56 -0
  294. package/scripts/demo/demo1104-parallel.ts +72 -0
  295. package/scripts/generate-ux-sim-device-manual.ts +21 -0
  296. package/scripts/intake-news.ts +10 -4
  297. package/scripts/intake-social.ts +10 -4
  298. package/scripts/lib/intake-check-cli.ts +15 -0
  299. package/scripts/measure-git-checkout-accel.ts +232 -0
  300. package/scripts/public-leak-baseline.txt +0 -1
  301. package/scripts/release-loop/docs-node.ts +4 -2
  302. package/scripts/release-loop/gate-baseline-receipt.ts +34 -3
  303. package/scripts/release-loop/gate-image-pin.ts +116 -2
  304. package/scripts/release-loop/gate-node-sim.ts +5 -1
  305. package/scripts/release-loop/gate-node.ts +633 -84
  306. package/scripts/release-loop/gate-progress-sim.ts +73 -0
  307. package/scripts/release-loop/gate-radius-live.ts +5 -4
  308. package/scripts/release-loop/gate-shard-dispatch.ts +99 -10
  309. package/scripts/release-loop/gate-shard-receipts.ts +81 -5
  310. package/scripts/release-loop/known-issues-node.ts +7 -2
  311. package/scripts/release-loop/node-verdict.ts +3 -1
  312. package/scripts/release-loop/notes-repair.ts +18 -1
  313. package/scripts/release-loop/preflight.ts +188 -8
  314. package/scripts/release-loop/render-warm-control-manifest.ts +22 -0
  315. package/scripts/release-loop/resume-release.ts +45 -12
  316. package/scripts/release-loop/resume.ts +93 -16
  317. package/scripts/release-loop/warm-control-forward.ts +178 -0
  318. package/scripts/retro-cycle.ts +30 -8
  319. package/scripts/rhythm/daily.ts +4 -1
  320. package/scripts/rhythm/linear-progress-sync.ts +28 -15
  321. package/scripts/sim-world-runner.ts +29 -0
  322. package/scripts/test-diet/node.ts +1 -1
  323. package/scripts/test-pod40-control-inbox-isolation.ts +39 -0
  324. package/scripts/ux-sim.ts +18 -1
  325. package/scripts/video-pipeline.ts +6 -1
  326. package/scripts/warm-pool-provider-config.ts +6 -1
  327. package/skills/explainer-video/engine/build.mjs +39 -2
  328. package/src/acp/core-turn-bridge.ts +30 -0
  329. package/src/agent/identity-env.ts +1 -0
  330. package/src/agent-mission/driver.ts +8 -5
  331. package/src/agent-mission/grok-auth-status.ts +119 -22
  332. package/src/agent-mission/mission-out.ts +2 -2
  333. package/src/agent-mission/resource-ladder.ts +11 -4
  334. package/src/agent-substrate/pr-reviewer.ts +211 -18
  335. package/src/agent-substrate/self-review-cli.ts +112 -39
  336. package/src/auto-research/question-ladder-contract.ts +2 -0
  337. package/src/auto-research/research-fanout.ts +221 -0
  338. package/src/auto-research/research-turn.ts +568 -47
  339. package/src/autopilot/mission-codebase-gate.ts +7 -3
  340. package/src/cli/config-test-sync.ts +6 -1
  341. package/src/cli/control-cli.ts +17 -6
  342. package/src/cli/decision-list-format.ts +9 -0
  343. package/src/cli/decision-list-since.ts +13 -0
  344. package/src/cli/decisions-cli.ts +84 -24
  345. package/src/cli/decisions-list-cli.ts +32 -0
  346. package/src/cli/doctor-cli.ts +2 -2
  347. package/src/cli/friendly-errors.ts +4 -0
  348. package/src/cli/intake-cli.ts +10 -5
  349. package/src/cli/light-entry-route.ts +25 -3
  350. package/src/cli/log-event-names.ts +8 -0
  351. package/src/cli/msg-cli.ts +5 -28
  352. package/src/cli/msg-list-cli.ts +73 -0
  353. package/src/cli/pr-cli.ts +42 -58
  354. package/src/cli/pr-land-options.ts +34 -0
  355. package/src/cli/provider-cli.ts +54 -0
  356. package/src/cli/pty-drive-cli.ts +25 -1
  357. package/src/cli/pty-takeover-cli.ts +9 -6
  358. package/src/cli/release-checklist-landed-cli.ts +273 -0
  359. package/src/cli/release-checklist-set-cli.ts +137 -0
  360. package/src/cli/release-checklist-write.ts +34 -0
  361. package/src/cli/release-cli.ts +8 -4
  362. package/src/cli/remote-eln-pty.ts +287 -0
  363. package/src/cli/resource-ledger-cli.ts +248 -0
  364. package/src/cli/runs-tree-cli.ts +256 -0
  365. package/src/cli/setup-cli.ts +42 -0
  366. package/src/cli/setup-keys.ts +100 -16
  367. package/src/cli/sim-cli.ts +89 -0
  368. package/src/cli/tasks-advance-cli.ts +185 -0
  369. package/src/cli/tasks-cli.ts +59 -92
  370. package/src/cli/tasks-read-cli.ts +32 -21
  371. package/src/cli/tui-test-cli.ts +159 -23
  372. package/src/compact/pipeline.ts +6 -1
  373. package/src/context-bus/nightly-condense.ts +8 -7
  374. package/src/control-plane/ledger.ts +42 -4
  375. package/src/control-plane/member-tokens.ts +25 -2
  376. package/src/control-plane/ports.ts +8 -3
  377. package/src/control-plane/server.ts +26 -5
  378. package/src/core-turn/research-policy.ts +7 -1
  379. package/src/core-turn/run-core-turn.ts +201 -48
  380. package/src/core-turn/types.ts +2 -0
  381. package/src/dashboard/acp-boot.ts +66 -10
  382. package/src/dashboard/classic-sidetab-mission-job.ts +129 -24
  383. package/src/dashboard/classic-sidetab-mission-pair.ts +3 -2
  384. package/src/dashboard/classic-sidetab-mission-trio.ts +125 -29
  385. package/src/dashboard/classic-sidetab-mission.ts +36 -17
  386. package/src/dashboard/index.ts +45 -35
  387. package/src/dashboard/sidetab-runtime.ts +2 -0
  388. package/src/dashboard/visible-mission-diagnostics.ts +14 -0
  389. package/src/decisions/decision-cards.ts +6 -1
  390. package/src/decisions/decision-ledger.ts +5 -0
  391. package/src/domains/retro-cycle-observation.ts +43 -0
  392. package/src/domains/retro-cycle.ts +13 -2
  393. package/src/domains/retro-proposals.ts +92 -0
  394. package/src/domains/retro-report.ts +6 -1
  395. package/src/error-report/report.ts +139 -4
  396. package/src/execution-loop/launch-gate.ts +115 -18
  397. package/src/fleet/host-doctor.ts +20 -20
  398. package/src/graph-runner/graph-cli.ts +27 -3
  399. package/src/graph-runner/graph-grow-llm.ts +3 -1
  400. package/src/graph-runner/runner.ts +241 -32
  401. package/src/grid/ssh-broker.ts +436 -0
  402. package/src/harness/browser-act.ts +11 -4
  403. package/src/harness/dispatch-backpressure.ts +111 -29
  404. package/src/harness/harness-cli-command.ts +40 -5
  405. package/src/harness/harness-pod-dispatch.ts +40 -1
  406. package/src/index.ts +156 -11
  407. package/src/light-cli.ts +52 -5
  408. package/src/llm/child-first-llm-observation.ts +112 -0
  409. package/src/llm/provider-credentials.ts +60 -4
  410. package/src/llm/provider-failure-evidence.ts +44 -0
  411. package/src/llm.ts +306 -32
  412. package/src/loops/orchestrator/tick.ts +29 -9
  413. package/src/maturity/feature-maturity.ts +2 -1
  414. package/src/mcp/client.ts +7 -0
  415. package/src/mcp/proxy-runtime.ts +6 -1
  416. package/src/mcp/server.ts +54 -0
  417. package/src/msg/msg-store.ts +5 -2
  418. package/src/native-tool-catalog.ts +15 -2
  419. package/src/nexus/api/consult-requests.ts +18 -6
  420. package/src/nexus/api/discord-trigger-bot.ts +6 -6
  421. package/src/nexus/api/graphs-api.ts +4 -2
  422. package/src/nexus/api/grokbot-trigger-bot.ts +206 -0
  423. package/src/nexus/api/http-server.ts +8 -0
  424. package/src/nexus/api/ops-api.ts +6 -0
  425. package/src/nexus/api/resource-guardian.ts +26 -0
  426. package/src/nexus/api/resource-ledger.ts +36 -0
  427. package/src/nexus/api/rest-route-paths.ts +3 -0
  428. package/src/nexus/api/telegram-trigger-bot.ts +6 -6
  429. package/src/nexus/api/ux-sim-devices.ts +36 -0
  430. package/src/nexus/boot/register-mcp-clients.ts +114 -8
  431. package/src/nexus/index.ts +15 -0
  432. package/src/nexus/outbound/grokbot-adapter.ts +71 -0
  433. package/src/nexus/outbound/router.ts +33 -13
  434. package/src/oauth/codex-owner-mirror.ts +47 -10
  435. package/src/oauth/codex-seat-home.ts +231 -0
  436. package/src/oauth/codex.ts +69 -16
  437. package/src/onboarding/first-run.ts +44 -6
  438. package/src/onboarding/web-first.ts +45 -14
  439. package/src/onboarding.ts +9 -0
  440. package/src/plugins/maker/wizard-generate.ts +13 -1
  441. package/src/preview/terminal.ts +22 -7
  442. package/src/prompt-enhance/enhance.ts +10 -0
  443. package/src/pty-shell/pty-manifest-query-cache.ts +18 -0
  444. package/src/pty-shell/pty-manifest.ts +76 -0
  445. package/src/pty-shell/pty-write-provenance.ts +21 -3
  446. package/src/pty-shell/registry.ts +9 -2
  447. package/src/pty-shell/remote-eln-inventory.ts +88 -0
  448. package/src/release-loop/gate-host-reservation.ts +5 -3
  449. package/src/release-loop/gate-shard-ledger.ts +2 -0
  450. package/src/release-loop/placement.ts +18 -8
  451. package/src/release-loop/proposal-auto-place.ts +83 -0
  452. package/src/release-loop/rehearsal.ts +86 -11
  453. package/src/release-loop/release-note.ts +84 -0
  454. package/src/release-loop/stage-mail.ts +71 -0
  455. package/src/research/axis-fanout.ts +107 -22
  456. package/src/research/entity-status-table.ts +305 -0
  457. package/src/research/evidence-attribution.ts +48 -0
  458. package/src/research/gap-followup.ts +6 -1
  459. package/src/research/lenses/second-order.ts +312 -0
  460. package/src/resource-ledger/guardian-reconcile.ts +172 -0
  461. package/src/resource-ledger/lease-automation.ts +112 -0
  462. package/src/resource-ledger/lease-heartbeat-worker.ts +169 -0
  463. package/src/resource-ledger/resource-ledger.ts +253 -0
  464. package/src/seat-loop/seat-loop.ts +2 -1
  465. package/src/self-dev/dev-cli.ts +3 -1
  466. package/src/self-dev/dev-pipeline.ts +67 -6
  467. package/src/self-dev/draft-sweep.ts +31 -10
  468. package/src/self-dev/draft-triage-rules.ts +60 -3
  469. package/src/self-dev/orchestrate-parent-dispatch.ts +44 -0
  470. package/src/self-dev/review-provider-fallback.ts +108 -10
  471. package/src/self-dev/run-supervisor.ts +152 -2
  472. package/src/self-implement/goal-author.ts +420 -30
  473. package/src/self-implement/graph-overlay-yaml.ts +151 -0
  474. package/src/self-implement/graph-yaml.ts +68 -2
  475. package/src/self-implement/orchestrator.ts +234 -59
  476. package/src/self-implement/pod-warm-pool-profile.ts +3 -0
  477. package/src/self-implement/seams.ts +42 -1
  478. package/src/self-implement/test-scenario-request.ts +37 -6
  479. package/src/session/chat.ts +2 -2
  480. package/src/session/index.ts +34 -0
  481. package/src/session/request-size-guard.ts +7 -7
  482. package/src/session-runtime/index.ts +37 -5
  483. package/src/session-runtime/search-processor.ts +5 -2
  484. package/src/sidetab-core/model.ts +213 -15
  485. package/src/sidetab-core/visible-agent-mission-pair.ts +51 -0
  486. package/src/sidetab-core/visible-agent-mission.ts +207 -60
  487. package/src/skills/tools/omni-search.ts +4 -2
  488. package/src/skills/tools/shell.ts +7 -4
  489. package/src/steward/entrance-dispatch-shadow-adapter-child.ts +26 -0
  490. package/src/steward/entrance-dispatch-shadow-adapter.ts +196 -0
  491. package/src/steward/entrance-dispatch-shadow.ts +318 -0
  492. package/src/storage/short-lived-read-cache.ts +119 -0
  493. package/src/task-agent/card-evidence.ts +2 -1
  494. package/src/task-agent/entrance-shadow.ts +178 -0
  495. package/src/task-agent/mission.ts +9 -19
  496. package/src/task-agent/parent-host.ts +93 -5
  497. package/src/task-agent/recall-inject.ts +98 -0
  498. package/src/task-agent/repair-cycle.ts +75 -1
  499. package/src/task-agent/task-card-state.ts +161 -0
  500. package/src/task-agent/task-hand.ts +66 -147
  501. package/src/task-agent/work-order-build.ts +22 -1
  502. package/src/task-orchestrator/surfaces/gate-pod-pool-policy.ts +161 -0
  503. package/src/task-orchestrator/surfaces/pod-artifact-return.ts +19 -1
  504. package/src/task-orchestrator/surfaces/pod-failure-reason.ts +15 -0
  505. package/src/task-orchestrator/surfaces/pod-si-warm-host.ts +21 -9
  506. package/src/task-orchestrator/surfaces/pod-warm-worker-pod.ts +1 -1
  507. package/src/task-orchestrator/surfaces/pod-warm-worker-provider.ts +490 -100
  508. package/src/task-orchestrator/surfaces/pod-warm-worker-runtime.ts +45 -3
  509. package/src/task-orchestrator/surfaces/self-implement-pod.ts +38 -8
  510. package/src/task-orchestrator/surfaces/warm-reuse-evidence.ts +61 -0
  511. package/src/tool-hints/gate.ts +45 -14
  512. package/src/tool-hints/signals.ts +1 -1
  513. package/src/tool-hints/types.ts +2 -0
  514. package/src/tool-runtime/browser-hand-runtime.ts +51 -11
  515. package/src/tool-runtime/browser-runtime.ts +31 -18
  516. package/src/tool-runtime/elanous-control-runtimes.ts +5 -2
  517. package/src/tool-runtime/elanous-linear-secretary-runtime.ts +152 -36
  518. package/src/tool-runtime/elanous-ux-sim-devices-runtime.ts +43 -0
  519. package/src/tool-runtime/index.ts +2 -0
  520. package/src/tool-runtime/types.ts +2 -0
  521. package/src/tui/entry.ts +55 -8
  522. package/src/tui/sidetab/attach.ts +324 -34
  523. package/src/tui/sidetab/list.ts +3 -2
  524. package/src/tui/sidetab/remote.ts +89 -0
  525. package/src/tui-client/dashboard-session.ts +2 -0
  526. package/src/tui-client/next-dashboard-runtime.ts +52 -0
  527. package/src/user-config.ts +3 -1
  528. package/src/ux-sim/author-reviewer-precheck-device.ts +78 -0
  529. package/src/ux-sim/codex-wire-capture.ts +26 -0
  530. package/src/ux-sim/draft-inventory-builder.ts +2 -1
  531. package/src/ux-sim/event-monkey.ts +20 -2
  532. package/src/ux-sim/fake-bin.ts +72 -1
  533. package/src/ux-sim/fake-cloud-vm.ts +227 -0
  534. package/src/ux-sim/fake-fleet.ts +123 -0
  535. package/src/ux-sim/fake-kubectl.ts +21 -6
  536. package/src/ux-sim/fake-llm.ts +14 -1
  537. package/src/ux-sim/fake-ssh.ts +125 -0
  538. package/src/ux-sim/fake-telegram-video.ts +54 -0
  539. package/src/ux-sim/fixtures/git-worktree-accel-linux.json +239 -0
  540. package/src/ux-sim/gate-shard-host-reroute.ts +7 -3
  541. package/src/ux-sim/graph-runtime-overlay-event-path-worker.ts +54 -0
  542. package/src/ux-sim/graph-runtime-overlay-event-path.ts +80 -0
  543. package/src/ux-sim/grid-chaos-driver.ts +198 -0
  544. package/src/ux-sim/grid-ledger.ts +259 -0
  545. package/src/ux-sim/grid-ready-tiers.ts +253 -0
  546. package/src/ux-sim/heal-reauthor-materialized.ts +115 -0
  547. package/src/ux-sim/linear-secretary.ts +4 -12
  548. package/src/ux-sim/mock-scenario-catalog.json +63 -32
  549. package/src/ux-sim/mock-scenario-catalog.ts +112 -7
  550. package/src/ux-sim/release-sim-rig.ts +63 -18
  551. package/src/ux-sim/research-decision-chain.ts +220 -0
  552. package/src/ux-sim/safe-public-copy-publish.ts +89 -0
  553. package/src/ux-sim/scenario.ts +107 -14
  554. package/src/ux-sim/seminar-rehearsal.ts +108 -0
  555. package/src/ux-sim/service-key-setup.ts +63 -0
  556. package/src/ux-sim/warm-pool-reuse-sim.ts +183 -0
  557. package/src/ux-sim/world-schema.ts +216 -0
  558. package/src/ux-sim/world-store.ts +328 -0
  559. package/src/ux-sim/world.ts +524 -0
  560. package/src/version/packed-revision.json +1 -1
  561. package/src/video-pipeline/recipes/explainer.ts +237 -10
  562. package/src/video-pipeline/telegram-video-sender.ts +47 -0
  563. package/apps/pwa/out/_next/static/Om5xS9jpjSXJCeTNGYEi4/_buildManifest.js +0 -1
  564. package/apps/pwa/out/_next/static/chunks/1151-5c2bb8f002ca2dd6.js +0 -1
  565. package/apps/pwa/out/_next/static/chunks/1200.6a37c202f9f17e9a.js +0 -226
  566. package/apps/pwa/out/_next/static/chunks/1261-a616d5728e02e624.js +0 -1
  567. package/apps/pwa/out/_next/static/chunks/1313-19f737e0222c4444.js +0 -1
  568. package/apps/pwa/out/_next/static/chunks/1357.3bbef3976c37f94a.js +0 -1
  569. package/apps/pwa/out/_next/static/chunks/1362-20adddfaf662b0fa.js +0 -1
  570. package/apps/pwa/out/_next/static/chunks/1737-9491fc6ab29b9ec6.js +0 -1
  571. package/apps/pwa/out/_next/static/chunks/1803-4f91a8e7dcaf042c.js +0 -1
  572. package/apps/pwa/out/_next/static/chunks/1961.a81b12872c3e93a9.js +0 -23
  573. package/apps/pwa/out/_next/static/chunks/1970cf59.2d4d8ce5d6c81853.js +0 -1
  574. package/apps/pwa/out/_next/static/chunks/1971-8890f3962ba7ee0a.js +0 -1
  575. package/apps/pwa/out/_next/static/chunks/2268-53861f339e0b65a2.js +0 -1
  576. package/apps/pwa/out/_next/static/chunks/2312.0c8b61e22d3136d7.js +0 -1
  577. package/apps/pwa/out/_next/static/chunks/273.f156eee28f11af77.js +0 -1
  578. package/apps/pwa/out/_next/static/chunks/2873.d2140e5a82546401.js +0 -1
  579. package/apps/pwa/out/_next/static/chunks/3095.dc44586a5f83b86d.js +0 -1
  580. package/apps/pwa/out/_next/static/chunks/3228-9650b6447b6fa288.js +0 -1
  581. package/apps/pwa/out/_next/static/chunks/360.ae9f9f4c33c395e8.js +0 -79
  582. package/apps/pwa/out/_next/static/chunks/3638.80412ea63aae8f3f.js +0 -286
  583. package/apps/pwa/out/_next/static/chunks/363bfab3.9623b9f89363541f.js +0 -1
  584. package/apps/pwa/out/_next/static/chunks/3744.54f87db52acfd1ab.js +0 -1
  585. package/apps/pwa/out/_next/static/chunks/3935.16701e33f8982dc9.js +0 -1
  586. package/apps/pwa/out/_next/static/chunks/3955.6922286237f2ac2b.js +0 -24
  587. package/apps/pwa/out/_next/static/chunks/3969.272ee7f9fd6c62e5.js +0 -34
  588. package/apps/pwa/out/_next/static/chunks/4199.ce86b281fd0a60b7.js +0 -1
  589. package/apps/pwa/out/_next/static/chunks/4311-6dd3144002cc0c2d.js +0 -1
  590. package/apps/pwa/out/_next/static/chunks/4426-2b230fad00c88930.js +0 -1
  591. package/apps/pwa/out/_next/static/chunks/4445.7990c76b3751a918.js +0 -115
  592. package/apps/pwa/out/_next/static/chunks/4447-14c5161fa59166c7.js +0 -1
  593. package/apps/pwa/out/_next/static/chunks/4856-b0b8075bba8c53f4.js +0 -1
  594. package/apps/pwa/out/_next/static/chunks/4870-de370d65e73c0bb5.js +0 -1
  595. package/apps/pwa/out/_next/static/chunks/4885-2c989165c4b29fad.js +0 -1
  596. package/apps/pwa/out/_next/static/chunks/4894.fec2ca9e99caefa2.js +0 -1
  597. package/apps/pwa/out/_next/static/chunks/5093.8f04b7f8cb899a95.js +0 -94
  598. package/apps/pwa/out/_next/static/chunks/5122-2bb177cebf89e19a.js +0 -1
  599. package/apps/pwa/out/_next/static/chunks/529.64ff7257180b2ac9.js +0 -1
  600. package/apps/pwa/out/_next/static/chunks/5461.08bf2404ff38ec85.js +0 -1
  601. package/apps/pwa/out/_next/static/chunks/5474-22e08a85583209b2.js +0 -1
  602. package/apps/pwa/out/_next/static/chunks/5567-265df39ed8fe9dcb.js +0 -1
  603. package/apps/pwa/out/_next/static/chunks/5570-a94ae19811cb2046.js +0 -1
  604. package/apps/pwa/out/_next/static/chunks/5574-b47c9ef2dceff1fd.js +0 -1
  605. package/apps/pwa/out/_next/static/chunks/5730.43d7ccc09988e646.js +0 -1
  606. package/apps/pwa/out/_next/static/chunks/6001.ec4049ceb3c43418.js +0 -27
  607. package/apps/pwa/out/_next/static/chunks/6120-471f03db1e299c0c.js +0 -1
  608. package/apps/pwa/out/_next/static/chunks/6175-41479e643aca1878.js +0 -1
  609. package/apps/pwa/out/_next/static/chunks/6291.a2de4f9787637075.js +0 -104
  610. package/apps/pwa/out/_next/static/chunks/6400-6699907c3537436a.js +0 -1
  611. package/apps/pwa/out/_next/static/chunks/6428.1f4327d6ae5fdf9a.js +0 -287
  612. package/apps/pwa/out/_next/static/chunks/644.02cb026fa44bcd0a.js +0 -1
  613. package/apps/pwa/out/_next/static/chunks/6466-6c87d60d3dd174fb.js +0 -1
  614. package/apps/pwa/out/_next/static/chunks/6773.d4264665ab31bec0.js +0 -1
  615. package/apps/pwa/out/_next/static/chunks/6822.3c789f1a8443e774.js +0 -1
  616. package/apps/pwa/out/_next/static/chunks/7261-8ff69d3b2ee671fd.js +0 -1
  617. package/apps/pwa/out/_next/static/chunks/7266.084c6bbc70035140.js +0 -1
  618. package/apps/pwa/out/_next/static/chunks/7271.5c0100e7320aa856.js +0 -1
  619. package/apps/pwa/out/_next/static/chunks/7429-bf5731358c8f2f68.js +0 -1
  620. package/apps/pwa/out/_next/static/chunks/7464.01f7a0ae1215fbe7.js +0 -1
  621. package/apps/pwa/out/_next/static/chunks/7479.0fcad5f37eb64f0c.js +0 -1
  622. package/apps/pwa/out/_next/static/chunks/7483.427a2fe2049e388d.js +0 -148
  623. package/apps/pwa/out/_next/static/chunks/7502-be74718178e13e56.js +0 -1
  624. package/apps/pwa/out/_next/static/chunks/7530.0889722b19572065.js +0 -24
  625. package/apps/pwa/out/_next/static/chunks/7645.5b2ee3ad45c55ea3.js +0 -1
  626. package/apps/pwa/out/_next/static/chunks/7788.7d1c79f1a8e18946.js +0 -1
  627. package/apps/pwa/out/_next/static/chunks/7910-6f139bcafd238b9f.js +0 -1
  628. package/apps/pwa/out/_next/static/chunks/7966.f71c8958d1637548.js +0 -1
  629. package/apps/pwa/out/_next/static/chunks/8073.f6cf2f2c71aafbd0.js +0 -1
  630. package/apps/pwa/out/_next/static/chunks/8201.190b94088980f430.js +0 -74
  631. package/apps/pwa/out/_next/static/chunks/8205.282ca4bb62d54a0a.js +0 -62
  632. package/apps/pwa/out/_next/static/chunks/8313-dfa1021bb58a46d6.js +0 -1
  633. package/apps/pwa/out/_next/static/chunks/837-81336ebaca8198a8.js +0 -1
  634. package/apps/pwa/out/_next/static/chunks/8447.7963352ef5f71b76.js +0 -1
  635. package/apps/pwa/out/_next/static/chunks/8574-868e8129525ef6d9.js +0 -1
  636. package/apps/pwa/out/_next/static/chunks/8588.d1c6a2903727ce87.js +0 -149
  637. package/apps/pwa/out/_next/static/chunks/8637.90f92d5c8db4732c.js +0 -1
  638. package/apps/pwa/out/_next/static/chunks/868.6e953be05bcf6dca.js +0 -41
  639. package/apps/pwa/out/_next/static/chunks/8706-e1fe0309343a2273.js +0 -1
  640. package/apps/pwa/out/_next/static/chunks/8749-06384cdfc4520add.js +0 -1
  641. package/apps/pwa/out/_next/static/chunks/8997-3c564dbb3b58b055.js +0 -1
  642. package/apps/pwa/out/_next/static/chunks/923.2034d10ae91e9c20.js +0 -1
  643. package/apps/pwa/out/_next/static/chunks/9312.bc1b89c5d4368033.js +0 -1
  644. package/apps/pwa/out/_next/static/chunks/943.39ae5e82f4f1893f.js +0 -1
  645. package/apps/pwa/out/_next/static/chunks/9469.0500480de55fb205.js +0 -32
  646. package/apps/pwa/out/_next/static/chunks/9770.5f75bc6088b16109.js +0 -1
  647. package/apps/pwa/out/_next/static/chunks/9870.8419702475254745.js +0 -8
  648. package/apps/pwa/out/_next/static/chunks/9941-376d1b74d51b01a4.js +0 -1
  649. package/apps/pwa/out/_next/static/chunks/9958.385434ab04241758.js +0 -1
  650. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-deea1450b17cb8dc.js +0 -1
  651. package/apps/pwa/out/_next/static/chunks/app/approvals/page-70985b904f8650ef.js +0 -1
  652. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-a2e15e33e56a4353.js +0 -1
  653. package/apps/pwa/out/_next/static/chunks/app/board/page-fc72ce2db12d6ca9.js +0 -1
  654. package/apps/pwa/out/_next/static/chunks/app/botlab/page-be03e41f9436ebd9.js +0 -1
  655. package/apps/pwa/out/_next/static/chunks/app/bots/page-35a35999382da3f2.js +0 -1
  656. package/apps/pwa/out/_next/static/chunks/app/ceo/page-3ff5b1e6ca88b848.js +0 -1
  657. package/apps/pwa/out/_next/static/chunks/app/chat/page-a65101300a0ee5c1.js +0 -1
  658. package/apps/pwa/out/_next/static/chunks/app/consult/page-3aca5b6d67dba511.js +0 -1
  659. package/apps/pwa/out/_next/static/chunks/app/control/page-45b8ab0a71e61314.js +0 -1
  660. package/apps/pwa/out/_next/static/chunks/app/decisions/page-53046e282d4cda8e.js +0 -1
  661. package/apps/pwa/out/_next/static/chunks/app/design-check/page-17809e60e8354c17.js +0 -1
  662. package/apps/pwa/out/_next/static/chunks/app/editor/page-fd2442d347bf5898.js +0 -1
  663. package/apps/pwa/out/_next/static/chunks/app/exec/page-e9d720d6fc082e21.js +0 -1
  664. package/apps/pwa/out/_next/static/chunks/app/healthz/route-deea1450b17cb8dc.js +0 -1
  665. package/apps/pwa/out/_next/static/chunks/app/inside/page-8bcf6233ac7c17af.js +0 -1
  666. package/apps/pwa/out/_next/static/chunks/app/intake/page-7cc25591cfc2126f.js +0 -1
  667. package/apps/pwa/out/_next/static/chunks/app/layout-053e871f35c9beba.js +0 -1
  668. package/apps/pwa/out/_next/static/chunks/app/live-run/page-4d7e9d8db5274a87.js +0 -1
  669. package/apps/pwa/out/_next/static/chunks/app/loops/page-2b2d8f5aa5f69ad4.js +0 -1
  670. package/apps/pwa/out/_next/static/chunks/app/market/page-0b8f92c5062e68b1.js +0 -1
  671. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-1bd9d0fdac2ced3d.js +0 -1
  672. package/apps/pwa/out/_next/static/chunks/app/not-found-44b7a1ff468c6648.js +0 -1
  673. package/apps/pwa/out/_next/static/chunks/app/observatory/page-cbc6523711dc1b65.js +0 -1
  674. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-fdad47899c2695be.js +0 -1
  675. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-79a8b5fee4c20871.js +0 -1
  676. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-03e8ac9606aeaffb.js +0 -1
  677. package/apps/pwa/out/_next/static/chunks/app/outputs/page-4cd55c55ec287e2f.js +0 -1
  678. package/apps/pwa/out/_next/static/chunks/app/page-db17b4305404161e.js +0 -1
  679. package/apps/pwa/out/_next/static/chunks/app/reflection/page-30041d848350fd02.js +0 -1
  680. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-c540da022dbf86b0.js +0 -1
  681. package/apps/pwa/out/_next/static/chunks/app/sessions/page-9399efc538da057f.js +0 -1
  682. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-ca2d09128c585ca4.js +0 -1
  683. package/apps/pwa/out/_next/static/chunks/app/settings/page-0e2635aecd343038.js +0 -1
  684. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-ef7f4399b6b7726e.js +0 -1
  685. package/apps/pwa/out/_next/static/chunks/app/setup/layout-deea1450b17cb8dc.js +0 -1
  686. package/apps/pwa/out/_next/static/chunks/app/setup/page-caf530535b875468.js +0 -1
  687. package/apps/pwa/out/_next/static/chunks/app/share/page-eaa20c1543a5fd8e.js +0 -1
  688. package/apps/pwa/out/_next/static/chunks/app/showroom/page-c541eb1b75120f61.js +0 -1
  689. package/apps/pwa/out/_next/static/chunks/app/tasks/page-ab5e213eda9479f4.js +0 -1
  690. package/apps/pwa/out/_next/static/chunks/app/term/page-0a815f34367b6db6.js +0 -1
  691. package/apps/pwa/out/_next/static/chunks/app/today/page-e858ba0ed9393b68.js +0 -1
  692. package/apps/pwa/out/_next/static/chunks/app/trace/page-1638ee9dd6e0582f.js +0 -1
  693. package/apps/pwa/out/_next/static/chunks/app/vault/page-4cf5a399109391f2.js +0 -1
  694. package/apps/pwa/out/_next/static/chunks/app/workflows/page-cb72bfd21006781a.js +0 -1
  695. package/apps/pwa/out/_next/static/chunks/app/workspace/page-6135d0242afbc434.js +0 -1
  696. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-a1dccf907eddb856.js +0 -1
  697. package/apps/pwa/out/_next/static/chunks/ea514caa.05a24f78d9dffe5f.js +0 -122
  698. package/apps/pwa/out/_next/static/chunks/fb7d20d5-6892502b6ee39ca6.js +0 -1
  699. package/apps/pwa/out/_next/static/chunks/framework-e8a911e19b1be41f.js +0 -1
  700. package/apps/pwa/out/_next/static/chunks/main-7022f418fabba021.js +0 -1
  701. package/apps/pwa/out/_next/static/chunks/main-app-e5f15df755756a1e.js +0 -1
  702. package/apps/pwa/out/_next/static/chunks/pages/_app-4525f91e36940c9b.js +0 -1
  703. package/apps/pwa/out/_next/static/chunks/pages/_error-140f0e519c085b0f.js +0 -1
  704. package/apps/pwa/out/_next/static/chunks/webpack-8f22ef63dcb865b1.js +0 -1
  705. package/apps/pwa/out/_next/static/css/d1f8bb401740a549.css +0 -1
  706. /package/apps/pwa/out/_next/static/{Om5xS9jpjSXJCeTNGYEi4 → fMFwB4C7VwMRiuFGZdGVs}/_ssgManifest.js +0 -0
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env bun
2
2
  import { spawn, spawnSync } from 'node:child_process';
3
- import { appendFileSync, chmodSync, copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
3
+ import { appendFileSync, chmodSync, copyFileSync, existsSync, mkdirSync, readdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
4
4
  import { hostname, tmpdir } from 'node:os';
5
5
  import { createHash, randomUUID } from 'node:crypto';
6
- import { basename, dirname, join, resolve } from 'node:path';
6
+ import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
7
7
  import { debug, redactSecretText } from '../../src/debug/log.js';
8
8
  import { registerStandaloneLogSink } from '../../src/domains/standalone-log-sink.js';
9
9
  import { landingFreezeMessage, readLandingFreeze } from '../../src/release-loop/landing-freeze.js';
@@ -15,12 +15,14 @@ import { loadGateBatchSafe } from './gate-batch-safe';
15
15
  import { observeGatePrewarmCutShadow, type GatePrewarmInput } from './gate-prewarm-plan.js';
16
16
  import { gateHistory } from './gate-history.js';
17
17
  import { baselineFromCutLogs } from './baseline-from-logs';
18
- import { mergePartialFailures, readPartialPlanResult, testFileOfId, verifyDocsOnlyCarry } from './gate-partial';
18
+ import { changedFilesBetween, mergePartialFailures, readPartialPlanResult, testFileOfId, verifyDocsOnlyCarry } from './gate-partial';
19
19
  import { planGateRadiusShadow, shadowActual, writeGateRadiusShadow, type GateRadiusShadowPlan } from './gate-radius-shadow';
20
20
  import { planHardRehearsalRadius, partialGateImagesMatch, preflightGateExecutionIdentity, preflightGateImageDigest } from './gate-radius-live';
21
- import { actualGatePodImageDigest, gateBaselineReceipt, gateEnvFingerprint, gateGraphPins, gateSourcePins, parseGatePodRuntimeIdentity,
22
- POD_SWEEP_INTEGRATION_ONLY } from './gate-baseline-receipt';
23
- import { gateImagePinPath, readGateImagePin, resolveGateImagePin, writeGateImagePin } from './gate-image-pin.js';
21
+ import { gitClosureTree, testsReachingChanged } from './gate-closure.js';
22
+ import { actualGatePodImageDigest, gateBaselineReceipt, gateEnvFingerprint, gateGraphPins, gateShardRecipeIdentityAtCommit, gateSourcePins, parseGatePodRuntimeIdentity,
23
+ POD_SWEEP_INTEGRATION_ONLY, gateAssignableTestsAtCommit } from './gate-baseline-receipt';
24
+ import { gateImagePinPath, normalizeGateImageDigest, pinnedGateImageSync as buildPinnedGateImageSync, readGateImagePin,
25
+ readGateImagePinForRun, replaceGateImagePin, resolveGateImagePin, writeGateImagePin } from './gate-image-pin.js';
24
26
  import { gateReceiptRegistryPath, planGateTrainReceiptCarry } from './gate-train-receipts.js';
25
27
  import { gateEnvFingerprint as gateReceiptEnvFingerprint, gateLockfileHash } from '../../src/self-implement/gate-receipt-registry.js';
26
28
  import { SPAWN_SYNC_MAX_BUFFER } from '../../src/util/spawn-sync-output.js';
@@ -36,25 +38,29 @@ import { emitNodeResult, readGraphContext } from './node-verdict.js';
36
38
  import { isGateExecutor, type GateExecutor } from './gate-executor.js';
37
39
  import { runPodCommand, parsePodCpu, podCpuMillis, resolvePodCpu, podCommandImageFor, type RunPodCommandOptions, type PodCommandResult, type PodCpu } from '../../src/task-orchestrator/surfaces/pod-command-job.js';
38
40
  import { POD_BUN_CACHE_HOST_PATH, parseInstallSeconds, podBunCacheVolume } from '../../src/task-orchestrator/surfaces/pod-bun-cache.js';
39
- import { PodPoolScheduler, parsePodPool, checkPodPool, defaultRemoteRun, snapshotWarmPoolMembers, type PodPoolMember } from '../../src/task-orchestrator/surfaces/pod-pool.js';
41
+ import { NODE_REGISTRY, PodPoolScheduler, parsePodPool, checkPodPool, defaultRemoteRun, snapshotWarmPoolMembers, syncPoolImages, type PodPoolMember } from '../../src/task-orchestrator/surfaces/pod-pool.js';
40
42
  import { POD_INSTALL_SLOTS_DEFAULT, POD_INSTALL_SLOTS_HOST_PATH, installSlotScript } from '../../src/task-orchestrator/surfaces/pod-install-slots.js';
41
43
  import { gateDepsInstallScript, parseGateDeps } from '../../src/task-orchestrator/surfaces/pod-gate-deps.js';
42
44
  import { warmReferenceFromJobArtifacts, writeWarmJobManifest } from './gate-warm-artifacts.js';
43
45
  import { assessWarmWorkerShadow, parseWarmWorkerReply, type WarmWorkerCommand, type WarmWorkerFileResult, type WarmWorkerKey } from '../../src/task-orchestrator/surfaces/pod-warm-worker-protocol.js';
44
46
  import type { WarmPodTransportResult } from '../../src/task-orchestrator/surfaces/pod-warm-worker-pod.js';
45
- import { requestWarmPodReplay, finalizeWarmPodReplay, quarantineWarmPodReplay, type WarmReplayResult } from '../../src/task-orchestrator/surfaces/pod-warm-worker-provider.js';
47
+ import { configureWarmPodProvider, loadWarmPodProvider, requestWarmPodReplay, finalizeWarmPodReplay, quarantineWarmPodReplay, type WarmReplayInput, type WarmReplayResult } from '../../src/task-orchestrator/surfaces/pod-warm-worker-provider.js';
48
+ import { DEFAULT_CONTROL_PORT } from '../../src/control-plane/server.js';
49
+ import { createRunScopedWarmControlForward, startWarmControlPortForward } from './warm-control-forward.js';
46
50
  import { resolveWarmPoolProfile } from '../../src/self-implement/pod-warm-pool-profile.js';
47
51
  import { decideWarmReuse, type WarmReuseSwitchConfig, type WarmReuseEvidence } from '../../src/task-orchestrator/surfaces/pod-warm-switch.js';
48
- import { getUserConfig } from '../../src/user-config.js';
52
+ import { invalidateWarmReuseEvidence, recordWarmGateEvidence, type ActualWarmLeaseEvidence } from '../../src/task-orchestrator/surfaces/warm-reuse-evidence.js';
53
+ import { getUserConfig, userConfigPath } from '../../src/user-config.js';
49
54
  import { beginGateShardAttempt, finalizeTerminalGateShards, gateShardsPath, recordGateShardsVerdict, writeGateShards, type GateJobTerminal, type GateShard } from '../../src/release-loop/gate-shards.js';
50
55
  import { appendGateShardLedger, gateShardLedgerPath, type GateShardLedgerRow } from '../../src/release-loop/gate-shard-ledger.js';
51
56
  import { markGateShardUnmeasured, nextGateShardAttempt, readGateShardManifest, readGateShardResult, saveGateShardResult } from './gate-shard-receipts.js';
52
- import { planGateShardDispatch, summarizeGateProgress, type GateProgressGroup, type GateShardReceipt } from './gate-shard-dispatch.js';
57
+ import { planGateReceiptRadius, planGateShardDispatch, summarizeGateProgress, type GateProgressGroup, type GateShardReceipt } from './gate-shard-dispatch.js';
53
58
  import { defaultKubectl } from '../../src/task-orchestrator/surfaces/self-implement-pod.js';
54
59
  import { executeTuiNodeCheck, type ExecutedTuiCheck } from './tui-node-checks.js';
55
60
  import { runWithReleaseGateTraffic, runWithReleasePwaTraffic } from './gate-traffic-mode.js';
56
61
  import { emitPodLifecycle, gatePodLifecycleEvent, gatePodOutcome } from '../../src/task-orchestrator/surfaces/pod-lifecycle-stages.js';
57
- import { gateHostReservationRoot, reserveReleaseGateHosts } from '../../src/release-loop/gate-host-reservation.js';
62
+ import { gateHostReservationRoot, readGateHostResourcesForHost, reserveReleaseGateHosts, type GateHostResourceReading } from '../../src/release-loop/gate-host-reservation.js';
63
+ import { startReleaseStageStallWatch } from '../../src/release-loop/stage-mail.js';
58
64
  import { normRoot } from '../../src/instance/resolve.js';
59
65
  import { cleanRetryVerdict, junitFailedCaseIds, junitTestcaseCount, junitTestcaseFiles } from './gate-shard-load-flaky.js';
60
66
  import { decideAndRecordGateAutoheal, gateAutohealCause, type GateAutohealDecision } from './gate-autoheal.js';
@@ -70,6 +76,8 @@ export interface WarmShadowObservation {
70
76
  cutSha?: string;
71
77
  baselineSha?: string;
72
78
  workerKey?: WarmWorkerKey;
79
+ /** Transient lease evidence; stripped before verdict persistence. */
80
+ leaseEvidence?: ActualWarmLeaseEvidence;
73
81
  }
74
82
 
75
83
  /** A provider may fill only lease identity; it cannot rewrite the Job attempt being compared. */
@@ -111,6 +119,8 @@ function redactedGateLogTail(input: string): string {
111
119
  * Every field falls back to the real tool, so an absent seam is today's behaviour byte for byte.
112
120
  */
113
121
  export interface GateTools {
122
+ /** Graph run identity passed to pool admission for shadow observations. */
123
+ graphRunId?: string | null;
114
124
  /** Wall clock the gate measures with; absent = `Date.now`. */
115
125
  now?: () => number;
116
126
  /** The Pod Job runner (the fake Pod stage of a scenario); absent = the positional `podCommand`, else `runPodCommand`. */
@@ -119,6 +129,8 @@ export interface GateTools {
119
129
  kubectl?: typeof defaultKubectl;
120
130
  /** Mock-only imageID observation seam; production reads the completed Job's child imageID from Kubernetes. */
121
131
  podImageDigest?: (input: { job: PodCommandResult; host: string }) => string | null;
132
+ /** Mock-only graph/recipe facts for an isolated gate tree; production pins the requested commit. */
133
+ graphRecipePins?: (repo: string, commit: string) => ({ graphSha: string; recipeSha: string; graphEntry: string; recipeCommand: string; recipeTimeoutMs: number }) | null;
122
134
  /** SSH transport behind {@link GateRunner.command} on a remote host; absent = a real `ssh` child. */
123
135
  ssh?: (host: string, script: string, limitMs?: number) => { rc: number; output: string; timedOut?: boolean };
124
136
  /** SSH reachability probe of a multi-host roster; absent = `defaultRemoteRun`. */
@@ -227,6 +239,9 @@ export function reconcileStaleGateShardBoard(input: {
227
239
  }
228
240
  export interface GateOptions {
229
241
  commit: string;
242
+ /** Present only when launched as a graph command; used to scope release-stage stall mail. */
243
+ graphId?: string;
244
+ dryRun?: boolean;
230
245
  /** Explicit pre-cut warm↔fresh comparison, persisted before the ordinary gate reads warmHistory. */
231
246
  warmPrecutCanary?: { file: string };
232
247
  /** RELEASE-POLICY-PACK — the gate Pod image is tied to this resolved cut commit. */
@@ -326,7 +341,7 @@ export interface GateOptions {
326
341
  abortTests?: (job: { name: string; context?: string }, reason: string) => boolean | void;
327
342
  /** GATE-LIVE-OBS — the shard state file (`gateShardsPath(version)`) this sweep keeps current; absent = not written. */
328
343
  shardsFile?: { path: string; version: string; ledgerPath?: string; envFingerprint?: string;
329
- receiptRoot?: string; base40?: string; expectedImageDigest?: string | null };
344
+ receiptRoot?: string; base40?: string; expectedImageDigest?: string | null; graphPins?: ({ graphSha: string; recipeSha: string } & { graphEntry?: string; recipeCommand?: string; recipeTimeoutMs?: number }) | null; executionIdentity?: import('./gate-radius-live.js').GatePodExecutionIdentity | null; radiusPriorCommit?: string };
330
345
  /** GATE-RISK-LANE — the ledgers `gateHistory` reads its watch list from; absent = no risk lane (the sweep plans as before). */
331
346
  riskWatch?: { instanceRoots: readonly string[]; ledgerRoots: readonly string[] };
332
347
  /** GATE-MULTI-HOST — is this pool member reachable (kubectl ns ⊕ ssh)? Injected by tests; absent = the real probe on
@@ -340,14 +355,110 @@ export interface GateOptions {
340
355
  }
341
356
 
342
357
  /** Gate-profile opt-in wires the producer only for the process entry, never a test runner seam. */
343
- export function withWarmGateHooks(opts: GateOptions, config: unknown, injectedRunner = false): GateOptions {
358
+ export interface WarmGateControlDependencies {
359
+ startPortForward?: typeof startWarmControlPortForward;
360
+ loadProvider?: typeof loadWarmPodProvider;
361
+ configureProvider?: typeof configureWarmPodProvider;
362
+ requestReplay?: typeof requestWarmPodReplay;
363
+ }
364
+
365
+ function safeWarmControlFailureReason(error: unknown): string {
366
+ if (error instanceof SyntaxError) return 'provider-config-invalid-json';
367
+ if (error instanceof Error) {
368
+ if (error.message === 'warm provider config unavailable') return 'provider-config-unavailable';
369
+ if (error.message === 'warm provider config must be private') return 'provider-config-not-private';
370
+ if (error.message === 'invalid warm provider config') return 'provider-config-invalid';
371
+ if (error.message === 'warm provider target is incomplete'
372
+ || error.message === 'warm control forward requires one cluster and namespace per gate run') {
373
+ return 'provider-config-target-invalid';
374
+ }
375
+ }
376
+ const code = error && typeof error === 'object' && 'code' in error && typeof error.code === 'string'
377
+ ? error.code : undefined;
378
+ if (code === 'ENOENT') return 'provider-config-unavailable';
379
+ if (code === 'EACCES' || code === 'EPERM') return 'provider-config-permission-denied';
380
+ return 'warm-control-setup-failed';
381
+ }
382
+
383
+ export function withWarmGateHooks(opts: GateOptions, config: unknown, injectedRunner = false,
384
+ onWarmCleanup?: (cleanup: () => Promise<void>) => void,
385
+ controlDependencies: WarmGateControlDependencies = {}): GateOptions {
344
386
  if (injectedRunner || !opts.pod || resolveWarmPoolProfile(config) !== 'gate') return opts;
345
387
  const warmReuseConfig = config && typeof config === 'object' && 'pod' in config
346
388
  && config.pod && typeof config.pod === 'object' && 'warmReuse' in config.pod
347
389
  ? config.pod.warmReuse as WarmReuseSwitchConfig : undefined;
348
- return { ...opts, pod: { ...opts.pod, warmReplay: requestWarmPodReplay,
390
+ const lifecycle = createRunScopedWarmControlForward(async () => {
391
+ return startWarmGateControl(config, controlDependencies);
392
+ });
393
+ const replay: NonNullable<GateOptions['pod']>['warmReplay'] = async (input) => {
394
+ try { await lifecycle.ensure(); }
395
+ catch (error) {
396
+ const reason = safeWarmControlFailureReason(error);
397
+ debug.log('pod.warm.control-forward', 'unavailable', { reason, fallback: 'fresh-job' }, { level: 'error' });
398
+ return { command: null, transport: { status: 'fallback', reason: 'control-unavailable', reply: null } };
399
+ }
400
+ return (controlDependencies.requestReplay ?? requestWarmPodReplay)(input);
401
+ };
402
+ const cleanup = async () => {
403
+ try { await lifecycle.stop(); }
404
+ finally { configureWarmPodProvider(null); }
405
+ };
406
+ onWarmCleanup?.(cleanup);
407
+ return { ...opts, pod: { ...opts.pod, warmReplay: replay,
349
408
  warmFinalize: finalizeWarmPodReplay, warmQuarantine: quarantineWarmPodReplay, warmProducerEnabled: true, warmReuseConfig } };
350
409
  }
410
+
411
+ export function resolveWarmProviderConfig(config: unknown): { path: string; source: 'env' | 'config' | 'default' } | undefined {
412
+ const envPath = process.env.ELANOUS_WARM_POD_PROVIDER_CONFIG?.trim();
413
+ if (envPath) return { path: envPath, source: 'env' };
414
+
415
+ const pod = config && typeof config === 'object' && !Array.isArray(config) && 'pod' in config
416
+ && config.pod && typeof config.pod === 'object' && !Array.isArray(config.pod)
417
+ ? config.pod as Record<string, unknown> : undefined;
418
+ const configuredPath = typeof pod?.warmProviderConfig === 'string' ? pod.warmProviderConfig.trim() : '';
419
+ if (configuredPath) return { path: configuredPath, source: 'config' };
420
+
421
+ const defaultPath = join(dirname(userConfigPath()), 'warm-pod-provider.json');
422
+ return existsSync(defaultPath) ? { path: defaultPath, source: 'default' } : undefined;
423
+ }
424
+
425
+ export function warmProviderTarget(path: string): { context: string; namespace: string } {
426
+ if (!isAbsolute(path) || (statSync(path).mode & 0o077) !== 0) throw new Error('warm provider config must be private');
427
+ const parsed: unknown = JSON.parse(readFileSync(path, 'utf8'));
428
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) throw new Error('invalid warm provider config');
429
+ const data = parsed as { candidates?: Array<{ spec?: { kubectlContext?: string; namespace?: string } }>;
430
+ poolTemplates?: Array<{ spec?: { kubectlContext?: string; namespace?: string } }> };
431
+ const rows = [...(data.candidates ?? []), ...(data.poolTemplates ?? [])];
432
+ const targets = new Map<string, { context: string; namespace: string }>();
433
+ for (const row of rows) {
434
+ const context = row.spec?.kubectlContext;
435
+ const namespace = row.spec?.namespace;
436
+ if (typeof context !== 'string' || !context || typeof namespace !== 'string' || !namespace)
437
+ throw new Error('warm provider target is incomplete');
438
+ targets.set(`${context}/${namespace}`, { context, namespace });
439
+ }
440
+ if (targets.size !== 1) throw new Error('warm control forward requires one cluster and namespace per gate run');
441
+ return [...targets.values()][0]!;
442
+ }
443
+
444
+ async function startWarmGateControl(config: unknown, dependencies: WarmGateControlDependencies) {
445
+ const resolvedConfig = resolveWarmProviderConfig(config);
446
+ if (!resolvedConfig) throw new Error('warm provider config unavailable');
447
+ debug.log('pod.warm.control-forward', 'config-discovered', { source: resolvedConfig.source });
448
+ const configPath = resolvedConfig.path;
449
+ const target = warmProviderTarget(configPath);
450
+ const forward = await (dependencies.startPortForward ?? startWarmControlPortForward)({ context: target.context,
451
+ namespace: target.namespace, service: 'elanous-control', remotePort: DEFAULT_CONTROL_PORT });
452
+ try {
453
+ const provider = (dependencies.loadProvider ?? loadWarmPodProvider)(configPath, { runtimeOverrides: { controlUrl: forward.url } });
454
+ (dependencies.configureProvider ?? configureWarmPodProvider)(provider);
455
+ return forward;
456
+ } catch (error) {
457
+ await forward.stop();
458
+ throw error;
459
+ }
460
+ }
461
+
351
462
  export interface GateResult {
352
463
  outcome: 'ok' | 'regression' | 'error';
353
464
  commit: string;
@@ -532,16 +643,26 @@ export async function runWarmPrecutCanary(input: { opts: GateOptions; runner: Ga
532
643
  || attemptIds.has(observation.attemptId)
533
644
  || (observation.reason === 'match' && (observation.finalized !== true || observation.quarantined !== 'no'))) {
534
645
  failure = new Error(`pre-cut warm comparison was not measured on attempt ${index + 1}: ${observation.reason}`);
646
+ observation = { ...observation, status: 'unmeasured', reason: observation.reason || 'warm-shadow-unmeasured' };
535
647
  }
536
648
  } catch (error) {
537
649
  observation = { files: [input.file], attemptId: `precut-error-${index + 1}-${randomUUID()}`,
538
650
  status: 'unmeasured', reason: String(error), quarantined: 'unavailable' };
539
651
  failure = error instanceof Error ? error : new Error(String(error));
540
652
  }
653
+ const journalObservation = observation;
654
+ const { leaseEvidence: _leaseEvidence, ...persistedObservation } = observation;
655
+ observation = persistedObservation;
541
656
  attemptIds.add(observation.attemptId);
542
657
  observations.push(observation);
543
- recordWarmPrecutCanarySample(input.historyPath, { version: opts.version, commit: opts.commit,
544
- baselineCommit: opts.baselineCommit, warmShadow: [observation] });
658
+ try {
659
+ recordWarmPrecutCanarySample(input.historyPath, { version: opts.version, commit: opts.commit,
660
+ baselineCommit: opts.baselineCommit, warmShadow: [observation] });
661
+ } catch (error) {
662
+ invalidateWarmReuseEvidence();
663
+ throw error;
664
+ }
665
+ await journalWarmGateShadow(journalObservation, opts.commit, runner, opts.repo ?? process.cwd());
545
666
  if (failure) throw failure;
546
667
  }
547
668
  const history = readWarmVerdictHistory(input.historyPath);
@@ -552,6 +673,37 @@ export async function runWarmPrecutCanary(input: { opts: GateOptions; runner: Ga
552
673
  evidence ? { 'gate-recheck': evidence } : undefined) };
553
674
  }
554
675
  /** Every counted match has a measured, finalized worker with this exact cut, baseline and lock. */
676
+ async function journalWarmGateShadow(shadow: WarmShadowObservation, commit: string, runner: GateRunner, repo: string): Promise<void> {
677
+ let head = '';
678
+ let main = '';
679
+ try {
680
+ const headResult = await runner.localCommand('git', ['rev-parse', `${commit}^{commit}`], repo);
681
+ const mainResult = await runner.localCommand('git', ['ls-remote', 'origin', 'refs/heads/main'], repo);
682
+ head = headResult.rc === 0 ? headResult.output.trim() : '';
683
+ const match = mainResult.rc === 0 ? /^(?:[0-9a-f]{40})\s+refs\/heads\/main\s*$/im.exec(mainResult.output) : null;
684
+ main = match?.[0].trim().split(/\s+/)[0] ?? '';
685
+ } catch (error) {
686
+ invalidateWarmReuseEvidence();
687
+ debug.log('pod.warm', 'evidence-journal-write-failed', { consumer: 'gate-recheck', reason: 'head-main-lookup-failed' }, { level: 'warn' });
688
+ return;
689
+ }
690
+ if (!/^[0-9a-f]{40}$/i.test(head) || !/^[0-9a-f]{40}$/i.test(main)) {
691
+ invalidateWarmReuseEvidence();
692
+ debug.log('pod.warm', 'evidence-journal-write-failed', { consumer: 'gate-recheck', reason: 'head-main-unmeasured' }, { level: 'warn' });
693
+ return;
694
+ }
695
+ const accepted = head === main && shadow.status === 'observed' && shadow.reason === 'match'
696
+ && shadow.finalized === true && shadow.quarantined === 'no' && !!shadow.leaseEvidence;
697
+ try {
698
+ recordWarmGateEvidence({ head, main, evidence: shadow.leaseEvidence
699
+ ? { ...shadow.leaseEvidence, leaseValid: accepted && shadow.leaseEvidence.leaseValid,
700
+ canaryPassed: accepted && shadow.leaseEvidence.canaryPassed, agree: accepted && shadow.leaseEvidence.agree }
701
+ : undefined, reason: head === main ? (shadow.reason || shadow.status) : 'head-main-mismatch' });
702
+ } catch (error) {
703
+ debug.log('pod.warm', 'evidence-journal-write-failed', { consumer: 'gate-recheck', reason: String(error) }, { level: 'warn' });
704
+ }
705
+ }
706
+
555
707
  export function warmEvidenceFromVerdicts(history: readonly WarmVerdictSample[] | undefined,
556
708
  version: string, head: string, baseline: string, lock: string): WarmReuseEvidence | undefined {
557
709
  if (!history?.length || !lock) return undefined;
@@ -961,7 +1113,7 @@ export function gateShardShell(o: { parts: readonly (readonly string[])[]; cdpPa
961
1113
  ...(o.beatSeconds ? gateBeatScript(o.beatSeconds, o.installSlots > 0) : []),
962
1114
  ...(o.cachePrefix ? [o.cachePrefix] : []),
963
1115
  gateEnvBaselineLine(),
964
- `bun -e ${quote("const {createHash}=require('node:crypto');const keys=['ELANOUS_TEST_FAKE_LLM','LANG','LC_ALL','TZ'];const e=Object.fromEntries(keys.sort().map(k=>[k,process.env[k]??'']));const envFingerprint=createHash('sha256').update(JSON.stringify(e)).digest('hex');console.log(JSON.stringify({bunVersion:Bun.version,platform:process.platform,architecture:process.arch,envFingerprint}));")} > "$O/runtime-identity.json" 2> "$O/runtime-identity.err" || rm -f "$O/runtime-identity.json"`,
1116
+ `bun -e ${quote("const {createHash}=require('node:crypto');const keys=['ELANOUS_TEST_FAKE_LLM','LANG','LC_ALL','TZ'];const e=Object.fromEntries(keys.sort().map(k=>[k,process.env[k]??'']));const envFingerprint=createHash('sha256').update(JSON.stringify(e)).digest('hex');console.log(JSON.stringify({bunVersion:Bun.version,platform:process.platform,architecture:process.arch,envFingerprint,baseImageDigest:process.env.ELANOUS_GATE_BASE_IMAGE_DIGEST??''}));")} > "$O/runtime-identity.json" 2> "$O/runtime-identity.err" || rm -f "$O/runtime-identity.json"`,
965
1117
  ...(o.rulesBaseSha ? [`export ELANOUS_GATE_BASE_SHA=${quote(o.rulesBaseSha)}`] : []),
966
1118
  // Seconds since this container's PID 1 started (the clone ran before this shell) — 0 when /proc cannot tell.
967
1119
  `pod_age=$(awk -v t="$(cut -d' ' -f22 /proc/1/stat 2>/dev/null)" -v hz="$(getconf CLK_TCK 2>/dev/null)" '{ if (t > 0 && hz > 0) print int($1 - t / hz); else print 0 }' /proc/uptime 2>/dev/null)`,
@@ -1438,6 +1590,8 @@ export const GATE_NIGHTLY_AUDITS: readonly string[] = [
1438
1590
  'scripts/unwired-exports.test.ts',
1439
1591
  // Replaces pwa-build-typecheck's full root tsc and PWA tsc sweeps (PWA build also runs in the release loop).
1440
1592
  'test/pwa-build-typecheck.test.ts',
1593
+ // Whole-repository credential scan runs through test-diet's nightly audit flag; gate uses bounded fixtures.
1594
+ 'scripts/resource-map-check.test.ts',
1441
1595
  ];
1442
1596
  const tail40 = (output: string) => output.trimEnd().split(/\r?\n/).slice(-40).join('\n');
1443
1597
  const lastStartedTestFile = (output: string, paths: string[]): string | undefined => {
@@ -1702,7 +1856,45 @@ export interface GateAdmission {
1702
1856
  acquire(signal: AbortSignal): Promise<() => void>;
1703
1857
  /** The pool-wide reading admission waits on (recommended · limitedBy · memorySlots); null before any reading. */
1704
1858
  waitReason(): string | null;
1859
+ /** Optional deterministic-test observation override; production uses poolGateAdmission's unknown-only provider. */
1860
+ priorityShadowObservation?(gateWaiting: boolean): GatePriorityShadowObservation;
1861
+ }
1862
+
1863
+ export type GatePriorityImageState = 'verified' | 'mismatch' | 'unknown';
1864
+ export interface GatePriorityShadowObservation {
1865
+ gateRunId: string | null;
1866
+ host: string | null;
1867
+ competingRunId: string | null;
1868
+ competingHost: string | null;
1869
+ gateImageState: GatePriorityImageState;
1870
+ competingImageState: GatePriorityImageState;
1871
+ gateWaiting: boolean;
1872
+ lowerPriorityWaiting: boolean | null;
1873
+ }
1874
+ export interface GatePriorityShadowDecision extends GatePriorityShadowObservation {
1875
+ event: 'gate-priority-shadow-decision';
1876
+ decision: 'gate-first' | 'no-contention' | 'insufficient-evidence';
1877
+ selectionRationale: string;
1878
+ }
1879
+
1880
+ /** A shadow-only policy decision; it has no pool or Pod handle and cannot change runtime state. */
1881
+ export function gatePriorityShadowDecision(input: GatePriorityShadowObservation): GatePriorityShadowDecision {
1882
+ const base = { event: 'gate-priority-shadow-decision' as const, ...input };
1883
+ if (!input.gateWaiting || input.lowerPriorityWaiting === false) {
1884
+ return { ...base, decision: 'no-contention', selectionRationale: !input.gateWaiting ? 'gate-not-waiting' : 'no-lower-priority-waiter-observed' };
1885
+ }
1886
+ if (input.lowerPriorityWaiting !== true) {
1887
+ return { ...base, decision: 'insufficient-evidence', selectionRationale: 'lower-priority-wait-state-unknown' };
1888
+ }
1889
+ if (!input.gateRunId || !input.competingRunId || !input.host || input.host !== input.competingHost) {
1890
+ return { ...base, decision: 'insufficient-evidence', selectionRationale: 'same-host-run-identities-unavailable' };
1891
+ }
1892
+ if (input.gateImageState !== 'verified' || input.competingImageState !== 'verified') {
1893
+ return { ...base, decision: 'insufficient-evidence', selectionRationale: 'image-state-not-verified' };
1894
+ }
1895
+ return { ...base, decision: 'gate-first', selectionRationale: 'same-host-contention-and-verified-gate-image; gate-policy-priority' };
1705
1896
  }
1897
+
1706
1898
  export const GATE_ADMISSION_WAIT_SECONDS_DEFAULT = 1800;
1707
1899
  /** Queue pressure scales the default wait but never creates an unbounded admission timer. */
1708
1900
  export function gateAdmissionWaitSeconds(shards: number, slots: number): number {
@@ -1725,18 +1917,47 @@ export function createGateRootLimiter(slots: number): <T>(run: () => Promise<T>)
1725
1917
  };
1726
1918
  }
1727
1919
  /** A direct gate has no preflight image pin. Its measured receipt still carries its own image digest. */
1728
- export function gateReceiptReuseKey(receipt: GateShardReceipt | null, fingerprint: string, expectedImageDigest: string | null | undefined,
1729
- hosts: ReadonlySet<string>): { envKey?: string; reason: string } {
1920
+ function gateRuntimeSourceFingerprint(repo: string, commit: string, identity: { bunVersion: string; platform: string; architecture: string; envFingerprint: string; baseImageDigest?: string } | null | undefined): string | null {
1921
+ if (!identity || typeof identity.baseImageDigest !== "string" || !/^[a-f0-9]{40}$/i.test(commit) || !/^sha256:[a-f0-9]{64}$/i.test(identity.baseImageDigest)) return null;
1922
+ const files = ['bun.lock', 'apps/pwa/bun.lock', 'package.json', 'apps/pwa/package.json', 'docker/harness/Dockerfile'];
1923
+ const inputs: Array<[string, string]> = [];
1924
+ for (const file of files) {
1925
+ const result = spawnSync('git', ['show', commit + ':' + file], { cwd: repo, encoding: 'utf8', maxBuffer: 8 * 1024 * 1024 });
1926
+ if (result.status !== 0 || result.error) return null;
1927
+ inputs.push([file, result.stdout]);
1928
+ }
1929
+ const lockfileHash = createHash('sha256').update(inputs.filter(([file]) => file.endsWith('.lock')).map(([, value]) => value).join('\0')).digest('hex');
1930
+ const dependencyLayerHash = createHash('sha256').update(JSON.stringify(inputs)).digest('hex');
1931
+ return createHash('sha256').update(JSON.stringify({ envFingerprint: identity.envFingerprint, bunVersion: identity.bunVersion,
1932
+ platform: identity.platform, architecture: identity.architecture, baseImageDigest: identity.baseImageDigest, lockfileHash, dependencyLayerHash })).digest('hex');
1933
+ }
1934
+
1935
+ export function gateReceiptReuseKey(receipt: GateShardReceipt | null, version: string, head40: string, fingerprint: string,
1936
+ expectedImageDigest: string | null | undefined, currentIdentity: import('./gate-radius-live.js').GatePodExecutionIdentity | null,
1937
+ graphPins: ({ graphSha: string; recipeSha: string } & { graphEntry?: string; recipeCommand?: string; recipeTimeoutMs?: number }) | null): { envKey?: string; reason: string } {
1730
1938
  if (!receipt) return { reason: 'receipt-missing' };
1731
1939
  if (receipt.status !== 'complete') return { reason: 'receipt-unmeasured' };
1732
- if (!hosts.has(receipt.host)) return { reason: 'receipt-host-outside-pool' };
1733
- if (expectedImageDigest) return receipt.envKey === `${fingerprint}:${expectedImageDigest}`
1734
- ? { envKey: receipt.envKey, reason: 'image-pinned' } : { reason: 'receipt-image-or-env-drift' };
1735
- const prefix = `${fingerprint}:`;
1736
- if (!receipt.envKey.startsWith(prefix)) return { reason: 'receipt-env-drift' };
1737
- return /^sha256:[a-f0-9]{64}$/i.test(receipt.envKey.slice(prefix.length))
1738
- ? { envKey: receipt.envKey, reason: 'measured-image' } : { reason: 'receipt-image-unmeasured' };
1940
+ if (!currentIdentity) return { reason: 'current-environment-unmeasured' };
1941
+ if (!graphPins?.graphEntry || !graphPins.recipeCommand) return { reason: 'current-shard-recipe-unmeasured' };
1942
+ if (!receipt.version || !receipt.head40 || !receipt.graphSha || !receipt.recipeSha || !receipt.graphEntry || !receipt.recipeCommand || !Number.isSafeInteger(receipt.recipeTimeoutMs) || !receipt.imageDigest || !receipt.runtimeIdentity || !receipt.envFingerprint)
1943
+ return { reason: 'receipt-reuse-record-incomplete' };
1944
+ if (receipt.graphEntry !== graphPins.graphEntry) return { reason: 'graph-entry-mismatch' };
1945
+ if (receipt.recipeCommand !== graphPins.recipeCommand) return { reason: 'recipe-command-mismatch' };
1946
+ if (receipt.recipeTimeoutMs !== graphPins.recipeTimeoutMs) return { reason: 'recipe-timeout-mismatch' };
1947
+ const environmentFields = ['bunVersion', 'platform', 'architecture', 'envFingerprint', 'baseImageDigest'] as const;
1948
+ const stored: Record<string, string> = { ...receipt.runtimeIdentity, envFingerprint: receipt.envFingerprint };
1949
+ const current: Record<string, string> = { ...currentIdentity };
1950
+ for (const field of environmentFields) {
1951
+ if (!stored[field] || !current[field]) return { reason: `environment-${field}-unmeasured` };
1952
+ if (stored[field] !== current[field]) return { reason: `environment-${field}-mismatch` };
1953
+ }
1954
+ if (receipt.envFingerprint !== receipt.runtimeIdentity.envFingerprint || receipt.envKey !== `${receipt.envFingerprint}:${receipt.imageDigest}`)
1955
+ return { reason: 'receipt-env-record-inconsistent' };
1956
+ if (receipt.runtimeIdentity.envFingerprint !== fingerprint) return { reason: 'environment-envFingerprint-current-fingerprint-mismatch' };
1957
+ if (expectedImageDigest && expectedImageDigest !== currentIdentity.imageDigest) return { reason: 'environment-imageDigest-current-pin-mismatch' };
1958
+ return { envKey: receipt.envKey, reason: `environment-match; baseline=${receipt.version}@${receipt.head40.slice(0, 12)}; current=${version}@${head40.slice(0, 12)}` };
1739
1959
  }
1960
+
1740
1961
  export type GateAdmissionOutcome = 'granted' | 'admission-timeout' | 'admission-error' | 'off';
1741
1962
  export interface GateAdmissionResult { outcome: GateAdmissionOutcome; waitedMs: number; reason?: string; release: () => void }
1742
1963
  export const gateAdmissionWaitText = (reading: string | null) => `메모리 여유 대기(admission) · ${reading ?? '측정 전'}`.slice(0, 160);
@@ -1752,17 +1973,38 @@ export function defaultGateMemberProbe(member: PodPoolMember, tools: GateTools =
1752
1973
  return !member.sshHost || (tools.remoteRun ?? defaultRemoteRun)(member.sshHost, 'true').status === 0;
1753
1974
  }
1754
1975
 
1755
- export function poolGateAdmission(pool: PodPoolScheduler): GateAdmission {
1756
- return { acquire: (signal) => pool.acquireAdmission(signal, undefined, { gate: true }), waitReason: () => pool.waitReason() };
1976
+ export function poolGateAdmission(pool: PodPoolScheduler, gateRunId: string | null = null,
1977
+ priorityShadowObservation?: (gateWaiting: boolean) => GatePriorityShadowObservation): GateAdmission {
1978
+ const singleHost = pool.members.length === 1 ? (pool.members[0]!.sshHost ?? hostname()) : null;
1979
+ // The optional provider is a deterministic test seam only. Production never fabricates a competitor or image fact.
1980
+ return {
1981
+ acquire: (signal) => pool.acquireAdmission(signal, undefined, { gate: true }),
1982
+ waitReason: () => pool.waitReason(),
1983
+ // At admission time a multi-host pool has not selected a host yet. Existing measurements do not expose
1984
+ // competing run ids or image states, so keep those unknown rather than deriving them from Job names.
1985
+ priorityShadowObservation: priorityShadowObservation ?? ((gateWaiting) => ({ gateRunId, host: singleHost, competingRunId: null, competingHost: null,
1986
+ gateImageState: 'unknown', competingImageState: 'unknown', gateWaiting, lowerPriorityWaiting: null })),
1987
+ };
1757
1988
  }
1758
- export async function admitGateShard(admission: GateAdmission | undefined, o: { waitMs: number; onWait: (reason: string) => void; reasonPollMs?: number; firstReasonMs?: number }): Promise<GateAdmissionResult> {
1989
+ export async function admitGateShard(admission: GateAdmission | undefined, o: { waitMs: number; onWait: (reason: string) => void; reasonPollMs?: number; firstReasonMs?: number;
1990
+ onPriorityShadow?: (decision: GatePriorityShadowDecision) => void }): Promise<GateAdmissionResult> {
1759
1991
  const noop = () => {};
1760
1992
  if (!admission || !(o.waitMs > 0)) return { outcome: 'off', waitedMs: 0, release: noop };
1761
1993
  const started = Date.now();
1762
1994
  const controller = new AbortController();
1763
1995
  let timedOut = false;
1764
1996
  let lastReason: string | undefined;
1765
- const tell = () => { lastReason = gateAdmissionWaitText(admission.waitReason()); o.onWait(lastReason); };
1997
+ let priorityShadowLogged = false;
1998
+ const tell = () => {
1999
+ lastReason = gateAdmissionWaitText(admission.waitReason());
2000
+ if (!priorityShadowLogged && admission.priorityShadowObservation) {
2001
+ priorityShadowLogged = true;
2002
+ const decision = gatePriorityShadowDecision(admission.priorityShadowObservation(true));
2003
+ if (o.onPriorityShadow) o.onPriorityShadow(decision);
2004
+ else debug.log('release-loop.gate', 'gate-priority-shadow-decision', decision);
2005
+ }
2006
+ o.onWait(lastReason);
2007
+ };
1766
2008
  const deadline = setTimeout(() => { timedOut = true; controller.abort(); }, o.waitMs);
1767
2009
  // A grant inside the first moment never touches the shard row (no flapping in shards.json).
1768
2010
  let ticker: ReturnType<typeof setInterval> | undefined;
@@ -1805,6 +2047,27 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1805
2047
  const ssh = tools.ssh ?? defaultSshCommand;
1806
2048
  const remoteRun = tools.remoteRun ?? defaultRemoteRun;
1807
2049
  const runPod = tools.podCommand ?? podCommand;
2050
+ const pinnedGateImageSync = (pod: NonNullable<GateOptions['pod']>, commit: string): RunPodCommandOptions['syncImages'] | undefined => {
2051
+ const hasDigest = Boolean(pod.pinnedImageDigest?.trim());
2052
+ const hasRunId = Boolean(pod.pinnedRunId?.trim());
2053
+ if (hasDigest !== hasRunId) throw new Error('gate pinned image: both pinnedImageDigest and pinnedRunId are required');
2054
+ if (!hasDigest) return undefined;
2055
+ return async (members, image, localCommit) => {
2056
+ if (localCommit !== commit) throw new Error('gate pinned image: requested source commit changed');
2057
+ const probe = preflightGateImageDigest;
2058
+ const poolSpecFor = (member: PodPoolMember) => `${member.context}${member.sshHost ? `@${member.sshHost}` : ''}:${member.capacity}#${member.registry ?? NODE_REGISTRY}`;
2059
+ const result = buildPinnedGateImageSync({ runId: pod.pinnedRunId!, commit, digest: pod.pinnedImageDigest!, image,
2060
+ members: members.map((member) => ({ context: member.context, registry: member.registry ?? NODE_REGISTRY })),
2061
+ probeTagDigest: (member) => {
2062
+ const candidate = members.find((row) => row.context === member.context && (row.registry ?? NODE_REGISTRY) === member.registry);
2063
+ return candidate ? probe(poolSpecFor(candidate), commit) : null;
2064
+ } });
2065
+ for (const drift of result.tagDrifts) debug.log('release-loop.gate', 'image-tag-drift', {
2066
+ ...drift, action: 'skip-push-use-pinned-digest',
2067
+ }, { level: 'warn' });
2068
+ return result.images;
2069
+ };
2070
+ };
1808
2071
  // GATE-HOSTMIRROR-EXPLICIT: resolved once per runner and handed to every podCommand (shard · retry · recheck).
1809
2072
  let gateMirror: GateHostMirror | undefined;
1810
2073
  const gateHostMirror = (pod: NonNullable<GateOptions['pod']>): { hostMirror?: string } => {
@@ -1840,13 +2103,16 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1840
2103
  };
1841
2104
  const podSweep = async (tree: string, logDir: string | undefined, pod: NonNullable<GateOptions['pod']>, only?: readonly string[], onProgress?: (progress: GateSweepProgress) => void): Promise<CommandResult> => {
1842
2105
  const sweepId = randomUUID();
1843
- const shardCount = pod.shards ?? 24;
2106
+ let shardCount = pod.shards ?? 24;
1844
2107
  const isolationConcurrency = pod.isolationConcurrency ?? 4;
1845
2108
  // GATE-TIMEOUT-HEAL ①: the configured value is the floor; each shard's own deadline is shardDeadlineSeconds(planned).
1846
2109
  const deadlineSeconds = pod.shardTimeoutSeconds ?? POD_SHARD_TIMEOUT_FLOOR_SECONDS;
1847
2110
  if (!pod.pool || !Number.isSafeInteger(shardCount) || shardCount < 1
1848
2111
  || !Number.isSafeInteger(deadlineSeconds) || deadlineSeconds < 1
1849
2112
  || !Number.isSafeInteger(isolationConcurrency) || isolationConcurrency < 1) throw new Error('invalid pod sweep options');
2113
+ const hasPinnedDigest = Boolean(pod.pinnedImageDigest?.trim());
2114
+ const hasPinnedRunId = Boolean(pod.pinnedRunId?.trim());
2115
+ if (hasPinnedDigest !== hasPinnedRunId) throw new Error('gate pinned image: both pinnedImageDigest and pinnedRunId are required');
1850
2116
  const head = await command('git', ['rev-parse', 'HEAD'], tree);
1851
2117
  check(head, 'cut tree HEAD');
1852
2118
  const commit = head.output.trim();
@@ -1860,7 +2126,8 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1860
2126
  // by not running. Fail closed (gate error), never a smaller sweep than planned.
1861
2127
  const missing = only?.filter((file) => !allFiles.includes(file)) ?? [];
1862
2128
  if (missing.length) throw new Error(`partial plan file missing at this commit: ${missing.slice(0, 5).join(', ')}`);
1863
- const files = onlySet ? allFiles.filter((file) => onlySet.has(file)) : allFiles;
2129
+ let files = onlySet ? allFiles.filter((file) => onlySet.has(file)) : allFiles;
2130
+ // An empty, closure-proven radius means every prior formal shard is carried; load the receipt inventory for dispatch.
1864
2131
  const rulesBaseSha = await rulesGateBaseFor(commit, files);
1865
2132
  if (files.some((file) => file.startsWith('-') || file.startsWith('/') || file.startsWith('./')
1866
2133
  || file.split('/').some((part) => !part || part === '.' || part === '..') || /[\r\n]/.test(file))) throw new Error('unsafe pod test path');
@@ -1871,7 +2138,9 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1871
2138
  const cdpPatterns = cdp.output.split(/\r?\n/).filter((path) => path.endsWith('.test.ts'));
1872
2139
  // CDP 시험은 `test:deterministic` 이 스스로 뺀다 — 조각에 그것만 남으면 bun «시험 없음» exit 1 을 «불완전»으로 읽었다(09-30 G1d 실측 둘).
1873
2140
  // bun 의 탐색은 숨은 디렉터리(`.x/`)를 안 연다 — 사람의 `bun test` 가 한 번도 안 돌리는 빈 픽스처가 조각에 혼자 남아 «Ran 0 tests» 를 «불완전»으로 읽었다(09-30 G1e 5번 조각).
1874
- const assignable = files.filter((file) => !cdpPatterns.includes(file) && !POD_SWEEP_INTEGRATION_ONLY.includes(file)
2141
+ const allAssignable = allFiles.filter((file) => !cdpPatterns.includes(file) && !POD_SWEEP_INTEGRATION_ONLY.includes(file)
2142
+ && !file.split('/').some((part) => part.startsWith('.')));
2143
+ let assignable = files.filter((file) => !cdpPatterns.includes(file) && !POD_SWEEP_INTEGRATION_ONLY.includes(file)
1875
2144
  && !file.split('/').some((part) => part.startsWith('.')));
1876
2145
  const integrationOnly = files.filter((file) => POD_SWEEP_INTEGRATION_ONLY.includes(file));
1877
2146
  if (integrationOnly.length) debug.log('release-loop.gate', 'pod-sweep-integration-only', { files: integrationOnly });
@@ -1885,11 +2154,25 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1885
2154
  // the first shard; heavy files stay solo and spawn files keep their own lane, so the rest of the plan is unchanged.
1886
2155
  const watchList = pod.riskWatch ? readGateRiskWatchList(pod.riskWatch) : [];
1887
2156
  const riskPlan = planGateRiskLaneShards({ assignable, durations, shardCount, heavy, watchList });
1888
- const shards = riskPlan.shards;
2157
+ let shards = riskPlan.shards;
1889
2158
  const receiptRoot = pod.shardsFile?.receiptRoot;
2159
+ const priorReceiptRows = only && receiptRoot && existsSync(receiptRoot) ? readdirSync(receiptRoot).filter((name) => /^pod-\d+\.receipt\.json$/.test(name))
2160
+ .sort((a, b) => Number(a.slice(4).split('.')[0]) - Number(b.slice(4).split('.')[0]))
2161
+ .map((name) => readGateShardManifest(receiptRoot, name.replace('.receipt.json', ''))).filter((row): row is GateShardReceipt => !!row) : [];
2162
+ const radiusReceiptPlan = only && priorReceiptRows.length ? planGateReceiptRadius({ receipts: priorReceiptRows, tests: allAssignable, selectedFiles: only ?? files, priorCommit: pod.shardsFile?.radiusPriorCommit ?? '' }) : null;
2163
+ const radiusUnchangedShardIds = radiusReceiptPlan?.unchangedShardIds ?? [];
2164
+ const radiusInvalidatedShardIds = radiusReceiptPlan?.invalidatedShardIds ?? [];
2165
+ if (radiusReceiptPlan) { assignable = allAssignable; shards = radiusReceiptPlan.shards.map((shard) => ({ ...shard, plannedSeconds: shard.files.reduce((total, file) => total + (durations.get(file) ?? 0), 0) })); shardCount = shards.length; }
1890
2166
  const base40 = pod.shardsFile?.base40;
1891
2167
  const envFingerprint = pod.shardsFile?.envFingerprint;
1892
2168
  const expectedImageDigest = pod.shardsFile?.expectedImageDigest;
2169
+ const injectedGraphRecipePins = tools.graphRecipePins?.(repo, commit) ?? null;
2170
+ const sourceGraphPins = pod.shardsFile?.graphPins ?? injectedGraphRecipePins ?? gateSourcePins(repo, commit);
2171
+ const shardRecipeIdentity = pod.shardsFile?.graphPins?.graphEntry && pod.shardsFile.graphPins.recipeCommand
2172
+ ? { graphEntry: pod.shardsFile.graphPins.graphEntry, recipeCommand: pod.shardsFile.graphPins.recipeCommand, recipeTimeoutMs: pod.shardsFile.graphPins.recipeTimeoutMs }
2173
+ : injectedGraphRecipePins ?? gateShardRecipeIdentityAtCommit(repo, commit);
2174
+ const currentGraphPins = sourceGraphPins && shardRecipeIdentity ? { ...sourceGraphPins, ...shardRecipeIdentity } : null;
2175
+ const currentExecutionIdentity = pod.shardsFile?.executionIdentity ?? preflightGateExecutionIdentity(pod.pool, process.env, commit);
1893
2176
  if (riskPlan.spawnFiles.length) debug.log('release-loop.gate', 'pod-spawn-lane', { files: riskPlan.spawnFiles, shards: riskPlan.spawnShardCount });
1894
2177
  if (riskPlan.riskFiles.length) debug.log('release-loop.gate', 'pod-risk-lane-plan', { files: riskPlan.riskFiles, shard: 0,
1895
2178
  plannedSeconds: riskPlan.riskPlannedSeconds, shards: shards.length, watch: watchList.length });
@@ -1911,16 +2194,31 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1911
2194
  const ready = poolOverride ? undefined : checkPodPool(parsePodPool(pod.pool), kubectl);
1912
2195
  if (ready && !ready.ok) throw new Error('pod command: 풀의 노드가 하나도 준비되지 않았다');
1913
2196
  const poolScheduler = poolOverride ?? new PodPoolScheduler(ready!.ready);
2197
+ type GateShardExecution = NonNullable<ReturnType<typeof parseGatePodRuntimeIdentity>>;
2198
+ type GateShardDetail = Partial<GateShardLedgerRow> & { runtimeIdentity?: GateShardExecution };
2199
+ const detailsById = new Map<string, GateShardDetail>();
2200
+ const executionsByShard = new Map<string, Array<{ branch: string; attemptId: string; imageDigest: string | null;
2201
+ runtimeIdentity: GateShardExecution | null; host: string | null }>>();
1914
2202
  const receiptChecks = shards.map((item, shard) => {
1915
2203
  if (pod.freshShards) return { reason: 'fresh-shards' };
1916
2204
  if (!receiptRoot || !base40 || !envFingerprint) return { reason: 'receipt-context-missing' };
1917
2205
  const prior = readGateShardManifest(receiptRoot, `pod-${shard}`);
1918
- const key = gateReceiptReuseKey(prior, envFingerprint, expectedImageDigest,
1919
- new Set(poolScheduler.members.map((member) => member.context)));
1920
- if (!key.envKey) return { reason: key.reason };
2206
+ const sameHead = prior?.head40 === commit;
2207
+ const priorRuntime = sameHead ? null : prior && gateRuntimeSourceFingerprint(repo, prior.head40, prior.runtimeIdentity);
2208
+ const currentRuntime = sameHead ? null : currentExecutionIdentity && gateRuntimeSourceFingerprint(repo, commit, currentExecutionIdentity);
2209
+ const key = prior?.base40 !== base40 ? { reason: 'base40-mismatch' }
2210
+ : !sameHead && (!priorRuntime || !currentRuntime) ? { reason: 'runtime-fingerprint-unmeasured' }
2211
+ : !sameHead && priorRuntime !== currentRuntime ? { reason: 'runtime-fingerprint-mismatch' }
2212
+ : gateReceiptReuseKey(prior, pod.shardsFile!.version, commit, envFingerprint, expectedImageDigest, currentExecutionIdentity, currentGraphPins);
2213
+ if (!key.envKey) {
2214
+ return { reason: key.reason };
2215
+ }
1921
2216
  const result = readGateShardResult(receiptRoot, { shard: { id: `pod-${shard}`, files: item.files },
1922
- head40: commit, base40, envKey: key.envKey });
1923
- return result ? { reason: key.reason, result } : { reason: 'receipt-identity-or-evidence-invalid' };
2217
+ head40: prior!.head40, base40, envKey: key.envKey });
2218
+ const decision = result ? 'reuse' as const : 'rerun' as const;
2219
+ const reason = result ? key.reason : 'receipt-payload-or-shard-radius-mismatch';
2220
+
2221
+ return result ? { reason, result } : { reason };
1924
2222
  });
1925
2223
  const receipts = receiptChecks.flatMap((check) => check.result ? [check.result.receipt] : []);
1926
2224
  const requiredOs = pod.shardCapabilities ?? {};
@@ -1951,8 +2249,29 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1951
2249
  shards: shards.map((item, shard) => ({ id: `pod-${shard}`, files: item.files,
1952
2250
  ...(requiredOs[`pod-${shard}`]?.os ? { requiredOs: requiredOs[`pod-${shard}`]!.os } : {}) })), receipts,
1953
2251
  hosts,
2252
+ graphEntry: currentGraphPins?.graphEntry, recipeCommand: currentGraphPins?.recipeCommand, recipeTimeoutMs: currentGraphPins?.recipeTimeoutMs, environmentIdentity: currentExecutionIdentity ?? undefined,
2253
+ radiusUnchangedShardIds, invalidatedShardIds: radiusInvalidatedShardIds,
1954
2254
  macPassShardIds,
1955
2255
  ...(pod.rerouteShard ? { rerouteShard: pod.rerouteShard } : {}), ...(pod.shardHost ? { shardHost: pod.shardHost } : {}) });
2256
+ for (const action of hostPlan) {
2257
+ const decision = action.kind === 'reuse' ? 'reuse' as const : 'rerun' as const;
2258
+ const reason = action.reason;
2259
+ const prior = receiptChecks[Number(action.shardId.slice(4))]?.result?.receipt
2260
+ ?? readGateShardManifest(receiptRoot ?? '', action.shardId);
2261
+ detailsById.set(action.shardId, { reuseDecision: decision, reuseReason: reason });
2262
+ debug.log('gate.receipt', 'reuse-decision', { shardId: action.shardId, decision, reason });
2263
+ if (pod.shardsFile?.ledgerPath && envFingerprint) {
2264
+ try { appendGateShardLedger(pod.shardsFile.ledgerPath, {
2265
+ v: 1, version: pod.shardsFile!.version, phase: 'cut', shardId: action.shardId, files: [...action.files],
2266
+ host: action.kind === 'run' ? action.host : prior?.host ?? null, executor: 'pod',
2267
+ imageDigest: prior?.imageDigest ?? null, commit, envFingerprint, startedAt: null, endedAt: null,
2268
+ observedAt: new Date().toISOString(), state: action.kind === 'reuse' ? 'done' : 'pending',
2269
+ rc: null, pass: null, fail: null, errors: null, ran: null, failureIds: prior?.failureIds ?? null,
2270
+ errorIds: prior?.errorIds ?? null, attribution: action.kind === 'reuse' ? 'complete' : 'unmeasured',
2271
+ logPath: null, junitPath: null, stopReason: null, attemptId: null, reuseDecision: decision, reuseReason: reason,
2272
+ }); } catch (error) { debug.log('gate.receipt', 'reuse-ledger-write-failed', { shardId: action.shardId, error: String(error) }); }
2273
+ }
2274
+ }
1956
2275
  // Leave ordinary shards to the live free-slot scheduler. A static plan can pick a busy member
1957
2276
  // while another is idle; pin only a capability or a deliberate cross-host replacement.
1958
2277
  const hostPins = new Map(hostPlan.flatMap((item) => item.kind === 'run'
@@ -1975,7 +2294,7 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
1975
2294
  const admissionWaitSeconds = pod.admissionWaitSeconds ?? gateAdmissionWaitSeconds(shards.length, rootSlots);
1976
2295
  if (!Number.isSafeInteger(admissionWaitSeconds) || admissionWaitSeconds < 0) throw new Error('invalid pod sweep options');
1977
2296
  // An injected pool (tests) runs without admission unless `pod.admission` is passed; the gate's own pool asks it.
1978
- const gateAdmission = pod.admission ?? tools.admission ?? (poolOverride ? undefined : poolGateAdmission(poolScheduler));
2297
+ const gateAdmission = pod.admission ?? tools.admission ?? (poolOverride ? undefined : poolGateAdmission(poolScheduler, tools.graphRunId ?? null));
1979
2298
  debug.log('release-loop.gate', 'pod-admission', { waitSeconds: admissionWaitSeconds, source: pod.admissionWaitSeconds !== undefined ? 'config' : 'default', enabled: !!gateAdmission && admissionWaitSeconds > 0,
1980
2299
  rootSlots, shards: shards.length });
1981
2300
  // GATE-POD-STALL-FAILFAST: a shard with no test output within the stall window is stopped and recorded unmeasured.
@@ -2106,7 +2425,6 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2106
2425
  })) });
2107
2426
  reportProgress();
2108
2427
  const filesById = new Map(shards.map((item, index) => [`pod-${index}`, [...item.files]]));
2109
- const detailsById = new Map<string, Partial<GateShardLedgerRow>>();
2110
2428
  const observeShard = (row: GateShard) => {
2111
2429
  if (!pod.shardsFile?.ledgerPath || !pod.shardsFile.envFingerprint) return;
2112
2430
  const detail = detailsById.get(row.id) ?? {};
@@ -2122,7 +2440,7 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2122
2440
  state: row.state, rc: row.rc ?? null, pass: detail.pass ?? null, fail: detail.fail ?? null,
2123
2441
  errors: detail.errors ?? null, ran: detail.ran ?? null,
2124
2442
  failureIds: detail.failureIds ?? null, errorIds: detail.errorIds ?? null,
2125
- attribution: detail.attribution ?? 'unmeasured', logPath, junitPath,
2443
+ attribution: detail.attribution ?? 'unmeasured', reuseDecision: detail.reuseDecision, reuseReason: detail.reuseReason, logPath, junitPath,
2126
2444
  stopReason: detail.stopReason ?? row.waitReason ?? null, attemptId: row.attemptId ?? null,
2127
2445
  });
2128
2446
  } catch (error) { debug.log('release-loop.gate', 'shard-ledger-write-failed', { shard: row.id, error: String(error) }, { level: 'warn' }); }
@@ -2178,7 +2496,7 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2178
2496
  failureIds.push(...parsed.failures); errorIds.push(...parsed.errors);
2179
2497
  } catch { attributed = false; }
2180
2498
  }
2181
- const detail: Partial<GateShardLedgerRow> = { ...(detailsById.get(id) ?? {}), ...counts, failureIds: attributed ? [...new Set(failureIds)].sort() : null,
2499
+ const detail: GateShardDetail = { ...(detailsById.get(id) ?? {}), ...counts, failureIds: attributed ? [...new Set(failureIds)].sort() : null,
2182
2500
  errorIds: attributed ? [...new Set(errorIds)].sort() : null, attribution: attributed ? 'complete' : 'unmeasured',
2183
2501
  stopReason: done.stalled.map((item) => item.reason).join(', ') || null };
2184
2502
  detailsById.set(id, detail);
@@ -2355,7 +2673,8 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2355
2673
  stamp('poolPlaced'); jobContext = member.context; jobContextForCapture = member.context; placedOn = member.context; placed();
2356
2674
  if (branch === '-tail') tailPlacedHost = member.context;
2357
2675
  }, skipMembers, depth === 0 && branch === '' && hostRetries === 0 && !retriedNoOutput && !batchIsolation && skipMembers.size === 0), clone: true, source: { kind: 'commit', sha: commit },
2358
- ...(pod.imagePin === 'cut-commit' ? { imageCommit: commit } : {}), deadlineSeconds: shardDeadline,
2676
+ ...(pod.imagePin === 'cut-commit' || pod.pinnedImageDigest || pod.pinnedRunId ? { imageCommit: commit } : {}),
2677
+ ...(pod.pinnedImageDigest || pod.pinnedRunId ? { syncImages: pinnedGateImageSync(pod, commit)! } : {}), deadlineSeconds: shardDeadline,
2359
2678
  ...gateHostMirror(pod),
2360
2679
  ...(multiHost ? { statusUnreadableMs: memberUnreadableSeconds * 1000 } : {}),
2361
2680
  ...(bunCache ? { bunCache } : {}),
@@ -2517,7 +2836,14 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2517
2836
  }
2518
2837
  }
2519
2838
  const installSeconds = parseInstallSeconds(output ?? '');
2520
- if (imageDigest) detailsById.set(`pod-${shard}${branch}`, { ...(detailsById.get(`pod-${shard}${branch}`) ?? {}), imageDigest });
2839
+ detailsById.set(`pod-${shard}${branch}`, { ...(detailsById.get(`pod-${shard}${branch}`) ?? {}),
2840
+ ...(imageDigest ? { imageDigest } : {}), ...(runtimeIdentity ? { runtimeIdentity } : {}) });
2841
+ if (!reused) {
2842
+ const rootId = `pod-${shard}`;
2843
+ executionsByShard.set(rootId, [...(executionsByShard.get(rootId) ?? []), {
2844
+ branch, attemptId, imageDigest, runtimeIdentity: runtimeIdentity ?? null, host: placedOn ?? board[rowIndex(shard, branch)]?.host ?? (poolScheduler.members.length === 1 ? poolScheduler.members[0]?.context : undefined) ?? null,
2845
+ }]);
2846
+ }
2521
2847
  // GATE-TIMEOUT-HEAL ③: a cut shard is «reason: timeout» (with the files that still finished), not a bare rc=null.
2522
2848
  if (!reused && !descent) debug.log('release-loop.gate', 'pod-shard', { shard, files: paths, durationMs, rc: rc ?? null, attempt: depth + 1, installSeconds, gateDeps: parseGateDeps(output ?? ''), deadlineSeconds: shardDeadline, parts: parts.length, ...(placedOn ? { host: placedOn } : {}),
2523
2849
  ...(testSeconds !== undefined ? { testSeconds } : {}),
@@ -2796,7 +3122,7 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2796
3122
  const receiptAttempt = receiptRoot ? nextGateShardAttempt(receiptRoot, shardId) : 1;
2797
3123
  if (receiptRoot && base40 && envFingerprint) {
2798
3124
  try {
2799
- markGateShardUnmeasured(receiptRoot, { id: shardId, files: [...item.files], head40: commit, base40,
3125
+ markGateShardUnmeasured(receiptRoot, { id: shardId, files: [...item.files], version: pod.shardsFile!.version, graphSha: currentGraphPins?.graphSha ?? '', recipeSha: currentGraphPins?.recipeSha ?? '', head40: commit, base40,
2800
3126
  host: 'pending', envKey: `${envFingerprint}:${expectedImageDigest ?? 'unmeasured'}`, status: 'unmeasured',
2801
3127
  failureIds: [], errorIds: [], evidencePath: 'pending', evidenceSha256: '0'.repeat(64),
2802
3128
  measuredAt: new Date().toISOString(), attempt: receiptAttempt });
@@ -2818,18 +3144,34 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2818
3144
  markShard(shard, { state, rc: done.stalled.length || done.runs.some((run) => run.fail || run.errors) ? 1 : 0, endedAt: new Date().toISOString() }, ['waitReason']);
2819
3145
  recordShardResult(`pod-${shard}`, done);
2820
3146
  if (receiptRoot && base40 && envFingerprint && !done.stalled.length) {
2821
- const imageDigest = detailsById.get(shardId)?.imageDigest;
2822
- const attribution = detailsById.get(shardId)?.attribution;
2823
- const row = board[shard];
2824
- if (imageDigest && row?.host && attribution === 'complete') {
3147
+ const executionRows = executionsByShard.get(shardId) ?? [];
3148
+ const executionEvidenceComplete = executionRows.length > 0
3149
+ && executionRows.every((execution) => !!execution.imageDigest && !!execution.runtimeIdentity && !!execution.host);
3150
+ const imageDigests = [...new Set(executionRows.map((execution) => execution.imageDigest).filter((value): value is string => !!value))];
3151
+ const runtimes = [...new Map(executionRows.flatMap((execution) => execution.runtimeIdentity
3152
+ ? [[JSON.stringify(execution.runtimeIdentity), execution.runtimeIdentity] as const] : [])).values()];
3153
+ const imageDigest = imageDigests.length === 1 ? imageDigests[0] : undefined;
3154
+ const runtimeIdentity = runtimes.length === 1 ? runtimes[0] : undefined;
3155
+ const detail = detailsById.get(shardId);
3156
+ if (imageDigest && runtimeIdentity) { const { imageDigest: _oldImageDigest, ...detailWithoutImage } = detail ?? {}; detailsById.set(shardId, { ...detailWithoutImage, imageDigest, runtimeIdentity }); }
3157
+ const attribution = detail?.attribution;
3158
+ const executionHosts = [...new Set(executionRows.map((execution) => execution.host).filter((host): host is string => !!host))];
3159
+ const executedHost = executionHosts[0];
3160
+ if (executionEvidenceComplete && imageDigest && runtimeIdentity && executedHost && currentGraphPins && attribution === 'complete') {
2825
3161
  try {
2826
3162
  saveGateShardResult(receiptRoot, { receipt: { id: shardId, files: [...item.files], head40: commit, base40,
2827
- host: row.host, envKey: `${envFingerprint}:${imageDigest}`, status: 'complete',
2828
- failureIds: detailsById.get(shardId)?.failureIds ?? [], errorIds: detailsById.get(shardId)?.errorIds ?? [],
3163
+ version: pod.shardsFile!.version, graphRunId: tools.graphRunId ?? undefined, graphSha: currentGraphPins!.graphSha, recipeSha: currentGraphPins!.recipeSha,
3164
+ graphEntry: currentGraphPins?.graphEntry, recipeCommand: currentGraphPins?.recipeCommand, recipeTimeoutMs: currentGraphPins?.recipeTimeoutMs,
3165
+ host: executedHost, envKey: `${envFingerprint}:${imageDigest}`, envFingerprint, imageDigest, runtimeIdentity,
3166
+ executions: executionRows.map((execution) => ({ branch: execution.branch, attemptId: execution.attemptId,
3167
+ host: execution.host!, imageDigest: execution.imageDigest!, runtimeIdentity: execution.runtimeIdentity! })), status: 'complete',
3168
+ failureIds: detail?.failureIds ?? [], errorIds: detail?.errorIds ?? [],
2829
3169
  evidencePath: 'pending', evidenceSha256: '0'.repeat(64), measuredAt: new Date().toISOString(),
2830
3170
  attempt: receiptAttempt }, runs: done.runs });
2831
3171
  } catch (error) { debug.log('release-loop.gate', 'shard-receipt-write-failed', { shard: shardId, error: String(error) }, { level: 'warn' }); }
2832
- }
3172
+ } else debug.log('release-loop.gate', 'shard-receipt-not-saved', { shard: shardId,
3173
+ missingImageDigest: !imageDigest, missingRuntimeIdentity: !runtimeIdentity, executionEvidenceComplete,
3174
+ executedHost: executedHost ?? null, attribution: attribution ?? 'unmeasured' });
2833
3175
  }
2834
3176
  return done;
2835
3177
  } catch (error) {
@@ -2982,7 +3324,9 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2982
3324
  let producer: RunPodCommandOptions['warmProducer'];
2983
3325
  if (leased && replay?.transport.status === 'observed' && replay.transport.reason === 'complete') {
2984
3326
  if (warmCommandMatchesRequest(leased, warmRequest!) && leased.podName && leased.podUid
2985
- && leased.podContext && leased.image?.endsWith(`@${leased.key.imageDigest}`)) {
3327
+ && leased.podContext && leased.image?.endsWith(`@${leased.key.imageDigest}`)
3328
+ && (!pod.pinnedImageDigest || (normalizeGateImageDigest(pod.pinnedImageDigest) !== null
3329
+ && normalizeGateImageDigest(leased.key.imageDigest) === normalizeGateImageDigest(pod.pinnedImageDigest)))) {
2986
3330
  producer = { pod: leased.podName, podUid: leased.podUid, context: leased.podContext, image: leased.image,
2987
3331
  commit, files: ['package.json', 'bun.lock'] };
2988
3332
  } else await quarantine('gate-producer-identity');
@@ -2996,7 +3340,9 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
2996
3340
  run: process.env.ELANOUS_RUN_ID || attemptId, phase: 'release-gate', requestedAt: new Date().toISOString(),
2997
3341
  graphNode: 'gate-triage', commit, reason: `release gate recheck ${files.length} files`, pool: pod.pool,
2998
3342
  memReq: POD_ISOLATION_MEMORY_LIMIT, warmReused: !!producer },
2999
- source: { kind: 'commit', sha: commit }, deadlineSeconds, ...(producer ? { warmProducer: producer, image: producer.image, imageCommit: commit } : {}),
3343
+ source: { kind: 'commit', sha: commit }, deadlineSeconds, ...(producer ? { warmProducer: producer, image: producer.image } : {}),
3344
+ ...(producer || pod.pinnedImageDigest || pod.pinnedRunId ? { imageCommit: commit } : {}),
3345
+ ...(pod.pinnedImageDigest || pod.pinnedRunId ? { syncImages: pinnedGateImageSync(pod, commit)! } : {}),
3000
3346
  ...(bunCache ? { bunCache } : {}), ...gateHostMirror(pod),
3001
3347
  ...(installSlots > 0 ? { installSlots: POD_INSTALL_SLOTS_HOST_PATH } : {}), ...(pod.cpu ? { cpu: pod.cpu } : {}),
3002
3348
  memoryLimit: POD_ISOLATION_MEMORY_LIMIT, name: `gate-recheck-${randomUUID()}`, command: ['bash', '-lc', shell] });
@@ -3137,7 +3483,10 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
3137
3483
  }
3138
3484
  }
3139
3485
  observation = { files: [...files], attemptId, status, reason, quarantined, finalized,
3140
- cutSha: replay.command.cutSha, baselineSha: replay.command.baselineSha, workerKey: replay.command.key };
3486
+ cutSha: replay.command.cutSha, baselineSha: replay.command.baselineSha, workerKey: replay.command.key,
3487
+ leaseEvidence: { workerId: replay.command.workerId, leaseId: replay.command.leaseId, generation: replay.command.generation,
3488
+ expectedLockHash: replay.command.key.lockHash, workerLockHash: replay.transport.reply?.key?.lockHash ?? '',
3489
+ leaseValid: finalized, canaryPassed: decision.reason === 'match' && finalized, agree: decision.reason === 'match' } };
3141
3490
  }
3142
3491
  } catch (error) {
3143
3492
  observation = { files: [...files], attemptId, status: 'unmeasured', reason: String(error), quarantined: 'unavailable' };
@@ -3184,7 +3533,7 @@ export function createGateRunner(repo: string, remote?: string, commandOverride?
3184
3533
  const onlySet = only ? new Set(only) : undefined;
3185
3534
  const missing = only?.filter((file) => !allFiles.includes(file)) ?? [];
3186
3535
  if (missing.length) throw new Error(`partial plan file missing at this commit: ${missing.slice(0, 5).join(', ')}`);
3187
- const files = onlySet ? allFiles.filter((file) => onlySet.has(file)) : allFiles;
3536
+ let files = onlySet ? allFiles.filter((file) => onlySet.has(file)) : allFiles;
3188
3537
  const groups = onlySet ? [{ name: 'partial', paths: files }] : [
3189
3538
  { name: 'src-cli', paths: ['src/cli'] },
3190
3539
  { name: 'src-rest', paths: [...new Set(files.filter((f) => f.startsWith('src/') && !f.startsWith('src/cli/')).map((f) => f.split('/').length === 2 ? f : f.split('/').slice(0, 2).join('/')))] },
@@ -3349,9 +3698,24 @@ export function saveBaselineFileCache(ledger: string, commit: string, rows: Base
3349
3698
  } finally { if (existsSync(temp)) rmSync(temp); }
3350
3699
  }
3351
3700
 
3352
- export async function judgeGate(opts: GateOptions, runner: GateRunner = createGateRunner(opts.repo ?? process.cwd(), opts.remote),
3701
+ class InvalidPodSweepOptionsError extends Error {
3702
+ constructor() {
3703
+ super('invalid pod sweep options');
3704
+ this.name = 'InvalidPodSweepOptionsError';
3705
+ }
3706
+ }
3707
+
3708
+ function assertValidPodSweepOptions(opts: GateOptions): void {
3709
+ if (opts.pod && (!opts.pod.pool || !Number.isSafeInteger(opts.pod.shards ?? 24) || (opts.pod.shards ?? 24) < 1
3710
+ || !Number.isSafeInteger(opts.pod.shardTimeoutSeconds ?? 1200) || (opts.pod.shardTimeoutSeconds ?? 1200) < 1)) {
3711
+ throw new InvalidPodSweepOptionsError();
3712
+ }
3713
+ }
3714
+
3715
+ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGateRunner(opts.repo ?? process.cwd(), opts.remote, undefined, undefined, undefined, undefined, { graphRunId: opts.graphRunId ?? null }),
3353
3716
  imageProbe: typeof preflightGateImageDigest = preflightGateImageDigest,
3354
- identityProbe: typeof preflightGateExecutionIdentity = preflightGateExecutionIdentity): Promise<GateResult> {
3717
+ identityProbe: typeof preflightGateExecutionIdentity = preflightGateExecutionIdentity,
3718
+ syncImages: typeof syncPoolImages = syncPoolImages): Promise<GateResult> {
3355
3719
  if (opts.pod?.warmReplay) opts = { ...opts, pod: { ...opts.pod,
3356
3720
  warmShadowScope: { requested: false, attempts: 0 } } };
3357
3721
  const explicitConfig = getElanousConfigDirOverride();
@@ -3409,8 +3773,7 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3409
3773
  catch (error) { debug.log('release-loop.gate', 'radius-shadow-unavailable', { reason: String(error) }); }
3410
3774
  if (!Number.isSafeInteger(opts.recheckFileLimit ?? GATE_HOST_RECHECK_FILE_LIMIT) || (opts.recheckFileLimit ?? GATE_HOST_RECHECK_FILE_LIMIT) < 1)
3411
3775
  throw new Error('invalid gate recheck file limit');
3412
- if (opts.pod && (!opts.pod.pool || !Number.isSafeInteger(opts.pod.shards ?? 24) || (opts.pod.shards ?? 24) < 1
3413
- || !Number.isSafeInteger(opts.pod.shardTimeoutSeconds ?? 1200) || (opts.pod.shardTimeoutSeconds ?? 1200) < 1)) throw new Error('invalid pod sweep options');
3776
+ assertValidPodSweepOptions(opts);
3414
3777
  if (opts.pod && opts.graphRunId) {
3415
3778
  const components = opts.pod.pool.split(',').map((part) => part.trim()).filter(Boolean);
3416
3779
  const members = parsePodPool(opts.pod.pool);
@@ -3430,11 +3793,22 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3430
3793
  const pinPath = gateImagePinPath(root, opts.version, pinRunId);
3431
3794
  const gateImageTag = `${podCommandImageFor([], true).split(':')[0]}:${opts.commit.slice(0, 12)}`;
3432
3795
  let savedPin: ReturnType<typeof readGateImagePin>;
3796
+ let supersededPin: ReturnType<typeof readGateImagePinForRun> = null;
3797
+ let stalePinNeedsSuperseding = false;
3433
3798
  try { savedPin = existsSync(pinPath) ? readGateImagePin(pinPath, pinRunId, gateImageTag, opts.commit) : null; }
3434
3799
  catch (error) {
3435
- debug.log('release-loop.gate', 'image-pin', { runId: pinRunId, currentImages, decision: 'fail-closed',
3436
- reason: 'saved-image-pin-invalid', error: String(error).slice(0, 300) }, { level: 'error' });
3437
- throw new Error('gate resume refused: saved image digest pin is invalid');
3800
+ let prior: ReturnType<typeof readGateImagePinForRun> = null;
3801
+ try { prior = readGateImagePinForRun(pinPath, pinRunId, gateImageTag); } catch { /* Keep invalid or corrupt pins fail-closed. */ }
3802
+ if (!prior || prior.commit === opts.commit.toLowerCase()) {
3803
+ debug.log('release-loop.gate', 'image-pin', { runId: pinRunId, currentImages, decision: 'fail-closed',
3804
+ reason: 'saved-image-pin-invalid', error: String(error).slice(0, 300) }, { level: 'error' });
3805
+ throw new Error('gate resume refused: saved image digest pin is invalid');
3806
+ }
3807
+ supersededPin = prior;
3808
+ stalePinNeedsSuperseding = true;
3809
+ savedPin = null;
3810
+ debug.log('release-loop.gate', 'image-pin', { runId: pinRunId, currentImages, decision: 'stale-tip-detected',
3811
+ priorCommit: supersededPin.commit, nextCommit: opts.commit.toLowerCase() });
3438
3812
  }
3439
3813
  const savedDigest = savedPin?.digest ?? null;
3440
3814
  let previouslyExecuted = false;
@@ -3449,11 +3823,39 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3449
3823
  } catch { previouslyExecuted = true; }
3450
3824
  }
3451
3825
  }
3452
- if (!savedDigest && previouslyExecuted) {
3826
+ if (!savedDigest && previouslyExecuted && !supersededPin) {
3453
3827
  debug.log('release-loop.gate', 'image-pin', { runId: opts.graphRunId, savedDigest: null, currentImages,
3454
3828
  decision: 'fail-closed', reason: 'resume-pin-missing' }, { level: 'error' });
3455
3829
  throw new Error('gate resume refused: saved image digest pin is missing');
3456
3830
  }
3831
+ const hasPoolImage = [...poolImages.values()].some((images) => images.some((image) => normalizeGateImageDigest(image) !== null));
3832
+ if (!savedDigest && !hasPoolImage) {
3833
+ let syncResults: Awaited<ReturnType<typeof syncPoolImages>>;
3834
+ const stopImageSyncWatch = startReleaseStageStallWatch({ runId: pinRunId, nodeId: 'gate' }, {
3835
+ graphId: opts.graphId ?? '', dryRun: opts.dryRun === true,
3836
+ });
3837
+ try { syncResults = await syncImages(members, podCommandImageFor([], true), opts.commit); }
3838
+ catch (error) {
3839
+ debug.log('release-loop.gate', 'image-pin', { runId: pinRunId, decision: 'fail-closed',
3840
+ reason: 'initial-image-sync-failed', error: String(error).slice(0, 300) }, { level: 'error' });
3841
+ throw new Error('gate image pin refused: initial image sync failed');
3842
+ } finally {
3843
+ stopImageSyncWatch();
3844
+ }
3845
+ const failedSyncs = memberSpecs.filter((member) => !syncResults.get(member.context)?.ok);
3846
+ if (failedSyncs.length) {
3847
+ debug.log('release-loop.gate', 'image-pin', { runId: pinRunId, decision: 'fail-closed', reason: 'initial-image-sync-failed',
3848
+ failed: failedSyncs.map((member) => ({ context: member.context, result: syncResults.get(member.context) ?? null })) }, { level: 'error' });
3849
+ throw new Error('gate image pin refused: initial image sync failed');
3850
+ }
3851
+ for (const member of memberSpecs) {
3852
+ const digest = imageProbe(member.spec, opts.commit);
3853
+ currentImages[member.context] = digest;
3854
+ poolImages.set(member.context, digest ? [digest] : []);
3855
+ }
3856
+ debug.log('release-loop.gate', 'image-pin', { runId: pinRunId, decision: 'initial-image-sync',
3857
+ outcomes: [...syncResults].map(([context, result]) => ({ context, ok: result.ok, action: result.action })), currentImages });
3858
+ }
3457
3859
  const resolution = resolveGateImagePin({ ...(savedDigest ? { savedDigest } : {}),
3458
3860
  ...(!savedDigest ? { initialDigest: [...poolImages.values()].flat().find(Boolean) ?? null } : {}), poolImages });
3459
3861
  if (!resolution.ok) {
@@ -3464,7 +3866,11 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3464
3866
  const selected = memberSpecs.filter((member) => resolution.eligiblePools.includes(member.context));
3465
3867
  if (!selected.length) throw new Error('gate image pin refused: no eligible pool');
3466
3868
  if (!savedDigest) {
3467
- try { writeGateImagePin(pinPath, pinRunId, resolution.digest, gateImageTag, opts.commit); }
3869
+ try {
3870
+ if (stalePinNeedsSuperseding) {
3871
+ replaceGateImagePin(pinPath, pinRunId, resolution.digest, gateImageTag, opts.commit, gateImageTag, supersededPin!.commit);
3872
+ } else writeGateImagePin(pinPath, pinRunId, resolution.digest, gateImageTag, opts.commit);
3873
+ }
3468
3874
  catch (error) {
3469
3875
  debug.log('release-loop.gate', 'image-pin', { runId: pinRunId, pinnedDigest: resolution.digest,
3470
3876
  currentImages, decision: 'fail-closed', reason: 'pin-write-failed', error: String(error).slice(0, 300) }, { level: 'error' });
@@ -3523,10 +3929,10 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3523
3929
  const explicitPartial = opts.full ? null : partialRead.plan;
3524
3930
  const rehearsalStampPresent = ['hard-5h', 'hard-mid'].some((step) =>
3525
3931
  existsSync(join(root, 'release', opts.version, 'rehearsal', `${step}.json`)));
3526
- const currentIdentity = !opts.full && !explicitPartial && opts.graphRunId && opts.pod && rehearsalStampPresent
3932
+ const currentIdentity = !opts.full && !explicitPartial && opts.graphRunId && opts.pod
3527
3933
  ? identityProbe(opts.pod.pool, process.env, opts.commit) : null;
3528
3934
  const currentImage = currentIdentity?.imageDigest ?? (!opts.full && !explicitPartial
3529
- && opts.graphRunId && opts.pod && rehearsalStampPresent ? imageProbe(opts.pod.pool, opts.commit) : null);
3935
+ && opts.graphRunId && opts.pod ? imageProbe(opts.pod.pool, opts.commit) : null);
3530
3936
  const receiptImage = currentImage ?? (opts.graphRunId && opts.pod && process.env.ELANOUS_GRAPH_CONTEXT
3531
3937
  ? imageProbe(opts.pod.pool, opts.commit) : null);
3532
3938
  const receiptBase = opts.baselineCommit ?? (roots.some((location) =>
@@ -3554,18 +3960,100 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3554
3960
  debug.log('release-loop.gate', 'train-receipt-plan-failed', { version: opts.version, reason: String(error).slice(0, 240) });
3555
3961
  }
3556
3962
  }
3963
+ // The same graph run's previous formal gate is the fallback when train receipts cannot carry.
3964
+ // Diff paths are resolved through imports and literal file consumers; unverifiable closure fails closed.
3965
+ let formalReceiptFallback: { priorCommit: string; files: string[]; priorFailures: string[]; priorErrors: string[] } | null = null;
3966
+ const formalReceiptRoot = join(ledger, 'release', opts.version, 'gate-logs', 'cut', 'receipts');
3967
+ const formalNames = existsSync(formalReceiptRoot) ? readdirSync(formalReceiptRoot).filter((name) => /^pod-\d+\.receipt\.json$/.test(name)) : [];
3968
+ const formalRows = formalNames.sort((a, b) => Number(a.slice(4).split('.')[0]) - Number(b.slice(4).split('.')[0]))
3969
+ .map((name) => readGateShardManifest(formalReceiptRoot, name.replace('.receipt.json', '')));
3970
+ const priorHead = formalRows[0]?.head40;
3971
+ let formalInventoryReason = 'formal-receipt-test-inventory-unreadable';
3972
+ let formalInventoryComplete = false;
3973
+ let formalPayloadComplete = false;
3974
+ if (priorHead && formalRows.length) {
3975
+ try {
3976
+ const priorTests = gateAssignableTestsAtCommit(repo, priorHead);
3977
+ const receiptFiles = formalRows.flatMap((row) => row?.files ?? []);
3978
+ formalInventoryComplete = !!priorTests
3979
+ && formalRows.every((row, index) => row?.id === 'pod-' + index && row.status === 'complete')
3980
+ && new Set(receiptFiles).size === receiptFiles.length
3981
+ && JSON.stringify([...receiptFiles].sort()) === JSON.stringify([...(priorTests ?? [])].sort());
3982
+ formalInventoryReason = priorTests ? 'formal-receipt-shard-inventory-incomplete' : formalInventoryReason;
3983
+ formalPayloadComplete = formalInventoryComplete && formalRows.every((row) => !!row
3984
+ && !!readGateShardResult(formalReceiptRoot, { shard: row, head40: row.head40, base40: row.base40, envKey: row.envKey }));
3985
+ } catch { formalInventoryComplete = false; formalPayloadComplete = false; }
3986
+ }
3987
+ const formalIdentity = currentIdentity && currentImage ? { ...currentIdentity, imageDigest: currentImage } : null;
3988
+ let formalReason = !formalRows.length ? 'formal-receipt-set-absent'
3989
+ : formalRows.some((row) => !row || row.status !== 'complete') ? 'formal-receipt-set-incomplete'
3990
+ : formalRows.some((row) => row!.version !== opts.version) ? 'formal-receipt-version-mismatch'
3991
+ : !formalInventoryComplete ? formalInventoryReason
3992
+ : !formalPayloadComplete ? 'formal-receipt-payload-incomplete'
3993
+ : formalRows.some((row) => row!.graphRunId !== opts.graphRunId) ? 'formal-receipt-run-id-missing-or-mismatch'
3994
+ : !receiptBase ? 'formal-receipt-base40-unmeasured'
3995
+ : formalRows.some((row) => row!.base40 !== receiptBase) ? 'formal-receipt-base40-mismatch'
3996
+ : !gateGraphPins(root, opts.graphRunId) ? 'formal-receipt-graph-pins-unmeasured'
3997
+ : formalRows.some((row) => !/^[a-f0-9]{64}$/i.test(row!.graphSha) || !/^[a-f0-9]{64}$/i.test(row!.recipeSha)
3998
+ || row!.graphSha !== formalRows[0]!.graphSha || row!.recipeSha !== formalRows[0]!.recipeSha) ? 'formal-receipt-graph-pins-missing-or-mixed'
3999
+ : !gateShardRecipeIdentityAtCommit(repo, opts.commit) ? 'formal-receipt-recipe-identity-unmeasured'
4000
+ : formalRows.some((row) => !row!.graphEntry || !row!.recipeCommand || !Number.isSafeInteger(row!.recipeTimeoutMs)
4001
+ || row!.graphEntry !== formalRows[0]!.graphEntry || row!.recipeCommand !== formalRows[0]!.recipeCommand
4002
+ || row!.recipeTimeoutMs !== formalRows[0]!.recipeTimeoutMs) ? 'formal-receipt-recipe-identity-missing-or-mixed'
4003
+ : !formalIdentity ? 'current-image-or-runtime-unmeasured'
4004
+ : formalRows.some((row) => row!.head40 !== priorHead) ? 'formal-receipt-heads-mixed'
4005
+ : formalRows.some((row) => row!.runtimeIdentity?.baseImageDigest !== formalIdentity.baseImageDigest) ? 'formal-receipt-environment-baseImageDigest-mismatch'
4006
+ : formalRows.some((row) => row!.envFingerprint !== formalIdentity.envFingerprint
4007
+ || JSON.stringify(row!.runtimeIdentity) !== JSON.stringify({ bunVersion: formalIdentity.bunVersion, platform: formalIdentity.platform,
4008
+ architecture: formalIdentity.architecture, envFingerprint: formalIdentity.envFingerprint, baseImageDigest: formalIdentity.baseImageDigest })) ? 'formal-receipt-environment-mismatch'
4009
+ : formalRows.some((row) => row!.imageDigest !== formalRows[0]!.imageDigest) ? 'formal-receipt-image-set-mixed'
4010
+ : formalRows.some((row) => !gateRuntimeSourceFingerprint(repo, row!.head40, row!.runtimeIdentity)
4011
+ || gateRuntimeSourceFingerprint(repo, row!.head40, row!.runtimeIdentity) !== gateRuntimeSourceFingerprint(repo, opts.commit, formalIdentity))
4012
+ ? 'formal-receipt-runtime-fingerprint-mismatch'
4013
+ : 'formal-receipt-radius-unmeasured';
4014
+ if (formalReason === 'formal-receipt-radius-unmeasured' && priorHead && priorHead !== opts.commit) {
4015
+ try {
4016
+ const tests = gateAssignableTestsAtCommit(repo, opts.commit);
4017
+ const changed = changedFilesBetween(repo, priorHead, opts.commit);
4018
+ if (!tests) formalReason = 'formal-receipt-test-inventory-unreadable';
4019
+ else {
4020
+ const closure = testsReachingChanged(gitClosureTree(repo, opts.commit), changed, tests);
4021
+ if (!closure.ok) formalReason = 'formal-receipt-radius-opaque:' + closure.reason;
4022
+ else if (!closure.tests.length) formalReason = 'formal-receipt-no-consumers';
4023
+ else {
4024
+ formalReceiptFallback = { priorCommit: priorHead, files: closure.tests,
4025
+ priorFailures: formalRows.flatMap((row) => row?.failureIds ?? []), priorErrors: formalRows.flatMap((row) => row?.errorIds ?? []) };
4026
+ formalReason = 'formal-receipt-radius-proven';
4027
+ }
4028
+ }
4029
+ } catch (error) { formalReason = 'formal-receipt-radius-error:' + String(error).slice(0, 160); }
4030
+ }
4031
+ const formalFallbackSelected = !partial && formalReceiptFallback !== null;
4032
+ if (formalFallbackSelected && formalReceiptFallback) {
4033
+ partial = { version: opts.version, priorCommit: formalReceiptFallback.priorCommit, forCommit: opts.commit,
4034
+ files: formalReceiptFallback.files, priorFailures: formalReceiptFallback.priorFailures, priorErrors: formalReceiptFallback.priorErrors };
4035
+ }
4036
+ debug.log('release-loop.gate', 'formal-receipt-fallback', { runId: opts.graphRunId, version: opts.version,
4037
+ priorCommit: priorHead ?? null, commit: opts.commit, reason: formalReason,
4038
+ changedFiles: priorHead && priorHead !== opts.commit ? (() => { try { return changedFilesBetween(repo, priorHead, opts.commit).length; } catch { return null; } })() : 0,
4039
+ selectedTests: formalReceiptFallback?.files.length ?? 0,
4040
+ carriedTests: formalReceiptFallback ? Math.max(0, formalRows.reduce((sum, row) => sum + (row?.files.length ?? 0), 0) - formalReceiptFallback.files.length) : 0,
4041
+ action: formalFallbackSelected ? 'radius-regate' : partial ? 'existing-plan-preserved' : 'full-sweep' });
3557
4042
  if (trainReceiptPlan) {
3558
4043
  result.trainReceiptReuse = { carried: trainReceiptPlan.carriedFiles.length, total: trainReceiptPlan.totalFiles,
3559
- receipts: trainReceiptPlan.receipts.length, reasons: trainReceiptPlan.reasons };
4044
+ receipts: trainReceiptPlan.receipts.length, reasons: [...trainReceiptPlan.reasons, ...(formalReceiptFallback ? [formalReason] : [])] };
3560
4045
  debug.log('release-loop.gate', 'train-receipt-plan', { version: opts.version, commit: opts.commit,
3561
4046
  carried: trainReceiptPlan.carriedFiles.length, total: trainReceiptPlan.totalFiles,
3562
4047
  ratio: trainReceiptPlan.carriedFiles.length / trainReceiptPlan.totalFiles,
3563
4048
  receipts: trainReceiptPlan.receipts, selectedFiles: trainReceiptPlan.files.length,
3564
- reasons: trainReceiptPlan.reasons, action: trainReceiptPlan.carriedFiles.length ? 'run-remaining-tests' : 'full-sweep' });
4049
+ reasons: [...trainReceiptPlan.reasons, ...(formalReceiptFallback ? [formalReason] : [])], action: formalFallbackSelected ? 'formal-receipt-radius-regate' : partial ? 'existing-plan-preserved' : trainReceiptPlan.carriedFiles.length ? 'run-remaining-tests' : 'full-sweep' });
3565
4050
  } else if (!opts.full && !explicitPartial && !radius?.plan) {
3566
4051
  debug.log('release-loop.gate', 'train-receipt-plan', { version: opts.version, commit: opts.commit,
3567
- carried: 0, total: null, ratio: 0, receipts: [], selectedFiles: null,
3568
- reasons: ['no safe receipt coverage'], action: 'full-sweep' });
4052
+ carried: formalReceiptFallback ? Math.max(0, formalRows.reduce((sum, row) => sum + (row?.files.length ?? 0), 0) - formalReceiptFallback.files.length) : 0,
4053
+ total: formalReceiptFallback ? formalRows.reduce((sum, row) => sum + (row?.files.length ?? 0), 0) : null,
4054
+ ratio: formalReceiptFallback ? (formalRows.reduce((sum, row) => sum + (row?.files.length ?? 0), 0) - formalReceiptFallback.files.length) / Math.max(1, formalRows.reduce((sum, row) => sum + (row?.files.length ?? 0), 0)) : 0,
4055
+ receipts: formalReceiptFallback ? formalRows.length : [], selectedFiles: formalReceiptFallback?.files.length ?? null,
4056
+ reasons: formalReceiptFallback ? [formalReason] : ['no safe receipt coverage'], action: formalFallbackSelected ? 'formal-receipt-radius-regate' : partial ? 'existing-plan-preserved' : 'full-sweep' });
3569
4057
  }
3570
4058
  }
3571
4059
  const explicitPodPlan = !!explicitPartial && explicitPartial.kind !== 'recheck' && !!opts.pod;
@@ -3644,7 +4132,8 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3644
4132
  ledgerPath: gateShardLedgerPath(opts.version, ledger), envFingerprint: gateEnvFingerprint(process.env),
3645
4133
  receiptRoot: join(ledger, 'release', opts.version, 'gate-logs', 'cut', 'receipts'),
3646
4134
  base40: receiptBase,
3647
- expectedImageDigest: receiptImage } } : undefined,
4135
+ expectedImageDigest: receiptImage, graphPins: opts.pod.shardsFile?.graphPins ?? gateSourcePins(repo, opts.commit),
4136
+ executionIdentity: currentIdentity ?? opts.pod.shardsFile?.executionIdentity ?? null, ...(selected?.priorCommit ? { radiusPriorCommit: selected.priorCommit } : {}) } } : undefined,
3648
4137
  selected?.files, (progress) => { latest = progress; emitProgress(); });
3649
4138
  emitProgress();
3650
4139
  return sweepResult;
@@ -3919,9 +4408,15 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3919
4408
  concurrency: opts.pod && runner.recheckPod ? recheckConcurrency : 1, executor: opts.pod && runner.recheckPod ? 'pod' : 'host',
3920
4409
  remote: opts.remote ?? null, podBatchFiles: opts.pod && runner.recheckPod && runner.recheckPodBatch ? GATE_RECHECK_POD_BATCH_FILES : 1 });
3921
4410
  const recheckStartedAt = clock();
3922
- const recordWarmShadow = (shadow?: WarmShadowObservation) => {
3923
- if (shadow && !result.warmShadow?.some((entry) => entry.attemptId === shadow.attemptId))
3924
- (result.warmShadow ??= []).push(shadow);
4411
+ const recordedWarmAttemptIds = new Set((result.warmShadow ?? []).map((entry) => entry.attemptId));
4412
+ const recordWarmShadow = async (shadow?: WarmShadowObservation) => {
4413
+ if (!shadow || recordedWarmAttemptIds.has(shadow.attemptId)) return;
4414
+ recordedWarmAttemptIds.add(shadow.attemptId);
4415
+ await journalWarmGateShadow(shadow, opts.commit, runner, opts.repo ?? process.cwd());
4416
+ {
4417
+ const { leaseEvidence: _leaseEvidence, ...persistedShadow } = shadow;
4418
+ (result.warmShadow ??= []).push(persistedShadow);
4419
+ }
3925
4420
  };
3926
4421
  const recheckFile = async (file: string, index: number) => {
3927
4422
  debug.log('release-loop.gate', 'isolated-recheck-progress',
@@ -3931,7 +4426,7 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3931
4426
  ? await runner.recheckPod(file, opts.commit, { ...opts.pod, warmCutSha: opts.commit, warmBaselineSha: baseSha,
3932
4427
  warmEligible: warmEligibleFiles.has(file) }, GATE_ISOLATED_TIMEOUT_MS)
3933
4428
  : await runner.command('bun', ['run', 'test:deterministic', asPath(file)], cutTree, GATE_ISOLATED_TIMEOUT_MS));
3934
- recordWarmShadow(cutCheck?.warmShadow);
4429
+ await recordWarmShadow(cutCheck?.warmShadow);
3935
4430
  if (cutCheck?.timedOut) {
3936
4431
  debug.log('release-loop.gate', 'isolated-timeout', { file, label: 'cut isolated', limitMs: GATE_ISOLATED_TIMEOUT_MS });
3937
4432
  result.stalledEnv.push({ file, reason: 'isolated-timeout', local: 'timeout' });
@@ -3957,7 +4452,7 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
3957
4452
  ? await runner.recheckPod(file, opts.commit, { ...opts.pod, warmCutSha: opts.commit, warmBaselineSha: baseSha,
3958
4453
  warmEligible: warmEligibleFiles.has(file) }, GATE_ISOLATED_TIMEOUT_MS, true)
3959
4454
  : await runner.command('bun', ['run', 'test:deterministic', asPath(file), '--timeout', String(GATE_TIMEOUT_RECHECK_MS)], cutTree, GATE_ISOLATED_TIMEOUT_MS);
3960
- recordWarmShadow(relaxed.warmShadow);
4455
+ await recordWarmShadow(relaxed.warmShadow);
3961
4456
  let flaky: string[] = [];
3962
4457
  let recheck: 'read' | 'timeout' | 'unreadable' = 'read';
3963
4458
  if (relaxed.timedOut) recheck = 'timeout';
@@ -4052,7 +4547,7 @@ export async function judgeGate(opts: GateOptions, runner: GateRunner = createGa
4052
4547
  }
4053
4548
  }
4054
4549
  for (const [file, run] of completed) {
4055
- recordWarmShadow(run.warmShadow);
4550
+ await recordWarmShadow(run.warmShadow);
4056
4551
  prefetchedCut.set(file, run);
4057
4552
  }
4058
4553
  if (failures.length) throw new SettledRecheckFailures(failures);
@@ -4274,6 +4769,28 @@ export function reservedGateHosts(opts: Pick<GateOptions, 'pod' | 'remote'>): st
4274
4769
  : [opts.remote?.split('@').at(-1) ?? hostname()];
4275
4770
  }
4276
4771
 
4772
+ export type GatePoolResourceProbe = (host: string, env: NodeJS.ProcessEnv, members: readonly PodPoolMember[]) => GateHostResourceReading;
4773
+
4774
+ export type GatePoolStartBlock = { host: string; reason: string; resources?: Pick<Extract<GateHostResourceReading, { status: 'measured' }>, 'reservations' | 'authoringLeases' | 'waitingJobs' | 'activeJobs'> };
4775
+
4776
+ /** The gate starts only after every host in its exclusive pool is measured empty. */
4777
+ export function releaseGatePoolStartBlock(opts: GateOptions, env: NodeJS.ProcessEnv,
4778
+ probe: GatePoolResourceProbe = (host, probeEnv, members) => readGateHostResourcesForHost(host, probeEnv, { members })): GatePoolStartBlock | null {
4779
+ if (!opts.pod) return null;
4780
+ let members: PodPoolMember[];
4781
+ try { members = parsePodPool(opts.pod.pool); }
4782
+ catch (error) { return { host: 'unknown', reason: `gate-pool-invalid: ${error instanceof Error ? error.message : String(error)}` }; }
4783
+ for (const host of reservedGateHosts(opts)) {
4784
+ const reading = probe(host, env, members);
4785
+ if (reading.status === 'unmeasurable') return { host, reason: `gate-pool-unmeasurable:${reading.reason}` };
4786
+ if (!reading.empty) return { host, reason: 'gate-host-busy', resources: {
4787
+ reservations: reading.reservations, authoringLeases: reading.authoringLeases,
4788
+ waitingJobs: reading.waitingJobs, activeJobs: reading.activeJobs,
4789
+ } };
4790
+ }
4791
+ return null;
4792
+ }
4793
+
4277
4794
  /** What was asked for, read best-effort when the options themselves were refused — so a failed gate still says which executor. */
4278
4795
  export function requestedGateExecutor(args: string[], env: NodeJS.ProcessEnv): { executor: string | null; host: string | null } {
4279
4796
  let executor: unknown;
@@ -4322,6 +4839,8 @@ export function parseOptions(args: string[], env: NodeJS.ProcessEnv): GateOption
4322
4839
  || !['darwin', 'linux'].includes((value as { os?: string }).os ?? ''))))
4323
4840
  throw new Error('gateShardCapabilities must map pod-N to {os: darwin|linux}');
4324
4841
  const opts: GateOptions = {
4842
+ ...(context?.graphId ? { graphId: context.graphId } : {}),
4843
+ dryRun: env.ELANOUS_GRAPH_DRY_RUN === '1',
4325
4844
  ...(fromGraph.gateImagePin === 'cut-commit' ? { imagePin: 'cut-commit' as const } : {}),
4326
4845
  rehearsalTui: fromGraph.rehearsalTui === true,
4327
4846
  recheckFileLimit: fromGraph.gateRecheckFileLimit !== undefined ? Number(fromGraph.gateRecheckFileLimit) : undefined,
@@ -4429,13 +4948,15 @@ export function parseOptions(args: string[], env: NodeJS.ProcessEnv): GateOption
4429
4948
  * `runner` is a seam for tests; the process entry passes none. */
4430
4949
  export async function runGateNode(argv: string[], env: NodeJS.ProcessEnv, runner?: GateRunner,
4431
4950
  judge: (opts: GateOptions, runner?: GateRunner, imageProbe?: typeof preflightGateImageDigest) => Promise<GateResult> = judgeGate,
4432
- imageProbe: typeof preflightGateImageDigest = preflightGateImageDigest): Promise<number> {
4951
+ imageProbe: typeof preflightGateImageDigest = preflightGateImageDigest,
4952
+ poolResourceProbe?: GatePoolResourceProbe): Promise<number> {
4433
4953
  const start = Date.now();
4434
- let result: GateResult;
4954
+ let result: GateResult | undefined;
4435
4955
  let version = '';
4436
4956
  let graphRunId: string | null = null;
4437
4957
  let autohealStoreRoot = '';
4438
4958
  let placement: { executor: string | null; host: string | null } | undefined;
4959
+ let warmControlCleanup: (() => Promise<void>) | undefined;
4439
4960
  try {
4440
4961
  const parsed = parseOptions(argv, env);
4441
4962
  let config: unknown = null;
@@ -4443,9 +4964,28 @@ export async function runGateNode(argv: string[], env: NodeJS.ProcessEnv, runner
4443
4964
  try { config = getUserConfig(); }
4444
4965
  catch (error) { debug.log('release-loop.gate', 'warm-profile-unavailable', { error: String(error) }); }
4445
4966
  }
4446
- const opts = parsed === 'help' ? parsed : withWarmGateHooks(parsed, config, !!runner);
4967
+ const opts = parsed === 'help' ? parsed : withWarmGateHooks(parsed, config, !!runner,
4968
+ cleanup => { warmControlCleanup = cleanup; });
4969
+ if (opts !== 'help' && opts.pod) {
4970
+ // Reject malformed shard settings before touching the live host pool.
4971
+ assertValidPodSweepOptions(opts);
4972
+ // Supplying a runner or judge is the node's existing simulation seam; never issue a real Kubernetes read from it.
4973
+ const probe = poolResourceProbe ?? (runner || judge !== judgeGate
4974
+ ? (() => ({ status: 'measured' as const, empty: true, reservations: 0, authoringLeases: 0, waitingJobs: 0, activeJobs: 0 }))
4975
+ : undefined);
4976
+ const occupied = releaseGatePoolStartBlock(opts, env, probe);
4977
+ if (occupied) {
4978
+ debug.log('release-loop.gate', 'gate-host-pool-preflight-blocked', { host: occupied.host, reason: occupied.reason,
4979
+ resources: occupied.resources ?? null, version: opts.version }, { level: 'error' });
4980
+ const counts = occupied.resources
4981
+ ? ` · reservations=${occupied.resources.reservations} · authoringLeases=${occupied.resources.authoringLeases} · waitingJobs=${occupied.resources.waitingJobs} · activeJobs=${occupied.resources.activeJobs}`
4982
+ : '';
4983
+ console.error(`🚨 release gate 즉시 차단 — gate 호스트 풀 ${occupied.host}: ${occupied.reason}${counts}`);
4984
+ throw new Error(`release gate host pool preflight blocked (${occupied.host}): ${occupied.reason}`);
4985
+ }
4986
+ }
4447
4987
  if (opts !== 'help' && opts.warmPrecutCanary) {
4448
- const canaryRunner = runner ?? createGateRunner(opts.repo ?? process.cwd(), opts.remote);
4988
+ const canaryRunner = runner ?? createGateRunner(opts.repo ?? process.cwd(), opts.remote, undefined, undefined, undefined, undefined, { graphRunId: opts.graphRunId ?? null });
4449
4989
  const warmPrecutTestSeam = (runner as (GateRunner & { warmPrecutCanaryTestSeam?: {
4450
4990
  config: unknown; hooks: Pick<NonNullable<GateOptions['pod']>, 'warmReplay' | 'warmFinalize' | 'warmQuarantine' | 'warmReuseConfig'>;
4451
4991
  } }) | undefined)?.warmPrecutCanaryTestSeam;
@@ -4481,9 +5021,18 @@ export async function runGateNode(argv: string[], env: NodeJS.ProcessEnv, runner
4481
5021
  try { result = await judge(context?.runId ? { ...opts, graphRunId: context.runId } : opts, runner, imageProbe); }
4482
5022
  finally { releaseHosts(); }
4483
5023
  } catch (error) {
4484
- result = { outcome: 'error', commit: '', introduced: [], preexisting: 0, fixed: 0, knownEnv: 0, knownEnvCleared: [], stalledEnv: [], rcNonzeroNoFailures: [], durationMs: Date.now() - start, error: String(error) };
5024
+ result = { outcome: 'error', commit: '', introduced: [], preexisting: 0, fixed: 0, knownEnv: 0, knownEnvCleared: [], stalledEnv: [], rcNonzeroNoFailures: [], durationMs: Date.now() - start,
5025
+ error: error instanceof InvalidPodSweepOptionsError ? error.message : String(error) };
4485
5026
  placement ??= requestedGateExecutor(argv, env);
5027
+ } finally {
5028
+ try { await warmControlCleanup?.(); }
5029
+ catch (error) {
5030
+ const reason = error instanceof Error ? error.message : String(error);
5031
+ debug.log('pod.warm.control-forward', 'cleanup-failed', { version, reason }, { level: 'error' });
5032
+ if (typeof result !== 'undefined') result = { ...result, outcome: 'error', error: [result.error, reason].filter(Boolean).join('; ') };
5033
+ }
4486
5034
  }
5035
+ if (!result) throw new Error('release gate returned without a result');
4487
5036
  if (versionPattern.test(version) && result.stalledShards?.length) {
4488
5037
  result.autoheals = result.stalledShards.map((shard, index) => {
4489
5038
  const shardKey = `pod-${shard.shard}`;