@joshuafolkken/kit 1.2116.0 → 1.3000.0

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 (2163) hide show
  1. package/.claude/agents/design-consultant.md +19 -0
  2. package/.claude/agents/investigator.md +12 -2
  3. package/.claude/agents/reviewer-verification.md +13 -2
  4. package/.claude/agents/reviewer.md +13 -2
  5. package/.claude/settings.json +32 -9
  6. package/.claude/skills/dependency-update/SKILL.md +11 -14
  7. package/.claude/skills/epic-commands/SKILL.md +8 -6
  8. package/.claude/skills/epic-commands/epic-bundle.md +6 -7
  9. package/.claude/skills/verify-ui/SKILL.md +13 -23
  10. package/.claude/skills/workflow-commands/SKILL.md +19 -18
  11. package/.claude/skills/workflow-commands/background-commands.md +7 -4
  12. package/.claude/skills/workflow-commands/backlogrun-child.md +31 -64
  13. package/.claude/skills/workflow-commands/backlogrun-lanes.md +54 -62
  14. package/.claude/skills/workflow-commands/backlogrun-park.md +65 -64
  15. package/.claude/skills/workflow-commands/backlogrun-progress.md +30 -44
  16. package/.claude/skills/workflow-commands/backlogrun-recovery.md +18 -33
  17. package/.claude/skills/workflow-commands/backlogrun-steps.md +62 -50
  18. package/.claude/skills/workflow-commands/backlogrun.md +13 -18
  19. package/.claude/skills/workflow-commands/chain-rule.md +54 -53
  20. package/.claude/skills/workflow-commands/delegation.md +11 -11
  21. package/.claude/skills/workflow-commands/entry-sequence.md +23 -34
  22. package/.claude/skills/workflow-commands/followup.md +19 -17
  23. package/.claude/skills/workflow-commands/fullrun-lane.md +11 -0
  24. package/.claude/skills/workflow-commands/fullrun-steps.md +27 -34
  25. package/.claude/skills/workflow-commands/fullrun.md +5 -6
  26. package/.claude/skills/workflow-commands/halfrun.md +4 -7
  27. package/.claude/skills/workflow-commands/issue-comments.md +29 -15
  28. package/.claude/skills/workflow-commands/issue-fold-existing.md +9 -14
  29. package/.claude/skills/workflow-commands/issue-scout.md +5 -8
  30. package/.claude/skills/workflow-commands/kickoff.md +25 -34
  31. package/.claude/skills/workflow-commands/latest-gate.md +6 -14
  32. package/.claude/skills/workflow-commands/needs-human-review.md +3 -3
  33. package/.claude/skills/workflow-commands/observation-filing.md +9 -7
  34. package/.claude/skills/workflow-commands/observation-ledger.md +4 -1
  35. package/.claude/skills/workflow-commands/pre-gate-cut.md +21 -26
  36. package/.claude/skills/workflow-commands/prerequisite.md +21 -6
  37. package/.claude/skills/workflow-commands/progress-watcher.md +8 -18
  38. package/.claude/skills/workflow-commands/prrun.md +1 -1
  39. package/.claude/skills/workflow-commands/retrospective.md +16 -15
  40. package/.claude/skills/workflow-commands/split-assessment.md +32 -22
  41. package/.claude/skills/workflow-commands/target-repository.md +2 -2
  42. package/.claude/skills/workflow-commands/working-tree-hold.md +3 -2
  43. package/.codex/hooks.json +18 -8
  44. package/.cursorrules +1 -2
  45. package/.github/actions/change-scope/action.yml +19 -0
  46. package/.github/actions/setup-pnpm/action.yml +87 -14
  47. package/.github/dependabot.yml +1 -0
  48. package/.github/workflows/ci.yml +74 -30
  49. package/.github/workflows/publish.yml +56 -14
  50. package/.github/workflows/sonar-qube.yml +28 -1
  51. package/.prettierignore +2 -0
  52. package/AGENTS.md +1 -2
  53. package/CLAUDE.md +8 -8
  54. package/GEMINI.md +1 -2
  55. package/README.md +1 -1
  56. package/SECURITY.md +11 -1
  57. package/cspell/index.yaml +11 -0
  58. package/dist/.inputs-verified.json +1 -0
  59. package/dist/CLAUDE.md +8 -8
  60. package/dist/commands/adopt.js +222 -0
  61. package/dist/commands/auth-setup-cli.js +127 -0
  62. package/dist/commands/auto-ok-judge-cli.js +223 -0
  63. package/dist/commands/auto-ok-main.js +136 -0
  64. package/dist/commands/backlog-budget-main.js +146 -0
  65. package/dist/commands/backlog-drive-cli.js +1935 -0
  66. package/dist/commands/backlog-next-main.js +186 -0
  67. package/dist/commands/backlog-offer-main.js +190 -0
  68. package/dist/commands/backlog-plan-cli.js +329 -0
  69. package/dist/commands/backlog-triage-cli.js +642 -0
  70. package/dist/commands/backlogrun-cli.js +829 -0
  71. package/dist/commands/behavior-cli.js +216 -0
  72. package/dist/commands/bump-version-main.js +22 -0
  73. package/dist/commands/bytes-command.js +208 -0
  74. package/dist/commands/cases-cli.js +57 -0
  75. package/dist/commands/check-commit-message-main.js +22 -0
  76. package/dist/commands/check-related.js +551 -0
  77. package/dist/commands/chunk-23GH6B3D.js +333 -0
  78. package/dist/commands/chunk-2ADQ5XRD.js +36 -0
  79. package/dist/commands/chunk-2CXAVVST.js +20 -0
  80. package/dist/commands/chunk-2DJLAUYB.js +109 -0
  81. package/dist/commands/chunk-2FE3C4PH.js +112 -0
  82. package/dist/commands/chunk-2FJJYCBD.js +149 -0
  83. package/dist/commands/chunk-2IESYBZH.js +34 -0
  84. package/dist/commands/chunk-2MJ4OCDL.js +188 -0
  85. package/dist/commands/chunk-2NSB5ZYQ.js +26 -0
  86. package/dist/commands/chunk-2OIX4JLA.js +37 -0
  87. package/dist/commands/chunk-2TQXCH2K.js +145 -0
  88. package/dist/commands/chunk-2VLHFILE.js +52 -0
  89. package/dist/commands/chunk-2VRITY55.js +41 -0
  90. package/dist/commands/chunk-2YCKPX3A.js +25 -0
  91. package/dist/commands/chunk-32SNWQJP.js +99 -0
  92. package/dist/commands/chunk-337QQM4C.js +136 -0
  93. package/dist/commands/chunk-34DND4BA.js +104 -0
  94. package/dist/commands/chunk-34LAULSC.js +352 -0
  95. package/dist/commands/chunk-36LOGVJ7.js +38 -0
  96. package/dist/commands/chunk-36M2UV6C.js +80 -0
  97. package/dist/commands/chunk-3BNNMJOT.js +702 -0
  98. package/dist/commands/chunk-3CCGKX7Y.js +20 -0
  99. package/dist/commands/chunk-3EO2XN3A.js +124 -0
  100. package/dist/commands/chunk-3GF52L5F.js +271 -0
  101. package/dist/commands/chunk-3HU3LPIF.js +113 -0
  102. package/dist/commands/chunk-3LZXX5GL.js +50 -0
  103. package/dist/commands/chunk-3NWAGIA6.js +39 -0
  104. package/dist/commands/chunk-3PEXBHRN.js +33 -0
  105. package/dist/commands/chunk-3RIQ36LH.js +110 -0
  106. package/dist/commands/chunk-3UKJFWKS.js +170 -0
  107. package/dist/commands/chunk-3WRQP3QE.js +47 -0
  108. package/dist/commands/chunk-3WWQFCGX.js +18 -0
  109. package/dist/commands/chunk-3ZEO3KOM.js +35 -0
  110. package/dist/commands/chunk-4BEIYKI2.js +76 -0
  111. package/dist/commands/chunk-4D5KWMFL.js +461 -0
  112. package/dist/commands/chunk-4DVM57T7.js +86 -0
  113. package/dist/commands/chunk-4EADHJVC.js +247 -0
  114. package/dist/commands/chunk-4G7NKNAZ.js +114 -0
  115. package/dist/commands/chunk-4HBVHYNL.js +73 -0
  116. package/dist/commands/chunk-4LWRCPS5.js +114 -0
  117. package/dist/commands/chunk-4P2LCVGO.js +211 -0
  118. package/dist/commands/chunk-4PES3BAA.js +263 -0
  119. package/dist/commands/chunk-4PUKDAXL.js +42 -0
  120. package/dist/commands/chunk-4Q4FXBUQ.js +99 -0
  121. package/dist/commands/chunk-4QYW2IL7.js +82 -0
  122. package/dist/commands/chunk-4YI4SLRJ.js +161 -0
  123. package/dist/commands/chunk-4Z5723GA.js +350 -0
  124. package/dist/commands/chunk-4ZHWTTQW.js +99 -0
  125. package/dist/commands/chunk-55I7OYHI.js +98 -0
  126. package/dist/commands/chunk-5GBZ43UA.js +58 -0
  127. package/dist/commands/chunk-5HCPSV45.js +800 -0
  128. package/dist/{hooks/chunk-OPSRGWFU.js → commands/chunk-5HVYOIIK.js} +1 -1
  129. package/dist/commands/chunk-5HWZFL4D.js +4175 -0
  130. package/dist/commands/chunk-5PAEXYIY.js +234 -0
  131. package/dist/commands/chunk-5SB37YDW.js +321 -0
  132. package/dist/commands/chunk-5TMAPYQD.js +19 -0
  133. package/dist/commands/chunk-5WIZR5SC.js +313 -0
  134. package/dist/commands/chunk-5Y7QQYTU.js +232 -0
  135. package/dist/commands/chunk-5ZTQX7OS.js +125 -0
  136. package/dist/commands/chunk-65E4OZJ7.js +9 -0
  137. package/dist/commands/chunk-66NX6EXR.js +29 -0
  138. package/dist/commands/chunk-66TGK5XL.js +84 -0
  139. package/dist/commands/chunk-6CJXLPRI.js +72 -0
  140. package/dist/commands/chunk-6EU5ZCDP.js +402 -0
  141. package/dist/commands/chunk-6FWV56B3.js +40 -0
  142. package/dist/commands/chunk-6HRRZANN.js +55 -0
  143. package/dist/commands/chunk-6I2JM5UX.js +134 -0
  144. package/dist/commands/chunk-6JVNRY5A.js +29 -0
  145. package/dist/commands/chunk-6NGNMIMT.js +20 -0
  146. package/dist/commands/chunk-6NRTLH6I.js +51 -0
  147. package/dist/commands/chunk-6NV2F7QH.js +47 -0
  148. package/dist/commands/chunk-6OP63TBT.js +78 -0
  149. package/dist/commands/chunk-6Q3XUCLM.js +204 -0
  150. package/dist/commands/chunk-6SKMZGER.js +148 -0
  151. package/dist/commands/chunk-6TESOL3L.js +173 -0
  152. package/dist/commands/chunk-6UGFS3EU.js +704 -0
  153. package/dist/commands/chunk-6VTJO5L2.js +38 -0
  154. package/dist/commands/chunk-6WEVLIZE.js +29 -0
  155. package/dist/commands/chunk-6WKJ3GDA.js +408 -0
  156. package/dist/commands/chunk-6WTVAL4D.js +115 -0
  157. package/dist/commands/chunk-72EW7AVI.js +59 -0
  158. package/dist/commands/chunk-72J2G2E7.js +1189 -0
  159. package/dist/commands/chunk-73EBNBUW.js +90 -0
  160. package/dist/commands/chunk-73JOEKIC.js +169 -0
  161. package/dist/commands/chunk-73KBUQKI.js +41 -0
  162. package/dist/commands/chunk-7CHCZBNF.js +555 -0
  163. package/dist/commands/chunk-7EAMUVIO.js +326 -0
  164. package/dist/commands/chunk-7GHOFHUS.js +48 -0
  165. package/dist/commands/chunk-7GMTJDO2.js +469 -0
  166. package/dist/commands/chunk-7HCPRVMB.js +76 -0
  167. package/dist/commands/chunk-7IT23HIR.js +306 -0
  168. package/dist/commands/chunk-7IZJ5MG2.js +72 -0
  169. package/dist/commands/chunk-7LJQMM2K.js +102 -0
  170. package/dist/commands/chunk-7MOZEEFJ.js +350 -0
  171. package/dist/commands/chunk-7P4X4TQL.js +507 -0
  172. package/dist/commands/chunk-7S6VRZOH.js +223 -0
  173. package/dist/commands/chunk-7V5UVKFG.js +20 -0
  174. package/dist/commands/chunk-7W3D3WRW.js +171 -0
  175. package/dist/commands/chunk-7ZECP3J6.js +212 -0
  176. package/dist/commands/chunk-A3D2XHOJ.js +387 -0
  177. package/dist/commands/chunk-A4HOQKOG.js +85 -0
  178. package/dist/commands/chunk-A5V7EWIX.js +85 -0
  179. package/dist/commands/chunk-A6T2N7VC.js +159 -0
  180. package/dist/commands/chunk-AI5K4QJO.js +72 -0
  181. package/dist/commands/chunk-AJWR7D3H.js +15 -0
  182. package/dist/commands/chunk-AKK56GNX.js +205 -0
  183. package/dist/commands/chunk-AKQYYHP2.js +461 -0
  184. package/dist/commands/chunk-AM44D7NF.js +52 -0
  185. package/dist/commands/chunk-ANUTT56I.js +85 -0
  186. package/dist/commands/chunk-AQ3PMSXK.js +76 -0
  187. package/dist/commands/chunk-AS3GWVAN.js +45 -0
  188. package/dist/commands/chunk-ATRMETHT.js +23 -0
  189. package/dist/commands/chunk-AVUGMOHZ.js +210 -0
  190. package/dist/commands/chunk-AWLYN2SP.js +64 -0
  191. package/dist/commands/chunk-AZUE65NT.js +77 -0
  192. package/dist/commands/chunk-B2EA2HCY.js +119 -0
  193. package/dist/commands/chunk-B33BTNB4.js +87 -0
  194. package/dist/commands/chunk-B3XFOHDX.js +71 -0
  195. package/dist/commands/chunk-B5GXZK3E.js +34 -0
  196. package/dist/commands/chunk-B77ZMVHS.js +80 -0
  197. package/dist/commands/chunk-BCK5LW4F.js +45 -0
  198. package/dist/commands/chunk-BEE7OAQ5.js +210 -0
  199. package/dist/commands/chunk-BF6YX4HE.js +70 -0
  200. package/dist/commands/chunk-BFLFPKQQ.js +46 -0
  201. package/dist/commands/chunk-BHRS7HAM.js +272 -0
  202. package/dist/commands/chunk-BIKGPT52.js +29 -0
  203. package/dist/commands/chunk-BJA5U4Q7.js +75 -0
  204. package/dist/commands/chunk-BJKEXXY6.js +15 -0
  205. package/dist/commands/chunk-BK6Q4VCA.js +128 -0
  206. package/dist/commands/chunk-BNXE3NVB.js +107 -0
  207. package/dist/commands/chunk-BPSJSHYD.js +209 -0
  208. package/dist/commands/chunk-BRFQBJ5Y.js +132 -0
  209. package/dist/commands/chunk-BY3POLIQ.js +104 -0
  210. package/dist/commands/chunk-BYSPYVLD.js +130 -0
  211. package/dist/commands/chunk-C26LKDBE.js +60 -0
  212. package/dist/commands/chunk-C2SEDMZ3.js +238 -0
  213. package/dist/commands/chunk-C6QSVO5K.js +56 -0
  214. package/dist/commands/chunk-CA6F5OXK.js +809 -0
  215. package/dist/commands/chunk-CADFBQJJ.js +75 -0
  216. package/dist/commands/chunk-CDY4NFQG.js +15 -0
  217. package/dist/commands/chunk-CGLLAEKZ.js +110 -0
  218. package/dist/commands/chunk-CHX4QTP4.js +133 -0
  219. package/dist/commands/chunk-CJAA5GAF.js +418 -0
  220. package/dist/commands/chunk-CJKPF5DJ.js +156 -0
  221. package/dist/commands/chunk-CJSFC5YI.js +158 -0
  222. package/dist/commands/chunk-CRNPPKP2.js +99 -0
  223. package/dist/commands/chunk-CUR2WNYB.js +42 -0
  224. package/dist/commands/chunk-CYQ3ZF7R.js +372 -0
  225. package/dist/commands/chunk-D3SHCUBC.js +64 -0
  226. package/dist/commands/chunk-D4HNS43Q.js +208 -0
  227. package/dist/commands/chunk-D4SZK7H2.js +34 -0
  228. package/dist/commands/chunk-D5HIP4HT.js +289 -0
  229. package/dist/commands/chunk-D5TAR6TV.js +71 -0
  230. package/dist/commands/chunk-DAJCUSPG.js +127 -0
  231. package/dist/commands/chunk-DBKTFB5V.js +18 -0
  232. package/dist/commands/chunk-DIB2Z2OS.js +307 -0
  233. package/dist/commands/chunk-DJVMC3U2.js +131 -0
  234. package/dist/commands/chunk-DKM4UJQU.js +10 -0
  235. package/dist/commands/chunk-DMD74E3F.js +39 -0
  236. package/dist/commands/chunk-DNJC7X73.js +84 -0
  237. package/dist/commands/chunk-DP7WIGQ4.js +298 -0
  238. package/dist/commands/chunk-DPJVKTO4.js +41 -0
  239. package/dist/commands/chunk-DRCTDVI2.js +83 -0
  240. package/dist/commands/chunk-DSBK66US.js +67 -0
  241. package/dist/commands/chunk-DXJQHJQ4.js +73 -0
  242. package/dist/commands/chunk-DXZW4V7J.js +114 -0
  243. package/dist/commands/chunk-E2ZCUKHT.js +274 -0
  244. package/dist/commands/chunk-E33LSO2W.js +20 -0
  245. package/dist/commands/chunk-E3CXOVPQ.js +258 -0
  246. package/dist/commands/chunk-EBI2BAKQ.js +47 -0
  247. package/dist/commands/chunk-EBNIX2TC.js +81 -0
  248. package/dist/commands/chunk-EBVS2LKX.js +60 -0
  249. package/dist/commands/chunk-EFHSCUFN.js +170 -0
  250. package/dist/commands/chunk-EH3LVYOX.js +72 -0
  251. package/dist/commands/chunk-EI6JG5DF.js +92 -0
  252. package/dist/commands/chunk-EK2Y6B4X.js +140 -0
  253. package/dist/commands/chunk-EK327QOS.js +260 -0
  254. package/dist/commands/chunk-EKCKCX5S.js +291 -0
  255. package/dist/commands/chunk-ELWNRE6E.js +93 -0
  256. package/dist/commands/chunk-ENFPR7J2.js +53 -0
  257. package/dist/commands/chunk-ENLWXAHD.js +80 -0
  258. package/dist/commands/chunk-ERGZPWKP.js +102 -0
  259. package/dist/commands/chunk-ESQEEL4O.js +58 -0
  260. package/dist/commands/chunk-EW4NPUMQ.js +363 -0
  261. package/dist/commands/chunk-EWA72KO7.js +241 -0
  262. package/dist/commands/chunk-EWVR5AEX.js +140 -0
  263. package/dist/commands/chunk-EZSO25UZ.js +80 -0
  264. package/dist/commands/chunk-F22G3VDB.js +183 -0
  265. package/dist/commands/chunk-F2HFWLQR.js +32 -0
  266. package/dist/commands/chunk-F2J6DGDM.js +302 -0
  267. package/dist/commands/chunk-F3WBEEYC.js +68 -0
  268. package/dist/commands/chunk-F6OWP2AY.js +750 -0
  269. package/dist/commands/chunk-F7XLEK55.js +62 -0
  270. package/dist/commands/chunk-FB3D7CX5.js +241 -0
  271. package/dist/commands/chunk-FC33R5UN.js +516 -0
  272. package/dist/commands/chunk-FCINBCKB.js +77 -0
  273. package/dist/commands/chunk-FFHEGWPK.js +91 -0
  274. package/dist/commands/chunk-FGL6DBZU.js +71 -0
  275. package/dist/commands/chunk-FGZQSSGH.js +210 -0
  276. package/dist/{hooks/chunk-VVNYJWEI.js → commands/chunk-FIUCHMCF.js} +4 -2
  277. package/dist/commands/chunk-FNOSSXLG.js +61 -0
  278. package/dist/commands/chunk-FNQW6NY7.js +154 -0
  279. package/dist/commands/chunk-FROACLVU.js +525 -0
  280. package/dist/commands/chunk-FVVZIJUC.js +425 -0
  281. package/dist/commands/chunk-G47ZNQVG.js +17 -0
  282. package/dist/commands/chunk-G6BXCWPH.js +141 -0
  283. package/dist/commands/chunk-GA4VIFHD.js +224 -0
  284. package/dist/commands/chunk-GA6E4VGO.js +328 -0
  285. package/dist/commands/chunk-GDUK5YPO.js +185 -0
  286. package/dist/commands/chunk-GIGKMIPQ.js +72 -0
  287. package/dist/commands/chunk-GJYMI2CM.js +48 -0
  288. package/dist/commands/chunk-GK2KY4MO.js +67 -0
  289. package/dist/commands/chunk-GM3XLC4W.js +63 -0
  290. package/dist/commands/chunk-GO3GH7FG.js +75 -0
  291. package/dist/commands/chunk-GPMSYXYO.js +378 -0
  292. package/dist/commands/chunk-GPTO6IZG.js +29 -0
  293. package/dist/commands/chunk-GQHUFNXN.js +54 -0
  294. package/dist/commands/chunk-GU5ML3Y3.js +263 -0
  295. package/dist/commands/chunk-GW4UWR3O.js +126 -0
  296. package/dist/commands/chunk-H4LYG37R.js +716 -0
  297. package/dist/commands/chunk-HBNB3TLG.js +122 -0
  298. package/dist/commands/chunk-HCA5QG2U.js +299 -0
  299. package/dist/commands/chunk-HE5S4XRE.js +21 -0
  300. package/dist/commands/chunk-HESMKHEB.js +105 -0
  301. package/dist/commands/chunk-HG2NZQD5.js +135 -0
  302. package/dist/commands/chunk-HH2KDLTP.js +161 -0
  303. package/dist/commands/chunk-HHBC6QZE.js +95 -0
  304. package/dist/commands/chunk-HIB5G2X6.js +426 -0
  305. package/dist/commands/chunk-HIPO6HUG.js +45 -0
  306. package/dist/commands/chunk-HIU2WXB6.js +26 -0
  307. package/dist/commands/chunk-HJKZDDDI.js +62 -0
  308. package/dist/commands/chunk-HLKAFSN4.js +76 -0
  309. package/dist/commands/chunk-HLUS2M3D.js +7 -0
  310. package/dist/commands/chunk-HO52D6JY.js +278 -0
  311. package/dist/commands/chunk-HOGFJHBT.js +412 -0
  312. package/dist/commands/chunk-HOSZITJM.js +156 -0
  313. package/dist/commands/chunk-HPVLI26Z.js +123 -0
  314. package/dist/commands/chunk-HQ2HSZBN.js +69 -0
  315. package/dist/commands/chunk-HRLGFRAV.js +21 -0
  316. package/dist/commands/chunk-HRT4KWP4.js +178 -0
  317. package/dist/commands/chunk-HTIDHEEN.js +108 -0
  318. package/dist/commands/chunk-HXCZ3KWS.js +41 -0
  319. package/dist/commands/chunk-HZBTXKT2.js +61 -0
  320. package/dist/commands/chunk-HZSQI6TD.js +18 -0
  321. package/dist/commands/chunk-I63RNFFR.js +213 -0
  322. package/dist/commands/chunk-IBEKFLWG.js +137 -0
  323. package/dist/commands/chunk-ICEMFE2V.js +139 -0
  324. package/dist/commands/chunk-IG22Y5MA.js +56 -0
  325. package/dist/commands/chunk-IGD6QJPH.js +91 -0
  326. package/dist/commands/chunk-ILGPZ47M.js +33 -0
  327. package/dist/commands/chunk-ILQZFUDC.js +65 -0
  328. package/dist/commands/chunk-ISPBJVXM.js +238 -0
  329. package/dist/commands/chunk-IW6NWCSN.js +10 -0
  330. package/dist/commands/chunk-IXX4SXIP.js +53 -0
  331. package/dist/commands/chunk-IZVM2TTH.js +84 -0
  332. package/dist/commands/chunk-J3G2R64I.js +88 -0
  333. package/dist/commands/chunk-J3TKZLHA.js +11 -0
  334. package/dist/commands/chunk-J6GIVMXI.js +59 -0
  335. package/dist/commands/chunk-JB7R3A4A.js +204 -0
  336. package/dist/commands/chunk-JGTLNFFE.js +803 -0
  337. package/dist/commands/chunk-JHN6RCE6.js +123 -0
  338. package/dist/commands/chunk-JJRKTWLK.js +64 -0
  339. package/dist/commands/chunk-JLREFWJ4.js +244 -0
  340. package/dist/commands/chunk-JLYW7CP6.js +43 -0
  341. package/dist/commands/chunk-JNWHX25C.js +36 -0
  342. package/dist/commands/chunk-JOARHU3M.js +137 -0
  343. package/dist/commands/chunk-JQXPLMCO.js +81 -0
  344. package/dist/commands/chunk-JTU5A4JI.js +55 -0
  345. package/dist/commands/chunk-JUJFIATR.js +121 -0
  346. package/dist/commands/chunk-JUUBDYFZ.js +61 -0
  347. package/dist/commands/chunk-JZOTCPX2.js +115 -0
  348. package/dist/commands/chunk-K2WVYHCP.js +18 -0
  349. package/dist/commands/chunk-K7GL3BGI.js +419 -0
  350. package/dist/commands/chunk-KB3OQWDT.js +71 -0
  351. package/dist/commands/chunk-KHWTJ4F7.js +132 -0
  352. package/dist/commands/chunk-KIILCKQR.js +220 -0
  353. package/dist/commands/chunk-KIVOZY2J.js +1864 -0
  354. package/dist/commands/chunk-KQWSENCT.js +94 -0
  355. package/dist/commands/chunk-KSR23NYN.js +33 -0
  356. package/dist/commands/chunk-KTLR4Y32.js +21 -0
  357. package/dist/commands/chunk-KUJQWO6M.js +119 -0
  358. package/dist/commands/chunk-KVHNQHX3.js +100 -0
  359. package/dist/commands/chunk-KVJDDECB.js +51 -0
  360. package/dist/commands/chunk-KVSSLDA3.js +1062 -0
  361. package/dist/commands/chunk-KVURNO74.js +187 -0
  362. package/dist/commands/chunk-KXHXMERX.js +214 -0
  363. package/dist/commands/chunk-KXRFGPZD.js +69 -0
  364. package/dist/commands/chunk-KZSM5M5P.js +89 -0
  365. package/dist/commands/chunk-L6LU2633.js +91 -0
  366. package/dist/commands/chunk-L6TU7FC2.js +103 -0
  367. package/dist/commands/chunk-L6XN3EXI.js +138 -0
  368. package/dist/commands/chunk-LA5WTOAM.js +319 -0
  369. package/dist/commands/chunk-LAKVPOJQ.js +59 -0
  370. package/dist/commands/chunk-LAYSCY4L.js +6 -0
  371. package/dist/commands/chunk-LBLII7BS.js +14 -0
  372. package/dist/commands/chunk-LC7SBONO.js +98 -0
  373. package/dist/commands/chunk-LCEJXF7A.js +101 -0
  374. package/dist/commands/chunk-LE2T3FGJ.js +302 -0
  375. package/dist/commands/chunk-LE7TFPMU.js +88 -0
  376. package/dist/commands/chunk-LHKXJD6L.js +303 -0
  377. package/dist/commands/chunk-LMS6N6GE.js +332 -0
  378. package/dist/commands/chunk-LMSS4ARB.js +32 -0
  379. package/dist/commands/chunk-LNBUIOK6.js +133 -0
  380. package/dist/commands/chunk-LOSOLCCW.js +119 -0
  381. package/dist/commands/chunk-LQXFVZTS.js +13 -0
  382. package/dist/commands/chunk-LRA3PXHS.js +472 -0
  383. package/dist/commands/chunk-LRS2OS5J.js +395 -0
  384. package/dist/commands/chunk-LULJUD6P.js +131 -0
  385. package/dist/commands/chunk-LUMCYDGE.js +141 -0
  386. package/dist/commands/chunk-LWAXXZPS.js +118 -0
  387. package/dist/commands/chunk-LYEKT3IN.js +77 -0
  388. package/dist/commands/chunk-LZNYHWRO.js +78 -0
  389. package/dist/commands/chunk-M3ZDYCUF.js +117 -0
  390. package/dist/commands/chunk-M42SLJCD.js +97 -0
  391. package/dist/commands/chunk-M4PEC7YW.js +349 -0
  392. package/dist/commands/chunk-MAGJFH5T.js +77 -0
  393. package/dist/commands/chunk-MDKDJF2K.js +160 -0
  394. package/dist/commands/chunk-MDLOETXL.js +211 -0
  395. package/dist/commands/chunk-MGF64OHV.js +32 -0
  396. package/dist/commands/chunk-MMTVQOCP.js +211 -0
  397. package/dist/commands/chunk-MMXZKLDU.js +115 -0
  398. package/dist/commands/chunk-MPGJ4ONJ.js +634 -0
  399. package/dist/commands/chunk-MS6Q3Z7V.js +870 -0
  400. package/dist/commands/chunk-MSPIR3OA.js +32 -0
  401. package/dist/commands/chunk-MVPUQLN5.js +183 -0
  402. package/dist/commands/chunk-MXC4IBZ7.js +104 -0
  403. package/dist/commands/chunk-MY3RSOS5.js +52 -0
  404. package/dist/commands/chunk-MYNM3YMR.js +347 -0
  405. package/dist/commands/chunk-MYWRGF5A.js +177 -0
  406. package/dist/commands/chunk-MZHOPRI6.js +529 -0
  407. package/dist/commands/chunk-N4O5I55P.js +655 -0
  408. package/dist/commands/chunk-N6TYL3B2.js +250 -0
  409. package/dist/commands/chunk-NFEBQED3.js +179 -0
  410. package/dist/commands/chunk-NFKULY26.js +48 -0
  411. package/dist/commands/chunk-NGKB632X.js +92 -0
  412. package/dist/commands/chunk-NJ53AWJU.js +122 -0
  413. package/dist/commands/chunk-NJT5L6IC.js +126 -0
  414. package/dist/commands/chunk-NKKH3PBE.js +87 -0
  415. package/dist/commands/chunk-NKOET4FB.js +44 -0
  416. package/dist/commands/chunk-NMLCPYBN.js +134 -0
  417. package/dist/commands/chunk-NOXLKIPR.js +114 -0
  418. package/dist/commands/chunk-NSAVEXVR.js +353 -0
  419. package/dist/commands/chunk-NSZTSCBW.js +1263 -0
  420. package/dist/commands/chunk-NYWGJLBU.js +19 -0
  421. package/dist/commands/chunk-O26Y2FOJ.js +134 -0
  422. package/dist/commands/chunk-O27H6NN6.js +163 -0
  423. package/dist/commands/chunk-O3NDWYNT.js +68 -0
  424. package/dist/commands/chunk-O4WBADCX.js +88 -0
  425. package/dist/commands/chunk-O5FVBIRI.js +271 -0
  426. package/dist/commands/chunk-O5QZ2S6X.js +98 -0
  427. package/dist/commands/chunk-OGNTJ5JB.js +47 -0
  428. package/dist/commands/chunk-OHNP3QL2.js +186 -0
  429. package/dist/commands/chunk-OHVAEJSM.js +184 -0
  430. package/dist/commands/chunk-OI7KM4K3.js +43 -0
  431. package/dist/commands/chunk-OIDMJASD.js +62 -0
  432. package/dist/commands/chunk-OJ4LGBVD.js +126 -0
  433. package/dist/commands/chunk-OKKQI4ZG.js +49 -0
  434. package/dist/commands/chunk-OKYFQJW3.js +22 -0
  435. package/dist/commands/chunk-ORSI7Y55.js +133 -0
  436. package/dist/commands/chunk-OT3UMEWK.js +47 -0
  437. package/dist/commands/chunk-OTZJXU2R.js +170 -0
  438. package/dist/commands/chunk-OVA7STGP.js +578 -0
  439. package/dist/commands/chunk-OWR2TCOY.js +269 -0
  440. package/dist/commands/chunk-OZZWRJQI.js +246 -0
  441. package/dist/commands/chunk-P4CWLRT2.js +213 -0
  442. package/dist/commands/chunk-P4D5RESF.js +88 -0
  443. package/dist/commands/chunk-P4KIQRSL.js +119 -0
  444. package/dist/commands/chunk-P4O67FP5.js +488 -0
  445. package/dist/commands/chunk-P6RGQXHI.js +391 -0
  446. package/dist/commands/chunk-P7FPXAHP.js +29 -0
  447. package/dist/commands/chunk-PBOS7MTW.js +6 -0
  448. package/dist/commands/chunk-PDAY76AN.js +47 -0
  449. package/dist/commands/chunk-PDDKRHHS.js +128 -0
  450. package/dist/commands/chunk-PE7B7242.js +84 -0
  451. package/dist/commands/chunk-PF22VUWB.js +723 -0
  452. package/dist/commands/chunk-PFO7EYAP.js +45 -0
  453. package/dist/commands/chunk-PR3JCPP7.js +126 -0
  454. package/dist/commands/chunk-PWYXY46Y.js +1150 -0
  455. package/dist/commands/chunk-PYOK73QE.js +44 -0
  456. package/dist/commands/chunk-PZ4ITSLG.js +80 -0
  457. package/dist/commands/chunk-PZ6VWHOO.js +144 -0
  458. package/dist/commands/chunk-PZTWQYRI.js +44 -0
  459. package/dist/commands/chunk-PZU6FZO6.js +17 -0
  460. package/dist/commands/chunk-Q3463XNL.js +198 -0
  461. package/dist/commands/chunk-Q5N2J2UF.js +78 -0
  462. package/dist/commands/chunk-Q5Q2QYVU.js +112 -0
  463. package/dist/commands/chunk-Q6SKKQVJ.js +34 -0
  464. package/dist/commands/chunk-Q7TV3OV6.js +218 -0
  465. package/dist/commands/chunk-QA22PBCJ.js +165 -0
  466. package/dist/commands/chunk-QAHFPCFR.js +50 -0
  467. package/dist/commands/chunk-QDFDB4CF.js +478 -0
  468. package/dist/commands/chunk-QEIO2ZNQ.js +324 -0
  469. package/dist/commands/chunk-QF4WC2AE.js +10 -0
  470. package/dist/commands/chunk-QGAERR7D.js +99 -0
  471. package/dist/commands/chunk-QHWJJ6X5.js +53 -0
  472. package/dist/commands/chunk-QQ4CIYMF.js +132 -0
  473. package/dist/commands/chunk-QQBMVC5W.js +227 -0
  474. package/dist/commands/chunk-QQZOQ7AM.js +32 -0
  475. package/dist/commands/chunk-QS5USD4T.js +540 -0
  476. package/dist/commands/chunk-QVOFWFWC.js +134 -0
  477. package/dist/commands/chunk-QWWTC3XR.js +109 -0
  478. package/dist/commands/chunk-QWX7EBC6.js +112 -0
  479. package/dist/commands/chunk-QX2R6UJG.js +15 -0
  480. package/dist/commands/chunk-QXQ56E56.js +27 -0
  481. package/dist/commands/chunk-R2CF6VZE.js +114 -0
  482. package/dist/commands/chunk-R6QE5VJG.js +46 -0
  483. package/dist/commands/chunk-R7IT5VOL.js +27 -0
  484. package/dist/commands/chunk-RBU2NKHF.js +44 -0
  485. package/dist/commands/chunk-RDRN56E4.js +92 -0
  486. package/dist/commands/chunk-REMKUFAC.js +304 -0
  487. package/dist/commands/chunk-REPANBLS.js +168 -0
  488. package/dist/commands/chunk-RGDFWJPZ.js +135 -0
  489. package/dist/commands/chunk-RGGEQM6G.js +140 -0
  490. package/dist/commands/chunk-RH6ZWJOA.js +77 -0
  491. package/dist/commands/chunk-RHII5XI6.js +492 -0
  492. package/dist/commands/chunk-RI7EQYKL.js +60 -0
  493. package/dist/commands/chunk-RINVPTA2.js +1310 -0
  494. package/dist/commands/chunk-RIQ75QWR.js +233 -0
  495. package/dist/commands/chunk-RIUPRMLW.js +63 -0
  496. package/dist/commands/chunk-RK4HE5NW.js +172 -0
  497. package/dist/commands/chunk-ROJXMBXP.js +85 -0
  498. package/dist/commands/chunk-RPDWFUQO.js +239 -0
  499. package/dist/commands/chunk-RQRLW4XK.js +20 -0
  500. package/dist/commands/chunk-RRQFITJE.js +40 -0
  501. package/dist/commands/chunk-RS764ZMU.js +46 -0
  502. package/dist/commands/chunk-RSSJWMQS.js +30 -0
  503. package/dist/commands/chunk-RUIBQMOV.js +38 -0
  504. package/dist/commands/chunk-RUWV4INF.js +245 -0
  505. package/dist/commands/chunk-RVHBWSIG.js +114 -0
  506. package/dist/commands/chunk-RVUJ6F5L.js +181 -0
  507. package/dist/commands/chunk-RX5JSPPH.js +1153 -0
  508. package/dist/commands/chunk-RXAZJMSZ.js +18 -0
  509. package/dist/commands/chunk-RY6ZDHKB.js +1218 -0
  510. package/dist/commands/chunk-RYZ3RQRH.js +16 -0
  511. package/dist/commands/chunk-RZ4OKKPM.js +1722 -0
  512. package/dist/commands/chunk-RZJAUVMI.js +69 -0
  513. package/dist/commands/chunk-S4X5PJV7.js +40 -0
  514. package/dist/commands/chunk-S6SXMBF2.js +66 -0
  515. package/dist/commands/chunk-S7XWXG4M.js +3893 -0
  516. package/dist/commands/chunk-SADJPNDB.js +67 -0
  517. package/dist/commands/chunk-SBGTCT2C.js +89 -0
  518. package/dist/commands/chunk-SFNBUB6D.js +110 -0
  519. package/dist/commands/chunk-SK2LJBFS.js +168 -0
  520. package/dist/commands/chunk-SNFLV7VV.js +45 -0
  521. package/dist/commands/chunk-SNO7CY2B.js +69 -0
  522. package/dist/commands/chunk-ST32OGPY.js +82 -0
  523. package/dist/commands/chunk-SV4FHQE7.js +995 -0
  524. package/dist/commands/chunk-SVAKCXZ7.js +44 -0
  525. package/dist/commands/chunk-SXULS6DX.js +112 -0
  526. package/dist/commands/chunk-T25S4QHL.js +52 -0
  527. package/dist/commands/chunk-T2E724HN.js +117 -0
  528. package/dist/commands/chunk-T2IO4LEB.js +285 -0
  529. package/dist/commands/chunk-T33QDAWD.js +16 -0
  530. package/dist/commands/chunk-T3FD3Q73.js +49 -0
  531. package/dist/commands/chunk-T4UYEHWG.js +50 -0
  532. package/dist/commands/chunk-T57W3UWK.js +88 -0
  533. package/dist/commands/chunk-TAPDXK34.js +48 -0
  534. package/dist/commands/chunk-TBIX5FRN.js +106 -0
  535. package/dist/commands/chunk-TBNQIFWL.js +101 -0
  536. package/dist/commands/chunk-TCBUX52E.js +701 -0
  537. package/dist/commands/chunk-TIXJY22D.js +90 -0
  538. package/dist/commands/chunk-TKGBF75Y.js +88 -0
  539. package/dist/commands/chunk-TMLNI3YW.js +95 -0
  540. package/dist/commands/chunk-TPKFVVJQ.js +125 -0
  541. package/dist/commands/chunk-TS4ZK46L.js +116 -0
  542. package/dist/commands/chunk-TUIFS5E7.js +72 -0
  543. package/dist/commands/chunk-TVJE67O2.js +179 -0
  544. package/dist/commands/chunk-TVZXG4Y4.js +197 -0
  545. package/dist/commands/chunk-TXXYC7EV.js +74 -0
  546. package/dist/commands/chunk-U2UH4VM4.js +229 -0
  547. package/dist/commands/chunk-U3IVVR4W.js +33 -0
  548. package/dist/commands/chunk-U5HQQWRE.js +20 -0
  549. package/dist/commands/chunk-U7XU5RG3.js +86 -0
  550. package/dist/commands/chunk-UCI4AL3Q.js +35 -0
  551. package/dist/commands/chunk-UCQJDYE3.js +21 -0
  552. package/dist/commands/chunk-UCUSCLEK.js +90 -0
  553. package/dist/commands/chunk-UEURNXE5.js +280 -0
  554. package/dist/commands/chunk-UGCUSRZF.js +17 -0
  555. package/dist/commands/chunk-UIWAMLQH.js +49 -0
  556. package/dist/commands/chunk-UJOZ2MGX.js +705 -0
  557. package/dist/commands/chunk-ULVVGGTY.js +64 -0
  558. package/dist/commands/chunk-UOAG2XQT.js +37 -0
  559. package/dist/commands/chunk-US6X7JXC.js +120 -0
  560. package/dist/commands/chunk-UTBVTCQN.js +7401 -0
  561. package/dist/commands/chunk-UU6GCJGM.js +56 -0
  562. package/dist/commands/chunk-UWLLZQJB.js +110 -0
  563. package/dist/commands/chunk-UZAU6UI6.js +33 -0
  564. package/dist/commands/chunk-V4Z7G4UH.js +73 -0
  565. package/dist/commands/chunk-V5FD7DVV.js +48 -0
  566. package/dist/commands/chunk-V5OIPYA6.js +109 -0
  567. package/dist/commands/chunk-VCR77BHO.js +8 -0
  568. package/dist/commands/chunk-VD5674LW.js +127 -0
  569. package/dist/commands/chunk-VD72V5VX.js +230 -0
  570. package/dist/commands/chunk-VDGNXSP3.js +174 -0
  571. package/dist/commands/chunk-VFJYOAOQ.js +339 -0
  572. package/dist/commands/chunk-VGHSZLYQ.js +85 -0
  573. package/dist/commands/chunk-VHRNXWVP.js +28 -0
  574. package/dist/commands/chunk-VJE3RJAX.js +23 -0
  575. package/dist/commands/chunk-VJLZ3IQQ.js +151 -0
  576. package/dist/commands/chunk-VTLL6CKO.js +269 -0
  577. package/dist/commands/chunk-VW5SGE7A.js +18 -0
  578. package/dist/commands/chunk-VZCQZFPH.js +378 -0
  579. package/dist/commands/chunk-VZHC2I3T.js +1208 -0
  580. package/dist/commands/chunk-VZSJCFRT.js +44 -0
  581. package/dist/commands/chunk-W2IA2LV3.js +15 -0
  582. package/dist/commands/chunk-W32DIQEP.js +43 -0
  583. package/dist/commands/chunk-W3FX7FYN.js +84 -0
  584. package/dist/commands/chunk-W47I2KDY.js +47 -0
  585. package/dist/commands/chunk-W4J6YTFE.js +74 -0
  586. package/dist/commands/chunk-W4YH2DF3.js +58 -0
  587. package/dist/commands/chunk-W6MVQEMO.js +109 -0
  588. package/dist/commands/chunk-W6V4DWC5.js +70 -0
  589. package/dist/commands/chunk-WG6GYBRJ.js +271 -0
  590. package/dist/commands/chunk-WGULS5DA.js +129 -0
  591. package/dist/commands/chunk-WIE7VUBE.js +122 -0
  592. package/dist/commands/chunk-WJ4NEDNI.js +288 -0
  593. package/dist/commands/chunk-WL5JHB3I.js +12 -0
  594. package/dist/commands/chunk-WMMGXJXP.js +92 -0
  595. package/dist/commands/chunk-WN7NK3NY.js +24 -0
  596. package/dist/commands/chunk-WOFLW2LX.js +26 -0
  597. package/dist/commands/chunk-WPAQUMHC.js +28 -0
  598. package/dist/commands/chunk-WQ6FS544.js +35 -0
  599. package/dist/commands/chunk-WQJ7O3C3.js +229 -0
  600. package/dist/commands/chunk-WRX3MINT.js +60 -0
  601. package/dist/commands/chunk-WSOF74K4.js +30 -0
  602. package/dist/commands/chunk-WTRDWEUQ.js +533 -0
  603. package/dist/commands/chunk-WVR4RUFP.js +327 -0
  604. package/dist/commands/chunk-WW3TX742.js +122 -0
  605. package/dist/commands/chunk-WWC5L3AO.js +177 -0
  606. package/dist/commands/chunk-X5XYKDOD.js +7 -0
  607. package/dist/commands/chunk-X7PN54LZ.js +143 -0
  608. package/dist/commands/chunk-XBRD2BDL.js +74 -0
  609. package/dist/commands/chunk-XDF25GSU.js +536 -0
  610. package/dist/commands/chunk-XDQOWUVT.js +51 -0
  611. package/dist/commands/chunk-XFPEUYDV.js +67 -0
  612. package/dist/commands/chunk-XGMRAKSL.js +85 -0
  613. package/dist/commands/chunk-XH6BGVVP.js +1639 -0
  614. package/dist/commands/chunk-XMBRXCIE.js +89 -0
  615. package/dist/commands/chunk-XSKB6ZUA.js +123 -0
  616. package/dist/commands/chunk-XXNEY4B3.js +110 -0
  617. package/dist/commands/chunk-XYAK53TK.js +443 -0
  618. package/dist/commands/chunk-Y2RNUX4W.js +8 -0
  619. package/dist/commands/chunk-Y5ZW3KN5.js +58 -0
  620. package/dist/commands/chunk-YGDNUTTI.js +120 -0
  621. package/dist/commands/chunk-YIA6FC3K.js +78 -0
  622. package/dist/commands/chunk-YPNTORQD.js +121 -0
  623. package/dist/commands/chunk-YT342DRV.js +143 -0
  624. package/dist/commands/chunk-YVH2OLDS.js +104 -0
  625. package/dist/commands/chunk-Z4HYBFZD.js +1160 -0
  626. package/dist/commands/chunk-ZA3W73PF.js +192 -0
  627. package/dist/commands/chunk-ZAAHZY2A.js +19 -0
  628. package/dist/commands/chunk-ZAJD6T6E.js +38 -0
  629. package/dist/commands/chunk-ZBFNQUY7.js +12 -0
  630. package/dist/commands/chunk-ZDSDPKCD.js +88 -0
  631. package/dist/commands/chunk-ZECFKW7D.js +60 -0
  632. package/dist/commands/chunk-ZHZSZNE2.js +173 -0
  633. package/dist/commands/chunk-ZNX2LJCQ.js +29 -0
  634. package/dist/commands/chunk-ZQ3CKRMP.js +99 -0
  635. package/dist/commands/chunk-ZVAIIHBE.js +63 -0
  636. package/dist/commands/chunk-ZYGOZT4J.js +39 -0
  637. package/dist/commands/chunk-ZYIMQHCB.js +81 -0
  638. package/dist/commands/chunk-ZZAH3YQP.js +170 -0
  639. package/dist/commands/ci-timing-cli.js +76 -0
  640. package/dist/commands/clone-scan-cli.js +189 -0
  641. package/dist/commands/code-symbol-cli.js +185 -0
  642. package/dist/commands/codex-hook-adapter.js +357 -0
  643. package/dist/commands/command-derive.js +802 -0
  644. package/dist/commands/cost-audit-main.js +207 -0
  645. package/dist/commands/cost-main.js +28 -0
  646. package/dist/commands/cspell-cached.js +158 -0
  647. package/dist/commands/defect-origin-main.js +221 -0
  648. package/dist/commands/defect-report-main.js +288 -0
  649. package/dist/commands/delegation-cli.js +65 -0
  650. package/dist/commands/diff-summary-cli.js +147 -0
  651. package/dist/commands/disposition-cli.js +408 -0
  652. package/dist/commands/doctor.js +267 -0
  653. package/dist/commands/document-read-cli.js +39 -844
  654. package/dist/commands/document-section-main.js +26 -835
  655. package/dist/commands/dogfood-commit-cli.js +102 -0
  656. package/dist/commands/e2e-retry-check.js +79 -0
  657. package/dist/commands/edit-files-cli.js +147 -0
  658. package/dist/commands/effect-audit-cli.js +319 -0
  659. package/dist/commands/epic-audit-main.js +158 -0
  660. package/dist/commands/epic-bundle-main.js +199 -0
  661. package/dist/commands/epic-check.js +90 -0
  662. package/dist/commands/epic-main.js +222 -0
  663. package/dist/commands/epic-next-main.js +157 -0
  664. package/dist/commands/eval-run.js +838 -0
  665. package/dist/commands/fanout-cli.js +86 -0
  666. package/dist/commands/format-edited-cli.js +120 -0
  667. package/dist/commands/format.js +139 -0
  668. package/dist/commands/fresh-machine-cli.js +691 -0
  669. package/dist/commands/gh-usage-cli.js +224 -0
  670. package/dist/commands/git-followup-workflow.js +2012 -0
  671. package/dist/commands/git-gh-checks-failed-main.js +156 -0
  672. package/dist/commands/git-workflow.js +602 -0
  673. package/dist/commands/github-release-cli.js +253 -0
  674. package/dist/commands/hook-ledger-cli.js +416 -0
  675. package/dist/commands/init-main.js +98 -0
  676. package/dist/commands/inputs.json +2764 -0
  677. package/dist/commands/issue-ack-cli.js +106 -0
  678. package/dist/commands/issue-already-done-cli.js +305 -0
  679. package/dist/commands/issue-body-cli.js +184 -0
  680. package/dist/commands/issue-cite-main.js +162 -0
  681. package/dist/commands/issue-comment-main.js +72 -0
  682. package/dist/commands/issue-consolidate-cli.js +329 -0
  683. package/dist/commands/issue-file-main.js +419 -0
  684. package/dist/commands/issue-fold-existing-cli.js +506 -0
  685. package/dist/commands/issue-fold-main.js +113 -0
  686. package/dist/commands/issue-lint-main.js +126 -0
  687. package/dist/commands/issue-measured-cli.js +205 -0
  688. package/dist/commands/issue-plan-cli.js +352 -0
  689. package/dist/commands/issue-premise-unmet-cli.js +268 -0
  690. package/dist/commands/issue-priority-cli.js +184 -0
  691. package/dist/commands/issue-read-main.js +79 -0
  692. package/dist/commands/issue-release-class-cli.js +119 -0
  693. package/dist/commands/issue-release-main.js +71 -0
  694. package/dist/commands/issue-scout-main.js +203 -0
  695. package/dist/commands/issue-spill-main.js +564 -0
  696. package/dist/commands/issue-state-main.js +76 -0
  697. package/dist/commands/issue-tick-cli.js +112 -0
  698. package/dist/commands/josh-completion.js +153 -0
  699. package/dist/commands/lane-adopt-cli.js +275 -0
  700. package/dist/commands/lane-breakdown-cli.js +703 -0
  701. package/dist/commands/lane-cli.js +863 -0
  702. package/dist/commands/lane-launch-main.js +103 -0
  703. package/dist/commands/lane-limit-cli.js +286 -0
  704. package/dist/commands/lane-measure-cli.js +1797 -0
  705. package/dist/commands/lane-pause-cli.js +255 -0
  706. package/dist/commands/lane-plan-cli.js +322 -0
  707. package/dist/commands/lane-resolve-cli.js +300 -0
  708. package/dist/commands/lane-restart-cli.js +387 -0
  709. package/dist/commands/lane-why-cli.js +307 -0
  710. package/dist/commands/lane-withdraw-cli.js +191 -0
  711. package/dist/commands/latest-corepack.js +278 -0
  712. package/dist/commands/latest-if-required-cli.js +124 -0
  713. package/dist/commands/latest-lane-guard-main.js +16 -0
  714. package/dist/commands/latest-scope-main.js +38 -0
  715. package/dist/commands/latest-update.js +449 -0
  716. package/dist/commands/lines-command.js +121 -0
  717. package/dist/commands/lint-parallel-main.js +134 -0
  718. package/dist/commands/lint-related.js +565 -0
  719. package/dist/commands/lint-rule.js +305 -0
  720. package/dist/commands/lockfile-policy.js +107 -0
  721. package/dist/commands/main-merge-main.js +61 -0
  722. package/dist/commands/main-sync-main.js +60 -0
  723. package/dist/commands/managed-config-scope-cli.js +66 -0
  724. package/dist/commands/measure-rerun-cli.js +124 -0
  725. package/dist/commands/metrics-command.js +859 -0
  726. package/dist/commands/observation-depth-cli.js +109 -0
  727. package/dist/commands/observation-record-cli.js +87 -0
  728. package/dist/commands/observations-flush-cli.js +115 -0
  729. package/dist/commands/oracle-list-cli.js +73 -0
  730. package/dist/commands/overrides-check.js +112 -0
  731. package/dist/commands/package-scout-cli.js +496 -0
  732. package/dist/commands/pin-verify-cli.js +88 -0
  733. package/dist/commands/plan-consumers-main.js +49 -0
  734. package/dist/commands/plan-scaffold-cli.js +367 -0
  735. package/dist/commands/port-command.js +64 -0
  736. package/dist/commands/pr-classification-main.js +37 -0
  737. package/dist/commands/pre-commit-lint.js +163 -0
  738. package/dist/commands/pre-commit-type-check.js +210 -0
  739. package/dist/commands/pre-push-unit.js +271 -0
  740. package/dist/commands/pretool-guard-cli.js +205 -0
  741. package/dist/commands/prevent-main-commit.js +42 -0
  742. package/dist/commands/project-profile-cli.js +58 -0
  743. package/dist/commands/propagate.js +368 -0
  744. package/dist/commands/prose-stale-cli.js +128 -0
  745. package/dist/commands/publish-tag-cli.js +30 -0
  746. package/dist/commands/publishable-range-check.js +191 -0
  747. package/dist/commands/read-files-cli.js +81 -0
  748. package/dist/commands/read-set-cli.js +121 -1745
  749. package/dist/commands/reconcile-templates.js +135 -0
  750. package/dist/commands/refactor-scan-cli.js +175 -0
  751. package/dist/commands/release-cli.js +724 -0
  752. package/dist/commands/release-scope-main.js +81 -0
  753. package/dist/commands/rename-cli.js +432 -0
  754. package/dist/commands/repo-party-cli.js +58 -0
  755. package/dist/commands/report-lint-cli.js +124 -0
  756. package/dist/commands/report-template-cli.js +69 -0
  757. package/dist/commands/reserved-run.js +127 -0
  758. package/dist/commands/retrospective-cli.js +555 -0
  759. package/dist/commands/review-attest-cli.js +118 -0
  760. package/dist/commands/review-brief-main.js +247 -0
  761. package/dist/commands/review-findings-cli.js +114 -0
  762. package/dist/commands/review-pair-cli.js +366 -0
  763. package/dist/commands/review-record-main.js +222 -0
  764. package/dist/commands/review-round2-cli.js +349 -0
  765. package/dist/commands/review-stops-cli.js +149 -0
  766. package/dist/commands/review-submit-cli.js +610 -0
  767. package/dist/commands/rule-list.js +184 -0
  768. package/dist/commands/rule-value-cli.js +908 -0
  769. package/dist/commands/ruleset-check-cli.js +67 -0
  770. package/dist/commands/run-add-cli.js +273 -0
  771. package/dist/commands/run-board-main.js +272 -0
  772. package/dist/commands/run-carry-cli.js +641 -0
  773. package/dist/commands/run-chain-cli.js +537 -0
  774. package/dist/commands/run-cut-cli.js +709 -0
  775. package/dist/commands/run-ending-cli.js +169 -0
  776. package/dist/commands/run-entry-cli.js +1060 -0
  777. package/dist/commands/run-event-cli.js +298 -0
  778. package/dist/commands/run-handoff-cli.js +344 -0
  779. package/dist/commands/run-handoff-lanes-cli.js +233 -0
  780. package/dist/commands/run-hold-main.js +203 -0
  781. package/dist/commands/run-liveness-cli.js +190 -0
  782. package/dist/commands/run-merge-main.js +246 -0
  783. package/dist/commands/run-next-cli.js +240 -0
  784. package/dist/commands/run-park-cli.js +393 -0
  785. package/dist/commands/run-pause-cli.js +334 -0
  786. package/dist/commands/run-pickup-cli.js +196 -0
  787. package/dist/commands/run-prep-main.js +209 -21168
  788. package/dist/commands/run-prime-cli.js +281 -0
  789. package/dist/commands/run-progress-main.js +655 -0
  790. package/dist/commands/run-report-cli.js +376 -0
  791. package/dist/commands/run-review-cli.js +777 -0
  792. package/dist/commands/run-ship-cli.js +2615 -0
  793. package/dist/commands/run-ship-evidence-cli.js +288 -0
  794. package/dist/commands/run-ship-lap-W5T2VHFC.js +30 -0
  795. package/dist/commands/run-ship-wait-main.js +145 -0
  796. package/dist/commands/run-split-cli.js +525 -0
  797. package/dist/commands/run-stale-main.js +254 -0
  798. package/dist/commands/run-status-cli.js +216 -0
  799. package/dist/commands/run-step-cli.js +419 -27653
  800. package/dist/commands/run-tail-cli.js +119 -0
  801. package/dist/commands/run-tidy-main.js +402 -0
  802. package/dist/commands/run-wake-main.js +272 -0
  803. package/dist/commands/run-watcher-guard-cli.js +128 -0
  804. package/dist/commands/secretlint-scan.js +84 -0
  805. package/dist/commands/security-audit-main.js +151 -0
  806. package/dist/commands/security-audit-provision-main.js +52 -0
  807. package/dist/commands/selfcheck-cli.js +409 -0
  808. package/dist/commands/session-language-main.js +120 -0
  809. package/dist/commands/sonar-hotspots-cli.js +133 -0
  810. package/dist/commands/sonar-new-code-cli.js +143 -0
  811. package/dist/commands/split-assess-cli.js +138 -0
  812. package/dist/commands/split-child-recover-cli.js +168 -0
  813. package/dist/commands/start.js +707 -0
  814. package/dist/commands/stash-pop-main.js +26 -0
  815. package/dist/commands/stash-push-main.js +30 -0
  816. package/dist/commands/stop-guard.js +567 -0
  817. package/dist/commands/sync-main.js +57 -0
  818. package/dist/commands/telegram-test-main.js +64 -0
  819. package/dist/commands/test-declared.js +255 -0
  820. package/dist/commands/test-e2e-guard.js +200 -0
  821. package/dist/commands/test-pinned-main.js +189 -0
  822. package/dist/commands/test-reach-cli.js +111 -0
  823. package/dist/commands/test-red-main.js +46 -0
  824. package/dist/commands/test-related-ZT2AO62I.js +113 -0
  825. package/dist/commands/test-related-main.js +223 -0
  826. package/dist/commands/test-unit-guard-main.js +87 -0
  827. package/dist/commands/time-cli.js +356 -0
  828. package/dist/commands/time-density-cli.js +183 -0
  829. package/dist/commands/tree-status-cli.js +172 -0
  830. package/dist/commands/type-check-command.js +74 -0
  831. package/dist/commands/ui-routes-cli.js +135 -0
  832. package/dist/commands/ui-shot-cli.js +131 -0
  833. package/dist/commands/uninstall.js +424 -0
  834. package/dist/commands/unused-members-STULPRBU.js +331 -0
  835. package/dist/commands/unused-members-cli.js +54 -0
  836. package/dist/commands/upstream-interrupt-main.js +449 -0
  837. package/dist/commands/usage-tee-cli.js +60 -0
  838. package/dist/commands/verification-gate.js +808 -0
  839. package/dist/commands/version-check.js +497 -0
  840. package/dist/hooks/audit-provision.js +20 -9
  841. package/dist/hooks/{chunk-UJ3FPMMM.js → chunk-4YXV2REH.js} +444 -141
  842. package/dist/hooks/chunk-6RR6JZSB.js +12367 -0
  843. package/dist/hooks/chunk-6YGMIODI.js +86 -0
  844. package/dist/hooks/chunk-CICKRHTB.js +7586 -0
  845. package/dist/hooks/chunk-CY3ADSDR.js +28580 -0
  846. package/dist/hooks/chunk-FOW4B7OQ.js +1795 -0
  847. package/dist/hooks/chunk-LKQBEKBI.js +232 -0
  848. package/dist/hooks/chunk-LRD2ERRI.js +299 -0
  849. package/dist/hooks/chunk-LWD43Z3C.js +6793 -0
  850. package/dist/hooks/chunk-NUPVO7RI.js +3054 -0
  851. package/dist/hooks/chunk-P7BPAU26.js +1082 -0
  852. package/dist/hooks/chunk-RQXECHAS.js +309 -0
  853. package/dist/hooks/chunk-SAAPRHTK.js +43 -0
  854. package/dist/hooks/chunk-U3ON2GBN.js +12 -0
  855. package/dist/hooks/{chunk-CQD4LJE6.js → chunk-UU4PTPEZ.js} +3143 -1257
  856. package/dist/hooks/chunk-YEURBB4L.js +32 -0
  857. package/dist/hooks/codex-hook-adapter.js +61 -25
  858. package/dist/hooks/daemon.js +67304 -0
  859. package/dist/hooks/format-edited.js +15 -5
  860. package/dist/hooks/inputs.json +584 -401
  861. package/dist/hooks/pretool-guard.js +11 -7
  862. package/dist/hooks/ready.js +300 -0
  863. package/dist/hooks/run-ship-lap-VCEOUHQI.js +8 -0
  864. package/dist/hooks/session-lang.js +226 -121
  865. package/dist/hooks/stop-guard.js +9188 -4508
  866. package/dist/inputs.json +169 -0
  867. package/dist/josh.js +9617 -6711
  868. package/dist/self-sync-guard/index.js +68 -14
  869. package/dist/version/index.js +642 -85
  870. package/eslint/base.js +36 -11
  871. package/eslint/config-fingerprint.js +164 -21
  872. package/eslint/rules/code-quality.js +6 -0
  873. package/eslint/rules/comment-why-only.js +40 -16
  874. package/eslint/rules/english-only-prose.js +10 -3
  875. package/eslint/rules/import.js +3 -17
  876. package/eslint/rules/test-helper-bans.js +34 -0
  877. package/eslint/untyped-environment.js +21 -0
  878. package/eslint/untyped.js +60 -0
  879. package/lefthook/base.yml +4 -5
  880. package/package.json +15 -13
  881. package/pnpm-workspace.yaml +15 -0
  882. package/ports/index.js +8 -15
  883. package/prompts/coding-standards.md +4 -43
  884. package/prompts/collaboration-workflow/file-edits.md +10 -10
  885. package/prompts/collaboration-workflow/gh-rest.md +14 -7
  886. package/prompts/collaboration-workflow/issue-template.en.md +125 -0
  887. package/prompts/collaboration-workflow/issue-template.md +49 -56
  888. package/prompts/collaboration-workflow/lane-instructions.md +1 -0
  889. package/prompts/collaboration-workflow/measurement.md +13 -17
  890. package/prompts/collaboration-workflow/operating-rules.md +10 -7
  891. package/prompts/collaboration-workflow/output-bounds.md +3 -3
  892. package/prompts/collaboration-workflow/overview.md +8 -17
  893. package/prompts/collaboration-workflow/plan-comment.md +1 -1
  894. package/prompts/collaboration-workflow/principles.md +17 -19
  895. package/prompts/collaboration-workflow/report-format.md +6 -5
  896. package/prompts/collaboration-workflow/residency.md +1 -0
  897. package/prompts/collaboration-workflow/rule-delivery.md +4 -12
  898. package/prompts/collaboration-workflow/shell-body.md +7 -7
  899. package/prompts/collaboration-workflow/turn-batching.md +2 -2
  900. package/prompts/collaboration-workflow/upstream-interrupt.md +8 -8
  901. package/prompts/collaboration-workflow/wip-cap.md +3 -3
  902. package/prompts/refactoring.md +4 -3
  903. package/prompts/review-rubric.md +8 -21
  904. package/prompts/review.md +52 -80
  905. package/prompts/sonar-hotspot-handling.md +1 -1
  906. package/prompts/testing-guide.md +15 -2
  907. package/scripts/agent/agent-argv.ts +11 -4
  908. package/scripts/agent/agent-consultation-model.ts +47 -0
  909. package/scripts/agent/agent-event.ts +11 -2
  910. package/scripts/agent/agent-launch-environment.ts +6 -57
  911. package/scripts/agent/agent-model-alias.ts +19 -0
  912. package/scripts/agent/agent-profile-schema.ts +98 -0
  913. package/scripts/agent/agent-role-profile.ts +105 -82
  914. package/scripts/agent/agent-safe-text.ts +2 -2
  915. package/scripts/agent/agent-session-role.ts +25 -3
  916. package/scripts/agent/answer-judge.ts +174 -0
  917. package/scripts/agent/answer-verdict.ts +122 -0
  918. package/scripts/agent/claude-agent-argv.ts +12 -6
  919. package/scripts/agent/codex-agent-argv.ts +17 -143
  920. package/scripts/agent/codex-home-source.ts +1 -1
  921. package/scripts/agent/codex-hooks.ts +29 -6
  922. package/scripts/agent/judgment-agent-argv.ts +49 -0
  923. package/scripts/agent/lane-instructions.ts +4 -1
  924. package/scripts/auto-ok/auto-ok-author.ts +14 -3
  925. package/scripts/auto-ok/auto-ok-cli.ts +20 -12
  926. package/scripts/auto-ok/auto-ok-judge-cli.ts +7 -14
  927. package/scripts/auto-ok/auto-ok-judge-read.ts +3 -3
  928. package/scripts/auto-ok/auto-ok-judge-write.ts +18 -16
  929. package/scripts/backlog/backlog-arrival-added.ts +47 -11
  930. package/scripts/backlog/backlog-arrival.ts +90 -23
  931. package/scripts/backlog/backlog-auto-triage.ts +130 -0
  932. package/scripts/backlog/backlog-budget-cli.ts +2 -1
  933. package/scripts/backlog/backlog-budget.ts +31 -5
  934. package/scripts/backlog/backlog-defect-priority.ts +32 -19
  935. package/scripts/backlog/backlog-drain-flush.ts +22 -0
  936. package/scripts/backlog/backlog-drive-adopt.ts +2 -2
  937. package/scripts/backlog/backlog-drive-after-merge.ts +123 -0
  938. package/scripts/backlog/backlog-drive-args.ts +60 -7
  939. package/scripts/backlog/backlog-drive-cli.ts +69 -64
  940. package/scripts/backlog/backlog-drive-collect.ts +46 -0
  941. package/scripts/backlog/backlog-drive-epic.ts +1 -1
  942. package/scripts/backlog/backlog-drive-hold.ts +32 -8
  943. package/scripts/backlog/backlog-drive-idle.ts +21 -10
  944. package/scripts/backlog/backlog-drive-launch-pass.ts +79 -23
  945. package/scripts/backlog/backlog-drive-launch.ts +73 -7
  946. package/scripts/backlog/backlog-drive-listing.ts +59 -0
  947. package/scripts/backlog/backlog-drive-memory.ts +4 -5
  948. package/scripts/backlog/backlog-drive-named-offer.ts +112 -22
  949. package/scripts/backlog/backlog-drive-named.ts +11 -4
  950. package/scripts/backlog/backlog-drive-offer-argv.ts +10 -2
  951. package/scripts/backlog/backlog-drive-park-triage.ts +57 -0
  952. package/scripts/backlog/backlog-drive-paused.ts +2 -1
  953. package/scripts/backlog/backlog-drive-rate-limit.ts +29 -0
  954. package/scripts/backlog/backlog-drive-rate.ts +73 -0
  955. package/scripts/backlog/backlog-drive-record.ts +58 -0
  956. package/scripts/backlog/backlog-drive-restore.ts +38 -8
  957. package/scripts/backlog/backlog-drive-retrospective-unit.ts +80 -0
  958. package/scripts/backlog/backlog-drive-retrospective.ts +35 -1
  959. package/scripts/backlog/backlog-drive-retry.ts +85 -0
  960. package/scripts/backlog/backlog-drive-seats.ts +4 -7
  961. package/scripts/backlog/backlog-drive-split-unit.ts +108 -0
  962. package/scripts/backlog/backlog-drive-stalled-retry.ts +194 -0
  963. package/scripts/backlog/backlog-drive-state.ts +28 -0
  964. package/scripts/backlog/backlog-drive-tick.ts +77 -0
  965. package/scripts/backlog/backlog-drive-token-handling.ts +2 -2
  966. package/scripts/backlog/backlog-drive-trace.ts +45 -0
  967. package/scripts/backlog/backlog-drive-unit.ts +54 -0
  968. package/scripts/backlog/backlog-drive-unread.ts +1 -1
  969. package/scripts/backlog/backlog-drive.ts +142 -99
  970. package/scripts/backlog/backlog-gate-scope.ts +15 -3
  971. package/scripts/backlog/backlog-hold-codes.ts +23 -0
  972. package/scripts/backlog/backlog-hold-text.ts +107 -0
  973. package/scripts/backlog/backlog-measure-close.ts +61 -31
  974. package/scripts/backlog/backlog-named.ts +1 -1
  975. package/scripts/backlog/backlog-next-offer.ts +138 -0
  976. package/scripts/backlog/backlog-next-report.ts +221 -0
  977. package/scripts/backlog/backlog-next-shared.ts +22 -4
  978. package/scripts/backlog/backlog-next-size.ts +108 -0
  979. package/scripts/backlog/backlog-next.ts +52 -187
  980. package/scripts/backlog/backlog-occupied.ts +7 -7
  981. package/scripts/backlog/backlog-offer-cli.ts +13 -2
  982. package/scripts/backlog/backlog-offer-timing.ts +141 -0
  983. package/scripts/backlog/backlog-offer.ts +26 -6
  984. package/scripts/backlog/backlog-overlap.ts +7 -1
  985. package/scripts/backlog/backlog-plan-cli.ts +27 -3
  986. package/scripts/backlog/backlog-plan-comment.ts +36 -14
  987. package/scripts/backlog/backlog-plan-words.ts +69 -0
  988. package/scripts/backlog/backlog-plan.ts +63 -46
  989. package/scripts/backlog/backlog-pool.ts +42 -13
  990. package/scripts/backlog/backlog-preflight.ts +67 -0
  991. package/scripts/backlog/backlog-ready.ts +7 -69
  992. package/scripts/backlog/backlog-resumable.ts +65 -0
  993. package/scripts/backlog/backlog-resume-reads.ts +119 -0
  994. package/scripts/backlog/backlog-stalled-detect.ts +4 -3
  995. package/scripts/backlog/backlog-stalled.ts +3 -2
  996. package/scripts/backlog/backlog-triage-adopt.ts +239 -0
  997. package/scripts/backlog/backlog-triage-approval.ts +94 -0
  998. package/scripts/backlog/backlog-triage-cli.ts +270 -0
  999. package/scripts/backlog/backlog-triage-decision.ts +49 -0
  1000. package/scripts/backlog/backlog-triage-park.ts +53 -0
  1001. package/scripts/backlog/backlog-triage-pass.ts +113 -0
  1002. package/scripts/backlog/backlog-triage-unblock.ts +68 -0
  1003. package/scripts/backlog/backlog-wait-cause.ts +76 -16
  1004. package/scripts/backlog/backlog-yield-cap.ts +108 -0
  1005. package/scripts/backlog/backlogrun-args.ts +45 -16
  1006. package/scripts/backlog/backlogrun-cli.ts +82 -18
  1007. package/scripts/backlog/backlogrun-launch.ts +12 -4
  1008. package/scripts/backlog/backlogrun-replace.ts +44 -4
  1009. package/scripts/build/build-bin.ts +25 -2
  1010. package/scripts/build/build-codex-hooks.ts +2 -2
  1011. package/scripts/build/build-commands.ts +27 -19
  1012. package/scripts/build/build-hooks.ts +117 -22
  1013. package/scripts/build/hook-bundle-stamp.ts +15 -5
  1014. package/scripts/build/local-bin.ts +27 -1
  1015. package/scripts/build/source-location.ts +82 -0
  1016. package/scripts/ci/ci-timing-cli.ts +73 -0
  1017. package/scripts/ci/ci-timing-table.ts +84 -0
  1018. package/scripts/ci/ci-timing.ts +104 -0
  1019. package/scripts/ci/composite-actions.ts +1 -1
  1020. package/scripts/ci/pr-classification.ts +89 -11
  1021. package/scripts/code/code-symbol-cli.ts +121 -0
  1022. package/scripts/code/code-symbol.ts +127 -0
  1023. package/scripts/config-merge/patch-json-key.ts +4 -7
  1024. package/scripts/cost-runtime/cost-blocks.ts +3 -4
  1025. package/scripts/cost-runtime/cost-cli.ts +4 -7
  1026. package/scripts/cost-runtime/cost-pricing.ts +2 -2
  1027. package/scripts/cost-runtime/cost-tokens.ts +7 -6
  1028. package/scripts/delegation/delegation-policy.ts +2 -2
  1029. package/scripts/delegation/duplicate-read-guard.ts +41 -28
  1030. package/scripts/delegation/investigation-guard.ts +13 -5
  1031. package/scripts/delegation/investigation-reads.ts +52 -34
  1032. package/scripts/delegation/large-read-guard.ts +150 -0
  1033. package/scripts/discovery/git-directory.ts +61 -0
  1034. package/scripts/discovery/pin-verify-cli.ts +115 -0
  1035. package/scripts/discovery/repo-discovery.ts +10 -58
  1036. package/scripts/discovery/repo-party.ts +1 -0
  1037. package/scripts/document/backlogrun-parent-read-set.ts +37 -6
  1038. package/scripts/document/capped-print.ts +3 -3
  1039. package/scripts/document/command-reference-line-budget.ts +4 -1
  1040. package/scripts/document/document-byte-budget.ts +34 -16
  1041. package/scripts/document/document-byte-check.ts +1 -1
  1042. package/scripts/document/document-reachability.ts +4 -3
  1043. package/scripts/document/document-scan.ts +2 -5
  1044. package/scripts/document/document-section-cli.ts +13 -1
  1045. package/scripts/document/edit-files-cli.ts +3 -7
  1046. package/scripts/document/entry-read-budget.ts +12 -4
  1047. package/scripts/document/entry-read-set.ts +9 -2
  1048. package/scripts/document/issue-citation-budget.ts +3 -3
  1049. package/scripts/document/lane-child-read-set.ts +21 -29
  1050. package/scripts/document/read-set-cli.ts +17 -10
  1051. package/scripts/document/read-set-point-of-use.ts +13 -9
  1052. package/scripts/document/read-set-trim.ts +42 -2
  1053. package/scripts/epic/epic-audit-checks.ts +1 -1
  1054. package/scripts/epic/epic-audit-cli.ts +19 -21
  1055. package/scripts/epic/epic-audit-main.ts +17 -0
  1056. package/scripts/epic/epic-audit-orphans.ts +1 -1
  1057. package/scripts/epic/epic-audit.ts +6 -3
  1058. package/scripts/epic/epic-blocked-by.ts +198 -0
  1059. package/scripts/epic/epic-body.ts +6 -6
  1060. package/scripts/epic/epic-bundle-apply.ts +41 -10
  1061. package/scripts/epic/epic-bundle-cli.ts +40 -99
  1062. package/scripts/epic/epic-bundle-evidence.ts +2 -2
  1063. package/scripts/epic/epic-bundle-format.ts +21 -7
  1064. package/scripts/epic/epic-bundle-recommend.ts +56 -0
  1065. package/scripts/epic/epic-bundle-referenced.ts +42 -17
  1066. package/scripts/epic/epic-bundle.ts +31 -4
  1067. package/scripts/epic/epic-busy.ts +11 -9
  1068. package/scripts/epic/epic-chains.ts +59 -23
  1069. package/scripts/epic/epic-child-source.ts +111 -0
  1070. package/scripts/epic/epic-cli-untrack.ts +38 -0
  1071. package/scripts/epic/epic-cli.ts +26 -7
  1072. package/scripts/epic/epic-close-comment.ts +4 -2
  1073. package/scripts/epic/epic-close.ts +25 -11
  1074. package/scripts/epic/epic-decide.ts +39 -3
  1075. package/scripts/epic/epic-fetch.ts +116 -24
  1076. package/scripts/epic/epic-graph.ts +1 -0
  1077. package/scripts/epic/epic-label-age.ts +55 -13
  1078. package/scripts/epic/epic-lane-occupancy.ts +75 -0
  1079. package/scripts/epic/epic-lane-offer.ts +49 -13
  1080. package/scripts/epic/epic-main.ts +23 -0
  1081. package/scripts/epic/epic-next-main.ts +2 -4
  1082. package/scripts/epic/epic-next-read.ts +12 -3
  1083. package/scripts/epic/epic-next-views.ts +1 -1
  1084. package/scripts/epic/epic-notify.ts +72 -0
  1085. package/scripts/epic/epic-parse.ts +1 -1
  1086. package/scripts/epic/epic-rank.ts +6 -2
  1087. package/scripts/epic/epic-reference.ts +1 -1
  1088. package/scripts/epic/epic-run.ts +14 -1
  1089. package/scripts/epic/epic-shape.ts +2 -2
  1090. package/scripts/epic/epic-solo-stale.ts +1 -1
  1091. package/scripts/epic/epic-solo.ts +11 -5
  1092. package/scripts/epic/epic-split-reach.ts +107 -0
  1093. package/scripts/epic/epic-triage.ts +29 -5
  1094. package/scripts/epic/epic-untrack-plan.ts +75 -0
  1095. package/scripts/epic/epic-untrack.ts +42 -0
  1096. package/scripts/epic/epic.ts +65 -31
  1097. package/scripts/followup/followup-check-report.ts +70 -0
  1098. package/scripts/followup/followup-ci-path.ts +27 -7
  1099. package/scripts/followup/followup-coderabbit-retrigger.ts +61 -23
  1100. package/scripts/followup/followup-failed-tests.ts +4 -0
  1101. package/scripts/followup/followup-human-merge.ts +109 -0
  1102. package/scripts/followup/followup-job-needs.ts +92 -14
  1103. package/scripts/followup/followup-job-rerun.ts +162 -43
  1104. package/scripts/followup/followup-run-rerun.ts +183 -0
  1105. package/scripts/followup/followup-section.ts +30 -0
  1106. package/scripts/followup/followup-ship-environment.ts +17 -0
  1107. package/scripts/followup/git-followup-finish.ts +52 -1
  1108. package/scripts/followup/git-followup-flush.ts +6 -8
  1109. package/scripts/followup/git-followup-stages.ts +3 -0
  1110. package/scripts/followup/git-followup-workflow.ts +29 -9
  1111. package/scripts/followup/git-pr-followup-checks.ts +65 -8
  1112. package/scripts/followup/git-pr-followup-wrapup.ts +11 -9
  1113. package/scripts/followup/git-pr-followup.ts +18 -12
  1114. package/scripts/fresh-machine/fresh-machine-cli.ts +2 -1
  1115. package/scripts/fresh-machine/fresh-machine-image.ts +3 -1
  1116. package/scripts/fresh-machine/fresh-machine-patterns.ts +25 -4
  1117. package/scripts/fresh-machine/fresh-machine-registry.ts +85 -0
  1118. package/scripts/fresh-machine/fresh-machine-script.ts +3 -1
  1119. package/scripts/fresh-machine/fresh-machine-spec.ts +2 -2
  1120. package/scripts/fresh-machine/specs/kit-test-backlogrun-python.json +0 -1
  1121. package/scripts/fresh-machine/specs/kit-test-backlogrun.json +0 -1
  1122. package/scripts/gate/busy-average.ts +26 -3
  1123. package/scripts/gate/change-scope-action.ts +101 -0
  1124. package/scripts/gate/check-inputs.ts +1 -1
  1125. package/scripts/gate/check-related-order.ts +65 -0
  1126. package/scripts/gate/check-related-pinned.ts +3 -2
  1127. package/scripts/gate/check-related-reuse.ts +34 -6
  1128. package/scripts/gate/check-related-section.ts +8 -1
  1129. package/scripts/gate/check-related-unplanned.ts +11 -1
  1130. package/scripts/gate/check-related.ts +122 -34
  1131. package/scripts/gate/check-reuse.ts +63 -31
  1132. package/scripts/gate/command-memory.ts +10 -4
  1133. package/scripts/gate/core-admission.ts +34 -8
  1134. package/scripts/gate/core-budget.ts +55 -65
  1135. package/scripts/gate/core-priority.ts +28 -0
  1136. package/scripts/gate/core-reservation.ts +85 -0
  1137. package/scripts/gate/core-wait.ts +90 -19
  1138. package/scripts/gate/core-weights.ts +25 -16
  1139. package/scripts/gate/gate-checks.ts +196 -0
  1140. package/scripts/gate/gate-labels.ts +4 -0
  1141. package/scripts/gate/gate-plan.ts +34 -164
  1142. package/scripts/gate/gate-report.ts +14 -10
  1143. package/scripts/gate/gate-run-steps.ts +38 -6
  1144. package/scripts/gate/gate-skip.ts +1 -1
  1145. package/scripts/gate/gate-static-group.ts +35 -6
  1146. package/scripts/gate/machine-capacity.ts +20 -25
  1147. package/scripts/gate/metrics-totals.ts +30 -4
  1148. package/scripts/gate/path-glob.ts +15 -0
  1149. package/scripts/gate/pre-commit-type-check.ts +2 -6
  1150. package/scripts/gate/project-checks.ts +33 -2
  1151. package/scripts/gate/project-gate-steps.ts +206 -0
  1152. package/scripts/gate/project-step-reuse.ts +69 -0
  1153. package/scripts/gate/scoped-green.ts +10 -4
  1154. package/scripts/gate/since-green.ts +76 -20
  1155. package/scripts/gate/tree-verdict.ts +111 -0
  1156. package/scripts/gate/tsc-arguments.ts +9 -0
  1157. package/scripts/gate/type-check-command.ts +4 -7
  1158. package/scripts/gate/type-check-step.ts +4 -1
  1159. package/scripts/gate/type-program-serial.ts +52 -0
  1160. package/scripts/gate/verification-gate.ts +47 -17
  1161. package/scripts/gate/verification-inputs.ts +46 -11
  1162. package/scripts/gate/whole-tree-reuse.ts +24 -0
  1163. package/scripts/gh/gh-author-association.ts +40 -14
  1164. package/scripts/gh/gh-call-kind.ts +97 -0
  1165. package/scripts/gh/gh-comment-input.ts +26 -0
  1166. package/scripts/gh/gh-core-rate-limit.ts +151 -0
  1167. package/scripts/gh/gh-permission-cache.ts +44 -0
  1168. package/scripts/gh/gh-request-tally.ts +143 -0
  1169. package/scripts/gh/gh-spawn.ts +2 -2
  1170. package/scripts/gh/gh-usage-cli.ts +71 -0
  1171. package/scripts/gh/gh-usage-event.ts +82 -0
  1172. package/scripts/gh/gh-usage-log.ts +48 -0
  1173. package/scripts/gh/gh-usage-tally.ts +209 -0
  1174. package/scripts/gh/git-gh-api-path.ts +17 -2
  1175. package/scripts/gh/git-gh-blocked-by-graphql.ts +107 -0
  1176. package/scripts/gh/git-gh-checks-failed-main.ts +24 -0
  1177. package/scripts/gh/git-gh-checks-failed.ts +141 -0
  1178. package/scripts/gh/git-gh-code-scanning.ts +81 -0
  1179. package/scripts/gh/git-gh-conditional.ts +36 -4
  1180. package/scripts/gh/git-gh-etag-read.ts +107 -0
  1181. package/scripts/gh/git-gh-exec.ts +74 -25
  1182. package/scripts/gh/git-gh-failure.ts +16 -2
  1183. package/scripts/gh/git-gh-helpers.ts +2 -6
  1184. package/scripts/gh/git-gh-issue-alias-graphql.ts +113 -0
  1185. package/scripts/gh/git-gh-issue-batch-graphql.ts +155 -0
  1186. package/scripts/gh/git-gh-issue-batch-read.ts +66 -0
  1187. package/scripts/gh/git-gh-issue-graphql.ts +229 -0
  1188. package/scripts/gh/git-gh-issue-list-graphql.ts +103 -0
  1189. package/scripts/gh/git-gh-issue-list.ts +126 -34
  1190. package/scripts/gh/git-gh-issue-memo.ts +53 -0
  1191. package/scripts/gh/git-gh-issue-read.ts +87 -14
  1192. package/scripts/gh/git-gh-issue-rest.ts +5 -8
  1193. package/scripts/gh/git-gh-issue-write.ts +31 -10
  1194. package/scripts/gh/git-gh-issue.ts +25 -4
  1195. package/scripts/gh/git-gh-poll-read.ts +43 -18
  1196. package/scripts/gh/git-gh-pr-auto-merge.ts +1 -4
  1197. package/scripts/gh/git-gh-pr-graphql-snapshot.ts +369 -0
  1198. package/scripts/gh/git-gh-pr-graphql-state.ts +21 -26
  1199. package/scripts/gh/git-gh-pr-read.ts +4 -1
  1200. package/scripts/gh/git-gh-pr-rollup.ts +10 -3
  1201. package/scripts/gh/git-gh-pr-snapshot.ts +78 -22
  1202. package/scripts/gh/git-gh-pr.ts +51 -17
  1203. package/scripts/gh/git-gh-rate-limit.ts +91 -0
  1204. package/scripts/gh/git-gh-repo.ts +37 -20
  1205. package/scripts/gh/git-gh-retry.ts +60 -24
  1206. package/scripts/gh/git-gh-spawn-width.ts +6 -0
  1207. package/scripts/gh/git-gh-transport.ts +213 -0
  1208. package/scripts/gh/git-pr-ai-review.ts +8 -5
  1209. package/scripts/gh/git-pr-checks-eval.ts +16 -17
  1210. package/scripts/gh/git-pr-checks-gate.ts +129 -0
  1211. package/scripts/gh/git-pr-checks-missing.ts +165 -0
  1212. package/scripts/gh/git-pr-checks-parse.ts +4 -0
  1213. package/scripts/gh/git-pr-checks-watch.ts +22 -6
  1214. package/scripts/gh/git-pr-checks.ts +105 -76
  1215. package/scripts/gh/git-pr-merge-checked.ts +26 -12
  1216. package/scripts/gh/git-pr.ts +9 -23
  1217. package/scripts/git/base-tree.ts +18 -10
  1218. package/scripts/git/changed-paths-sync.ts +4 -12
  1219. package/scripts/git/changed-paths.ts +31 -6
  1220. package/scripts/git/git-command.ts +9 -1
  1221. package/scripts/git/git-common-directory.ts +17 -3
  1222. package/scripts/git/git-issue.ts +3 -3
  1223. package/scripts/git/git-merge-conflicts.ts +8 -3
  1224. package/scripts/git/git-path-quoting.ts +54 -0
  1225. package/scripts/git/git-push-transport.ts +8 -10
  1226. package/scripts/git/git-schemas.ts +1 -0
  1227. package/scripts/git/git-spawn-sync.ts +11 -7
  1228. package/scripts/git/git-spawn.ts +1 -1
  1229. package/scripts/git/git-ssh-keepalive.ts +3 -3
  1230. package/scripts/git/git-workflow.ts +32 -9
  1231. package/scripts/git/git-worktree.ts +12 -4
  1232. package/scripts/git/main-merge.ts +3 -36
  1233. package/scripts/git/main-sync.ts +2 -13
  1234. package/scripts/git/repository-lock.ts +8 -7
  1235. package/scripts/git/stash/git-stash.ts +38 -5
  1236. package/scripts/git/stash/stash-pop-cli.ts +43 -6
  1237. package/scripts/hooks/bash-revert.ts +253 -0
  1238. package/scripts/hooks/batch-guard.ts +28 -16
  1239. package/scripts/hooks/check-commit-message.ts +5 -7
  1240. package/scripts/hooks/codex-hook-adapter.ts +58 -13
  1241. package/scripts/hooks/direct-gh-usage.ts +130 -0
  1242. package/scripts/hooks/edited-cspell.ts +8 -11
  1243. package/scripts/hooks/fixtures/claude-Agent.json +16 -0
  1244. package/scripts/hooks/fixtures/claude-Bash.json +12 -0
  1245. package/scripts/hooks/fixtures/claude-Edit.json +17 -0
  1246. package/scripts/hooks/fixtures/claude-Read.json +12 -0
  1247. package/scripts/hooks/fixtures/claude-Write.json +12 -0
  1248. package/scripts/hooks/fixtures/codex-Bash-cat.json +12 -0
  1249. package/scripts/hooks/fixtures/codex-Bash.json +12 -0
  1250. package/scripts/hooks/fixtures/codex-apply_patch.json +14 -0
  1251. package/scripts/hooks/format-edited-cli.ts +8 -1
  1252. package/scripts/hooks/format-edited-file.ts +33 -27
  1253. package/scripts/hooks/hook-context.ts +22 -0
  1254. package/scripts/hooks/hook-demoted.ts +84 -0
  1255. package/scripts/hooks/hook-lap.ts +61 -0
  1256. package/scripts/hooks/hook-ledger-cli.ts +246 -0
  1257. package/scripts/hooks/hook-ledger-demote.ts +58 -0
  1258. package/scripts/hooks/hook-ledger-issues.ts +61 -0
  1259. package/scripts/hooks/hook-ledger-read.ts +97 -0
  1260. package/scripts/hooks/hook-ledger.ts +163 -0
  1261. package/scripts/hooks/implementation-authority.ts +48 -0
  1262. package/scripts/hooks/implementation-shell-deny.ts +344 -0
  1263. package/scripts/hooks/implementation-shell-nested.ts +148 -0
  1264. package/scripts/hooks/implementation-shell.ts +253 -0
  1265. package/scripts/hooks/lane-plan-guard.ts +1 -1
  1266. package/scripts/hooks/pre-commit-lint.ts +10 -5
  1267. package/scripts/hooks/pre-push-unit.ts +49 -13
  1268. package/scripts/hooks/pretool-guard.ts +184 -70
  1269. package/scripts/hooks/reserved-run.ts +13 -13
  1270. package/scripts/hooks/run-hook.sh +84 -30
  1271. package/scripts/hooks/step-zero-notice.ts +52 -14
  1272. package/scripts/hooks/stop-actions.ts +10 -3
  1273. package/scripts/hooks/stop-guard.ts +29 -8
  1274. package/scripts/init/claude-kit-only-settings.ts +1 -1
  1275. package/scripts/init/hook-command-rewrite.ts +90 -65
  1276. package/scripts/init/hook-launch.ts +27 -22
  1277. package/scripts/init/init-ai-copy.ts +14 -4
  1278. package/scripts/init/init-bootstrap.ts +40 -8
  1279. package/scripts/init/init-copy-content.ts +2 -2
  1280. package/scripts/init/init-install.ts +9 -1
  1281. package/scripts/init/init-logic-deploy-vps.ts +5 -3
  1282. package/scripts/init/init-logic-workspace.ts +16 -1
  1283. package/scripts/init/init-logic.ts +11 -18
  1284. package/scripts/init/npm-publish-files.ts +25 -0
  1285. package/scripts/init/start-setup-pr.ts +1 -1
  1286. package/scripts/init/tsconfig-preset-migration.ts +5 -10
  1287. package/scripts/issue/aggregation-split.ts +4 -2
  1288. package/scripts/issue/already-done-citation.ts +103 -0
  1289. package/scripts/issue/baseline-measure.ts +2 -1
  1290. package/scripts/issue/behavior-change-lint.ts +5 -4
  1291. package/scripts/issue/defect-origin-line.ts +11 -10
  1292. package/scripts/issue/defect-origin.ts +4 -3
  1293. package/scripts/issue/defect-rate.ts +2 -1
  1294. package/scripts/issue/defect-report-format.ts +1 -1
  1295. package/scripts/issue/effect-audit.ts +12 -11
  1296. package/scripts/issue/enforcement-lint.ts +48 -0
  1297. package/scripts/issue/expected-effect-lint.ts +6 -5
  1298. package/scripts/issue/figure-source-lint.ts +59 -0
  1299. package/scripts/issue/git-next-issues.ts +15 -17
  1300. package/scripts/issue/issue-already-done-cli.ts +24 -4
  1301. package/scripts/issue/issue-auto-ok.ts +23 -6
  1302. package/scripts/issue/issue-body-cli.ts +75 -0
  1303. package/scripts/issue/issue-body-keys.ts +223 -0
  1304. package/scripts/issue/issue-body-or-comment.ts +1 -1
  1305. package/scripts/issue/issue-bug-label.ts +5 -2
  1306. package/scripts/issue/issue-cap-files.ts +111 -0
  1307. package/scripts/issue/issue-cite-cli.ts +2 -2
  1308. package/scripts/issue/issue-cite.ts +20 -3
  1309. package/scripts/issue/issue-classification.ts +66 -7
  1310. package/scripts/issue/issue-closing-pr.ts +51 -16
  1311. package/scripts/issue/issue-consolidate-cli.ts +81 -0
  1312. package/scripts/issue/issue-consolidate.ts +246 -0
  1313. package/scripts/issue/issue-declared-size.ts +21 -0
  1314. package/scripts/issue/issue-evidence-exit.ts +6 -3
  1315. package/scripts/issue/issue-file-batch-entries.ts +107 -0
  1316. package/scripts/issue/issue-file-batch.ts +206 -0
  1317. package/scripts/issue/issue-file-cli.ts +147 -208
  1318. package/scripts/issue/issue-file-fold.ts +4 -8
  1319. package/scripts/issue/issue-file-interrupt.ts +68 -9
  1320. package/scripts/issue/issue-file-lane-hint.ts +3 -2
  1321. package/scripts/issue/issue-file-main.ts +17 -0
  1322. package/scripts/issue/issue-file-pass.ts +242 -0
  1323. package/scripts/issue/issue-file.ts +24 -5
  1324. package/scripts/issue/issue-fold-apply.ts +102 -0
  1325. package/scripts/issue/issue-fold-existing-cli.ts +226 -19
  1326. package/scripts/issue/issue-human-stops.ts +102 -0
  1327. package/scripts/issue/issue-labels.ts +14 -3
  1328. package/scripts/issue/issue-lint-cli.ts +20 -6
  1329. package/scripts/issue/issue-lint.ts +4 -6
  1330. package/scripts/issue/issue-merged.ts +75 -9
  1331. package/scripts/issue/issue-not-before.ts +34 -4
  1332. package/scripts/issue/issue-number-shape.ts +8 -0
  1333. package/scripts/issue/issue-plan-cli.ts +33 -5
  1334. package/scripts/issue/issue-plan-notify.ts +100 -0
  1335. package/scripts/issue/issue-premise-unmet-cli.ts +110 -0
  1336. package/scripts/issue/issue-priority-cli.ts +103 -16
  1337. package/scripts/issue/issue-priority-instructed.ts +55 -0
  1338. package/scripts/issue/issue-priority-raise.ts +70 -12
  1339. package/scripts/issue/issue-priority.ts +56 -16
  1340. package/scripts/issue/issue-rank.ts +48 -15
  1341. package/scripts/issue/issue-read-cli.ts +66 -33
  1342. package/scripts/issue/issue-read.ts +20 -5
  1343. package/scripts/issue/issue-release-class-cli.ts +79 -0
  1344. package/scripts/issue/issue-report-failures.ts +14 -5
  1345. package/scripts/issue/issue-run-hold.ts +13 -0
  1346. package/scripts/issue/issue-run-verdict.ts +68 -0
  1347. package/scripts/issue/issue-sample-gate.ts +18 -7
  1348. package/scripts/issue/issue-sample-required.ts +20 -3
  1349. package/scripts/issue/issue-sample-source.ts +2 -1
  1350. package/scripts/issue/issue-scout-cli.ts +34 -18
  1351. package/scripts/issue/issue-scout.ts +25 -4
  1352. package/scripts/issue/issue-search.ts +3 -0
  1353. package/scripts/issue/issue-sources.ts +98 -0
  1354. package/scripts/issue/issue-spill-cli.ts +292 -0
  1355. package/scripts/issue/issue-spill-main.ts +11 -0
  1356. package/scripts/issue/issue-spill.ts +193 -0
  1357. package/scripts/issue/issue-state-cli.ts +9 -17
  1358. package/scripts/issue/issue-template-section.ts +8 -3
  1359. package/scripts/issue/issue-tick-cli.ts +59 -0
  1360. package/scripts/issue/issue-watch-diff.ts +22 -7
  1361. package/scripts/issue/issue-watch-hook.ts +11 -9
  1362. package/scripts/issue/issue-watch.ts +25 -5
  1363. package/scripts/issue/issue-wip.ts +44 -9
  1364. package/scripts/issue/markdown-section.ts +66 -10
  1365. package/scripts/issue/measure-declaration.ts +70 -13
  1366. package/scripts/issue/measure-rerun-cli.ts +9 -8
  1367. package/scripts/issue/measure-twin.ts +37 -0
  1368. package/scripts/issue/reproduction-measure.ts +2 -1
  1369. package/scripts/issue/session-cite.ts +1 -1
  1370. package/scripts/issue/size-estimate.ts +317 -22
  1371. package/scripts/issue/trusted-measure-source.ts +43 -0
  1372. package/scripts/issue/trusted-measure.ts +79 -35
  1373. package/scripts/issue/upstream-interrupt-cli.ts +280 -0
  1374. package/scripts/issue/upstream-interrupt-main.ts +11 -0
  1375. package/scripts/josh/agent-session-environment.ts +19 -1
  1376. package/scripts/josh/cli-body.ts +46 -9
  1377. package/scripts/josh/command-usage.ts +3 -0
  1378. package/scripts/josh/durable-state-migrate.ts +11 -4
  1379. package/scripts/josh/durable-state-root.ts +60 -0
  1380. package/scripts/josh/durable-state.ts +9 -44
  1381. package/scripts/josh/hook-decision.ts +55 -113
  1382. package/scripts/josh/hook-envelope.ts +62 -0
  1383. package/scripts/josh/hook-payload-capture.ts +78 -0
  1384. package/scripts/josh/hook-tool-payload.ts +15 -0
  1385. package/scripts/josh/josh-aliases.ts +7 -0
  1386. package/scripts/josh/josh-command-map.ts +15 -0
  1387. package/scripts/josh/josh-command-types.ts +28 -4
  1388. package/scripts/josh/josh-commands-agent-hooks.ts +39 -7
  1389. package/scripts/josh/josh-commands-ai.ts +420 -9
  1390. package/scripts/josh/josh-commands-backlog.ts +79 -11
  1391. package/scripts/josh/josh-commands-clone.ts +2 -5
  1392. package/scripts/josh/josh-commands-development.ts +25 -8
  1393. package/scripts/josh/josh-commands-document.ts +22 -10
  1394. package/scripts/josh/josh-commands-epic.ts +30 -11
  1395. package/scripts/josh/josh-commands-hooks.ts +0 -1
  1396. package/scripts/josh/josh-commands-issue-write.ts +190 -18
  1397. package/scripts/josh/josh-commands-issue.ts +57 -17
  1398. package/scripts/josh/josh-commands-lint.ts +52 -19
  1399. package/scripts/josh/josh-commands-maintenance.ts +37 -4
  1400. package/scripts/josh/josh-commands-pause.ts +53 -5
  1401. package/scripts/josh/josh-commands-prime.ts +28 -0
  1402. package/scripts/josh/josh-commands-progress.ts +59 -7
  1403. package/scripts/josh/josh-commands-project.ts +8 -5
  1404. package/scripts/josh/josh-commands-review.ts +83 -5
  1405. package/scripts/josh/josh-commands-run.ts +20 -31
  1406. package/scripts/josh/josh-commands-ship.ts +95 -13
  1407. package/scripts/josh/josh-commands-test-check.ts +0 -2
  1408. package/scripts/josh/josh-commands-versioning.ts +11 -2
  1409. package/scripts/josh/josh-commands-workflow.ts +41 -11
  1410. package/scripts/josh/josh-completion-scripts.ts +81 -0
  1411. package/scripts/josh/josh-completion.ts +29 -0
  1412. package/scripts/josh/josh-environment-file.ts +8 -10
  1413. package/scripts/josh/josh-gh-usage.ts +53 -0
  1414. package/scripts/josh/josh-in-process.ts +21 -21
  1415. package/scripts/josh/josh-logic.ts +22 -46
  1416. package/scripts/josh/josh-read-only.ts +51 -0
  1417. package/scripts/josh/josh-run.ts +30 -6
  1418. package/scripts/josh/josh.ts +9 -11
  1419. package/scripts/josh/path-decision.ts +2 -2
  1420. package/scripts/josh/process-identity.ts +5 -0
  1421. package/scripts/josh/session-handoff-line.ts +88 -0
  1422. package/scripts/josh/session-language-cli.ts +18 -4
  1423. package/scripts/josh/session-model-record.ts +62 -0
  1424. package/scripts/lane/historical-evidence.ts +136 -0
  1425. package/scripts/lane/historical-log-evidence.ts +47 -0
  1426. package/scripts/lane/lane-adopt-cli.ts +1 -1
  1427. package/scripts/lane/lane-await.ts +8 -3
  1428. package/scripts/lane/lane-breakdown-calls.ts +165 -0
  1429. package/scripts/lane/lane-breakdown-cli.ts +77 -9
  1430. package/scripts/lane/lane-breakdown-estimate.ts +136 -0
  1431. package/scripts/lane/lane-breakdown-implement.ts +166 -29
  1432. package/scripts/lane/lane-breakdown-laps.ts +116 -24
  1433. package/scripts/lane/lane-breakdown-pause.ts +127 -0
  1434. package/scripts/lane/lane-breakdown-pinned.ts +19 -3
  1435. package/scripts/lane/lane-breakdown-related.ts +40 -0
  1436. package/scripts/lane/lane-breakdown-text.ts +129 -15
  1437. package/scripts/lane/lane-breakdown.ts +194 -30
  1438. package/scripts/lane/lane-broker-server.ts +1 -1
  1439. package/scripts/lane/lane-capacity.ts +27 -16
  1440. package/scripts/lane/lane-chain-stop-stats.ts +110 -0
  1441. package/scripts/lane/lane-check-stats.ts +25 -5
  1442. package/scripts/lane/lane-child-invocation.ts +9 -9
  1443. package/scripts/lane/lane-ci-path-stats.ts +15 -4
  1444. package/scripts/lane/lane-cli.ts +2 -2
  1445. package/scripts/lane/lane-concurrency-stats.ts +110 -0
  1446. package/scripts/lane/lane-cut-stats.ts +101 -0
  1447. package/scripts/lane/lane-dispatch.ts +25 -20
  1448. package/scripts/lane/lane-early-push-stats.ts +25 -0
  1449. package/scripts/lane/lane-environment.ts +2 -2
  1450. package/scripts/lane/lane-gap-stats.ts +69 -8
  1451. package/scripts/lane/lane-guard-policy.ts +1 -1
  1452. package/scripts/lane/lane-hand-back-held.ts +51 -0
  1453. package/scripts/lane/lane-hand-back-hold.ts +103 -0
  1454. package/scripts/lane/lane-held-stats.ts +13 -1
  1455. package/scripts/lane/lane-implement-rate-read.ts +50 -0
  1456. package/scripts/lane/lane-implement-rate.ts +74 -0
  1457. package/scripts/lane/lane-implement-read.ts +129 -0
  1458. package/scripts/lane/lane-implement-signals-record.ts +56 -0
  1459. package/scripts/lane/lane-implement-signals.ts +161 -0
  1460. package/scripts/lane/lane-implement-stats.ts +93 -18
  1461. package/scripts/lane/lane-launch-admission.ts +61 -0
  1462. package/scripts/lane/lane-launch-cli.ts +63 -27
  1463. package/scripts/lane/lane-launch-pending.ts +44 -0
  1464. package/scripts/lane/lane-ledger-archive.ts +200 -0
  1465. package/scripts/lane/lane-ledger-kind.ts +5 -0
  1466. package/scripts/lane/lane-ledger-pinned-origin.ts +10 -0
  1467. package/scripts/lane/lane-ledger-schema-load.ts +45 -0
  1468. package/scripts/lane/lane-ledger-schema-offer.ts +30 -0
  1469. package/scripts/lane/lane-ledger-schema-ship.ts +70 -4
  1470. package/scripts/lane/lane-ledger-schema.ts +53 -30
  1471. package/scripts/lane/lane-ledger-tail.ts +124 -0
  1472. package/scripts/lane/lane-ledger-write.ts +60 -27
  1473. package/scripts/lane/lane-ledger.ts +6 -31
  1474. package/scripts/lane/lane-limit-cli.ts +11 -1
  1475. package/scripts/lane/lane-limit-history.ts +77 -0
  1476. package/scripts/lane/lane-limit-override.ts +49 -8
  1477. package/scripts/lane/lane-listening-ports.ts +77 -0
  1478. package/scripts/lane/lane-load.ts +62 -2
  1479. package/scripts/lane/lane-measure-cli.ts +134 -55
  1480. package/scripts/lane/lane-net-read.ts +22 -10
  1481. package/scripts/lane/lane-net-time.ts +103 -18
  1482. package/scripts/lane/lane-open.ts +19 -113
  1483. package/scripts/lane/lane-over-causes.ts +130 -0
  1484. package/scripts/lane/lane-over.ts +177 -0
  1485. package/scripts/lane/lane-overrun-prompt.ts +4 -3
  1486. package/scripts/lane/lane-overrun.ts +22 -9
  1487. package/scripts/lane/lane-pairs.ts +128 -0
  1488. package/scripts/lane/lane-paths.ts +26 -0
  1489. package/scripts/lane/lane-pause-cli.ts +4 -2
  1490. package/scripts/lane/lane-paused-spans.ts +11 -4
  1491. package/scripts/lane/lane-phase.ts +36 -7
  1492. package/scripts/lane/lane-plan-approval.ts +113 -0
  1493. package/scripts/lane/lane-plan-auto.ts +53 -0
  1494. package/scripts/lane/lane-plan-check.ts +196 -54
  1495. package/scripts/lane/lane-plan-cli.ts +37 -10
  1496. package/scripts/lane/lane-plan-imports.ts +53 -0
  1497. package/scripts/lane/lane-plan-premise.ts +83 -0
  1498. package/scripts/lane/lane-plan-probe.ts +115 -0
  1499. package/scripts/lane/lane-plan-signals.ts +119 -0
  1500. package/scripts/lane/lane-plan-size.ts +389 -0
  1501. package/scripts/lane/lane-plan-wait-event.ts +124 -0
  1502. package/scripts/lane/lane-plan-wait-until.ts +22 -0
  1503. package/scripts/lane/lane-plan-wait.ts +125 -0
  1504. package/scripts/lane/lane-plan.ts +113 -14
  1505. package/scripts/lane/lane-preserve.ts +58 -13
  1506. package/scripts/lane/lane-process-load.ts +130 -19
  1507. package/scripts/lane/lane-process-stats.ts +51 -10
  1508. package/scripts/lane/lane-reap.ts +4 -2
  1509. package/scripts/lane/lane-registry.ts +19 -14
  1510. package/scripts/lane/lane-relaunch.ts +32 -14
  1511. package/scripts/lane/lane-report.ts +2 -0
  1512. package/scripts/lane/lane-resolve-cli.ts +88 -0
  1513. package/scripts/lane/lane-resolve-hunks.ts +63 -0
  1514. package/scripts/lane/lane-resolve-record.ts +59 -0
  1515. package/scripts/lane/lane-resolve.ts +122 -0
  1516. package/scripts/lane/lane-restart.ts +1 -1
  1517. package/scripts/lane/lane-room.ts +58 -0
  1518. package/scripts/lane/lane-round-one-stats.ts +2 -1
  1519. package/scripts/lane/lane-sampler.ts +53 -3
  1520. package/scripts/lane/lane-seat-ownership.ts +57 -0
  1521. package/scripts/lane/lane-seat-start.ts +52 -0
  1522. package/scripts/lane/lane-seat-stop.ts +20 -0
  1523. package/scripts/lane/lane-seat.ts +174 -0
  1524. package/scripts/lane/lane-seed.ts +2 -5
  1525. package/scripts/lane/lane-session-action.ts +26 -10
  1526. package/scripts/lane/lane-session-broker.ts +1 -1
  1527. package/scripts/lane/lane-session-reread.ts +2 -1
  1528. package/scripts/lane/lane-setup.ts +59 -0
  1529. package/scripts/lane/lane-ship-lap-stats.ts +3 -1
  1530. package/scripts/lane/lane-sinks-issues.ts +52 -0
  1531. package/scripts/lane/lane-sinks.ts +165 -0
  1532. package/scripts/lane/lane-size-record.ts +39 -0
  1533. package/scripts/lane/lane-size-stats.ts +111 -0
  1534. package/scripts/lane/lane-split-stats.ts +33 -9
  1535. package/scripts/lane/lane-stage-budget.ts +27 -0
  1536. package/scripts/lane/lane-stage-stats.ts +94 -25
  1537. package/scripts/lane/lane-state-record.ts +74 -0
  1538. package/scripts/lane/lane-state.ts +21 -33
  1539. package/scripts/lane/lane-stats-request.ts +163 -0
  1540. package/scripts/lane/lane-stats-tables.ts +44 -3
  1541. package/scripts/lane/lane-stats.ts +9 -2
  1542. package/scripts/lane/lane-stop-stats.ts +3 -2
  1543. package/scripts/lane/lane-test-related-stats.ts +5 -2
  1544. package/scripts/lane/lane-timeline.ts +251 -0
  1545. package/scripts/lane/lane-transcript-calls.ts +73 -4
  1546. package/scripts/lane/lane-transcript-stats.ts +8 -3
  1547. package/scripts/lane/lane-turn-stats.ts +171 -0
  1548. package/scripts/lane/lane-value-cell.ts +87 -13
  1549. package/scripts/lane/lane-value-missing.ts +21 -0
  1550. package/scripts/lane/lane-why-causes.ts +102 -0
  1551. package/scripts/lane/lane-why-ci.ts +50 -0
  1552. package/scripts/lane/lane-why-cli.ts +83 -0
  1553. package/scripts/lane/lane-why-period.ts +187 -0
  1554. package/scripts/lane/lane-why-ship.ts +67 -0
  1555. package/scripts/lane/lane-why.ts +192 -0
  1556. package/scripts/lane/lane-withdraw.ts +12 -1
  1557. package/scripts/lane/lane-yield-split.ts +218 -0
  1558. package/scripts/lane/lane-yield.ts +38 -4
  1559. package/scripts/lane/openai-lane-ship.ts +2 -2
  1560. package/scripts/lane/openai-lane-supervisor-cli.ts +17 -8
  1561. package/scripts/lane/openai-lane-supervisor-decision.ts +10 -4
  1562. package/scripts/lane/openai-lane-supervisor-entry.ts +6 -0
  1563. package/scripts/lane/openai-lane-supervisor-owner.ts +19 -3
  1564. package/scripts/lane/openai-lane-supervisor.ts +26 -4
  1565. package/scripts/lane/process-directories.ts +3 -1
  1566. package/scripts/lane/process-lane-marks.ts +11 -5
  1567. package/scripts/lane/process-linux.ts +81 -0
  1568. package/scripts/lane/process-tools.ts +2 -5
  1569. package/scripts/lib/bounded-pool.ts +38 -7
  1570. package/scripts/lib/buffered-process.ts +34 -9
  1571. package/scripts/lib/claude-installer.ts +29 -0
  1572. package/scripts/lib/import-closure.ts +72 -0
  1573. package/scripts/lib/josh-temporary-directory.ts +7 -0
  1574. package/scripts/lib/main-guard.ts +29 -0
  1575. package/scripts/lib/package-manifest.ts +54 -3
  1576. package/scripts/lib/pnpm-installer.ts +16 -0
  1577. package/scripts/lib/poll.ts +130 -20
  1578. package/scripts/lib/schemas.ts +1 -1
  1579. package/scripts/lib/stamped-memo.ts +1 -1
  1580. package/scripts/lib/stamped-store.ts +82 -0
  1581. package/scripts/lib/stdin-text.ts +68 -0
  1582. package/scripts/lib/timeouts.ts +4 -4
  1583. package/scripts/lib/transcript-record.ts +4 -0
  1584. package/scripts/lib/verified-download.ts +17 -0
  1585. package/scripts/lines/bytes-command.ts +1 -1
  1586. package/scripts/lint/cspell-cached.ts +1 -1
  1587. package/scripts/lint/eslint-cache-dependencies.ts +38 -8
  1588. package/scripts/lint/eslint-daemon-calls.ts +83 -0
  1589. package/scripts/lint/eslint-daemon.ts +101 -13
  1590. package/scripts/lint/eslint-heap.ts +50 -0
  1591. package/scripts/lint/eslint-memory.js +45 -0
  1592. package/scripts/lint/eslint-trim.ts +44 -0
  1593. package/scripts/lint/eslint-warm.ts +5 -2
  1594. package/scripts/lint/format.ts +30 -5
  1595. package/scripts/lint/import-graph-store.ts +245 -0
  1596. package/scripts/lint/import-graph.ts +54 -65
  1597. package/scripts/lint/import-move.ts +275 -0
  1598. package/scripts/lint/import-test-inputs.ts +97 -0
  1599. package/scripts/lint/lint-gate-scope.ts +1 -0
  1600. package/scripts/lint/lint-parallel.ts +148 -43
  1601. package/scripts/lint/lint-related-scope.ts +6 -1
  1602. package/scripts/lint/lint-related.ts +66 -25
  1603. package/scripts/lint/lint-rule.ts +293 -0
  1604. package/scripts/lint/lint-shard.ts +91 -0
  1605. package/scripts/lint/lint-timing.ts +39 -0
  1606. package/scripts/lint/rename-cli.ts +36 -10
  1607. package/scripts/lint/rename-identifier.ts +2 -2
  1608. package/scripts/lint/type-only-imports.ts +20 -1
  1609. package/scripts/notify/git-notify.ts +3 -1
  1610. package/scripts/notify/telegram-notify.ts +33 -35
  1611. package/scripts/notify/telegram-test.ts +9 -4
  1612. package/scripts/observations/observation-depth-cli.ts +78 -0
  1613. package/scripts/observations/observation-depth.ts +85 -0
  1614. package/scripts/observations/observation-ledger-home.ts +14 -7
  1615. package/scripts/observations/observations-flush-landing.ts +1 -1
  1616. package/scripts/overrides/overrides-check.ts +33 -10
  1617. package/scripts/overrides/overrides-diff-report.ts +91 -0
  1618. package/scripts/overrides/overrides-diff.ts +98 -0
  1619. package/scripts/package/package-scout-cli.ts +37 -11
  1620. package/scripts/package/package-scout-format.ts +20 -6
  1621. package/scripts/package/package-scout-reuse.ts +207 -0
  1622. package/scripts/plan/plan-scaffold-cli.ts +125 -0
  1623. package/scripts/plan/plan-scaffold.ts +112 -0
  1624. package/scripts/ports/port-command.ts +2 -5
  1625. package/scripts/propagate/propagate-git.ts +3 -3
  1626. package/scripts/propagate/propagate-publish.ts +8 -7
  1627. package/scripts/propagate/propagate-steps.ts +2 -3
  1628. package/scripts/refactor/import-graph.ts +2 -4
  1629. package/scripts/refactor/refactor-lint.ts +47 -30
  1630. package/scripts/refactor/refactor-scan.ts +16 -9
  1631. package/scripts/refactor/refactor-targets.ts +2 -3
  1632. package/scripts/release/github-release.ts +10 -10
  1633. package/scripts/release/publish-tag-cli.ts +13 -3
  1634. package/scripts/release/release-cli.ts +2 -0
  1635. package/scripts/release/release-progress.ts +44 -36
  1636. package/scripts/release/release-request.ts +42 -0
  1637. package/scripts/release/release-scope-cli.ts +31 -2
  1638. package/scripts/release/release-workflow-check.ts +59 -0
  1639. package/scripts/report/markdown-shape.ts +2 -1
  1640. package/scripts/report/report-template-cli.ts +2 -2
  1641. package/scripts/report/report-template.ts +17 -4
  1642. package/scripts/review/acceptance-map.ts +87 -8
  1643. package/scripts/review/diff-summary-cli.ts +81 -0
  1644. package/scripts/review/diff-summary.ts +109 -0
  1645. package/scripts/review/disposition-batch-filing.ts +150 -0
  1646. package/scripts/review/disposition-batch.ts +103 -0
  1647. package/scripts/review/disposition-cli.ts +35 -1
  1648. package/scripts/review/import-specifiers.ts +38 -0
  1649. package/scripts/review/prose-stale-cli.ts +7 -37
  1650. package/scripts/review/prose-stale-read.ts +105 -0
  1651. package/scripts/review/prose-stale-scan.ts +121 -17
  1652. package/scripts/review/removed-tests-check.ts +28 -4
  1653. package/scripts/review/review-brief-cli.ts +69 -71
  1654. package/scripts/review/review-brief.ts +38 -42
  1655. package/scripts/review/review-code-tree.ts +80 -16
  1656. package/scripts/review/review-comment-carry.ts +30 -0
  1657. package/scripts/review/review-diff-pack.ts +70 -0
  1658. package/scripts/review/review-diff-write.ts +23 -22
  1659. package/scripts/review/review-final-record.ts +47 -0
  1660. package/scripts/review/review-finding-ledger.ts +72 -10
  1661. package/scripts/review/review-findings-cli.ts +88 -8
  1662. package/scripts/review/review-fix-hunks.ts +115 -0
  1663. package/scripts/review/review-fix-round.ts +144 -0
  1664. package/scripts/review/review-gate-mode.ts +25 -0
  1665. package/scripts/review/review-interaction.ts +69 -11
  1666. package/scripts/review/review-lane-handover.ts +29 -4
  1667. package/scripts/review/review-level.ts +35 -34
  1668. package/scripts/review/review-lint-findings.ts +3 -3
  1669. package/scripts/review/review-lint-sections.ts +2 -2
  1670. package/scripts/review/review-lint.ts +7 -1
  1671. package/scripts/review/review-pair-cli.ts +157 -0
  1672. package/scripts/review/review-pair-log.ts +75 -0
  1673. package/scripts/review/review-pair-session.ts +98 -0
  1674. package/scripts/review/review-pair.ts +112 -0
  1675. package/scripts/review/review-prior-findings.ts +2 -4
  1676. package/scripts/review/review-prompt-level.ts +28 -0
  1677. package/scripts/review/review-readers-scan.ts +25 -3
  1678. package/scripts/review/review-record-cli.ts +46 -68
  1679. package/scripts/review/review-record-interaction.ts +2 -2
  1680. package/scripts/review/review-record-main.ts +7 -2
  1681. package/scripts/review/review-record-pinned.ts +5 -0
  1682. package/scripts/review/review-record-slot.ts +155 -0
  1683. package/scripts/review/review-reviewed-tree.ts +60 -13
  1684. package/scripts/review/review-round-one-blobs.ts +43 -9
  1685. package/scripts/review/review-round-one-skip.ts +72 -0
  1686. package/scripts/review/review-round-reuse.ts +13 -6
  1687. package/scripts/review/review-round.ts +57 -0
  1688. package/scripts/review/review-round2-cli.ts +5 -0
  1689. package/scripts/review/review-round2-skip-comment.ts +3 -1
  1690. package/scripts/review/review-round2.ts +18 -6
  1691. package/scripts/review/review-size.ts +92 -0
  1692. package/scripts/review/review-stamps.ts +8 -0
  1693. package/scripts/review/review-submit-args.ts +91 -0
  1694. package/scripts/review/review-submit-cli.ts +55 -29
  1695. package/scripts/review/selfcheck-cli.ts +193 -0
  1696. package/scripts/review/selfcheck-commands.ts +175 -0
  1697. package/scripts/review/selfcheck-report.ts +98 -0
  1698. package/scripts/rules/bash-triggers.ts +24 -13
  1699. package/scripts/rules/broad-investigation-shell.ts +183 -0
  1700. package/scripts/rules/broad-investigation.ts +116 -0
  1701. package/scripts/rules/consultation-handoff.ts +81 -0
  1702. package/scripts/rules/consultation-investigation.ts +99 -0
  1703. package/scripts/rules/decision-oracle.ts +1 -1
  1704. package/scripts/rules/delivered-rules-guard.ts +94 -0
  1705. package/scripts/rules/delivered-rules.ts +46 -87
  1706. package/scripts/rules/destructive-command.ts +2 -1
  1707. package/scripts/rules/direct-git-status.ts +81 -0
  1708. package/scripts/rules/direct-issue-comment.ts +9 -1
  1709. package/scripts/rules/direct-vitest-run.ts +98 -0
  1710. package/scripts/rules/egress-guard.ts +308 -0
  1711. package/scripts/rules/firing-point.ts +9 -12
  1712. package/scripts/rules/gh-api.ts +19 -4
  1713. package/scripts/rules/gh-repo-selector.ts +1 -1
  1714. package/scripts/rules/git-argv.ts +57 -10
  1715. package/scripts/rules/guard-remedy.ts +9 -0
  1716. package/scripts/rules/guard-rule-rows.ts +13 -0
  1717. package/scripts/rules/implementation-cut-verdict.ts +1 -1
  1718. package/scripts/rules/implementation-cut.ts +94 -31
  1719. package/scripts/rules/interpreter-options.ts +179 -0
  1720. package/scripts/rules/investigator-foreground.ts +13 -7
  1721. package/scripts/rules/josh-git-bare.ts +1 -1
  1722. package/scripts/rules/keychain-read.ts +73 -0
  1723. package/scripts/rules/lane-background.ts +15 -14
  1724. package/scripts/rules/lane-carry-conflict.ts +15 -8
  1725. package/scripts/rules/lane-direct-tool.ts +18 -11
  1726. package/scripts/rules/lane-interactive-ask.ts +3 -5
  1727. package/scripts/rules/lane-park.ts +25 -10
  1728. package/scripts/rules/lane-spilled-read.ts +3 -5
  1729. package/scripts/rules/lane-split-park.ts +7 -6
  1730. package/scripts/rules/lane-switch-main.ts +10 -3
  1731. package/scripts/rules/launched-call.ts +135 -0
  1732. package/scripts/rules/main-model.ts +54 -0
  1733. package/scripts/rules/nested-commands.ts +71 -0
  1734. package/scripts/rules/permission-guards.ts +6 -2
  1735. package/scripts/rules/pr-merge.ts +1 -1
  1736. package/scripts/rules/pre-gate-cut.ts +20 -11
  1737. package/scripts/rules/protected-files.ts +34 -98
  1738. package/scripts/rules/repeat-check-related.ts +66 -0
  1739. package/scripts/rules/reviewer-foreground.ts +11 -7
  1740. package/scripts/rules/round-one-check-related.ts +59 -19
  1741. package/scripts/rules/rule-list.ts +3 -4
  1742. package/scripts/rules/rule-rephrase.ts +43 -0
  1743. package/scripts/rules/rule-rewrite.ts +16 -6
  1744. package/scripts/rules/rule-value-cache.ts +10 -1
  1745. package/scripts/rules/rule-value-cli.ts +62 -54
  1746. package/scripts/rules/rule-value-prose.ts +186 -0
  1747. package/scripts/rules/rule-value-runs.ts +171 -0
  1748. package/scripts/rules/rule-value.ts +38 -13
  1749. package/scripts/rules/run-tail-rule.ts +19 -2
  1750. package/scripts/rules/secret-paths.ts +92 -0
  1751. package/scripts/rules/sed-in-place.ts +1 -1
  1752. package/scripts/rules/shell-permissions.ts +91 -0
  1753. package/scripts/rules/shell-redirects.ts +54 -0
  1754. package/scripts/rules/shell-segments.ts +3 -2
  1755. package/scripts/rules/stop-decision.ts +7 -1
  1756. package/scripts/rules/stop-rules.ts +1 -1
  1757. package/scripts/rules/unasked-filing.ts +158 -0
  1758. package/scripts/run/add/run-add-cli.ts +114 -36
  1759. package/scripts/run/add/run-add-epic.ts +45 -0
  1760. package/scripts/run/add/run-add-issue.ts +17 -0
  1761. package/scripts/run/add/run-add.ts +159 -21
  1762. package/scripts/run/attached-log.ts +38 -0
  1763. package/scripts/run/board/run-board-cli.ts +34 -9
  1764. package/scripts/run/board/run-board-closed-graphql.ts +129 -0
  1765. package/scripts/run/board/run-board-closed.ts +68 -10
  1766. package/scripts/run/board/run-board-decision-graphql.ts +136 -0
  1767. package/scripts/run/board/run-board-decision-read.ts +195 -0
  1768. package/scripts/run/board/run-board-decision.ts +92 -0
  1769. package/scripts/run/board/run-board-earlier.ts +27 -3
  1770. package/scripts/run/board/run-board-ending-reason.ts +98 -9
  1771. package/scripts/run/board/run-board-ending-states.ts +34 -0
  1772. package/scripts/run/board/run-board-every.ts +19 -9
  1773. package/scripts/run/board/run-board-first-lane.ts +26 -0
  1774. package/scripts/run/board/run-board-fit.ts +47 -11
  1775. package/scripts/run/board/run-board-fold-store.ts +62 -0
  1776. package/scripts/run/board/run-board-fold.ts +41 -9
  1777. package/scripts/run/board/run-board-gather-live.ts +2 -0
  1778. package/scripts/run/board/run-board-gather-thread.ts +14 -3
  1779. package/scripts/run/board/run-board-gather-worker.ts +10 -8
  1780. package/scripts/run/board/run-board-gather.ts +10 -3
  1781. package/scripts/run/board/run-board-github.ts +117 -29
  1782. package/scripts/run/board/run-board-header.ts +33 -24
  1783. package/scripts/run/board/run-board-held.ts +53 -0
  1784. package/scripts/run/board/run-board-human-merge.ts +113 -0
  1785. package/scripts/run/board/run-board-human.ts +37 -0
  1786. package/scripts/run/board/run-board-idle.ts +9 -6
  1787. package/scripts/run/board/run-board-issue-count.ts +101 -0
  1788. package/scripts/run/board/run-board-keys.ts +19 -4
  1789. package/scripts/run/board/run-board-labels.ts +20 -4
  1790. package/scripts/run/board/run-board-lane-event.ts +23 -2
  1791. package/scripts/run/board/run-board-lane-result.ts +58 -0
  1792. package/scripts/run/board/run-board-lane-state.ts +52 -7
  1793. package/scripts/run/board/run-board-lane-stop.ts +108 -0
  1794. package/scripts/run/board/run-board-lane-time.ts +1 -0
  1795. package/scripts/run/board/run-board-layout.ts +64 -74
  1796. package/scripts/run/board/run-board-link.ts +42 -2
  1797. package/scripts/run/board/run-board-notes.ts +1 -1
  1798. package/scripts/run/board/run-board-now.ts +1 -1
  1799. package/scripts/run/board/run-board-operation-codex.ts +37 -0
  1800. package/scripts/run/board/run-board-operation-read.ts +2 -2
  1801. package/scripts/run/board/run-board-operation.ts +8 -5
  1802. package/scripts/run/board/run-board-plan-shared.ts +3 -0
  1803. package/scripts/run/board/run-board-plan.ts +6 -1
  1804. package/scripts/run/board/run-board-process-groups.ts +1 -1
  1805. package/scripts/run/board/run-board-quota-held.ts +319 -0
  1806. package/scripts/run/board/run-board-quota-lane.ts +23 -0
  1807. package/scripts/run/board/run-board-quota-read.ts +422 -0
  1808. package/scripts/run/board/run-board-quota-spent.ts +162 -0
  1809. package/scripts/run/board/run-board-quota-status.ts +67 -0
  1810. package/scripts/run/board/run-board-read.ts +112 -36
  1811. package/scripts/run/board/run-board-reason.ts +40 -20
  1812. package/scripts/run/board/run-board-render-condition.ts +18 -2
  1813. package/scripts/run/board/run-board-render-drawn.ts +5 -1
  1814. package/scripts/run/board/run-board-render-foot.ts +5 -1
  1815. package/scripts/run/board/run-board-render-found.ts +21 -2
  1816. package/scripts/run/board/run-board-render-icon.ts +3 -6
  1817. package/scripts/run/board/run-board-render-lanes.ts +49 -9
  1818. package/scripts/run/board/run-board-render-lead.ts +20 -1
  1819. package/scripts/run/board/run-board-render-legend.ts +4 -0
  1820. package/scripts/run/board/run-board-render-none.ts +35 -0
  1821. package/scripts/run/board/run-board-render-notes.ts +5 -3
  1822. package/scripts/run/board/run-board-render-processes.ts +6 -5
  1823. package/scripts/run/board/run-board-render-quota-cell.ts +81 -0
  1824. package/scripts/run/board/run-board-render-quota-github.ts +112 -0
  1825. package/scripts/run/board/run-board-render-quota.ts +285 -0
  1826. package/scripts/run/board/run-board-render-section.ts +50 -6
  1827. package/scripts/run/board/run-board-render-tail.ts +53 -7
  1828. package/scripts/run/board/run-board-render-throughput.ts +140 -0
  1829. package/scripts/run/board/run-board-render-title.ts +26 -4
  1830. package/scripts/run/board/run-board-render.ts +59 -57
  1831. package/scripts/run/board/run-board-row-yield.ts +1 -0
  1832. package/scripts/run/board/run-board-scope.ts +13 -6
  1833. package/scripts/run/board/run-board-seat.ts +107 -0
  1834. package/scripts/run/board/run-board-settle.ts +33 -0
  1835. package/scripts/run/board/run-board-setup.ts +30 -15
  1836. package/scripts/run/board/run-board-single.ts +123 -0
  1837. package/scripts/run/board/run-board-snapshot.ts +7 -1
  1838. package/scripts/run/board/run-board-span.ts +18 -3
  1839. package/scripts/run/board/run-board-spin.ts +12 -6
  1840. package/scripts/run/board/run-board-standing-waits.ts +52 -0
  1841. package/scripts/run/board/run-board-state.ts +23 -0
  1842. package/scripts/run/board/run-board-status.ts +86 -99
  1843. package/scripts/run/board/run-board-throughput.ts +215 -0
  1844. package/scripts/run/board/run-board-tick.ts +76 -30
  1845. package/scripts/run/board/run-board-usage-read.ts +3 -3
  1846. package/scripts/run/board/run-board-usage-top.ts +12 -35
  1847. package/scripts/run/board/run-board-usual.ts +18 -1
  1848. package/scripts/run/carry/run-carry-added.ts +6 -1
  1849. package/scripts/run/carry/run-carry-args.ts +22 -8
  1850. package/scripts/run/carry/run-carry-cli.ts +31 -1
  1851. package/scripts/run/carry/run-carry-conversation.ts +12 -4
  1852. package/scripts/run/carry/run-carry-ended.ts +3 -0
  1853. package/scripts/run/carry/run-carry-reclaim.ts +2 -1
  1854. package/scripts/run/carry/run-carry.ts +40 -20
  1855. package/scripts/run/cut/run-cut-adoption.ts +67 -0
  1856. package/scripts/run/cut/run-cut-cli.ts +88 -34
  1857. package/scripts/run/cut/run-cut-decline.ts +1 -1
  1858. package/scripts/run/cut/run-cut-handoff.ts +2 -1
  1859. package/scripts/run/cut/run-cut-next.ts +20 -0
  1860. package/scripts/run/cut/run-cut-ready.ts +7 -5
  1861. package/scripts/run/cut/run-cut-report.ts +13 -14
  1862. package/scripts/run/cut/run-cut-resume.ts +1 -1
  1863. package/scripts/run/cut/run-cut.ts +36 -23
  1864. package/scripts/run/detached-launch.ts +12 -7
  1865. package/scripts/run/early-push-record.ts +22 -0
  1866. package/scripts/run/entry/run-entry-children.ts +126 -0
  1867. package/scripts/run/entry/run-entry-cli.ts +126 -82
  1868. package/scripts/run/entry/run-entry-dispatch.ts +20 -0
  1869. package/scripts/run/entry/run-entry-lane-plan.ts +39 -0
  1870. package/scripts/run/entry/run-entry-spill.ts +67 -22
  1871. package/scripts/run/entry/run-entry-stop.ts +9 -8
  1872. package/scripts/run/entry/run-entry-sync.ts +149 -0
  1873. package/scripts/run/entry/run-entry-trust.ts +1 -1
  1874. package/scripts/run/entry/run-entry.ts +9 -0
  1875. package/scripts/run/event/run-event-checks.ts +1 -1
  1876. package/scripts/run/event/run-event-filed.ts +1 -1
  1877. package/scripts/run/event/run-event-follow.ts +9 -5
  1878. package/scripts/run/event/run-event-overrun.ts +7 -7
  1879. package/scripts/run/event/run-event-plan.ts +1 -1
  1880. package/scripts/run/event/run-event-render.ts +5 -0
  1881. package/scripts/run/event/run-event-retry.ts +34 -0
  1882. package/scripts/run/event/run-event-scope.ts +4 -1
  1883. package/scripts/run/event/run-event-setup.ts +55 -5
  1884. package/scripts/run/event/run-event-step.ts +81 -0
  1885. package/scripts/run/event/run-event-stream-emit.ts +63 -23
  1886. package/scripts/run/event/run-event-stream.ts +69 -21
  1887. package/scripts/run/event/run-event-tail.ts +122 -0
  1888. package/scripts/run/event/run-event-watch.ts +12 -7
  1889. package/scripts/run/handoff/run-handoff-args.ts +93 -0
  1890. package/scripts/run/handoff/run-handoff-cli.ts +320 -0
  1891. package/scripts/run/handoff/run-handoff-final.ts +38 -0
  1892. package/scripts/run/handoff/run-handoff-launch.ts +113 -0
  1893. package/scripts/run/handoff/run-handoff-retrospective.ts +48 -0
  1894. package/scripts/run/handoff-lanes/run-handoff-lanes-cli.ts +31 -0
  1895. package/scripts/run/handoff-lanes/run-handoff-lanes.ts +183 -0
  1896. package/scripts/run/hold/run-hold-block.ts +35 -0
  1897. package/scripts/run/hold/run-hold-cli.ts +20 -36
  1898. package/scripts/run/hold/run-hold-main.ts +16 -1
  1899. package/scripts/run/hold/run-hold.ts +12 -8
  1900. package/scripts/run/hold/run-stop-notify.ts +1 -1
  1901. package/scripts/run/launch-priority.ts +4 -7
  1902. package/scripts/run/merge/run-merge-auth.ts +38 -13
  1903. package/scripts/run/merge/run-merge-cap.ts +11 -6
  1904. package/scripts/run/merge/run-merge-cli.ts +55 -58
  1905. package/scripts/run/merge/run-merge-dated.ts +64 -0
  1906. package/scripts/run/merge/run-merge-decision.ts +183 -0
  1907. package/scripts/run/merge/run-merge-driver.ts +2 -0
  1908. package/scripts/run/merge/run-merge-github-limit.ts +98 -0
  1909. package/scripts/run/merge/run-merge-health.ts +137 -0
  1910. package/scripts/run/merge/run-merge-human-review.ts +26 -0
  1911. package/scripts/run/merge/run-merge-restart.ts +10 -3
  1912. package/scripts/run/merge/run-merge-signals.ts +34 -9
  1913. package/scripts/run/merge/run-merge-steps.ts +49 -50
  1914. package/scripts/run/merge/run-merge-token.ts +3 -4
  1915. package/scripts/run/merge/run-merge-usage-limit.ts +22 -9
  1916. package/scripts/run/merge/run-merge-withdrawn.ts +4 -3
  1917. package/scripts/run/merge/run-merge.ts +36 -18
  1918. package/scripts/run/park/run-park-answered.ts +84 -0
  1919. package/scripts/run/park/run-park-body.ts +346 -0
  1920. package/scripts/run/park/run-park-cli.ts +37 -12
  1921. package/scripts/run/park/run-park-lane.ts +41 -0
  1922. package/scripts/run/park/run-park-release.ts +61 -0
  1923. package/scripts/run/park/run-park-write.ts +41 -0
  1924. package/scripts/run/park/run-park.ts +2 -4
  1925. package/scripts/run/park/run-stalled-park.ts +32 -0
  1926. package/scripts/run/park/run-stalled.ts +75 -12
  1927. package/scripts/run/pause/run-pause-cli.ts +4 -3
  1928. package/scripts/run/pause/run-pause-comment.ts +30 -0
  1929. package/scripts/run/pause/run-pause.ts +35 -223
  1930. package/scripts/run/pause/run-set-aside-commit.ts +52 -0
  1931. package/scripts/run/pause/run-set-aside.ts +139 -0
  1932. package/scripts/run/prime/run-prime-cli.ts +105 -0
  1933. package/scripts/run/progress/run-progress-cli.ts +44 -27
  1934. package/scripts/run/progress/run-progress-config.ts +7 -18
  1935. package/scripts/run/progress/run-progress.ts +16 -7
  1936. package/scripts/run/review/run-chain-cli.ts +162 -0
  1937. package/scripts/run/review/run-chain-join.ts +108 -0
  1938. package/scripts/run/review/run-chain-review-fix.ts +70 -0
  1939. package/scripts/run/review/run-chain.ts +167 -0
  1940. package/scripts/run/review/run-review-cli.ts +127 -53
  1941. package/scripts/run/review/run-review-early-push.ts +41 -7
  1942. package/scripts/run/review/run-review-join-ready.ts +88 -0
  1943. package/scripts/run/review/run-review-pinned-accepted.ts +15 -1
  1944. package/scripts/run/review/run-review-pinned-join.ts +8 -4
  1945. package/scripts/run/review/run-review-pinned-steps.ts +12 -7
  1946. package/scripts/run/review/run-review-pinned.ts +8 -3
  1947. package/scripts/run/review/run-review-steps.ts +29 -14
  1948. package/scripts/run/review/run-review-unplanned.ts +75 -0
  1949. package/scripts/run/review/run-review.ts +4 -4
  1950. package/scripts/run/run-halfrun-resume.ts +9 -1
  1951. package/scripts/run/run-headless-keys.ts +23 -0
  1952. package/scripts/run/run-headless.ts +77 -13
  1953. package/scripts/run/run-investigation-record.ts +66 -0
  1954. package/scripts/run/run-label-main.ts +55 -0
  1955. package/scripts/run/run-label.ts +20 -4
  1956. package/scripts/run/run-liveness-cli.ts +1 -1
  1957. package/scripts/run/run-liveness.ts +6 -5
  1958. package/scripts/run/run-maintenance.ts +66 -0
  1959. package/scripts/run/run-open-pr.ts +19 -0
  1960. package/scripts/run/run-parent-cut-hook.ts +17 -9
  1961. package/scripts/run/run-pickup-cli.ts +86 -0
  1962. package/scripts/run/run-pickup-launch.ts +85 -0
  1963. package/scripts/run/run-poll-hook.ts +14 -7
  1964. package/scripts/run/run-pr-return.ts +99 -0
  1965. package/scripts/run/run-prep-cli.ts +54 -7
  1966. package/scripts/run/run-prep-locate.ts +8 -3
  1967. package/scripts/run/run-prep-summary.ts +55 -0
  1968. package/scripts/run/run-prep.ts +37 -1
  1969. package/scripts/run/run-report-cli.ts +13 -2
  1970. package/scripts/run/run-report-end.ts +133 -0
  1971. package/scripts/run/run-report-handoff.ts +1 -1
  1972. package/scripts/run/run-report.ts +7 -1
  1973. package/scripts/run/run-stage-read.ts +38 -4
  1974. package/scripts/run/run-stage.ts +18 -6
  1975. package/scripts/run/run-status.ts +2 -1
  1976. package/scripts/run/run-step-cli.ts +38 -10
  1977. package/scripts/run/run-step-lane-plan.ts +26 -12
  1978. package/scripts/run/run-step-progress.ts +61 -0
  1979. package/scripts/run/run-step-section-driver.ts +27 -0
  1980. package/scripts/run/run-step-section-once.ts +83 -0
  1981. package/scripts/run/run-step-section-table.ts +120 -0
  1982. package/scripts/run/run-step-section.ts +39 -53
  1983. package/scripts/run/run-step.ts +4 -3
  1984. package/scripts/run/run-stop-notify.ts +1 -1
  1985. package/scripts/run/run-tail-cli.ts +14 -6
  1986. package/scripts/run/run-tail.ts +22 -0
  1987. package/scripts/run/run-watcher-guard.ts +15 -5
  1988. package/scripts/run/run-watcher-hook.ts +12 -6
  1989. package/scripts/run/ship/run-ship-args.ts +8 -1
  1990. package/scripts/run/ship/run-ship-cli.ts +68 -65
  1991. package/scripts/run/ship/run-ship-conflict-probe.ts +12 -14
  1992. package/scripts/run/ship/run-ship-detach-wait.ts +25 -0
  1993. package/scripts/run/ship/run-ship-detach.ts +29 -35
  1994. package/scripts/run/ship/run-ship-early-push.ts +34 -0
  1995. package/scripts/run/ship/run-ship-evidence-cli.ts +133 -0
  1996. package/scripts/run/ship/run-ship-evidence.ts +71 -0
  1997. package/scripts/run/ship/run-ship-final-review.ts +28 -0
  1998. package/scripts/run/ship/run-ship-gate-runs.ts +58 -0
  1999. package/scripts/run/ship/run-ship-group.ts +38 -0
  2000. package/scripts/run/ship/run-ship-handover.ts +1 -1
  2001. package/scripts/run/ship/run-ship-lap.ts +100 -12
  2002. package/scripts/run/ship/run-ship-narrowed.ts +104 -0
  2003. package/scripts/run/ship/run-ship-next.ts +3 -3
  2004. package/scripts/run/ship/run-ship-pair-runs.ts +127 -0
  2005. package/scripts/run/ship/run-ship-place.ts +9 -8
  2006. package/scripts/run/ship/run-ship-planned.ts +1 -1
  2007. package/scripts/run/ship/run-ship-pre-detach-pinned.ts +7 -1
  2008. package/scripts/run/ship/run-ship-pre-detach.ts +18 -12
  2009. package/scripts/run/ship/run-ship-preflight-reuse.ts +53 -0
  2010. package/scripts/run/ship/run-ship-preflight.ts +21 -2
  2011. package/scripts/run/ship/run-ship-probe.ts +5 -15
  2012. package/scripts/run/ship/run-ship-record-wait.ts +30 -0
  2013. package/scripts/run/ship/run-ship-relaunch-cap.ts +107 -14
  2014. package/scripts/run/ship/run-ship-relaunch.ts +7 -1
  2015. package/scripts/run/ship/run-ship-removed-rows.ts +34 -10
  2016. package/scripts/run/ship/run-ship-reship.ts +125 -0
  2017. package/scripts/run/ship/run-ship-return.ts +68 -22
  2018. package/scripts/run/ship/run-ship-review-checkpoint.ts +112 -0
  2019. package/scripts/run/ship/run-ship-review-reason.ts +3 -1
  2020. package/scripts/run/ship/run-ship-review-steps.ts +80 -31
  2021. package/scripts/run/ship/run-ship-review.ts +13 -9
  2022. package/scripts/run/ship/run-ship-reviewer.ts +59 -7
  2023. package/scripts/run/ship/run-ship-scoped.ts +232 -21
  2024. package/scripts/run/ship/run-ship-stage.ts +3 -5
  2025. package/scripts/run/ship/run-ship-steps.ts +65 -20
  2026. package/scripts/run/ship/run-ship-stop-cause.ts +52 -1
  2027. package/scripts/run/ship/run-ship-stop-context.ts +5 -5
  2028. package/scripts/run/ship/run-ship-stop-text.ts +1 -1
  2029. package/scripts/run/ship/run-ship-supervised.ts +38 -0
  2030. package/scripts/run/ship/run-ship-sync.ts +114 -19
  2031. package/scripts/run/ship/run-ship-synced-scope.ts +162 -58
  2032. package/scripts/run/ship/run-ship-tree-stamp.ts +35 -0
  2033. package/scripts/run/ship/run-ship-wait-cli.ts +23 -25
  2034. package/scripts/run/ship/run-ship-wait-main.ts +12 -0
  2035. package/scripts/run/ship/run-ship-waiter.ts +8 -6
  2036. package/scripts/run/ship/run-ship.ts +12 -0
  2037. package/scripts/run/split/run-split-cli.ts +134 -0
  2038. package/scripts/run/split/run-split-prerequisite.ts +75 -0
  2039. package/scripts/run/split/run-split.ts +213 -0
  2040. package/scripts/run/stale/run-stale-cli.ts +86 -0
  2041. package/scripts/run/stale/run-stale-main.ts +7 -0
  2042. package/scripts/run/stale/run-stale.ts +117 -0
  2043. package/scripts/run/tidy/run-tidy-cli.ts +24 -2
  2044. package/scripts/run/tree-status-cli.ts +131 -0
  2045. package/scripts/run/tree-status.ts +77 -0
  2046. package/scripts/run/ts-entry-loader.ts +34 -0
  2047. package/scripts/run/wake/run-wake-await.ts +22 -2
  2048. package/scripts/run/wake/run-wake-cli.ts +3 -3
  2049. package/scripts/run/wake/run-wake-describe.ts +1 -1
  2050. package/scripts/run/wake/run-wake-driver.ts +158 -61
  2051. package/scripts/run/wake/run-wake-handoff.ts +65 -14
  2052. package/scripts/run/wake/run-wake-loop.ts +63 -23
  2053. package/scripts/run/wake/run-wake-ports.ts +99 -17
  2054. package/scripts/run/wake/run-wake-resume.ts +98 -0
  2055. package/scripts/run/wake/run-wake-session.ts +16 -14
  2056. package/scripts/run/wake/run-wake-window.ts +15 -0
  2057. package/scripts/run/wake/run-wake.ts +7 -6
  2058. package/scripts/safe-chain/preinstall-command.ts +3 -6
  2059. package/scripts/safe-chain/project-config.ts +2 -2
  2060. package/scripts/security/security-audit-cache.ts +157 -0
  2061. package/scripts/security/security-audit-main.ts +4 -2
  2062. package/scripts/security/security-audit-provision-logic.ts +4 -4
  2063. package/scripts/security/security-audit-provision-main.ts +19 -5
  2064. package/scripts/split/declared-growth.ts +22 -0
  2065. package/scripts/split/split-assess.ts +220 -37
  2066. package/scripts/split/split-child-recover-cli.ts +118 -0
  2067. package/scripts/split/split-direction.ts +172 -0
  2068. package/scripts/split/split-measure.ts +28 -14
  2069. package/scripts/split/split-relocations.ts +108 -0
  2070. package/scripts/split/split-resolution.ts +63 -61
  2071. package/scripts/sync/claude-settings-merge.ts +8 -4
  2072. package/scripts/sync/managed-config-scope.ts +13 -1
  2073. package/scripts/sync/sync-ai-files.ts +2 -2
  2074. package/scripts/sync/sync-configs.ts +3 -5
  2075. package/scripts/test/test-e2e-guard.ts +2 -1
  2076. package/scripts/test/test-inputs.ts +119 -0
  2077. package/scripts/test/test-no-base.ts +35 -16
  2078. package/scripts/test/test-pinned-cache-logic.ts +4 -0
  2079. package/scripts/test/test-pinned-cache.ts +8 -15
  2080. package/scripts/test/test-pinned-carry.ts +93 -0
  2081. package/scripts/test/test-pinned-emit.ts +2 -1
  2082. package/scripts/test/test-pinned-ledger.ts +15 -9
  2083. package/scripts/test/test-pinned-logic.ts +66 -4
  2084. package/scripts/test/test-pinned-main.ts +6 -30
  2085. package/scripts/test/test-pinned-moves.ts +43 -0
  2086. package/scripts/test/test-pinned-probe.ts +61 -17
  2087. package/scripts/test/test-pinned-prune-logic.ts +2 -1
  2088. package/scripts/test/test-pinned-reach.ts +11 -3
  2089. package/scripts/test/test-pinned-record.ts +36 -4
  2090. package/scripts/test/test-pinned-snapshot.ts +110 -0
  2091. package/scripts/test/test-pinned-spawn.ts +32 -7
  2092. package/scripts/test/test-pinned-stage.ts +43 -16
  2093. package/scripts/test/test-pinned-type-check.ts +110 -0
  2094. package/scripts/test/test-pinned.ts +92 -35
  2095. package/scripts/test/test-red-logic.ts +40 -2
  2096. package/scripts/test/test-red.ts +131 -19
  2097. package/scripts/test/test-related-cap.ts +182 -0
  2098. package/scripts/test/test-related-main.ts +2 -4
  2099. package/scripts/test/test-related-pins.ts +33 -0
  2100. package/scripts/test/test-related-record.ts +84 -8
  2101. package/scripts/test/test-related-red.ts +218 -0
  2102. package/scripts/test/test-related-reuse.ts +167 -0
  2103. package/scripts/test/test-related-run.ts +144 -0
  2104. package/scripts/test/test-related-synced.ts +31 -8
  2105. package/scripts/test/test-related-touched.ts +10 -5
  2106. package/scripts/test/test-related-verdict.ts +127 -0
  2107. package/scripts/test/test-related-whole.ts +22 -0
  2108. package/scripts/test/test-related.ts +123 -146
  2109. package/scripts/test/test-type-logic.ts +1 -2
  2110. package/scripts/test/test-unit-guard.ts +12 -3
  2111. package/scripts/test/unit-count-file.ts +25 -1
  2112. package/scripts/test/unit-lane-count.ts +63 -0
  2113. package/scripts/test/unit-run-marker.ts +11 -1
  2114. package/scripts/test/unit-update-arguments.ts +73 -0
  2115. package/scripts/test/unit-worker-share.ts +28 -13
  2116. package/scripts/test/whole-suite-files.ts +2 -0
  2117. package/scripts/time-runtime/guard-rephrase.ts +66 -0
  2118. package/scripts/time-runtime/time-agent-bundles.ts +5 -5
  2119. package/scripts/time-runtime/time-bundle-call.ts +2 -2
  2120. package/scripts/time-runtime/time-bundles.ts +2 -2
  2121. package/scripts/time-runtime/time-command-key.ts +2 -5
  2122. package/scripts/time-runtime/time-density-hook.ts +2 -31
  2123. package/scripts/time-runtime/time-format.ts +4 -4
  2124. package/scripts/time-runtime/time-josh-names.ts +51 -0
  2125. package/scripts/time-runtime/time-markers.ts +4 -4
  2126. package/scripts/time-runtime/time-phase-names.ts +2 -2
  2127. package/scripts/time-runtime/time-shell.ts +28 -17
  2128. package/scripts/time-runtime/time-single-check.ts +4 -4
  2129. package/scripts/time-runtime/time-spans.ts +8 -8
  2130. package/scripts/time-runtime/time-tool-call.ts +4 -3
  2131. package/scripts/time-runtime/time-transcript-block.ts +172 -0
  2132. package/scripts/time-runtime/time-transcript-line.ts +26 -158
  2133. package/scripts/time-runtime/transcript-tail.ts +39 -0
  2134. package/scripts/ui/ui-shot-cli.ts +90 -0
  2135. package/scripts/ui/ui-shot.ts +95 -0
  2136. package/scripts/usage/usage-state-path.ts +22 -0
  2137. package/scripts/usage/usage-tee-cli.ts +5 -0
  2138. package/scripts/usage/usage-tee.ts +48 -0
  2139. package/scripts/version/development-engines-verdict.ts +7 -1
  2140. package/scripts/version/fresh-metadata-cache.ts +4 -3
  2141. package/scripts/version/latest-corepack.ts +3 -3
  2142. package/scripts/version/latest-if-required-cli.ts +32 -4
  2143. package/scripts/version/latest-scope-cli.ts +12 -2
  2144. package/scripts/version/latest-stamp.ts +5 -4
  2145. package/scripts/version/npm-registry.ts +19 -0
  2146. package/scripts/version/playwright-browsers.ts +1 -1
  2147. package/scripts/version/release-hold.ts +2 -2
  2148. package/scripts/version/upgrade-command-guard.ts +1 -1
  2149. package/templates/prettierignore.basic +3 -0
  2150. package/templates/sonar-project.properties +2 -1
  2151. package/templates/workflows/ci.yml +5 -4
  2152. package/tsconfig/base.json +1 -0
  2153. package/dist/hooks/chunk-3GKE653K.js +0 -6204
  2154. package/dist/hooks/chunk-45CJJOO7.js +0 -1243
  2155. package/dist/hooks/chunk-5PM2JRGV.js +0 -7780
  2156. package/dist/hooks/chunk-7SIUNQXK.js +0 -3591
  2157. package/dist/hooks/chunk-Z6DQJKH3.js +0 -2806
  2158. package/prompts/collaboration-workflow.md +0 -28
  2159. package/scripts/epic/epic-bundle-poll.ts +0 -41
  2160. package/scripts/josh/josh-commands-lane.ts +0 -310
  2161. package/scripts/josh/josh-commands-split.ts +0 -28
  2162. package/scripts/review/review-lint-cli.ts +0 -57
  2163. package/scripts/split/split-early-notice.ts +0 -116
@@ -0,0 +1,2615 @@
1
+ #!/usr/bin/env tsx
2
+ import {
3
+ lane_hand_back_held,
4
+ run_ship_pre_detach
5
+ } from "./chunk-OTZJXU2R.js";
6
+ import {
7
+ run_section,
8
+ run_tail
9
+ } from "./chunk-GM3XLC4W.js";
10
+ import "./chunk-UCUSCLEK.js";
11
+ import "./chunk-BRFQBJ5Y.js";
12
+ import {
13
+ run_ship_wait_cli,
14
+ run_ship_waiter
15
+ } from "./chunk-ZHZSZNE2.js";
16
+ import "./chunk-SXULS6DX.js";
17
+ import {
18
+ early_push_record
19
+ } from "./chunk-QXQ56E56.js";
20
+ import {
21
+ run_ship_args
22
+ } from "./chunk-EI6JG5DF.js";
23
+ import {
24
+ run_ship_preflight,
25
+ run_ship_scoped,
26
+ run_ship_tree_stamp
27
+ } from "./chunk-F6OWP2AY.js";
28
+ import "./chunk-5TMAPYQD.js";
29
+ import {
30
+ run_stalled_park
31
+ } from "./chunk-6WEVLIZE.js";
32
+ import "./chunk-BJA5U4Q7.js";
33
+ import "./chunk-KQWSENCT.js";
34
+ import {
35
+ run_wake_code,
36
+ run_wake_stop,
37
+ run_wake_takeover,
38
+ run_wake_window
39
+ } from "./chunk-HG2NZQD5.js";
40
+ import {
41
+ run_investigation_record
42
+ } from "./chunk-SVAKCXZ7.js";
43
+ import {
44
+ run_ship_stop_text
45
+ } from "./chunk-U5HQQWRE.js";
46
+ import "./chunk-T33QDAWD.js";
47
+ import {
48
+ run_stalled
49
+ } from "./chunk-B33BTNB4.js";
50
+ import {
51
+ pre_commit_lint_switch
52
+ } from "./chunk-X5XYKDOD.js";
53
+ import {
54
+ pre_push_related_switch
55
+ } from "./chunk-VCR77BHO.js";
56
+ import {
57
+ lane_session_broker
58
+ } from "./chunk-MYNM3YMR.js";
59
+ import {
60
+ lane_session_action,
61
+ review_pair,
62
+ review_pair_session,
63
+ run_ship_review,
64
+ run_ship_stop_cause
65
+ } from "./chunk-3BNNMJOT.js";
66
+ import {
67
+ ts_entry_loader
68
+ } from "./chunk-VHRNXWVP.js";
69
+ import {
70
+ api_auth,
71
+ lane_relaunch
72
+ } from "./chunk-3GF52L5F.js";
73
+ import "./chunk-GPTO6IZG.js";
74
+ import "./chunk-PZU6FZO6.js";
75
+ import "./chunk-DAJCUSPG.js";
76
+ import {
77
+ main_merge,
78
+ main_merge_regenerate
79
+ } from "./chunk-WQJ7O3C3.js";
80
+ import "./chunk-XGMRAKSL.js";
81
+ import "./chunk-US6X7JXC.js";
82
+ import {
83
+ followup_ship_environment
84
+ } from "./chunk-LBLII7BS.js";
85
+ import "./chunk-PZTWQYRI.js";
86
+ import {
87
+ run_step_section
88
+ } from "./chunk-RVHBWSIG.js";
89
+ import "./chunk-CADFBQJJ.js";
90
+ import "./chunk-MZHOPRI6.js";
91
+ import "./chunk-XDQOWUVT.js";
92
+ import {
93
+ main_merge_guard
94
+ } from "./chunk-P4D5RESF.js";
95
+ import "./chunk-ZAJD6T6E.js";
96
+ import "./chunk-6NRTLH6I.js";
97
+ import "./chunk-JB7R3A4A.js";
98
+ import {
99
+ run_ship_body_draft
100
+ } from "./chunk-J3G2R64I.js";
101
+ import "./chunk-4HBVHYNL.js";
102
+ import "./chunk-KVJDDECB.js";
103
+ import "./chunk-SK2LJBFS.js";
104
+ import {
105
+ review_final_record
106
+ } from "./chunk-CJAA5GAF.js";
107
+ import {
108
+ review_round_reuse,
109
+ run_ship_probe
110
+ } from "./chunk-CJSFC5YI.js";
111
+ import {
112
+ review_reviewed_tree
113
+ } from "./chunk-Q3463XNL.js";
114
+ import "./chunk-BCK5LW4F.js";
115
+ import "./chunk-HZBTXKT2.js";
116
+ import "./chunk-NMLCPYBN.js";
117
+ import "./chunk-6Q3XUCLM.js";
118
+ import {
119
+ backlog_ready
120
+ } from "./chunk-5WIZR5SC.js";
121
+ import "./chunk-ZAAHZY2A.js";
122
+ import "./chunk-ILQZFUDC.js";
123
+ import "./chunk-RINVPTA2.js";
124
+ import "./chunk-FNOSSXLG.js";
125
+ import "./chunk-VZSJCFRT.js";
126
+ import "./chunk-PWYXY46Y.js";
127
+ import {
128
+ lane_capacity
129
+ } from "./chunk-YPNTORQD.js";
130
+ import "./chunk-AM44D7NF.js";
131
+ import "./chunk-NJ53AWJU.js";
132
+ import "./chunk-ANUTT56I.js";
133
+ import "./chunk-P4O67FP5.js";
134
+ import "./chunk-F3WBEEYC.js";
135
+ import "./chunk-JOARHU3M.js";
136
+ import "./chunk-F2J6DGDM.js";
137
+ import "./chunk-T3FD3Q73.js";
138
+ import "./chunk-ZQ3CKRMP.js";
139
+ import "./chunk-M42SLJCD.js";
140
+ import "./chunk-A4HOQKOG.js";
141
+ import "./chunk-QA22PBCJ.js";
142
+ import "./chunk-B2EA2HCY.js";
143
+ import "./chunk-NGKB632X.js";
144
+ import "./chunk-KZSM5M5P.js";
145
+ import "./chunk-YGDNUTTI.js";
146
+ import "./chunk-LC7SBONO.js";
147
+ import "./chunk-6NGNMIMT.js";
148
+ import "./chunk-T2E724HN.js";
149
+ import "./chunk-RZJAUVMI.js";
150
+ import "./chunk-T57W3UWK.js";
151
+ import "./chunk-GIGKMIPQ.js";
152
+ import "./chunk-SADJPNDB.js";
153
+ import {
154
+ josh_command
155
+ } from "./chunk-2VRITY55.js";
156
+ import "./chunk-ELWNRE6E.js";
157
+ import "./chunk-HLKAFSN4.js";
158
+ import "./chunk-7ZECP3J6.js";
159
+ import "./chunk-3HU3LPIF.js";
160
+ import "./chunk-2CXAVVST.js";
161
+ import "./chunk-J3TKZLHA.js";
162
+ import "./chunk-IZVM2TTH.js";
163
+ import "./chunk-2IESYBZH.js";
164
+ import "./chunk-5PAEXYIY.js";
165
+ import "./chunk-RQRLW4XK.js";
166
+ import "./chunk-TPKFVVJQ.js";
167
+ import "./chunk-BPSJSHYD.js";
168
+ import "./chunk-VDGNXSP3.js";
169
+ import {
170
+ telegram_notify
171
+ } from "./chunk-WJ4NEDNI.js";
172
+ import "./chunk-5HVYOIIK.js";
173
+ import "./chunk-D4SZK7H2.js";
174
+ import "./chunk-OJ4LGBVD.js";
175
+ import "./chunk-3RIQ36LH.js";
176
+ import "./chunk-2ADQ5XRD.js";
177
+ import "./chunk-7IZJ5MG2.js";
178
+ import "./chunk-HXCZ3KWS.js";
179
+ import "./chunk-EKCKCX5S.js";
180
+ import "./chunk-LUMCYDGE.js";
181
+ import "./chunk-EH3LVYOX.js";
182
+ import "./chunk-HOSZITJM.js";
183
+ import {
184
+ run_review,
185
+ run_review_pinned,
186
+ run_review_pinned_accepted,
187
+ run_review_pinned_join,
188
+ run_review_pinned_steps,
189
+ run_review_pinned_tree
190
+ } from "./chunk-5HCPSV45.js";
191
+ import {
192
+ test_pinned,
193
+ test_pinned_record
194
+ } from "./chunk-VZHC2I3T.js";
195
+ import "./chunk-N6TYL3B2.js";
196
+ import "./chunk-HZSQI6TD.js";
197
+ import "./chunk-ESQEEL4O.js";
198
+ import "./chunk-VD5674LW.js";
199
+ import "./chunk-2FJJYCBD.js";
200
+ import "./chunk-D3SHCUBC.js";
201
+ import "./chunk-NFEBQED3.js";
202
+ import "./chunk-LE7TFPMU.js";
203
+ import "./chunk-QX2R6UJG.js";
204
+ import "./chunk-RX5JSPPH.js";
205
+ import "./chunk-U7XU5RG3.js";
206
+ import "./chunk-GJYMI2CM.js";
207
+ import "./chunk-VD72V5VX.js";
208
+ import "./chunk-U2UH4VM4.js";
209
+ import "./chunk-WGULS5DA.js";
210
+ import {
211
+ RETRY_PENDING_KEY,
212
+ RETRY_PENDING_VALUE,
213
+ git_gh_pr_read
214
+ } from "./chunk-23GH6B3D.js";
215
+ import "./chunk-GU5ML3Y3.js";
216
+ import "./chunk-4Z5723GA.js";
217
+ import "./chunk-HBNB3TLG.js";
218
+ import "./chunk-BJKEXXY6.js";
219
+ import {
220
+ cost_cli
221
+ } from "./chunk-FVVZIJUC.js";
222
+ import "./chunk-GW4UWR3O.js";
223
+ import "./chunk-DKM4UJQU.js";
224
+ import {
225
+ changed_paths_sync
226
+ } from "./chunk-CA6F5OXK.js";
227
+ import "./chunk-QWX7EBC6.js";
228
+ import "./chunk-6I2JM5UX.js";
229
+ import "./chunk-BYSPYVLD.js";
230
+ import "./chunk-3WWQFCGX.js";
231
+ import "./chunk-LAYSCY4L.js";
232
+ import "./chunk-AVUGMOHZ.js";
233
+ import "./chunk-KVSSLDA3.js";
234
+ import "./chunk-6CJXLPRI.js";
235
+ import "./chunk-GPMSYXYO.js";
236
+ import "./chunk-E2ZCUKHT.js";
237
+ import {
238
+ FAILURE_MESSAGE_PREFIX,
239
+ FAILURE_REASON_CHECKS,
240
+ FAILURE_REASON_CONFLICT
241
+ } from "./chunk-WVR4RUFP.js";
242
+ import "./chunk-HH2KDLTP.js";
243
+ import "./chunk-3EO2XN3A.js";
244
+ import "./chunk-5GBZ43UA.js";
245
+ import {
246
+ check_reuse
247
+ } from "./chunk-O5FVBIRI.js";
248
+ import "./chunk-SV4FHQE7.js";
249
+ import "./chunk-6SKMZGER.js";
250
+ import "./chunk-LCEJXF7A.js";
251
+ import "./chunk-HE5S4XRE.js";
252
+ import "./chunk-DNJC7X73.js";
253
+ import "./chunk-ENLWXAHD.js";
254
+ import "./chunk-NOXLKIPR.js";
255
+ import {
256
+ test_pinned_logic
257
+ } from "./chunk-E3CXOVPQ.js";
258
+ import "./chunk-GA6E4VGO.js";
259
+ import "./chunk-7EAMUVIO.js";
260
+ import {
261
+ review_round
262
+ } from "./chunk-7P4X4TQL.js";
263
+ import "./chunk-PR3JCPP7.js";
264
+ import "./chunk-WMMGXJXP.js";
265
+ import "./chunk-W6MVQEMO.js";
266
+ import "./chunk-T25S4QHL.js";
267
+ import {
268
+ review_interaction
269
+ } from "./chunk-V5OIPYA6.js";
270
+ import {
271
+ review_round2
272
+ } from "./chunk-RVUJ6F5L.js";
273
+ import "./chunk-MY3RSOS5.js";
274
+ import "./chunk-KVURNO74.js";
275
+ import "./chunk-QHWJJ6X5.js";
276
+ import "./chunk-REPANBLS.js";
277
+ import "./chunk-Q6SKKQVJ.js";
278
+ import "./chunk-EWA72KO7.js";
279
+ import {
280
+ run_ship_lap
281
+ } from "./chunk-PE7B7242.js";
282
+ import {
283
+ review_attest
284
+ } from "./chunk-KIILCKQR.js";
285
+ import "./chunk-WG6GYBRJ.js";
286
+ import "./chunk-CRNPPKP2.js";
287
+ import "./chunk-LAKVPOJQ.js";
288
+ import "./chunk-UU6GCJGM.js";
289
+ import "./chunk-ZDSDPKCD.js";
290
+ import "./chunk-MVPUQLN5.js";
291
+ import "./chunk-5SB37YDW.js";
292
+ import "./chunk-VW5SGE7A.js";
293
+ import "./chunk-ICEMFE2V.js";
294
+ import "./chunk-BIKGPT52.js";
295
+ import "./chunk-PDDKRHHS.js";
296
+ import "./chunk-55I7OYHI.js";
297
+ import "./chunk-DJVMC3U2.js";
298
+ import "./chunk-MSPIR3OA.js";
299
+ import "./chunk-QQZOQ7AM.js";
300
+ import "./chunk-AWLYN2SP.js";
301
+ import "./chunk-L6XN3EXI.js";
302
+ import "./chunk-W4J6YTFE.js";
303
+ import "./chunk-BK6Q4VCA.js";
304
+ import "./chunk-P6RGQXHI.js";
305
+ import "./chunk-KB3OQWDT.js";
306
+ import "./chunk-FGL6DBZU.js";
307
+ import "./chunk-SNO7CY2B.js";
308
+ import "./chunk-RUIBQMOV.js";
309
+ import "./chunk-OZZWRJQI.js";
310
+ import "./chunk-L6LU2633.js";
311
+ import {
312
+ gate_tree
313
+ } from "./chunk-IXX4SXIP.js";
314
+ import {
315
+ file_map_stamp
316
+ } from "./chunk-CGLLAEKZ.js";
317
+ import "./chunk-WL5JHB3I.js";
318
+ import "./chunk-4BEIYKI2.js";
319
+ import "./chunk-LE2T3FGJ.js";
320
+ import "./chunk-LQXFVZTS.js";
321
+ import "./chunk-F2HFWLQR.js";
322
+ import "./chunk-6NV2F7QH.js";
323
+ import "./chunk-REMKUFAC.js";
324
+ import "./chunk-VGHSZLYQ.js";
325
+ import "./chunk-7LJQMM2K.js";
326
+ import "./chunk-FROACLVU.js";
327
+ import "./chunk-MGF64OHV.js";
328
+ import "./chunk-RK4HE5NW.js";
329
+ import "./chunk-O26Y2FOJ.js";
330
+ import "./chunk-XH6BGVVP.js";
331
+ import "./chunk-RXAZJMSZ.js";
332
+ import "./chunk-3PEXBHRN.js";
333
+ import "./chunk-RZ4OKKPM.js";
334
+ import "./chunk-PBOS7MTW.js";
335
+ import "./chunk-2NSB5ZYQ.js";
336
+ import "./chunk-2MJ4OCDL.js";
337
+ import "./chunk-IW6NWCSN.js";
338
+ import "./chunk-UCI4AL3Q.js";
339
+ import "./chunk-QS5USD4T.js";
340
+ import "./chunk-WWC5L3AO.js";
341
+ import {
342
+ lane_ledger
343
+ } from "./chunk-XYAK53TK.js";
344
+ import {
345
+ agent_argv
346
+ } from "./chunk-NJT5L6IC.js";
347
+ import "./chunk-OHVAEJSM.js";
348
+ import "./chunk-E33LSO2W.js";
349
+ import "./chunk-DXJQHJQ4.js";
350
+ import "./chunk-Y2RNUX4W.js";
351
+ import {
352
+ agent_role_profile
353
+ } from "./chunk-RIQ75QWR.js";
354
+ import "./chunk-6WTVAL4D.js";
355
+ import "./chunk-LHKXJD6L.js";
356
+ import "./chunk-ROJXMBXP.js";
357
+ import "./chunk-FCINBCKB.js";
358
+ import "./chunk-Q5Q2QYVU.js";
359
+ import "./chunk-GO3GH7FG.js";
360
+ import "./chunk-KVHNQHX3.js";
361
+ import "./chunk-7HCPRVMB.js";
362
+ import "./chunk-RSSJWMQS.js";
363
+ import "./chunk-RUWV4INF.js";
364
+ import "./chunk-JTU5A4JI.js";
365
+ import "./chunk-FNQW6NY7.js";
366
+ import "./chunk-337QQM4C.js";
367
+ import "./chunk-BEE7OAQ5.js";
368
+ import "./chunk-DBKTFB5V.js";
369
+ import "./chunk-UCQJDYE3.js";
370
+ import {
371
+ core_priority
372
+ } from "./chunk-TCBUX52E.js";
373
+ import "./chunk-KXHXMERX.js";
374
+ import "./chunk-MDLOETXL.js";
375
+ import "./chunk-65E4OZJ7.js";
376
+ import "./chunk-NFKULY26.js";
377
+ import {
378
+ lane_registry
379
+ } from "./chunk-LRS2OS5J.js";
380
+ import {
381
+ lane_handoff
382
+ } from "./chunk-AI5K4QJO.js";
383
+ import "./chunk-7S6VRZOH.js";
384
+ import "./chunk-LULJUD6P.js";
385
+ import "./chunk-TBNQIFWL.js";
386
+ import "./chunk-P4CWLRT2.js";
387
+ import "./chunk-XFPEUYDV.js";
388
+ import "./chunk-5ZTQX7OS.js";
389
+ import {
390
+ run_ship_detach
391
+ } from "./chunk-HCA5QG2U.js";
392
+ import {
393
+ detached_launch
394
+ } from "./chunk-C2SEDMZ3.js";
395
+ import "./chunk-LRA3PXHS.js";
396
+ import "./chunk-6OP63TBT.js";
397
+ import "./chunk-TVZXG4Y4.js";
398
+ import "./chunk-FIUCHMCF.js";
399
+ import "./chunk-XXNEY4B3.js";
400
+ import "./chunk-4PUKDAXL.js";
401
+ import "./chunk-EWVR5AEX.js";
402
+ import "./chunk-C6QSVO5K.js";
403
+ import "./chunk-W3FX7FYN.js";
404
+ import "./chunk-ZBFNQUY7.js";
405
+ import "./chunk-U3IVVR4W.js";
406
+ import "./chunk-O3NDWYNT.js";
407
+ import {
408
+ run_event_scope,
409
+ run_event_stream_emit
410
+ } from "./chunk-34LAULSC.js";
411
+ import "./chunk-5Y7QQYTU.js";
412
+ import "./chunk-34DND4BA.js";
413
+ import {
414
+ run_event_stream
415
+ } from "./chunk-NSAVEXVR.js";
416
+ import "./chunk-P4KIQRSL.js";
417
+ import {
418
+ RUN_STALLED_LABEL
419
+ } from "./chunk-QQBMVC5W.js";
420
+ import "./chunk-TUIFS5E7.js";
421
+ import {
422
+ lane_child_marker
423
+ } from "./chunk-QAHFPCFR.js";
424
+ import "./chunk-66TGK5XL.js";
425
+ import {
426
+ agent_profile_schema
427
+ } from "./chunk-EZSO25UZ.js";
428
+ import "./chunk-2DJLAUYB.js";
429
+ import {
430
+ lane_child_invocation,
431
+ run_ship_next,
432
+ run_ship_stop_context
433
+ } from "./chunk-EW4NPUMQ.js";
434
+ import {
435
+ review_stop_log
436
+ } from "./chunk-BF6YX4HE.js";
437
+ import "./chunk-3LZXX5GL.js";
438
+ import "./chunk-W2IA2LV3.js";
439
+ import {
440
+ run_ship_stage
441
+ } from "./chunk-OHNP3QL2.js";
442
+ import {
443
+ session_cite
444
+ } from "./chunk-X7PN54LZ.js";
445
+ import "./chunk-MDKDJF2K.js";
446
+ import {
447
+ issue_cite
448
+ } from "./chunk-HQ2HSZBN.js";
449
+ import "./chunk-WQ6FS544.js";
450
+ import "./chunk-6HRRZANN.js";
451
+ import {
452
+ lane_ledger_write
453
+ } from "./chunk-I63RNFFR.js";
454
+ import "./chunk-MPGJ4ONJ.js";
455
+ import "./chunk-6WKJ3GDA.js";
456
+ import "./chunk-YIA6FC3K.js";
457
+ import "./chunk-JQXPLMCO.js";
458
+ import "./chunk-66NX6EXR.js";
459
+ import "./chunk-3NWAGIA6.js";
460
+ import "./chunk-2FE3C4PH.js";
461
+ import "./chunk-HLUS2M3D.js";
462
+ import {
463
+ poll
464
+ } from "./chunk-SBGTCT2C.js";
465
+ import {
466
+ process_identity
467
+ } from "./chunk-AKK56GNX.js";
468
+ import "./chunk-TBIX5FRN.js";
469
+ import "./chunk-IGD6QJPH.js";
470
+ import {
471
+ git_common_directory
472
+ } from "./chunk-FFHEGWPK.js";
473
+ import "./chunk-R6QE5VJG.js";
474
+ import "./chunk-4ZHWTTQW.js";
475
+ import {
476
+ FULL_PAGE_QUERY,
477
+ git_gh_api_path
478
+ } from "./chunk-RDRN56E4.js";
479
+ import {
480
+ git_gh_exec
481
+ } from "./chunk-XDF25GSU.js";
482
+ import "./chunk-EBVS2LKX.js";
483
+ import "./chunk-AQ3PMSXK.js";
484
+ import "./chunk-QVOFWFWC.js";
485
+ import "./chunk-G6BXCWPH.js";
486
+ import {
487
+ error_text
488
+ } from "./chunk-CDY4NFQG.js";
489
+ import "./chunk-OKYFQJW3.js";
490
+ import "./chunk-HHBC6QZE.js";
491
+ import "./chunk-UEURNXE5.js";
492
+ import {
493
+ stamp_file
494
+ } from "./chunk-QWWTC3XR.js";
495
+ import "./chunk-ILGPZ47M.js";
496
+ import {
497
+ PROJECT_ROOT
498
+ } from "./chunk-3CCGKX7Y.js";
499
+ import "./chunk-KSR23NYN.js";
500
+ import {
501
+ buffered_process
502
+ } from "./chunk-D5TAR6TV.js";
503
+ import "./chunk-G47ZNQVG.js";
504
+ import {
505
+ changed_paths
506
+ } from "./chunk-V5FD7DVV.js";
507
+ import {
508
+ change_base
509
+ } from "./chunk-36LOGVJ7.js";
510
+ import "./chunk-ENFPR7J2.js";
511
+ import "./chunk-F7XLEK55.js";
512
+ import "./chunk-UGCUSRZF.js";
513
+ import {
514
+ git_command,
515
+ git_diff_reads
516
+ } from "./chunk-AKQYYHP2.js";
517
+ import {
518
+ git_spawn
519
+ } from "./chunk-CJKPF5DJ.js";
520
+ import "./chunk-RBU2NKHF.js";
521
+ import "./chunk-NKKH3PBE.js";
522
+ import {
523
+ git_spawn_sync
524
+ } from "./chunk-B77ZMVHS.js";
525
+ import "./chunk-B5GXZK3E.js";
526
+ import "./chunk-KTLR4Y32.js";
527
+ import "./chunk-ZNX2LJCQ.js";
528
+ import "./chunk-VJE3RJAX.js";
529
+ import "./chunk-WPAQUMHC.js";
530
+ import {
531
+ json_value
532
+ } from "./chunk-HIU2WXB6.js";
533
+
534
+ // scripts/run/ship/run-ship-cli.ts
535
+ import { dirname as __josh_dirname2 } from "node:path";
536
+ import { fileURLToPath as __josh_file_path2 } from "node:url";
537
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
538
+
539
+ // scripts/run/ship/run-ship.ts
540
+ var PREFLIGHT_HEADER = "=== preflight ===";
541
+ var PRE_DETACH_HEADER = "=== pre-detach checks ===";
542
+ var REVIEW_HEADER = "=== review ===";
543
+ var GATE_HEADER = "=== gate ===";
544
+ var SYNC_HEADER = "=== sync origin/main ===";
545
+ var COMMIT_HEADER = "=== commit/push/PR ===";
546
+ var ROUND_TWO_HEADER = "=== round-2 review ===";
547
+ var FOLLOWUP_HEADER = "=== followup ===";
548
+ var REPORT_HEADER = "=== report ===";
549
+ var STOPPED_PREFIX = "stopped at: ";
550
+ var SKIPPED_BODY = "skipped \u2014 already done";
551
+ function mark_of(result) {
552
+ const { is_skipped, reason } = result;
553
+ return {
554
+ ...is_skipped !== void 0 && { is_skipped },
555
+ ...reason !== void 0 && { reason }
556
+ };
557
+ }
558
+ function section_of(header, result) {
559
+ const { conflicts, preconditions, cause } = result;
560
+ return {
561
+ header,
562
+ body: run_tail.section_body(result.out, result.err, result.code),
563
+ code: result.code,
564
+ out: result.out,
565
+ ...conflicts !== void 0 && { conflicts },
566
+ ...preconditions !== void 0 && { preconditions },
567
+ ...cause !== void 0 && { cause },
568
+ ...mark_of(result)
569
+ };
570
+ }
571
+ function failed_section(sections) {
572
+ return sections.findLast((section) => section.code !== run_section.SUCCESS_EXIT_CODE);
573
+ }
574
+ function format_report(sections) {
575
+ const body = run_section.format_sections(sections);
576
+ const failed = failed_section(sections);
577
+ if (failed === void 0) return body;
578
+ return `${body}${run_section.SECTION_SEPARATOR}${STOPPED_PREFIX}${failed.header}`;
579
+ }
580
+ function with_checks(stop, checks3) {
581
+ if (checks3.code === run_section.SUCCESS_EXIT_CODE) return stop;
582
+ return {
583
+ ...stop,
584
+ preconditions: [...stop.preconditions ?? [], ...checks3.preconditions ?? []]
585
+ };
586
+ }
587
+ var run_ship = {
588
+ COMMIT_HEADER,
589
+ FOLLOWUP_HEADER,
590
+ GATE_HEADER,
591
+ PREFLIGHT_HEADER,
592
+ PRE_DETACH_HEADER,
593
+ REPORT_HEADER,
594
+ REVIEW_HEADER,
595
+ ROUND_TWO_HEADER,
596
+ SKIPPED_BODY,
597
+ SYNC_HEADER,
598
+ STOPPED_PREFIX,
599
+ exit_code: run_section.exit_code_of,
600
+ failed_section,
601
+ format_report,
602
+ section_of,
603
+ with_checks
604
+ };
605
+
606
+ // scripts/git/git-merge-conflicts.ts
607
+ import { existsSync } from "node:fs";
608
+ import path from "node:path";
609
+ var CLEAN_EXIT_CODE = 0;
610
+ var HEAD = "HEAD";
611
+ function blob_id(revision, file_path, cwd) {
612
+ return git_spawn_sync.read(["rev-parse", "--verify", "--quiet", `${revision}:${file_path}`], {
613
+ cwd
614
+ });
615
+ }
616
+ function working_blob_id(file_path, cwd) {
617
+ if (!existsSync(path.join(cwd, file_path))) return void 0;
618
+ return git_spawn_sync.read(["hash-object", "-w", "--", file_path], { cwd });
619
+ }
620
+ function is_one_sided(sides) {
621
+ return sides.ours === sides.theirs || sides.ours === sides.base || sides.theirs === sides.base;
622
+ }
623
+ function is_complete(sides) {
624
+ return sides.base !== void 0 && sides.ours !== void 0 && sides.theirs !== void 0;
625
+ }
626
+ function is_merged(sides, cwd) {
627
+ if (is_one_sided(sides)) return true;
628
+ if (!is_complete(sides)) return false;
629
+ const { base, ours, theirs } = sides;
630
+ const result = git_spawn_sync.run(["merge-file", "-p", "--object-id", ours, base, theirs], {
631
+ cwd
632
+ });
633
+ return result.exit_code === CLEAN_EXIT_CODE;
634
+ }
635
+ function sides_of(file_path, commits, cwd) {
636
+ return {
637
+ base: blob_id(commits.base, file_path, cwd),
638
+ ours: working_blob_id(file_path, cwd),
639
+ theirs: blob_id(commits.theirs, file_path, cwd)
640
+ };
641
+ }
642
+ function working_tree_conflicts(theirs, paths3, cwd) {
643
+ const fork = git_spawn_sync.read(["merge-base", HEAD, theirs], { cwd });
644
+ if (fork === void 0) return void 0;
645
+ const base = changed_paths_sync.through_merge(fork, theirs, { cwd });
646
+ return paths3.filter((file_path) => !is_merged(sides_of(file_path, { base, theirs }, cwd), cwd));
647
+ }
648
+ var git_merge_conflicts = { working_tree_conflicts };
649
+
650
+ // scripts/run/ship/run-ship-conflict-probe.ts
651
+ var FAILURE_EXIT_CODE = 1;
652
+ var CONFLICT_NOTE = "merging origin/main would stop on a conflict in:";
653
+ function fix_note() {
654
+ return `The pre-detach checks did not run. Commit the work with ${main_merge_guard.commit_command()}, run \`pnpm josh main:merge\`, resolve the conflict in those files, then run the ship again.`;
655
+ }
656
+ async function read_conflicts() {
657
+ try {
658
+ const default_branch = await git_command.get_default_branch();
659
+ await git_command.fetch_branch(default_branch);
660
+ const paths3 = await changed_paths.read_changed_paths(false);
661
+ const root = await git_command.repository_root();
662
+ return git_merge_conflicts.working_tree_conflicts(`origin/${default_branch}`, paths3, root);
663
+ } catch {
664
+ return void 0;
665
+ }
666
+ }
667
+ async function probe() {
668
+ const conflicts = await read_conflicts() ?? [];
669
+ if (conflicts.length === 0 || main_merge_regenerate.is_resolvable(conflicts)) return void 0;
670
+ const out = [CONFLICT_NOTE, ...conflicts, fix_note()].join("\n");
671
+ return { code: FAILURE_EXIT_CODE, out, conflicts };
672
+ }
673
+ var run_ship_conflict_probe = { CONFLICT_NOTE, probe, read_conflicts };
674
+
675
+ // scripts/run/ship/run-ship-detach-wait.ts
676
+ var SUCCESS_EXIT_CODE = 0;
677
+ var UNDER = "under";
678
+ var END_TURN = "end the turn: the supervisor ships the rest";
679
+ async function after_launch(issue) {
680
+ const verdict = cost_cli.session_verdict();
681
+ console.info(`cost --cut: ${verdict}`);
682
+ if (verdict === UNDER) return await run_ship_wait_cli.run([issue]);
683
+ console.info(END_TURN);
684
+ return SUCCESS_EXIT_CODE;
685
+ }
686
+ var run_ship_detach_wait = { END_TURN, after_launch };
687
+
688
+ // scripts/run/ship/run-ship-early-push.ts
689
+ async function push(args) {
690
+ const state = await run_ship_probe.read_state();
691
+ if (!state.is_committed || state.is_pushed) {
692
+ await early_push_record.record("ship", state.is_pushed ? "already-pushed" : "uncommitted");
693
+ return;
694
+ }
695
+ const result = await josh_command.josh_run(
696
+ ["git", "-y", "--skip-commit", ...args.body, args.title],
697
+ true
698
+ );
699
+ await early_push_record.record("ship", result.code === 0 ? "pushed" : "push-failed");
700
+ }
701
+ async function refresh(stage, is_review, state) {
702
+ if (!is_review || stage !== run_ship_stage.STAGE.GATE) return state;
703
+ return await run_ship_probe.read_state();
704
+ }
705
+ var run_ship_early_push = { push, refresh };
706
+
707
+ // scripts/run/ship/run-ship-group.ts
708
+ async function run(step, execute, sections) {
709
+ const steps2 = step.beside === void 0 ? [step] : [step, step.beside];
710
+ const results = await Promise.all(steps2.map(async (current) => await execute(current)));
711
+ const failed = results.findLastIndex((section) => section.code !== 0);
712
+ sections.push(...results.filter((_, index) => index !== failed));
713
+ if (failed !== -1) sections.push(...results.slice(failed, failed + 1));
714
+ const stopped_step = steps2[failed];
715
+ return stopped_step === void 0 ? void 0 : { step: stopped_step, sections };
716
+ }
717
+ function settled_phase(section) {
718
+ const { PHASE: PHASE4 } = run_ship_stage;
719
+ if (section.code !== 0) return PHASE4.FAILED;
720
+ return section.is_skipped === true ? PHASE4.SKIPPED : PHASE4.DONE;
721
+ }
722
+ var run_ship_group = { run, settled_phase };
723
+
724
+ // scripts/run/ship/run-ship-handover.ts
725
+ import { dirname as __josh_dirname } from "node:path";
726
+ import { fileURLToPath as __josh_file_path } from "node:url";
727
+ import { fileURLToPath } from "node:url";
728
+
729
+ // scripts/run/ship/run-ship-relaunch.ts
730
+ function holder_pid(repository, number) {
731
+ return run_ship_detach.read_record(repository, number)?.pid;
732
+ }
733
+ function successor_argv() {
734
+ return {
735
+ command: process.execPath,
736
+ args: [...ts_entry_loader.loader_argv(process.execArgv), ...process.argv.slice(1)]
737
+ };
738
+ }
739
+ function relaunch(request2) {
740
+ const launch_id = process.env[run_ship_detach.LAUNCH_ID_KEY];
741
+ if (launch_id === void 0) return void 0;
742
+ const result = detached_launch.launch(
743
+ {
744
+ argv: successor_argv(),
745
+ cwd: request2.cwd,
746
+ log_path: run_ship_detach.log_path(request2.repository, request2.number),
747
+ env: run_ship_detach.supervisor_environment(launch_id)
748
+ },
749
+ console.error
750
+ );
751
+ return result.kind === "launched" ? result.pid : void 0;
752
+ }
753
+ var run_ship_relaunch = { holder_pid, relaunch };
754
+
755
+ // scripts/run/ship/run-ship-handover.ts
756
+ var __josh_meta = import.meta;
757
+ var __josh_source_url = new URL("../../scripts/run/ship/run-ship-handover.ts", __josh_meta.url).href;
758
+ var __josh_source_filename = __josh_file_path(__josh_source_url);
759
+ var __josh_source_dirname = __josh_dirname(__josh_source_filename);
760
+ var ENTRY = fileURLToPath(new URL("run-ship-cli.ts", __josh_source_url));
761
+ var ROOT = fileURLToPath(new URL("../../..", __josh_source_url));
762
+ var HANDOVER_HEADER = "=== handover ===";
763
+ var SUCCESS_EXIT_CODE2 = 0;
764
+ async function never_stale() {
765
+ return false;
766
+ }
767
+ async function watch() {
768
+ if (!run_ship_detach.is_supervised()) return never_stale;
769
+ return await run_wake_code.watch(run_wake_code.source_of(ROOT, ENTRY));
770
+ }
771
+ function ports_of(repository, number) {
772
+ return {
773
+ holder_pid: () => run_ship_relaunch.holder_pid(repository, number),
774
+ is_alive: process_identity.is_live_pid,
775
+ stop: run_wake_stop.signal
776
+ };
777
+ }
778
+ async function note(number, text) {
779
+ await run_event_stream_emit.emit(
780
+ run_event_stream.EVENT_KIND.NOTE,
781
+ `${issue_cite.plain_for("program", number)} ${text}`
782
+ );
783
+ }
784
+ async function take_over(args, repository) {
785
+ const pid = run_ship_relaunch.relaunch({ repository, number: args.number, cwd: process.cwd() });
786
+ if (pid === void 0) return void 0;
787
+ const result = await run_wake_takeover.await_takeover(pid, ports_of(repository, args.number));
788
+ return result === "taken" ? pid : void 0;
789
+ }
790
+ function handed_over(pid) {
791
+ return {
792
+ header: HANDOVER_HEADER,
793
+ body: `code changed on main \u2014 process ${String(pid)} ships the rest on the new code`,
794
+ code: SUCCESS_EXIT_CODE2
795
+ };
796
+ }
797
+ async function hand_over(args, is_stale) {
798
+ if (!await is_stale()) return void 0;
799
+ const repository = await run_ship_probe.repository_directory();
800
+ if (repository === void 0) return void 0;
801
+ const pid = await take_over(args, repository);
802
+ if (pid === void 0) {
803
+ await note(
804
+ args.number,
805
+ `The ship supervisor's code changed on main, but no successor took the ship over, so process ${String(process.pid)} runs the rest on the code it started with.`
806
+ );
807
+ return void 0;
808
+ }
809
+ await note(
810
+ args.number,
811
+ `The ship supervisor's code changed on main, so process ${String(process.pid)} handed the ship to process ${String(pid)} on the new code.`
812
+ );
813
+ return handed_over(pid);
814
+ }
815
+ var run_ship_handover = { hand_over, watch };
816
+
817
+ // scripts/run/ship/run-ship-infra-retry.ts
818
+ import { setTimeout as delay } from "node:timers/promises";
819
+ var MAX_INFRA_RETRIES = 2;
820
+ var RETRY_DELAY_MS = 6e4;
821
+ var RETRY_CAP = String(MAX_INFRA_RETRIES);
822
+ var DEFAULT_HOOKS = {
823
+ wait: async (milliseconds) => {
824
+ await delay(milliseconds);
825
+ },
826
+ note: (text) => {
827
+ process.stderr.write(`${text}
828
+ `);
829
+ }
830
+ };
831
+ function is_retryable(stage, section) {
832
+ if (section.code === 0 || run_ship_stop_cause.is_review(stage)) return false;
833
+ return run_ship_stop_cause.cause_of(stage, section) === run_ship_stop_cause.CAUSE.INFRA;
834
+ }
835
+ async function run_attempt(attempt, retries_left) {
836
+ if (retries_left === 0) return await attempt();
837
+ process.env[RETRY_PENDING_KEY] = RETRY_PENDING_VALUE;
838
+ try {
839
+ return await attempt();
840
+ } finally {
841
+ Reflect.deleteProperty(process.env, RETRY_PENDING_KEY);
842
+ }
843
+ }
844
+ async function retried(stage, attempt, hooks = DEFAULT_HOOKS, retries_left = MAX_INFRA_RETRIES) {
845
+ const section = await run_attempt(attempt, retries_left);
846
+ if (retries_left === 0 || !is_retryable(stage, section)) return section;
847
+ const ordinal = String(MAX_INFRA_RETRIES - retries_left + 1);
848
+ hooks.note(`josh ship: ${stage} stopped on the infrastructure \u2014 retry ${ordinal}/${RETRY_CAP}`);
849
+ await hooks.wait(RETRY_DELAY_MS);
850
+ return await retried(stage, attempt, hooks, retries_left - 1);
851
+ }
852
+ var run_ship_infra_retry = { MAX_INFRA_RETRIES, RETRY_DELAY_MS, retried };
853
+
854
+ // scripts/run/ship/run-ship-pre-detach-pinned.ts
855
+ import { randomUUID } from "node:crypto";
856
+
857
+ // scripts/run/ship/run-ship-pre-detach-timed.ts
858
+ var SUCCESS_EXIT_CODE3 = 0;
859
+ var { PHASE } = run_ship_stage;
860
+ async function emit_phase(issue, phase) {
861
+ const text = run_ship_stage.event_text(issue, lane_ledger_write.PRE_DETACH_STAGE, phase);
862
+ await run_event_stream_emit.emit(run_event_stream.EVENT_KIND.SHIP_STAGE, text);
863
+ }
864
+ async function checks(issue, run5 = run_ship_pre_detach.checks) {
865
+ await emit_phase(issue, PHASE.START);
866
+ const started_ms = performance.now();
867
+ const result = await run5();
868
+ const elapsed_ms = performance.now() - started_ms;
869
+ await lane_ledger_write.record_stage({
870
+ stage: lane_ledger_write.PRE_DETACH_STAGE,
871
+ elapsed_ms,
872
+ issue: Number(issue)
873
+ });
874
+ await emit_phase(issue, result.code === SUCCESS_EXIT_CODE3 ? PHASE.DONE : PHASE.FAILED);
875
+ return result;
876
+ }
877
+ var run_ship_pre_detach_timed = { checks };
878
+
879
+ // scripts/run/ship/run-ship-pre-detach-pinned.ts
880
+ var SUCCESS_EXIT_CODE4 = 0;
881
+ var FAILURE_EXIT_CODE2 = 1;
882
+ var SKIPPED_NOTE = "test:pinned not run before the detach; round 1 lists the unpinned places under --unpinned-ok: ";
883
+ var CARRIED_NOTE = "josh ship: --unpinned-ok carried from an earlier run on this branch: ";
884
+ async function own_summary(reason) {
885
+ const token = randomUUID();
886
+ const argv = ["josh", ...test_pinned_record.launch_argv(token, reason, "pre-detach")];
887
+ const result = await buffered_process.run_buffered_process(argv);
888
+ const answer = test_pinned_record.read(token);
889
+ test_pinned_record.clear(token);
890
+ return answer ?? test_pinned_record.not_run_summary(result.output);
891
+ }
892
+ function remaining_note(remaining) {
893
+ const hunks = remaining === void 0 ? "the remaining hunks" : `${String(remaining)} remaining hunks`;
894
+ return `test:pinned: probing ${hunks} in the background \u2014 the next ship's pre-detach reads their verdicts
895
+ `;
896
+ }
897
+ async function is_rest_launched() {
898
+ try {
899
+ const tree = await run_review_pinned_tree.key();
900
+ run_review_pinned_steps.clear();
901
+ return run_review_pinned_steps.launch_remaining(PROJECT_ROOT, tree).kind === "launched";
902
+ } catch (error) {
903
+ error_text.trace_swallowed("run_ship_pre_detach_pinned.is_rest_launched", error);
904
+ return false;
905
+ }
906
+ }
907
+ async function continued(answer) {
908
+ if (answer.is_cut !== true || !await is_rest_launched()) return answer;
909
+ return { ...answer, text: `${answer.text}${remaining_note(answer.remaining)}` };
910
+ }
911
+ async function summary(reason) {
912
+ const answer = await run_review_pinned_join.answer_on_tree();
913
+ const is_whole = answer?.is_cut !== true || reason === void 0;
914
+ return await continued(answer !== void 0 && is_whole ? answer : await own_summary(reason));
915
+ }
916
+ async function held_summary() {
917
+ try {
918
+ const report = await test_pinned.held_report(test_pinned_logic.DEFAULT_MAX_HUNKS);
919
+ return report === void 0 ? void 0 : test_pinned_record.summary_of(report);
920
+ } catch (error) {
921
+ error_text.trace_swallowed("run_ship_pre_detach_pinned.held_summary", error);
922
+ return void 0;
923
+ }
924
+ }
925
+ async function summary_for(reason) {
926
+ const held = reason === void 0 ? void 0 : await held_summary();
927
+ return held ?? await summary(reason);
928
+ }
929
+ async function is_listed_after_detach(number) {
930
+ try {
931
+ return !await review_round_reuse.is_reusable_here(Number(number));
932
+ } catch (error) {
933
+ error_text.trace_swallowed("run_ship_pre_detach_pinned.is_listed_after_detach", error);
934
+ return false;
935
+ }
936
+ }
937
+ async function pinned_check(options) {
938
+ const reason = run_review_pinned.ok_reason_of(options.unpinned_ok);
939
+ if (reason !== void 0 && await is_listed_after_detach(options.number)) {
940
+ return { code: SUCCESS_EXIT_CODE4, out: `${SKIPPED_NOTE}${reason}
941
+ ` };
942
+ }
943
+ const verdict = await run_review_pinned_accepted.judge(await summary_for(reason), reason);
944
+ return {
945
+ code: verdict.kind === "stop" ? FAILURE_EXIT_CODE2 : SUCCESS_EXIT_CODE4,
946
+ out: verdict.text
947
+ };
948
+ }
949
+ function cleared() {
950
+ try {
951
+ run_review_pinned_steps.clear();
952
+ } catch (error) {
953
+ error_text.trace_swallowed("run_ship_pre_detach_pinned.cleared", error);
954
+ }
955
+ }
956
+ function checks_for(options) {
957
+ if (!options.is_review) {
958
+ return async () => {
959
+ cleared();
960
+ return await run_ship_pre_detach.checks();
961
+ };
962
+ }
963
+ return async () => await run_ship_pre_detach.checks(process.cwd(), check_reuse.DEFAULT_RECORDS, async () => {
964
+ return await pinned_check(options);
965
+ });
966
+ }
967
+ async function timed_checks(args) {
968
+ return await run_ship_pre_detach_timed.checks(args.number, checks_for(args));
969
+ }
970
+ async function with_recorded_reason(args) {
971
+ if (!args.is_review || args.unpinned_ok.length > 0) return args;
972
+ const reason = await run_review_pinned_accepted.recorded_reason();
973
+ if (reason === void 0) return args;
974
+ console.info(`${CARRIED_NOTE}${reason}`);
975
+ return { ...args, unpinned_ok: [run_review_pinned.UNPINNED_OK_FLAG, reason] };
976
+ }
977
+ var run_ship_pre_detach_pinned = { checks_for, pinned_check, timed_checks, with_recorded_reason };
978
+
979
+ // scripts/run/ship/run-ship-reship.ts
980
+ var { PHASE: PHASE2, STAGE } = run_ship_stage;
981
+ var { CAUSE } = run_ship_stop_cause;
982
+ var SUCCESS_EXIT_CODE5 = 0;
983
+ var REVIEW_REASONS = /* @__PURE__ */ new Set([STAGE.REVIEW, STAGE.ROUND_TWO]);
984
+ var FIX_CAUSES = /* @__PURE__ */ new Set([CAUSE.CHECK, CAUSE.FINDING]);
985
+ var FOLLOWUP_CHECK = { reason: STAGE.FOLLOWUP, cause: CAUSE.CHECK };
986
+ var SHIP_STAGES = /* @__PURE__ */ new Set([
987
+ ...Object.values(STAGE),
988
+ lane_ledger_write.PRE_DETACH_STAGE
989
+ ]);
990
+ var SKIP_REASON = "re-ship after review or followup failure";
991
+ var SKIP_NOTE = `${lane_ledger_write.PRE_DETACH_STAGE}: skipped (${SKIP_REASON})`;
992
+ function is_followup_check(stop) {
993
+ return stop.reason === FOLLOWUP_CHECK.reason && stop.cause === FOLLOWUP_CHECK.cause;
994
+ }
995
+ function is_fix_failure(stop) {
996
+ if (is_followup_check(stop)) return true;
997
+ return REVIEW_REASONS.has(stop.reason) && FIX_CAUSES.has(stop.cause ?? "");
998
+ }
999
+ async function with_base(stop) {
1000
+ if (!is_fix_failure(stop)) return stop;
1001
+ const base = await change_base.resolved_through_merge();
1002
+ return base === void 0 ? stop : { ...stop, base };
1003
+ }
1004
+ function is_ship_mark(entry, issue) {
1005
+ if (entry.kind === lane_ledger.KIND.STOP) return entry.issue === issue;
1006
+ return entry.kind === lane_ledger.KIND.STAGE && entry.issue === issue && SHIP_STAGES.has(entry.stage);
1007
+ }
1008
+ async function last_stop(issue, path2) {
1009
+ const ledger = path2 ?? await lane_ledger_write.target();
1010
+ if (ledger === void 0) return void 0;
1011
+ const marks = lane_ledger.read_entries(ledger).filter((entry) => is_ship_mark(entry, Number(issue)));
1012
+ const last = marks.at(-1);
1013
+ return last?.kind === lane_ledger.KIND.STOP ? last : void 0;
1014
+ }
1015
+ async function is_due(issue, path2) {
1016
+ const last = await last_stop(issue, path2);
1017
+ if (last?.base === void 0 || !is_fix_failure(last)) return false;
1018
+ return last.base === await change_base.resolved_through_merge();
1019
+ }
1020
+ async function skipped(issue) {
1021
+ const text = run_ship_stage.event_text(issue, lane_ledger_write.PRE_DETACH_STAGE, PHASE2.SKIPPED);
1022
+ console.error(SKIP_NOTE);
1023
+ await run_event_stream_emit.emit(
1024
+ run_event_stream.EVENT_KIND.SHIP_STAGE,
1025
+ run_ship_stage.with_reason(text, SKIP_REASON)
1026
+ );
1027
+ return { header: run_ship.PREFLIGHT_HEADER, body: SKIP_NOTE, code: SUCCESS_EXIT_CODE5 };
1028
+ }
1029
+ async function pinned_only(args) {
1030
+ const passed = { code: SUCCESS_EXIT_CODE5, out: run_ship_pre_detach.PASSED };
1031
+ return run_ship_pre_detach.with_pinned(
1032
+ passed,
1033
+ await run_ship_pre_detach_pinned.pinned_check(args)
1034
+ );
1035
+ }
1036
+ async function checks2(args) {
1037
+ if (!args.is_review) return { code: SUCCESS_EXIT_CODE5, out: SKIP_NOTE };
1038
+ return await run_ship_pre_detach_timed.checks(args.number, async () => await pinned_only(args));
1039
+ }
1040
+ var run_ship_reship = { SKIP_NOTE, SKIP_REASON, checks: checks2, is_due, skipped, with_base };
1041
+
1042
+ // scripts/run/ship/run-ship-return.ts
1043
+ import { setTimeout as sleep2 } from "node:timers/promises";
1044
+
1045
+ // scripts/run/ship/run-ship-place.ts
1046
+ import { setTimeout as sleep } from "node:timers/promises";
1047
+ var PLACE_POLL_MS = 3e4;
1048
+ var PLACE_POLLS = 120;
1049
+ var RELAUNCH_OVERSHOOT = 1;
1050
+ function is_behind(lane, issue) {
1051
+ return lane.issue.localeCompare(issue, void 0, { numeric: true }) > 0;
1052
+ }
1053
+ async function waiters_behind(issue) {
1054
+ const lanes = await lane_registry.list_lanes();
1055
+ return lanes.filter(
1056
+ (lane) => is_behind(lane, issue) && lane_handoff.is_place_waiting(lane.issue, lane.directory)
1057
+ ).length;
1058
+ }
1059
+ async function is_over_limit(issue) {
1060
+ const limit = await lane_capacity.lane_limit();
1061
+ if (limit.kind !== "limit") return false;
1062
+ const use = await backlog_ready.lane_use();
1063
+ const behind = await waiters_behind(issue);
1064
+ return use.occupied - behind > lane_capacity.seated_limit(limit.limit) + RELAUNCH_OVERSHOOT;
1065
+ }
1066
+ async function is_place_taken(issue) {
1067
+ try {
1068
+ return await is_over_limit(issue);
1069
+ } catch {
1070
+ return false;
1071
+ }
1072
+ }
1073
+ function mark(lane, is_waiting) {
1074
+ const repository = git_common_directory.repository(lane.directory);
1075
+ if (repository === void 0) return;
1076
+ try {
1077
+ run_ship_stage.mark_place_waiting(
1078
+ run_ship_stage.record_path(repository, lane.issue),
1079
+ is_waiting
1080
+ );
1081
+ } catch {
1082
+ }
1083
+ }
1084
+ async function wait_for_place(issue) {
1085
+ const is_free = await poll.poll_until(async () => !await is_place_taken(issue), {
1086
+ attempts: PLACE_POLLS,
1087
+ interval_ms: PLACE_POLL_MS,
1088
+ sleeper: sleep
1089
+ });
1090
+ if (!is_free) await sleep(PLACE_POLL_MS);
1091
+ }
1092
+ async function await_place(lane, stage) {
1093
+ if (stage !== run_ship_stage.STAGE.FOLLOWUP) return;
1094
+ mark(lane, true);
1095
+ try {
1096
+ await wait_for_place(lane.issue);
1097
+ } finally {
1098
+ mark(lane, false);
1099
+ }
1100
+ }
1101
+ var run_ship_place = { await_place };
1102
+
1103
+ // scripts/run/ship/run-ship-relaunch-cap.ts
1104
+ var MAX_SHIP_STOP_RELAUNCHES = 4;
1105
+ var PARK_CAUSE = "ship-stop cap";
1106
+ var TIMEOUT_PARK_CAUSE = "merge-wait timeout";
1107
+ var CI_INFRA_PARK_CAUSE = "CI infrastructure failure";
1108
+ var { CI_INFRA } = run_ship_stop_cause.CAUSE;
1109
+ var { CHILD_LAUNCH, SHIP_STOP } = run_event_stream.EVENT_KIND;
1110
+ var STOP_KIND = { REVIEW: "review", MECHANICAL: "mechanical" };
1111
+ var REVIEW_REASONS2 = /* @__PURE__ */ new Set([
1112
+ run_ship_stage.STAGE.REVIEW,
1113
+ run_ship_stage.STAGE.ROUND_TWO
1114
+ ]);
1115
+ function kind_of(reason) {
1116
+ return reason !== void 0 && REVIEW_REASONS2.has(reason) ? STOP_KIND.REVIEW : STOP_KIND.MECHANICAL;
1117
+ }
1118
+ function is_capped_stop(text) {
1119
+ return run_ship_stop_text.cause_of(text) !== CI_INFRA;
1120
+ }
1121
+ function is_stop_of(event, kind) {
1122
+ if (event.kind !== SHIP_STOP || !is_capped_stop(event.text)) return false;
1123
+ return kind_of(run_ship_stop_text.reason_of(event.text)) === kind;
1124
+ }
1125
+ function stops_since_dispatch(events, issue, kind) {
1126
+ const own = events.filter((event) => run_event_scope.issue_named(event) === issue);
1127
+ const dispatched = own.findLastIndex((event) => event.kind === CHILD_LAUNCH);
1128
+ return own.slice(dispatched + 1).filter((event) => is_stop_of(event, kind)).length;
1129
+ }
1130
+ async function is_over(issue, reason) {
1131
+ const events = await run_event_stream_emit.all_events();
1132
+ return stops_since_dispatch(events, issue, kind_of(reason)) > MAX_SHIP_STOP_RELAUNCHES;
1133
+ }
1134
+ function park_comment(issue, lead, blocked) {
1135
+ return [
1136
+ lead,
1137
+ ...blocked === void 0 ? [] : ["", `Cause: \`${blocked}\``],
1138
+ "",
1139
+ `Read the stop with \`pnpm josh ship --log ${issue}\`, then ${run_stalled.next_step(issue)}.`
1140
+ ].join("\n");
1141
+ }
1142
+ async function park_with(issue, notice, parked2) {
1143
+ const { blocked, stop } = parked2;
1144
+ const comment = park_comment(issue, notice.lead, blocked);
1145
+ const is_parked = await run_stalled_park.apply(issue, comment, blocked ?? notice.cause, { stop });
1146
+ if (!is_parked) return false;
1147
+ await telegram_notify.warn({
1148
+ issue_title: `${notice.title} ${issue_cite.plain_for("telegram", issue)}`,
1149
+ body: notice.body,
1150
+ recovery: `Read pnpm josh ship --log ${issue}, then fix the cause and remove ${RUN_STALLED_LABEL} to offer it again.`
1151
+ });
1152
+ return true;
1153
+ }
1154
+ async function park(issue, parked2) {
1155
+ const { reason } = parked2;
1156
+ const kind = kind_of(reason);
1157
+ const relaunches = String(MAX_SHIP_STOP_RELAUNCHES);
1158
+ return await park_with(
1159
+ issue,
1160
+ {
1161
+ lead: `Parked by the \`josh ship\` supervisor: the ship stopped at \`${reason}\` after ${relaunches} relaunches of the lane child for ${kind} stops since its dispatch \u2014 the ${kind} stop cap was exceeded.`,
1162
+ cause: PARK_CAUSE,
1163
+ title: "Ship stop cap reached",
1164
+ body: `The lane child's ${kind} stops passed their cap of ${relaunches} relaunches since its dispatch, the last at ${reason}, so it was not relaunched and the issue is parked.`
1165
+ },
1166
+ parked2
1167
+ );
1168
+ }
1169
+ async function park_timed_out(issue, parked2) {
1170
+ const { reason } = parked2;
1171
+ return await park_with(
1172
+ issue,
1173
+ {
1174
+ lead: `Parked by the \`josh ship\` supervisor: the merge wait at \`${reason}\` timed out, which a relaunch of the lane child does not clear, so none was started.`,
1175
+ cause: TIMEOUT_PARK_CAUSE,
1176
+ title: "Merge wait timed out",
1177
+ body: `The merge wait at ${reason} timed out, so the lane child was not relaunched and the issue is parked.`
1178
+ },
1179
+ parked2
1180
+ );
1181
+ }
1182
+ async function park_ci_infra(issue, parked2) {
1183
+ const { reason } = parked2;
1184
+ return await park_with(
1185
+ issue,
1186
+ {
1187
+ lead: `Parked by the \`josh ship\` supervisor: CI infrastructure failures outlasted every rerun at \`${reason}\`, which a relaunch of the lane child does not clear, so none was started. Resume it once CI recovers.`,
1188
+ cause: CI_INFRA_PARK_CAUSE,
1189
+ title: CI_INFRA_PARK_CAUSE,
1190
+ body: `CI infrastructure failures outlasted every rerun at ${reason}, so the lane child was not relaunched and the issue is parked until CI recovers.`
1191
+ },
1192
+ parked2
1193
+ );
1194
+ }
1195
+ async function park_at_once(issue, parked2) {
1196
+ if (parked2.stop.cause === CI_INFRA) return await park_ci_infra(issue, parked2);
1197
+ return await park_timed_out(issue, parked2);
1198
+ }
1199
+ var run_ship_relaunch_cap = {
1200
+ MAX_SHIP_STOP_RELAUNCHES,
1201
+ STOP_KIND,
1202
+ is_over,
1203
+ kind_of,
1204
+ park,
1205
+ park_at_once,
1206
+ park_timed_out,
1207
+ stops_since_dispatch
1208
+ };
1209
+
1210
+ // scripts/run/ship/run-ship-return.ts
1211
+ var OPENAI_PROVIDER = "openai";
1212
+ var SERVING_POLL_MS = 1e3;
1213
+ var SERVING_POLLS = 60;
1214
+ var RELOAD_POLLS = (run_wake_window.WINDOW_MS + run_wake_window.PASS_INTERVAL_MS) / SERVING_POLL_MS + SERVING_POLLS;
1215
+ var VERSION_MISMATCH_NOTE = "the lane broker runs older code than this ship (a version mismatch), and no broker on the current code read the request within the wait";
1216
+ function stop_text(issue, stage, resume, output) {
1217
+ const reason = run_ship_stage.stop_reason(stage, resume.conflicts);
1218
+ const cause = run_ship_stop_cause.cause_of(stage, { ...resume, ...output });
1219
+ return run_ship_stop_text.format(issue, reason, cause);
1220
+ }
1221
+ function can_relaunch(lane) {
1222
+ return lane !== void 0 && lane.profile?.provider !== OPENAI_PROVIDER;
1223
+ }
1224
+ async function lane_to_relaunch(issue) {
1225
+ if (!lane_child_marker.is_child_of(process.cwd())) return void 0;
1226
+ const lane = await lane_registry.find_open_lane(issue);
1227
+ return can_relaunch(lane) ? lane : void 0;
1228
+ }
1229
+ function note2(text) {
1230
+ process.stderr.write(`${text}
1231
+ `);
1232
+ }
1233
+ async function record_failed_relaunch(issue, reason) {
1234
+ note2(`the lane child could not be relaunched: ${reason}`);
1235
+ await run_event_stream_emit.emit(
1236
+ run_event_stream.EVENT_KIND.RELAUNCH_FAILED,
1237
+ `${issue_cite.plain_for("program", issue)} could not be relaunched: ${reason}`
1238
+ );
1239
+ }
1240
+ async function relaunched(lane, stop) {
1241
+ const invocation = lane_child_invocation.ship_stop_invocation(lane.issue, stop);
1242
+ const phase = agent_profile_schema.IMPLEMENTATION_PHASE;
1243
+ const result = await lane_relaunch.relaunch(lane, invocation, phase, note2);
1244
+ if (result.kind === "launched") return "relaunched";
1245
+ await record_failed_relaunch(lane.issue, result.note);
1246
+ return "recorded";
1247
+ }
1248
+ async function ask_broker(lane, stop) {
1249
+ const answer = await lane_session_broker.request(lane.directory, lane.issue, {
1250
+ kind: "relaunch",
1251
+ stop
1252
+ });
1253
+ if (answer.is_success) return { reply: "started", reason: "" };
1254
+ note2(`the lane broker did not start the lane child \u2014 ${answer.reason}`);
1255
+ const reply = lane_session_broker.is_unreadable(answer) ? "unreadable" : "failed";
1256
+ return { reply, reason: answer.reason };
1257
+ }
1258
+ async function await_server(lane, previous, polls = SERVING_POLLS) {
1259
+ const found = await poll.poll_for(
1260
+ () => {
1261
+ const session = lane_session_broker.serving_session(lane.directory, lane.issue);
1262
+ return session === previous ? void 0 : session;
1263
+ },
1264
+ { attempts: polls, interval_ms: SERVING_POLL_MS, sleeper: sleep2 }
1265
+ );
1266
+ if (found === void 0 && polls > 0) await sleep2(SERVING_POLL_MS);
1267
+ return found;
1268
+ }
1269
+ function polls_after(reply) {
1270
+ return reply === "unreadable" ? RELOAD_POLLS : SERVING_POLLS;
1271
+ }
1272
+ function redispatch_reason(last) {
1273
+ const cause = last.reply === "unreadable" ? `${VERSION_MISMATCH_NOTE}: ` : "";
1274
+ return `${cause}the driver re-dispatches the issue \u2014 ${last.reason}`;
1275
+ }
1276
+ async function brokered(lane, stop, server) {
1277
+ const first = await ask_broker(lane, stop);
1278
+ if (first.reply === "started") return "relaunched";
1279
+ const next = await await_server(lane, server, polls_after(first.reply));
1280
+ const last = next === void 0 ? first : await ask_broker(lane, stop);
1281
+ if (last.reply === "started") return "relaunched";
1282
+ await record_failed_relaunch(lane.issue, redispatch_reason(last));
1283
+ return "redispatch";
1284
+ }
1285
+ async function is_returned(issue, stop) {
1286
+ const repository = await run_ship_probe.repository_directory();
1287
+ if (repository === void 0) return false;
1288
+ const stop_note = lane_child_invocation.ship_stop_note(issue, stop);
1289
+ return await run_ship_waiter.offer(repository, issue, stop_note);
1290
+ }
1291
+ async function relaunched_or_brokered(lane, stop) {
1292
+ await run_ship_place.await_place(lane, stop.stage);
1293
+ const server = await await_server(lane);
1294
+ return server === void 0 ? await relaunched(lane, stop) : await brokered(lane, stop, server);
1295
+ }
1296
+ async function parked(issue, parking, output, is_at_once) {
1297
+ const blocked = run_ship_stop_cause.blocked_cause_of(output.body);
1298
+ const { park: park2, park_at_once: park_at_once2 } = run_ship_relaunch_cap;
1299
+ const is_parked = await (is_at_once ? park_at_once2 : park2)(issue, { ...parking, blocked });
1300
+ if (is_parked) return "parked";
1301
+ note2("the lane child was not relaunched, and the park label was refused");
1302
+ return "recorded";
1303
+ }
1304
+ async function park_outcome(issue, stage, resume, output) {
1305
+ const reason = run_ship_stage.stop_reason(stage, resume.conflicts);
1306
+ const failed = { ...resume, ...output };
1307
+ const is_at_once = run_ship_stop_cause.parks_at_once(stage, failed);
1308
+ if (is_at_once || await run_ship_relaunch_cap.is_over(issue, reason)) {
1309
+ const stop = { stage, cause: run_ship_stop_cause.cause_of(stage, failed) };
1310
+ return await parked(issue, { reason, stop }, output, is_at_once);
1311
+ }
1312
+ return void 0;
1313
+ }
1314
+ async function keep_stop(issue, stop) {
1315
+ const repository = await run_ship_probe.repository_directory();
1316
+ if (repository === void 0) return;
1317
+ await run_ship_detach.mark_stop(
1318
+ repository,
1319
+ issue,
1320
+ lane_child_invocation.ship_stop_invocation(issue, stop)
1321
+ );
1322
+ }
1323
+ async function stopped(issue, stage, resume, output) {
1324
+ await run_event_stream_emit.emit(
1325
+ run_event_stream.EVENT_KIND.SHIP_STOP,
1326
+ stop_text(issue, stage, resume, output)
1327
+ );
1328
+ await keep_stop(issue, { stage, ...resume });
1329
+ const lane = await lane_to_relaunch(issue);
1330
+ if (lane === void 0) return "recorded";
1331
+ const parked_outcome = await park_outcome(issue, stage, resume, output);
1332
+ if (parked_outcome !== void 0) return parked_outcome;
1333
+ const findings = run_ship_stop_cause.details_of(stage, { ...resume, ...output });
1334
+ const context = await run_ship_stop_context.build(issue, output.body, findings);
1335
+ const stop = { stage, ...resume, context };
1336
+ return await is_returned(issue, stop) ? "returned" : await relaunched_or_brokered(lane, stop);
1337
+ }
1338
+ async function return_control(issue, stage, resume, output) {
1339
+ return await stopped(issue, stage, resume, { body: output });
1340
+ }
1341
+ function stopped_resume(resume, failed) {
1342
+ const { conflicts, cause } = failed ?? {};
1343
+ return {
1344
+ ...resume,
1345
+ ...conflicts !== void 0 && { conflicts },
1346
+ ...cause !== void 0 && { cause }
1347
+ };
1348
+ }
1349
+ async function hand_back(args, stage, failed) {
1350
+ const is_review_stale = await run_ship_probe.read_review_stale();
1351
+ const resume = { ...run_ship_next.resume_of(args), is_review_stale };
1352
+ return await stopped(args.number, stage, stopped_resume(resume, failed), failed ?? { body: "" });
1353
+ }
1354
+ var run_ship_return = { hand_back, return_control };
1355
+
1356
+ // scripts/run/ship/run-ship-final-review.ts
1357
+ async function run2(issue, review) {
1358
+ const stamp = review_final_record.stamp(issue);
1359
+ const tree = await gate_tree.read_gate_tree();
1360
+ const is_stale = await review_round_reuse.is_stale_here();
1361
+ if (!is_stale && run_ship_tree_stamp.is_reusable(stamp, tree)) {
1362
+ return { code: 0, out: "final round 2 reused on the reviewed tree", is_skipped: true };
1363
+ }
1364
+ stamp.write(tree.files, void 0, tree.base);
1365
+ const result = await review();
1366
+ run_ship_tree_stamp.complete(stamp, tree, result.code);
1367
+ return result;
1368
+ }
1369
+ var run_ship_final_review = { run: run2 };
1370
+
1371
+ // scripts/run/ship/run-ship-review-checkpoint.ts
1372
+ function checkpoints(issue, stage, phases, head) {
1373
+ return phases.map(([name, phase]) => ({
1374
+ name,
1375
+ phase,
1376
+ stamp: file_map_stamp.create(
1377
+ `josh-ship-review-step-${issue}-${stage}-${name}-`,
1378
+ PROJECT_ROOT,
1379
+ () => head
1380
+ )
1381
+ }));
1382
+ }
1383
+ function matches(stamp, tree) {
1384
+ const prior = stamp.read();
1385
+ if (prior?.completed_at === void 0) return false;
1386
+ return stamp.describes_inputs(prior) && file_map_stamp.describes_base(prior, tree.base) && file_map_stamp.changed_since(prior, tree.files).length === 0;
1387
+ }
1388
+ async function attested_prefix(entries, count) {
1389
+ const provider = entries.findIndex(({ name }) => name === "provider");
1390
+ if (provider === -1 || provider >= count) return count;
1391
+ const { status } = await review_attest.check_here();
1392
+ return status === "missing" || status === "mismatch" ? provider : count;
1393
+ }
1394
+ async function reusable_prefix(entries, tree, is_stale) {
1395
+ const missing = entries.findIndex(({ stamp }) => is_stale || !matches(stamp, tree));
1396
+ const count = await attested_prefix(entries, missing === -1 ? entries.length : missing);
1397
+ for (const { stamp } of entries.slice(count)) stamp.remove();
1398
+ return count;
1399
+ }
1400
+ async function recorded(phase, stamp, tree) {
1401
+ stamp.write(tree.files, void 0, tree.base);
1402
+ const result = await phase();
1403
+ if (result.code === 0) stamp.complete();
1404
+ return result;
1405
+ }
1406
+ async function run3(issue, stage, phases, is_stale = false) {
1407
+ const tree = await gate_tree.read_gate_tree();
1408
+ if (tree.base === void 0 || Object.keys(tree.files).length === 0) {
1409
+ for (const { stamp } of checkpoints(issue, stage, phases, "")) stamp.remove();
1410
+ return await run_ship_scoped.run_phases(phases.map(([, phase]) => phase));
1411
+ }
1412
+ const entries = checkpoints(issue, stage, phases, await git_command.head_commit());
1413
+ const count = await reusable_prefix(entries, tree, is_stale);
1414
+ return await run_ship_scoped.run_phases(
1415
+ entries.map(({ name, phase, stamp }, index) => async () => {
1416
+ if (index < count) return { code: 0, out: `review step ${name}: reused` };
1417
+ return await recorded(phase, stamp, tree);
1418
+ })
1419
+ );
1420
+ }
1421
+ var run_ship_review_checkpoint = { run: run3 };
1422
+
1423
+ // scripts/run/ship/run-ship-review-reason.ts
1424
+ var HELD_REASON = "reused: round 1 attested on this branch, its tree held";
1425
+ var DELTA_REASON = "reused: round 1 attested on this branch, what moved since is round 2's delta";
1426
+ var RAN_PREFIX = "ran: --review with no reusable round 1 \u2014 ";
1427
+ var UNNAMED_CAUSE = "the recorded round does not cover this tree";
1428
+ function reused(answer) {
1429
+ const reason = answer.reuse === review_round_reuse.REUSE.HELD ? HELD_REASON : DELTA_REASON;
1430
+ return answer.note === void 0 ? reason : `${reason} \u2014 ${answer.note}`;
1431
+ }
1432
+ function ran(answer) {
1433
+ return `${RAN_PREFIX}${answer.cause ?? UNNAMED_CAUSE}`;
1434
+ }
1435
+ var run_ship_review_reason = { ran, reused };
1436
+
1437
+ // scripts/run/ship/run-ship-brokered-review.ts
1438
+ var { CODE } = review_attest.REVIEW_SLOT;
1439
+ function copy_stamp(source, target) {
1440
+ const text = stamp_file.read_stamp_text(source);
1441
+ if (text !== void 0) stamp_file.write_text_stamp(target, text);
1442
+ }
1443
+ async function code_request(directory, issue, round) {
1444
+ return await lane_session_broker.request(directory, issue, { kind: "review", round });
1445
+ }
1446
+ async function staged_review(directory, issue, round, slot) {
1447
+ const code = lane_session_broker.review_paths(directory);
1448
+ const own = lane_session_broker.review_paths(directory, slot);
1449
+ copy_stamp(own.brief, code.brief);
1450
+ const answer = await code_request(directory, issue, round);
1451
+ copy_stamp(code.findings, own.findings);
1452
+ stamp_file.remove_stamp(code.findings);
1453
+ return answer;
1454
+ }
1455
+ async function staged_reviews(directory, issue, round, slots) {
1456
+ const [slot, ...rest] = slots;
1457
+ if (slot === void 0) return [];
1458
+ const answer = await staged_review(directory, issue, round, slot);
1459
+ return [answer, ...await staged_reviews(directory, issue, round, rest)];
1460
+ }
1461
+ async function in_turn(directory, issue, round, slots) {
1462
+ const code_brief = lane_session_broker.review_paths(directory).brief;
1463
+ const kept = stamp_file.read_stamp_text(code_brief);
1464
+ const others = slots.filter((slot) => slot !== CODE);
1465
+ const answers = [...await staged_reviews(directory, issue, round, others)];
1466
+ if (kept !== void 0) stamp_file.write_text_stamp(code_brief, kept);
1467
+ if (slots.includes(CODE)) answers.push(await code_request(directory, issue, round));
1468
+ return answers.find((answer) => !answer.is_success) ?? lane_session_action.SUCCESS;
1469
+ }
1470
+ async function request(directory, issue, round, slots) {
1471
+ if (slots.length === 1 && slots[0] === CODE) return await code_request(directory, issue, round);
1472
+ const answer = await lane_session_broker.request(directory, issue, {
1473
+ kind: "review",
1474
+ round,
1475
+ slots
1476
+ });
1477
+ if (!lane_session_broker.is_unreadable(answer)) return answer;
1478
+ return await in_turn(directory, issue, round, slots);
1479
+ }
1480
+ var run_ship_brokered_review = { request };
1481
+
1482
+ // scripts/run/ship/run-ship-reviewer.ts
1483
+ var SUCCESS_EXIT_CODE6 = 0;
1484
+ var FAILURE_EXIT_CODE3 = 1;
1485
+ var should_forward_stderr = true;
1486
+ var ATTEST_CHECK = ["review:attest", "--check"];
1487
+ var KEPT_REVIEW_NOTE = "the reviewer wrote its findings before it failed \u2014 its review is kept; attest and record judge it.";
1488
+ var MISSING_FINDINGS_NOTE = "the reviewer submitted no findings; nothing is at the slot path:";
1489
+ var ROUND_ONE = "1";
1490
+ var ROUND_TWO = "2";
1491
+ var { CAUSE: CAUSE2 } = run_ship_stop_cause;
1492
+ var { CODE: CODE2 } = review_attest.REVIEW_SLOT;
1493
+ var { PRIORITY_ENVIRONMENT } = core_priority;
1494
+ function failure(out, cause) {
1495
+ return { code: FAILURE_EXIT_CODE3, out, cause };
1496
+ }
1497
+ function tagged(cause, result) {
1498
+ return result.code === SUCCESS_EXIT_CODE6 ? result : { ...result, cause };
1499
+ }
1500
+ function tagged_phase(cause, phase) {
1501
+ return async () => tagged(cause, await phase());
1502
+ }
1503
+ function paths(slot) {
1504
+ return lane_session_broker.review_paths(PROJECT_ROOT, slot);
1505
+ }
1506
+ async function josh(argv) {
1507
+ return await josh_command.josh_run(argv, should_forward_stderr, void 0, PRIORITY_ENVIRONMENT);
1508
+ }
1509
+ function note3(text) {
1510
+ process.stderr.write(`${text}
1511
+ `);
1512
+ }
1513
+ function exited_note(log_path) {
1514
+ const exited = `reviewer failed \u2014 log: ${log_path}`;
1515
+ if (!api_auth.is_auth_failed_transcript(stamp_file.read_stamp_text(log_path))) return exited;
1516
+ return `${api_auth.AUTH_FAILURE_NOTE}: ${exited}`;
1517
+ }
1518
+ function current_verdict(slot) {
1519
+ return run_ship_review.read_verdict(stamp_file.read_stamp_text(paths(slot).findings));
1520
+ }
1521
+ function missing_findings(slots) {
1522
+ const missing = slots.map((slot) => paths(slot).findings).filter((findings) => stamp_file.read_stamp_text(findings) === void 0);
1523
+ return missing.length === 0 ? void 0 : `${MISSING_FINDINGS_NOTE} ${missing.join(", ")}`;
1524
+ }
1525
+ function finished_session(slots) {
1526
+ const missing = missing_findings(slots);
1527
+ return missing === void 0 ? { code: SUCCESS_EXIT_CODE6, out: "" } : failure(missing, CAUSE2.INFRA);
1528
+ }
1529
+ function ended_session(failed_note, slots = [CODE2]) {
1530
+ if (slots.some((slot) => current_verdict(slot).kind === run_ship_review.VERDICT.INVALID)) {
1531
+ const missing = missing_findings(slots);
1532
+ return failure(missing === void 0 ? failed_note : `${failed_note}
1533
+ ${missing}`, CAUSE2.INFRA);
1534
+ }
1535
+ note3(`${failed_note}
1536
+ ${KEPT_REVIEW_NOTE}`);
1537
+ return { code: SUCCESS_EXIT_CODE6, out: "" };
1538
+ }
1539
+ async function run_direct_session(argv, profile, slot, round) {
1540
+ const log_path = paths(slot).log;
1541
+ const request2 = { argv, cwd: PROJECT_ROOT, log_path, profile, env: PRIORITY_ENVIRONMENT };
1542
+ note3(agent_role_profile.describe_review(Number(round), profile));
1543
+ const result = await detached_launch.launch_attached(request2, note3);
1544
+ if (result.kind === "failed") {
1545
+ return failure(`reviewer could not start: ${result.note}`, CAUSE2.INFRA);
1546
+ }
1547
+ if (result.exit_code !== SUCCESS_EXIT_CODE6) return ended_session(exited_note(log_path), [slot]);
1548
+ return finished_session([slot]);
1549
+ }
1550
+ function is_brokered(profile, issue) {
1551
+ if (!lane_child_marker.is_child_of(PROJECT_ROOT)) return false;
1552
+ return profile.provider === "openai" || lane_session_broker.is_serving(PROJECT_ROOT, issue);
1553
+ }
1554
+ function session_for(prompt_of, issue, round, slots) {
1555
+ const { slot, all } = slots;
1556
+ const prompt = run_ship_review.slot_prompt(prompt_of, slot, all)(paths(slot).brief, slot, issue);
1557
+ return { slot, built: agent_argv.review_in(prompt, Number(round), PROJECT_ROOT) };
1558
+ }
1559
+ async function run_slot(session, round) {
1560
+ const { built, slot } = session;
1561
+ if (built.kind === "rejected") {
1562
+ return failure(`reviewer profile rejected: ${built.note}`, CAUSE2.INFRA);
1563
+ }
1564
+ return await run_direct_session(built.argv, built.profile, slot, round);
1565
+ }
1566
+ async function run_brokered(issue, round, slots) {
1567
+ const answer = await run_ship_brokered_review.request(PROJECT_ROOT, issue, round, slots);
1568
+ return answer.is_success ? finished_session(slots) : ended_session(`isolated reviewer failed: ${answer.reason}`, slots);
1569
+ }
1570
+ async function launch_pair(slots) {
1571
+ if (slots.includes(CODE2)) await review_pair_session.launch(PROJECT_ROOT, PRIORITY_ENVIRONMENT);
1572
+ }
1573
+ async function run_slots(sessions, round, slots) {
1574
+ const [results] = await Promise.all([
1575
+ Promise.all(sessions.map(async (session) => await run_slot(session, round))),
1576
+ launch_pair(slots)
1577
+ ]);
1578
+ return results;
1579
+ }
1580
+ async function run_sessions(prompt_of, issue, round, slots) {
1581
+ const sessions = slots.map((slot) => session_for(prompt_of, issue, round, { slot, all: slots }));
1582
+ const [first] = sessions;
1583
+ if (first?.built.kind === "argv" && is_brokered(first.built.profile, issue)) {
1584
+ return await run_brokered(issue, round, slots);
1585
+ }
1586
+ const results = await run_slots(sessions, round, slots);
1587
+ return results.find((result) => result.code !== SUCCESS_EXIT_CODE6) ?? {
1588
+ code: SUCCESS_EXIT_CODE6,
1589
+ out: ""
1590
+ };
1591
+ }
1592
+ function offer_pair(code) {
1593
+ if (code !== void 0) review_pair.offer(code.brief);
1594
+ }
1595
+ async function record_pair(issue, code) {
1596
+ if (code === void 0) return;
1597
+ const argv = review_pair_session.pair_argv(issue, paths(CODE2).log, PROJECT_ROOT);
1598
+ if (argv === void 0) return;
1599
+ const result = await josh(argv);
1600
+ if (result.code !== SUCCESS_EXIT_CODE6) note3(`paired reviewer: review:pair recorded nothing`);
1601
+ }
1602
+ async function launch_reviewers(briefs, prompt_of, issue, round) {
1603
+ const code = briefs.find(({ slot }) => slot === CODE2);
1604
+ const effective_round = review_round.from_brief(code?.brief ?? "", round);
1605
+ for (const { brief, slot } of briefs) {
1606
+ const target = paths(slot);
1607
+ stamp_file.write_text_stamp(target.brief, brief);
1608
+ stamp_file.remove_stamp(target.findings);
1609
+ }
1610
+ offer_pair(code);
1611
+ const result = await run_sessions(
1612
+ effective_round === ROUND_TWO ? run_ship_review.verification_prompt : prompt_of,
1613
+ issue,
1614
+ effective_round,
1615
+ briefs.map(({ slot }) => slot)
1616
+ );
1617
+ await record_pair(issue, code);
1618
+ return result;
1619
+ }
1620
+ async function attest_phase() {
1621
+ return tagged(CAUSE2.ATTEST, await josh(ATTEST_CHECK));
1622
+ }
1623
+ function reviewed_together(opens, prompt_of, issue, round) {
1624
+ const printed = /* @__PURE__ */ new Map();
1625
+ function briefs() {
1626
+ return opens.map(({ slot }) => ({ brief: printed.get(slot) ?? "", slot }));
1627
+ }
1628
+ return [
1629
+ ...opens.map(({ open, slot }) => async () => {
1630
+ const result = await josh(open);
1631
+ printed.set(slot, result.out);
1632
+ return tagged(CAUSE2.CHECK, result);
1633
+ }),
1634
+ async () => await launch_reviewers(briefs(), prompt_of, issue, round)
1635
+ ];
1636
+ }
1637
+ function reviewed(open, prompt_of, issue, round) {
1638
+ return reviewed_together([{ open, slot: CODE2 }], prompt_of, issue, round);
1639
+ }
1640
+ var run_ship_reviewer = {
1641
+ attest_phase,
1642
+ current_verdict,
1643
+ failure,
1644
+ josh,
1645
+ note: note3,
1646
+ paths,
1647
+ reviewed,
1648
+ reviewed_together,
1649
+ ROUND_ONE,
1650
+ ROUND_TWO,
1651
+ SUCCESS_EXIT_CODE: SUCCESS_EXIT_CODE6,
1652
+ tagged,
1653
+ tagged_phase
1654
+ };
1655
+
1656
+ // scripts/run/ship/run-ship-review-steps.ts
1657
+ var RUN_REVIEW = "run:review";
1658
+ function round_two_decision(issue) {
1659
+ return ["review:round2", "--record", issue, "--json"];
1660
+ }
1661
+ var REVIEW_BRIEF = "review:brief";
1662
+ var ROUND_TWO_BRIEF = [REVIEW_BRIEF, "--round", "2"];
1663
+ var INTERACTION_FLAG = "--interaction";
1664
+ var INTERACTION_BRIEF = [REVIEW_BRIEF, INTERACTION_FLAG];
1665
+ var UNREADABLE_DECISION_NOTE = "review:round2 printed no decision josh ship can read:";
1666
+ var COMMENT_FLAG = "--comment";
1667
+ var FIXED_JOIN_NOTE = "the round-1 gate read the tree before the review fixes \u2014 drained, not judged; the gate re-runs once the tree is fixed.";
1668
+ var ROUND_TWO_SKIPPED_NOTE = "round 2 not due \u2014 nothing left to verify; shipping on.";
1669
+ var ROUND_ONE_RECORDED_NOTE = "round 1 already recorded \u2014 reused, not reviewed again; round 2 decides on the fix delta before the commit.";
1670
+ var { run_phases, scoped_pair } = run_ship_scoped;
1671
+ var { CAUSE: CAUSE3 } = run_ship_stop_cause;
1672
+ var { CODE: CODE3, INTERACTION } = review_attest.REVIEW_SLOT;
1673
+ var ROUND_ONE_OPENS = {
1674
+ code: [RUN_REVIEW, run_review.CODE_ONLY_FLAG],
1675
+ interaction: INTERACTION_BRIEF
1676
+ };
1677
+ var SLOT_RECORD_FLAGS = {
1678
+ code: [],
1679
+ interaction: [INTERACTION_FLAG]
1680
+ };
1681
+ var {
1682
+ attest_phase: attest_phase2,
1683
+ current_verdict: current_verdict2,
1684
+ failure: failure2,
1685
+ josh: josh2,
1686
+ note: note4,
1687
+ paths: paths2,
1688
+ reviewed: reviewed2,
1689
+ reviewed_together: reviewed_together2,
1690
+ ROUND_ONE: ROUND_ONE2,
1691
+ ROUND_TWO: ROUND_TWO2,
1692
+ SUCCESS_EXIT_CODE: SUCCESS_EXIT_CODE7,
1693
+ tagged: tagged2,
1694
+ tagged_phase: tagged_phase2
1695
+ } = run_ship_reviewer;
1696
+ function has_fixes(slots) {
1697
+ return slots.some(
1698
+ (slot) => run_ship_review.has_fixes(stamp_file.read_stamp_text(paths2(slot).findings))
1699
+ );
1700
+ }
1701
+ function is_drained(code, slots) {
1702
+ if (code === run_review.UNPINNED_EXIT_CODE) return false;
1703
+ return code === run_review.MOVED_EXIT_CODE || has_fixes(slots);
1704
+ }
1705
+ async function join_gate(slots) {
1706
+ const joined = await josh2([RUN_REVIEW, "--join"]);
1707
+ if (joined.code === SUCCESS_EXIT_CODE7 || !is_drained(joined.code, slots)) return joined;
1708
+ note4(FIXED_JOIN_NOTE);
1709
+ return { code: SUCCESS_EXIT_CODE7, out: joined.out };
1710
+ }
1711
+ function record_flags(round, outcome) {
1712
+ return round === ROUND_TWO2 && outcome.is_passing ? [COMMENT_FLAG] : [];
1713
+ }
1714
+ async function record_and_route(issue, round, outcome_of, slot = CODE3) {
1715
+ const verdict = current_verdict2(slot);
1716
+ if (verdict.kind === run_ship_review.VERDICT.INVALID) return failure2(verdict.note, CAUSE3.INFRA);
1717
+ const outcome = outcome_of(verdict);
1718
+ const flags = [...SLOT_RECORD_FLAGS[slot], ...record_flags(round, outcome)];
1719
+ const specs = run_ship_review.recorded_specs(verdict, outcome);
1720
+ const recorded2 = await josh2(["review:record", "--issue", issue, ...flags, ...specs]);
1721
+ if (recorded2.code !== SUCCESS_EXIT_CODE7) return tagged2(CAUSE3.CHECK, recorded2);
1722
+ review_stop_log.record({
1723
+ issue: Number(issue),
1724
+ stage: run_ship_stage.STAGE.REVIEW,
1725
+ findings: run_ship_review.passing_fixes(verdict, outcome),
1726
+ is_fixed: true
1727
+ });
1728
+ const out = [...verdict.report, outcome.note].join("\n");
1729
+ return outcome.is_passing ? { code: SUCCESS_EXIT_CODE7, out } : failure2(out, CAUSE3.FINDING);
1730
+ }
1731
+ async function is_fix_verified(slots) {
1732
+ const is_fixed = slots.some(
1733
+ (slot) => current_verdict2(slot).kind === run_ship_review.VERDICT.FIXED
1734
+ );
1735
+ if (!is_fixed) return true;
1736
+ const checked = await scoped_pair();
1737
+ return checked.code === SUCCESS_EXIT_CODE7;
1738
+ }
1739
+ function outcome_for_round(round, verdict) {
1740
+ return round === ROUND_TWO2 ? run_ship_review.round_two_outcome(verdict) : run_ship_review.round_one_outcome(verdict);
1741
+ }
1742
+ async function round_one_record(issue, slot, is_verified) {
1743
+ const round = slot === CODE3 ? review_round.from_brief(stamp_file.read_stamp_text(paths2(slot).brief) ?? "") : ROUND_ONE2;
1744
+ return await record_and_route(
1745
+ issue,
1746
+ round,
1747
+ (verdict) => is_verified ? outcome_for_round(round, verdict) : run_ship_review.UNVERIFIED_OUTCOME,
1748
+ slot
1749
+ );
1750
+ }
1751
+ function merged(results) {
1752
+ const out = results.map((result) => result.out).join("\n");
1753
+ const stopped3 = results.find((result) => result.code !== SUCCESS_EXIT_CODE7);
1754
+ return stopped3 === void 0 ? { code: SUCCESS_EXIT_CODE7, out } : { ...stopped3, out };
1755
+ }
1756
+ async function record_slots(issue, slots) {
1757
+ const is_verified = await is_fix_verified(slots);
1758
+ const results = [];
1759
+ for (const slot of slots) {
1760
+ const result = await round_one_record(issue, slot, is_verified);
1761
+ results.push(result);
1762
+ }
1763
+ return merged(results);
1764
+ }
1765
+ function skipped2(out) {
1766
+ return { code: SUCCESS_EXIT_CODE7, out, is_skipped: true };
1767
+ }
1768
+ async function record_outcome(issue, verdict, cause) {
1769
+ if (verdict === run_ship_review.VERDICT.INVALID || cause === CAUSE3.CHECK || review_round.from_brief(stamp_file.read_stamp_text(paths2(CODE3).brief) ?? "") === ROUND_TWO2) {
1770
+ return;
1771
+ }
1772
+ await lane_ledger_write.record_round_one({ issue: Number(issue), verdict });
1773
+ }
1774
+ function round_one_kind(slots) {
1775
+ const kinds = new Set(slots.map((slot) => current_verdict2(slot).kind));
1776
+ const { FIXED, INVALID } = run_ship_review.VERDICT;
1777
+ if (kinds.has(INVALID)) return INVALID;
1778
+ return kinds.has(FIXED) ? FIXED : current_verdict2().kind;
1779
+ }
1780
+ async function code_round_one_record(issue, slots) {
1781
+ const kind = round_one_kind(slots);
1782
+ const recorded2 = await record_slots(issue, slots);
1783
+ const is_stopped = recorded2.cause === CAUSE3.FINDING;
1784
+ review_reviewed_tree.mark_stopped(Number(issue), is_stopped);
1785
+ await record_outcome(issue, is_stopped ? run_ship_review.VERDICT.BLOCKING : kind, recorded2.cause);
1786
+ return recorded2;
1787
+ }
1788
+ function round_one_opens(slots, unpinned_ok) {
1789
+ return slots.map((slot) => ({
1790
+ open: slot === CODE3 ? [...ROUND_ONE_OPENS[slot], ...unpinned_ok] : ROUND_ONE_OPENS[slot],
1791
+ slot
1792
+ }));
1793
+ }
1794
+ async function reused_round(issue, reused2) {
1795
+ await record_outcome(issue, lane_ledger_write.ROUND_ONE_REUSED);
1796
+ return { ...skipped2(ROUND_ONE_RECORDED_NOTE), reason: run_ship_review_reason.reused(reused2) };
1797
+ }
1798
+ async function round_one_stage(issue, is_stale, slots, unpinned_ok) {
1799
+ const reused2 = await review_round_reuse.answer(Number(issue), is_stale);
1800
+ if (reused2.reuse !== review_round_reuse.REUSE.AGAIN) return await reused_round(issue, reused2);
1801
+ if (is_stale) review_reviewed_tree.discard();
1802
+ const opens = round_one_opens(slots, unpinned_ok);
1803
+ const provider = reviewed_together2(opens, run_ship_review.reviewer_prompt, issue, ROUND_ONE2);
1804
+ const ran2 = await run_ship_review_checkpoint.run(
1805
+ issue,
1806
+ `one-${slots.join("-")}`,
1807
+ [
1808
+ ["scoped", tagged_phase2(CAUSE3.CHECK, scoped_pair)],
1809
+ ["provider", async () => await run_phases(provider)],
1810
+ ["gate", tagged_phase2(CAUSE3.CHECK, async () => await join_gate(slots))],
1811
+ ["attest", attest_phase2],
1812
+ ["record", async () => await code_round_one_record(issue, slots)]
1813
+ ],
1814
+ is_stale
1815
+ );
1816
+ return { ...ran2, reason: run_ship_review_reason.ran(reused2) };
1817
+ }
1818
+ async function interaction_stage(issue) {
1819
+ const opens = [{ open: INTERACTION_BRIEF, slot: INTERACTION }];
1820
+ const provider = reviewed_together2(opens, run_ship_review.reviewer_prompt, issue, ROUND_ONE2);
1821
+ return await run_ship_review_checkpoint.run(
1822
+ issue,
1823
+ "interaction",
1824
+ [
1825
+ ["scoped", tagged_phase2(CAUSE3.CHECK, scoped_pair)],
1826
+ ["provider", async () => await run_phases(provider)],
1827
+ ["attest", attest_phase2],
1828
+ ["record", async () => await record_slots(issue, [INTERACTION])]
1829
+ ],
1830
+ await review_round_reuse.is_stale_here()
1831
+ );
1832
+ }
1833
+ async function due_slots(issue) {
1834
+ return review_interaction.round_one_slots(await review_interaction.status(Number(issue)));
1835
+ }
1836
+ async function is_interaction_due(issue) {
1837
+ const slots = await due_slots(issue);
1838
+ return slots.includes(INTERACTION);
1839
+ }
1840
+ async function is_interaction_owed(issue, first) {
1841
+ if (first.code !== SUCCESS_EXIT_CODE7) return false;
1842
+ return await is_interaction_due(issue);
1843
+ }
1844
+ function after_interaction(first, second) {
1845
+ const out = [first.out, second.out].join("\n");
1846
+ const { reason } = first;
1847
+ return { code: SUCCESS_EXIT_CODE7, out, ...reason !== void 0 && { reason } };
1848
+ }
1849
+ async function review_stage(issue, is_stale = false, unpinned_ok = []) {
1850
+ const slots = await due_slots(issue);
1851
+ const first = await round_one_stage(issue, is_stale, slots, unpinned_ok);
1852
+ if (!await is_interaction_owed(issue, first)) return first;
1853
+ const second = await interaction_stage(issue);
1854
+ if (second.code !== SUCCESS_EXIT_CODE7) return second;
1855
+ return after_interaction(first, second);
1856
+ }
1857
+ async function reviewed_round_two(issue) {
1858
+ const provider = reviewed2(ROUND_TWO_BRIEF, run_ship_review.verification_prompt, issue, ROUND_TWO2);
1859
+ return await run_ship_review_checkpoint.run(
1860
+ issue,
1861
+ "two",
1862
+ [
1863
+ ["scoped", tagged_phase2(CAUSE3.CHECK, scoped_pair)],
1864
+ ["provider", async () => await run_phases(provider)],
1865
+ ["attest", attest_phase2],
1866
+ [
1867
+ "record",
1868
+ async () => await record_and_route(issue, ROUND_TWO2, run_ship_review.round_two_outcome)
1869
+ ]
1870
+ ],
1871
+ await review_round_reuse.is_stale_here()
1872
+ );
1873
+ }
1874
+ async function execute_round_two_stage(issue) {
1875
+ const decision = await josh2(round_two_decision(issue));
1876
+ if (decision.code !== SUCCESS_EXIT_CODE7) return tagged2(CAUSE3.CHECK, decision);
1877
+ const answer = review_round2.parse_json(decision.out);
1878
+ if (answer === void 0) {
1879
+ return failure2(`${UNREADABLE_DECISION_NOTE}
1880
+ ${decision.out}`, CAUSE3.CHECK);
1881
+ }
1882
+ note4(answer.reason);
1883
+ await lane_ledger_write.record_round_two({
1884
+ issue: Number(issue),
1885
+ verdict: answer.verdict,
1886
+ code: answer.code
1887
+ });
1888
+ if (answer.verdict !== review_round2.REQUIRED_VERDICT) {
1889
+ return skipped2(`${answer.verdict}
1890
+ ${ROUND_TWO_SKIPPED_NOTE}`);
1891
+ }
1892
+ return await reviewed_round_two(issue);
1893
+ }
1894
+ async function round_two_stage(issue) {
1895
+ return await run_ship_final_review.run(issue, async () => await execute_round_two_stage(issue));
1896
+ }
1897
+ var run_ship_review_steps = { review_stage, round_two_stage };
1898
+
1899
+ // scripts/gh/git-gh-code-scanning.ts
1900
+ import { z } from "zod";
1901
+ var ALERT_NOTE = "code scanning alerts in the pull request\u2019s own files (a merge does not clear them):";
1902
+ var location_schema = z.looseObject({ path: z.string(), start_line: z.number() });
1903
+ var alert_schema = z.looseObject({
1904
+ rule: z.looseObject({ id: z.string() }),
1905
+ most_recent_instance: z.looseObject({ location: location_schema })
1906
+ });
1907
+ var file_schema = z.looseObject({ filename: z.string() });
1908
+ async function read_listing(path2, schema) {
1909
+ const raw_json = await git_gh_exec.exec_gh_api({ path: path2, should_paginate: true });
1910
+ return json_value.parse_with(raw_json, schema.array());
1911
+ }
1912
+ async function read_alerts(pr_number) {
1913
+ const query = `${FULL_PAGE_QUERY}&state=open&ref=refs/pull/${String(pr_number)}/merge`;
1914
+ const path2 = `${git_gh_api_path.code_scanning_alerts_api_path()}${query}`;
1915
+ const alerts = await read_listing(path2, alert_schema);
1916
+ return alerts?.map(({ rule, most_recent_instance: { location } }) => ({
1917
+ rule: rule.id,
1918
+ path: location.path,
1919
+ line: location.start_line
1920
+ }));
1921
+ }
1922
+ async function read_files(pr_number) {
1923
+ const path2 = `${git_gh_api_path.pull_files_api_path(String(pr_number))}${FULL_PAGE_QUERY}`;
1924
+ const files = await read_listing(path2, file_schema);
1925
+ return files === void 0 ? void 0 : new Set(files.map((file) => file.filename));
1926
+ }
1927
+ async function read_own_alerts(pr_number) {
1928
+ const [alerts, files] = await Promise.all([read_alerts(pr_number), read_files(pr_number)]);
1929
+ if (alerts === void 0 || files === void 0) return void 0;
1930
+ return alerts.filter((alert) => files.has(alert.path));
1931
+ }
1932
+ async function own_alerts_note(pr_number) {
1933
+ try {
1934
+ const alerts = await read_own_alerts(pr_number);
1935
+ if (alerts === void 0 || alerts.length === 0) return void 0;
1936
+ return [
1937
+ ALERT_NOTE,
1938
+ ...alerts.map((alert) => ` ${alert.rule} \u2014 ${alert.path}:${String(alert.line)}`)
1939
+ ].join("\n");
1940
+ } catch {
1941
+ return void 0;
1942
+ }
1943
+ }
1944
+ var git_gh_code_scanning = { ALERT_NOTE, own_alerts_note };
1945
+
1946
+ // scripts/run/ship/run-ship-overlap.ts
1947
+ var WAIT_INTERVAL_MS = 3e4;
1948
+ var MAX_WAIT_ATTEMPTS = 60;
1949
+ var NAME_ONLY_ARGUMENTS = [
1950
+ "-c",
1951
+ "core.quotePath=false",
1952
+ "diff",
1953
+ "--name-only",
1954
+ "--no-relative",
1955
+ "--no-renames"
1956
+ ];
1957
+ var REGENERATED_PATHS = new Set(
1958
+ main_merge_regenerate.RESOLVED_FILES.filter((entry) => "command" in entry).map(
1959
+ (entry) => entry.path
1960
+ )
1961
+ );
1962
+ function to_paths(raw) {
1963
+ return changed_paths.to_paths(raw);
1964
+ }
1965
+ async function has_upstream(directory) {
1966
+ try {
1967
+ await git_spawn.read(["-C", directory, "rev-parse", "--verify", "--quiet", "@{upstream}"]);
1968
+ return true;
1969
+ } catch {
1970
+ return false;
1971
+ }
1972
+ }
1973
+ async function lane_paths(directory) {
1974
+ const base = await git_diff_reads.default_branch_reference();
1975
+ try {
1976
+ return to_paths(
1977
+ await git_spawn.read(["-C", directory, ...NAME_ONLY_ARGUMENTS, `${base}...HEAD`, "--"])
1978
+ );
1979
+ } catch {
1980
+ return [];
1981
+ }
1982
+ }
1983
+ function own_launch(issue) {
1984
+ const since = lane_handoff.ship_running_since(issue, process.cwd());
1985
+ return { issue, since: since ?? Infinity };
1986
+ }
1987
+ function is_launched_before(lane, own) {
1988
+ const since = lane_handoff.ship_running_since(lane.issue, lane.directory);
1989
+ if (since === void 0) return false;
1990
+ return since < own.since || since === own.since && Number(lane.issue) < Number(own.issue);
1991
+ }
1992
+ async function is_open_ship(lane, own) {
1993
+ if (!is_launched_before(lane, own)) return false;
1994
+ return await has_upstream(lane.directory);
1995
+ }
1996
+ async function lane_head(directory) {
1997
+ try {
1998
+ return await git_spawn.read(["-C", directory, "rev-parse", "HEAD"]);
1999
+ } catch {
2000
+ return void 0;
2001
+ }
2002
+ }
2003
+ async function conflicting_paths(lane, shared) {
2004
+ const theirs = await lane_head(lane.directory);
2005
+ const conflicted = theirs === void 0 ? void 0 : git_merge_conflicts.working_tree_conflicts(theirs, shared, process.cwd());
2006
+ return (conflicted ?? shared).filter((file_path) => !REGENERATED_PATHS.has(file_path));
2007
+ }
2008
+ async function shared_paths(lane, launch, own) {
2009
+ if (!await is_open_ship(lane, launch)) return [];
2010
+ const paths3 = await lane_paths(lane.directory);
2011
+ const shared = paths3.filter((file_path) => own.has(file_path));
2012
+ if (shared.length === 0) return [];
2013
+ return await conflicting_paths(lane, shared);
2014
+ }
2015
+ async function other_lanes(issue) {
2016
+ const lanes = await lane_registry.list_lanes();
2017
+ return lanes.filter((lane) => lane.issue !== issue && !lane.is_stranded);
2018
+ }
2019
+ async function find_overlap(issue) {
2020
+ const own = new Set(await changed_paths.read_changed_paths(false));
2021
+ const launch = own_launch(issue);
2022
+ const others = await other_lanes(issue);
2023
+ const shared = await Promise.all(
2024
+ others.map(async (lane) => await shared_paths(lane, launch, own))
2025
+ );
2026
+ return {
2027
+ lanes: others.filter((_lane, index) => (shared[index] ?? []).length > 0),
2028
+ paths: [...new Set(shared.flat())].toSorted((left, right) => left.localeCompare(right))
2029
+ };
2030
+ }
2031
+ async function read_overlap(issue) {
2032
+ try {
2033
+ return await find_overlap(issue);
2034
+ } catch {
2035
+ return { lanes: [], paths: [] };
2036
+ }
2037
+ }
2038
+ function is_settled(lanes) {
2039
+ return lanes.every((lane) => !lane_handoff.is_ship_running(lane.issue, lane.directory));
2040
+ }
2041
+ async function wait_for(lanes, options) {
2042
+ return await poll.poll_until(async () => is_settled(lanes), {
2043
+ attempts: MAX_WAIT_ATTEMPTS,
2044
+ interval_ms: WAIT_INTERVAL_MS,
2045
+ sleeper: options.sleeper ?? poll.sleep
2046
+ });
2047
+ }
2048
+ async function await_overlap(issue, options = {}) {
2049
+ const overlap = await read_overlap(issue);
2050
+ if (overlap.lanes.length === 0) return void 0;
2051
+ const started = Date.now();
2052
+ const is_cleared = await wait_for(overlap.lanes, options);
2053
+ const lanes = overlap.lanes.map((lane) => Number(lane.issue));
2054
+ const waited_ms = Date.now() - started;
2055
+ const record2 = { issue: Number(issue), lanes, paths: [...overlap.paths], waited_ms, is_cleared };
2056
+ await lane_ledger_write.record_overlap(record2, options.ledger);
2057
+ return record2;
2058
+ }
2059
+ function note5(record2) {
2060
+ if (record2 === void 0) return "";
2061
+ const lanes = record2.lanes.map((lane) => session_cite.issue(lane)).join(", ");
2062
+ const outcome = record2.is_cleared ? "waited for" : "gave up waiting for";
2063
+ return `${outcome} ${lanes}, whose open pull requests conflict on: ${record2.paths.join(", ")}`;
2064
+ }
2065
+ var run_ship_overlap = { MAX_WAIT_ATTEMPTS, await_overlap, note: note5 };
2066
+
2067
+ // scripts/run/ship/run-ship-sync.ts
2068
+ var { STEP, timed } = run_ship_lap;
2069
+ var should_forward_stderr2 = true;
2070
+ var SUCCESS_EXIT_CODE8 = 0;
2071
+ var FAILURE_EXIT_CODE4 = 1;
2072
+ var MAX_MERGE_RETRIES = 2;
2073
+ var CONFLICT_NOTE2 = "merging the default branch left unmerged paths:";
2074
+ var DEFERRED_PREFIX = "merge deferred to the followup: ";
2075
+ var CURRENT_SUFFIX = " brings nothing in";
2076
+ var MERGED_PREFIX = "merged ";
2077
+ var MERGED_GATE_NOTE = "the default branch moved since the sync; the tree merged with it fails the gate:";
2078
+ var PUSHED_NOTE = "pushed the merge ahead of the gate, so CI runs beside it";
2079
+ var PUSH_FAILED_NOTE = "the push ahead of the gate failed; the commit stage pushes after the gate:";
2080
+ var PAIR_RED_NOTE = "the scoped pair is red on the merged tree; the commit stage pushes after the gate";
2081
+ var LEFT_TO_CI_NOTE = "the default branch moved since the sync without a conflict \u2014 not merged again; the pull request CI checks the merge ref";
2082
+ var MERGED_AGAIN_NOTE = "followup: the default branch moved under the failed checks \u2014 merged it again; gating and pushing the merged tree, no re-ship";
2083
+ function push_argv(title) {
2084
+ return ["git", "-y", "--skip-commit", "--skip-pr", title];
2085
+ }
2086
+ async function josh3(argv) {
2087
+ return await josh_command.josh_run(argv, should_forward_stderr2);
2088
+ }
2089
+ async function merge_outcome() {
2090
+ try {
2091
+ return await timed(STEP.MERGE, async () => await main_merge.merge());
2092
+ } catch (error) {
2093
+ return { kind: "refused", message: error_text.message_of(error) };
2094
+ }
2095
+ }
2096
+ function conflict_result(files, lead) {
2097
+ const out = [lead, CONFLICT_NOTE2, ...files].filter((line) => line !== "").join("\n");
2098
+ return { code: FAILURE_EXIT_CODE4, out, conflicts: files };
2099
+ }
2100
+ function sync_note(outcome) {
2101
+ if (outcome.kind === "refused") return `${DEFERRED_PREFIX}${outcome.message}`;
2102
+ return outcome.kind === "current" ? `${outcome.branch}${CURRENT_SUFFIX}` : `${MERGED_PREFIX}${outcome.branch}`;
2103
+ }
2104
+ async function commit_locally(title, is_dirty) {
2105
+ if (!is_dirty) return void 0;
2106
+ const commit = await timed(
2107
+ STEP.LOCAL_COMMIT,
2108
+ async () => await josh_command.josh_run(
2109
+ ["git", "-y", "--skip-push", "--skip-pr", title],
2110
+ should_forward_stderr2,
2111
+ void 0,
2112
+ { [pre_commit_lint_switch.SWITCH_ENV_KEY]: "off" }
2113
+ )
2114
+ );
2115
+ return commit.code === SUCCESS_EXIT_CODE8 ? void 0 : commit;
2116
+ }
2117
+ async function push_ahead(title) {
2118
+ const pair = await run_ship_scoped.scoped_pair();
2119
+ if (pair.code !== SUCCESS_EXIT_CODE8) return PAIR_RED_NOTE;
2120
+ const push2 = await timed(
2121
+ STEP.PUSH,
2122
+ async () => await josh_command.josh_run(push_argv(title), should_forward_stderr2, void 0, {
2123
+ [pre_push_related_switch.SWITCH_ENV_KEY]: pre_push_related_switch.SWITCH_ON
2124
+ })
2125
+ );
2126
+ return push2.code === SUCCESS_EXIT_CODE8 ? PUSHED_NOTE : [PUSH_FAILED_NOTE, push2.out].join("\n");
2127
+ }
2128
+ async function open_pull_number() {
2129
+ try {
2130
+ return await git_gh_pr_read.pr_get_number(await git_command.branch());
2131
+ } catch {
2132
+ return void 0;
2133
+ }
2134
+ }
2135
+ async function pushed_note(outcome, title) {
2136
+ if (outcome.kind !== "merged" || await open_pull_number() === void 0) return "";
2137
+ return await push_ahead(title);
2138
+ }
2139
+ async function waited_note(issue) {
2140
+ const overlap = await timed(
2141
+ STEP.OVERLAP_WAIT,
2142
+ async () => await run_ship_overlap.await_overlap(issue)
2143
+ );
2144
+ return run_ship_overlap.note(overlap);
2145
+ }
2146
+ async function sync_stage(issue, title, is_dirty) {
2147
+ const waited = await waited_note(issue);
2148
+ const failed_commit = await commit_locally(title, is_dirty);
2149
+ if (failed_commit !== void 0) {
2150
+ const out2 = [waited, failed_commit.out].filter((line) => line !== "").join("\n");
2151
+ return { ...failed_commit, out: out2 };
2152
+ }
2153
+ const outcome = await merge_outcome();
2154
+ if (outcome.kind === "conflict") return conflict_result(outcome.files, waited);
2155
+ const pushed = await pushed_note(outcome, title);
2156
+ const out = [waited, sync_note(outcome), pushed].filter((line) => line !== "").join("\n");
2157
+ return { code: SUCCESS_EXIT_CODE8, out };
2158
+ }
2159
+ async function gate_merged() {
2160
+ const gate = await run_ship_scoped.scoped_gate();
2161
+ if (gate.code === SUCCESS_EXIT_CODE8) return void 0;
2162
+ const out = [MERGED_GATE_NOTE, gate.out].filter((line) => line !== "").join("\n");
2163
+ return { ...gate, out, cause: run_ship_stop_cause.CAUSE.CHECK };
2164
+ }
2165
+ async function is_behind_default() {
2166
+ try {
2167
+ const default_branch = await git_command.get_default_branch();
2168
+ return await git_command.commit_count_beyond("HEAD", `origin/${default_branch}`) > 0;
2169
+ } catch {
2170
+ return true;
2171
+ }
2172
+ }
2173
+ async function is_merge_left_to_ci() {
2174
+ const conflicts = await run_ship_conflict_probe.read_conflicts();
2175
+ if (conflicts?.length !== 0) return false;
2176
+ if (await is_behind_default()) console.error(LEFT_TO_CI_NOTE);
2177
+ return true;
2178
+ }
2179
+ async function merge_and_gate(is_green) {
2180
+ const outcome = await merge_outcome();
2181
+ if (outcome.kind === "conflict") return conflict_result(outcome.files, "");
2182
+ if (is_green && outcome.kind !== "merged") return void 0;
2183
+ return await gate_merged();
2184
+ }
2185
+ async function catch_up() {
2186
+ const is_green = await run_ship_scoped.is_gate_green();
2187
+ if (is_green && await is_merge_left_to_ci()) return void 0;
2188
+ return await merge_and_gate(is_green);
2189
+ }
2190
+ async function push_merged(title) {
2191
+ const gate = await gate_merged();
2192
+ if (gate !== void 0) return gate;
2193
+ const push2 = await josh3(push_argv(title));
2194
+ return push2.code === SUCCESS_EXIT_CODE8 ? void 0 : push2;
2195
+ }
2196
+ var MERGE_FIXABLE_REASONS = [FAILURE_REASON_CHECKS, FAILURE_REASON_CONFLICT];
2197
+ function names_merge_fixable(text) {
2198
+ if (text?.includes(FAILURE_MESSAGE_PREFIX) !== true) return false;
2199
+ return MERGE_FIXABLE_REASONS.some((reason) => text.includes(reason));
2200
+ }
2201
+ function is_checks_failure(failed) {
2202
+ return [failed.out, failed.err].some((text) => names_merge_fixable(text));
2203
+ }
2204
+ var CODE_SCANNING_CHECK = "CodeQL";
2205
+ function names_code_scanning_red(text) {
2206
+ return text?.split(`${FAILURE_REASON_CHECKS}: `)[1]?.includes(CODE_SCANNING_CHECK) === true;
2207
+ }
2208
+ async function own_alerts_stop(failed) {
2209
+ if ([failed.out, failed.err].every((text) => !names_code_scanning_red(text))) return void 0;
2210
+ const pr_number = await open_pull_number();
2211
+ const note6 = pr_number === void 0 ? void 0 : await git_gh_code_scanning.own_alerts_note(pr_number);
2212
+ if (note6 === void 0) return void 0;
2213
+ return { ...failed, out: [failed.out, note6].join("\n"), cause: run_ship_stop_cause.CAUSE.CHECK };
2214
+ }
2215
+ async function merge_again(title, failed) {
2216
+ if (!is_checks_failure(failed)) return failed;
2217
+ const alerts = await own_alerts_stop(failed);
2218
+ if (alerts !== void 0) return alerts;
2219
+ const outcome = await merge_outcome();
2220
+ if (outcome.kind === "conflict") return conflict_result(outcome.files, failed.out);
2221
+ if (outcome.kind !== "merged") return failed;
2222
+ console.error(MERGED_AGAIN_NOTE);
2223
+ return await push_merged(title);
2224
+ }
2225
+ function ignore_wait() {
2226
+ }
2227
+ async function marked_followup(title, notify, mark2) {
2228
+ mark2(true);
2229
+ try {
2230
+ return await josh_command.josh_run(
2231
+ ["followup", title, ...notify],
2232
+ should_forward_stderr2,
2233
+ void 0,
2234
+ followup_ship_environment.SHIPPED_ENVIRONMENT
2235
+ );
2236
+ } finally {
2237
+ mark2(false);
2238
+ }
2239
+ }
2240
+ async function followup_attempt(title, notify, mark2, retries) {
2241
+ const result = await marked_followup(title, notify, mark2);
2242
+ if (result.code === SUCCESS_EXIT_CODE8 || retries >= MAX_MERGE_RETRIES) return result;
2243
+ const stop = await merge_again(title, result);
2244
+ return stop ?? await followup_attempt(title, notify, mark2, retries + 1);
2245
+ }
2246
+ async function followup_stage(title, notify, mark2 = ignore_wait) {
2247
+ return await followup_attempt(title, notify, mark2, 0);
2248
+ }
2249
+ var run_ship_sync = {
2250
+ CONFLICT_NOTE: CONFLICT_NOTE2,
2251
+ LEFT_TO_CI_NOTE,
2252
+ MAX_MERGE_RETRIES,
2253
+ MERGED_AGAIN_NOTE,
2254
+ MERGED_GATE_NOTE,
2255
+ PAIR_RED_NOTE,
2256
+ PUSHED_NOTE,
2257
+ PUSH_FAILED_NOTE,
2258
+ catch_up,
2259
+ followup_stage,
2260
+ sync_stage
2261
+ };
2262
+
2263
+ // scripts/run/ship/run-ship-steps.ts
2264
+ var should_forward_stderr3 = true;
2265
+ var SUCCESS_EXIT_CODE9 = 0;
2266
+ var { STAGE: STAGE2 } = run_ship_stage;
2267
+ async function josh4(argv) {
2268
+ return await josh_command.josh_run(argv, should_forward_stderr3);
2269
+ }
2270
+ var PREFLIGHT_STEP = {
2271
+ stage: STAGE2.PREFLIGHT,
2272
+ header: run_ship.PREFLIGHT_HEADER,
2273
+ run: async (args) => await run_ship_preflight.stage({ title: args.title, body_path: args.body_path })
2274
+ };
2275
+ async function gate_stage(args) {
2276
+ const is_skipped = await run_ship_scoped.is_gate_green();
2277
+ const result = await run_ship_scoped.scoped_gate();
2278
+ if (args.is_review && result.code === SUCCESS_EXIT_CODE9) await run_ship_early_push.push(args);
2279
+ return { ...result, is_skipped };
2280
+ }
2281
+ var SYNC_STEP = {
2282
+ stage: STAGE2.SYNC,
2283
+ header: run_ship.SYNC_HEADER,
2284
+ run: async (args, state) => await run_ship_sync.sync_stage(args.number, args.title, state.is_dirty === true)
2285
+ };
2286
+ async function commit_stage(args, state) {
2287
+ const stop = run_ship_stage.is_shipped(state) ? void 0 : await run_ship_sync.catch_up();
2288
+ if (stop !== void 0) return stop;
2289
+ const argv = ["git", "-y", ...run_ship_stage.commit_flags(state), ...args.body, args.title];
2290
+ const { STEP: STEP2 } = run_ship_lap;
2291
+ const environment = {
2292
+ ...core_priority.PRIORITY_ENVIRONMENT,
2293
+ ...run_ship_lap.environment(STEP2.COMMIT)
2294
+ };
2295
+ return await run_ship_lap.timed(
2296
+ STEP2.COMMIT,
2297
+ async () => await josh_command.josh_run(argv, should_forward_stderr3, void 0, environment)
2298
+ );
2299
+ }
2300
+ var COMMIT_STEPS = [
2301
+ {
2302
+ stage: STAGE2.GATE,
2303
+ header: run_ship.GATE_HEADER,
2304
+ run: async (args) => await gate_stage(args)
2305
+ },
2306
+ {
2307
+ stage: STAGE2.COMMIT,
2308
+ header: run_ship.COMMIT_HEADER,
2309
+ run: async (args, state) => await commit_stage(args, state)
2310
+ }
2311
+ ];
2312
+ function wait_mark(target) {
2313
+ return function mark2(is_merge_waiting) {
2314
+ if (target === void 0) return;
2315
+ try {
2316
+ run_ship_stage.mark_merge_waiting(target, is_merge_waiting);
2317
+ } catch {
2318
+ }
2319
+ };
2320
+ }
2321
+ function freeing_mark(mark2) {
2322
+ if (!lane_child_marker.is_child_of(process.cwd())) return mark2;
2323
+ return function mark_freeing(is_merge_waiting) {
2324
+ mark2(is_merge_waiting);
2325
+ if (is_merge_waiting) void lane_hand_back_held.record();
2326
+ };
2327
+ }
2328
+ async function remove_run_records(issue_number) {
2329
+ await run_ship_body_draft.remove(issue_number);
2330
+ await run_investigation_record.remove(issue_number);
2331
+ }
2332
+ async function followup_stage2(args) {
2333
+ const mark2 = freeing_mark(wait_mark(await run_ship_probe.record_target(args.number)));
2334
+ const result = await run_ship_sync.followup_stage(args.title, args.notify, mark2);
2335
+ if (result.code === SUCCESS_EXIT_CODE9) await remove_run_records(args.number);
2336
+ return result;
2337
+ }
2338
+ var MERGE_STEPS = [
2339
+ {
2340
+ stage: STAGE2.FOLLOWUP,
2341
+ header: run_ship.FOLLOWUP_HEADER,
2342
+ run: async (args) => await followup_stage2(args)
2343
+ },
2344
+ {
2345
+ stage: STAGE2.REPORT,
2346
+ header: run_ship.REPORT_HEADER,
2347
+ run: async (args) => await josh4(["run:tail", args.number, ...args.cites])
2348
+ }
2349
+ ];
2350
+ var REVIEW_STEP = {
2351
+ stage: STAGE2.REVIEW,
2352
+ header: run_ship.REVIEW_HEADER,
2353
+ run: async (args, state) => await run_ship_review_steps.review_stage(
2354
+ args.number,
2355
+ state.is_review_stale === true,
2356
+ args.unpinned_ok
2357
+ )
2358
+ };
2359
+ var ROUND_TWO_STEP = {
2360
+ stage: STAGE2.ROUND_TWO,
2361
+ header: run_ship.ROUND_TWO_HEADER,
2362
+ run: async (args) => await run_ship_review_steps.round_two_stage(args.number)
2363
+ };
2364
+ function steps(args) {
2365
+ if (!args.is_review) return [PREFLIGHT_STEP, SYNC_STEP, ...COMMIT_STEPS, ...MERGE_STEPS];
2366
+ const reviewed_commit = COMMIT_STEPS.map(
2367
+ (step) => step.stage === STAGE2.GATE ? { ...step, beside: ROUND_TWO_STEP } : step
2368
+ );
2369
+ return [PREFLIGHT_STEP, SYNC_STEP, REVIEW_STEP, ...reviewed_commit, ...MERGE_STEPS];
2370
+ }
2371
+ var run_ship_steps = { PREFLIGHT_STEP, steps };
2372
+
2373
+ // scripts/run/ship/run-ship-supervised.ts
2374
+ var SUCCESS_EXIT_CODE10 = 0;
2375
+ async function supervised_repository() {
2376
+ return run_ship_detach.is_supervised() ? await run_ship_probe.repository_directory() : void 0;
2377
+ }
2378
+ async function claim_identity(args) {
2379
+ const repository = await supervised_repository();
2380
+ if (repository !== void 0) await run_ship_detach.claim_identity(repository, args.number);
2381
+ }
2382
+ async function record_result(args, sections) {
2383
+ const repository = await supervised_repository();
2384
+ if (repository === void 0) return;
2385
+ await run_ship_detach.mark_result(repository, args.number, run_ship.exit_code(sections));
2386
+ }
2387
+ function print_section() {
2388
+ return run_ship_detach.is_supervised() ? SUCCESS_EXIT_CODE10 : run_step_section.print_once("ship");
2389
+ }
2390
+ var run_ship_supervised = { claim_identity, print_section, record_result };
2391
+
2392
+ // scripts/run/ship/run-ship-cli.ts
2393
+ var __josh_meta2 = import.meta;
2394
+ var __josh_source_url2 = new URL("../../scripts/run/ship/run-ship-cli.ts", __josh_meta2.url).href;
2395
+ var __josh_source_filename2 = __josh_file_path2(__josh_source_url2);
2396
+ var __josh_source_dirname2 = __josh_dirname2(__josh_source_filename2);
2397
+ var ARGV_OFFSET = 2;
2398
+ var SUCCESS_EXIT_CODE11 = 0;
2399
+ var FAILURE_EXIT_CODE5 = 1;
2400
+ var USAGE = 'Usage: josh ship "<title> #<N>" [<follow-up-N> ...] [--cite <N> ...] [--review [--unpinned-ok "<reason>"]] [--detach] [--body-file <path>] [--notify-message <text> | --notify-message-file <path>] | josh ship --log <N>';
2401
+ var NO_LOG_NOTE = "no detached ship supervisor log for this issue";
2402
+ var LANE_CHILD_DETACH_NOTE = "lane child: shipping through the detached supervisor (--detach implied), so the end of this turn cannot kill it";
2403
+ var { PHASE: PHASE3, STAGE: STAGE3 } = run_ship_stage;
2404
+ var REREAD_AFTER = /* @__PURE__ */ new Set([STAGE3.SYNC, STAGE3.REVIEW]);
2405
+ async function record_timed(step, issue, elapsed_ms) {
2406
+ await lane_ledger_write.record_stage({ stage: step.stage, elapsed_ms, issue: Number(issue) });
2407
+ }
2408
+ async function run_once(step, args, state) {
2409
+ const started_ms = performance.now();
2410
+ const result = await run_ship_lap.within(
2411
+ args.number,
2412
+ step.stage,
2413
+ async () => await step.run(args, state)
2414
+ );
2415
+ const elapsed_ms = performance.now() - started_ms;
2416
+ if (result.is_skipped !== true) await record_timed(step, args.number, elapsed_ms);
2417
+ return run_ship.section_of(step.header, result);
2418
+ }
2419
+ async function run_step(step, args, state) {
2420
+ const first = [state];
2421
+ return await run_ship_infra_retry.retried(step.stage, async () => {
2422
+ const current = first.pop() ?? await run_ship_probe.read_state();
2423
+ return await run_once(step, args, current);
2424
+ });
2425
+ }
2426
+ async function emit_phase2(args, context, mark2) {
2427
+ const text = run_ship_stage.event_text(args.number, mark2.stage, mark2.phase, context.started);
2428
+ await run_event_stream_emit.emit(
2429
+ run_event_stream.EVENT_KIND.SHIP_STAGE,
2430
+ run_ship_stage.with_reason(text, mark2.reason)
2431
+ );
2432
+ }
2433
+ function record(target, write) {
2434
+ if (target === void 0) return;
2435
+ try {
2436
+ write(target);
2437
+ } catch {
2438
+ }
2439
+ }
2440
+ async function settle(step, args, context, section) {
2441
+ const phase = run_ship_group.settled_phase(section);
2442
+ await emit_phase2(args, context, { stage: step.stage, phase, reason: section.reason });
2443
+ if (phase === PHASE3.FAILED) return;
2444
+ record(context.target, (path2) => {
2445
+ run_ship_stage.mark_done(path2, step.stage);
2446
+ });
2447
+ }
2448
+ function set_state(context, state) {
2449
+ context.state = state;
2450
+ }
2451
+ async function run_stage(step, args, context) {
2452
+ if (run_ship_stage.is_done(step.stage, context.done, context.state, args.body.length > 0)) {
2453
+ await emit_phase2(args, context, { stage: step.stage, phase: PHASE3.SKIPPED });
2454
+ return { header: step.header, body: run_ship.SKIPPED_BODY, code: SUCCESS_EXIT_CODE11 };
2455
+ }
2456
+ context.started.push(step.stage);
2457
+ record(context.target, (path2) => {
2458
+ run_ship_stage.mark_started(path2, step.stage);
2459
+ });
2460
+ await emit_phase2(args, context, { stage: step.stage, phase: PHASE3.START });
2461
+ const section = await run_step(step, args, context.state);
2462
+ await settle(step, args, context, section);
2463
+ if (REREAD_AFTER.has(step.stage)) set_state(context, await run_ship_probe.read_state());
2464
+ return section;
2465
+ }
2466
+ async function open_context(args) {
2467
+ const [target, state, is_stale] = await Promise.all([
2468
+ run_ship_probe.record_target(args.number),
2469
+ run_ship_probe.read_state(),
2470
+ run_ship_handover.watch()
2471
+ ]);
2472
+ const done = target === void 0 ? /* @__PURE__ */ new Set() : run_ship_stage.read_done(target);
2473
+ const started = target === void 0 ? [] : [...run_ship_stage.read_started(target)];
2474
+ record(target, (path2) => {
2475
+ run_ship_stage.clear_waits(path2);
2476
+ });
2477
+ return { target, done, state, started, is_stale };
2478
+ }
2479
+ async function record_stop(args, stage, failed) {
2480
+ const issue = Number(args.number);
2481
+ await lane_ledger_write.record_stop(
2482
+ await run_ship_reship.with_base(run_ship_stop_cause.record_of(issue, stage, failed))
2483
+ );
2484
+ review_stop_log.record({ issue, stage, findings: run_ship_stop_cause.details_of(stage, failed) });
2485
+ }
2486
+ async function stopped2(sections, args, step, context) {
2487
+ const failed = sections.at(-1);
2488
+ await record_stop(args, step.stage, failed);
2489
+ if (run_ship_detach.is_supervised()) {
2490
+ record(context.target, run_ship_stage.end_attempt);
2491
+ await run_ship_return.hand_back(args, step.stage, failed);
2492
+ }
2493
+ return sections;
2494
+ }
2495
+ async function ship_stage(step, args, context, sections) {
2496
+ const failed = await run_ship_group.run(
2497
+ step,
2498
+ async (current) => await run_stage(current, args, context),
2499
+ sections
2500
+ );
2501
+ if (failed !== void 0) {
2502
+ return { sections: await stopped2(sections, args, failed.step, context), is_handed_over: false };
2503
+ }
2504
+ set_state(context, await run_ship_early_push.refresh(step.stage, args.is_review, context.state));
2505
+ if (step.stage !== STAGE3.SYNC) return void 0;
2506
+ const handover = await run_ship_handover.hand_over(args, context.is_stale);
2507
+ return handover === void 0 ? void 0 : { sections: [...sections, handover], is_handed_over: true };
2508
+ }
2509
+ async function ship(args) {
2510
+ const context = await open_context(args);
2511
+ const sections = [];
2512
+ for (const step of run_ship_steps.steps(args)) {
2513
+ const outcome = await ship_stage(step, args, context, sections);
2514
+ if (outcome !== void 0) return outcome;
2515
+ }
2516
+ record(context.target, (path2) => {
2517
+ run_ship_stage.clear(path2);
2518
+ });
2519
+ return { sections, is_handed_over: false };
2520
+ }
2521
+ async function print_log(number) {
2522
+ const repository = await run_ship_probe.repository_directory();
2523
+ const log = repository === void 0 ? void 0 : run_ship_detach.read_log(repository, number);
2524
+ if (log === void 0) {
2525
+ console.error(NO_LOG_NOTE);
2526
+ return FAILURE_EXIT_CODE5;
2527
+ }
2528
+ console.info(log);
2529
+ return SUCCESS_EXIT_CODE11;
2530
+ }
2531
+ async function detach(args) {
2532
+ const repository = await run_ship_probe.repository_directory();
2533
+ if (repository === void 0) {
2534
+ console.info(run_ship_detach.FAILED);
2535
+ return FAILURE_EXIT_CODE5;
2536
+ }
2537
+ const result = await run_ship_detach.detach({ ...args, repository, cwd: process.cwd() });
2538
+ console.error(result.note);
2539
+ console.info(result.verdict);
2540
+ if (result.verdict !== run_ship_detach.LAUNCHED) return FAILURE_EXIT_CODE5;
2541
+ return await run_ship_detach_wait.after_launch(args.number);
2542
+ }
2543
+ function should_detach(args) {
2544
+ if (args.is_detach) return true;
2545
+ return !run_ship_detach.is_supervised() && lane_child_marker.is_child_of(process.cwd());
2546
+ }
2547
+ async function pre_detach_stop(args, stage, sections) {
2548
+ await record_stop(args, stage, sections[0]);
2549
+ return sections;
2550
+ }
2551
+ async function pre_detach_checks(args, preflight, checks_of) {
2552
+ const result = await checks_of(args);
2553
+ const checks3 = { header: run_ship.PRE_DETACH_HEADER, body: result.out, code: result.code };
2554
+ if (run_ship.exit_code([checks3, preflight]) !== SUCCESS_EXIT_CODE11) {
2555
+ await record_stop(args, STAGE3.PREFLIGHT, run_ship.with_checks(preflight, result));
2556
+ }
2557
+ return [checks3, preflight];
2558
+ }
2559
+ async function pre_detach_sections(args) {
2560
+ const preflight = await run_stage(run_ship_steps.PREFLIGHT_STEP, args, await open_context(args));
2561
+ if (preflight.preconditions?.includes(run_ship_preflight.SCOPED_PRECONDITION)) {
2562
+ return await pre_detach_stop(args, STAGE3.PREFLIGHT, [preflight]);
2563
+ }
2564
+ const conflict = await run_ship_conflict_probe.probe();
2565
+ if (conflict !== void 0) {
2566
+ return await pre_detach_stop(args, STAGE3.SYNC, [
2567
+ run_ship.section_of(run_ship.SYNC_HEADER, conflict),
2568
+ preflight
2569
+ ]);
2570
+ }
2571
+ return await pre_detach_checks(args, preflight, run_ship_pre_detach_pinned.timed_checks);
2572
+ }
2573
+ async function detach_after_preflight(args) {
2574
+ const sections = await run_ship_reship.is_due(args.number) ? await pre_detach_checks(
2575
+ args,
2576
+ await run_ship_reship.skipped(args.number),
2577
+ run_ship_reship.checks
2578
+ ) : await pre_detach_sections(args);
2579
+ const code = run_ship.exit_code(sections);
2580
+ if (code === SUCCESS_EXIT_CODE11) return await detach(args);
2581
+ console.info(run_ship.format_report(sections));
2582
+ return code;
2583
+ }
2584
+ async function run_ship_command(given) {
2585
+ const args = await run_ship_pre_detach_pinned.with_recorded_reason(given);
2586
+ if (should_detach(args)) {
2587
+ if (!args.is_detach) console.error(LANE_CHILD_DETACH_NOTE);
2588
+ return await detach_after_preflight(args);
2589
+ }
2590
+ await run_ship_supervised.claim_identity(args);
2591
+ const { sections, is_handed_over } = await ship(args);
2592
+ if (!is_handed_over) await run_ship_supervised.record_result(args, sections);
2593
+ console.info(run_ship.format_report(sections));
2594
+ return run_ship.exit_code(sections);
2595
+ }
2596
+ async function run_governed(args) {
2597
+ const printed = run_ship_supervised.print_section();
2598
+ return printed === SUCCESS_EXIT_CODE11 ? await run_ship_command(args) : printed;
2599
+ }
2600
+ async function run4(argv) {
2601
+ const command = run_ship_args.parse(argv);
2602
+ if (command === void 0) {
2603
+ console.error(USAGE);
2604
+ return FAILURE_EXIT_CODE5;
2605
+ }
2606
+ return command.kind === "log" ? await print_log(command.number) : await run_governed(await run_ship_body_draft.with_draft(command.args));
2607
+ }
2608
+ async function main(argv) {
2609
+ process.exitCode = await run4(argv);
2610
+ }
2611
+ var run_ship_cli = { run: run4 };
2612
+ if (process.argv[1] === fileURLToPath2(__josh_source_url2)) await main(process.argv.slice(ARGV_OFFSET));
2613
+ export {
2614
+ run_ship_cli
2615
+ };