@cleocode/core 2026.6.12 → 2026.6.13

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 (385) hide show
  1. package/dist/conduit/local-transport.d.ts +12 -0
  2. package/dist/conduit/local-transport.d.ts.map +1 -1
  3. package/dist/conduit/local-transport.js +53 -23
  4. package/dist/conduit/local-transport.js.map +1 -1
  5. package/dist/crypto/credentials.d.ts +37 -0
  6. package/dist/crypto/credentials.d.ts.map +1 -1
  7. package/dist/crypto/credentials.js +110 -0
  8. package/dist/crypto/credentials.js.map +1 -1
  9. package/dist/dispatch/contracts/derive-output-contract.d.ts +86 -0
  10. package/dist/dispatch/contracts/derive-output-contract.d.ts.map +1 -0
  11. package/dist/dispatch/contracts/derive-output-contract.js +347 -0
  12. package/dist/dispatch/contracts/derive-output-contract.js.map +1 -0
  13. package/dist/dispatch/contracts/ensures-schema.d.ts +77 -0
  14. package/dist/dispatch/contracts/ensures-schema.d.ts.map +1 -0
  15. package/dist/dispatch/contracts/ensures-schema.js +91 -0
  16. package/dist/dispatch/contracts/ensures-schema.js.map +1 -0
  17. package/dist/dispatch/contracts/output-contracts.d.ts +27 -5
  18. package/dist/dispatch/contracts/output-contracts.d.ts.map +1 -1
  19. package/dist/dispatch/contracts/output-contracts.js +29 -6
  20. package/dist/dispatch/contracts/output-contracts.js.map +1 -1
  21. package/dist/docs/export-document.js +2294 -1250
  22. package/dist/docs/export-document.js.map +3 -3
  23. package/dist/go/driver.d.ts +132 -7
  24. package/dist/go/driver.d.ts.map +1 -1
  25. package/dist/go/driver.js +135 -10
  26. package/dist/go/driver.js.map +1 -1
  27. package/dist/go/index.d.ts +1 -1
  28. package/dist/go/index.d.ts.map +1 -1
  29. package/dist/go/index.js +1 -1
  30. package/dist/go/index.js.map +1 -1
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +5 -0
  34. package/dist/index.js.map +1 -1
  35. package/dist/internal.d.ts +13 -10
  36. package/dist/internal.d.ts.map +1 -1
  37. package/dist/internal.js +11 -11
  38. package/dist/internal.js.map +1 -1
  39. package/dist/lifecycle/engine-ops.d.ts.map +1 -1
  40. package/dist/lifecycle/engine-ops.js +7 -4
  41. package/dist/lifecycle/engine-ops.js.map +1 -1
  42. package/dist/lifecycle/ivtr-loop.d.ts +108 -183
  43. package/dist/lifecycle/ivtr-loop.d.ts.map +1 -1
  44. package/dist/lifecycle/ivtr-loop.js +207 -522
  45. package/dist/lifecycle/ivtr-loop.js.map +1 -1
  46. package/dist/llm/auxiliary-fallback.js +1 -1
  47. package/dist/llm/auxiliary-fallback.js.map +1 -1
  48. package/dist/llm/cli-ops.d.ts +14 -1
  49. package/dist/llm/cli-ops.d.ts.map +1 -1
  50. package/dist/llm/cli-ops.js +41 -12
  51. package/dist/llm/cli-ops.js.map +1 -1
  52. package/dist/llm/concrete-session.d.ts.map +1 -1
  53. package/dist/llm/concrete-session.js +4 -0
  54. package/dist/llm/concrete-session.js.map +1 -1
  55. package/dist/llm/credentials.d.ts +35 -0
  56. package/dist/llm/credentials.d.ts.map +1 -1
  57. package/dist/llm/credentials.js +49 -0
  58. package/dist/llm/credentials.js.map +1 -1
  59. package/dist/llm/index.d.ts +4 -0
  60. package/dist/llm/index.d.ts.map +1 -1
  61. package/dist/llm/index.js +4 -0
  62. package/dist/llm/index.js.map +1 -1
  63. package/dist/llm/pi/gondolin-loader.d.ts +241 -0
  64. package/dist/llm/pi/gondolin-loader.d.ts.map +1 -0
  65. package/dist/llm/pi/gondolin-loader.js +195 -0
  66. package/dist/llm/pi/gondolin-loader.js.map +1 -0
  67. package/dist/llm/pi/index.d.ts +28 -0
  68. package/dist/llm/pi/index.d.ts.map +1 -0
  69. package/dist/llm/pi/index.js +27 -0
  70. package/dist/llm/pi/index.js.map +1 -0
  71. package/dist/llm/pi/pi-agent-adapter.d.ts +135 -0
  72. package/dist/llm/pi/pi-agent-adapter.d.ts.map +1 -0
  73. package/dist/llm/pi/pi-agent-adapter.js +329 -0
  74. package/dist/llm/pi/pi-agent-adapter.js.map +1 -0
  75. package/dist/llm/pi/pi-errors.d.ts +161 -0
  76. package/dist/llm/pi/pi-errors.d.ts.map +1 -0
  77. package/dist/llm/pi/pi-errors.js +296 -0
  78. package/dist/llm/pi/pi-errors.js.map +1 -0
  79. package/dist/llm/pi/pi-execution-env.d.ts +286 -0
  80. package/dist/llm/pi/pi-execution-env.d.ts.map +1 -0
  81. package/dist/llm/pi/pi-execution-env.js +406 -0
  82. package/dist/llm/pi/pi-execution-env.js.map +1 -0
  83. package/dist/llm/pi/pi-gondolin-env.d.ts +227 -0
  84. package/dist/llm/pi/pi-gondolin-env.d.ts.map +1 -0
  85. package/dist/llm/pi/pi-gondolin-env.js +541 -0
  86. package/dist/llm/pi/pi-gondolin-env.js.map +1 -0
  87. package/dist/llm/pi/pi-session-storage.d.ts +154 -0
  88. package/dist/llm/pi/pi-session-storage.d.ts.map +1 -0
  89. package/dist/llm/pi/pi-session-storage.js +314 -0
  90. package/dist/llm/pi/pi-session-storage.js.map +1 -0
  91. package/dist/llm/pi/pi-stream-fn.d.ts +124 -0
  92. package/dist/llm/pi/pi-stream-fn.d.ts.map +1 -0
  93. package/dist/llm/pi/pi-stream-fn.js +504 -0
  94. package/dist/llm/pi/pi-stream-fn.js.map +1 -0
  95. package/dist/llm/pi/pi-tool-bridge.d.ts +99 -0
  96. package/dist/llm/pi/pi-tool-bridge.d.ts.map +1 -0
  97. package/dist/llm/pi/pi-tool-bridge.js +117 -0
  98. package/dist/llm/pi/pi-tool-bridge.js.map +1 -0
  99. package/dist/llm/pi/pi-types.d.ts +56 -0
  100. package/dist/llm/pi/pi-types.d.ts.map +1 -0
  101. package/dist/llm/pi/pi-types.js +16 -0
  102. package/dist/llm/pi/pi-types.js.map +1 -0
  103. package/dist/llm/pi/resolve-execution-env.d.ts +194 -0
  104. package/dist/llm/pi/resolve-execution-env.d.ts.map +1 -0
  105. package/dist/llm/pi/resolve-execution-env.js +132 -0
  106. package/dist/llm/pi/resolve-execution-env.js.map +1 -0
  107. package/dist/llm/plugin-facade.js +2253 -1151
  108. package/dist/llm/plugin-facade.js.map +3 -3
  109. package/dist/llm/role-executor.d.ts.map +1 -1
  110. package/dist/llm/role-executor.js +8 -5
  111. package/dist/llm/role-executor.js.map +1 -1
  112. package/dist/llm/role-resolver.d.ts +46 -14
  113. package/dist/llm/role-resolver.d.ts.map +1 -1
  114. package/dist/llm/role-resolver.js +178 -20
  115. package/dist/llm/role-resolver.js.map +1 -1
  116. package/dist/llm/sealed-credential.d.ts +125 -0
  117. package/dist/llm/sealed-credential.d.ts.map +1 -0
  118. package/dist/llm/sealed-credential.js +133 -0
  119. package/dist/llm/sealed-credential.js.map +1 -0
  120. package/dist/llm/session-factory.d.ts.map +1 -1
  121. package/dist/llm/session-factory.js +6 -2
  122. package/dist/llm/session-factory.js.map +1 -1
  123. package/dist/llm/system-key.d.ts +67 -0
  124. package/dist/llm/system-key.d.ts.map +1 -0
  125. package/dist/llm/system-key.js +87 -0
  126. package/dist/llm/system-key.js.map +1 -0
  127. package/dist/llm/system-of-use-registry.d.ts +119 -0
  128. package/dist/llm/system-of-use-registry.d.ts.map +1 -0
  129. package/dist/llm/system-of-use-registry.js +200 -0
  130. package/dist/llm/system-of-use-registry.js.map +1 -0
  131. package/dist/llm/system-resolver.d.ts +32 -10
  132. package/dist/llm/system-resolver.d.ts.map +1 -1
  133. package/dist/llm/system-resolver.js +70 -18
  134. package/dist/llm/system-resolver.js.map +1 -1
  135. package/dist/memory/brain-writer-thread.d.ts.map +1 -1
  136. package/dist/memory/brain-writer-thread.js +116 -11
  137. package/dist/memory/brain-writer-thread.js.map +1 -1
  138. package/dist/memory/claude-mem-migration.d.ts.map +1 -1
  139. package/dist/memory/claude-mem-migration.js +21 -0
  140. package/dist/memory/claude-mem-migration.js.map +1 -1
  141. package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
  142. package/dist/memory/graph-memory-bridge.js +32 -25
  143. package/dist/memory/graph-memory-bridge.js.map +1 -1
  144. package/dist/memory/llm-backend-resolver.js +23 -5
  145. package/dist/memory/llm-backend-resolver.js.map +1 -1
  146. package/dist/nexus/migrations/M-split-graph.d.ts.map +1 -1
  147. package/dist/nexus/migrations/M-split-graph.js +60 -53
  148. package/dist/nexus/migrations/M-split-graph.js.map +1 -1
  149. package/dist/orchestrate/pivot.d.ts.map +1 -1
  150. package/dist/orchestrate/pivot.js +20 -2
  151. package/dist/orchestrate/pivot.js.map +1 -1
  152. package/dist/release/engine-ops.js +2 -2
  153. package/dist/release/engine-ops.js.map +1 -1
  154. package/dist/routing/capability-matrix.d.ts.map +1 -1
  155. package/dist/routing/capability-matrix.js +0 -57
  156. package/dist/routing/capability-matrix.js.map +1 -1
  157. package/dist/selfimprove/budget.d.ts +206 -0
  158. package/dist/selfimprove/budget.d.ts.map +1 -0
  159. package/dist/selfimprove/budget.js +203 -0
  160. package/dist/selfimprove/budget.js.map +1 -0
  161. package/dist/selfimprove/dhq-adapter.d.ts +105 -0
  162. package/dist/selfimprove/dhq-adapter.d.ts.map +1 -0
  163. package/dist/selfimprove/dhq-adapter.js +95 -0
  164. package/dist/selfimprove/dhq-adapter.js.map +1 -0
  165. package/dist/selfimprove/draft-pr.d.ts +129 -0
  166. package/dist/selfimprove/draft-pr.d.ts.map +1 -0
  167. package/dist/selfimprove/draft-pr.js +158 -0
  168. package/dist/selfimprove/draft-pr.js.map +1 -0
  169. package/dist/selfimprove/envelope-diff.d.ts +162 -0
  170. package/dist/selfimprove/envelope-diff.d.ts.map +1 -0
  171. package/dist/selfimprove/envelope-diff.js +321 -0
  172. package/dist/selfimprove/envelope-diff.js.map +1 -0
  173. package/dist/selfimprove/replay.d.ts +121 -0
  174. package/dist/selfimprove/replay.d.ts.map +1 -0
  175. package/dist/selfimprove/replay.js +109 -0
  176. package/dist/selfimprove/replay.js.map +1 -0
  177. package/dist/selfimprove/run-loop.d.ts +148 -0
  178. package/dist/selfimprove/run-loop.d.ts.map +1 -0
  179. package/dist/selfimprove/run-loop.js +240 -0
  180. package/dist/selfimprove/run-loop.js.map +1 -0
  181. package/dist/selfimprove/scenario.d.ts +145 -0
  182. package/dist/selfimprove/scenario.d.ts.map +1 -0
  183. package/dist/selfimprove/scenario.js +243 -0
  184. package/dist/selfimprove/scenario.js.map +1 -0
  185. package/dist/sentient/daemon-entry.js +5 -0
  186. package/dist/sentient/daemon-entry.js.map +1 -1
  187. package/dist/sentient/daemon.d.ts.map +1 -1
  188. package/dist/sentient/daemon.js +19 -0
  189. package/dist/sentient/daemon.js.map +1 -1
  190. package/dist/sentient/hygiene-scan.d.ts.map +1 -1
  191. package/dist/sentient/hygiene-scan.js +14 -6
  192. package/dist/sentient/hygiene-scan.js.map +1 -1
  193. package/dist/sessions/briefing.d.ts.map +1 -1
  194. package/dist/sessions/briefing.js +13 -9
  195. package/dist/sessions/briefing.js.map +1 -1
  196. package/dist/sessions/connection-session-handle.d.ts +161 -0
  197. package/dist/sessions/connection-session-handle.d.ts.map +1 -0
  198. package/dist/sessions/connection-session-handle.js +168 -0
  199. package/dist/sessions/connection-session-handle.js.map +1 -0
  200. package/dist/sessions/handoff.d.ts.map +1 -1
  201. package/dist/sessions/handoff.js +9 -0
  202. package/dist/sessions/handoff.js.map +1 -1
  203. package/dist/sessions/index.d.ts +4 -1
  204. package/dist/sessions/index.d.ts.map +1 -1
  205. package/dist/sessions/index.js +31 -1
  206. package/dist/sessions/index.js.map +1 -1
  207. package/dist/sessions/session-id.d.ts +34 -0
  208. package/dist/sessions/session-id.d.ts.map +1 -1
  209. package/dist/sessions/session-id.js +37 -0
  210. package/dist/sessions/session-id.js.map +1 -1
  211. package/dist/sessions/session-manifest-mirror.d.ts +115 -0
  212. package/dist/sessions/session-manifest-mirror.d.ts.map +1 -0
  213. package/dist/sessions/session-manifest-mirror.js +250 -0
  214. package/dist/sessions/session-manifest-mirror.js.map +1 -0
  215. package/dist/sessions/session-switch.d.ts.map +1 -1
  216. package/dist/sessions/session-switch.js +5 -2
  217. package/dist/sessions/session-switch.js.map +1 -1
  218. package/dist/store/converters.d.ts.map +1 -1
  219. package/dist/store/converters.js +2 -0
  220. package/dist/store/converters.js.map +1 -1
  221. package/dist/store/db-helpers.d.ts.map +1 -1
  222. package/dist/store/db-helpers.js +2 -0
  223. package/dist/store/db-helpers.js.map +1 -1
  224. package/dist/store/dual-scope-db.d.ts.map +1 -1
  225. package/dist/store/dual-scope-db.js +87 -47
  226. package/dist/store/dual-scope-db.js.map +1 -1
  227. package/dist/store/pi-session-store.d.ts +151 -0
  228. package/dist/store/pi-session-store.d.ts.map +1 -0
  229. package/dist/store/pi-session-store.js +166 -0
  230. package/dist/store/pi-session-store.js.map +1 -0
  231. package/dist/store/safety-data-accessor.d.ts +1 -0
  232. package/dist/store/safety-data-accessor.d.ts.map +1 -1
  233. package/dist/store/safety-data-accessor.js +5 -0
  234. package/dist/store/safety-data-accessor.js.map +1 -1
  235. package/dist/store/schema/cleo-global/accounts.d.ts +357 -0
  236. package/dist/store/schema/cleo-global/accounts.d.ts.map +1 -0
  237. package/dist/store/schema/cleo-global/accounts.js +136 -0
  238. package/dist/store/schema/cleo-global/accounts.js.map +1 -0
  239. package/dist/store/schema/cleo-global/index.d.ts +2 -0
  240. package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
  241. package/dist/store/schema/cleo-global/index.js +2 -0
  242. package/dist/store/schema/cleo-global/index.js.map +1 -1
  243. package/dist/store/schema/cleo-global/session-manifest.d.ts +217 -0
  244. package/dist/store/schema/cleo-global/session-manifest.d.ts.map +1 -0
  245. package/dist/store/schema/cleo-global/session-manifest.js +99 -0
  246. package/dist/store/schema/cleo-global/session-manifest.js.map +1 -0
  247. package/dist/store/schema/cleo-project/tasks-core.d.ts +16 -0
  248. package/dist/store/schema/cleo-project/tasks-core.d.ts.map +1 -1
  249. package/dist/store/schema/cleo-project/tasks-core.js +14 -0
  250. package/dist/store/schema/cleo-project/tasks-core.js.map +1 -1
  251. package/dist/store/schema/tasks.d.ts +16 -0
  252. package/dist/store/schema/tasks.d.ts.map +1 -1
  253. package/dist/store/schema/tasks.js +10 -0
  254. package/dist/store/schema/tasks.js.map +1 -1
  255. package/dist/store/selfimprove-dhq-schema.d.ts +284 -0
  256. package/dist/store/selfimprove-dhq-schema.d.ts.map +1 -0
  257. package/dist/store/selfimprove-dhq-schema.js +128 -0
  258. package/dist/store/selfimprove-dhq-schema.js.map +1 -0
  259. package/dist/store/selfimprove-dhq-store.d.ts +175 -0
  260. package/dist/store/selfimprove-dhq-store.d.ts.map +1 -0
  261. package/dist/store/selfimprove-dhq-store.js +182 -0
  262. package/dist/store/selfimprove-dhq-store.js.map +1 -0
  263. package/dist/store/session-store.d.ts +52 -13
  264. package/dist/store/session-store.d.ts.map +1 -1
  265. package/dist/store/session-store.js +71 -13
  266. package/dist/store/session-store.js.map +1 -1
  267. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  268. package/dist/store/sqlite-data-accessor.js +7 -0
  269. package/dist/store/sqlite-data-accessor.js.map +1 -1
  270. package/dist/store/umbrella-data-accessor.d.ts +1 -0
  271. package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
  272. package/dist/store/umbrella-data-accessor.js +5 -0
  273. package/dist/store/umbrella-data-accessor.js.map +1 -1
  274. package/dist/store/validation-schemas.d.ts +32 -0
  275. package/dist/store/validation-schemas.d.ts.map +1 -1
  276. package/dist/store/writer-lease-schema.d.ts +392 -0
  277. package/dist/store/writer-lease-schema.d.ts.map +1 -0
  278. package/dist/store/writer-lease-schema.js +142 -0
  279. package/dist/store/writer-lease-schema.js.map +1 -0
  280. package/dist/store/writer-lease.d.ts +368 -0
  281. package/dist/store/writer-lease.d.ts.map +1 -0
  282. package/dist/store/writer-lease.js +1002 -0
  283. package/dist/store/writer-lease.js.map +1 -0
  284. package/dist/tasks/backfill-child-projections.d.ts.map +1 -1
  285. package/dist/tasks/backfill-child-projections.js +14 -9
  286. package/dist/tasks/backfill-child-projections.js.map +1 -1
  287. package/dist/tasks/complete.d.ts.map +1 -1
  288. package/dist/tasks/complete.js +7 -10
  289. package/dist/tasks/complete.js.map +1 -1
  290. package/dist/tasks/duplicate-detector.d.ts.map +1 -1
  291. package/dist/tasks/duplicate-detector.js +14 -7
  292. package/dist/tasks/duplicate-detector.js.map +1 -1
  293. package/dist/telemetry/index.d.ts.map +1 -1
  294. package/dist/telemetry/index.js +10 -4
  295. package/dist/telemetry/index.js.map +1 -1
  296. package/dist/tools/agent-registry.d.ts +250 -0
  297. package/dist/tools/agent-registry.d.ts.map +1 -0
  298. package/dist/tools/agent-registry.js +292 -0
  299. package/dist/tools/agent-registry.js.map +1 -0
  300. package/dist/tools/agent-tool-families.d.ts +107 -0
  301. package/dist/tools/agent-tool-families.d.ts.map +1 -0
  302. package/dist/tools/agent-tool-families.js +527 -0
  303. package/dist/tools/agent-tool-families.js.map +1 -0
  304. package/dist/tools/browser-driver.d.ts +183 -0
  305. package/dist/tools/browser-driver.d.ts.map +1 -0
  306. package/dist/tools/browser-driver.js +242 -0
  307. package/dist/tools/browser-driver.js.map +1 -0
  308. package/dist/tools/builtin-agent-tools.d.ts +36 -0
  309. package/dist/tools/builtin-agent-tools.d.ts.map +1 -0
  310. package/dist/tools/builtin-agent-tools.js +150 -0
  311. package/dist/tools/builtin-agent-tools.js.map +1 -0
  312. package/dist/tools/dispatch.d.ts +370 -0
  313. package/dist/tools/dispatch.d.ts.map +1 -0
  314. package/dist/tools/dispatch.js +505 -0
  315. package/dist/tools/dispatch.js.map +1 -0
  316. package/dist/tools/env-scrub.d.ts +93 -0
  317. package/dist/tools/env-scrub.d.ts.map +1 -0
  318. package/dist/tools/env-scrub.js +176 -0
  319. package/dist/tools/env-scrub.js.map +1 -0
  320. package/dist/tools/fs.d.ts +30 -0
  321. package/dist/tools/fs.d.ts.map +1 -1
  322. package/dist/tools/fs.js +55 -2
  323. package/dist/tools/fs.js.map +1 -1
  324. package/dist/tools/guard.d.ts +15 -0
  325. package/dist/tools/guard.d.ts.map +1 -1
  326. package/dist/tools/guard.js +49 -12
  327. package/dist/tools/guard.js.map +1 -1
  328. package/dist/tools/index.d.ts +10 -0
  329. package/dist/tools/index.d.ts.map +1 -1
  330. package/dist/tools/index.js +37 -0
  331. package/dist/tools/index.js.map +1 -1
  332. package/dist/tools/pty.d.ts +45 -0
  333. package/dist/tools/pty.d.ts.map +1 -0
  334. package/dist/tools/pty.js +166 -0
  335. package/dist/tools/pty.js.map +1 -0
  336. package/dist/tools/schema-gen.d.ts +57 -0
  337. package/dist/tools/schema-gen.d.ts.map +1 -0
  338. package/dist/tools/schema-gen.js +52 -0
  339. package/dist/tools/schema-gen.js.map +1 -0
  340. package/dist/tools/shell.d.ts +12 -0
  341. package/dist/tools/shell.d.ts.map +1 -1
  342. package/dist/tools/shell.js +14 -1
  343. package/dist/tools/shell.js.map +1 -1
  344. package/dist/tools/web-agent-tools.d.ts +72 -0
  345. package/dist/tools/web-agent-tools.d.ts.map +1 -0
  346. package/dist/tools/web-agent-tools.js +393 -0
  347. package/dist/tools/web-agent-tools.js.map +1 -0
  348. package/dist/tools/web-search-backends.d.ts +156 -0
  349. package/dist/tools/web-search-backends.d.ts.map +1 -0
  350. package/dist/tools/web-search-backends.js +290 -0
  351. package/dist/tools/web-search-backends.js.map +1 -0
  352. package/dist/validation/ops.d.ts +1 -15
  353. package/dist/validation/ops.d.ts.map +1 -1
  354. package/dist/validation/ops.js +0 -20
  355. package/dist/validation/ops.js.map +1 -1
  356. package/migrations/drizzle-cleo-global/20260607000000_t11891-writer-leases/migration.sql +55 -0
  357. package/migrations/drizzle-cleo-global/20260607010000_t11639-session-manifest/migration.sql +43 -0
  358. package/migrations/drizzle-cleo-global/20260608000000_t11899-pi-session-tree/migration.sql +52 -0
  359. package/migrations/drizzle-cleo-global/20260608010000_t11709-accounts-credential-pool/migration.sql +72 -0
  360. package/migrations/drizzle-cleo-global/20260608020000_t11889-selfimprove-dhq/migration.sql +64 -0
  361. package/migrations/drizzle-cleo-project/20260607000000_t11891-writer-leases/migration.sql +55 -0
  362. package/migrations/drizzle-cleo-project/20260607010000_t11639-session-parent/migration.sql +22 -0
  363. package/migrations/drizzle-cleo-project/20260608000000_t11899-pi-session-tree/migration.sql +52 -0
  364. package/migrations/drizzle-cleo-project/20260608020000_t11889-selfimprove-dhq/migration.sql +64 -0
  365. package/package.json +15 -13
  366. package/dist/lifecycle/chain-composition.d.ts +0 -30
  367. package/dist/lifecycle/chain-composition.d.ts.map +0 -1
  368. package/dist/lifecycle/chain-composition.js +0 -152
  369. package/dist/lifecycle/chain-composition.js.map +0 -1
  370. package/dist/lifecycle/chain-store.d.ts +0 -70
  371. package/dist/lifecycle/chain-store.d.ts.map +0 -1
  372. package/dist/lifecycle/chain-store.js +0 -246
  373. package/dist/lifecycle/chain-store.js.map +0 -1
  374. package/dist/lifecycle/default-chain.d.ts +0 -39
  375. package/dist/lifecycle/default-chain.d.ts.map +0 -1
  376. package/dist/lifecycle/default-chain.js +0 -176
  377. package/dist/lifecycle/default-chain.js.map +0 -1
  378. package/dist/lifecycle/tessera-engine.d.ts +0 -48
  379. package/dist/lifecycle/tessera-engine.d.ts.map +0 -1
  380. package/dist/lifecycle/tessera-engine.js +0 -249
  381. package/dist/lifecycle/tessera-engine.js.map +0 -1
  382. package/dist/validation/chain-validation.d.ts +0 -43
  383. package/dist/validation/chain-validation.d.ts.map +0 -1
  384. package/dist/validation/chain-validation.js +0 -146
  385. package/dist/validation/chain-validation.js.map +0 -1
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Budget caps + circuit-breaker state machine for the self-improvement loop
3
+ * (T11889 · T11889-C).
4
+ *
5
+ * The loop is an AUTONOMOUS dogfooding engine — it boots a sandbox, replays a
6
+ * scenario, and on a regression it WRITES a leased DHQ row and opens a draft PR.
7
+ * Two guardrails bound that autonomy:
8
+ *
9
+ * 1. {@link SelfImproveBudget} — HARD, in-code caps (`maxTokens`, `maxUsd`,
10
+ * `maxPrs = 1`, `maxWorktrees = 1`). These are REAL, not advisory: the engine
11
+ * asks {@link CircuitBreaker.assertWithinBudget} BEFORE each costed step, so a
12
+ * cap is enforced as a PRE-FLIGHT check (never merely observed after the fact).
13
+ * `MemoryMax=32G` is NOT an in-code cap — a CORE function cannot portably
14
+ * self-confine to a cgroup (`systemd-run` is Linux-only) — it is an OPERATIONAL
15
+ * launch-wrapper documented on {@link MEMORY_MAX_LAUNCH_WRAPPER}; the in-process
16
+ * complement is the gondolin VM's own `memory` option.
17
+ * 2. {@link CircuitBreaker} — a one-way latch that HALTS the run (no further ops,
18
+ * no DHQ write, no PR) the moment any of these trip:
19
+ * - an architectural gate goes RED (`gateRed`);
20
+ * - the writer lease throws {@link "../store/writer-lease.js".LeaseUnavailableError}
21
+ * (a `require`-mode acquisition FAILURE — `leaseUnavailable`);
22
+ * - a budget cap would be exceeded (`budgetOverrun`);
23
+ * - a DB error escapes the leased section (`dbError`).
24
+ * It does NOT trip on "daemon OFF": the default lease mode is `local` (no
25
+ * daemon), so daemon-off is the NORMAL operating state — tripping on it would
26
+ * block EVERY write in the default config (P5 spec §B.7 correction).
27
+ *
28
+ * This module is PURE — no DB, no native handle, no `cleo` mutation, no I/O.
29
+ * Import-time side-effect-free.
30
+ *
31
+ * @module @cleocode/core/selfimprove/budget
32
+ * @epic T11889
33
+ * @task T11913
34
+ */
35
+ /**
36
+ * The default budget for a self-improvement run. `maxPrs` / `maxWorktrees` are
37
+ * `1` by contract; `maxTokens` / `maxUsd` are conservative defaults overridable
38
+ * via {@link resolveBudget} (env) or an explicit partial.
39
+ */
40
+ export const DEFAULT_BUDGET = {
41
+ maxTokens: 200_000,
42
+ maxUsd: 5,
43
+ maxPrs: 1,
44
+ maxWorktrees: 1,
45
+ };
46
+ /**
47
+ * The launch-boundary memory cap — an OPERATIONAL wrapper, NOT an in-code cap.
48
+ *
49
+ * A CORE function cannot portably self-confine to a cgroup (`systemd-run` is
50
+ * Linux-only; re-exec'ing under it from inside the engine is fragile), so the
51
+ * runbook / spawn wrapper that invokes `cleo selfimprove run` wraps it on Linux.
52
+ * On macOS the gondolin VM's own `memory` option bounds the guest. Exported as a
53
+ * documented constant so the spawn wrapper and the runbook share one SSoT string.
54
+ */
55
+ export const MEMORY_MAX_LAUNCH_WRAPPER = 'systemd-run --user --scope -p MemoryMax=32G -p MemorySwapMax=0';
56
+ /** A fresh, zeroed {@link BudgetSpend}. */
57
+ export function emptySpend() {
58
+ return { tokens: 0, usd: 0, prs: 0, worktrees: 0 };
59
+ }
60
+ /**
61
+ * Thrown by {@link CircuitBreaker.assertWithinBudget} when a step's charge would
62
+ * push the accumulated spend past a cap. Carries the offending dimension so the
63
+ * engine can trip the breaker with `reason: 'budgetOverrun'` and surface WHICH cap.
64
+ */
65
+ export class BudgetExceededError extends Error {
66
+ /** Stable machine-readable code. */
67
+ code = 'E_SELFIMPROVE_BUDGET_EXCEEDED';
68
+ /** Which cap was exceeded. */
69
+ dimension;
70
+ /**
71
+ * @param dimension - The exceeded cap dimension.
72
+ * @param attempted - The accumulated value the step would have reached.
73
+ * @param cap - The cap that bounds it.
74
+ */
75
+ constructor(dimension, attempted, cap) {
76
+ super(`self-improve budget exceeded: ${dimension} would reach ${attempted}, cap is ${cap}`);
77
+ this.name = 'BudgetExceededError';
78
+ this.dimension = dimension;
79
+ }
80
+ }
81
+ /**
82
+ * A one-way circuit-breaker latch + pre-flight budget gate for ONE run.
83
+ *
84
+ * Once {@link trip} is called the breaker stays OPEN for the run's lifetime —
85
+ * there is no reset (a run is single-use; the next run constructs a fresh
86
+ * breaker). {@link assertOpen} short-circuits B.4-B.5 to a no-op the moment the
87
+ * latch is set, and {@link assertWithinBudget} is the PRE-FLIGHT check the engine
88
+ * runs before each costed step.
89
+ *
90
+ * PURE — holds only in-memory counters; no I/O.
91
+ */
92
+ export class CircuitBreaker {
93
+ #budget;
94
+ #spend;
95
+ #open = false;
96
+ #reason = null;
97
+ #detail = null;
98
+ /**
99
+ * @param budget - The caps for this run (defaults to {@link DEFAULT_BUDGET}).
100
+ * @param spend - The starting spend (defaults to a zeroed accumulator).
101
+ */
102
+ constructor(budget = DEFAULT_BUDGET, spend = emptySpend()) {
103
+ this.#budget = budget;
104
+ this.#spend = spend;
105
+ }
106
+ /** Whether the breaker has latched OPEN. */
107
+ get isOpen() {
108
+ return this.#open;
109
+ }
110
+ /** The current latch state (open flag + reason + detail). */
111
+ get state() {
112
+ return { open: this.#open, reason: this.#reason, detail: this.#detail };
113
+ }
114
+ /** The accumulated spend so far (a live read of the internal counters). */
115
+ get spend() {
116
+ return { ...this.#spend };
117
+ }
118
+ /**
119
+ * Latch the breaker OPEN. Idempotent: the FIRST trip wins — a later trip does
120
+ * not overwrite the original reason (the first fault is the relevant one).
121
+ *
122
+ * @param reason - The trip reason.
123
+ * @param detail - A human-readable detail for logs / the run report.
124
+ */
125
+ trip(reason, detail) {
126
+ if (this.#open)
127
+ return;
128
+ this.#open = true;
129
+ this.#reason = reason;
130
+ this.#detail = detail;
131
+ }
132
+ /**
133
+ * Throw if the breaker is OPEN — the engine calls this at the top of each
134
+ * phase so a tripped breaker short-circuits the rest of the run.
135
+ *
136
+ * @throws {Error} `E_SELFIMPROVE_CIRCUIT_OPEN` when the breaker is latched.
137
+ */
138
+ assertClosed() {
139
+ if (this.#open) {
140
+ const err = new Error(`self-improve circuit-breaker OPEN (${this.#reason}): ${this.#detail}`);
141
+ err.code = 'E_SELFIMPROVE_CIRCUIT_OPEN';
142
+ throw err;
143
+ }
144
+ }
145
+ /**
146
+ * PRE-FLIGHT budget check for a costed step. Computes the spend the step WOULD
147
+ * reach and — if any dimension would exceed its cap — TRIPS the breaker with
148
+ * `reason: 'budgetOverrun'` and throws {@link BudgetExceededError} BEFORE the
149
+ * step runs. On success it COMMITS the charge to the accumulator.
150
+ *
151
+ * @param charge - The increment the step would add.
152
+ * @throws {BudgetExceededError} When a cap would be exceeded (and trips the breaker).
153
+ */
154
+ chargeOrTrip(charge) {
155
+ const next = {
156
+ tokens: this.#spend.tokens + (charge.tokens ?? 0),
157
+ usd: this.#spend.usd + (charge.usd ?? 0),
158
+ prs: this.#spend.prs + (charge.prs ?? 0),
159
+ worktrees: this.#spend.worktrees + (charge.worktrees ?? 0),
160
+ };
161
+ const checks = [
162
+ ['maxTokens', next.tokens, this.#budget.maxTokens],
163
+ ['maxUsd', next.usd, this.#budget.maxUsd],
164
+ ['maxPrs', next.prs, this.#budget.maxPrs],
165
+ ['maxWorktrees', next.worktrees, this.#budget.maxWorktrees],
166
+ ];
167
+ for (const [dimension, attempted, cap] of checks) {
168
+ if (attempted > cap) {
169
+ const err = new BudgetExceededError(dimension, attempted, cap);
170
+ this.trip('budgetOverrun', err.message);
171
+ throw err;
172
+ }
173
+ }
174
+ this.#spend.tokens = next.tokens;
175
+ this.#spend.usd = next.usd;
176
+ this.#spend.prs = next.prs;
177
+ this.#spend.worktrees = next.worktrees;
178
+ }
179
+ }
180
+ /**
181
+ * Resolve the effective {@link SelfImproveBudget}, layering env overrides over an
182
+ * explicit partial over {@link DEFAULT_BUDGET}. `maxPrs` / `maxWorktrees` are
183
+ * ALWAYS clamped to at most `1` regardless of override — the one-PR / one-sandbox
184
+ * ceiling is a hard invariant, not a tunable.
185
+ *
186
+ * Env overrides (numeric): `CLEO_SELFIMPROVE_MAX_TOKENS`, `CLEO_SELFIMPROVE_MAX_USD`.
187
+ *
188
+ * @param overrides - Optional explicit partial caps (test / caller injection).
189
+ * @param env - The environment to read overrides from (defaults to `process.env`).
190
+ * @returns The resolved, invariant-clamped budget.
191
+ */
192
+ export function resolveBudget(overrides = {}, env = process.env) {
193
+ const envTokens = Number(env.CLEO_SELFIMPROVE_MAX_TOKENS);
194
+ const envUsd = Number(env.CLEO_SELFIMPROVE_MAX_USD);
195
+ const maxTokens = overrides.maxTokens ??
196
+ (Number.isFinite(envTokens) && envTokens > 0 ? envTokens : DEFAULT_BUDGET.maxTokens);
197
+ const maxUsd = overrides.maxUsd ?? (Number.isFinite(envUsd) && envUsd > 0 ? envUsd : DEFAULT_BUDGET.maxUsd);
198
+ // The one-PR / one-sandbox ceiling is invariant — clamp to at most 1.
199
+ const maxPrs = Math.min(1, overrides.maxPrs ?? DEFAULT_BUDGET.maxPrs);
200
+ const maxWorktrees = Math.min(1, overrides.maxWorktrees ?? DEFAULT_BUDGET.maxWorktrees);
201
+ return { maxTokens, maxUsd, maxPrs, maxWorktrees };
202
+ }
203
+ //# sourceMappingURL=budget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"budget.js","sourceRoot":"","sources":["../../src/selfimprove/budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAwCH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GACpC,gEAAyE,CAAC;AAiB5E,2CAA2C;AAC3C,MAAM,UAAU,UAAU;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;AACrD,CAAC;AAiBD;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,oCAAoC;IACpB,IAAI,GAAG,+BAAwC,CAAC;IAChE,8BAA8B;IACd,SAAS,CAA0B;IAEnD;;;;OAIG;IACH,YAAY,SAAkC,EAAE,SAAiB,EAAE,GAAW;QAC5E,KAAK,CAAC,iCAAiC,SAAS,gBAAgB,SAAS,YAAY,GAAG,EAAE,CAAC,CAAC;QAC5F,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AAYD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,cAAc;IAChB,OAAO,CAA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,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IACzC,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,YAAwC,EAAE,EAC1C,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEpD,MAAM,SAAS,GACb,SAAS,CAAC,SAAS;QACnB,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACvF,MAAM,MAAM,GACV,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAE/F,sEAAsE;IACtE,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,YAAY,IAAI,cAAc,CAAC,YAAY,CAAC,CAAC;IAExF,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Durable DHQ adapter for the self-improvement loop (T11889 · T11889-C).
3
+ *
4
+ * This adapter sits OUTSIDE the store chokepoint (it is in `selfimprove/`, not
5
+ * `store/`), so it MUST NOT open a raw native handle (Gate-3). It is the lease
6
+ * boundary: EVERY write it performs is wrapped in
7
+ * {@link "../store/writer-lease.js".withWriterLease}`('project', 'bulk', …)`, which
8
+ * serializes the write against any other writer on the `(project, bulk)` lane. It
9
+ * then calls the Gate-3 accessors in
10
+ * {@link "../store/selfimprove-dhq-store.js"} (the ONLY native-handle toucher) —
11
+ * whose prepared statements target ONLY `selfimprove_dhq`.
12
+ *
13
+ * Two invariants the rest of the loop relies on:
14
+ *
15
+ * 1. **No raw / unleased write.** Reads go straight through the accessor (the
16
+ * shared handle, no lease); every WRITE goes through {@link upsertOpenDhq} /
17
+ * {@link recordPrUrl}, both of which acquire the lease first. There is no
18
+ * code path here that mutates `cleo.db` without the lease.
19
+ * 2. **`selfimprove_dhq` ONLY — never a prod `tasks`/`brain` row.** The lease
20
+ * SERIALIZES the write; it does NOT confine it to a table. The
21
+ * table-confinement is ENTIRELY this adapter's discipline: it calls only the
22
+ * `selfimprove_dhq` accessors, whose SQL references no other table. A unit
23
+ * test asserts the accessor SQL targets `selfimprove_dhq` and nothing else.
24
+ *
25
+ * Lease-mode note (P5 spec §B.7): the default mode is `local` (no daemon), where a
26
+ * contended lease DEGRADES under `busy_timeout` rather than throwing. To get a hard
27
+ * denial signal for the circuit-breaker, the process runs in `require` mode
28
+ * (`CLEO_WRITER_LEASE_MODE=require`), where an unacquirable lease THROWS
29
+ * {@link "../store/writer-lease.js".LeaseUnavailableError}. This adapter does NOT
30
+ * swallow that throw — it propagates so {@link runSelfImprove} trips the breaker.
31
+ *
32
+ * This module is import-time side-effect-free.
33
+ *
34
+ * @module @cleocode/core/selfimprove/dhq-adapter
35
+ * @epic T11889
36
+ * @task T11913
37
+ */
38
+ import { type SelfimproveDhqRow } from '../store/selfimprove-dhq-store.js';
39
+ /**
40
+ * The fields the engine supplies to {@link upsertOpenDhq}. `now` and the fixed
41
+ * `status: 'open'` are stamped by the accessor; `dhqId` / `severity` carry through.
42
+ */
43
+ export interface UpsertDhqInput {
44
+ /** Stable `'DHQ-###'` handle (used only on first insert for a hash). */
45
+ readonly dhqId: string;
46
+ /** The scenario name replayed. */
47
+ readonly scenario: string;
48
+ /** sha256 of the normalized regression signature — the idempotency key. */
49
+ readonly questionHash: string;
50
+ /** Human-readable DHQ title. */
51
+ readonly title: string;
52
+ /** The envelope-diff payload (the evidence) as serialized JSON. */
53
+ readonly regressionJson: string;
54
+ /** Severity classification, or `null` until triaged. */
55
+ readonly severity: string | null;
56
+ /** Ties the row to ONE loop run. */
57
+ readonly runId: string;
58
+ }
59
+ /** The durable DHQ adapter — the lease boundary for the self-improvement loop. */
60
+ export interface DhqAdapter {
61
+ /**
62
+ * Read the open DHQ row for a `question_hash` (lease-free — readers share the
63
+ * handle). Returns `null` when no open row exists.
64
+ */
65
+ readOpen(questionHash: string): Promise<SelfimproveDhqRow | null>;
66
+ /**
67
+ * UPSERT exactly ONE open DHQ row for a `question_hash`, under the
68
+ * `(project, bulk)` writer lease. Idempotent via the partial-UNIQUE index: a
69
+ * repeated open regression refreshes the existing row.
70
+ */
71
+ upsertOpenDhq(input: UpsertDhqInput): Promise<void>;
72
+ /**
73
+ * Record the draft PR URL on the open DHQ row for a `question_hash`, under the
74
+ * `(project, bulk)` writer lease.
75
+ *
76
+ * @returns The number of rows updated (0 when no open row exists).
77
+ */
78
+ recordPrUrl(questionHash: string, prUrl: string): Promise<number>;
79
+ }
80
+ /**
81
+ * Construct the durable DHQ adapter bound to a project working directory.
82
+ *
83
+ * Every WRITE method acquires the `(project, bulk)` writer lease via
84
+ * {@link "../store/writer-lease.js".withWriterLease} before delegating to the
85
+ * Gate-3 accessor. The native handle is resolved per call through
86
+ * {@link "../store/selfimprove-dhq-store.js".getSelfimproveDhqNativeDb} (the
87
+ * chokepoint singleton — no raw open). The clock is injectable for deterministic
88
+ * tests; production uses `Date.now`.
89
+ *
90
+ * @param opts - Adapter options.
91
+ * @param opts.cwd - Project working directory for scope resolution (defaults to `cwd`).
92
+ * @param opts.now - Injectable clock (defaults to {@link Date.now}).
93
+ * @returns A {@link DhqAdapter}.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * const adapter = createDhqAdapter({ cwd: projectRoot });
98
+ * await adapter.upsertOpenDhq({ dhqId: 'DHQ-001', … }); // leased UPSERT
99
+ * ```
100
+ */
101
+ export declare function createDhqAdapter(opts?: {
102
+ cwd?: string;
103
+ now?: () => number;
104
+ }): DhqAdapter;
105
+ //# sourceMappingURL=dhq-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dhq-adapter.d.ts","sourceRoot":"","sources":["../../src/selfimprove/dhq-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAGL,KAAK,iBAAiB,EAIvB,MAAM,mCAAmC,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,kFAAkF;AAClF,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAClE;;;;OAIG;IACH,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD;;;;;OAKG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACnE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAO,GAAG,UAAU,CAoC5F"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Durable DHQ adapter for the self-improvement loop (T11889 · T11889-C).
3
+ *
4
+ * This adapter sits OUTSIDE the store chokepoint (it is in `selfimprove/`, not
5
+ * `store/`), so it MUST NOT open a raw native handle (Gate-3). It is the lease
6
+ * boundary: EVERY write it performs is wrapped in
7
+ * {@link "../store/writer-lease.js".withWriterLease}`('project', 'bulk', …)`, which
8
+ * serializes the write against any other writer on the `(project, bulk)` lane. It
9
+ * then calls the Gate-3 accessors in
10
+ * {@link "../store/selfimprove-dhq-store.js"} (the ONLY native-handle toucher) —
11
+ * whose prepared statements target ONLY `selfimprove_dhq`.
12
+ *
13
+ * Two invariants the rest of the loop relies on:
14
+ *
15
+ * 1. **No raw / unleased write.** Reads go straight through the accessor (the
16
+ * shared handle, no lease); every WRITE goes through {@link upsertOpenDhq} /
17
+ * {@link recordPrUrl}, both of which acquire the lease first. There is no
18
+ * code path here that mutates `cleo.db` without the lease.
19
+ * 2. **`selfimprove_dhq` ONLY — never a prod `tasks`/`brain` row.** The lease
20
+ * SERIALIZES the write; it does NOT confine it to a table. The
21
+ * table-confinement is ENTIRELY this adapter's discipline: it calls only the
22
+ * `selfimprove_dhq` accessors, whose SQL references no other table. A unit
23
+ * test asserts the accessor SQL targets `selfimprove_dhq` and nothing else.
24
+ *
25
+ * Lease-mode note (P5 spec §B.7): the default mode is `local` (no daemon), where a
26
+ * contended lease DEGRADES under `busy_timeout` rather than throwing. To get a hard
27
+ * denial signal for the circuit-breaker, the process runs in `require` mode
28
+ * (`CLEO_WRITER_LEASE_MODE=require`), where an unacquirable lease THROWS
29
+ * {@link "../store/writer-lease.js".LeaseUnavailableError}. This adapter does NOT
30
+ * swallow that throw — it propagates so {@link runSelfImprove} trips the breaker.
31
+ *
32
+ * This module is import-time side-effect-free.
33
+ *
34
+ * @module @cleocode/core/selfimprove/dhq-adapter
35
+ * @epic T11889
36
+ * @task T11913
37
+ */
38
+ import { getSelfimproveDhqNativeDb, readOpenSelfimproveDhq, setSelfimproveDhqPrUrl, upsertOpenSelfimproveDhq, } from '../store/selfimprove-dhq-store.js';
39
+ import { withWriterLease } from '../store/writer-lease.js';
40
+ /**
41
+ * Construct the durable DHQ adapter bound to a project working directory.
42
+ *
43
+ * Every WRITE method acquires the `(project, bulk)` writer lease via
44
+ * {@link "../store/writer-lease.js".withWriterLease} before delegating to the
45
+ * Gate-3 accessor. The native handle is resolved per call through
46
+ * {@link "../store/selfimprove-dhq-store.js".getSelfimproveDhqNativeDb} (the
47
+ * chokepoint singleton — no raw open). The clock is injectable for deterministic
48
+ * tests; production uses `Date.now`.
49
+ *
50
+ * @param opts - Adapter options.
51
+ * @param opts.cwd - Project working directory for scope resolution (defaults to `cwd`).
52
+ * @param opts.now - Injectable clock (defaults to {@link Date.now}).
53
+ * @returns A {@link DhqAdapter}.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const adapter = createDhqAdapter({ cwd: projectRoot });
58
+ * await adapter.upsertOpenDhq({ dhqId: 'DHQ-001', … }); // leased UPSERT
59
+ * ```
60
+ */
61
+ export function createDhqAdapter(opts = {}) {
62
+ const cwd = opts.cwd;
63
+ const now = opts.now ?? (() => Date.now());
64
+ return {
65
+ async readOpen(questionHash) {
66
+ const native = await getSelfimproveDhqNativeDb(cwd);
67
+ return readOpenSelfimproveDhq(native, questionHash);
68
+ },
69
+ async upsertOpenDhq(input) {
70
+ // EVERY write is leased — never raw / unleased. The lease serializes against
71
+ // other writers on (project, bulk); the table-confinement is the accessor's.
72
+ await withWriterLease('project', 'bulk', async () => {
73
+ const native = await getSelfimproveDhqNativeDb(cwd);
74
+ const row = {
75
+ dhqId: input.dhqId,
76
+ scenario: input.scenario,
77
+ questionHash: input.questionHash,
78
+ title: input.title,
79
+ regressionJson: input.regressionJson,
80
+ severity: input.severity,
81
+ runId: input.runId,
82
+ now: now(),
83
+ };
84
+ upsertOpenSelfimproveDhq(native, row);
85
+ });
86
+ },
87
+ async recordPrUrl(questionHash, prUrl) {
88
+ return withWriterLease('project', 'bulk', async () => {
89
+ const native = await getSelfimproveDhqNativeDb(cwd);
90
+ return setSelfimproveDhqPrUrl(native, questionHash, prUrl, now());
91
+ });
92
+ },
93
+ };
94
+ }
95
+ //# sourceMappingURL=dhq-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dhq-adapter.js","sourceRoot":"","sources":["../../src/selfimprove/dhq-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EAGtB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AA6C3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAA6C,EAAE;IAC9E,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3C,OAAO;QACL,KAAK,CAAC,QAAQ,CAAC,YAAoB;YACjC,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC;YACpD,OAAO,sBAAsB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACtD,CAAC;QAED,KAAK,CAAC,aAAa,CAAC,KAAqB;YACvC,6EAA6E;YAC7E,6EAA6E;YAC7E,MAAM,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE;gBAClD,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC;gBACpD,MAAM,GAAG,GAAyB;oBAChC,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,YAAY,EAAE,KAAK,CAAC,YAAY;oBAChC,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,cAAc,EAAE,KAAK,CAAC,cAAc;oBACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,GAAG,EAAE,GAAG,EAAE;iBACX,CAAC;gBACF,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,WAAW,CAAC,YAAoB,EAAE,KAAa;YACnD,OAAO,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE;gBACnD,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,GAAG,CAAC,CAAC;gBACpD,OAAO,sBAAsB,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YACpE,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Draft-PR egress for the self-improvement loop (T11889 · T11889-C).
3
+ *
4
+ * On a detected regression the loop's ONLY outbound action is to open ONE DRAFT
5
+ * PR against the cleocode repo (ADR-065 — PRs target `main` via the Merge Queue;
6
+ * NEVER a direct push to `main`, NEVER an auto-merge, NEVER a publish). This module
7
+ * is the egress primitive, modeled on `propose-patch.ts` (the closest "agent
8
+ * proposes a fix PR" exemplar) with three self-dogfooding hardenings:
9
+ *
10
+ * 1. **`--draft` is ALWAYS appended** to `gh pr create` — the PR is never
11
+ * ready-for-merge; a human reviews and undrafts it.
12
+ * 2. **Dry-run is the DEFAULT.** `openDraftPr` returns the planned `steps[]`
13
+ * WITHOUT invoking git/gh unless `execute: true` is passed. So the loop is
14
+ * side-effect-free at egress by default.
15
+ * 3. **Branch `feat/T11889-selfimprove-<scenario>-<ts>`** — a feature branch
16
+ * (ADR-065); no main mutation path exists in this module.
17
+ *
18
+ * The live path wraps the git/gh shell-out in
19
+ * {@link "../sentient/skill-provenance.js".withProvenance}`('pr-generator', …)`
20
+ * (the established legal PR-cutting origin — the `SkillWriteOrigin` union is
21
+ * closed) and returns the `gh`-emitted PR URL so the caller can record it back
22
+ * into `selfimprove_dhq.pr_url` via the leased adapter.
23
+ *
24
+ * This module is import-time side-effect-free.
25
+ *
26
+ * @module @cleocode/core/selfimprove/draft-pr
27
+ * @epic T11889
28
+ * @task T11913
29
+ */
30
+ /**
31
+ * Pluggable command runner. Returns stdout as UTF-8 text or throws on non-zero
32
+ * exit. Production default wraps `child_process.execFileSync` with piped stdio.
33
+ */
34
+ export type CommandRunner = (file: string, args: readonly string[]) => string;
35
+ /** Failure codes from {@link openDraftPr}. */
36
+ export type DraftPrErrorCode =
37
+ /** Patch file does not exist on disk. */
38
+ 'E_NOT_FOUND'
39
+ /** Patch file exists but is empty. */
40
+ | 'E_PATCH_EMPTY'
41
+ /** `gh` CLI missing / not authenticated. */
42
+ | 'E_GH_UNAVAILABLE'
43
+ /** Shell-out failure during the live PR cut. */
44
+ | 'E_DRAFT_PR_FAILED';
45
+ /** Args for {@link openDraftPr}. */
46
+ export interface OpenDraftPrArgs {
47
+ /** The scenario name whose regression this PR addresses (branch slug). */
48
+ readonly scenario: string;
49
+ /** Path to a unified-diff file with the proposed fix. Resolved against {@link cwd}. */
50
+ readonly diffPath: string;
51
+ /** PR title. */
52
+ readonly title: string;
53
+ /** PR body markdown (the trailer is appended automatically). */
54
+ readonly body: string;
55
+ /**
56
+ * When `true`, actually cut the branch + open the draft PR. DEFAULT `false`
57
+ * (dry-run) — the loop is side-effect-free at egress unless `--execute` flows
58
+ * through to here.
59
+ *
60
+ * @defaultValue false
61
+ */
62
+ readonly execute?: boolean;
63
+ /** Working directory for path resolution + git ops. Defaults to {@link process.cwd}. */
64
+ readonly cwd?: string;
65
+ /** Injectable command runner (tests capture the shell-out). Defaults to {@link execFileSync}. */
66
+ readonly run?: CommandRunner;
67
+ /** Injectable timestamp source for the branch suffix (tests pin it). Defaults to now. */
68
+ readonly timestamp?: () => string;
69
+ }
70
+ /** Dry-run result — the planned steps, no side effects. */
71
+ export interface DraftPrDryRun {
72
+ readonly kind: 'dry-run';
73
+ readonly scenario: string;
74
+ readonly branchName: string;
75
+ /** The planned shell steps; the `gh pr create` step includes `--draft`. */
76
+ readonly steps: readonly string[];
77
+ }
78
+ /** Live result — the opened draft PR. */
79
+ export interface DraftPrOk {
80
+ readonly kind: 'ok';
81
+ readonly scenario: string;
82
+ readonly branchName: string;
83
+ /** The draft PR URL emitted by `gh pr create --draft`. */
84
+ readonly prUrl: string;
85
+ }
86
+ /** Failure result. */
87
+ export interface DraftPrFailure {
88
+ readonly kind: 'error';
89
+ readonly code: DraftPrErrorCode;
90
+ readonly message: string;
91
+ }
92
+ /** Discriminated-union result of {@link openDraftPr}. */
93
+ export type DraftPrResult = DraftPrDryRun | DraftPrOk | DraftPrFailure;
94
+ /**
95
+ * Compute the feature branch name for a scenario's draft PR (ADR-065 feature
96
+ * branch — `feat/T11889-selfimprove-<scenario>-<ts>`). The timestamp is
97
+ * colon/dot-sanitized so it is a valid git ref.
98
+ *
99
+ * @param scenario - The scenario name.
100
+ * @param ts - The ISO timestamp string.
101
+ * @returns The branch name.
102
+ */
103
+ export declare function draftPrBranchName(scenario: string, ts: string): string;
104
+ /**
105
+ * Open ONE DRAFT PR carrying a proposed self-improvement fix.
106
+ *
107
+ * DRY-RUN by default ({@link OpenDraftPrArgs.execute} falsey): returns the planned
108
+ * `steps[]` (the `gh pr create` step ALWAYS carries `--draft`) WITHOUT touching
109
+ * git/gh — so the loop is egress-side-effect-free unless `--execute` is threaded
110
+ * through. The live path (`execute: true`) cuts the feature branch, applies the
111
+ * diff, commits, pushes the FEATURE branch (NEVER `main`), and runs
112
+ * `gh pr create --base main --head <branch> --draft`, returning the PR URL.
113
+ *
114
+ * NEVER pushes `main`, NEVER auto-merges, NEVER publishes — the only egress is a
115
+ * draft PR against a feature branch.
116
+ *
117
+ * @param args - See {@link OpenDraftPrArgs}.
118
+ * @returns A {@link DraftPrResult} describing the outcome.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * // dry-run (default): no side effects, steps include `--draft`
123
+ * const plan = await openDraftPr({ scenario: 'x', diffPath: 'fix.patch', title, body });
124
+ * // live: cuts branch + opens draft PR
125
+ * const res = await openDraftPr({ scenario: 'x', diffPath: 'fix.patch', title, body, execute: true });
126
+ * ```
127
+ */
128
+ export declare function openDraftPr(args: OpenDraftPrArgs): Promise<DraftPrResult>;
129
+ //# sourceMappingURL=draft-pr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-pr.d.ts","sourceRoot":"","sources":["../../src/selfimprove/draft-pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAeH;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,MAAM,CAAC;AAM9E,8CAA8C;AAC9C,MAAM,MAAM,gBAAgB;AAC1B,yCAAyC;AACvC,aAAa;AACf,sCAAsC;GACpC,eAAe;AACjB,4CAA4C;GAC1C,kBAAkB;AACpB,gDAAgD;GAC9C,mBAAmB,CAAC;AAExB,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gBAAgB;IAChB,QAAQ,CAAC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