@cleocode/core 2026.5.134 → 2026.6.1

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 (557) hide show
  1. package/binaries/README.md +49 -27
  2. package/dist/agents/{agent-registry.d.ts → agent-capacity-tracker.d.ts} +2 -2
  3. package/dist/agents/agent-capacity-tracker.d.ts.map +1 -0
  4. package/dist/agents/{agent-registry.js → agent-capacity-tracker.js} +2 -2
  5. package/dist/agents/agent-capacity-tracker.js.map +1 -0
  6. package/dist/agents/index.d.ts +1 -1
  7. package/dist/agents/index.d.ts.map +1 -1
  8. package/dist/agents/index.js +4 -2
  9. package/dist/agents/index.js.map +1 -1
  10. package/dist/agents/seed-install.d.ts +1 -1
  11. package/dist/agents/seed-install.d.ts.map +1 -1
  12. package/dist/agents/seed-install.js +42 -36
  13. package/dist/agents/seed-install.js.map +1 -1
  14. package/dist/caamp-export.d.ts +18 -0
  15. package/dist/caamp-export.d.ts.map +1 -0
  16. package/dist/caamp-export.js +18 -0
  17. package/dist/caamp-export.js.map +1 -0
  18. package/dist/conduit/http-transport.d.ts +7 -13
  19. package/dist/conduit/http-transport.d.ts.map +1 -1
  20. package/dist/conduit/http-transport.js +12 -59
  21. package/dist/conduit/http-transport.js.map +1 -1
  22. package/dist/conduit/local-transport.d.ts +1 -1
  23. package/dist/conduit/local-transport.d.ts.map +1 -1
  24. package/dist/conduit/local-transport.js +69 -43
  25. package/dist/conduit/local-transport.js.map +1 -1
  26. package/dist/dispatch/mutate-projection.d.ts.map +1 -1
  27. package/dist/dispatch/mutate-projection.js +11 -0
  28. package/dist/dispatch/mutate-projection.js.map +1 -1
  29. package/dist/docs/docs-read-model.d.ts +7 -0
  30. package/dist/docs/docs-read-model.d.ts.map +1 -1
  31. package/dist/docs/docs-read-model.js +5 -0
  32. package/dist/docs/docs-read-model.js.map +1 -1
  33. package/dist/docs/export-document.js +40526 -281
  34. package/dist/docs/export-document.js.map +6 -1
  35. package/dist/docs/supersede.d.ts.map +1 -1
  36. package/dist/docs/supersede.js +12 -7
  37. package/dist/docs/supersede.js.map +1 -1
  38. package/dist/doctor/db-substrate.d.ts.map +1 -1
  39. package/dist/doctor/db-substrate.js +10 -9
  40. package/dist/doctor/db-substrate.js.map +1 -1
  41. package/dist/git-shim-export.d.ts +18 -0
  42. package/dist/git-shim-export.d.ts.map +1 -0
  43. package/dist/git-shim-export.js +18 -0
  44. package/dist/git-shim-export.js.map +1 -0
  45. package/dist/hooks/payload-schemas.d.ts +2 -2
  46. package/dist/init.d.ts.map +1 -1
  47. package/dist/init.js +39 -32
  48. package/dist/init.js.map +1 -1
  49. package/dist/internal.d.ts +11 -3
  50. package/dist/internal.d.ts.map +1 -1
  51. package/dist/internal.js +14 -5
  52. package/dist/internal.js.map +1 -1
  53. package/dist/lafs-export.d.ts +18 -0
  54. package/dist/lafs-export.d.ts.map +1 -0
  55. package/dist/lafs-export.js +18 -0
  56. package/dist/lafs-export.js.map +1 -0
  57. package/dist/lifecycle/effective-stage.js +1 -1
  58. package/dist/lifecycle/index.js +1 -1
  59. package/dist/lifecycle/index.js.map +1 -1
  60. package/dist/lifecycle/rollup.js +1 -1
  61. package/dist/llm/credential-pool.d.ts +17 -0
  62. package/dist/llm/credential-pool.d.ts.map +1 -1
  63. package/dist/llm/credential-pool.js +40 -1
  64. package/dist/llm/credential-pool.js.map +1 -1
  65. package/dist/llm/plugin-facade.d.ts.map +1 -1
  66. package/dist/llm/plugin-facade.js +43392 -354
  67. package/dist/llm/plugin-facade.js.map +6 -1
  68. package/dist/llm/role-executor.d.ts +8 -0
  69. package/dist/llm/role-executor.d.ts.map +1 -1
  70. package/dist/llm/role-executor.js +96 -4
  71. package/dist/llm/role-executor.js.map +1 -1
  72. package/dist/llm/role-resolver.d.ts.map +1 -1
  73. package/dist/llm/role-resolver.js +56 -1
  74. package/dist/llm/role-resolver.js.map +1 -1
  75. package/dist/llm/transports/codex-oauth-headers.d.ts +51 -0
  76. package/dist/llm/transports/codex-oauth-headers.d.ts.map +1 -0
  77. package/dist/llm/transports/codex-oauth-headers.js +89 -0
  78. package/dist/llm/transports/codex-oauth-headers.js.map +1 -0
  79. package/dist/memory/claude-mem-migration.d.ts.map +1 -1
  80. package/dist/memory/claude-mem-migration.js +1 -3
  81. package/dist/memory/claude-mem-migration.js.map +1 -1
  82. package/dist/memory/decisions.d.ts.map +1 -1
  83. package/dist/memory/decisions.js +77 -23
  84. package/dist/memory/decisions.js.map +1 -1
  85. package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
  86. package/dist/memory/graph-memory-bridge.js +12 -6
  87. package/dist/memory/graph-memory-bridge.js.map +1 -1
  88. package/dist/memory/learnings.d.ts +2 -2
  89. package/dist/memory/nexus-plasticity.d.ts +21 -9
  90. package/dist/memory/nexus-plasticity.d.ts.map +1 -1
  91. package/dist/memory/nexus-plasticity.js +44 -22
  92. package/dist/memory/nexus-plasticity.js.map +1 -1
  93. package/dist/memory/patterns.d.ts +2 -2
  94. package/dist/memory/redaction.d.ts +19 -3
  95. package/dist/memory/redaction.d.ts.map +1 -1
  96. package/dist/memory/redaction.js +64 -129
  97. package/dist/memory/redaction.js.map +6 -1
  98. package/dist/metrics/token-service.d.ts +8 -2
  99. package/dist/metrics/token-service.d.ts.map +1 -1
  100. package/dist/metrics/token-service.js +1 -1
  101. package/dist/metrics/token-service.js.map +1 -1
  102. package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
  103. package/dist/nexus/analyze-orchestrator.js +6 -8
  104. package/dist/nexus/analyze-orchestrator.js.map +1 -1
  105. package/dist/nexus/api-extractors/http-extractor.d.ts.map +1 -1
  106. package/dist/nexus/api-extractors/http-extractor.js +3 -3
  107. package/dist/nexus/api-extractors/http-extractor.js.map +1 -1
  108. package/dist/nexus/clusters.d.ts.map +1 -1
  109. package/dist/nexus/clusters.js +3 -2
  110. package/dist/nexus/clusters.js.map +1 -1
  111. package/dist/nexus/context.d.ts.map +1 -1
  112. package/dist/nexus/context.js +10 -16
  113. package/dist/nexus/context.js.map +1 -1
  114. package/dist/nexus/diff.d.ts.map +1 -1
  115. package/dist/nexus/diff.js +6 -4
  116. package/dist/nexus/diff.js.map +1 -1
  117. package/dist/nexus/export.d.ts.map +1 -1
  118. package/dist/nexus/export.js +7 -4
  119. package/dist/nexus/export.js.map +1 -1
  120. package/dist/nexus/flows.d.ts.map +1 -1
  121. package/dist/nexus/flows.js +3 -1
  122. package/dist/nexus/flows.js.map +1 -1
  123. package/dist/nexus/impact.d.ts +1 -1
  124. package/dist/nexus/impact.d.ts.map +1 -1
  125. package/dist/nexus/impact.js +31 -17
  126. package/dist/nexus/impact.js.map +1 -1
  127. package/dist/nexus/living-brain.d.ts.map +1 -1
  128. package/dist/nexus/living-brain.js +27 -15
  129. package/dist/nexus/living-brain.js.map +1 -1
  130. package/dist/nexus/nexus-bridge.d.ts.map +1 -1
  131. package/dist/nexus/nexus-bridge.js +28 -29
  132. package/dist/nexus/nexus-bridge.js.map +1 -1
  133. package/dist/nexus/plasticity-queries.d.ts +4 -2
  134. package/dist/nexus/plasticity-queries.d.ts.map +1 -1
  135. package/dist/nexus/plasticity-queries.js +27 -15
  136. package/dist/nexus/plasticity-queries.js.map +1 -1
  137. package/dist/nexus/query.d.ts.map +1 -1
  138. package/dist/nexus/query.js +6 -2
  139. package/dist/nexus/query.js.map +1 -1
  140. package/dist/nexus/registry.d.ts.map +1 -1
  141. package/dist/nexus/registry.js +65 -30
  142. package/dist/nexus/registry.js.map +1 -1
  143. package/dist/nexus/route-analysis.d.ts +3 -2
  144. package/dist/nexus/route-analysis.d.ts.map +1 -1
  145. package/dist/nexus/route-analysis.js +11 -10
  146. package/dist/nexus/route-analysis.js.map +1 -1
  147. package/dist/nexus/sigil.d.ts.map +1 -1
  148. package/dist/nexus/sigil.js +60 -13
  149. package/dist/nexus/sigil.js.map +1 -1
  150. package/dist/nexus/user-profile.d.ts +2 -1
  151. package/dist/nexus/user-profile.d.ts.map +1 -1
  152. package/dist/nexus/user-profile.js +8 -4
  153. package/dist/nexus/user-profile.js.map +1 -1
  154. package/dist/orchestrate/index.d.ts +1 -1
  155. package/dist/orchestrate/index.d.ts.map +1 -1
  156. package/dist/orchestrate/index.js +1 -1
  157. package/dist/orchestrate/index.js.map +1 -1
  158. package/dist/orchestrate/plan.d.ts +3 -3
  159. package/dist/orchestrate/plan.d.ts.map +1 -1
  160. package/dist/orchestrate/plan.js +7 -7
  161. package/dist/orchestrate/plan.js.map +1 -1
  162. package/dist/orchestrate/spawn-ops.js +2 -2
  163. package/dist/orchestrate/spawn-ops.js.map +1 -1
  164. package/dist/orchestration/classify.d.ts +2 -2
  165. package/dist/orchestration/classify.js +3 -3
  166. package/dist/orchestration/classify.js.map +1 -1
  167. package/dist/orchestration/validate-spawn.d.ts.map +1 -1
  168. package/dist/orchestration/validate-spawn.js +5 -5
  169. package/dist/orchestration/validate-spawn.js.map +1 -1
  170. package/dist/paths-export.d.ts +18 -0
  171. package/dist/paths-export.d.ts.map +1 -0
  172. package/dist/paths-export.js +18 -0
  173. package/dist/paths-export.js.map +1 -0
  174. package/dist/paths.d.ts.map +1 -1
  175. package/dist/paths.js +24 -11
  176. package/dist/paths.js.map +1 -1
  177. package/dist/playbooks/index.d.ts +1 -0
  178. package/dist/playbooks/index.d.ts.map +1 -1
  179. package/dist/playbooks/index.js +4 -0
  180. package/dist/playbooks/index.js.map +1 -1
  181. package/dist/playbooks/skill-node-executor.d.ts +155 -0
  182. package/dist/playbooks/skill-node-executor.d.ts.map +1 -0
  183. package/dist/playbooks/skill-node-executor.js +156 -0
  184. package/dist/playbooks/skill-node-executor.js.map +1 -0
  185. package/dist/repair.d.ts +3 -7
  186. package/dist/repair.d.ts.map +1 -1
  187. package/dist/repair.js +5 -43
  188. package/dist/repair.js.map +1 -1
  189. package/dist/sagas/migrate-containment.js +7 -7
  190. package/dist/sagas/migrate-containment.js.map +1 -1
  191. package/dist/scaffold/ensure-dirs.d.ts +8 -2
  192. package/dist/scaffold/ensure-dirs.d.ts.map +1 -1
  193. package/dist/scaffold/ensure-dirs.js +24 -11
  194. package/dist/scaffold/ensure-dirs.js.map +1 -1
  195. package/dist/scaffold/project-detection.d.ts +5 -1
  196. package/dist/scaffold/project-detection.d.ts.map +1 -1
  197. package/dist/scaffold/project-detection.js +9 -5
  198. package/dist/scaffold/project-detection.js.map +1 -1
  199. package/dist/sentient/hygiene-scan.js +6 -6
  200. package/dist/sentient/hygiene-scan.js.map +1 -1
  201. package/dist/sentient/proposal-dedup.js +2 -2
  202. package/dist/sentient/proposal-rate-limiter.js +1 -1
  203. package/dist/sentient/propose-tick.js +5 -5
  204. package/dist/sentient/propose-tick.js.map +1 -1
  205. package/dist/sentient/stage-drift-tick.js +3 -3
  206. package/dist/sentient/stage-drift-tick.js.map +1 -1
  207. package/dist/sequence/index.d.ts.map +1 -1
  208. package/dist/sequence/index.js +6 -2
  209. package/dist/sequence/index.js.map +1 -1
  210. package/dist/sessions/briefing.d.ts.map +1 -1
  211. package/dist/sessions/briefing.js +18 -4
  212. package/dist/sessions/briefing.js.map +1 -1
  213. package/dist/setup/sections/verification.js +2 -2
  214. package/dist/setup/sections/verification.js.map +1 -1
  215. package/dist/shutdown.d.ts +91 -0
  216. package/dist/shutdown.d.ts.map +1 -0
  217. package/dist/shutdown.js +120 -0
  218. package/dist/shutdown.js.map +1 -0
  219. package/dist/skills/index.d.ts +2 -0
  220. package/dist/skills/index.d.ts.map +1 -1
  221. package/dist/skills/index.js +1 -0
  222. package/dist/skills/index.js.map +1 -1
  223. package/dist/skills/skill-executor-adapter.d.ts +136 -0
  224. package/dist/skills/skill-executor-adapter.d.ts.map +1 -0
  225. package/dist/skills/skill-executor-adapter.js +137 -0
  226. package/dist/skills/skill-executor-adapter.js.map +1 -0
  227. package/dist/skills/usage-recorder.d.ts.map +1 -1
  228. package/dist/skills/usage-recorder.js +30 -0
  229. package/dist/skills/usage-recorder.js.map +1 -1
  230. package/dist/skills-export.d.ts +23 -0
  231. package/dist/skills-export.d.ts.map +1 -0
  232. package/dist/skills-export.js +23 -0
  233. package/dist/skills-export.js.map +1 -0
  234. package/dist/stats/index.d.ts.map +1 -1
  235. package/dist/stats/index.js +8 -3
  236. package/dist/stats/index.js.map +1 -1
  237. package/dist/store/agent-doctor.d.ts +3 -3
  238. package/dist/store/agent-doctor.d.ts.map +1 -1
  239. package/dist/store/agent-doctor.js +18 -13
  240. package/dist/store/agent-doctor.js.map +1 -1
  241. package/dist/store/agent-install.d.ts +6 -5
  242. package/dist/store/agent-install.d.ts.map +1 -1
  243. package/dist/store/agent-install.js +20 -16
  244. package/dist/store/agent-install.js.map +1 -1
  245. package/dist/store/agent-registry-accessor.d.ts +66 -28
  246. package/dist/store/agent-registry-accessor.d.ts.map +1 -1
  247. package/dist/store/agent-registry-accessor.js +248 -167
  248. package/dist/store/agent-registry-accessor.js.map +1 -1
  249. package/dist/store/agent-registry-store.d.ts +242 -0
  250. package/dist/store/agent-registry-store.d.ts.map +1 -0
  251. package/dist/store/agent-registry-store.js +501 -0
  252. package/dist/store/agent-registry-store.js.map +1 -0
  253. package/dist/store/agent-resolver.d.ts +8 -8
  254. package/dist/store/agent-resolver.d.ts.map +1 -1
  255. package/dist/store/agent-resolver.js +19 -17
  256. package/dist/store/agent-resolver.js.map +1 -1
  257. package/dist/store/backup-pack.d.ts.map +1 -1
  258. package/dist/store/backup-pack.js +24 -8
  259. package/dist/store/backup-pack.js.map +1 -1
  260. package/dist/store/conduit-sqlite.d.ts +181 -74
  261. package/dist/store/conduit-sqlite.d.ts.map +1 -1
  262. package/dist/store/conduit-sqlite.js +307 -528
  263. package/dist/store/conduit-sqlite.js.map +1 -1
  264. package/dist/store/cross-db-cleanup.d.ts +5 -5
  265. package/dist/store/cross-db-cleanup.d.ts.map +1 -1
  266. package/dist/store/cross-db-cleanup.js +12 -10
  267. package/dist/store/cross-db-cleanup.js.map +1 -1
  268. package/dist/store/data-accessor.d.ts +4 -4
  269. package/dist/store/data-accessor.js +5 -5
  270. package/dist/store/data-accessor.js.map +1 -1
  271. package/dist/store/data-safety-central.d.ts +83 -1
  272. package/dist/store/data-safety-central.d.ts.map +1 -1
  273. package/dist/store/data-safety-central.js +257 -0
  274. package/dist/store/data-safety-central.js.map +1 -1
  275. package/dist/store/db-helpers.d.ts +8 -2
  276. package/dist/store/db-helpers.d.ts.map +1 -1
  277. package/dist/store/db-helpers.js +6 -2
  278. package/dist/store/db-helpers.js.map +1 -1
  279. package/dist/store/dual-scope-db.d.ts +46 -4
  280. package/dist/store/dual-scope-db.d.ts.map +1 -1
  281. package/dist/store/dual-scope-db.js +103 -9
  282. package/dist/store/dual-scope-db.js.map +1 -1
  283. package/dist/store/exodus/__fixtures__/representative-fixture.d.ts +116 -0
  284. package/dist/store/exodus/__fixtures__/representative-fixture.d.ts.map +1 -0
  285. package/dist/store/exodus/__fixtures__/representative-fixture.js +274 -0
  286. package/dist/store/exodus/__fixtures__/representative-fixture.js.map +1 -0
  287. package/dist/store/exodus/index.d.ts +3 -1
  288. package/dist/store/exodus/index.d.ts.map +1 -1
  289. package/dist/store/exodus/index.js +3 -1
  290. package/dist/store/exodus/index.js.map +1 -1
  291. package/dist/store/exodus/migrate.d.ts +120 -1
  292. package/dist/store/exodus/migrate.d.ts.map +1 -1
  293. package/dist/store/exodus/migrate.js +923 -119
  294. package/dist/store/exodus/migrate.js.map +1 -1
  295. package/dist/store/exodus/on-open.d.ts +189 -0
  296. package/dist/store/exodus/on-open.d.ts.map +1 -0
  297. package/dist/store/exodus/on-open.js +464 -0
  298. package/dist/store/exodus/on-open.js.map +1 -0
  299. package/dist/store/exodus/table-name-map.d.ts +173 -0
  300. package/dist/store/exodus/table-name-map.d.ts.map +1 -0
  301. package/dist/store/exodus/table-name-map.js +660 -0
  302. package/dist/store/exodus/table-name-map.js.map +1 -0
  303. package/dist/store/exodus/verify-migration.d.ts +72 -0
  304. package/dist/store/exodus/verify-migration.d.ts.map +1 -0
  305. package/dist/store/exodus/verify-migration.js +678 -0
  306. package/dist/store/exodus/verify-migration.js.map +1 -0
  307. package/dist/store/exodus/verify.d.ts +32 -8
  308. package/dist/store/exodus/verify.d.ts.map +1 -1
  309. package/dist/store/exodus/verify.js +48 -142
  310. package/dist/store/exodus/verify.js.map +1 -1
  311. package/dist/store/index.d.ts +2 -3
  312. package/dist/store/index.d.ts.map +1 -1
  313. package/dist/store/index.js +2 -3
  314. package/dist/store/index.js.map +1 -1
  315. package/dist/store/memory-accessor.d.ts +31 -0
  316. package/dist/store/memory-accessor.d.ts.map +1 -1
  317. package/dist/store/memory-accessor.js +38 -0
  318. package/dist/store/memory-accessor.js.map +1 -1
  319. package/dist/store/memory-sqlite.d.ts +86 -13
  320. package/dist/store/memory-sqlite.d.ts.map +1 -1
  321. package/dist/store/memory-sqlite.js +326 -528
  322. package/dist/store/memory-sqlite.js.map +1 -1
  323. package/dist/store/migrate-signaldock-to-conduit.d.ts +1 -1
  324. package/dist/store/migrate-signaldock-to-conduit.d.ts.map +1 -1
  325. package/dist/store/migrate-signaldock-to-conduit.js +126 -35
  326. package/dist/store/migrate-signaldock-to-conduit.js.map +1 -1
  327. package/dist/store/migration-manager.d.ts +49 -0
  328. package/dist/store/migration-manager.d.ts.map +1 -1
  329. package/dist/store/migration-manager.js +167 -67
  330. package/dist/store/migration-manager.js.map +1 -1
  331. package/dist/store/migration-sqlite.d.ts +1 -1
  332. package/dist/store/migration-sqlite.d.ts.map +1 -1
  333. package/dist/store/migration-sqlite.js +32 -3
  334. package/dist/store/migration-sqlite.js.map +1 -1
  335. package/dist/store/nexus-sqlite.d.ts +152 -29
  336. package/dist/store/nexus-sqlite.d.ts.map +1 -1
  337. package/dist/store/nexus-sqlite.js +496 -177
  338. package/dist/store/nexus-sqlite.js.map +1 -1
  339. package/dist/store/nexus-validation-schemas.d.ts +32 -32
  340. package/dist/store/open-cleo-db.d.ts +37 -40
  341. package/dist/store/open-cleo-db.d.ts.map +1 -1
  342. package/dist/store/open-cleo-db.js +76 -153
  343. package/dist/store/open-cleo-db.js.map +1 -1
  344. package/dist/store/role-accessors-impl.d.ts +4 -4
  345. package/dist/store/role-accessors-impl.d.ts.map +1 -1
  346. package/dist/store/role-accessors-impl.js +18 -15
  347. package/dist/store/role-accessors-impl.js.map +1 -1
  348. package/dist/store/schema/{signaldock-schema.d.ts → agent-registry-schema.d.ts} +15 -5
  349. package/dist/store/schema/agent-registry-schema.d.ts.map +1 -0
  350. package/dist/store/schema/{signaldock-schema.js → agent-registry-schema.js} +15 -5
  351. package/dist/store/schema/agent-registry-schema.js.map +1 -0
  352. package/dist/store/schema/agent-schema.d.ts +1 -1
  353. package/dist/store/schema/agent-schema.js +4 -4
  354. package/dist/store/schema/agent-schema.js.map +1 -1
  355. package/dist/store/schema/attachments.d.ts +1 -1
  356. package/dist/store/schema/audit.d.ts +15 -5
  357. package/dist/store/schema/audit.d.ts.map +1 -1
  358. package/dist/store/schema/audit.js +12 -2
  359. package/dist/store/schema/audit.js.map +1 -1
  360. package/dist/store/schema/background-jobs.d.ts +1 -1
  361. package/dist/store/schema/cleo-global/{signaldock.d.ts → agent-registry.d.ts} +277 -271
  362. package/dist/store/schema/cleo-global/agent-registry.d.ts.map +1 -0
  363. package/dist/store/schema/cleo-global/{signaldock.js → agent-registry.js} +136 -125
  364. package/dist/store/schema/cleo-global/agent-registry.js.map +1 -0
  365. package/dist/store/schema/cleo-global/index.d.ts +29 -22
  366. package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
  367. package/dist/store/schema/cleo-global/index.js +29 -22
  368. package/dist/store/schema/cleo-global/index.js.map +1 -1
  369. package/dist/store/schema/cleo-global/nexus.d.ts +36 -1034
  370. package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
  371. package/dist/store/schema/cleo-global/nexus.js +32 -337
  372. package/dist/store/schema/cleo-global/nexus.js.map +1 -1
  373. package/dist/store/schema/cleo-global/skills.d.ts +16 -0
  374. package/dist/store/schema/cleo-global/skills.d.ts.map +1 -1
  375. package/dist/store/schema/cleo-global/skills.js +11 -0
  376. package/dist/store/schema/cleo-global/skills.js.map +1 -1
  377. package/dist/store/schema/{cleo-project → cleo-global}/telemetry.d.ts +33 -17
  378. package/dist/store/schema/cleo-global/telemetry.d.ts.map +1 -0
  379. package/dist/store/schema/{cleo-project → cleo-global}/telemetry.js +30 -18
  380. package/dist/store/schema/cleo-global/telemetry.js.map +1 -0
  381. package/dist/store/schema/cleo-project/audit.d.ts +8 -8
  382. package/dist/store/schema/cleo-project/audit.d.ts.map +1 -1
  383. package/dist/store/schema/cleo-project/audit.js +2 -6
  384. package/dist/store/schema/cleo-project/audit.js.map +1 -1
  385. package/dist/store/schema/cleo-project/docs.d.ts +1 -1
  386. package/dist/store/schema/cleo-project/index.d.ts +29 -12
  387. package/dist/store/schema/cleo-project/index.d.ts.map +1 -1
  388. package/dist/store/schema/cleo-project/index.js +29 -12
  389. package/dist/store/schema/cleo-project/index.js.map +1 -1
  390. package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
  391. package/dist/store/schema/cleo-project/nexus-graph.d.ts +1067 -0
  392. package/dist/store/schema/cleo-project/nexus-graph.d.ts.map +1 -0
  393. package/dist/store/schema/cleo-project/nexus-graph.js +407 -0
  394. package/dist/store/schema/cleo-project/nexus-graph.js.map +1 -0
  395. package/dist/store/schema/cleo-project/provenance-orphans.d.ts +385 -0
  396. package/dist/store/schema/cleo-project/provenance-orphans.d.ts.map +1 -0
  397. package/dist/store/schema/cleo-project/provenance-orphans.js +142 -0
  398. package/dist/store/schema/cleo-project/provenance-orphans.js.map +1 -0
  399. package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
  400. package/dist/store/schema/cleo-project/runtime.d.ts +1 -1
  401. package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
  402. package/dist/store/schema/cleo-project/tasks-core.d.ts +3 -3
  403. package/dist/store/schema/cleo-shared/brain.d.ts +711 -494
  404. package/dist/store/schema/cleo-shared/brain.d.ts.map +1 -1
  405. package/dist/store/schema/cleo-shared/brain.js +215 -134
  406. package/dist/store/schema/cleo-shared/brain.js.map +1 -1
  407. package/dist/store/schema/conduit-schema.d.ts +63 -51
  408. package/dist/store/schema/conduit-schema.d.ts.map +1 -1
  409. package/dist/store/schema/conduit-schema.js +23 -11
  410. package/dist/store/schema/conduit-schema.js.map +1 -1
  411. package/dist/store/schema/goal.d.ts +3 -2
  412. package/dist/store/schema/goal.d.ts.map +1 -1
  413. package/dist/store/schema/goal.js +3 -2
  414. package/dist/store/schema/goal.js.map +1 -1
  415. package/dist/store/schema/index.d.ts +1 -0
  416. package/dist/store/schema/index.d.ts.map +1 -1
  417. package/dist/store/schema/index.js +1 -0
  418. package/dist/store/schema/index.js.map +1 -1
  419. package/dist/store/schema/lifecycle.d.ts +2 -2
  420. package/dist/store/schema/memory-schema.d.ts +2 -2
  421. package/dist/store/schema/nexus-schema.d.ts +174 -115
  422. package/dist/store/schema/nexus-schema.d.ts.map +1 -1
  423. package/dist/store/schema/nexus-schema.js +175 -55
  424. package/dist/store/schema/nexus-schema.js.map +1 -1
  425. package/dist/store/schema/provenance/releases.d.ts +1 -1
  426. package/dist/store/schema/schema-utils.d.ts +78 -0
  427. package/dist/store/schema/schema-utils.d.ts.map +1 -0
  428. package/dist/store/schema/schema-utils.js +49 -0
  429. package/dist/store/schema/schema-utils.js.map +1 -0
  430. package/dist/store/schema/skills-schema.d.ts +81 -44
  431. package/dist/store/schema/skills-schema.d.ts.map +1 -1
  432. package/dist/store/schema/skills-schema.js +49 -16
  433. package/dist/store/schema/skills-schema.js.map +1 -1
  434. package/dist/store/schema/tasks.d.ts +3 -3
  435. package/dist/store/skills-db.d.ts +90 -50
  436. package/dist/store/skills-db.d.ts.map +1 -1
  437. package/dist/store/skills-db.js +132 -146
  438. package/dist/store/skills-db.js.map +1 -1
  439. package/dist/store/sqlite-backup.d.ts +2 -2
  440. package/dist/store/sqlite-backup.d.ts.map +1 -1
  441. package/dist/store/sqlite-backup.js +11 -10
  442. package/dist/store/sqlite-backup.js.map +1 -1
  443. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  444. package/dist/store/sqlite-data-accessor.js +25 -18
  445. package/dist/store/sqlite-data-accessor.js.map +1 -1
  446. package/dist/store/sqlite.d.ts +72 -12
  447. package/dist/store/sqlite.d.ts.map +1 -1
  448. package/dist/store/sqlite.js +153 -89
  449. package/dist/store/sqlite.js.map +1 -1
  450. package/dist/store/tasks-schema.d.ts +4 -0
  451. package/dist/store/tasks-schema.d.ts.map +1 -1
  452. package/dist/store/tasks-schema.js +60 -0
  453. package/dist/store/tasks-schema.js.map +1 -1
  454. package/dist/store/tasks-sqlite.d.ts +2 -2
  455. package/dist/store/tasks-sqlite.d.ts.map +1 -1
  456. package/dist/store/tasks-sqlite.js +10 -5
  457. package/dist/store/tasks-sqlite.js.map +1 -1
  458. package/dist/store/umbrella-data-accessor.d.ts +17 -6
  459. package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
  460. package/dist/store/umbrella-data-accessor.js +8 -8
  461. package/dist/store/umbrella-data-accessor.js.map +1 -1
  462. package/dist/store/validation-schemas.d.ts +241 -208
  463. package/dist/store/validation-schemas.d.ts.map +1 -1
  464. package/dist/system/health.d.ts.map +1 -1
  465. package/dist/system/health.js +11 -6
  466. package/dist/system/health.js.map +1 -1
  467. package/dist/system/project-health.d.ts.map +1 -1
  468. package/dist/system/project-health.js +58 -12
  469. package/dist/system/project-health.js.map +1 -1
  470. package/dist/tasks/add.d.ts +8 -0
  471. package/dist/tasks/add.d.ts.map +1 -1
  472. package/dist/tasks/add.js +101 -0
  473. package/dist/tasks/add.js.map +1 -1
  474. package/dist/tasks/cancelled-child-waiver-audit.d.ts +47 -0
  475. package/dist/tasks/cancelled-child-waiver-audit.d.ts.map +1 -0
  476. package/dist/tasks/cancelled-child-waiver-audit.js +34 -0
  477. package/dist/tasks/cancelled-child-waiver-audit.js.map +1 -0
  478. package/dist/tasks/complete.d.ts +22 -2
  479. package/dist/tasks/complete.d.ts.map +1 -1
  480. package/dist/tasks/complete.js +71 -6
  481. package/dist/tasks/complete.js.map +1 -1
  482. package/dist/tasks/compute-task-view.js +1 -1
  483. package/dist/tasks/session-scope.d.ts +5 -0
  484. package/dist/tasks/session-scope.d.ts.map +1 -1
  485. package/dist/tasks/session-scope.js +4 -0
  486. package/dist/tasks/session-scope.js.map +1 -1
  487. package/dist/tools/guard.d.ts +71 -1
  488. package/dist/tools/guard.d.ts.map +1 -1
  489. package/dist/tools/guard.js +73 -1
  490. package/dist/tools/guard.js.map +1 -1
  491. package/dist/tools/index.d.ts +21 -0
  492. package/dist/tools/index.d.ts.map +1 -1
  493. package/dist/tools/index.js +25 -0
  494. package/dist/tools/index.js.map +1 -1
  495. package/dist/upgrade.d.ts.map +1 -1
  496. package/dist/upgrade.js +22 -13
  497. package/dist/upgrade.js.map +1 -1
  498. package/dist/workgraph/containment.js +18 -18
  499. package/dist/workgraph/relations.js +2 -2
  500. package/dist/worktree/list.d.ts +1 -1
  501. package/dist/worktree/list.d.ts.map +1 -1
  502. package/dist/worktree/list.js +19 -21
  503. package/dist/worktree/list.js.map +1 -1
  504. package/dist/worktree-export.d.ts +18 -0
  505. package/dist/worktree-export.d.ts.map +1 -0
  506. package/dist/worktree-export.js +18 -0
  507. package/dist/worktree-export.js.map +1 -0
  508. package/migrations/drizzle-agent-registry/20260412000000_initial-global-agent-registry/migration.sql +29 -0
  509. package/migrations/drizzle-brain/20260601000001_t11522-brain-task-observations/migration.sql +28 -0
  510. package/migrations/drizzle-brain/20260601000002_t11522-inline-only-brain-tables/migration.sql +75 -0
  511. package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/migration.sql +49 -144
  512. package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/snapshot.json +8 -8
  513. package/migrations/drizzle-cleo-global/20260531000002_t11546-brain-usage-log/migration.sql +16 -0
  514. package/migrations/drizzle-cleo-global/20260601000001_t11544-skills-usage-project-id/migration.sql +12 -0
  515. package/migrations/drizzle-cleo-global/20260602000001_t11622-agent-registry-rename/migration.sql +80 -0
  516. package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/migration.sql +26 -167
  517. package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/snapshot.json +8 -8
  518. package/migrations/drizzle-cleo-project/20260531000002_t11546-brain-usage-log/migration.sql +21 -0
  519. package/migrations/drizzle-cleo-project/20260601000001_t11549-agent-credentials-brain-release-links/migration.sql +49 -0
  520. package/migrations/drizzle-cleo-project/20260601000002_t11538-project-nexus-graph/migration.sql +140 -0
  521. package/migrations/drizzle-cleo-project/20260602000002_t11649-token-usage-transport-mcp/migration.sql +146 -0
  522. package/migrations/drizzle-conduit/20260601000003_t11523-conduit-inline-schema/migration.sql +82 -0
  523. package/migrations/drizzle-nexus/20260421200001_t1165-baseline-reset/migration.sql +26 -8
  524. package/migrations/drizzle-nexus/20260601000001_t11545-nexus-relation-weights-partition/migration.sql +97 -0
  525. package/package.json +45 -13
  526. package/scripts/install-supervisor-binary.mjs +50 -201
  527. package/scripts/napi-binary-picker.mjs +267 -0
  528. package/dist/agents/agent-registry.d.ts.map +0 -1
  529. package/dist/agents/agent-registry.js.map +0 -1
  530. package/dist/store/data-safety.d.ts +0 -92
  531. package/dist/store/data-safety.d.ts.map +0 -1
  532. package/dist/store/data-safety.js +0 -274
  533. package/dist/store/data-safety.js.map +0 -1
  534. package/dist/store/schema/cleo-global/signaldock.d.ts.map +0 -1
  535. package/dist/store/schema/cleo-global/signaldock.js.map +0 -1
  536. package/dist/store/schema/cleo-project/telemetry.d.ts.map +0 -1
  537. package/dist/store/schema/cleo-project/telemetry.js.map +0 -1
  538. package/dist/store/schema/signaldock-schema.d.ts.map +0 -1
  539. package/dist/store/schema/signaldock-schema.js.map +0 -1
  540. package/dist/store/signaldock-sqlite.d.ts +0 -173
  541. package/dist/store/signaldock-sqlite.d.ts.map +0 -1
  542. package/dist/store/signaldock-sqlite.js +0 -445
  543. package/dist/store/signaldock-sqlite.js.map +0 -1
  544. package/migrations/drizzle-nexus/20260318205558_initial/migration.sql +0 -46
  545. package/migrations/drizzle-nexus/20260412000001_t529-nexus-graph-tables/migration.sql +0 -49
  546. package/migrations/drizzle-nexus/20260415000001_t622-project-registry-paths/migration.sql +0 -12
  547. package/migrations/drizzle-nexus/20260419000001_t998-nexus-plasticity/migration.sql +0 -13
  548. package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/migration.sql +0 -16
  549. package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/snapshot.json +0 -1531
  550. package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/migration.sql +0 -13
  551. package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/snapshot.json +0 -1652
  552. package/migrations/drizzle-nexus/20260504000001_t1839-fts5-nexus-symbols/migration.sql +0 -68
  553. package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/migration.sql +0 -20
  554. package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/snapshot.json +0 -1652
  555. package/migrations/drizzle-nexus/20260526222449_t11025-project-id-aliases/migration.sql +0 -16
  556. package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/migration.sql +0 -209
  557. package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/snapshot.json +0 -2060
@@ -1,14 +1,71 @@
1
1
  /**
2
- * SQLite store for nexus.db via drizzle-orm/node-sqlite + node:sqlite (DatabaseSync).
2
+ * SQLite store for the NEXUS domain via drizzle-orm/node-sqlite + node:sqlite
3
+ * (DatabaseSync).
3
4
  *
4
- * Separate database from tasks.db and brain.db for cross-project registry
5
- * and audit infrastructure. Follows the same singleton + WAL + migration
6
- * pattern as memory-sqlite.ts.
5
+ * ## Dual-scope residency split (ADR-090 · T11648 runtime read half)
7
6
  *
8
- * nexus.db lives in ~/.cleo/ (global home) rather than per-project .cleo/,
9
- * since it stores cross-project data.
7
+ * The nexus domain is now SPLIT across the two consolidated `cleo.db` files:
10
8
  *
9
+ * - **GRAPH (project scope):** the four code-graph tables (`nexus_nodes`,
10
+ * `nexus_relations`, `nexus_contracts`, `nexus_code_index`) + the
11
+ * `nexus_relation_weights` plasticity sibling live in
12
+ * `<projectRoot>/.cleo/cleo.db` — the portable per-project living brain.
13
+ * This is where exodus WRITES them (`resolveTableTargetScope` in
14
+ * `store/exodus/table-name-map.ts`), so the runtime READS them from there too.
15
+ * - **REGISTRY/identity (global scope):** the six cross-project tables
16
+ * (`nexus_project_registry`, `nexus_project_id_aliases`, `nexus_user_profile`,
17
+ * `nexus_sigils`, `nexus_audit_log`, `nexus_schema_meta`) stay in the GLOBAL
18
+ * `cleo.db` under {@link getCleoHome} (ADR-090 §2.2).
19
+ *
20
+ * `getNexusDb()` opens the PROJECT scope as `main` (via {@link openDualScopeDb}
21
+ * ('project')) and ATTACHes the GLOBAL `cleo.db` under
22
+ * {@link NEXUS_GLOBAL_ATTACH_ALIAS}. SQLite's bare-name resolution then routes
23
+ * each query to the correct file with ZERO accessor changes: graph tables exist
24
+ * in `main` (project) and resolve there; registry/identity tables are absent
25
+ * from `main` and fall through to the attached GLOBAL db. The GLOBAL db also
26
+ * carries empty graph tables (frozen T11363 migration leftovers), correctly
27
+ * SHADOWED by `main`.
28
+ *
29
+ * ### Why this fix (T11648)
30
+ *
31
+ * T11538/T11539 moved the graph schema to PROJECT scope and routed exodus there,
32
+ * but the runtime READ accessors still opened the GLOBAL handle — so after a
33
+ * `cleo exodus migrate` the project held 24k+ `nexus_nodes` while the runtime
34
+ * read 0 from global (`cleo nexus search-code` / `context` returned empty). This
35
+ * module is the deferred runtime half: it reads the graph from the SAME scope
36
+ * exodus writes it.
37
+ *
38
+ * This preserves the prior guarantees:
39
+ * - Every nexus-domain open flows through the single pragma SSoT (ADR-068/069).
40
+ * - DB Open Guard Gate 3 (`scripts/lint-no-direct-db-open.mjs`) stays green: the
41
+ * only native open is inside `dual-scope-db.ts` (the ATTACH below is a SQL
42
+ * statement on an already-chokepointed handle, not a `new DatabaseSync(`).
43
+ *
44
+ * ## COMPLETE-CUTOVER to prefixed `nexus_*` tables (T11578 · AC3)
45
+ *
46
+ * The nexus runtime READ + WRITE path targets PREFIXED consolidated tables. The
47
+ * five PROJECT graph tables are owned by the consolidated cleo-project migration;
48
+ * the six GLOBAL registry/identity tables by the consolidated cleo-global
49
+ * migration. The former legacy drop/rebuild (`establishLegacyNexusSchema`) and
50
+ * BARE registry tables (`project_registry`, …) are GONE. The runtime schema
51
+ * barrel `schema/nexus-schema.ts` maps every export symbol to its prefixed
52
+ * physical name — accessors need ZERO change.
53
+ *
54
+ * The `drizzle-nexus` migration set carries ONLY the delta the consolidated
55
+ * migration cannot model: the `nexus_symbols_fts` FTS5 virtual table + its three
56
+ * `nexus_nodes` triggers, the `nexus_relation_weights` plasticity-partition
57
+ * sibling (T11545), and the `_nexus_meta` health-probe table (the reconcile
58
+ * sentinel). The destructive half of the plasticity partition is applied
59
+ * idempotently at open by `ensureNexusRelationWeights` (a no-op for the
60
+ * already-narrow project-scope `nexus_relations`).
61
+ *
62
+ * @adr ADR-036 — registry/identity is global-only (relaxed for the 4 graph
63
+ * tables by ADR-090 §2.4).
64
+ * @adr ADR-090 — nexus code-graph residency global→project scope split.
11
65
  * @task T5365
66
+ * @task T11524 - E6-L4: route getNexusDb through the dual-scope chokepoint
67
+ * @task T11578 - AC3: COMPLETE-CUTOVER nexus runtime → prefixed nexus_* tables
68
+ * @task T11648 - ADR-090 runtime read half: route graph reads to project scope
12
69
  */
13
70
  import type { DatabaseSync } from 'node:sqlite';
14
71
  import type { NodeSQLiteDatabase } from 'drizzle-orm/node-sqlite';
@@ -16,22 +73,50 @@ import * as nexusSchema from './schema/nexus-schema.js';
16
73
  /** Schema version for newly created nexus databases. Single source of truth. */
17
74
  export declare const NEXUS_SCHEMA_VERSION = "1.0.0";
18
75
  /**
19
- * Returns the global-tier nexus.db path. ALWAYS under `getCleoHome()`.
76
+ * Returns the nexus GRAPH DB path the consolidated PROJECT `cleo.db`
77
+ * (`<projectRoot>/.cleo/cleo.db`), where the four code-graph tables
78
+ * (`nexus_nodes`, `nexus_relations`, `nexus_contracts`, `nexus_code_index`) and
79
+ * the `nexus_relation_weights` plasticity sibling physically reside post the
80
+ * ADR-090 residency split (T11538/T11539).
81
+ *
82
+ * ## ADR-090 residency move — runtime read half (T11648)
20
83
  *
21
- * nexus.db is a cross-project registry and must live in the global CLEO
22
- * home directory (`~/.local/share/cleo/` on Linux via XDG). It is NEVER
23
- * written to a per-project `.cleo/` directory.
84
+ * Exodus WRITES the graph tables to PROJECT scope (per `resolveTableTargetScope`
85
+ * in `store/exodus/table-name-map.ts`); this resolver routes the runtime READ
86
+ * path to the SAME scope so the migrated graph is visible. Previously this
87
+ * returned the GLOBAL `cleo.db` (`resolveDualScopeDbPath('global')`), which left
88
+ * `cleo nexus search-code` / `context` reading the empty global graph tables —
89
+ * the T11538/T11539 runtime-half gap this fix closes. The cross-project
90
+ * registry/identity tables stay GLOBAL and are reached via the
91
+ * {@link NEXUS_GLOBAL_ATTACH_ALIAS} attach (see {@link getNexusRegistryDbPath}).
24
92
  *
93
+ * @param cwd - Optional working directory used to resolve the owning project
94
+ * root (forwarded to {@link resolveDualScopeDbPath}('project', cwd)).
25
95
  * @task T307
26
96
  * @epic T299
27
- * @why ADR-036 §Decision/Global-Tier: nexus.db is global-only. This guard
28
- * throws immediately if path resolution ever drifts outside getCleoHome(),
29
- * preventing silent creation of project-tier stray nexus.db files.
30
- * @throws {Error} If the resolved path is not under `getCleoHome()` — this
31
- * indicates a code path that bypasses canonical path resolution and is a
32
- * bug that must be fixed rather than silently tolerated.
97
+ * @task T11648 (ADR-090 runtime read half route graph reads to project scope)
98
+ * @why ADR-090 §2.1/§2.4 supersedes ADR-036's global-only assertion FOR THE
99
+ * GRAPH TABLES ONLY. The graph is per-project and must live in the portable
100
+ * `.cleo/cleo.db`; the registry/identity tables remain global-asserted in
101
+ * {@link getNexusRegistryDbPath}.
33
102
  */
34
- export declare function getNexusDbPath(): string;
103
+ export declare function getNexusDbPath(cwd?: string): string;
104
+ /**
105
+ * Returns the cross-project nexus REGISTRY/identity DB path — the consolidated
106
+ * GLOBAL `cleo.db` under `getCleoHome()`.
107
+ *
108
+ * The registry/identity tables (`nexus_project_registry`,
109
+ * `nexus_project_id_aliases`, `nexus_user_profile`, `nexus_sigils`,
110
+ * `nexus_audit_log`, `nexus_schema_meta`) are genuinely global (ADR-090 §2.2)
111
+ * and MUST stay under `getCleoHome()`. The ADR-036 global-only assertion is
112
+ * retained here as defence-in-depth (it was relaxed only for the four graph
113
+ * tables, now homed in PROJECT scope via {@link getNexusDbPath}).
114
+ *
115
+ * @task T11648 (ADR-090 — registry stays global-asserted)
116
+ * @adr ADR-036 — registry/identity is global-only.
117
+ * @throws {Error} If the resolved path is not under `getCleoHome()`.
118
+ */
119
+ export declare function getNexusRegistryDbPath(): string;
35
120
  /**
36
121
  * Resolve the absolute path to the drizzle-nexus migrations folder inside
37
122
  * @cleocode/core, using ESM-native module resolution (T1177).
@@ -57,9 +142,8 @@ export declare function getNestedNexusSentinelPath(): string;
57
142
  * warning via the canonical pino logger if found.
58
143
  *
59
144
  * The function is non-blocking and non-throwing — it never alters the
60
- * outcome of the surrounding `getNexusDb()` open. The canonical flat
61
- * `nexus.db` open proceeds normally regardless of whether the nested debris
62
- * is present.
145
+ * outcome of the surrounding `getNexusDb()` open. The canonical consolidated
146
+ * open proceeds normally regardless of whether the nested debris is present.
63
147
  *
64
148
  * Idempotency: the first call for a given nested path emits the warning;
65
149
  * subsequent calls within the same process are no-ops. Tests can reset the
@@ -80,26 +164,65 @@ export declare function detectAndWarnOnNestedNexus(): boolean;
80
164
  */
81
165
  export declare function _resetNestedNexusWarningGate(): void;
82
166
  /**
83
- * Initialize the nexus.db SQLite database (lazy, singleton).
84
- * Creates the database file and tables if they don't exist.
85
- * Returns the drizzle ORM instance (async via sqlite-proxy).
167
+ * Initialize the consolidated PROJECT `cleo.db` (the nexus GRAPH home) with the
168
+ * GLOBAL `cleo.db` ATTACHed for registry/identity reads, plus the nexus DELTA
169
+ * schema within it (lazy, singleton).
170
+ *
171
+ * ## ADR-090 residency move — runtime read half (T11648)
172
+ *
173
+ * The four code-graph tables (`nexus_nodes`, `nexus_relations`, `nexus_contracts`,
174
+ * `nexus_code_index`) + the `nexus_relation_weights` plasticity sibling now live
175
+ * in PROJECT scope (`<projectRoot>/.cleo/cleo.db`) — that is where exodus WRITES
176
+ * them. The runtime READ path therefore opens the PROJECT scope as `main` so the
177
+ * graph is visible (previously it opened GLOBAL and read empty graph tables —
178
+ * the T11538/T11539 gap). The cross-project registry/identity tables stay GLOBAL;
179
+ * we open GLOBAL first (so its consolidated migration creates them) then ATTACH
180
+ * it under {@link NEXUS_GLOBAL_ATTACH_ALIAS} so the registry/identity accessors —
181
+ * which reference bare names (`nexus_project_registry`, `nexus_user_profile`,
182
+ * `nexus_sigils`, `nexus_project_id_aliases`, `nexus_audit_log`,
183
+ * `nexus_schema_meta`) — resolve via SQLite's bare-name fall-through to the
184
+ * attached GLOBAL db. ADR-036's global-only assertion is relaxed for the four
185
+ * graph tables ONLY (registry stays global-asserted in {@link getNexusRegistryDbPath}).
186
+ *
187
+ * Uses a promise guard so concurrent callers wait for the same initialization to
188
+ * complete (migrations are async).
86
189
  *
87
- * Uses a promise guard so concurrent callers wait for the same
88
- * initialization to complete (migrations are async).
190
+ * @task T307
191
+ * @task T11524 (E6-L4 dual-scope chokepoint delegation)
192
+ * @task T11578 (AC3 — prefixed `nexus_*` tables)
193
+ * @task T11648 (ADR-090 runtime read half — project-scope graph + global attach)
89
194
  */
90
195
  export declare function getNexusDb(): Promise<NodeSQLiteDatabase<typeof nexusSchema>>;
91
196
  /**
92
- * Close the nexus.db database connection and release resources.
197
+ * Close the nexus-domain database connection and release resources.
198
+ *
199
+ * ## E6-L4 (T11524) · ADR-090 runtime read half (T11648)
200
+ *
201
+ * The nexus GRAPH domain now SHARES the consolidated PROJECT `cleo.db` handle
202
+ * with the other project-tier domains (tasks/brain/conduit — all open it via
203
+ * {@link openDualScopeDb}('project'), same cache key), with the GLOBAL `cleo.db`
204
+ * ATTACHed for registry/identity reads. This function therefore must NOT close
205
+ * the underlying `DatabaseSync` nor evict the dual-scope cache — doing so would
206
+ * break in-flight queries from those siblings with "database is not open". It
207
+ * only drops the nexus-domain singleton references; the shared handle's lifecycle
208
+ * (and the global ATTACH) is owned by `openDualScopeDb` and torn down by a
209
+ * coordinated reset (`closeAllDatabases` → `_resetDualScopeDbCache`).
93
210
  */
94
211
  export declare function closeNexusDb(): void;
95
212
  /**
96
- * Reset nexus.db singleton state without saving.
97
- * Used during tests or when database file is recreated.
213
+ * Reset nexus singleton state without saving.
214
+ * Used during tests or when the database file is recreated.
98
215
  * Safe to call multiple times.
216
+ *
217
+ * ## E6-L4 (T11524) · ADR-090 runtime read half (T11648)
218
+ *
219
+ * Drops only the nexus-domain singleton references — does NOT close the shared
220
+ * dual-scope PROJECT `cleo.db` handle nor evict the dual-scope cache (that handle
221
+ * is shared with the other project-tier domains). Mirrors {@link closeNexusDb}.
99
222
  */
100
223
  export declare function resetNexusDbState(): void;
101
224
  /**
102
- * Get the underlying node:sqlite DatabaseSync instance for nexus.db.
225
+ * Get the underlying node:sqlite DatabaseSync instance for the nexus domain.
103
226
  * Useful for direct PRAGMA calls or raw SQL operations.
104
227
  * Returns null if the database hasn't been initialized.
105
228
  */
@@ -1 +1 @@
1
- {"version":3,"file":"nexus-sqlite.d.ts","sourceRoot":"","sources":["../../src/store/nexus-sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAMlE,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAMxD,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAS5C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAmBvC;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAuBD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CA8BpD;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAmRD;;;;;;;GAOG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC,OAAO,WAAW,CAAC,CAAC,CAmDlF;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAanC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAcxC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,GAAG,IAAI,CAEtD;AAED,YAAY,EAAE,kBAAkB,EAAE,CAAC;AACnC;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"nexus-sqlite.d.ts","sourceRoot":"","sources":["../../src/store/nexus-sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAYlE,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAMxD,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAmC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAe/C;AAuDD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAuBD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CA8BpD;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAiVD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC,OAAO,WAAW,CAAC,CAAC,CA2HlF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAQnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,GAAG,IAAI,CAEtD;AAED,YAAY,EAAE,kBAAkB,EAAE,CAAC;AACnC;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC"}