@cleocode/cleo 2026.10.27 → 2026.11.1-canary.11

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 (356) hide show
  1. package/README.md +28 -365
  2. package/dist/.source-stamp.json +4 -0
  3. package/dist/cli/{adapter-ZIB3OAPD.js → adapter-JZET3CDA.js} +5 -5
  4. package/dist/cli/{add-TBJUMJW7.js → add-W23ZQJ2U.js} +5 -5
  5. package/dist/cli/{add-batch-GGKVPTS5.js → add-batch-MNLEUT24.js} +5 -5
  6. package/dist/cli/{admin-NGPG2LSO.js → admin-3NN6QIJE.js} +5 -5
  7. package/dist/cli/{admin-PEYBYMZN.js → admin-LOGL2TBY.js} +16 -6
  8. package/dist/cli/{adr-2XVNDYZ7.js → adr-QYUJRVHW.js} +5 -5
  9. package/dist/cli/{agent-B23GPWYM.js → agent-KKMNGKR2.js} +3 -548
  10. package/dist/cli/{agent-outputs-SZ45UZVC.js → agent-outputs-ZEKMONK2.js} +2 -2
  11. package/dist/cli/{analyze-A44RDCSX.js → analyze-VUEJUV24.js} +5 -5
  12. package/dist/cli/{archive-QQB6M2RF.js → archive-I2XT6DGU.js} +5 -5
  13. package/dist/cli/{archive-stats-K4YKKYQV.js → archive-stats-J5AMTF7W.js} +5 -5
  14. package/dist/cli/{attention-KAHDF6KD.js → attention-736TGLSO.js} +5 -5
  15. package/dist/cli/{audit-ALSFSHEI.js → audit-JTEHB556.js} +2 -2
  16. package/dist/cli/{auth-5L3XPCXL.js → auth-QNFL6SIX.js} +5 -5
  17. package/dist/cli/{backfill-5B2FWBIB.js → backfill-QCEV5ZJR.js} +2 -2
  18. package/dist/cli/{backup-IYFULQTM.js → backup-6D6Y7S4X.js} +39 -10
  19. package/dist/cli/{backup-inspect-SYI6JWYI.js → backup-inspect-YS4HJUFF.js} +3 -3
  20. package/dist/cli/{backup-recover-I64KKABA.js → backup-recover-6RRWTZUF.js} +3 -3
  21. package/dist/cli/{blockers-KYNJJKZQ.js → blockers-TXOHUIQZ.js} +5 -5
  22. package/dist/cli/{brain-3E6GWG33.js → brain-MPZZ73RR.js} +2 -2
  23. package/dist/cli/{briefing-J6PDDZ2C.js → briefing-HR7WKAP7.js} +5 -5
  24. package/dist/cli/{caamp-4GLHZPAB.js → caamp-6BHIZIRC.js} +2 -2
  25. package/dist/cli/{cancel-A4OCUVDI.js → cancel-RPBL7XNS.js} +16 -6
  26. package/dist/cli/{canon-NPF5RODM.js → canon-UQKCAL3J.js} +13 -8
  27. package/dist/cli/{chunk-SXXOC6KZ.js → canon-docs-ZXWC4AFI.js} +51 -4
  28. package/dist/cli/{cant-JZXHRLE2.js → cant-7YDYKDCE.js} +2 -2
  29. package/dist/cli/{changeset-WTR2KKML.js → changeset-XDMWUH4W.js} +2 -2
  30. package/dist/cli/{check-HHT4J5ZM.js → check-ALYB2DED.js} +43 -5
  31. package/dist/cli/{check-ZT6O5JDS.js → check-BNV2Z7NL.js} +45 -23
  32. package/dist/cli/{checkpoint-THR2KML7.js → checkpoint-WGT5Q4IV.js} +2 -2
  33. package/dist/cli/{chunk-6G43T2BO.js → chunk-2DRYEF4Q.js} +2 -2
  34. package/dist/cli/{chunk-4FO2MCCU.js → chunk-2EBQ2UPV.js} +2 -2
  35. package/dist/cli/{chunk-G63BB37P.js → chunk-2FVSEFH6.js} +3 -3
  36. package/dist/cli/{chunk-6N6WGLXE.js → chunk-2NXQCE4N.js} +10 -2
  37. package/dist/cli/{chunk-BXEMLY6P.js → chunk-367CXLZW.js} +2 -2
  38. package/dist/cli/{chunk-DNR7ZPOW.js → chunk-3C4ABVIM.js} +2 -2
  39. package/dist/cli/{chunk-YJQL26VS.js → chunk-3FLFKMKA.js} +3 -3
  40. package/dist/cli/{chunk-FBR2NQW4.js → chunk-4C4NJVR3.js} +2 -2
  41. package/dist/cli/{chunk-QITYNI2H.js → chunk-57YMZSNI.js} +2 -2
  42. package/dist/cli/{chunk-HQG5YZCJ.js → chunk-5D5EFJTJ.js} +2 -2
  43. package/dist/cli/{chunk-2LFWGSPE.js → chunk-5OFSGZLM.js} +2 -2
  44. package/dist/cli/{chunk-Y6FHWDNX.js → chunk-6KWKDXMT.js} +2 -2
  45. package/dist/cli/{chunk-RX5F2FUP.js → chunk-6VT7QNQH.js} +2 -2
  46. package/dist/cli/{chunk-D7QZ4WSJ.js → chunk-6ZCDCJB4.js} +2 -2
  47. package/dist/cli/{chunk-4QI7JOPI.js → chunk-762STE53.js} +2 -2
  48. package/dist/cli/{chunk-SP66YNWA.js → chunk-76QLAP54.js} +2 -2
  49. package/dist/cli/{chunk-7VRIP4MD.js → chunk-7AEZ35UT.js} +2 -2
  50. package/dist/cli/{chunk-64OLQ6OH.js → chunk-7VAYYOTQ.js} +2 -2
  51. package/dist/cli/{chunk-YM7QMFFW.js → chunk-AXFIVWJZ.js} +2 -2
  52. package/dist/cli/{chunk-AI4BE3MJ.js → chunk-B3NZQ2Y4.js} +2 -2
  53. package/dist/cli/{chunk-MLUCI3JC.js → chunk-BELA5D4T.js} +15 -6
  54. package/dist/cli/{chunk-2UQB3DWD.js → chunk-BJL3MZUI.js} +2 -2
  55. package/dist/cli/{chunk-UPFW3DRJ.js → chunk-BSIPR5S5.js} +2 -2
  56. package/dist/cli/{chunk-JRDAITPC.js → chunk-D75KPNMP.js} +18 -19
  57. package/dist/cli/{chunk-NBFD6HZX.js → chunk-DA7LGEOB.js} +2 -2
  58. package/dist/cli/{chunk-ESI6Q4OS.js → chunk-FD6EQLV7.js} +1 -2
  59. package/dist/cli/{chunk-5IFMSDWF.js → chunk-FJ5CWNTM.js} +2 -2
  60. package/dist/cli/{chunk-XSURVN6Y.js → chunk-FYS4D5VL.js} +2 -2
  61. package/dist/cli/chunk-HACZVXOL.js +92 -0
  62. package/dist/cli/{chunk-JBLHNKSK.js → chunk-HPRGQCRR.js} +2 -2
  63. package/dist/cli/{chunk-362WHUCT.js → chunk-IC33OPZA.js} +2 -2
  64. package/dist/cli/{chunk-TVNXFYOJ.js → chunk-ICFMF56Q.js} +4 -4
  65. package/dist/cli/{chunk-Y7ZNHNVQ.js → chunk-IDFVCC6T.js} +2 -2
  66. package/dist/cli/{chunk-NDN5LU2T.js → chunk-IDZSVRTW.js} +2 -2
  67. package/dist/cli/{chunk-SLNCIDY5.js → chunk-K3VVRO75.js} +2 -2
  68. package/dist/cli/{owner-override-cap-53HYZHIL.js → chunk-KA636FBJ.js} +45 -5
  69. package/dist/cli/{chunk-GNASLIE2.js → chunk-KNHQAYMR.js} +2 -2
  70. package/dist/cli/{chunk-THHPBHFL.js → chunk-LVPOIHUW.js} +2 -2
  71. package/dist/cli/{chunk-IYP3ACPP.js → chunk-M7L5XJYS.js} +2 -2
  72. package/dist/cli/{chunk-PGR4RWQL.js → chunk-MYBFLQT4.js} +8 -5
  73. package/dist/cli/{chunk-W56TDRLF.js → chunk-OMLSVE5U.js} +2 -2
  74. package/dist/cli/{chunk-TNLB7XJO.js → chunk-QZKOWHXO.js} +2 -2
  75. package/dist/cli/{chunk-5KN6IF7F.js → chunk-SKQG2E6A.js} +2 -2
  76. package/dist/cli/{chunk-J4ZSHCUO.js → chunk-TBIXOLSO.js} +2 -2
  77. package/dist/cli/{chunk-QWNKLLLG.js → chunk-TM72T27J.js} +2 -20
  78. package/dist/cli/{chunk-SHRGWWE2.js → chunk-TRUE5NCE.js} +12 -5
  79. package/dist/cli/{chunk-T2TE45UH.js → chunk-UAHZXF7P.js} +2 -2
  80. package/dist/cli/{chunk-3SWQFMWN.js → chunk-UGEJXSUY.js} +2 -2
  81. package/dist/cli/{chunk-NPEWU2LO.js → chunk-UYNMYQIG.js} +2 -2
  82. package/dist/cli/{chunk-S2IS4DXJ.js → chunk-VR6TPIRF.js} +2 -2
  83. package/dist/cli/{chunk-GL5GCK7T.js → chunk-VV65VS2B.js} +2 -2
  84. package/dist/cli/{chunk-OIS3BDSL.js → chunk-YNBEP6TJ.js} +23 -11
  85. package/dist/cli/{chunk-TUUKU4H7.js → chunk-YQQXHUUN.js} +15 -5
  86. package/dist/cli/{chunk-RBI6IBDF.js → chunk-Z24VFMRA.js} +2 -2
  87. package/dist/cli/{claim-MFFSWD64.js → claim-NJMCYE4S.js} +5 -5
  88. package/dist/cli/{classify-H3W4U76E.js → classify-KWJ3TFEC.js} +2 -2
  89. package/dist/cli/{cli-5PJ2B6ZH.js → cli-FIW3KVGU.js} +5 -5
  90. package/dist/cli/{cloud-IEDKFMLI.js → cloud-2H332MHX.js} +4 -4
  91. package/dist/cli/{code-IUDQNALE.js → code-NB4L5SQS.js} +2 -2
  92. package/dist/cli/{complete-2IN4YEWL.js → complete-ZVXR5WFT.js} +6 -6
  93. package/dist/cli/{complexity-JVEIZE5M.js → complexity-J7QTUVEQ.js} +5 -5
  94. package/dist/cli/{compliance-MC3X2M34.js → compliance-JA6VK45M.js} +5 -5
  95. package/dist/cli/{config-Z5BXGRZB.js → config-G7L2NAIX.js} +12 -7
  96. package/dist/cli/{consensus-T6UARQTD.js → consensus-TMDIZHXI.js} +5 -5
  97. package/dist/cli/{context-M4F3YXZE.js → context-6GLTMU2N.js} +5 -5
  98. package/dist/cli/{contribution-76FJYJKR.js → contribution-HPVDMKN6.js} +5 -5
  99. package/dist/cli/{curator-3YXUY4N7.js → curator-O2FXIQFI.js} +2 -2
  100. package/dist/cli/{current-EFRCVSWL.js → current-QFANPTZ4.js} +5 -5
  101. package/dist/cli/{daemon-UAAMDN6C.js → daemon-XTMW67JG.js} +5 -5
  102. package/dist/cli/{dash-ZEBYLYPV.js → dash-K25EK3MM.js} +5 -5
  103. package/dist/cli/{decide-GQTJOC55.js → decide-7JM6V3MS.js} +2 -2
  104. package/dist/cli/{decompose-XTK2DXSM.js → decompose-D2CI6H4Z.js} +5 -5
  105. package/dist/cli/{decomposition-ZDACSPOU.js → decomposition-HM2POZII.js} +5 -5
  106. package/dist/cli/{delete-6YZADILS.js → delete-WKIEMXKN.js} +5 -5
  107. package/dist/cli/{deps-WTASB2GB.js → deps-2X5EWRGY.js} +5 -5
  108. package/dist/cli/{detect-IITE5EBW.js → detect-SWEMXU4U.js} +5 -5
  109. package/dist/cli/{detect-drift-PVC7IPHL.js → detect-drift-M5C4RFJ5.js} +15 -12
  110. package/dist/cli/{diagnostics-MFUOSLSQ.js → diagnostics-6STQBKON.js} +5 -5
  111. package/dist/cli/{docs-AIZLN3ZE.js → docs-O5A34WJY.js} +172 -101
  112. package/dist/cli/{docs-NF5COLOB.js → docs-SI2YNPSG.js} +216 -30
  113. package/dist/cli/{doctor-4DWCNDOP.js → doctor-45UUXTVQ.js} +57 -52
  114. package/dist/cli/{doctor-ac-bindings-HPTG3DDJ.js → doctor-ac-bindings-PBJQ5AS6.js} +3 -3
  115. package/dist/cli/{doctor-acceptance-drift-P7DOAY54.js → doctor-acceptance-drift-FIV25NRE.js} +3 -3
  116. package/dist/cli/{doctor-credentials-TBRT7RAV.js → doctor-credentials-W7EGOG54.js} +3 -3
  117. package/dist/cli/{doctor-db-substrate-ZMLTPGQF.js → doctor-db-substrate-DQJDPL4K.js} +3 -3
  118. package/dist/cli/{doctor-dep-cycles-QWFYH2JK.js → doctor-dep-cycles-2RK2MAHL.js} +3 -3
  119. package/dist/cli/{doctor-exodus-FYBTDXNQ.js → doctor-exodus-SCIA5CZ5.js} +3 -3
  120. package/dist/cli/{doctor-exodus-residue-S7EKSTZS.js → doctor-exodus-residue-N7R3FRC5.js} +3 -3
  121. package/dist/cli/{doctor-fk-check-CNZCA74C.js → doctor-fk-check-5TND2DZH.js} +3 -3
  122. package/dist/cli/{doctor-global-delivery-FICIWVP6.js → doctor-global-delivery-ENAHOZF7.js} +3 -3
  123. package/dist/cli/{doctor-goal-runtime-UIPZRP5Y.js → doctor-goal-runtime-PN6LJFPN.js} +3 -3
  124. package/dist/cli/{doctor-heavy-command-hook-SJHLYWEI.js → doctor-heavy-command-hook-UK3PLJRM.js} +3 -3
  125. package/dist/cli/{doctor-hooks-GHQIAFOY.js → doctor-hooks-ABHXHN2C.js} +3 -3
  126. package/dist/cli/{doctor-legacy-backups-USISQQ5C.js → doctor-legacy-backups-6NXVR43I.js} +3 -3
  127. package/dist/cli/{doctor-legacy-reaper-54BUE5RK.js → doctor-legacy-reaper-SWQOAPNV.js} +3 -3
  128. package/dist/cli/{doctor-malformed-ids-LZNVED2E.js → doctor-malformed-ids-VPZE6A4O.js} +3 -3
  129. package/dist/cli/{doctor-manifest-rows-3L6RUH3C.js → doctor-manifest-rows-GHPAYQ6I.js} +3 -3
  130. package/dist/cli/{doctor-memory-guard-Z62J6U3O.js → doctor-memory-guard-Z6IMLQ5C.js} +3 -3
  131. package/dist/cli/{doctor-migrations-EYB6XSZ2.js → doctor-migrations-6HICMUH5.js} +3 -3
  132. package/dist/cli/{doctor-nexus-residency-GFS37HCL.js → doctor-nexus-residency-VEOZBSYZ.js} +3 -3
  133. package/dist/cli/{doctor-project-identity-A3C6ZWUQ.js → doctor-project-identity-UPRBKXXU.js} +3 -3
  134. package/dist/cli/{doctor-projects-73UHVECZ.js → doctor-projects-3BKEL6SE.js} +3 -3
  135. package/dist/cli/{doctor-projects-registry-5RGRJMCE.js → doctor-projects-registry-JQRWKMRP.js} +3 -3
  136. package/dist/cli/{doctor-release-readiness-7G3OGH2R.js → doctor-release-readiness-ZAK5RKP7.js} +3 -3
  137. package/dist/cli/{doctor-repair-IK6OSUHA.js → doctor-repair-KP66YRVA.js} +3 -3
  138. package/dist/cli/{doctor-row-identity-2CULRXQ2.js → doctor-row-identity-7BDE6BMR.js} +3 -3
  139. package/dist/cli/{doctor-skill-fixtures-OQ2RMIR6.js → doctor-skill-fixtures-MJQ7BJRE.js} +3 -3
  140. package/dist/cli/{doctor-split-brain-5YQGDVTY.js → doctor-split-brain-FFQ7U2FI.js} +3 -3
  141. package/dist/cli/{doctor-superseded-store-JLATIXXP.js → doctor-superseded-store-FQSFKMEX.js} +3 -3
  142. package/dist/cli/{doctor-sync-journal-MZM3WUIT.js → doctor-sync-journal-AM5M5RGO.js} +3 -3
  143. package/dist/cli/{doctor-sync-triggers-IZFC62D7.js → doctor-sync-triggers-4GSCFCL7.js} +3 -3
  144. package/dist/cli/{doctor-system-TJINX2M3.js → doctor-system-S7KYSUXW.js} +3 -3
  145. package/dist/cli/{doctor-tool-locks-VXKJZKAY.js → doctor-tool-locks-XRRQJ3MK.js} +3 -3
  146. package/dist/cli/{doctor-twin-collapse-C5GLUSAO.js → doctor-twin-collapse-SJM5LNAO.js} +3 -3
  147. package/dist/cli/doctor-type-matrix-6MJXOZI2.js +26 -0
  148. package/dist/cli/{doctor-worktree-stores-WZMB4ZHG.js → doctor-worktree-stores-TIR5ZDJ4.js} +3 -3
  149. package/dist/cli/{done-A7ITQSJT.js → done-TXCQGNT7.js} +91 -8
  150. package/dist/cli/{event-RD4EI52P.js → event-J2A7PIDI.js} +2 -2
  151. package/dist/cli/{exists-U33AFKXF.js → exists-NN5QNXFW.js} +2 -2
  152. package/dist/cli/{exodus-QHAQC5SH.js → exodus-VIV4AX54.js} +2 -2
  153. package/dist/cli/{export-OTDQUAQQ.js → export-T4YD6Q3U.js} +5 -5
  154. package/dist/cli/{export-tasks-BKVXMFLD.js → export-tasks-VB5U3YMC.js} +5 -5
  155. package/dist/cli/{federation-GZCJIYMK.js → federation-7WZTYIX7.js} +2 -2
  156. package/dist/cli/{find-BWKYKZEN.js → find-KMTKZ7FY.js} +5 -5
  157. package/dist/cli/{focus-772SYK7Z.js → focus-3BLWBLBG.js} +5 -5
  158. package/dist/cli/{focus-H5CBCFFV.js → focus-6ZYKBB3X.js} +2 -2
  159. package/dist/cli/{gateway-PJ2A6TNM.js → gateway-WVQ3QQFW.js} +2 -2
  160. package/dist/cli/{gc-KG3D2PSR.js → gc-PZGIBTWQ.js} +3 -3
  161. package/dist/cli/{go-AEDN2TNP.js → go-LK5WEP3M.js} +2 -2
  162. package/dist/cli/{goal-TG74GKBK.js → goal-IRTYU7XD.js} +3 -3
  163. package/dist/cli/{grade-BZYBWDA7.js → grade-GIXFAUVP.js} +5 -5
  164. package/dist/cli/{graph-LB2TBRH6.js → graph-SVPHG4VG.js} +8 -33
  165. package/dist/cli/{history-XIYAXOUF.js → history-LPGGTRI7.js} +5 -5
  166. package/dist/cli/{hook-GS5ZZX46.js → hook-VMFPDWVJ.js} +2 -2
  167. package/dist/cli/hook-entry.js +105 -7
  168. package/dist/cli/hygiene-NJD3GR56.js +142 -0
  169. package/dist/cli/{import-C2QISQC7.js → import-55RUOSXO.js} +5 -5
  170. package/dist/cli/{import-tasks-P6FYXAAS.js → import-tasks-RXPNEFPW.js} +5 -5
  171. package/dist/cli/index.js +256 -204
  172. package/dist/cli/{init-XLIT5JVO.js → init-KNRJ22RZ.js} +5 -5
  173. package/dist/cli/{inject-EDZVSPTW.js → inject-43VJCL2Y.js} +5 -5
  174. package/dist/cli/{install-global-FFNYQ366.js → install-global-GU4F2KKV.js} +2 -2
  175. package/dist/cli/{intelligence-OE7SIVR5.js → intelligence-36SGMEHH.js} +5 -5
  176. package/dist/cli/{issue-S67EZXN7.js → issue-VYWZG6BR.js} +5 -5
  177. package/dist/cli/{janitor-GMTGHNOZ.js → janitor-LU6EA55M.js} +2 -2
  178. package/dist/cli/{labels-M7GIBYAQ.js → labels-X6BEE5ZZ.js} +5 -5
  179. package/dist/cli/{lean-FNQ3D4VT.js → lean-GXLAUNNG.js} +2 -2
  180. package/dist/cli/{lifecycle-NO5QDJ2J.js → lifecycle-5P7AVPSI.js} +6 -6
  181. package/dist/cli/{list-VH6DPZ4V.js → list-5N73FV7H.js} +5 -5
  182. package/dist/cli/{llm-P35U52I5.js → llm-IO53XETC.js} +9 -9
  183. package/dist/cli/{llm-YVC5HL7D.js → llm-J3SYJEGB.js} +2 -2
  184. package/dist/cli/{llm-cost-CRIA3VMB.js → llm-cost-DYY7IC4W.js} +3 -3
  185. package/dist/cli/{llm-stream-YBT4FNWZ.js → llm-stream-G35ANQKL.js} +3 -3
  186. package/dist/cli/{log-XIPOX6UM.js → log-E7XZBG7W.js} +5 -5
  187. package/dist/cli/{login-SYEMTZXY.js → login-IRTRPQTX.js} +4 -4
  188. package/dist/cli/{logout-FVWR2AXZ.js → logout-XEL6AVVB.js} +4 -4
  189. package/dist/cli/{manifest-A5F2YD35.js → manifest-UZDHLWAN.js} +5 -5
  190. package/dist/cli/{map-AOMU72RY.js → map-6J27ZMSH.js} +5 -5
  191. package/dist/cli/{memory-4WNZWJG7.js → memory-CFG7P3MM.js} +65 -18
  192. package/dist/cli/{memory-GK5WDYWT.js → memory-Y2C7HYDJ.js} +4 -3
  193. package/dist/cli/merge-JCDDPQIX.js +65 -0
  194. package/dist/cli/{migrate-agents-v2-IX3IBBIT.js → migrate-agents-v2-4W4ZSHZM.js} +3 -3
  195. package/dist/cli/{migrate-claude-mem-OTSYHYBZ.js → migrate-claude-mem-MDBLLJ22.js} +6 -6
  196. package/dist/cli/{next-YUZ4X7NB.js → next-MSGFEI7M.js} +5 -5
  197. package/dist/cli/{nexus-RYH4IAG3.js → nexus-IK7QLEDF.js} +3 -11
  198. package/dist/cli/{nexus-YHPP3RZU.js → nexus-XULYITP6.js} +98 -63
  199. package/dist/cli/{nexus-vault-cli-2R6ALKUP.js → nexus-vault-cli-G7QY446L.js} +4 -4
  200. package/dist/cli/{ops-XPJK3WBN.js → ops-2XDAGO4L.js} +5 -5
  201. package/dist/cli/{orchestrate-AYBDAVOQ.js → orchestrate-BDU4ZLDN.js} +77 -346
  202. package/dist/cli/{orchestrate-TWV43SAR.js → orchestrate-SUOWHPIU.js} +147 -140
  203. package/dist/cli/{otel-TR54MLYU.js → otel-4AS22352.js} +2 -2
  204. package/dist/cli/owner-override-cap-5XAZD23U.js +31 -0
  205. package/dist/cli/{owner-password-GQO37FBV.js → owner-password-VBK5RHKP.js} +3 -3
  206. package/dist/cli/{phase-CFH2NZU5.js → phase-FF6OMRTY.js} +5 -5
  207. package/dist/cli/{pipeline-LW5HWLBI.js → pipeline-4ATMN26D.js} +3 -3
  208. package/dist/cli/{pivot-LEBKDG22.js → pivot-S6JDBRK4.js} +5 -5
  209. package/dist/cli/{plan-6VK5I4BT.js → plan-AY6CF5VB.js} +5 -5
  210. package/dist/cli/{playbook-YPGSNILZ.js → playbook-JDDX5F3H.js} +3 -3
  211. package/dist/cli/{playbook-4GKDYZYW.js → playbook-LJOLT6MX.js} +5 -5
  212. package/dist/cli/{project-QJM7P2HG.js → project-RCRORK6A.js} +3 -3
  213. package/dist/cli/project-hook-entry.js +1 -1
  214. package/dist/cli/{promote-4V4ZLAL3.js → promote-YAFPAZEH.js} +5 -5
  215. package/dist/cli/{provenance-2SFRY42O.js → provenance-2WVSVXNS.js} +5 -5
  216. package/dist/cli/{provider-G6MBFVHR.js → provider-GJD2MZOF.js} +5 -5
  217. package/dist/cli/{reason-2AYZ6SGZ.js → reason-QJZGRMSL.js} +5 -5
  218. package/dist/cli/{reconcile-7CBD7AHH.js → reconcile-JMYN3BON.js} +6 -5
  219. package/dist/cli/{refresh-memory-JTQYFIC7.js → refresh-memory-XVQE7B7L.js} +2 -2
  220. package/dist/cli/{relates-FP43JAOK.js → relates-NNOSVBIM.js} +5 -5
  221. package/dist/cli/{release-NW7XHRVB.js → release-DB23AFID.js} +136 -6
  222. package/dist/cli/{release-OWPFPUQG.js → release-EI72GMAM.js} +79 -96
  223. package/dist/cli/release-authorize-OPL262T6.js +84 -0
  224. package/dist/cli/{remote-ZCCQGM5A.js → remote-XJGF5MGU.js} +2 -2
  225. package/dist/cli/{renderers-37XPXD3K.js → renderers-AMSXAXLY.js} +2 -2
  226. package/dist/cli/{reorder-M457CQRR.js → reorder-HFTIHYBZ.js} +5 -5
  227. package/dist/cli/{reparent-53T6IUUS.js → reparent-JOBADCH5.js} +5 -5
  228. package/dist/cli/{req-ORMMU5PV.js → req-6JXMXBNA.js} +38 -5
  229. package/dist/cli/{research-LFGCGIEP.js → research-5GRWQLHM.js} +6 -6
  230. package/dist/cli/{restore-ZYRIZQUJ.js → restore-ZZH5EUTG.js} +12 -6
  231. package/dist/cli/{revert-XB7K5DR7.js → revert-2F3RPBGW.js} +2 -2
  232. package/dist/cli/review-LTRABBAL.js +162 -0
  233. package/dist/cli/{roadmap-EK6LXBQ4.js → roadmap-THEKOZ3A.js} +5 -5
  234. package/dist/cli/{run-PZJCIRFD.js → run-LH2KI2BV.js} +57 -4
  235. package/dist/cli/{safestop-NO57J3RK.js → safestop-3BH4GLOW.js} +5 -5
  236. package/dist/cli/{saga-NIJMIJE5.js → saga-SMAWF37G.js} +5 -5
  237. package/dist/cli/{schema-5SBTATBP.js → schema-J4UNFL5K.js} +2 -2
  238. package/dist/cli/{self-update-7747XBHR.js → self-update-OP7X4SV5.js} +2 -2
  239. package/dist/cli/{selfimprove-6HSEV3RG.js → selfimprove-MJXG7BIB.js} +5 -5
  240. package/dist/cli/{selfimprove-IYKG5PF4.js → selfimprove-MQ5WGGVO.js} +2 -2
  241. package/dist/cli/{sentient-U56VMS6D.js → sentient-B7TXJ2XI.js} +2 -2
  242. package/dist/cli/{sentient-Z7W7WO74.js → sentient-W3D6ATW5.js} +2 -2
  243. package/dist/cli/{sequence-T42KPEEQ.js → sequence-VUPNLIB3.js} +5 -5
  244. package/dist/cli/{service-CBEZWGHC.js → service-ZBMCSGAO.js} +5 -5
  245. package/dist/cli/{session-XDADM7O4.js → session-5JTABSZR.js} +6 -6
  246. package/dist/cli/{session-TFVW42XK.js → session-NN655K5R.js} +3 -3
  247. package/dist/cli/{setup-WZVYP7QA.js → setup-JQ3DFC5Q.js} +4 -4
  248. package/dist/cli/{show-I2TEU6MP.js → show-OKAPY3KE.js} +5 -6
  249. package/dist/cli/{skill-YUWT2LC6.js → skill-HOUTOSDX.js} +2 -2
  250. package/dist/cli/{skills-ZBYRPFRL.js → skills-CJ4UY4VG.js} +7 -7
  251. package/dist/cli/{snapshot-GMN7LZ4A.js → snapshot-5AUXE72Q.js} +5 -5
  252. package/dist/cli/{start-FQWDRGJE.js → start-ZB263BD4.js} +5 -5
  253. package/dist/cli/{stats-D2AU77GH.js → stats-QKNT3RCZ.js} +5 -5
  254. package/dist/cli/{status-TNLDBR7K.js → status-7BIMUOCS.js} +2 -2
  255. package/dist/cli/{sticky-FKZFQYNV.js → sticky-IDNWN3F6.js} +5 -5
  256. package/dist/cli/{sticky-EKL5FD2D.js → sticky-Z2BMRSAB.js} +2 -2
  257. package/dist/cli/{stop-ZCL7RZPH.js → stop-OCEFE7PM.js} +5 -5
  258. package/dist/cli/{sync-WM4JLGXF.js → sync-6DQ2OAMG.js} +6 -6
  259. package/dist/cli/{tasks-RU6AAJKD.js → tasks-BIZI4QJF.js} +30 -5
  260. package/dist/cli/{tasks-54WNYQZS.js → tasks-Q2XYKLX6.js} +5 -5
  261. package/dist/cli/{telemetry-RQFRJRBZ.js → telemetry-DCWQTH2I.js} +2 -2
  262. package/dist/cli/{templates-6H4CTUCW.js → templates-Q3QZQZ62.js} +2 -2
  263. package/dist/cli/{testing-S7FCPHW5.js → testing-PTDKLHX3.js} +5 -5
  264. package/dist/cli/{token-BDRGEO3E.js → token-BZEEYQHF.js} +5 -5
  265. package/dist/cli/{transcript-DVV4EFPG.js → transcript-ZY6UF3TU.js} +2 -2
  266. package/dist/cli/{update-BD77ORMO.js → update-E5PECNWK.js} +5 -5
  267. package/dist/cli/{upgrade-EDQ7F6OX.js → upgrade-E6M4ERKP.js} +5 -5
  268. package/dist/cli/{verify-VOJRQQE2.js → verify-474GA75M.js} +12 -7
  269. package/dist/cli/{web-BPCE3X2V.js → web-R7LXSDEG.js} +2 -2
  270. package/dist/cli/{workgraph-ZKOFWUUE.js → workgraph-LWSTY3JY.js} +6 -6
  271. package/dist/cli/{worktree-2UEPNBJC.js → worktree-3B5JR6N7.js} +4 -5
  272. package/dist/cli/{worktree-2HHJT5BS.js → worktree-ZCJAH23Z.js} +12 -14
  273. package/package.json +16 -14
  274. package/studio-dist/client/_app/immutable/chunks/{CwQ8nAoh.js → 6tOJRYtC.js} +1 -1
  275. package/studio-dist/client/_app/immutable/chunks/{C87Q3uxm.js → Bb5_AOYB.js} +1 -1
  276. package/studio-dist/client/_app/immutable/chunks/C2a5FdIt.js +1 -0
  277. package/studio-dist/client/_app/immutable/chunks/{Dv66614U.js → DdIqZ0F-.js} +1 -1
  278. package/studio-dist/client/_app/immutable/chunks/{Js_lZuOv.js → DtBpLaMM.js} +1 -1
  279. package/studio-dist/client/_app/immutable/chunks/{EZwHPWle.js → h4IOtB0S.js} +1 -1
  280. package/studio-dist/client/_app/immutable/entry/{app.C2oQiIiz.js → app.Bu2fyKEV.js} +2 -2
  281. package/studio-dist/client/_app/immutable/entry/start.CBBzjkal.js +1 -0
  282. package/studio-dist/client/_app/immutable/nodes/{0.DaE6eVaG.js → 0.D0Q67wN6.js} +1 -1
  283. package/studio-dist/client/_app/immutable/nodes/{1.D0Mb3i_7.js → 1.Cx9rAK7i.js} +1 -1
  284. package/studio-dist/client/_app/immutable/nodes/{15.ChRO-4dz.js → 15.DnOsli29.js} +1 -1
  285. package/studio-dist/client/_app/immutable/nodes/{16.fltF2wse.js → 16.CrxwCKGy.js} +1 -1
  286. package/studio-dist/client/_app/immutable/nodes/{17.DnYjMhyj.js → 17.Cdh0_9mm.js} +1 -1
  287. package/studio-dist/client/_app/immutable/nodes/{18.DYVIAC9a.js → 18.8GsoNI5O.js} +1 -1
  288. package/studio-dist/client/_app/immutable/nodes/{20.CVBcbjBW.js → 20.BJG6Nl3w.js} +1 -1
  289. package/studio-dist/client/_app/immutable/nodes/{24.Bfswm8Y5.js → 24.j8WC-gjA.js} +1 -1
  290. package/studio-dist/client/_app/immutable/nodes/25.BlW7cJd4.js +39 -0
  291. package/studio-dist/client/_app/immutable/nodes/{26.D3RoTHoD.js → 26.C5RluMQM.js} +1 -1
  292. package/studio-dist/client/_app/immutable/nodes/{28.D64RBcfs.js → 28.B9m_UNTl.js} +1 -1
  293. package/studio-dist/client/_app/immutable/nodes/{29.yfuBeH1x.js → 29.BLFaoK4P.js} +1 -1
  294. package/studio-dist/client/_app/immutable/nodes/{3.ezhkaJvt.js → 3.BhtcETod.js} +1 -1
  295. package/studio-dist/client/_app/version.json +1 -1
  296. package/studio-dist/server/chunks/{0-BKQLYEeE.js → 0-3ISI_Jd4.js} +3 -3
  297. package/studio-dist/server/chunks/1-CM2aVyEP.js +9 -0
  298. package/studio-dist/server/chunks/{15-DuSvkmiZ.js → 15-3X9-99yQ.js} +3 -3
  299. package/studio-dist/server/chunks/{16-DJVePzvS.js → 16-CpB7uymk.js} +3 -3
  300. package/studio-dist/server/chunks/{17-D8K9-EPJ.js → 17-BwPBOkXY.js} +3 -3
  301. package/studio-dist/server/chunks/{18-D5FUPGnv.js → 18-4rPYGgn2.js} +3 -3
  302. package/studio-dist/server/chunks/{2-DQaIET_o.js → 2-q7c9jKfs.js} +6 -6
  303. package/studio-dist/server/chunks/{20-CmHgNZFV.js → 20-BRURJXYm.js} +3 -3
  304. package/studio-dist/server/chunks/{23-D194DGVi.js → 23-DEuC4HS6.js} +3 -2
  305. package/studio-dist/server/chunks/{24-CfuHWHgd.js → 24-guuvcnQd.js} +5 -4
  306. package/studio-dist/server/chunks/{25-bm3BDSum.js → 25-Cu45aO6X.js} +618 -36
  307. package/studio-dist/server/chunks/{26-DRlhAbrf.js → 26-CbjqXxSv.js} +15 -14
  308. package/studio-dist/server/chunks/{28-DeYe2rpm.js → 28-CiVv4jji.js} +3 -3
  309. package/studio-dist/server/chunks/{29-d_lZvJg3.js → 29-CHrYKy9L.js} +6 -5
  310. package/studio-dist/server/chunks/{3-BrE1-gTA.js → 3-dGuWwuGL.js} +4 -4
  311. package/studio-dist/server/chunks/30-CZYg7-qi.js +94 -0
  312. package/studio-dist/server/chunks/{_layout.svelte-BeqNMCvk.js → _layout.svelte-BtFiGIEp.js} +4 -4
  313. package/studio-dist/server/chunks/{_page.svelte-Dm8y5a8S.js → _page.svelte-Bazc0M-R.js} +3 -3
  314. package/studio-dist/server/chunks/{_page.svelte-V7BTZinR.js → _page.svelte-C3zGtsso.js} +9 -8
  315. package/studio-dist/server/chunks/{_page.svelte-CJVF_ySt.js → _page.svelte-C7HQSp26.js} +3 -3
  316. package/studio-dist/server/chunks/{_page.svelte-Bchzzf-O.js → _page.svelte-CGmJXo2R.js} +3 -3
  317. package/studio-dist/server/chunks/{_page.svelte-CkXCx1iz.js → _page.svelte-CQVvPMmQ.js} +3 -3
  318. package/studio-dist/server/chunks/{_page.svelte-DIx7Hcw-.js → _page.svelte-CndKFWTU.js} +3 -3
  319. package/studio-dist/server/chunks/{_page.svelte-Ds0GMs_q.js → _page.svelte-CpWAUdOW.js} +5 -5
  320. package/studio-dist/server/chunks/{_page.svelte-DM-MP-Vl.js → _page.svelte-DWXNbjU9.js} +3 -3
  321. package/studio-dist/server/chunks/{_page.svelte-B7xxx6BP.js → _page.svelte-DciYSvHg.js} +4 -4
  322. package/studio-dist/server/chunks/{_page.svelte-DnmZYECG.js → _page.svelte-FsmVvOW2.js} +3 -3
  323. package/studio-dist/server/chunks/{_page.svelte-Cx9Ptecp.js → _page.svelte-_ePwQLv-.js} +2 -2
  324. package/studio-dist/server/chunks/{_server.ts-B5vYKkI6.js → _server.ts--7OuOtTn.js} +1 -2
  325. package/studio-dist/server/chunks/{_server.ts-Cd_KHxRr.js → _server.ts-BDyyTu-K.js} +2 -2
  326. package/studio-dist/server/chunks/{_server.ts-YtGAClvW.js → _server.ts-Bqqug0HB.js} +10 -8
  327. package/studio-dist/server/chunks/{_server.ts-CcQ0AQoo.js → _server.ts-C_2-lCv8.js} +6 -5
  328. package/studio-dist/server/chunks/{_server.ts-6A72NyG7.js → _server.ts-Cr0M7RVU.js} +2 -2
  329. package/studio-dist/server/chunks/{_server.ts-BKZlM7rp.js → _server.ts-Csp0H96s.js} +2 -2
  330. package/studio-dist/server/chunks/{_server.ts-DdCviCsN.js → _server.ts-CyTTBEcl.js} +4 -4
  331. package/studio-dist/server/chunks/{_server.ts-Ck-oreiA.js → _server.ts-D6VzZhEs.js} +3 -3
  332. package/studio-dist/server/chunks/{_server.ts-b2YIpIsi.js → _server.ts-D9u8o_fg.js} +3 -3
  333. package/studio-dist/server/chunks/{_server.ts-XLV5SvjH.js → _server.ts-NPYD7LXS.js} +2 -2
  334. package/studio-dist/server/chunks/{_server.ts-CqO357sV.js → _server.ts-Te-2tjen.js} +2 -2
  335. package/studio-dist/server/chunks/{_server.ts-OPrTc7WI.js → _server.ts-ZJufMUl-.js} +2 -2
  336. package/studio-dist/server/chunks/{client-DR3j81J8.js → client-DKCgIuPq.js} +2 -2
  337. package/studio-dist/server/chunks/{error.svelte-NY-X_Qdt.js → error.svelte-gYXatkJM.js} +3 -3
  338. package/studio-dist/server/chunks/{explorer-loader-CP09K03H.js → explorer-loader-fHkiu8Z4.js} +8 -6
  339. package/studio-dist/server/chunks/{http-Dz72j56i.js → http-elrAoEmj.js} +2 -2
  340. package/studio-dist/server/chunks/{internal-y7btLoII.js → internal-C4t8_O0Q.js} +2 -2
  341. package/studio-dist/server/chunks/{lane-transition-lM2ngbbc.js → lane-transition-tca216Ny.js} +10 -3
  342. package/studio-dist/server/chunks/{operations-registry-DKEHmggR.js → operations-registry-C9N47F53.js} +350 -471
  343. package/studio-dist/server/chunks/{stores-Cm-Qj76R.js → stores-CLlSxFBW.js} +2 -2
  344. package/studio-dist/server/chunks/{tasks-sWuEmiGW.js → tasks-Ch-fdBjA.js} +2 -2
  345. package/studio-dist/server/index.js +1 -1
  346. package/studio-dist/server/manifest.js +29 -29
  347. package/dist/cli/canon-docs-2GTOLF7Y.js +0 -26
  348. package/dist/cli/chunk-IGM44F43.js +0 -33
  349. package/dist/cli/conduit-STEBYJTU.js +0 -535
  350. package/dist/cli/conduit-XYYPJYUF.js +0 -319
  351. package/dist/cli/hygiene-QVIG57RZ.js +0 -55
  352. package/studio-dist/client/_app/immutable/chunks/BXnpxR_0.js +0 -1
  353. package/studio-dist/client/_app/immutable/entry/start.BolRa540.js +0 -1
  354. package/studio-dist/client/_app/immutable/nodes/25.B_7VqHJ6.js +0 -39
  355. package/studio-dist/server/chunks/1-ClOr3JN3.js +0 -9
  356. package/studio-dist/server/chunks/30-BHsj4oeh.js +0 -105
@@ -15,13 +15,13 @@
15
15
  })();
16
16
  import {
17
17
  lazyOperation
18
- } from "./chunk-JRDAITPC.js";
18
+ } from "./chunk-D75KPNMP.js";
19
19
  import {
20
20
  defineTypedHandler,
21
21
  lafsError,
22
22
  lafsSuccess,
23
23
  typedDispatch
24
- } from "./chunk-QWNKLLLG.js";
24
+ } from "./chunk-TM72T27J.js";
25
25
  import {
26
26
  dispatchMeta,
27
27
  handleErrorResult,
@@ -29,13 +29,14 @@ import {
29
29
  } from "./chunk-XD25OCUE.js";
30
30
 
31
31
  // packages/cleo/src/dispatch/domains/docs.ts
32
- import { randomUUID } from "node:crypto";
32
+ import { createHash, randomUUID } from "node:crypto";
33
33
  import { readFile } from "node:fs/promises";
34
34
  import { join, resolve } from "node:path";
35
35
  import { DocKindRegistry } from "@cleocode/contracts/docs-taxonomy.js";
36
36
  import { ExitCode } from "@cleocode/contracts/exit-codes.js";
37
37
  import { LLM_OUTPUT_MODES } from "@cleocode/contracts/operations/docs";
38
38
  import { parseChangesetFrontmatter } from "@cleocode/core/changesets/parse-frontmatter";
39
+ import { resolveInvokingCheckout } from "@cleocode/core/core-paths";
39
40
  import { readAuditLog, verifyAuditTrail, writeAuditEntry } from "@cleocode/core/docs/docs-audit";
40
41
  import { createDocsReadModel } from "@cleocode/core/docs/docs-read-model";
41
42
  import {
@@ -75,6 +76,12 @@ var allocateAdrSlug = lazyOperation(
75
76
  var allocateAutoSlugForDispatch = lazyOperation(
76
77
  async () => (await import("@cleocode/core/docs/numbering")).allocateAutoSlugForDispatch
77
78
  );
79
+ var docNameViolation = lazyOperation(
80
+ async () => (await import("@cleocode/core/docs/doc-name-rule")).docNameViolation
81
+ );
82
+ var describeDocNameViolation = lazyOperation(
83
+ async () => (await import("@cleocode/core/docs/doc-name-rule")).describeDocNameViolation
84
+ );
78
85
  var exportDocument = lazyOperation(
79
86
  async () => (await import("@cleocode/core/docs/export-document")).exportDocument
80
87
  );
@@ -130,6 +137,12 @@ var triageDocs = lazyOperation(
130
137
  var computeDocsStats = lazyOperation(
131
138
  async () => (await import("@cleocode/core/docs/stats")).computeDocsStats
132
139
  );
140
+ var runDocsModernize = lazyOperation(
141
+ async () => (await import("@cleocode/core/docs/modernize/index")).runDocsModernize
142
+ );
143
+ var scanDocsRot = lazyOperation(
144
+ async () => (await import("@cleocode/core/docs/rot")).scanDocsRot
145
+ );
133
146
  var runLegacyDocMigration = lazyOperation(
134
147
  async () => (await import("@cleocode/core/docs/legacy-doc-migration")).runLegacyDocMigration
135
148
  );
@@ -173,6 +186,19 @@ function getDocKindRegistry() {
173
186
  function registeredKindValues() {
174
187
  return getDocKindRegistry().list().map((d) => d.kind);
175
188
  }
189
+ async function recordAddedDocHead(projectRoot, slug, attachedBy, bytes) {
190
+ try {
191
+ const { recordNewDocIdentity } = await import("@cleocode/core/docs/docs-update");
192
+ return (await recordNewDocIdentity(projectRoot, { slug, authorAgentId: attachedBy, bytes })).headVersionUid;
193
+ } catch (err) {
194
+ pushWarning({
195
+ // @sync-invariant none:input-shape the warning only reports that the head was not recorded; the add already committed and nothing is rejected
196
+ code: "W_DOC_HEAD_DEFERRED",
197
+ message: `doc '${slug}' was added, but its version head could not be recorded (${err instanceof Error ? err.message : String(err)}); run \`cleo docs migrate\` to record it.`
198
+ });
199
+ return void 0;
200
+ }
201
+ }
176
202
  async function currentAttachmentBackend() {
177
203
  return resolveAttachmentBackend();
178
204
  }
@@ -250,7 +276,8 @@ async function decisionLinkResponse(op, write) {
250
276
  err.toLAFSError().code,
251
277
  // @sync-invariant docs.decision-adr-links.revoke-monotonic the accessor's refusal (re-link of a revoked pair, revoke of an unknown link) is surfaced unchanged
252
278
  err.message,
253
- op
279
+ op,
280
+ err.fix ?? "cleo docs list --type adr"
254
281
  );
255
282
  }
256
283
  }
@@ -284,12 +311,9 @@ var _docsTypedHandler = defineTypedHandler("docs", {
284
311
  const model = createDocsReadModel();
285
312
  const backend = await currentAttachmentBackend();
286
313
  if (isProjectScope) {
287
- const docs = await model.listProjectDocs({
288
- kind: typeFilter,
289
- limit: Number.isFinite(effectiveLimit) ? effectiveLimit : void 0
290
- });
314
+ const docs = await model.listProjectDocs({ kind: typeFilter });
291
315
  const totalCount = docs.length;
292
- const projected = docs.map((doc) => ({
316
+ const allProjected = docs.map((doc) => ({
293
317
  id: doc.id,
294
318
  // Full content hash — a SHA-256 field in a machine envelope must be the
295
319
  // real digest, never a display-truncated form (T11294: the per-doc
@@ -312,12 +336,13 @@ var _docsTypedHandler = defineTypedHandler("docs", {
312
336
  ownerId: doc.ownerId,
313
337
  ownerType: doc.ownerType
314
338
  }));
315
- projected.sort(
339
+ allProjected.sort(
316
340
  (a, b) => comparator(
317
341
  { sha256: a.sha256, slug: a.slug, createdAt: a.createdAt },
318
342
  { sha256: b.sha256, slug: b.slug, createdAt: b.createdAt }
319
343
  )
320
344
  );
345
+ const projected = Number.isFinite(effectiveLimit) ? allProjected.slice(0, effectiveLimit) : allProjected;
321
346
  const truncated = totalCount > projected.length;
322
347
  if (truncated) {
323
348
  hintParts.push(
@@ -332,6 +357,12 @@ var _docsTypedHandler = defineTypedHandler("docs", {
332
357
  ...typeFilter !== void 0 ? { type: typeFilter } : {},
333
358
  count: projected.length,
334
359
  ...truncated ? { totalCount } : {},
360
+ population: {
361
+ matched: totalCount,
362
+ returned: projected.length,
363
+ truncated,
364
+ limit: Number.isFinite(effectiveLimit) ? effectiveLimit : null
365
+ },
335
366
  limit: Number.isFinite(effectiveLimit) ? effectiveLimit : 0,
336
367
  orderBy,
337
368
  ...hintParts.length > 0 ? { hint: hintParts.join(" ") } : {},
@@ -381,6 +412,12 @@ var _docsTypedHandler = defineTypedHandler("docs", {
381
412
  ...typeFilter !== void 0 ? { type: typeFilter } : {},
382
413
  count: slicedOwner.length,
383
414
  ...truncatedOwner ? { totalCount: totalCountOwner } : {},
415
+ population: {
416
+ matched: totalCountOwner,
417
+ returned: slicedOwner.length,
418
+ truncated: truncatedOwner,
419
+ limit: Number.isFinite(effectiveLimit) ? effectiveLimit : null
420
+ },
384
421
  limit: Number.isFinite(effectiveLimit) ? effectiveLimit : 0,
385
422
  orderBy,
386
423
  ...hintParts.length > 0 ? { hint: hintParts.join(" ") } : {},
@@ -572,7 +609,12 @@ var _docsTypedHandler = defineTypedHandler("docs", {
572
609
  apply,
573
610
  repair,
574
611
  ...params.olderThanDays !== void 0 ? { olderThanDays: params.olderThanDays } : {},
575
- ...backupReceiptPath !== void 0 ? { backupReceiptPath } : {}
612
+ ...typeof params.only === "string" ? {
613
+ only: params.only.split(",").map((c) => c.trim()).filter((c) => c.length > 0)
614
+ } : {},
615
+ ...backupReceiptPath !== void 0 ? { backupReceiptPath } : {},
616
+ // T14188: mirrors and git come from the invoking checkout.
617
+ checkoutRoot: resolveInvokingCheckout()
576
618
  });
577
619
  if (!result.ok) {
578
620
  return lafsError(result.error.code, result.error.message, "doctor");
@@ -580,8 +622,17 @@ var _docsTypedHandler = defineTypedHandler("docs", {
580
622
  return lafsSuccess(result.report, "doctor");
581
623
  },
582
624
  // ── docs.migrate (T13360 — spec §5 honest legacy docs import) ─────────────
583
- migrate: async (_params) => {
625
+ migrate: async (params) => {
584
626
  const projectRoot = getProjectRoot();
627
+ const limit = params.limit;
628
+ if (limit !== void 0 && (!Number.isInteger(limit) || limit < 1)) {
629
+ return lafsError(
630
+ "E_INVALID_INPUT",
631
+ // @sync-invariant none:input-shape a non-positive or fractional --limit is refused before the store is opened
632
+ `--limit must be a positive integer (got ${String(params.limit)})`,
633
+ "migrate"
634
+ );
635
+ }
585
636
  const { getDb, getNativeDb } = await sqliteForMigration();
586
637
  await getDb(projectRoot);
587
638
  const native = getNativeDb(projectRoot);
@@ -596,10 +647,15 @@ var _docsTypedHandler = defineTypedHandler("docs", {
596
647
  const result = await runLegacyDocMigration({
597
648
  projectRoot,
598
649
  db: native,
599
- cwd: projectRoot
650
+ cwd: projectRoot,
651
+ ...limit !== void 0 ? { limit } : {},
652
+ dryRun: params.dryRun === true
600
653
  });
601
654
  const step = result.report.steps[0];
602
- const summary = result.report.status === "completed" ? `legacy docs migration: ${result.counts.toCapture} captured, ${result.counts.toMarkDangling} dangling, ${result.counts.toSkip} already migrated, ${result.counts.nativeConflicts} native-conflict skips (${result.counts.versions} history rows)` : `legacy docs migration ${result.report.status}: ${result.report.failure ?? "step failed"}`;
655
+ const movedCount = params.dryRun === true ? result.counts.toRekey : result.rekeyed.length;
656
+ const moved = (movedCount > 0 ? `; ${params.dryRun ? "would move" : "moved"} ${movedCount} doc(s) onto the shared identity` : "") + (result.rekeySkipped.length > 0 ? `; ${result.rekeySkipped.length} doc(s) cannot move (${result.rekeySkipped.map((d) => `${d.slug}: ${d.reason}, held by ${d.holder}`).join("; ")})` : "");
657
+ const left = result.counts.remaining > 0 ? `; ${result.counts.remaining} left (limit ${limit}): run cleo docs migrate again` : "";
658
+ const summary = params.dryRun ? `legacy docs migration dry run: would capture ${result.counts.toCapture}, mark ${result.counts.toMarkDangling} dangling (${result.counts.versions} history rows); ${result.counts.toSkip} already migrated, ${result.counts.nativeConflicts} native-conflict skips${moved}${left}; nothing written` : result.skippedStep ? `legacy docs migration: nothing to migrate (${result.counts.toSkip} already migrated, ${result.counts.nativeConflicts} native-conflict skips${moved}); no snapshot written` : result.report.status === "completed" ? `legacy docs migration: ${result.counts.toCapture} captured, ${result.counts.toMarkDangling} dangling, ${result.counts.toSkip} already migrated, ${result.counts.nativeConflicts} native-conflict skips (${result.counts.versions} history rows)${moved}${left}` : `legacy docs migration ${result.report.status}: ${result.report.failure ?? "step failed"}`;
603
659
  return lafsSuccess(
604
660
  {
605
661
  status: result.report.status,
@@ -608,6 +664,10 @@ var _docsTypedHandler = defineTypedHandler("docs", {
608
664
  skipped: result.counts.toSkip,
609
665
  nativeConflicts: result.counts.nativeConflicts,
610
666
  versionsImported: result.counts.versions,
667
+ remaining: result.counts.remaining,
668
+ rekeyed: movedCount,
669
+ rekeySkipped: result.rekeySkipped,
670
+ dryRun: params.dryRun === true,
611
671
  failure: result.report.failure,
612
672
  backupId: step?.backup?.backupId ?? null,
613
673
  transaction: step?.transaction ?? "none",
@@ -616,6 +676,33 @@ var _docsTypedHandler = defineTypedHandler("docs", {
616
676
  "migrate"
617
677
  );
618
678
  },
679
+ // ── docs.modernize (T14113 — messy docs folder → linked CleoDocs) ─────────
680
+ modernize: async (params) => {
681
+ let result;
682
+ try {
683
+ result = await runDocsModernize(
684
+ getProjectRoot(),
685
+ {
686
+ ...params,
687
+ exclude: params.exclude?.split(",").map((e) => e.trim()).filter(Boolean)
688
+ },
689
+ // T14188: the folder and plan files are the invoking checkout's.
690
+ { checkoutRoot: resolveInvokingCheckout() }
691
+ );
692
+ } catch (err) {
693
+ const code = err instanceof Error && "code" in err ? String(err.code) : "";
694
+ if (!code.startsWith("E_MODERNIZE")) throw err;
695
+ return lafsError(
696
+ code,
697
+ // @sync-invariant none:input-shape a stale plan, missing root or unknown receipt is refused; the receipt holds any earlier step
698
+ err instanceof Error ? err.message : code,
699
+ "modernize"
700
+ );
701
+ }
702
+ const counts = result.plan?.counts;
703
+ const summary = result.mode === "rollback" ? `rolled back ${result.receipt?.runId} (${result.receipt?.ops.length ?? 0} steps reversed)` : (result.plan?.mode === "store" ? `${result.plan.storeRows?.length ?? 0} stored docs to re-kind or re-slug` : `${result.plan?.rows.length ?? 0} files: ${counts?.keep ?? 0} keep, ${counts?.rename ?? 0} rename, ${counts?.["merge-into"] ?? 0} merge, ${counts?.delete ?? 0} delete, ${result.plan?.linkFixes?.length ?? 0} link-fix`) + (result.receipt ? `; applied as ${result.receipt.runId} (${result.receipt.ops.length} steps, ${result.receipt.edgeCount} graph edges)` : "; dry run, nothing written");
704
+ return lafsSuccess({ ...result, summary }, "modernize");
705
+ },
619
706
  // ── docs.add ───────────────────────────────────────────────────────────────
620
707
  add: async (params) => {
621
708
  const {
@@ -629,7 +716,8 @@ var _docsTypedHandler = defineTypedHandler("docs", {
629
716
  slug: rawSlug,
630
717
  title: rawTitle,
631
718
  type: rawType,
632
- strict: strictMode
719
+ strict: strictMode,
720
+ newBecause
633
721
  } = params;
634
722
  if (!ownerId) {
635
723
  return lafsError("E_INVALID_INPUT", "ownerId is required", "add");
@@ -841,6 +929,71 @@ var _docsTypedHandler = defineTypedHandler("docs", {
841
929
  );
842
930
  }
843
931
  }
932
+ if (slug !== void 0) {
933
+ const nameCheck = await docNameViolation(slug, type);
934
+ if (nameCheck !== null) {
935
+ if (adrNumber !== void 0) releaseReservedSlug(slug);
936
+ return lafsError(
937
+ "E_DOC_NAME_RULE",
938
+ // @sync-invariant none:input-shape a slug that breaks the doc naming rule is refused before anything is written
939
+ await describeDocNameViolation(slug, nameCheck),
940
+ "add",
941
+ `cleo docs add ... --slug ${nameCheck.suggestion}`,
942
+ { suggestion: nameCheck.suggestion, reasons: nameCheck.reasons }
943
+ );
944
+ }
945
+ }
946
+ {
947
+ const reason = typeof newBecause === "string" ? newBecause.trim() : void 0;
948
+ const dup = await import("@cleocode/core/docs/duplicate-check");
949
+ if (reason !== void 0 && reason.length < dup.NEW_BECAUSE_MIN_LENGTH) {
950
+ if (adrNumber !== void 0 && slug !== void 0) releaseReservedSlug(slug);
951
+ return lafsError(
952
+ "E_INVALID_INPUT",
953
+ // @sync-invariant none:input-shape a too-short --new-because reason is refused before anything is written
954
+ `--new-because needs a reason of at least ${dup.NEW_BECAUSE_MIN_LENGTH} characters saying why this is not an existing doc`,
955
+ "add"
956
+ );
957
+ }
958
+ const bytes = typeof inlineContent === "string" ? Buffer.from(inlineContent, "utf-8") : filePath ? await readFile(resolve(String(filePath))).catch(() => null) : null;
959
+ const text = bytes?.toString("utf-8");
960
+ const title = (typeof rawTitle === "string" && rawTitle.trim() ? rawTitle : null) ?? (text ? dup.markdownTitle(text) : null);
961
+ const match = type === void 0 ? null : dup.findDuplicateDoc(
962
+ {
963
+ ...slug !== void 0 ? { slug } : {},
964
+ ...type !== void 0 ? { kind: type } : {},
965
+ ...title !== null ? { title } : {},
966
+ ...text !== void 0 ? { content: text } : {},
967
+ ...bytes ? { sha256: createHash("sha256").update(bytes).digest("hex") } : {}
968
+ },
969
+ await dup.loadDuplicateCandidates(projectRoot, { kind: type }),
970
+ await dup.readDuplicateThresholds(projectRoot)
971
+ );
972
+ if (match && reason === void 0) {
973
+ if (adrNumber !== void 0 && slug !== void 0) releaseReservedSlug(slug);
974
+ const { message, fix } = dup.describeDuplicate(match);
975
+ return lafsError(
976
+ "E_DOC_DUPLICATE",
977
+ // @sync-invariant none:input-shape a likely duplicate doc is refused before anything is written
978
+ message,
979
+ "add",
980
+ fix,
981
+ {
982
+ existing: { slug: match.slug, kind: match.kind, title: match.title },
983
+ rule: match.rule,
984
+ score: match.score
985
+ }
986
+ );
987
+ }
988
+ if (match && reason !== void 0) {
989
+ await dup.recordNewBecause(projectRoot, {
990
+ slug: slug ?? null,
991
+ kind: type ?? null,
992
+ resembles: match,
993
+ reason
994
+ });
995
+ }
996
+ }
844
997
  if (slug !== void 0 && adrNumber === void 0) {
845
998
  const reservation = await reserveSlugForDispatch(projectRoot, {
846
999
  kind: type ?? "",
@@ -945,6 +1098,7 @@ var _docsTypedHandler = defineTypedHandler("docs", {
945
1098
  throw err;
946
1099
  }
947
1100
  if (adrNumber !== void 0 && slug !== void 0) consumeReservedSlug(slug);
1101
+ const headVersionUid = slug !== void 0 ? await recordAddedDocHead(projectRoot, slug, attachedBy, bytes) : void 0;
948
1102
  let backend = "llmtxt";
949
1103
  try {
950
1104
  const blobMirror = createAttachmentBlobStore(projectRoot);
@@ -989,7 +1143,8 @@ var _docsTypedHandler = defineTypedHandler("docs", {
989
1143
  attachmentBackend: backend,
990
1144
  ...slug !== void 0 ? { slug } : {},
991
1145
  ...type !== void 0 ? { type } : {},
992
- ...adrNumber !== void 0 ? { adrNumber } : {}
1146
+ ...adrNumber !== void 0 ? { adrNumber } : {},
1147
+ ...headVersionUid !== void 0 ? { headVersionUid } : {}
993
1148
  },
994
1149
  "add"
995
1150
  );
@@ -1059,6 +1214,7 @@ var _docsTypedHandler = defineTypedHandler("docs", {
1059
1214
  throw err;
1060
1215
  }
1061
1216
  if (adrNumber !== void 0 && slug !== void 0) consumeReservedSlug(slug);
1217
+ const headVersionUid = slug !== void 0 ? await recordAddedDocHead(projectRoot, slug, attachedBy, bytes) : void 0;
1062
1218
  const blobName = slug ?? meta.sha256.slice(0, 12);
1063
1219
  let backend = "llmtxt";
1064
1220
  try {
@@ -1104,7 +1260,8 @@ var _docsTypedHandler = defineTypedHandler("docs", {
1104
1260
  attachmentBackend: backend,
1105
1261
  ...slug !== void 0 ? { slug } : {},
1106
1262
  ...type !== void 0 ? { type } : {},
1107
- ...adrNumber !== void 0 ? { adrNumber } : {}
1263
+ ...adrNumber !== void 0 ? { adrNumber } : {},
1264
+ ...headVersionUid !== void 0 ? { headVersionUid } : {}
1108
1265
  },
1109
1266
  "add"
1110
1267
  );
@@ -1147,6 +1304,7 @@ var _docsTypedHandler = defineTypedHandler("docs", {
1147
1304
  throw err;
1148
1305
  }
1149
1306
  if (adrNumber !== void 0 && slug !== void 0) consumeReservedSlug(slug);
1307
+ const headVersionUid = slug !== void 0 ? await recordAddedDocHead(projectRoot, slug, attachedBy, urlBytes) : void 0;
1150
1308
  const backend = await currentAttachmentBackend();
1151
1309
  const projection = projectionCapture.status === "ready" ? await projectDocumentAttachment(projectionCapture.context, {
1152
1310
  attachmentId: meta.id,
@@ -1181,7 +1339,8 @@ var _docsTypedHandler = defineTypedHandler("docs", {
1181
1339
  attachmentBackend: backend,
1182
1340
  ...slug !== void 0 ? { slug } : {},
1183
1341
  ...type !== void 0 ? { type } : {},
1184
- ...adrNumber !== void 0 ? { adrNumber } : {}
1342
+ ...adrNumber !== void 0 ? { adrNumber } : {},
1343
+ ...headVersionUid !== void 0 ? { headVersionUid } : {}
1185
1344
  },
1186
1345
  "add"
1187
1346
  );
@@ -1396,15 +1555,20 @@ var _docsTypedHandler = defineTypedHandler("docs", {
1396
1555
  "E_INVALID_INPUT",
1397
1556
  // @sync-invariant none:input-shape a missing ADR slug or decision id is refused before any write
1398
1557
  "<adrSlug> and <decisionId> are required",
1399
- "link-decision"
1558
+ "link-decision",
1559
+ "cleo docs link-decision <adrSlug> <decisionId>"
1400
1560
  );
1401
1561
  }
1402
1562
  return decisionLinkResponse("link-decision", async () => {
1403
1563
  if (await createDocsReadModel().resolveLatest(adrSlug) === null)
1404
- throw new CleoError(ExitCode.NOT_FOUND, `no doc has the slug '${adrSlug}'`);
1564
+ throw new CleoError(ExitCode.NOT_FOUND, `no doc has the slug '${adrSlug}'`, {
1565
+ fix: "cleo docs list --type adr"
1566
+ });
1405
1567
  const { recallDecision } = await import("@cleocode/core/memory/decisions");
1406
1568
  if (await recallDecision(getProjectRoot(), decisionId) === null)
1407
- throw new CleoError(ExitCode.NOT_FOUND, `no stored decision has the id '${decisionId}'`);
1569
+ throw new CleoError(ExitCode.NOT_FOUND, `no stored decision has the id '${decisionId}'`, {
1570
+ fix: 'cleo memory decision-find "<words>"'
1571
+ });
1408
1572
  const { inserted } = await linkDecisionToAdr(getProjectRoot(), {
1409
1573
  decisionId,
1410
1574
  adrSlug,
@@ -1420,7 +1584,8 @@ var _docsTypedHandler = defineTypedHandler("docs", {
1420
1584
  "E_INVALID_INPUT",
1421
1585
  // @sync-invariant none:input-shape a missing ADR slug or decision id is refused before any write
1422
1586
  "<adrSlug> and <decisionId> are required",
1423
- "unlink-decision"
1587
+ "unlink-decision",
1588
+ "cleo docs unlink-decision <adrSlug> <decisionId>"
1424
1589
  );
1425
1590
  }
1426
1591
  return decisionLinkResponse("unlink-decision", async () => {
@@ -1541,8 +1706,15 @@ var QUERY_OPS = /* @__PURE__ */ new Set([
1541
1706
  "audit",
1542
1707
  "doctor",
1543
1708
  "triage",
1544
- "stats"
1709
+ "stats",
1710
+ "rot"
1545
1711
  ]);
1712
+ var syncDocsFts = lazyOperation(
1713
+ async () => (await import("@cleocode/core/docs/docs-fts")).syncDocsFts
1714
+ );
1715
+ async function syncDocsIndex(projectRoot) {
1716
+ await syncDocsFts(projectRoot).catch(() => void 0);
1717
+ }
1546
1718
  var MUTATE_OPS = /* @__PURE__ */ new Set([
1547
1719
  "add",
1548
1720
  "remove",
@@ -1555,7 +1727,8 @@ var MUTATE_OPS = /* @__PURE__ */ new Set([
1555
1727
  "sync",
1556
1728
  "import",
1557
1729
  "doctor",
1558
- "migrate"
1730
+ "migrate",
1731
+ "modernize"
1559
1732
  ]);
1560
1733
  async function dispatchDocsLegacyQuery(operation, params) {
1561
1734
  const projectRoot = getProjectRoot();
@@ -1614,7 +1787,7 @@ async function dispatchDocsLegacyQuery(operation, params) {
1614
1787
  return readAuditLog(projectRoot, params["slug"]);
1615
1788
  case "status": {
1616
1789
  const model = createDocsReadModel();
1617
- return model.status(projectRoot);
1790
+ return model.status(projectRoot, resolveInvokingCheckout());
1618
1791
  }
1619
1792
  case "triage":
1620
1793
  return triageDocs({
@@ -1625,6 +1798,11 @@ async function dispatchDocsLegacyQuery(operation, params) {
1625
1798
  });
1626
1799
  case "stats":
1627
1800
  return computeDocsStats({ projectRoot });
1801
+ case "rot":
1802
+ return scanDocsRot({
1803
+ projectRoot: resolveInvokingCheckout(),
1804
+ ...typeof params["changed"] === "string" ? { changed: params["changed"] } : {}
1805
+ });
1628
1806
  default:
1629
1807
  throw new Error(`Unsupported docs query operation: ${operation}`);
1630
1808
  }
@@ -1645,6 +1823,8 @@ async function dispatchDocsLegacyMutate(operation, params) {
1645
1823
  toPath: String(params["toPath"]),
1646
1824
  attachmentId: typeof params["attachmentId"] === "string" ? params["attachmentId"] : void 0,
1647
1825
  projectRoot,
1826
+ // T14135: run from a canonical CLEO worktree, a relative --to lands in it.
1827
+ cwd: process.cwd(),
1648
1828
  // T13919: a dry run runs the real checks and writes nothing.
1649
1829
  ...params["dryRun"] === true ? { dryRun: true } : {}
1650
1830
  });
@@ -1821,12 +2001,16 @@ var DocsHandler = class {
1821
2001
  operation,
1822
2002
  params ?? {}
1823
2003
  );
1824
- return docsEnvelopeToResponse(envelope, "mutate", operation, startTime);
2004
+ const response = docsEnvelopeToResponse(envelope, "mutate", operation, startTime);
2005
+ if (response.success) await syncDocsIndex(projectRoot);
2006
+ return response;
1825
2007
  }
2008
+ const data = await dispatchDocsLegacyMutate(operation, params ?? {});
2009
+ await syncDocsIndex(projectRoot);
1826
2010
  return {
1827
2011
  meta: dispatchMeta("mutate", "docs", operation, startTime),
1828
2012
  success: true,
1829
- data: await dispatchDocsLegacyMutate(operation, params ?? {})
2013
+ data
1830
2014
  };
1831
2015
  }
1832
2016
  );
@@ -1855,7 +2039,8 @@ var DocsHandler = class {
1855
2039
  "audit",
1856
2040
  "doctor",
1857
2041
  "triage",
1858
- "stats"
2042
+ "stats",
2043
+ "rot"
1859
2044
  ],
1860
2045
  mutate: [
1861
2046
  "add",
@@ -1869,7 +2054,8 @@ var DocsHandler = class {
1869
2054
  "sync",
1870
2055
  "import",
1871
2056
  "doctor",
1872
- "migrate"
2057
+ "migrate",
2058
+ "modernize"
1873
2059
  ]
1874
2060
  };
1875
2061
  }
@@ -1877,4 +2063,4 @@ var DocsHandler = class {
1877
2063
  export {
1878
2064
  DocsHandler
1879
2065
  };
1880
- //# sourceMappingURL=docs-NF5COLOB.js.map
2066
+ //# sourceMappingURL=docs-SI2YNPSG.js.map