@cleocode/core 2026.9.24 → 2026.9.26

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 (481) hide show
  1. package/dist/admin/import-tasks.d.ts.map +1 -1
  2. package/dist/admin/import-tasks.js +5 -2
  3. package/dist/admin/import-tasks.js.map +1 -1
  4. package/dist/admin/import.d.ts.map +1 -1
  5. package/dist/admin/import.js +7 -2
  6. package/dist/admin/import.js.map +1 -1
  7. package/dist/audit-prune.d.ts +32 -0
  8. package/dist/audit-prune.d.ts.map +1 -1
  9. package/dist/audit-prune.js +37 -3
  10. package/dist/audit-prune.js.map +1 -1
  11. package/dist/build-provenance.json +2 -2
  12. package/dist/cloud/crypto.d.ts +1 -2
  13. package/dist/cloud/crypto.d.ts.map +1 -1
  14. package/dist/cloud/crypto.js +1 -11
  15. package/dist/cloud/crypto.js.map +1 -1
  16. package/dist/cloud/index.d.ts +1 -0
  17. package/dist/cloud/index.d.ts.map +1 -1
  18. package/dist/cloud/index.js +1 -0
  19. package/dist/cloud/index.js.map +1 -1
  20. package/dist/cloud/nexus-auth.d.ts +26 -1
  21. package/dist/cloud/nexus-auth.d.ts.map +1 -1
  22. package/dist/cloud/nexus-auth.js +61 -32
  23. package/dist/cloud/nexus-auth.js.map +1 -1
  24. package/dist/cloud/nexus-credentials.js +2 -2
  25. package/dist/cloud/nexus-credentials.js.map +1 -1
  26. package/dist/cloud/nexus-device.d.ts +809 -0
  27. package/dist/cloud/nexus-device.d.ts.map +1 -0
  28. package/dist/cloud/nexus-device.js +1680 -0
  29. package/dist/cloud/nexus-device.js.map +1 -0
  30. package/dist/cloud/nexus-enrol.d.ts +210 -0
  31. package/dist/cloud/nexus-enrol.d.ts.map +1 -0
  32. package/dist/cloud/nexus-enrol.js +1023 -0
  33. package/dist/cloud/nexus-enrol.js.map +1 -0
  34. package/dist/cloud/nexus-link.d.ts +3 -0
  35. package/dist/cloud/nexus-link.d.ts.map +1 -1
  36. package/dist/cloud/nexus-link.js +38 -4
  37. package/dist/cloud/nexus-link.js.map +1 -1
  38. package/dist/cloud/signing.d.ts +20 -0
  39. package/dist/cloud/signing.d.ts.map +1 -1
  40. package/dist/cloud/signing.js +14 -0
  41. package/dist/cloud/signing.js.map +1 -1
  42. package/dist/cloud/uuidv7.d.ts +9 -0
  43. package/dist/cloud/uuidv7.d.ts.map +1 -0
  44. package/dist/cloud/uuidv7.js +19 -0
  45. package/dist/cloud/uuidv7.js.map +1 -0
  46. package/dist/crypto/credentials.d.ts +61 -0
  47. package/dist/crypto/credentials.d.ts.map +1 -1
  48. package/dist/crypto/credentials.js +154 -58
  49. package/dist/crypto/credentials.js.map +1 -1
  50. package/dist/decide/bench/index.d.ts +1 -1
  51. package/dist/decide/bench/index.d.ts.map +1 -1
  52. package/dist/decide/bench/index.js +1 -1
  53. package/dist/decide/bench/index.js.map +1 -1
  54. package/dist/decide/bench/operation.d.ts +1 -1
  55. package/dist/decide/bench/operation.d.ts.map +1 -1
  56. package/dist/decide/bench/operation.js +1 -1
  57. package/dist/decide/bench/operation.js.map +1 -1
  58. package/dist/decide/bench/profiles.d.ts +50 -22
  59. package/dist/decide/bench/profiles.d.ts.map +1 -1
  60. package/dist/decide/bench/profiles.js +103 -59
  61. package/dist/decide/bench/profiles.js.map +1 -1
  62. package/dist/decide/bench/report.d.ts.map +1 -1
  63. package/dist/decide/bench/report.js +6 -1
  64. package/dist/decide/bench/report.js.map +1 -1
  65. package/dist/decide/bench/runner.d.ts +6 -1
  66. package/dist/decide/bench/runner.d.ts.map +1 -1
  67. package/dist/decide/bench/runner.js +1 -0
  68. package/dist/decide/bench/runner.js.map +1 -1
  69. package/dist/decide/client.d.ts.map +1 -1
  70. package/dist/decide/client.js +11 -5
  71. package/dist/decide/client.js.map +1 -1
  72. package/dist/decide/jev-wire.d.ts +31 -1
  73. package/dist/decide/jev-wire.d.ts.map +1 -1
  74. package/dist/decide/jev-wire.js +61 -7
  75. package/dist/decide/jev-wire.js.map +1 -1
  76. package/dist/docs/export-document.js +12907 -10622
  77. package/dist/docs/export-document.js.map +3 -3
  78. package/dist/doctor/dependency-cycles.d.ts +41 -0
  79. package/dist/doctor/dependency-cycles.d.ts.map +1 -0
  80. package/dist/doctor/dependency-cycles.js +39 -0
  81. package/dist/doctor/dependency-cycles.js.map +1 -0
  82. package/dist/doctor/index.d.ts +2 -0
  83. package/dist/doctor/index.d.ts.map +1 -1
  84. package/dist/doctor/index.js +1 -0
  85. package/dist/doctor/index.js.map +1 -1
  86. package/dist/doctor/orphan-ac-bindings.d.ts +64 -0
  87. package/dist/doctor/orphan-ac-bindings.d.ts.map +1 -0
  88. package/dist/doctor/orphan-ac-bindings.js +59 -0
  89. package/dist/doctor/orphan-ac-bindings.js.map +1 -0
  90. package/dist/doctor/projects.d.ts.map +1 -1
  91. package/dist/doctor/projects.js +43 -29
  92. package/dist/doctor/projects.js.map +1 -1
  93. package/dist/doctor/row-identity.d.ts +42 -0
  94. package/dist/doctor/row-identity.d.ts.map +1 -0
  95. package/dist/doctor/row-identity.js +151 -0
  96. package/dist/doctor/row-identity.js.map +1 -0
  97. package/dist/doctor/twin-collapse.d.ts +58 -2
  98. package/dist/doctor/twin-collapse.d.ts.map +1 -1
  99. package/dist/doctor/twin-collapse.js +212 -14
  100. package/dist/doctor/twin-collapse.js.map +1 -1
  101. package/dist/error-catalog.d.ts.map +1 -1
  102. package/dist/error-catalog.js +4 -0
  103. package/dist/error-catalog.js.map +1 -1
  104. package/dist/error-registry.d.ts.map +1 -1
  105. package/dist/error-registry.js +8 -0
  106. package/dist/error-registry.js.map +1 -1
  107. package/dist/lifecycle/verification/satisfies-validator.d.ts.map +1 -1
  108. package/dist/lifecycle/verification/satisfies-validator.js +10 -0
  109. package/dist/lifecycle/verification/satisfies-validator.js.map +1 -1
  110. package/dist/llm/plugin-facade.js +17767 -15482
  111. package/dist/llm/plugin-facade.js.map +3 -3
  112. package/dist/memory/index.d.ts.map +1 -1
  113. package/dist/memory/index.js +19 -10
  114. package/dist/memory/index.js.map +1 -1
  115. package/dist/memory/manifest-identity.d.ts +171 -0
  116. package/dist/memory/manifest-identity.d.ts.map +1 -0
  117. package/dist/memory/manifest-identity.js +345 -0
  118. package/dist/memory/manifest-identity.js.map +1 -0
  119. package/dist/memory/mental-model-queue.d.ts +14 -4
  120. package/dist/memory/mental-model-queue.d.ts.map +1 -1
  121. package/dist/memory/mental-model-queue.js +64 -35
  122. package/dist/memory/mental-model-queue.js.map +1 -1
  123. package/dist/memory/pipeline-manifest-sqlite.d.ts +47 -5
  124. package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -1
  125. package/dist/memory/pipeline-manifest-sqlite.js +130 -14
  126. package/dist/memory/pipeline-manifest-sqlite.js.map +1 -1
  127. package/dist/memory/retrieval/observe.d.ts.map +1 -1
  128. package/dist/memory/retrieval/observe.js +2 -0
  129. package/dist/memory/retrieval/observe.js.map +1 -1
  130. package/dist/memory/transcript-scanner.js +1 -1
  131. package/dist/nexus/deps.d.ts.map +1 -1
  132. package/dist/nexus/deps.js +7 -14
  133. package/dist/nexus/deps.js.map +1 -1
  134. package/dist/nexus/discover.d.ts.map +1 -1
  135. package/dist/nexus/discover.js +6 -9
  136. package/dist/nexus/discover.js.map +1 -1
  137. package/dist/nexus/git-state.d.ts.map +1 -1
  138. package/dist/nexus/git-state.js +10 -1
  139. package/dist/nexus/git-state.js.map +1 -1
  140. package/dist/nexus/projects-clean.d.ts.map +1 -1
  141. package/dist/nexus/projects-clean.js +22 -11
  142. package/dist/nexus/projects-clean.js.map +1 -1
  143. package/dist/nexus/projects-scan.d.ts.map +1 -1
  144. package/dist/nexus/projects-scan.js +8 -13
  145. package/dist/nexus/projects-scan.js.map +1 -1
  146. package/dist/nexus/query.d.ts.map +1 -1
  147. package/dist/nexus/query.js +4 -12
  148. package/dist/nexus/query.js.map +1 -1
  149. package/dist/nexus/registry-roots.d.ts +5 -2
  150. package/dist/nexus/registry-roots.d.ts.map +1 -1
  151. package/dist/nexus/registry-roots.js +8 -10
  152. package/dist/nexus/registry-roots.js.map +1 -1
  153. package/dist/nexus/registry.d.ts +18 -0
  154. package/dist/nexus/registry.d.ts.map +1 -1
  155. package/dist/nexus/registry.js +37 -16
  156. package/dist/nexus/registry.js.map +1 -1
  157. package/dist/nexus/workspace.d.ts.map +1 -1
  158. package/dist/nexus/workspace.js +54 -4
  159. package/dist/nexus/workspace.js.map +1 -1
  160. package/dist/orchestrate/lifecycle-ops.js +1 -1
  161. package/dist/orchestrate/lifecycle-ops.js.map +1 -1
  162. package/dist/orchestrate/pivot.d.ts.map +1 -1
  163. package/dist/orchestrate/pivot.js +4 -2
  164. package/dist/orchestrate/pivot.js.map +1 -1
  165. package/dist/orchestrate/query-ops.d.ts.map +1 -1
  166. package/dist/orchestrate/query-ops.js +3 -3
  167. package/dist/orchestrate/query-ops.js.map +1 -1
  168. package/dist/orchestrate/spawn-ops.js +1 -1
  169. package/dist/orchestrate/spawn-ops.js.map +1 -1
  170. package/dist/orchestrate/worktree-complete.d.ts.map +1 -1
  171. package/dist/orchestrate/worktree-complete.js +40 -2
  172. package/dist/orchestrate/worktree-complete.js.map +1 -1
  173. package/dist/orchestration/index.js +1 -1
  174. package/dist/orchestration/index.js.map +1 -1
  175. package/dist/orchestration/lead-rollup.d.ts.map +1 -1
  176. package/dist/orchestration/lead-rollup.js +3 -3
  177. package/dist/orchestration/lead-rollup.js.map +1 -1
  178. package/dist/orchestration/parallel.js +1 -1
  179. package/dist/orchestration/parallel.js.map +1 -1
  180. package/dist/orchestration/spawn-prompt.d.ts +26 -0
  181. package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
  182. package/dist/orchestration/spawn-prompt.js +62 -91
  183. package/dist/orchestration/spawn-prompt.js.map +1 -1
  184. package/dist/orchestration/wave-topic.d.ts +4 -2
  185. package/dist/orchestration/wave-topic.d.ts.map +1 -1
  186. package/dist/orchestration/wave-topic.js +6 -4
  187. package/dist/orchestration/wave-topic.js.map +1 -1
  188. package/dist/orchestration/waves.d.ts +2 -1
  189. package/dist/orchestration/waves.d.ts.map +1 -1
  190. package/dist/orchestration/waves.js +4 -3
  191. package/dist/orchestration/waves.js.map +1 -1
  192. package/dist/phases/index.d.ts.map +1 -1
  193. package/dist/phases/index.js +4 -2
  194. package/dist/phases/index.js.map +1 -1
  195. package/dist/release/ci-evidence.d.ts +190 -0
  196. package/dist/release/ci-evidence.d.ts.map +1 -1
  197. package/dist/release/ci-evidence.js +436 -4
  198. package/dist/release/ci-evidence.js.map +1 -1
  199. package/dist/sdk/validator-ac-pull.d.ts.map +1 -1
  200. package/dist/sdk/validator-ac-pull.js +2 -1
  201. package/dist/sdk/validator-ac-pull.js.map +1 -1
  202. package/dist/selfimprove/fix-gen.js +12807 -10522
  203. package/dist/selfimprove/fix-gen.js.map +3 -3
  204. package/dist/sentient/cross-project-hygiene.d.ts +5 -0
  205. package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
  206. package/dist/sentient/cross-project-hygiene.js +7 -1
  207. package/dist/sentient/cross-project-hygiene.js.map +1 -1
  208. package/dist/sentient/propose-tick.d.ts.map +1 -1
  209. package/dist/sentient/propose-tick.js +2 -3
  210. package/dist/sentient/propose-tick.js.map +1 -1
  211. package/dist/sentient/stage-drift-tick.d.ts.map +1 -1
  212. package/dist/sentient/stage-drift-tick.js +2 -3
  213. package/dist/sentient/stage-drift-tick.js.map +1 -1
  214. package/dist/session/engine-ops.d.ts.map +1 -1
  215. package/dist/session/engine-ops.js +77 -49
  216. package/dist/session/engine-ops.js.map +1 -1
  217. package/dist/sessions/focus-state-store.d.ts +69 -23
  218. package/dist/sessions/focus-state-store.d.ts.map +1 -1
  219. package/dist/sessions/focus-state-store.js +113 -27
  220. package/dist/sessions/focus-state-store.js.map +1 -1
  221. package/dist/sessions/handoff.js +1 -1
  222. package/dist/sessions/handoff.js.map +1 -1
  223. package/dist/sessions/index.d.ts.map +1 -1
  224. package/dist/sessions/index.js +24 -13
  225. package/dist/sessions/index.js.map +1 -1
  226. package/dist/sessions/terminal-identity.d.ts +165 -17
  227. package/dist/sessions/terminal-identity.d.ts.map +1 -1
  228. package/dist/sessions/terminal-identity.js +341 -32
  229. package/dist/sessions/terminal-identity.js.map +1 -1
  230. package/dist/skills/manifests/research.js +2 -0
  231. package/dist/skills/manifests/research.js.map +1 -1
  232. package/dist/skills/orchestrator/startup.js +2 -2
  233. package/dist/skills/orchestrator/startup.js.map +1 -1
  234. package/dist/skills/orchestrator/validator.d.ts.map +1 -1
  235. package/dist/skills/orchestrator/validator.js +9 -2
  236. package/dist/skills/orchestrator/validator.js.map +1 -1
  237. package/dist/skills/validation.d.ts +4 -1
  238. package/dist/skills/validation.d.ts.map +1 -1
  239. package/dist/skills/validation.js +11 -3
  240. package/dist/skills/validation.js.map +1 -1
  241. package/dist/snapshot/index.d.ts +4 -0
  242. package/dist/snapshot/index.d.ts.map +1 -1
  243. package/dist/snapshot/index.js +50 -3
  244. package/dist/snapshot/index.js.map +1 -1
  245. package/dist/spawn/branch-lock.d.ts +111 -7
  246. package/dist/spawn/branch-lock.d.ts.map +1 -1
  247. package/dist/spawn/branch-lock.js +296 -8
  248. package/dist/spawn/branch-lock.js.map +1 -1
  249. package/dist/store/ac-binding-prune.d.ts +144 -0
  250. package/dist/store/ac-binding-prune.d.ts.map +1 -0
  251. package/dist/store/ac-binding-prune.js +293 -0
  252. package/dist/store/ac-binding-prune.js.map +1 -0
  253. package/dist/store/agent-registry-store.d.ts.map +1 -1
  254. package/dist/store/agent-registry-store.js +3 -2
  255. package/dist/store/agent-registry-store.js.map +1 -1
  256. package/dist/store/backup-sidecar.d.ts +85 -2
  257. package/dist/store/backup-sidecar.d.ts.map +1 -1
  258. package/dist/store/backup-sidecar.js +173 -1
  259. package/dist/store/backup-sidecar.js.map +1 -1
  260. package/dist/store/conduit-sqlite.d.ts.map +1 -1
  261. package/dist/store/conduit-sqlite.js +3 -2
  262. package/dist/store/conduit-sqlite.js.map +1 -1
  263. package/dist/store/credential-transfer.d.ts.map +1 -1
  264. package/dist/store/credential-transfer.js +3 -0
  265. package/dist/store/credential-transfer.js.map +1 -1
  266. package/dist/store/db-helpers.d.ts +32 -13
  267. package/dist/store/db-helpers.d.ts.map +1 -1
  268. package/dist/store/db-helpers.js +144 -40
  269. package/dist/store/db-helpers.js.map +1 -1
  270. package/dist/store/dependency-cycles.d.ts +164 -0
  271. package/dist/store/dependency-cycles.d.ts.map +1 -0
  272. package/dist/store/dependency-cycles.js +360 -0
  273. package/dist/store/dependency-cycles.js.map +1 -0
  274. package/dist/store/display-id-alias.d.ts +585 -0
  275. package/dist/store/display-id-alias.d.ts.map +1 -0
  276. package/dist/store/display-id-alias.js +1538 -0
  277. package/dist/store/display-id-alias.js.map +1 -0
  278. package/dist/store/dual-scope-db.d.ts.map +1 -1
  279. package/dist/store/dual-scope-db.js +48 -0
  280. package/dist/store/dual-scope-db.js.map +1 -1
  281. package/dist/store/exodus/migrate.d.ts.map +1 -1
  282. package/dist/store/exodus/migrate.js +8 -1
  283. package/dist/store/exodus/migrate.js.map +1 -1
  284. package/dist/store/exodus/reconcile.d.ts.map +1 -1
  285. package/dist/store/exodus/reconcile.js +7 -2
  286. package/dist/store/exodus/reconcile.js.map +1 -1
  287. package/dist/store/exodus/recovery.d.ts.map +1 -1
  288. package/dist/store/exodus/recovery.js +20 -1
  289. package/dist/store/exodus/recovery.js.map +1 -1
  290. package/dist/store/global-salt.d.ts +35 -0
  291. package/dist/store/global-salt.d.ts.map +1 -1
  292. package/dist/store/global-salt.js +136 -16
  293. package/dist/store/global-salt.js.map +1 -1
  294. package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
  295. package/dist/store/legacy-tasks-lineage.js +19 -2
  296. package/dist/store/legacy-tasks-lineage.js.map +1 -1
  297. package/dist/store/migration-sqlite.d.ts.map +1 -1
  298. package/dist/store/migration-sqlite.js +19 -11
  299. package/dist/store/migration-sqlite.js.map +1 -1
  300. package/dist/store/portable-bundle-scan.d.ts.map +1 -1
  301. package/dist/store/portable-bundle-scan.js +6 -0
  302. package/dist/store/portable-bundle-scan.js.map +1 -1
  303. package/dist/store/row-identity-flag.d.ts +26 -0
  304. package/dist/store/row-identity-flag.d.ts.map +1 -0
  305. package/dist/store/row-identity-flag.js +31 -0
  306. package/dist/store/row-identity-flag.js.map +1 -0
  307. package/dist/store/row-identity-registry.d.ts +61 -0
  308. package/dist/store/row-identity-registry.d.ts.map +1 -0
  309. package/dist/store/row-identity-registry.js +206 -0
  310. package/dist/store/row-identity-registry.js.map +1 -0
  311. package/dist/store/row-identity.d.ts +480 -0
  312. package/dist/store/row-identity.d.ts.map +1 -0
  313. package/dist/store/row-identity.js +1509 -0
  314. package/dist/store/row-identity.js.map +1 -0
  315. package/dist/store/safety-data-accessor.d.ts +5 -2
  316. package/dist/store/safety-data-accessor.d.ts.map +1 -1
  317. package/dist/store/safety-data-accessor.js +9 -2
  318. package/dist/store/safety-data-accessor.js.map +1 -1
  319. package/dist/store/schema/attachments.d.ts +1 -1
  320. package/dist/store/schema/audit.d.ts +4 -4
  321. package/dist/store/schema/background-jobs.d.ts +1 -1
  322. package/dist/store/schema/cleo-global/nexus.d.ts +1 -1
  323. package/dist/store/schema/cleo-global/skills.d.ts +2 -2
  324. package/dist/store/schema/cleo-project/audit.d.ts +4 -4
  325. package/dist/store/schema/cleo-project/docs.d.ts +1 -1
  326. package/dist/store/schema/cleo-project/lifecycle.d.ts +4 -4
  327. package/dist/store/schema/cleo-project/nexus-graph.d.ts +3 -3
  328. package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
  329. package/dist/store/schema/cleo-project/provenance-rest.d.ts +3 -3
  330. package/dist/store/schema/cleo-project/runtime.d.ts +3 -3
  331. package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +87 -1
  332. package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts.map +1 -1
  333. package/dist/store/schema/cleo-project/tasks-core-batch2.js +35 -0
  334. package/dist/store/schema/cleo-project/tasks-core-batch2.js.map +1 -1
  335. package/dist/store/schema/cleo-project/tasks-core.d.ts +183 -7
  336. package/dist/store/schema/cleo-project/tasks-core.d.ts.map +1 -1
  337. package/dist/store/schema/cleo-project/tasks-core.js +52 -1
  338. package/dist/store/schema/cleo-project/tasks-core.js.map +1 -1
  339. package/dist/store/schema/cleo-shared/brain.d.ts +6 -6
  340. package/dist/store/schema/lifecycle.d.ts +4 -4
  341. package/dist/store/schema/manifest.d.ts +1 -1
  342. package/dist/store/schema/memory-schema.d.ts +5 -5
  343. package/dist/store/schema/nexus-schema.d.ts +3 -3
  344. package/dist/store/schema/provenance/releases.d.ts +1 -1
  345. package/dist/store/schema/skills-schema.d.ts +2 -2
  346. package/dist/store/schema/tasks.d.ts +6 -6
  347. package/dist/store/session-store.d.ts +63 -3
  348. package/dist/store/session-store.d.ts.map +1 -1
  349. package/dist/store/session-store.js +121 -8
  350. package/dist/store/session-store.js.map +1 -1
  351. package/dist/store/split-brain-import.d.ts +2 -14
  352. package/dist/store/split-brain-import.d.ts.map +1 -1
  353. package/dist/store/split-brain-import.js +40 -19
  354. package/dist/store/split-brain-import.js.map +1 -1
  355. package/dist/store/sqlite-data-accessor.d.ts +326 -2
  356. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  357. package/dist/store/sqlite-data-accessor.js +782 -49
  358. package/dist/store/sqlite-data-accessor.js.map +1 -1
  359. package/dist/store/sync/clock-store.d.ts +67 -0
  360. package/dist/store/sync/clock-store.d.ts.map +1 -0
  361. package/dist/store/sync/clock-store.js +117 -0
  362. package/dist/store/sync/clock-store.js.map +1 -0
  363. package/dist/store/sync/flags.d.ts +51 -0
  364. package/dist/store/sync/flags.d.ts.map +1 -0
  365. package/dist/store/sync/flags.js +81 -0
  366. package/dist/store/sync/flags.js.map +1 -0
  367. package/dist/store/sync/hlc.d.ts +115 -0
  368. package/dist/store/sync/hlc.d.ts.map +1 -0
  369. package/dist/store/sync/hlc.js +172 -0
  370. package/dist/store/sync/hlc.js.map +1 -0
  371. package/dist/store/sync/index.d.ts +20 -0
  372. package/dist/store/sync/index.d.ts.map +1 -0
  373. package/dist/store/sync/index.js +20 -0
  374. package/dist/store/sync/index.js.map +1 -0
  375. package/dist/store/sync/replica-registry.d.ts +85 -0
  376. package/dist/store/sync/replica-registry.d.ts.map +1 -0
  377. package/dist/store/sync/replica-registry.js +147 -0
  378. package/dist/store/sync/replica-registry.js.map +1 -0
  379. package/dist/store/sync/replica.d.ts +181 -0
  380. package/dist/store/sync/replica.d.ts.map +1 -0
  381. package/dist/store/sync/replica.js +305 -0
  382. package/dist/store/sync/replica.js.map +1 -0
  383. package/dist/store/sync/schema.d.ts +68 -0
  384. package/dist/store/sync/schema.d.ts.map +1 -0
  385. package/dist/store/sync/schema.js +130 -0
  386. package/dist/store/sync/schema.js.map +1 -0
  387. package/dist/store/sync/skew-hold.d.ts +71 -0
  388. package/dist/store/sync/skew-hold.d.ts.map +1 -0
  389. package/dist/store/sync/skew-hold.js +89 -0
  390. package/dist/store/sync/skew-hold.js.map +1 -0
  391. package/dist/store/table-classification.d.ts +10 -8
  392. package/dist/store/table-classification.d.ts.map +1 -1
  393. package/dist/store/table-classification.js +93 -25
  394. package/dist/store/table-classification.js.map +1 -1
  395. package/dist/store/tasks-sqlite.d.ts.map +1 -1
  396. package/dist/store/tasks-sqlite.js +23 -3
  397. package/dist/store/tasks-sqlite.js.map +1 -1
  398. package/dist/store/twin-collapse.d.ts +113 -2
  399. package/dist/store/twin-collapse.d.ts.map +1 -1
  400. package/dist/store/twin-collapse.js +247 -19
  401. package/dist/store/twin-collapse.js.map +1 -1
  402. package/dist/store/umbrella-data-accessor.d.ts +5 -2
  403. package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
  404. package/dist/store/umbrella-data-accessor.js +9 -2
  405. package/dist/store/umbrella-data-accessor.js.map +1 -1
  406. package/dist/store/validation-schemas.d.ts +241 -49
  407. package/dist/store/validation-schemas.d.ts.map +1 -1
  408. package/dist/system/health.d.ts +2 -0
  409. package/dist/system/health.d.ts.map +1 -1
  410. package/dist/system/health.js +57 -0
  411. package/dist/system/health.js.map +1 -1
  412. package/dist/system/project-health.d.ts +9 -2
  413. package/dist/system/project-health.d.ts.map +1 -1
  414. package/dist/system/project-health.js +8 -3
  415. package/dist/system/project-health.js.map +1 -1
  416. package/dist/task-work/index.d.ts.map +1 -1
  417. package/dist/task-work/index.js +9 -6
  418. package/dist/task-work/index.js.map +1 -1
  419. package/dist/tasks/ac-coverage-gate.d.ts.map +1 -1
  420. package/dist/tasks/ac-coverage-gate.js +3 -0
  421. package/dist/tasks/ac-coverage-gate.js.map +1 -1
  422. package/dist/tasks/ac-table.d.ts +35 -7
  423. package/dist/tasks/ac-table.d.ts.map +1 -1
  424. package/dist/tasks/ac-table.js +119 -14
  425. package/dist/tasks/ac-table.js.map +1 -1
  426. package/dist/tasks/add.d.ts.map +1 -1
  427. package/dist/tasks/add.js +48 -2
  428. package/dist/tasks/add.js.map +1 -1
  429. package/dist/tasks/analyze.d.ts.map +1 -1
  430. package/dist/tasks/analyze.js +3 -2
  431. package/dist/tasks/analyze.js.map +1 -1
  432. package/dist/tasks/backfill-child-projections.js +47 -6
  433. package/dist/tasks/backfill-child-projections.js.map +1 -1
  434. package/dist/tasks/complete.d.ts.map +1 -1
  435. package/dist/tasks/complete.js +6 -1
  436. package/dist/tasks/complete.js.map +1 -1
  437. package/dist/tasks/completion-evaluation.d.ts.map +1 -1
  438. package/dist/tasks/completion-evaluation.js +3 -0
  439. package/dist/tasks/completion-evaluation.js.map +1 -1
  440. package/dist/tasks/evidence.d.ts +19 -1
  441. package/dist/tasks/evidence.d.ts.map +1 -1
  442. package/dist/tasks/evidence.js +93 -21
  443. package/dist/tasks/evidence.js.map +1 -1
  444. package/dist/tasks/infer-add-params.js +1 -1
  445. package/dist/tasks/infer-add-params.js.map +1 -1
  446. package/dist/tasks/task-context.d.ts.map +1 -1
  447. package/dist/tasks/task-context.js +3 -1
  448. package/dist/tasks/task-context.js.map +1 -1
  449. package/dist/tasks/task-import.d.ts.map +1 -1
  450. package/dist/tasks/task-import.js +11 -3
  451. package/dist/tasks/task-import.js.map +1 -1
  452. package/dist/tasks/task-next.d.ts +5 -1
  453. package/dist/tasks/task-next.d.ts.map +1 -1
  454. package/dist/tasks/task-next.js +7 -2
  455. package/dist/tasks/task-next.js.map +1 -1
  456. package/dist/validation/compliance.d.ts +5 -1
  457. package/dist/validation/compliance.d.ts.map +1 -1
  458. package/dist/validation/compliance.js +24 -3
  459. package/dist/validation/compliance.js.map +1 -1
  460. package/dist/validation/engine-ops.d.ts.map +1 -1
  461. package/dist/validation/engine-ops.js +3 -2
  462. package/dist/validation/engine-ops.js.map +1 -1
  463. package/dist/validation/index.d.ts +1 -1
  464. package/dist/validation/index.d.ts.map +1 -1
  465. package/dist/validation/index.js +1 -1
  466. package/dist/validation/index.js.map +1 -1
  467. package/dist/validation/protocol-common.d.ts +47 -2
  468. package/dist/validation/protocol-common.d.ts.map +1 -1
  469. package/dist/validation/protocol-common.js +86 -21
  470. package/dist/validation/protocol-common.js.map +1 -1
  471. package/dist/workgraph/scaffold-apply.d.ts.map +1 -1
  472. package/dist/workgraph/scaffold-apply.js +14 -5
  473. package/dist/workgraph/scaffold-apply.js.map +1 -1
  474. package/migrations/README.md +12 -0
  475. package/migrations/drizzle-cleo-project/20260928120000_t12341-row-uids/migration.sql +169 -0
  476. package/migrations/drizzle-cleo-project/20260930160000_t12886-dependency-cycle-guard/migration.sql +76 -0
  477. package/migrations/drizzle-cleo-project/20260930160000_t12886-dependency-cycle-guard/revert.sql +7 -0
  478. package/migrations/sync-journal/20260929140000_t12342-sync-clock/migration.sql +42 -0
  479. package/package.json +13 -13
  480. package/templates/CLEO-INJECTION.md +2 -2
  481. package/templates/CLEO-REFERENCE.md +5 -1
@@ -0,0 +1,585 @@
1
+ /**
2
+ * Display ids, uid re-keys, their aliases, and the identity quarantine (T12341).
3
+ *
4
+ * `T####` is a per-project DISPLAY id: unique inside one store at rest, typed
5
+ * by people and agents, but allocated locally, so two offline stores can
6
+ * allocate the same one for different work. The row's uid is its identity
7
+ * (`store/row-identity.ts`). Spec: `cleo docs fetch t12341-uid-scheme` §6.4, §9.
8
+ *
9
+ * ## Receiving a row: place it, or hold it
10
+ *
11
+ * An incoming row travels as a {@link WireRow}: its uid, its birth
12
+ * fingerprint, its values, and every reference as the referenced row's
13
+ * (uid, birth fingerprint) ({@link WireRef}). {@link receiveRow} places it in
14
+ * its table, or HOLDS it in `tasks_identity_quarantine` (local-only) when it
15
+ * cannot be placed yet:
16
+ *
17
+ * - `uid-collision`: a local row has its uid with a different birth
18
+ * fingerprint. Neither row is re-keyed here unless this replica is the
19
+ * authority ({@link rekeyRowUid}); the others wait for the published
20
+ * {@link RekeyReceipt} ({@link applyRekey}).
21
+ * - `display-id-collision`: a local row holds its display id. The loser is
22
+ * re-numbered only by its authority ({@link remintTaskDisplayId}); the
23
+ * others wait for the {@link RemintOp} ({@link applyRemintOp}).
24
+ * - `key-collision`: another local row holds its local key (a key derived
25
+ * from a local display id, such as an AC id); the merge engine re-derives
26
+ * the key (T12344).
27
+ * - `ref-pending`: a reference does not resolve to a local row with the SAME
28
+ * birth fingerprint ({@link resolveWireRef}), e.g. it names the loser of a
29
+ * uid collision whose re-key has not arrived. It never resolves to the
30
+ * other row that shares the uid.
31
+ *
32
+ * Held rows never enter the task tables, so no validator, parser or command
33
+ * ever sees an id that is not a `T####` (the round-1 provisional `prov-` ids
34
+ * are gone). Every op that could unblock a held row re-tries the held rows
35
+ * ({@link releaseHeld}).
36
+ *
37
+ * ## Display-id collision: one authority, ordered by HLC
38
+ *
39
+ * Every replica agrees on the loser ({@link collisionLoser}: the greater
40
+ * uid). {@link remintAuthority} is a pure function of synced inputs (cloud
41
+ * sync, the origin, replica membership with join / retire HLCs, the
42
+ * collision's HLC) and a point in HLC time: the origin first, then each
43
+ * active replica in turn for one takeover window, cycling, so a silent
44
+ * authority is always taken over and nothing waits forever. Two authorities
45
+ * may both re-mint around a window boundary: {@link applyRemintOp} keeps the
46
+ * op with the greater HLC on every replica, whatever the arrival order, and
47
+ * the other number becomes an alias.
48
+ *
49
+ * ## Uid collision: re-key the loser
50
+ *
51
+ * The loser is the greater birth fingerprint. {@link rekeyRowUid} asserts the
52
+ * row it re-keys carries that fingerprint (a replica holding the winner never
53
+ * re-keys it), gives it a random uid, and cascades from STORED identity:
54
+ * minted children get {@link rekeyedChildUid} of their old uid and the new
55
+ * owner uid, natural rows keyed by a re-keyed row are re-derived, stored uid
56
+ * copies (`ac_uid`) and display-id aliases follow. The receipt lists every
57
+ * value; receivers apply them ({@link applyRekey}) and never recompute.
58
+ *
59
+ * ## Gate 28
60
+ *
61
+ * Every write here goes through a chokepoint helper in
62
+ * `sqlite-data-accessor.ts`; this module only reads and decides.
63
+ *
64
+ * @module
65
+ * @task T12341
66
+ * @task T12744
67
+ * @task T12745
68
+ * @task T12748
69
+ * @task T12750
70
+ * @epic T12323
71
+ */
72
+ import type { DatabaseSync } from 'node:sqlite';
73
+ import { type TaskClaimGuard } from '@cleocode/contracts';
74
+ import type { Hlc as HlcWire } from '@cleocode/contracts/cloud';
75
+ import { type QuarantineRow } from './sqlite-data-accessor.js';
76
+ /** Physical name of the display-id alias table. */
77
+ export declare const DISPLAY_ID_ALIAS_TABLE = "tasks_display_id_aliases";
78
+ /** Physical name of the uid re-key alias table. */
79
+ export declare const UID_ALIAS_TABLE = "tasks_uid_aliases";
80
+ /** Physical name of the identity quarantine (local-only). */
81
+ export declare const QUARANTINE_TABLE = "tasks_identity_quarantine";
82
+ /** Why a display id was displaced. */
83
+ export type DisplayIdAliasReason = 'collision-remint' | 'superseded-remint'
84
+ /** The display id a re-mint op assigned (the portable re-mint record, T12800). */
85
+ | 'remint-assigned' | 'split-brain-import' | 'manual';
86
+ /**
87
+ * Total order of two encoded HLC values (`Hlc` wire strings).
88
+ *
89
+ * @param a - One value.
90
+ * @param b - The other.
91
+ * @returns Negative, zero or positive.
92
+ * @throws HlcError when a value is not an encoded HLC.
93
+ */
94
+ export declare function compareHlc(a: HlcWire, b: HlcWire): number;
95
+ /** The replica id a pre-HLC value carries: none issued it. */
96
+ export declare const PRE_HLC_REPLICA = "00000000-0000-0000-0000-000000000000";
97
+ /**
98
+ * The collision HLC of two rows that have no creation HLC (written before the
99
+ * change journal, T12342): the later of their two BIRTHS, at counter 0, from
100
+ * no replica ({@link PRE_HLC_REPLICA}). Every replica derives the same value
101
+ * from the rows' synced births; it only anchors the authority schedule
102
+ * ({@link remintAuthority}), never a clock (HLC never reads a uid's time).
103
+ *
104
+ * @param birthMsA - One row's birth, epoch ms.
105
+ * @param birthMsB - The other's.
106
+ * @returns An encoded HLC.
107
+ * @task T12802
108
+ */
109
+ export declare function collisionHlcFromBirths(birthMsA: number, birthMsB: number): HlcWire;
110
+ /**
111
+ * Of two rows that carry the same display id, the one that must be re-minted:
112
+ * the greater uid. Every replica picks the same one for the same pair, and for
113
+ * UUIDv7 uids the older row keeps its id.
114
+ *
115
+ * @param a - Uid of one claimant.
116
+ * @param b - Uid of the other.
117
+ * @returns The uid to re-mint.
118
+ */
119
+ export declare function collisionLoser(a: string, b: string): string;
120
+ /** A replica of the project, as the authority rule sees it (synced membership). */
121
+ export interface ProjectReplica {
122
+ /** Replica id (T12342). */
123
+ readonly id: string;
124
+ /** HLC at which it joined the project. */
125
+ readonly joinedHlc: string;
126
+ /** HLC at which it was retired, when it was. */
127
+ readonly retiredHlc?: string | null;
128
+ }
129
+ /** Why {@link remintAuthority} chose its authority. */
130
+ export type RemintAuthorityReason = 'server' | 'origin' | 'fallback';
131
+ /** Default length of one authority window (HLC physical time). */
132
+ export declare const REMINT_TAKEOVER_MS: number;
133
+ /** Inputs of {@link remintAuthority}: all synced, so every replica has the same. */
134
+ export interface RemintAuthorityInput {
135
+ /** The project syncs to cloud: the server is the authority. */
136
+ readonly cloudSynced: boolean;
137
+ /** Replica that originated the losing row (`null`: backfilled before sync). */
138
+ readonly origin: string | null;
139
+ /** Project membership. */
140
+ readonly replicas: readonly ProjectReplica[];
141
+ /** When the collision came to exist: the later creation HLC of the two rows. */
142
+ readonly collisionHlc: string;
143
+ /** The HLC time to evaluate at (a replica's clock, or an op's HLC). */
144
+ readonly atHlc: string;
145
+ /** Window length; default {@link REMINT_TAKEOVER_MS}. */
146
+ readonly takeoverAfterMs?: number;
147
+ }
148
+ /**
149
+ * Which replica may re-mint the losing row of a display-id collision at HLC
150
+ * time `atHlc` (spec §9.2). A pure function of synced inputs: every replica
151
+ * evaluating the same time names the same authority.
152
+ *
153
+ * 1. The project syncs to cloud → the server.
154
+ * 2. Else the origin, while it is an active member, for the first window
155
+ * after the collision.
156
+ * 3. Else the FALLBACK CHAIN: the active members other than the origin,
157
+ * sorted, one window each, cycling. A fallback that stays silent loses its
158
+ * turn when its window ends, so a collision never waits forever.
159
+ *
160
+ * @param input - The facts every replica can see.
161
+ * @returns The authority, the rule, and the window index (0 = origin).
162
+ */
163
+ export declare function remintAuthority(input: RemintAuthorityInput): {
164
+ readonly authority: string;
165
+ readonly reason: RemintAuthorityReason;
166
+ readonly slot: number;
167
+ };
168
+ /** Where a displacement came from: the replica that authored it, and when (HLC). */
169
+ export interface Displacement {
170
+ /** Replica that authored the displacement (the authority). */
171
+ readonly origin?: string | null;
172
+ /** HLC of the displacement. */
173
+ readonly displacedHlc?: string | null;
174
+ /** Wall-clock record time; defaults to now. */
175
+ readonly now?: string;
176
+ }
177
+ /**
178
+ * Record that `displayId` used to name the row (`entityUid`, `entityBirthFp`).
179
+ * Idempotent.
180
+ *
181
+ * @param db - Connection on the project `cleo.db`.
182
+ * @param entry - The displaced id, the row that carried it, and the displacement.
183
+ */
184
+ export declare function recordDisplayIdAlias(db: DatabaseSync, entry: Displacement & {
185
+ readonly table: string;
186
+ readonly displayId: string;
187
+ readonly entityUid: string;
188
+ readonly entityBirthFp: string | null;
189
+ readonly reason: DisplayIdAliasReason;
190
+ }): void;
191
+ /** A row that carries, or carried, a display id. */
192
+ export interface DisplayIdClaimant {
193
+ /** Uid of the row (`null` for a live row whose uid is not filled yet). */
194
+ readonly uid: string | null;
195
+ /** Its display id today (`null`: the row is not placed here). */
196
+ readonly currentId: string | null;
197
+ /** `live` when it carries the id now, `alias` when it carried it before. */
198
+ readonly via: 'live' | 'alias';
199
+ /** Alias only: the replica that displaced it. */
200
+ readonly origin?: string | null;
201
+ /** Alias only: the HLC of the displacement. */
202
+ readonly displacedHlc?: string | null;
203
+ }
204
+ /** Outcome of resolving a display id. */
205
+ export type DisplayIdResolution = {
206
+ readonly status: 'none';
207
+ } | {
208
+ readonly status: 'resolved';
209
+ readonly claimant: DisplayIdClaimant;
210
+ /** Rows that carried this id before (history; the live row still wins). */
211
+ readonly alsoKnownAs: readonly DisplayIdClaimant[];
212
+ } | {
213
+ readonly status: 'ambiguous';
214
+ readonly candidates: readonly DisplayIdClaimant[];
215
+ };
216
+ /**
217
+ * Resolve a display id: a live row always wins (aliases come back as
218
+ * history); with no live row, one alias resolves and several are ambiguous.
219
+ *
220
+ * @param db - Connection on the project `cleo.db`.
221
+ * @param table - Display-id table (e.g. `tasks_tasks`).
222
+ * @param displayId - The id to resolve.
223
+ * @returns `resolved` (live, or the single alias), `ambiguous` with every
224
+ * candidate (callers report it as an error and never pick), or `none`.
225
+ */
226
+ export declare function resolveDisplayId(db: DatabaseSync, table: string, displayId: string): DisplayIdResolution;
227
+ /**
228
+ * Allocate the next `T####` on the caller's handle, with the same lower bound
229
+ * `allocateNextTaskId` uses (the highest stored numeric id). Only the re-mint
230
+ * authority allocates for a collision.
231
+ *
232
+ * @param db - Connection on the project `cleo.db`.
233
+ * @returns The new display id.
234
+ */
235
+ export declare function allocateTaskDisplayId(db: DatabaseSync): string;
236
+ /**
237
+ * The re-mint the authority publishes. Other replicas apply it verbatim
238
+ * ({@link applyRemintOp}); they never recompute the number.
239
+ */
240
+ export interface RemintOp {
241
+ /** Uid of the re-minted task. */
242
+ readonly uid: string;
243
+ /** Its birth fingerprint (a uid can be shared by two rows during a uid collision). */
244
+ readonly birthFp: string;
245
+ /** The contested display id it was displaced from. */
246
+ readonly oldId: string;
247
+ /** The display id the authority gave it. */
248
+ readonly newId: string;
249
+ /** The authority that re-minted. */
250
+ readonly origin: string | null;
251
+ /** HLC of the re-mint: the greater HLC wins on every replica. */
252
+ readonly hlc: string;
253
+ }
254
+ /** Receipt of a local re-mint: the op plus what was rewritten here. */
255
+ export interface RemintReceipt extends RemintOp {
256
+ /** Rows rewritten per `table.column`. */
257
+ readonly rewritten: Readonly<Record<string, number>>;
258
+ /** Held rows placed because the re-mint freed their id. */
259
+ readonly released: readonly HeldRowKey[];
260
+ }
261
+ /**
262
+ * The winning re-mint of a row: the op with the greatest HLC. It is DERIVED
263
+ * from the row's `remint-assigned` display aliases, which are portable (they
264
+ * sync with the row), so a replica that lost local state, or never had it,
265
+ * reaches the same answer (T12800).
266
+ */
267
+ interface RemintRecord {
268
+ readonly newId: string;
269
+ readonly hlc: string;
270
+ readonly origin: string | null;
271
+ }
272
+ /**
273
+ * AUTHORITY ONLY ({@link remintAuthority}): give the losing task of a
274
+ * display-id collision a new display id. Allocates the next `T####`, renames
275
+ * through the chokepoint (version CAS, claim columns kept), records the
276
+ * contested id as an alias and the op as the row's re-mint record, places any
277
+ * held row the freed id unblocks, and returns the op to publish.
278
+ *
279
+ * @param db - Connection on the project `cleo.db`.
280
+ * @param taskId - Current local display id of the task to re-mint.
281
+ * @param options - The contested id (default: `taskId`), why, the authority,
282
+ * the op's HLC, and an optional version / claim guard for a manual rename.
283
+ * @returns The op to publish, with what was rewritten here.
284
+ * @throws CleoError NOT_FOUND when the task does not exist or has no identity yet.
285
+ */
286
+ export declare function remintTaskDisplayId(db: DatabaseSync, taskId: string, options: {
287
+ readonly reason: DisplayIdAliasReason;
288
+ readonly origin: string | null;
289
+ readonly hlc: string;
290
+ readonly contestedId?: string;
291
+ readonly now?: string;
292
+ readonly guard?: {
293
+ readonly expectedUpdatedAt?: string;
294
+ readonly claim?: TaskClaimGuard;
295
+ };
296
+ }): RemintReceipt;
297
+ /** Outcome of {@link applyRemintOp}. */
298
+ export type ApplyRemintResult = {
299
+ readonly status: 'applied';
300
+ readonly receipt: RemintReceipt;
301
+ }
302
+ /** The row is not placed here (held or not yet received): the op is recorded
303
+ * and the row takes `newId` when it is placed. */
304
+ | {
305
+ readonly status: 'recorded';
306
+ readonly released: readonly HeldRowKey[];
307
+ } | {
308
+ readonly status: 'already-applied';
309
+ }
310
+ /** An op with a greater HLC was applied already; this one's number became an alias. */
311
+ | {
312
+ readonly status: 'superseded';
313
+ readonly winner: RemintRecord;
314
+ }
315
+ /** The new id is held here by another row: a NEW collision for its authority. */
316
+ | {
317
+ readonly status: 'conflict';
318
+ readonly holderUid: string | null;
319
+ };
320
+ /**
321
+ * NON-AUTHORITY: apply a re-mint an authority published. Of several ops for
322
+ * one row, the one with the greatest HLC wins on every replica, whatever the
323
+ * arrival order: a lesser op is recorded as an alias (`superseded`), a greater
324
+ * one renames the row again and turns the previous number into an alias.
325
+ * Never allocates.
326
+ *
327
+ * @param db - Connection on the project `cleo.db`.
328
+ * @param op - The published re-mint.
329
+ * @returns What happened.
330
+ */
331
+ export declare function applyRemintOp(db: DatabaseSync, op: RemintOp): ApplyRemintResult;
332
+ /** A value a wire row carries. */
333
+ export type WireValue = string | number | null;
334
+ /** A reference on the wire: the referenced row's uid and birth fingerprint. */
335
+ export interface WireRef {
336
+ /**
337
+ * The referenced row's uid; `null` when the SENDER could not find the row
338
+ * its local key names and knows no uid for it.
339
+ */
340
+ readonly uid: string | null;
341
+ /**
342
+ * The referenced row's birth fingerprint. A minted target is only ever
343
+ * matched on uid AND fingerprint, so a reference without one never matches
344
+ * a row (T12798 review). `null` for a natural target (its uid is a pure
345
+ * function; no fingerprint).
346
+ */
347
+ readonly birthFp: string | null;
348
+ /**
349
+ * The sender had the reference but no longer has the row it names (deleted
350
+ * there). The receiver uses the row when it still has it (uid and
351
+ * fingerprint), else applies the table's `gone` rule instead of waiting
352
+ * for a row that will never arrive.
353
+ */
354
+ readonly gone?: true;
355
+ }
356
+ /**
357
+ * Version of the wire row format. v2 (T12798) carries no local key of
358
+ * another row in `values`; a row without it (or older) came from a build
359
+ * whose values hold raw local keys, and is held (`unsupported-wire`) rather
360
+ * than applied or silently stripped.
361
+ */
362
+ export declare const WIRE_VERSION = 2;
363
+ /** An incoming row (the merge engine, T12344, builds these from the outbox). */
364
+ export interface WireRow {
365
+ /** {@link WIRE_VERSION} of the sender (absent: a v1 sender). */
366
+ readonly version?: number;
367
+ readonly table: string;
368
+ readonly uid: string;
369
+ /** Birth fingerprint (minted tables); `null` for natural rows. */
370
+ readonly birthFp: string | null;
371
+ /**
372
+ * Column values, WITHOUT any local key of another row: reference columns,
373
+ * stored reference uids and the key columns they come from, and JSON arrays
374
+ * of ids travel as {@link refs} / {@link jsonRefs} and are resolved on the
375
+ * receiver (T12798).
376
+ */
377
+ readonly values: Readonly<Record<string, WireValue>>;
378
+ /**
379
+ * Reference column → the referenced row's identity, or `null` for NULL.
380
+ * Also carries each stored reference uid column (`ac_uid`): its resolution
381
+ * sets both that column and the key column it comes from (`ac_id`).
382
+ */
383
+ readonly refs?: Readonly<Record<string, WireRef | null>>;
384
+ /** JSON array of ids column → the identities of its elements, in order. */
385
+ readonly jsonRefs?: Readonly<Record<string, readonly WireRef[]>>;
386
+ }
387
+ /** Why a row is held. */
388
+ export type HoldReason = QuarantineRow['reason'];
389
+ /** The key of a held row. */
390
+ export interface HeldRowKey {
391
+ readonly entityTable: string;
392
+ readonly uid: string;
393
+ readonly birthFp: string;
394
+ }
395
+ /** A uid collision found while receiving. */
396
+ export interface UidCollision {
397
+ readonly kind: 'uid';
398
+ readonly table: string;
399
+ readonly uid: string;
400
+ /** The smaller fingerprint keeps the uid. */
401
+ readonly winnerBirthFp: string;
402
+ /** The greater fingerprint is re-keyed by its authority. */
403
+ readonly loserBirthFp: string;
404
+ /** True when the local (placed) row is the loser. */
405
+ readonly localIsLoser: boolean;
406
+ }
407
+ /** A display-id collision found while receiving. */
408
+ export interface DisplayIdCollision {
409
+ readonly kind: 'display-id';
410
+ readonly table: string;
411
+ readonly displayId: string;
412
+ readonly loserUid: string;
413
+ readonly localIsLoser: boolean;
414
+ }
415
+ /** Outcome of {@link receiveRow}. */
416
+ export type ReceiveResult = {
417
+ readonly status: 'inserted';
418
+ readonly key: string;
419
+ readonly uid: string;
420
+ } | {
421
+ readonly status: 'duplicate';
422
+ readonly uid: string;
423
+ } | {
424
+ readonly status: 'held';
425
+ readonly reason: HoldReason;
426
+ readonly collision?: UidCollision | DisplayIdCollision;
427
+ };
428
+ /** Outcome of {@link resolveWireRef}. */
429
+ export type WireRefResolution = {
430
+ readonly status: 'row';
431
+ readonly key: string;
432
+ readonly uid: string;
433
+ } | {
434
+ readonly status: 'held';
435
+ } | {
436
+ readonly status: 'pending';
437
+ };
438
+ /**
439
+ * Resolve a wire reference to a local row: the row with that uid AND that
440
+ * birth fingerprint, following `tasks_uid_aliases` when the target was
441
+ * re-keyed. A row that has the uid with ANOTHER fingerprint (the other side of
442
+ * a uid collision) never matches: the reference is `held` (its target waits
443
+ * in the quarantine) or `pending` (its target has not arrived, or its re-key
444
+ * has not), and the referencing row waits too.
445
+ *
446
+ * @param db - Connection on the project `cleo.db`.
447
+ * @param table - The referenced table.
448
+ * @param ref - The reference.
449
+ * @returns Where it points.
450
+ */
451
+ export declare function resolveWireRef(db: DatabaseSync, table: string, ref: WireRef): WireRefResolution;
452
+ /** The project policy a received row is validated against (T12801). */
453
+ export interface ReceivePolicy {
454
+ /** The resolved `hierarchy.maxDepth` (config, `CLEO_HIERARCHY_MAX_DEPTH`, or the profile). */
455
+ readonly maxDepth: number;
456
+ }
457
+ /**
458
+ * Resolve the receive policy of a project from its configuration, exactly as
459
+ * a local task write does (`resolveHierarchyPolicy(loadConfig())`, so
460
+ * `hierarchy.maxDepth` and `CLEO_HIERARCHY_MAX_DEPTH` apply). The merge engine
461
+ * resolves it once per merge and passes it to {@link receiveRow}.
462
+ *
463
+ * @param cwd - Project root.
464
+ * @returns The policy.
465
+ */
466
+ export declare function loadReceivePolicy(cwd?: string): Promise<ReceivePolicy>;
467
+ /**
468
+ * Receive one row: place it, or hold it (module docs). The first receive
469
+ * marks the store's identity values as shared, so the open pass never
470
+ * clears them (T12746).
471
+ *
472
+ * @param db - Connection on the project `cleo.db`, inside the merge transaction.
473
+ * @param wire - The incoming row.
474
+ * @param policy - The project's resolved receive policy ({@link loadReceivePolicy}).
475
+ * It stays in force on this connection, also for held rows released later;
476
+ * without one, the default hierarchy profile applies.
477
+ * @returns What happened; a `held` result carries the collision for the caller
478
+ * (the merge engine) to hand to its authority.
479
+ */
480
+ export declare function receiveRow(db: DatabaseSync, wire: WireRow, policy?: ReceivePolicy): ReceiveResult;
481
+ /**
482
+ * Re-try the held rows now (after an op this module did not apply).
483
+ *
484
+ * @param db - Connection on the project `cleo.db`.
485
+ * @returns The rows placed.
486
+ */
487
+ export declare function releaseHeld(db: DatabaseSync): HeldRowKey[];
488
+ /** A held row, as `cleo doctor` and the merge status report it. */
489
+ export interface HeldRow extends HeldRowKey {
490
+ readonly reason: HoldReason;
491
+ readonly contestedId: string | null;
492
+ readonly createdAt: string;
493
+ readonly row: WireRow;
494
+ }
495
+ /**
496
+ * Every held row (read-only: held rows are never edited in place).
497
+ *
498
+ * @param db - Connection on the project `cleo.db`.
499
+ * @returns The held rows, oldest first.
500
+ */
501
+ export declare function listHeldRows(db: DatabaseSync): HeldRow[];
502
+ /**
503
+ * The wire form of a local row (what a sender publishes): values without the
504
+ * identity columns, and every declared reference as the target's uid and
505
+ * birth fingerprint.
506
+ *
507
+ * @param db - Connection on the project `cleo.db`.
508
+ * @param table - Declared table.
509
+ * @param uid - The row's uid.
510
+ * @returns The wire row.
511
+ */
512
+ export declare function wireRowOf(db: DatabaseSync, table: string, uid: string): WireRow;
513
+ /** A natural row whose uid was re-derived because a re-keyed row is in its key. */
514
+ export interface NaturalRederive {
515
+ readonly table: string;
516
+ readonly oldUid: string;
517
+ readonly newUid: string;
518
+ }
519
+ /** Receipt of {@link rekeyRowUid}: one re-keyed row and everything that followed. */
520
+ export interface RekeyReceipt {
521
+ /** Table of the re-keyed row. */
522
+ readonly table: string;
523
+ /** The colliding uid it carried. */
524
+ readonly oldUid: string;
525
+ /** Its birth fingerprint (unchanged; keys the alias and every match). */
526
+ readonly birthFp: string;
527
+ /** The new uid. */
528
+ readonly newUid: string;
529
+ /** Natural rows re-derived (dependencies, relations, labels, display aliases). */
530
+ readonly natural: readonly NaturalRederive[];
531
+ /** Minted children re-keyed with it ({@link rekeyedChildUid}), recursively. */
532
+ readonly cascaded: readonly RekeyReceipt[];
533
+ /** The authority that re-keyed. */
534
+ readonly origin: string | null;
535
+ /** HLC of the re-key. */
536
+ readonly hlc: string | null;
537
+ }
538
+ /**
539
+ * AUTHORITY ONLY: re-key the LOSER of a uid collision (same uid, different
540
+ * birth fingerprints; the loser is the greater fingerprint). The caller names
541
+ * the loser by its fingerprint and the call asserts it: the row re-keyed is
542
+ * the one with `loserBirthFp`, wherever it is here (placed, or held because
543
+ * the winner arrived first), and a fingerprint that is not the greater of the
544
+ * pair is refused. The row gets a random uid; the cascade follows from stored
545
+ * identity (module docs). Held rows the re-key unblocks are placed.
546
+ *
547
+ * @param db - Connection on the project `cleo.db`.
548
+ * @param table - Minted table of the row.
549
+ * @param uid - The colliding uid.
550
+ * @param collision - The loser's and the winner's birth fingerprints (the
551
+ * winner must be the smaller; T12801).
552
+ * @param options - The authority and the HLC of the re-key.
553
+ * @returns The receipt to publish, with its cascade and natural uids.
554
+ * @throws CleoError when this replica has no row (uid, loserBirthFp), or the
555
+ * fingerprint is not the loser's.
556
+ */
557
+ export declare function rekeyRowUid(db: DatabaseSync, table: string, uid: string, collision: {
558
+ readonly loserBirthFp: string;
559
+ readonly winnerBirthFp: string;
560
+ }, options?: Displacement): RekeyReceipt;
561
+ /** Outcome of {@link applyRekey} for one row of the receipt. */
562
+ export type RekeyApplyStatus = 'applied' | 'applied-held' | 'already-applied' | 'alias-only';
563
+ /**
564
+ * RECEIVER: apply a published {@link RekeyReceipt}. Every entry moves the row
565
+ * with (old uid, birth fingerprint) to the published new uid, wherever it is
566
+ * here: a placed row (with its stored copies, display aliases and the
567
+ * published natural uids), a held row (its wire form), or nowhere (the uid
568
+ * alias is recorded, so the row takes its new uid when it arrives). A row
569
+ * with the old uid and ANOTHER fingerprint (the winner) is never touched.
570
+ * Nothing is recomputed. Held rows the re-key unblocks are placed.
571
+ *
572
+ * @param db - Connection on the project `cleo.db`.
573
+ * @param receipt - The published receipt.
574
+ * @returns Per-row outcome, and the held rows placed.
575
+ */
576
+ export declare function applyRekey(db: DatabaseSync, receipt: RekeyReceipt): {
577
+ readonly rows: ReadonlyArray<{
578
+ table: string;
579
+ oldUid: string;
580
+ status: RekeyApplyStatus;
581
+ }>;
582
+ readonly released: readonly HeldRowKey[];
583
+ };
584
+ export {};
585
+ //# sourceMappingURL=display-id-alias.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-id-alias.d.ts","sourceRoot":"","sources":["../../src/store/display-id-alias.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAkBhE,OAAO,EAUL,KAAK,aAAa,EAOnB,MAAM,2BAA2B,CAAC;AAKnC,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AAEjE,mDAAmD;AACnD,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAEnD,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAE5D,sCAAsC;AACtC,MAAM,MAAM,oBAAoB,GAC5B,kBAAkB,GAClB,mBAAmB;AACrB,kFAAk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