@cleocode/core 2026.10.1 → 2026.10.3

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 (389) hide show
  1. package/dist/build-provenance.json +2 -2
  2. package/dist/cloud/http.d.ts +2 -0
  3. package/dist/cloud/http.d.ts.map +1 -1
  4. package/dist/cloud/http.js +3 -0
  5. package/dist/cloud/http.js.map +1 -1
  6. package/dist/cloud/journal.d.ts +9 -5
  7. package/dist/cloud/journal.d.ts.map +1 -1
  8. package/dist/cloud/journal.js +29 -8
  9. package/dist/cloud/journal.js.map +1 -1
  10. package/dist/cloud/manifest-check.d.ts +140 -4
  11. package/dist/cloud/manifest-check.d.ts.map +1 -1
  12. package/dist/cloud/manifest-check.js +322 -10
  13. package/dist/cloud/manifest-check.js.map +1 -1
  14. package/dist/cloud/nexus-attach.d.ts +25 -0
  15. package/dist/cloud/nexus-attach.d.ts.map +1 -1
  16. package/dist/cloud/nexus-attach.js +81 -6
  17. package/dist/cloud/nexus-attach.js.map +1 -1
  18. package/dist/cloud/nexus-cloud-activity.d.ts +37 -0
  19. package/dist/cloud/nexus-cloud-activity.d.ts.map +1 -0
  20. package/dist/cloud/nexus-cloud-activity.js +79 -0
  21. package/dist/cloud/nexus-cloud-activity.js.map +1 -0
  22. package/dist/cloud/nexus-cloud-status.d.ts.map +1 -1
  23. package/dist/cloud/nexus-cloud-status.js +36 -0
  24. package/dist/cloud/nexus-cloud-status.js.map +1 -1
  25. package/dist/cloud/nexus-device.d.ts +1 -1
  26. package/dist/cloud/nexus-enrol.d.ts.map +1 -1
  27. package/dist/cloud/nexus-enrol.js +5 -0
  28. package/dist/cloud/nexus-enrol.js.map +1 -1
  29. package/dist/cloud/nexus-home.d.ts +74 -0
  30. package/dist/cloud/nexus-home.d.ts.map +1 -0
  31. package/dist/cloud/nexus-home.js +97 -0
  32. package/dist/cloud/nexus-home.js.map +1 -0
  33. package/dist/cloud/nexus-vault-keys.d.ts +130 -0
  34. package/dist/cloud/nexus-vault-keys.d.ts.map +1 -0
  35. package/dist/cloud/nexus-vault-keys.js +347 -0
  36. package/dist/cloud/nexus-vault-keys.js.map +1 -0
  37. package/dist/cloud/nexus-vault-state.d.ts +121 -0
  38. package/dist/cloud/nexus-vault-state.d.ts.map +1 -0
  39. package/dist/cloud/nexus-vault-state.js +274 -0
  40. package/dist/cloud/nexus-vault-state.js.map +1 -0
  41. package/dist/cloud/nexus-vault.d.ts +160 -0
  42. package/dist/cloud/nexus-vault.d.ts.map +1 -0
  43. package/dist/cloud/nexus-vault.js +1745 -0
  44. package/dist/cloud/nexus-vault.js.map +1 -0
  45. package/dist/cloud/signing.d.ts +24 -8
  46. package/dist/cloud/signing.d.ts.map +1 -1
  47. package/dist/cloud/signing.js +61 -15
  48. package/dist/cloud/signing.js.map +1 -1
  49. package/dist/docs/export-document.js +8137 -3318
  50. package/dist/docs/export-document.js.map +3 -3
  51. package/dist/doctor/migrations.d.ts +75 -0
  52. package/dist/doctor/migrations.d.ts.map +1 -0
  53. package/dist/doctor/migrations.js +136 -0
  54. package/dist/doctor/migrations.js.map +1 -0
  55. package/dist/doctor/sync-sealer.d.ts +48 -0
  56. package/dist/doctor/sync-sealer.d.ts.map +1 -0
  57. package/dist/doctor/sync-sealer.js +109 -0
  58. package/dist/doctor/sync-sealer.js.map +1 -0
  59. package/dist/doctor/sync-triggers.d.ts +53 -0
  60. package/dist/doctor/sync-triggers.d.ts.map +1 -0
  61. package/dist/doctor/sync-triggers.js +157 -0
  62. package/dist/doctor/sync-triggers.js.map +1 -0
  63. package/dist/init.d.ts.map +1 -1
  64. package/dist/init.js +5 -1
  65. package/dist/init.js.map +1 -1
  66. package/dist/internal.d.ts +1 -1
  67. package/dist/internal.d.ts.map +1 -1
  68. package/dist/internal.js +1 -1
  69. package/dist/internal.js.map +1 -1
  70. package/dist/llm/plugin-facade.js +8442 -3623
  71. package/dist/llm/plugin-facade.js.map +3 -3
  72. package/dist/nexus/projects-clean.d.ts +3 -0
  73. package/dist/nexus/projects-clean.d.ts.map +1 -1
  74. package/dist/nexus/projects-clean.js +9 -3
  75. package/dist/nexus/projects-clean.js.map +1 -1
  76. package/dist/nexus/registry-roots.d.ts +3 -1
  77. package/dist/nexus/registry-roots.d.ts.map +1 -1
  78. package/dist/nexus/registry-roots.js +5 -2
  79. package/dist/nexus/registry-roots.js.map +1 -1
  80. package/dist/nexus/registry.d.ts +8 -1
  81. package/dist/nexus/registry.d.ts.map +1 -1
  82. package/dist/nexus/registry.js +24 -10
  83. package/dist/nexus/registry.js.map +1 -1
  84. package/dist/nexus/workspace.d.ts +4 -1
  85. package/dist/nexus/workspace.d.ts.map +1 -1
  86. package/dist/nexus/workspace.js +10 -4
  87. package/dist/nexus/workspace.js.map +1 -1
  88. package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
  89. package/dist/orchestrate/spawn-ops.js +7 -2
  90. package/dist/orchestrate/spawn-ops.js.map +1 -1
  91. package/dist/orchestrate/worker-verify.d.ts +121 -12
  92. package/dist/orchestrate/worker-verify.d.ts.map +1 -1
  93. package/dist/orchestrate/worker-verify.js +172 -21
  94. package/dist/orchestrate/worker-verify.js.map +1 -1
  95. package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
  96. package/dist/orchestration/spawn-prompt.js +15 -9
  97. package/dist/orchestration/spawn-prompt.js.map +1 -1
  98. package/dist/release/ci-evidence.d.ts +9 -0
  99. package/dist/release/ci-evidence.d.ts.map +1 -1
  100. package/dist/release/ci-evidence.js +9 -2
  101. package/dist/release/ci-evidence.js.map +1 -1
  102. package/dist/resources/backend.d.ts +15 -3
  103. package/dist/resources/backend.d.ts.map +1 -1
  104. package/dist/resources/backend.js +7 -3
  105. package/dist/resources/backend.js.map +1 -1
  106. package/dist/resources/darwin-backend.d.ts +142 -0
  107. package/dist/resources/darwin-backend.d.ts.map +1 -0
  108. package/dist/resources/darwin-backend.js +288 -0
  109. package/dist/resources/darwin-backend.js.map +1 -0
  110. package/dist/resources/governor.d.ts +44 -1
  111. package/dist/resources/governor.d.ts.map +1 -1
  112. package/dist/resources/governor.js +100 -36
  113. package/dist/resources/governor.js.map +1 -1
  114. package/dist/resources/heavy-command.d.ts +132 -0
  115. package/dist/resources/heavy-command.d.ts.map +1 -0
  116. package/dist/resources/heavy-command.js +768 -0
  117. package/dist/resources/heavy-command.js.map +1 -0
  118. package/dist/resources/monitor.d.ts +50 -1
  119. package/dist/resources/monitor.d.ts.map +1 -1
  120. package/dist/resources/monitor.js +83 -1
  121. package/dist/resources/monitor.js.map +1 -1
  122. package/dist/resources/run-admission.d.ts +303 -0
  123. package/dist/resources/run-admission.d.ts.map +1 -0
  124. package/dist/resources/run-admission.js +648 -0
  125. package/dist/resources/run-admission.js.map +1 -0
  126. package/dist/resources/run-class.d.ts +111 -0
  127. package/dist/resources/run-class.d.ts.map +1 -0
  128. package/dist/resources/run-class.js +658 -0
  129. package/dist/resources/run-class.js.map +1 -0
  130. package/dist/resources/run-governed.d.ts +158 -0
  131. package/dist/resources/run-governed.d.ts.map +1 -0
  132. package/dist/resources/run-governed.js +406 -0
  133. package/dist/resources/run-governed.js.map +1 -0
  134. package/dist/resources/slot-holder.d.ts +267 -0
  135. package/dist/resources/slot-holder.d.ts.map +1 -0
  136. package/dist/resources/slot-holder.js +505 -0
  137. package/dist/resources/slot-holder.js.map +1 -0
  138. package/dist/resources/tool-groups.d.ts +74 -0
  139. package/dist/resources/tool-groups.d.ts.map +1 -0
  140. package/dist/resources/tool-groups.js +118 -0
  141. package/dist/resources/tool-groups.js.map +1 -0
  142. package/dist/routing/build-command-groups.d.ts.map +1 -1
  143. package/dist/routing/build-command-groups.js +1 -0
  144. package/dist/routing/build-command-groups.js.map +1 -1
  145. package/dist/selfimprove/fix-gen.js +8446 -3627
  146. package/dist/selfimprove/fix-gen.js.map +3 -3
  147. package/dist/sentient/cross-project-hygiene.d.ts +3 -2
  148. package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
  149. package/dist/sentient/cross-project-hygiene.js +5 -2
  150. package/dist/sentient/cross-project-hygiene.js.map +1 -1
  151. package/dist/sentient/state.d.ts +7 -0
  152. package/dist/sentient/state.d.ts.map +1 -1
  153. package/dist/sentient/state.js.map +1 -1
  154. package/dist/sentient/tick.d.ts +14 -2
  155. package/dist/sentient/tick.d.ts.map +1 -1
  156. package/dist/sentient/tick.js +63 -4
  157. package/dist/sentient/tick.js.map +1 -1
  158. package/dist/store/backup-recover.d.ts.map +1 -1
  159. package/dist/store/backup-recover.js +5 -0
  160. package/dist/store/backup-recover.js.map +1 -1
  161. package/dist/store/data-accessor.d.ts +1 -0
  162. package/dist/store/data-accessor.d.ts.map +1 -1
  163. package/dist/store/data-accessor.js +7 -0
  164. package/dist/store/data-accessor.js.map +1 -1
  165. package/dist/store/dual-scope-db.d.ts +23 -1
  166. package/dist/store/dual-scope-db.d.ts.map +1 -1
  167. package/dist/store/dual-scope-db.js +126 -36
  168. package/dist/store/dual-scope-db.js.map +1 -1
  169. package/dist/store/exodus/recovery.d.ts.map +1 -1
  170. package/dist/store/exodus/recovery.js +15 -0
  171. package/dist/store/exodus/recovery.js.map +1 -1
  172. package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
  173. package/dist/store/legacy-tasks-lineage.js +5 -0
  174. package/dist/store/legacy-tasks-lineage.js.map +1 -1
  175. package/dist/store/lock.d.ts +8 -1
  176. package/dist/store/lock.d.ts.map +1 -1
  177. package/dist/store/lock.js +10 -2
  178. package/dist/store/lock.js.map +1 -1
  179. package/dist/store/migration-manager.d.ts +5 -0
  180. package/dist/store/migration-manager.d.ts.map +1 -1
  181. package/dist/store/migration-manager.js +11 -0
  182. package/dist/store/migration-manager.js.map +1 -1
  183. package/dist/store/migration-runner.d.ts +158 -0
  184. package/dist/store/migration-runner.d.ts.map +1 -0
  185. package/dist/store/migration-runner.js +493 -0
  186. package/dist/store/migration-runner.js.map +1 -0
  187. package/dist/store/portable-bundle-import.d.ts +15 -1
  188. package/dist/store/portable-bundle-import.d.ts.map +1 -1
  189. package/dist/store/portable-bundle-import.js +24 -4
  190. package/dist/store/portable-bundle-import.js.map +1 -1
  191. package/dist/store/portable-bundle-relocate.d.ts +43 -0
  192. package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
  193. package/dist/store/portable-bundle-relocate.js +79 -5
  194. package/dist/store/portable-bundle-relocate.js.map +1 -1
  195. package/dist/store/portable-bundle-scan.d.ts +42 -0
  196. package/dist/store/portable-bundle-scan.d.ts.map +1 -1
  197. package/dist/store/portable-bundle-scan.js +132 -25
  198. package/dist/store/portable-bundle-scan.js.map +1 -1
  199. package/dist/store/portable-bundle.d.ts +40 -0
  200. package/dist/store/portable-bundle.d.ts.map +1 -1
  201. package/dist/store/portable-bundle.js +43 -7
  202. package/dist/store/portable-bundle.js.map +1 -1
  203. package/dist/store/row-identity-registry.d.ts +137 -7
  204. package/dist/store/row-identity-registry.d.ts.map +1 -1
  205. package/dist/store/row-identity-registry.js +364 -9
  206. package/dist/store/row-identity-registry.js.map +1 -1
  207. package/dist/store/row-identity.d.ts.map +1 -1
  208. package/dist/store/row-identity.js +9 -10
  209. package/dist/store/row-identity.js.map +1 -1
  210. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  211. package/dist/store/sqlite-data-accessor.js +10 -0
  212. package/dist/store/sqlite-data-accessor.js.map +1 -1
  213. package/dist/store/sqlite.d.ts +31 -0
  214. package/dist/store/sqlite.d.ts.map +1 -1
  215. package/dist/store/sqlite.js +5 -1
  216. package/dist/store/sqlite.js.map +1 -1
  217. package/dist/store/sync/capture.d.ts +203 -0
  218. package/dist/store/sync/capture.d.ts.map +1 -0
  219. package/dist/store/sync/capture.js +562 -0
  220. package/dist/store/sync/capture.js.map +1 -0
  221. package/dist/store/sync/clock-store.d.ts.map +1 -1
  222. package/dist/store/sync/clock-store.js +2 -0
  223. package/dist/store/sync/clock-store.js.map +1 -1
  224. package/dist/store/sync/fk-orphans.d.ts +133 -0
  225. package/dist/store/sync/fk-orphans.d.ts.map +1 -0
  226. package/dist/store/sync/fk-orphans.js +265 -0
  227. package/dist/store/sync/fk-orphans.js.map +1 -0
  228. package/dist/store/sync/flags.d.ts +7 -0
  229. package/dist/store/sync/flags.d.ts.map +1 -1
  230. package/dist/store/sync/flags.js +16 -0
  231. package/dist/store/sync/flags.js.map +1 -1
  232. package/dist/store/sync/hlc.d.ts.map +1 -1
  233. package/dist/store/sync/hlc.js +4 -0
  234. package/dist/store/sync/hlc.js.map +1 -1
  235. package/dist/store/sync/identity-fill.d.ts +45 -0
  236. package/dist/store/sync/identity-fill.d.ts.map +1 -0
  237. package/dist/store/sync/identity-fill.js +85 -0
  238. package/dist/store/sync/identity-fill.js.map +1 -0
  239. package/dist/store/sync/machinery.d.ts +27 -0
  240. package/dist/store/sync/machinery.d.ts.map +1 -0
  241. package/dist/store/sync/machinery.js +44 -0
  242. package/dist/store/sync/machinery.js.map +1 -0
  243. package/dist/store/sync/netting.d.ts +120 -0
  244. package/dist/store/sync/netting.d.ts.map +1 -0
  245. package/dist/store/sync/netting.js +336 -0
  246. package/dist/store/sync/netting.js.map +1 -0
  247. package/dist/store/sync/replica.d.ts +27 -2
  248. package/dist/store/sync/replica.d.ts.map +1 -1
  249. package/dist/store/sync/replica.js +47 -3
  250. package/dist/store/sync/replica.js.map +1 -1
  251. package/dist/store/sync/schema.d.ts +12 -0
  252. package/dist/store/sync/schema.d.ts.map +1 -1
  253. package/dist/store/sync/schema.js +21 -0
  254. package/dist/store/sync/schema.js.map +1 -1
  255. package/dist/store/sync/seal-backlog.d.ts +21 -0
  256. package/dist/store/sync/seal-backlog.d.ts.map +1 -0
  257. package/dist/store/sync/seal-backlog.js +24 -0
  258. package/dist/store/sync/seal-backlog.js.map +1 -0
  259. package/dist/store/sync/sealer-values.d.ts +34 -0
  260. package/dist/store/sync/sealer-values.d.ts.map +1 -0
  261. package/dist/store/sync/sealer-values.js +53 -0
  262. package/dist/store/sync/sealer-values.js.map +1 -0
  263. package/dist/store/sync/sealer.d.ts +145 -0
  264. package/dist/store/sync/sealer.d.ts.map +1 -0
  265. package/dist/store/sync/sealer.js +906 -0
  266. package/dist/store/sync/sealer.js.map +1 -0
  267. package/dist/store/sync/structural.d.ts +63 -0
  268. package/dist/store/sync/structural.d.ts.map +1 -0
  269. package/dist/store/sync/structural.js +180 -0
  270. package/dist/store/sync/structural.js.map +1 -0
  271. package/dist/store/sync/timestamps.d.ts +92 -0
  272. package/dist/store/sync/timestamps.d.ts.map +1 -0
  273. package/dist/store/sync/timestamps.js +228 -0
  274. package/dist/store/sync/timestamps.js.map +1 -0
  275. package/dist/store/sync/tombstones.d.ts +75 -0
  276. package/dist/store/sync/tombstones.d.ts.map +1 -0
  277. package/dist/store/sync/tombstones.js +103 -0
  278. package/dist/store/sync/tombstones.js.map +1 -0
  279. package/dist/store/sync/trigger-classes.d.ts +221 -0
  280. package/dist/store/sync/trigger-classes.d.ts.map +1 -0
  281. package/dist/store/sync/trigger-classes.js +441 -0
  282. package/dist/store/sync/trigger-classes.js.map +1 -0
  283. package/dist/store/sync/trigger-suspend-at-path.d.ts +23 -0
  284. package/dist/store/sync/trigger-suspend-at-path.d.ts.map +1 -0
  285. package/dist/store/sync/trigger-suspend-at-path.js +44 -0
  286. package/dist/store/sync/trigger-suspend-at-path.js.map +1 -0
  287. package/dist/store/sync/writer-version.d.ts +43 -0
  288. package/dist/store/sync/writer-version.d.ts.map +1 -0
  289. package/dist/store/sync/writer-version.js +90 -0
  290. package/dist/store/sync/writer-version.js.map +1 -0
  291. package/dist/store/table-classification.d.ts.map +1 -1
  292. package/dist/store/table-classification.js +102 -0
  293. package/dist/store/table-classification.js.map +1 -1
  294. package/dist/store/trigger-suspend-schema.d.ts +44 -0
  295. package/dist/store/trigger-suspend-schema.d.ts.map +1 -0
  296. package/dist/store/trigger-suspend-schema.js +25 -0
  297. package/dist/store/trigger-suspend-schema.js.map +1 -0
  298. package/dist/store/vault-manifest.d.ts +365 -0
  299. package/dist/store/vault-manifest.d.ts.map +1 -0
  300. package/dist/store/vault-manifest.js +812 -0
  301. package/dist/store/vault-manifest.js.map +1 -0
  302. package/dist/store/writer-lease.d.ts +31 -0
  303. package/dist/store/writer-lease.d.ts.map +1 -1
  304. package/dist/store/writer-lease.js +65 -2
  305. package/dist/store/writer-lease.js.map +1 -1
  306. package/dist/system/health.d.ts.map +1 -1
  307. package/dist/system/health.js +21 -0
  308. package/dist/system/health.js.map +1 -1
  309. package/dist/system/project-health.d.ts.map +1 -1
  310. package/dist/system/project-health.js +3 -1
  311. package/dist/system/project-health.js.map +1 -1
  312. package/dist/tasks/affected-packages.d.ts +58 -0
  313. package/dist/tasks/affected-packages.d.ts.map +1 -1
  314. package/dist/tasks/affected-packages.js +75 -6
  315. package/dist/tasks/affected-packages.js.map +1 -1
  316. package/dist/tasks/affected-scope.d.ts +150 -23
  317. package/dist/tasks/affected-scope.d.ts.map +1 -1
  318. package/dist/tasks/affected-scope.js +320 -32
  319. package/dist/tasks/affected-scope.js.map +1 -1
  320. package/dist/tasks/change-set.d.ts +96 -0
  321. package/dist/tasks/change-set.d.ts.map +1 -1
  322. package/dist/tasks/change-set.js +169 -4
  323. package/dist/tasks/change-set.js.map +1 -1
  324. package/dist/tasks/complete-ci.d.ts +115 -0
  325. package/dist/tasks/complete-ci.d.ts.map +1 -0
  326. package/dist/tasks/complete-ci.js +171 -0
  327. package/dist/tasks/complete-ci.js.map +1 -0
  328. package/dist/tasks/complete.d.ts.map +1 -1
  329. package/dist/tasks/complete.js +50 -17
  330. package/dist/tasks/complete.js.map +1 -1
  331. package/dist/tasks/compute-task-view.d.ts.map +1 -1
  332. package/dist/tasks/compute-task-view.js +7 -0
  333. package/dist/tasks/compute-task-view.js.map +1 -1
  334. package/dist/tasks/done-plan.d.ts.map +1 -1
  335. package/dist/tasks/done-plan.js +51 -30
  336. package/dist/tasks/done-plan.js.map +1 -1
  337. package/dist/tasks/done-record.d.ts +6 -0
  338. package/dist/tasks/done-record.d.ts.map +1 -1
  339. package/dist/tasks/done-record.js +9 -3
  340. package/dist/tasks/done-record.js.map +1 -1
  341. package/dist/tasks/evidence.d.ts +3 -2
  342. package/dist/tasks/evidence.d.ts.map +1 -1
  343. package/dist/tasks/evidence.js +143 -12
  344. package/dist/tasks/evidence.js.map +1 -1
  345. package/dist/tasks/gate-notes.d.ts +22 -0
  346. package/dist/tasks/gate-notes.d.ts.map +1 -0
  347. package/dist/tasks/gate-notes.js +33 -0
  348. package/dist/tasks/gate-notes.js.map +1 -0
  349. package/dist/tasks/index.d.ts +2 -1
  350. package/dist/tasks/index.d.ts.map +1 -1
  351. package/dist/tasks/index.js +2 -1
  352. package/dist/tasks/index.js.map +1 -1
  353. package/dist/tasks/test-run-binding.d.ts +117 -0
  354. package/dist/tasks/test-run-binding.d.ts.map +1 -0
  355. package/dist/tasks/test-run-binding.js +365 -0
  356. package/dist/tasks/test-run-binding.js.map +1 -0
  357. package/dist/tasks/tool-cache-env.d.ts +123 -0
  358. package/dist/tasks/tool-cache-env.d.ts.map +1 -0
  359. package/dist/tasks/tool-cache-env.js +287 -0
  360. package/dist/tasks/tool-cache-env.js.map +1 -0
  361. package/dist/tasks/tool-cache-failed-first.d.ts +155 -0
  362. package/dist/tasks/tool-cache-failed-first.d.ts.map +1 -0
  363. package/dist/tasks/tool-cache-failed-first.js +285 -0
  364. package/dist/tasks/tool-cache-failed-first.js.map +1 -0
  365. package/dist/tasks/tool-cache.d.ts +375 -55
  366. package/dist/tasks/tool-cache.d.ts.map +1 -1
  367. package/dist/tasks/tool-cache.js +912 -303
  368. package/dist/tasks/tool-cache.js.map +1 -1
  369. package/dist/tasks/tool-resolver.d.ts +4 -3
  370. package/dist/tasks/tool-resolver.d.ts.map +1 -1
  371. package/dist/tasks/tool-resolver.js +15 -4
  372. package/dist/tasks/tool-resolver.js.map +1 -1
  373. package/dist/tasks/tool-semaphore.d.ts +67 -7
  374. package/dist/tasks/tool-semaphore.d.ts.map +1 -1
  375. package/dist/tasks/tool-semaphore.js +134 -56
  376. package/dist/tasks/tool-semaphore.js.map +1 -1
  377. package/dist/upgrade.d.ts.map +1 -1
  378. package/dist/upgrade.js +4 -0
  379. package/dist/upgrade.js.map +1 -1
  380. package/dist/validation/engine-ops.d.ts +6 -0
  381. package/dist/validation/engine-ops.d.ts.map +1 -1
  382. package/dist/validation/engine-ops.js +8 -0
  383. package/dist/validation/engine-ops.js.map +1 -1
  384. package/migrations/drizzle-cleo-project/20260930170000_t12819-trigger-suspend-clause/migration.sql +367 -0
  385. package/migrations/sync-journal/20260930120000_t12343-capture/migration.sql +47 -0
  386. package/migrations/sync-journal/20261001170000_t12984-sealer/migration.sql +101 -0
  387. package/package.json +13 -13
  388. package/templates/CLEO-INJECTION.md +5 -5
  389. package/templates/CLEO-REFERENCE.md +8 -4
@@ -0,0 +1,267 @@
1
+ /**
2
+ * Holder records for local lock slots: the governor's class slots and the
3
+ * tool semaphore's per-tool slots (T12963, gh#1222).
4
+ *
5
+ * `proper-lockfile` frees a slot whose holder died only after
6
+ * {@link SLOT_LOCK_STALE_MS} (10 min) of mtime staleness. With a one-slot
7
+ * `test-run` budget, a SIGKILLed `cleo verify tool:test` blocked every later
8
+ * heavy run for ten minutes, and the deferral named no one. Each slot carries
9
+ * a `<slot>.holder.json` record: the holder's pid and process start time, the
10
+ * lock directory it describes, and the process groups of the tools it started.
11
+ * A slot is reaped only when the holder pid is provably gone (or recycled) AND
12
+ * every one of those tool groups is gone too: a tool started detached outlives
13
+ * a SIGKILLed cleo, and it is the tool that uses the machine.
14
+ *
15
+ * Start times are `ps -o lstart=` strings rendered under `PS_STABLE_ENV` (UTC,
16
+ * C locale), so a string written by one process compares equal to the same
17
+ * process's start time read by another, whatever either one's `TZ` or locale.
18
+ *
19
+ * @task T12963
20
+ */
21
+ import type { ResourceClass } from '@cleocode/contracts';
22
+ /**
23
+ * A slot lock older than this may be stolen (its holder presumed dead): the
24
+ * `proper-lockfile` stale window of every governor slot, and the default of
25
+ * every tool-semaphore slot.
26
+ */
27
+ export declare const SLOT_LOCK_STALE_MS = 600000;
28
+ /**
29
+ * How often a governor slot holder refreshes its lock. Short, so a holder
30
+ * frozen by a job pause keeps its slot for nearly the whole stale window
31
+ * (#1777 round 6).
32
+ */
33
+ export declare const SLOT_LOCK_UPDATE_MS = 15000;
34
+ /**
35
+ * The liveness fields every slot holder record carries.
36
+ *
37
+ * @task T12963
38
+ */
39
+ export interface SlotHolderIdentity {
40
+ /** OS process id of the holder. */
41
+ pid: number;
42
+ /** Host the pid belongs to. Liveness is only judged on this host. */
43
+ host: string;
44
+ /**
45
+ * The holder's process start time (`ps -o lstart=` under `PS_STABLE_ENV`),
46
+ * or `null` when `ps` could not say. A live process at `pid` with a
47
+ * different start time is not the holder: the pid was recycled. Absent from
48
+ * records written before T12963.
49
+ */
50
+ startedAt?: string | null;
51
+ /**
52
+ * The lock directory this record describes (`<ino>:<birthtimeMs>`), or
53
+ * `null` when it has no usable identity. A record whose lock was since
54
+ * replaced, or that has no identity, never authorises a reap.
55
+ */
56
+ lockId?: string | null;
57
+ /**
58
+ * Process groups of the tools the holder started while holding the slot.
59
+ * The slot stays held while any of them has a member.
60
+ */
61
+ toolGroups?: readonly number[];
62
+ }
63
+ /**
64
+ * Who holds a local governor slot, written to `<slot>.holder.json` once the
65
+ * lock is taken.
66
+ *
67
+ * @task T12963
68
+ */
69
+ export interface GovernorSlotHolder extends SlotHolderIdentity {
70
+ /** The holder's process start time, or `null` when `ps` could not say. */
71
+ startedAt: string | null;
72
+ /** The lock directory this record describes, or `null` when it has none. */
73
+ lockId: string | null;
74
+ /** Class the slot belongs to. */
75
+ cls: ResourceClass;
76
+ /** Wall-clock acquisition time (epoch ms), for deferral messages. */
77
+ acquiredAtMs: number;
78
+ }
79
+ /**
80
+ * How a holder's pid and tool groups are probed. Tests inject one; production
81
+ * uses `kill(pid, 0)`, `kill(-pgid, 0)` and `ps`.
82
+ *
83
+ * @task T12963
84
+ */
85
+ export interface PidProbe {
86
+ /** `gone` (no such process), `alive`, or `unknown` when the probe itself failed. */
87
+ liveness(pid: number): 'gone' | 'alive' | 'unknown';
88
+ /** The process start time as `ps -o lstart=` prints it, or `null` when it cannot be read. */
89
+ startedAt(pid: number): string | null;
90
+ /** `gone` (no member left), `alive`, or `unknown` when the probe failed. */
91
+ groupLiveness(pgid: number): 'gone' | 'alive' | 'unknown';
92
+ }
93
+ /**
94
+ * Verdict on a slot's recorded holder. Only `dead` frees the slot; `unknown`
95
+ * keeps it held, because reaping a live holder would admit two heavy runs
96
+ * against one budget.
97
+ *
98
+ * @task T12963
99
+ */
100
+ export type GovernorHolderState = 'alive' | 'dead' | 'unknown';
101
+ /**
102
+ * This process's start time (`ps -o lstart=` under `PS_STABLE_ENV`), read once
103
+ * per process, or `null` when `ps` could not say.
104
+ *
105
+ * @returns The start time, or `null`.
106
+ *
107
+ * @task T12963
108
+ */
109
+ export declare function ownProcessStartedAt(): string | null;
110
+ /**
111
+ * A lock directory's identity: `<ino>:<birthtimeMs>`, or `null` when the
112
+ * filesystem reports no birth time (NFS, FUSE, older kernels report 0). An
113
+ * inode alone can be reused by the next lock, so such a lock has no identity
114
+ * and is never reaped (T12963 re-review F3).
115
+ *
116
+ * @param ino - The lock directory's inode.
117
+ * @param birthtimeMs - Its birth time, as `fs.Stats.birthtimeMs`.
118
+ * @returns The identity, or `null`.
119
+ *
120
+ * @internal Exported for tests.
121
+ * @task T12963
122
+ */
123
+ export declare function lockIdentity(ino: number, birthtimeMs: number): string | null;
124
+ /**
125
+ * The identity of a slot's current lock directory, for a holder record's
126
+ * `lockId`, or `null` when there is no lock or it has no usable identity.
127
+ *
128
+ * @param slotPath - Slot lock file path.
129
+ * @returns The lock identity, or `null`.
130
+ *
131
+ * @task T12963
132
+ */
133
+ export declare function currentLockId(slotPath: string): string | null;
134
+ /**
135
+ * Write a slot's holder record. Best-effort: a failed write leaves the slot
136
+ * unreapable (it waits out the stale timeout), never unheld.
137
+ *
138
+ * @param slotPath - Slot lock file path.
139
+ * @param record - The record to write.
140
+ *
141
+ * @task T12963
142
+ */
143
+ export declare function writeHolderRecord(slotPath: string, record: SlotHolderIdentity): void;
144
+ /**
145
+ * Keep a held slot's record listing every tool group this process starts
146
+ * while it holds the slot. Rewrites only while the slot's lock is still the
147
+ * one the record describes.
148
+ *
149
+ * @param slotPath - Slot lock file path.
150
+ * @param record - The record as first written (its `toolGroups` are replaced).
151
+ * @returns The groups already running (put them in the first record) and `stop`.
152
+ *
153
+ * @task T12963
154
+ */
155
+ export declare function recordToolGroupsWhileHeld<T extends SlotHolderIdentity>(slotPath: string, record: () => T): {
156
+ groups: readonly number[];
157
+ stop: () => void;
158
+ };
159
+ /**
160
+ * Write the holder record for a governor slot whose lock is held, stamping it
161
+ * with the current lock's identity.
162
+ *
163
+ * @param slotPath - Slot lock file path.
164
+ * @param holder - Who holds it.
165
+ * @returns The record as written.
166
+ *
167
+ * @internal Exported so tests can plant a foreign holder.
168
+ * @task T12963
169
+ */
170
+ export declare function writeGovernorHolder(slotPath: string, holder: Omit<GovernorSlotHolder, 'lockId'>): GovernorSlotHolder;
171
+ /**
172
+ * Read a governor slot's holder record, or `null` when absent or malformed.
173
+ *
174
+ * @param slotPath - Slot lock file path.
175
+ * @returns The record, or `null`.
176
+ *
177
+ * @task T12963
178
+ */
179
+ export declare function readGovernorHolder(slotPath: string): GovernorSlotHolder | null;
180
+ /**
181
+ * Decide whether a slot's recorded holder still holds it.
182
+ *
183
+ * - `dead`: the holder pid is gone, or alive with a different start time
184
+ * than the record's (a recycled pid), AND every tool group it started is
185
+ * gone.
186
+ * - `unknown`: no record, another host's pid, a pid of 1 or below, a record
187
+ * that does not describe the current lock (or a lock with no identity), or
188
+ * a probe that failed. Never treated as dead.
189
+ * - `alive`: otherwise, including a live pid whose start time was never
190
+ * recorded, and a dead holder whose tool is still running.
191
+ *
192
+ * A live holder's `proper-lockfile` timer refreshes the lock mtime (governor
193
+ * slots every 15 s, tool slots every 5 min). While the mtime is within
194
+ * {@link LOCK_REFRESH_WINDOW_MS} a live pid is taken as the holder without
195
+ * asking `ps`, so a contended acquire spawns nothing. A pid recycled inside that window therefore reads as alive until
196
+ * the refresh lapses; that is the safe direction.
197
+ *
198
+ * @param holder - The slot's record, or `null`.
199
+ * @param slotPath - Slot lock file path. Without it the lock identity and
200
+ * mtime are not consulted, so a live pid is always `alive` (report-only).
201
+ * @param probe - Pid probe; tests inject one.
202
+ * @returns The verdict.
203
+ *
204
+ * @task T12963
205
+ */
206
+ export declare function assessSlotHolder(holder: SlotHolderIdentity | null, slotPath?: string, probe?: PidProbe): GovernorHolderState;
207
+ /**
208
+ * {@link assessSlotHolder} for a governor slot's record.
209
+ *
210
+ * @param holder - The slot's record, or `null`.
211
+ * @param slotPath - Slot lock file path.
212
+ * @param probe - Pid probe; tests inject one.
213
+ * @returns The verdict.
214
+ *
215
+ * @task T12963
216
+ */
217
+ export declare function assessGovernorHolder(holder: GovernorSlotHolder | null, slotPath: string, probe?: PidProbe): GovernorHolderState;
218
+ /**
219
+ * Free a held slot whose holder is provably dead: its pid gone or recycled
220
+ * and every tool group it started gone.
221
+ *
222
+ * Runs under a per-slot guard and re-checks the holder inside it. The holder
223
+ * record is removed with the lock, so a second reaper that takes the guard
224
+ * afterwards finds no record (or the next holder's) and stands down. A lock
225
+ * within {@link STALE_TAKEOVER_MARGIN_MS} of `staleMs` is left to
226
+ * `proper-lockfile`, and the lock identity is re-read immediately before the
227
+ * `rm`, so a concurrent stale takeover's fresh lock is never removed.
228
+ *
229
+ * @param slotPath - Slot lock file path.
230
+ * @param readHolder - Reads the slot's record (the governor's or the tool semaphore's).
231
+ * @param opts - The slot's `proper-lockfile` stale threshold, and a probe (tests).
232
+ * @returns `true` when the slot was reaped; the caller then takes it.
233
+ *
234
+ * @task T12963
235
+ */
236
+ export declare function reapSlotIfHolderDead(slotPath: string, readHolder: (slotPath: string) => SlotHolderIdentity | null, opts?: {
237
+ staleMs?: number;
238
+ probe?: PidProbe;
239
+ }): boolean;
240
+ /**
241
+ * Name every held governor slot and its holder, for a deferral reason.
242
+ *
243
+ * @param slots - Slot lock file paths of one class.
244
+ * @returns `; held by …`, or `''` when no slot is held.
245
+ *
246
+ * @task T12963
247
+ */
248
+ export declare function describeSlotHolders(slots: readonly string[]): string;
249
+ /**
250
+ * Take a slot without waiting: free, or freed by reaping a dead holder.
251
+ *
252
+ * @param slotPath - Slot lock file path.
253
+ * @param cls - Class the slot belongs to.
254
+ * @returns The grant's release (drops the holder record, then the lock), or
255
+ * `null` when the slot is held.
256
+ * @throws Any lock error other than `ELOCKED` (an unwritable slot directory),
257
+ * for the governor's fail-open path.
258
+ *
259
+ * @task T12963
260
+ */
261
+ export declare function lockSlot(slotPath: string, cls: ResourceClass): Promise<(() => Promise<void>) | null>;
262
+ /**
263
+ * Forget cached start times, this process's included. Tests only.
264
+ * @internal
265
+ */
266
+ export declare function _resetSlotHolderStateForTest(): void;
267
+ //# sourceMappingURL=slot-holder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-holder.d.ts","sourceRoot":"","sources":["../../src/resources/slot-holder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAYzD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,SAAU,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAU1C;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,0E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