@cleocode/core 2026.9.24 → 2026.9.25

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 (328) hide show
  1. package/dist/audit-prune.d.ts +32 -0
  2. package/dist/audit-prune.d.ts.map +1 -1
  3. package/dist/audit-prune.js +37 -3
  4. package/dist/audit-prune.js.map +1 -1
  5. package/dist/build-provenance.json +2 -2
  6. package/dist/cloud/crypto.d.ts +1 -2
  7. package/dist/cloud/crypto.d.ts.map +1 -1
  8. package/dist/cloud/crypto.js +1 -11
  9. package/dist/cloud/crypto.js.map +1 -1
  10. package/dist/cloud/uuidv7.d.ts +9 -0
  11. package/dist/cloud/uuidv7.d.ts.map +1 -0
  12. package/dist/cloud/uuidv7.js +19 -0
  13. package/dist/cloud/uuidv7.js.map +1 -0
  14. package/dist/decide/bench/index.d.ts +1 -1
  15. package/dist/decide/bench/index.d.ts.map +1 -1
  16. package/dist/decide/bench/index.js +1 -1
  17. package/dist/decide/bench/index.js.map +1 -1
  18. package/dist/decide/bench/operation.d.ts +1 -1
  19. package/dist/decide/bench/operation.d.ts.map +1 -1
  20. package/dist/decide/bench/operation.js +1 -1
  21. package/dist/decide/bench/operation.js.map +1 -1
  22. package/dist/decide/bench/profiles.d.ts +50 -22
  23. package/dist/decide/bench/profiles.d.ts.map +1 -1
  24. package/dist/decide/bench/profiles.js +103 -59
  25. package/dist/decide/bench/profiles.js.map +1 -1
  26. package/dist/decide/bench/report.d.ts.map +1 -1
  27. package/dist/decide/bench/report.js +6 -1
  28. package/dist/decide/bench/report.js.map +1 -1
  29. package/dist/decide/bench/runner.d.ts +6 -1
  30. package/dist/decide/bench/runner.d.ts.map +1 -1
  31. package/dist/decide/bench/runner.js +1 -0
  32. package/dist/decide/bench/runner.js.map +1 -1
  33. package/dist/decide/client.d.ts.map +1 -1
  34. package/dist/decide/client.js +11 -5
  35. package/dist/decide/client.js.map +1 -1
  36. package/dist/decide/jev-wire.d.ts +31 -1
  37. package/dist/decide/jev-wire.d.ts.map +1 -1
  38. package/dist/decide/jev-wire.js +61 -7
  39. package/dist/decide/jev-wire.js.map +1 -1
  40. package/dist/docs/export-document.js +17181 -15536
  41. package/dist/docs/export-document.js.map +3 -3
  42. package/dist/doctor/orphan-ac-bindings.d.ts +64 -0
  43. package/dist/doctor/orphan-ac-bindings.d.ts.map +1 -0
  44. package/dist/doctor/orphan-ac-bindings.js +59 -0
  45. package/dist/doctor/orphan-ac-bindings.js.map +1 -0
  46. package/dist/doctor/projects.d.ts.map +1 -1
  47. package/dist/doctor/projects.js +43 -29
  48. package/dist/doctor/projects.js.map +1 -1
  49. package/dist/doctor/row-identity.d.ts +31 -0
  50. package/dist/doctor/row-identity.d.ts.map +1 -0
  51. package/dist/doctor/row-identity.js +93 -0
  52. package/dist/doctor/row-identity.js.map +1 -0
  53. package/dist/doctor/twin-collapse.d.ts +58 -2
  54. package/dist/doctor/twin-collapse.d.ts.map +1 -1
  55. package/dist/doctor/twin-collapse.js +212 -14
  56. package/dist/doctor/twin-collapse.js.map +1 -1
  57. package/dist/lifecycle/verification/satisfies-validator.d.ts.map +1 -1
  58. package/dist/lifecycle/verification/satisfies-validator.js +10 -0
  59. package/dist/lifecycle/verification/satisfies-validator.js.map +1 -1
  60. package/dist/llm/plugin-facade.js +17045 -15400
  61. package/dist/llm/plugin-facade.js.map +3 -3
  62. package/dist/memory/index.d.ts.map +1 -1
  63. package/dist/memory/index.js +19 -10
  64. package/dist/memory/index.js.map +1 -1
  65. package/dist/memory/manifest-identity.d.ts +171 -0
  66. package/dist/memory/manifest-identity.d.ts.map +1 -0
  67. package/dist/memory/manifest-identity.js +345 -0
  68. package/dist/memory/manifest-identity.js.map +1 -0
  69. package/dist/memory/mental-model-queue.d.ts +14 -4
  70. package/dist/memory/mental-model-queue.d.ts.map +1 -1
  71. package/dist/memory/mental-model-queue.js +64 -35
  72. package/dist/memory/mental-model-queue.js.map +1 -1
  73. package/dist/memory/pipeline-manifest-sqlite.d.ts +47 -5
  74. package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -1
  75. package/dist/memory/pipeline-manifest-sqlite.js +130 -14
  76. package/dist/memory/pipeline-manifest-sqlite.js.map +1 -1
  77. package/dist/memory/retrieval/observe.d.ts.map +1 -1
  78. package/dist/memory/retrieval/observe.js +2 -0
  79. package/dist/memory/retrieval/observe.js.map +1 -1
  80. package/dist/memory/transcript-scanner.js +1 -1
  81. package/dist/nexus/deps.d.ts.map +1 -1
  82. package/dist/nexus/deps.js +7 -14
  83. package/dist/nexus/deps.js.map +1 -1
  84. package/dist/nexus/discover.d.ts.map +1 -1
  85. package/dist/nexus/discover.js +6 -9
  86. package/dist/nexus/discover.js.map +1 -1
  87. package/dist/nexus/git-state.d.ts.map +1 -1
  88. package/dist/nexus/git-state.js +10 -1
  89. package/dist/nexus/git-state.js.map +1 -1
  90. package/dist/nexus/projects-clean.d.ts.map +1 -1
  91. package/dist/nexus/projects-clean.js +22 -11
  92. package/dist/nexus/projects-clean.js.map +1 -1
  93. package/dist/nexus/projects-scan.d.ts.map +1 -1
  94. package/dist/nexus/projects-scan.js +8 -13
  95. package/dist/nexus/projects-scan.js.map +1 -1
  96. package/dist/nexus/query.d.ts.map +1 -1
  97. package/dist/nexus/query.js +4 -12
  98. package/dist/nexus/query.js.map +1 -1
  99. package/dist/nexus/registry-roots.d.ts +5 -2
  100. package/dist/nexus/registry-roots.d.ts.map +1 -1
  101. package/dist/nexus/registry-roots.js +8 -10
  102. package/dist/nexus/registry-roots.js.map +1 -1
  103. package/dist/nexus/registry.d.ts +18 -0
  104. package/dist/nexus/registry.d.ts.map +1 -1
  105. package/dist/nexus/registry.js +37 -16
  106. package/dist/nexus/registry.js.map +1 -1
  107. package/dist/orchestrate/worktree-complete.d.ts.map +1 -1
  108. package/dist/orchestrate/worktree-complete.js +40 -2
  109. package/dist/orchestrate/worktree-complete.js.map +1 -1
  110. package/dist/orchestration/spawn-prompt.d.ts +26 -0
  111. package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
  112. package/dist/orchestration/spawn-prompt.js +62 -91
  113. package/dist/orchestration/spawn-prompt.js.map +1 -1
  114. package/dist/release/ci-evidence.d.ts +190 -0
  115. package/dist/release/ci-evidence.d.ts.map +1 -1
  116. package/dist/release/ci-evidence.js +436 -4
  117. package/dist/release/ci-evidence.js.map +1 -1
  118. package/dist/sdk/validator-ac-pull.d.ts.map +1 -1
  119. package/dist/sdk/validator-ac-pull.js +2 -1
  120. package/dist/sdk/validator-ac-pull.js.map +1 -1
  121. package/dist/selfimprove/fix-gen.js +17049 -15404
  122. package/dist/selfimprove/fix-gen.js.map +3 -3
  123. package/dist/sentient/cross-project-hygiene.d.ts +5 -0
  124. package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
  125. package/dist/sentient/cross-project-hygiene.js +7 -1
  126. package/dist/sentient/cross-project-hygiene.js.map +1 -1
  127. package/dist/sentient/propose-tick.d.ts.map +1 -1
  128. package/dist/sentient/propose-tick.js +2 -3
  129. package/dist/sentient/propose-tick.js.map +1 -1
  130. package/dist/sentient/stage-drift-tick.d.ts.map +1 -1
  131. package/dist/sentient/stage-drift-tick.js +2 -3
  132. package/dist/sentient/stage-drift-tick.js.map +1 -1
  133. package/dist/skills/manifests/research.js +2 -0
  134. package/dist/skills/manifests/research.js.map +1 -1
  135. package/dist/skills/orchestrator/validator.d.ts.map +1 -1
  136. package/dist/skills/orchestrator/validator.js +9 -2
  137. package/dist/skills/orchestrator/validator.js.map +1 -1
  138. package/dist/skills/validation.d.ts +4 -1
  139. package/dist/skills/validation.d.ts.map +1 -1
  140. package/dist/skills/validation.js +11 -3
  141. package/dist/skills/validation.js.map +1 -1
  142. package/dist/spawn/branch-lock.d.ts +111 -7
  143. package/dist/spawn/branch-lock.d.ts.map +1 -1
  144. package/dist/spawn/branch-lock.js +296 -8
  145. package/dist/spawn/branch-lock.js.map +1 -1
  146. package/dist/store/ac-binding-prune.d.ts +144 -0
  147. package/dist/store/ac-binding-prune.d.ts.map +1 -0
  148. package/dist/store/ac-binding-prune.js +293 -0
  149. package/dist/store/ac-binding-prune.js.map +1 -0
  150. package/dist/store/agent-registry-store.d.ts.map +1 -1
  151. package/dist/store/agent-registry-store.js +3 -2
  152. package/dist/store/agent-registry-store.js.map +1 -1
  153. package/dist/store/backup-sidecar.d.ts +85 -2
  154. package/dist/store/backup-sidecar.d.ts.map +1 -1
  155. package/dist/store/backup-sidecar.js +173 -1
  156. package/dist/store/backup-sidecar.js.map +1 -1
  157. package/dist/store/conduit-sqlite.d.ts.map +1 -1
  158. package/dist/store/conduit-sqlite.js +3 -2
  159. package/dist/store/conduit-sqlite.js.map +1 -1
  160. package/dist/store/credential-transfer.d.ts.map +1 -1
  161. package/dist/store/credential-transfer.js +3 -0
  162. package/dist/store/credential-transfer.js.map +1 -1
  163. package/dist/store/db-helpers.d.ts +17 -11
  164. package/dist/store/db-helpers.d.ts.map +1 -1
  165. package/dist/store/db-helpers.js +61 -38
  166. package/dist/store/db-helpers.js.map +1 -1
  167. package/dist/store/display-id-alias.d.ts +529 -0
  168. package/dist/store/display-id-alias.d.ts.map +1 -0
  169. package/dist/store/display-id-alias.js +1063 -0
  170. package/dist/store/display-id-alias.js.map +1 -0
  171. package/dist/store/dual-scope-db.d.ts.map +1 -1
  172. package/dist/store/dual-scope-db.js +21 -0
  173. package/dist/store/dual-scope-db.js.map +1 -1
  174. package/dist/store/exodus/reconcile.d.ts.map +1 -1
  175. package/dist/store/exodus/reconcile.js +7 -2
  176. package/dist/store/exodus/reconcile.js.map +1 -1
  177. package/dist/store/exodus/recovery.d.ts.map +1 -1
  178. package/dist/store/exodus/recovery.js +20 -1
  179. package/dist/store/exodus/recovery.js.map +1 -1
  180. package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
  181. package/dist/store/legacy-tasks-lineage.js +19 -2
  182. package/dist/store/legacy-tasks-lineage.js.map +1 -1
  183. package/dist/store/row-identity-flag.d.ts +26 -0
  184. package/dist/store/row-identity-flag.d.ts.map +1 -0
  185. package/dist/store/row-identity-flag.js +31 -0
  186. package/dist/store/row-identity-flag.js.map +1 -0
  187. package/dist/store/row-identity-registry.d.ts +61 -0
  188. package/dist/store/row-identity-registry.d.ts.map +1 -0
  189. package/dist/store/row-identity-registry.js +198 -0
  190. package/dist/store/row-identity-registry.js.map +1 -0
  191. package/dist/store/row-identity.d.ts +390 -0
  192. package/dist/store/row-identity.d.ts.map +1 -0
  193. package/dist/store/row-identity.js +1240 -0
  194. package/dist/store/row-identity.js.map +1 -0
  195. package/dist/store/safety-data-accessor.d.ts +2 -0
  196. package/dist/store/safety-data-accessor.d.ts.map +1 -1
  197. package/dist/store/safety-data-accessor.js +4 -0
  198. package/dist/store/safety-data-accessor.js.map +1 -1
  199. package/dist/store/schema/attachments.d.ts +1 -1
  200. package/dist/store/schema/audit.d.ts +4 -4
  201. package/dist/store/schema/background-jobs.d.ts +1 -1
  202. package/dist/store/schema/cleo-global/nexus.d.ts +1 -1
  203. package/dist/store/schema/cleo-global/skills.d.ts +2 -2
  204. package/dist/store/schema/cleo-project/audit.d.ts +4 -4
  205. package/dist/store/schema/cleo-project/docs.d.ts +1 -1
  206. package/dist/store/schema/cleo-project/lifecycle.d.ts +4 -4
  207. package/dist/store/schema/cleo-project/nexus-graph.d.ts +3 -3
  208. package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
  209. package/dist/store/schema/cleo-project/provenance-rest.d.ts +3 -3
  210. package/dist/store/schema/cleo-project/runtime.d.ts +3 -3
  211. package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +87 -1
  212. package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts.map +1 -1
  213. package/dist/store/schema/cleo-project/tasks-core-batch2.js +35 -0
  214. package/dist/store/schema/cleo-project/tasks-core-batch2.js.map +1 -1
  215. package/dist/store/schema/cleo-project/tasks-core.d.ts +183 -7
  216. package/dist/store/schema/cleo-project/tasks-core.d.ts.map +1 -1
  217. package/dist/store/schema/cleo-project/tasks-core.js +52 -1
  218. package/dist/store/schema/cleo-project/tasks-core.js.map +1 -1
  219. package/dist/store/schema/cleo-shared/brain.d.ts +6 -6
  220. package/dist/store/schema/lifecycle.d.ts +4 -4
  221. package/dist/store/schema/manifest.d.ts +1 -1
  222. package/dist/store/schema/memory-schema.d.ts +5 -5
  223. package/dist/store/schema/nexus-schema.d.ts +3 -3
  224. package/dist/store/schema/provenance/releases.d.ts +1 -1
  225. package/dist/store/schema/skills-schema.d.ts +2 -2
  226. package/dist/store/schema/tasks.d.ts +6 -6
  227. package/dist/store/split-brain-import.d.ts +2 -14
  228. package/dist/store/split-brain-import.d.ts.map +1 -1
  229. package/dist/store/split-brain-import.js +4 -19
  230. package/dist/store/split-brain-import.js.map +1 -1
  231. package/dist/store/sqlite-data-accessor.d.ts +279 -2
  232. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  233. package/dist/store/sqlite-data-accessor.js +544 -44
  234. package/dist/store/sqlite-data-accessor.js.map +1 -1
  235. package/dist/store/sync/clock-store.d.ts +67 -0
  236. package/dist/store/sync/clock-store.d.ts.map +1 -0
  237. package/dist/store/sync/clock-store.js +117 -0
  238. package/dist/store/sync/clock-store.js.map +1 -0
  239. package/dist/store/sync/flags.d.ts +51 -0
  240. package/dist/store/sync/flags.d.ts.map +1 -0
  241. package/dist/store/sync/flags.js +81 -0
  242. package/dist/store/sync/flags.js.map +1 -0
  243. package/dist/store/sync/hlc.d.ts +115 -0
  244. package/dist/store/sync/hlc.d.ts.map +1 -0
  245. package/dist/store/sync/hlc.js +172 -0
  246. package/dist/store/sync/hlc.js.map +1 -0
  247. package/dist/store/sync/index.d.ts +20 -0
  248. package/dist/store/sync/index.d.ts.map +1 -0
  249. package/dist/store/sync/index.js +20 -0
  250. package/dist/store/sync/index.js.map +1 -0
  251. package/dist/store/sync/replica-registry.d.ts +85 -0
  252. package/dist/store/sync/replica-registry.d.ts.map +1 -0
  253. package/dist/store/sync/replica-registry.js +147 -0
  254. package/dist/store/sync/replica-registry.js.map +1 -0
  255. package/dist/store/sync/replica.d.ts +181 -0
  256. package/dist/store/sync/replica.d.ts.map +1 -0
  257. package/dist/store/sync/replica.js +305 -0
  258. package/dist/store/sync/replica.js.map +1 -0
  259. package/dist/store/sync/schema.d.ts +68 -0
  260. package/dist/store/sync/schema.d.ts.map +1 -0
  261. package/dist/store/sync/schema.js +130 -0
  262. package/dist/store/sync/schema.js.map +1 -0
  263. package/dist/store/sync/skew-hold.d.ts +71 -0
  264. package/dist/store/sync/skew-hold.d.ts.map +1 -0
  265. package/dist/store/sync/skew-hold.js +89 -0
  266. package/dist/store/sync/skew-hold.js.map +1 -0
  267. package/dist/store/table-classification.d.ts +10 -8
  268. package/dist/store/table-classification.d.ts.map +1 -1
  269. package/dist/store/table-classification.js +93 -25
  270. package/dist/store/table-classification.js.map +1 -1
  271. package/dist/store/tasks-sqlite.d.ts.map +1 -1
  272. package/dist/store/tasks-sqlite.js +9 -1
  273. package/dist/store/tasks-sqlite.js.map +1 -1
  274. package/dist/store/twin-collapse.d.ts +113 -2
  275. package/dist/store/twin-collapse.d.ts.map +1 -1
  276. package/dist/store/twin-collapse.js +247 -19
  277. package/dist/store/twin-collapse.js.map +1 -1
  278. package/dist/store/umbrella-data-accessor.d.ts +2 -0
  279. package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
  280. package/dist/store/umbrella-data-accessor.js +4 -0
  281. package/dist/store/umbrella-data-accessor.js.map +1 -1
  282. package/dist/store/validation-schemas.d.ts +241 -49
  283. package/dist/store/validation-schemas.d.ts.map +1 -1
  284. package/dist/system/health.d.ts.map +1 -1
  285. package/dist/system/health.js +3 -0
  286. package/dist/system/health.js.map +1 -1
  287. package/dist/system/project-health.d.ts +9 -2
  288. package/dist/system/project-health.d.ts.map +1 -1
  289. package/dist/system/project-health.js +8 -3
  290. package/dist/system/project-health.js.map +1 -1
  291. package/dist/tasks/ac-coverage-gate.d.ts.map +1 -1
  292. package/dist/tasks/ac-coverage-gate.js +3 -0
  293. package/dist/tasks/ac-coverage-gate.js.map +1 -1
  294. package/dist/tasks/ac-table.d.ts +35 -7
  295. package/dist/tasks/ac-table.d.ts.map +1 -1
  296. package/dist/tasks/ac-table.js +119 -14
  297. package/dist/tasks/ac-table.js.map +1 -1
  298. package/dist/tasks/add.d.ts.map +1 -1
  299. package/dist/tasks/add.js +48 -2
  300. package/dist/tasks/add.js.map +1 -1
  301. package/dist/tasks/backfill-child-projections.js +47 -6
  302. package/dist/tasks/backfill-child-projections.js.map +1 -1
  303. package/dist/tasks/complete.d.ts.map +1 -1
  304. package/dist/tasks/complete.js +6 -1
  305. package/dist/tasks/complete.js.map +1 -1
  306. package/dist/tasks/completion-evaluation.d.ts.map +1 -1
  307. package/dist/tasks/completion-evaluation.js +3 -0
  308. package/dist/tasks/completion-evaluation.js.map +1 -1
  309. package/dist/tasks/evidence.d.ts.map +1 -1
  310. package/dist/tasks/evidence.js +14 -3
  311. package/dist/tasks/evidence.js.map +1 -1
  312. package/dist/validation/compliance.d.ts +5 -1
  313. package/dist/validation/compliance.d.ts.map +1 -1
  314. package/dist/validation/compliance.js +24 -3
  315. package/dist/validation/compliance.js.map +1 -1
  316. package/dist/validation/index.d.ts +1 -1
  317. package/dist/validation/index.d.ts.map +1 -1
  318. package/dist/validation/index.js +1 -1
  319. package/dist/validation/index.js.map +1 -1
  320. package/dist/validation/protocol-common.d.ts +47 -2
  321. package/dist/validation/protocol-common.d.ts.map +1 -1
  322. package/dist/validation/protocol-common.js +86 -21
  323. package/dist/validation/protocol-common.js.map +1 -1
  324. package/migrations/README.md +12 -0
  325. package/migrations/drizzle-cleo-project/20260928120000_t12341-row-uids/migration.sql +169 -0
  326. package/migrations/sync-journal/20260929140000_t12342-sync-clock/migration.sql +42 -0
  327. package/package.json +13 -13
  328. package/templates/CLEO-REFERENCE.md +4 -0
@@ -0,0 +1,390 @@
1
+ /**
2
+ * Row uids (T12341): the merge key every syncing row carries.
3
+ *
4
+ * A table whose Gate A class syncs gets a `uid TEXT` column. The local primary
5
+ * key (`T####`, an AC id, a session id, a composite edge key) stays the local
6
+ * key, and local foreign keys keep pointing at it; the uid is what a merge
7
+ * compares, as (project, uid). Spec: `cleo docs fetch t12341-uid-scheme`.
8
+ *
9
+ * ## How a uid is made
10
+ *
11
+ * - **Minted, new row** (this build writes it): a random UUIDv7
12
+ * ({@link mintRowUid}), set by the Drizzle `$defaultFn` or by the writer.
13
+ * - **Minted, no uid yet** (an existing row, or one an older build or a raw-SQL
14
+ * writer inserted): a DETERMINISTIC v7-layout uid. Its timestamp is the
15
+ * row's birth; its other 74 bits are SHA-256 over (scope, table, key, birth,
16
+ * the uids of its owning rows, and, for append-only tables, a frozen content
17
+ * list) ({@link mintedRowUid}). A `randomOnly` table (portable-secret) gets a
18
+ * random uid instead.
19
+ * - **Natural** (edges, labels): a UUIDv8 over the key with every reference
20
+ * replaced by the referenced row's uid ({@link naturalRowUid}); a pure
21
+ * function of the row. Symmetric relation types hash their endpoints in
22
+ * sorted order; the reversed twin of a symmetric edge stored both ways takes
23
+ * the `natural-mirror` recipe. A reference whose row does not exist hashes
24
+ * `dangling:<raw key>` and is reported.
25
+ *
26
+ * Deterministic identity can coincide for different rows (the same `T100`
27
+ * with the same `created_at` in two stores). Every minted row therefore also
28
+ * carries a birth fingerprint ({@link birthFingerprint}, `birth_fp`), hashed
29
+ * once from creation facts no edit changes. Same uid and same `birth_fp` is
30
+ * the same row; same uid and a different `birth_fp` is a COLLISION
31
+ * ({@link classifyUidMatch}), which the merge never merges.
32
+ *
33
+ * ## When uids are filled
34
+ *
35
+ * {@link prepareRowIdentity} runs on every open of a `cleo.db`, inside the
36
+ * cold-open lease right after the migrations:
37
+ *
38
+ * 1. re-asserts the identity columns and indexes (idempotent; heals a
39
+ * migration the journal probe stamped without running its index DDL);
40
+ * 2. registers the deterministic SQL functions on the connection, re-links
41
+ * acceptance criteria an older build recreated without their uid (the AC
42
+ * uid graveyard, spec §6.5), then fills every NULL uid (minted tables,
43
+ * owners first; then natural tables), the stored reference facts (`ac_uid`,
44
+ * `ac_text_hash`) and the birth fingerprints, in one savepoint;
45
+ * 3. installs one TEMP `AFTER INSERT` trigger per declared table on this
46
+ * connection, so a row inserted here without them gets the same values the
47
+ * open pass would give it, in the same statement. A trigger never fails the
48
+ * insert: a value that would clash is left NULL and reported at the next
49
+ * open.
50
+ *
51
+ * A row an older build inserts keeps NULL values until the next open by this
52
+ * build: there is no persistent trigger that computes them (see the
53
+ * migration's header). Row uids are OPT-IN: nothing here runs unless
54
+ * `CLEO_ROW_UID_FILL=1` ({@link rowUidFillEnabled}).
55
+ *
56
+ * A failure never fails the open: it is logged, and the rows keep NULL values
57
+ * until a later open succeeds. A uid's timestamp is ordering sugar only: HLC
58
+ * (T12342) never reads time from a uid.
59
+ *
60
+ * @module
61
+ * @task T12341
62
+ * @epic T12323
63
+ */
64
+ import type { DatabaseSync } from 'node:sqlite';
65
+ import type { TableScope } from '@cleocode/contracts';
66
+ import { BIRTH_FP_COLUMN, ROW_IDENTITY, rowIdentityColumns, rowIdentitySpec, UID_COLUMN } from './row-identity-registry.js';
67
+ export { BIRTH_FP_COLUMN, ROW_IDENTITY, rowIdentityColumns, rowIdentitySpec, UID_COLUMN };
68
+ /** Domain separator hashed into every deterministic uid. Changing it re-keys every row. */
69
+ export declare const ROW_UID_DOMAIN = "cleo/row-uid/v1";
70
+ /** Domain separator hashed into every birth fingerprint. */
71
+ export declare const ROW_BIRTH_DOMAIN = "cleo/row-birth/v1";
72
+ /** Per-connection SQL function computing a deterministic uid. */
73
+ export declare const ROW_UID_SQL_FUNCTION = "cleo_row_uid";
74
+ /** Per-connection SQL function computing a birth fingerprint. */
75
+ export declare const ROW_BIRTH_FP_SQL_FUNCTION = "cleo_row_birth_fp";
76
+ /** Per-connection SQL function returning a fresh random UUIDv7 (`randomOnly` tables). */
77
+ export declare const ROW_RANDOM_UID_SQL_FUNCTION = "cleo_row_random_uid";
78
+ /** Per-connection SQL function hashing AC text like `acTextHash`. */
79
+ export declare const AC_TEXT_HASH_SQL_FUNCTION = "cleo_ac_text_hash";
80
+ /** Physical name of the AC uid graveyard (spec §6.5). */
81
+ export declare const AC_UID_GRAVEYARD = "tasks_ac_uid_graveyard";
82
+ /**
83
+ * The literal-table writes the open pass makes, supplied by the tasks
84
+ * chokepoint (`store/sqlite-data-accessor.ts`, which registers them when it
85
+ * loads) so they stay enumerable by gate 28.
86
+ */
87
+ export interface RowIdentityWriters {
88
+ relinkAcUidNative(db: DatabaseSync, acId: string, uid: string, birthFp: string | null): number;
89
+ clearAcUidGraveyardNative(db: DatabaseSync): void;
90
+ writeRowIdentityMetaNative(db: DatabaseSync, key: string, value: string): void;
91
+ fillIdentityColumnNative(db: DatabaseSync, table: string, column: string, valueSql: string, rowid?: number): number;
92
+ clearBirthFpNative(db: DatabaseSync, table: string, rowid: number): void;
93
+ }
94
+ /**
95
+ * Register the chokepoint's row-identity writers (called once by
96
+ * `store/sqlite-data-accessor.ts` at load).
97
+ *
98
+ * @param writers - The writers.
99
+ */
100
+ export declare function registerRowIdentityWriters(writers: RowIdentityWriters): void;
101
+ /** A SQL value as node:sqlite passes it to a function. */
102
+ export type UidInput = string | number | bigint | Uint8Array | null;
103
+ /**
104
+ * Unambiguous encoding of uid inputs: per value a type tag (0 null, 1 text,
105
+ * 2 integer, 3 real, 4 blob), a big-endian u32 byte length, and the bytes. An
106
+ * integer-valued number is tag 2 (SQLite `3` and `3.0` encode alike); any other
107
+ * number is tag 3 with its ECMAScript shortest round-trip text. Frozen for
108
+ * recipe v1.
109
+ *
110
+ * @param values - Inputs in hash order.
111
+ * @returns The encoded bytes.
112
+ */
113
+ export declare function encodeUidInputs(values: readonly UidInput[]): Buffer;
114
+ /**
115
+ * Epoch milliseconds of a stored timestamp, or `null` when absent or not a
116
+ * strict ISO-8601 / SQLite timestamp. A value WITHOUT a zone is UTC:
117
+ * `datetime('now')` writes `YYYY-MM-DD HH:MM:SS` meaning UTC, and a zoneless
118
+ * `YYYY-MM-DDTHH:MM:SS` is read the same way, never as the device's local
119
+ * time (`Date.parse` would, and a uid would then depend on the device's
120
+ * timezone). Anything else (`Date.parse` extensions such as `Sep 24 2026`,
121
+ * out-of-range fields) is `null`, i.e. an unparseable birth. Comparing that
122
+ * text against ISO text is wrong within a day (`' '` sorts before `'T'`), so
123
+ * every comparison and every uid birth goes through this function (T12329).
124
+ *
125
+ * @param value - Stored timestamp.
126
+ * @returns Epoch milliseconds, or `null`.
127
+ */
128
+ export declare function parseStoreTimestamp(value: UidInput | undefined): number | null;
129
+ /**
130
+ * A new uid for a row this build creates: a random UUIDv7.
131
+ *
132
+ * @param birthMs - The row's own birth, for a row imported with one (an
133
+ * importer must never stamp import time into an old row's uid).
134
+ * @returns Canonical lowercase UUID string.
135
+ */
136
+ export declare function mintRowUid(birthMs?: number): string;
137
+ /**
138
+ * The deterministic uid of a minted row that has none: a v7 layout whose
139
+ * timestamp is the row's birth and whose other 74 bits come from SHA-256 over
140
+ * the row's identity. An unknown birth gives timestamp 0; the row's birth
141
+ * fingerprint flags it (`birth:unknown`), and {@link rowIdentityFindings}
142
+ * lists it.
143
+ *
144
+ * @param scope - Store scope.
145
+ * @param table - Physical table name.
146
+ * @param key - Local key values.
147
+ * @param birth - Stored birth value (any format, or null).
148
+ * @param ownerUids - Uids of the owning rows.
149
+ * @param content - Frozen content values of an append-only row.
150
+ * @returns Canonical lowercase UUID string.
151
+ */
152
+ export declare function mintedRowUid(scope: TableScope, table: string, key: readonly UidInput[], birth: UidInput, ownerUids?: readonly UidInput[], content?: readonly UidInput[]): string;
153
+ /**
154
+ * The new uid of a minted child row when its owner is re-keyed (spec §6.4):
155
+ * derived from STORED identity only (the child's old uid and the owner's new
156
+ * uid), never from a local key or content, so every replica that computes it
157
+ * gets the same value whatever display ids it holds. The child's timestamp
158
+ * bits are kept; the other 74 bits come from SHA-256.
159
+ *
160
+ * @param scope - Store scope.
161
+ * @param table - Physical table of the child.
162
+ * @param oldChildUid - The child's uid before the re-key.
163
+ * @param newOwnerUid - The owner's new uid.
164
+ * @returns Canonical lowercase UUID string.
165
+ */
166
+ export declare function rekeyedChildUid(scope: TableScope, table: string, oldChildUid: string, newOwnerUid: string): string;
167
+ /** Recipe of a natural uid: the edge itself, or the reversed twin of a symmetric edge. */
168
+ export type NaturalRecipe = 'natural' | 'natural-mirror';
169
+ /**
170
+ * The uid of a natural row: a UUIDv8 over (scope, table, key), with every
171
+ * reference in the key already replaced by the referenced row's uid.
172
+ *
173
+ * @param scope - Store scope.
174
+ * @param table - Physical table name.
175
+ * @param parts - Key values, references as uids.
176
+ * @param recipe - `natural-mirror` for the reversed twin of a symmetric edge.
177
+ * @returns Canonical lowercase UUID string.
178
+ */
179
+ export declare function naturalRowUid(scope: TableScope, table: string, parts: readonly UidInput[], recipe?: NaturalRecipe): string;
180
+ /**
181
+ * Canonical form of a text input to a birth fingerprint: Unicode NFC, line
182
+ * endings as LF, surrounding whitespace trimmed. Two stores that hold the same
183
+ * text in different normal forms fingerprint it identically.
184
+ *
185
+ * @param text - Stored text.
186
+ * @returns The canonical text.
187
+ */
188
+ export declare function canonicalText(text: string): string;
189
+ /**
190
+ * A minted row's birth fingerprint: 128 bits of SHA-256 over the canonical
191
+ * birth (epoch ms when it parses, so a format-only difference fingerprints
192
+ * alike; a flagged token otherwise) and the table's frozen birth facts, each
193
+ * canonicalised ({@link canonicalText}). Computed ONCE, when the row first
194
+ * gets its identity, from the row as it is then; never recomputed. It is
195
+ * write-once and syncs with the row: a receiver stores the value it receives.
196
+ *
197
+ * @param table - Physical table name.
198
+ * @param birth - Stored birth value.
199
+ * @param facts - Birth fact values, in declared order.
200
+ * @returns 32 lowercase hex characters.
201
+ */
202
+ export declare function birthFingerprint(table: string, birth: UidInput, facts: readonly UidInput[]): string;
203
+ /** How two rows that carry the same uid relate. */
204
+ export type UidMatch = 'same-row' | 'collision' | 'unknown';
205
+ /**
206
+ * Classify two rows of one table that carry the same uid (merge contract,
207
+ * spec §6.4): equal birth fingerprints are one row; different ones are a
208
+ * COLLISION that must never be merged; a missing fingerprint must be filled
209
+ * before the row is emitted.
210
+ *
211
+ * @param a - Birth fingerprint of one row.
212
+ * @param b - Birth fingerprint of the other.
213
+ * @returns The relation.
214
+ */
215
+ export declare function classifyUidMatch(a: string | null, b: string | null): UidMatch;
216
+ /**
217
+ * Register the identity SQL functions on a connection: the deterministic uid
218
+ * and birth fingerprint, the AC text hash, and a random v7 for `randomOnly`
219
+ * tables.
220
+ *
221
+ * @param db - Connection on a `cleo.db`.
222
+ * @param scope - The store's scope.
223
+ */
224
+ export declare function registerRowUidFunction(db: DatabaseSync, scope: TableScope): void;
225
+ /**
226
+ * Re-assert the identity columns and indexes of every declared table present
227
+ * in the store. Idempotent; the migration normally created them already.
228
+ *
229
+ * @param db - Connection on a `cleo.db`.
230
+ * @param scope - The store's scope.
231
+ * @returns Statements that had to be run (empty on a healthy store).
232
+ */
233
+ export declare function ensureRowIdentitySchema(db: DatabaseSync, scope: TableScope): string[];
234
+ /** Findings the open pass reports (and `cleo doctor` can list). */
235
+ export interface RowIdentityFindings {
236
+ /** Minted rows whose birth is missing or unparseable (uid timestamp 0), per table. */
237
+ readonly unknownBirth: Readonly<Record<string, number>>;
238
+ /** Natural rows with a key reference to a row that does not exist, per table. */
239
+ readonly danglingRefs: Readonly<Record<string, number>>;
240
+ /** Reversed twins of symmetric edges stored both ways (duplicates to drop), per table. */
241
+ readonly mirrorEdges: Readonly<Record<string, number>>;
242
+ }
243
+ /** What one fill pass did. */
244
+ export interface RowUidFillReport {
245
+ /** Uids written per table. */
246
+ readonly filled: Readonly<Record<string, number>>;
247
+ /** Stored reference facts written, per `table.column`. */
248
+ readonly refsFilled: Readonly<Record<string, number>>;
249
+ /** Birth fingerprints written per table. */
250
+ readonly fingerprinted: Readonly<Record<string, number>>;
251
+ /** Acceptance criteria re-linked to their uid from the graveyard. */
252
+ readonly relinked: number;
253
+ /** Rows left without a uid or fingerprint, per table (a uniqueness clash). */
254
+ readonly unfilled: Readonly<Record<string, number>>;
255
+ /** Rows the recipes flag. */
256
+ readonly findings: RowIdentityFindings;
257
+ /** Schema statements the pass had to re-run. */
258
+ readonly healed: readonly string[];
259
+ /**
260
+ * Pre-release identity values: `none` (the recipe marker is current, or
261
+ * there were no values), `cleared` (values without the current recipe
262
+ * marker were cleared and refilled), or `refused` (they were kept because
263
+ * uids have already synced; spec §12.1).
264
+ */
265
+ readonly refill: 'none' | 'cleared' | 'refused';
266
+ }
267
+ /**
268
+ * Fill the NULL uids of one declared table (the open pass's recipe). Requires
269
+ * {@link registerRowUidFunction} on the connection. Used after a uid re-key,
270
+ * which clears the uids of the natural rows keyed by the re-keyed row.
271
+ *
272
+ * @param db - Connection on a `cleo.db`.
273
+ * @param scope - The store's scope.
274
+ * @param table - Declared table.
275
+ * @returns Uids written.
276
+ */
277
+ export declare function fillTableUids(db: DatabaseSync, scope: TableScope, table: string, writers?: RowIdentityWriters): number;
278
+ /**
279
+ * Rows the recipes flag: minted rows with an unknown birth (uid timestamp 0),
280
+ * natural rows with a dangling key reference, and reversed twins of symmetric
281
+ * edges stored both ways.
282
+ *
283
+ * @param db - Connection on a `cleo.db`.
284
+ * @param scope - The store's scope.
285
+ * @returns Counts per table (tables without findings are absent).
286
+ */
287
+ export declare function rowIdentityFindings(db: DatabaseSync, scope: TableScope): RowIdentityFindings;
288
+ /**
289
+ * Fill every NULL uid, stored reference fact and birth fingerprint of the
290
+ * declared tables, in one savepoint, after re-linking graveyard AC uids.
291
+ * Requires {@link registerRowUidFunction} on the connection. Idempotent: a
292
+ * filled store writes nothing.
293
+ *
294
+ * @param db - Connection on a `cleo.db`.
295
+ * @param scope - The store's scope.
296
+ * @returns What was written and what could not be.
297
+ */
298
+ export declare function fillRowUids(db: DatabaseSync, scope: TableScope, writers?: RowIdentityWriters): Omit<RowUidFillReport, 'healed' | 'findings' | 'refill'>;
299
+ /**
300
+ * Install the per-connection TEMP triggers that fill a uid, the stored
301
+ * reference facts and the birth fingerprint on insert, in that order. Each
302
+ * step is guarded so the trigger never fails the insert: a uid that would
303
+ * clash is left NULL (a symmetric edge first tries its mirror recipe).
304
+ * Requires {@link registerRowUidFunction}.
305
+ *
306
+ * @param db - Connection on a `cleo.db`.
307
+ * @param scope - The store's scope.
308
+ */
309
+ export declare function installRowUidTriggers(db: DatabaseSync, scope: TableScope): void;
310
+ /**
311
+ * Bring a freshly opened `cleo.db` connection's row identity up to date:
312
+ * schema, graveyard re-link, fill, per-connection triggers. Never throws: a
313
+ * failure is logged and the store opens with the values it has.
314
+ *
315
+ * @param db - Connection on a `cleo.db`, after its migrations ran.
316
+ * @param scope - The store's scope.
317
+ * @param options - `triggers: false` skips the per-connection triggers (a
318
+ * dedicated migration connection: exodus refuses copies whose triggers call
319
+ * an opaque function, so its rows are filled at the next open instead).
320
+ * @returns The fill report, or `null` when skipped or failed.
321
+ */
322
+ /**
323
+ * Version of every identity recipe this build derives (uid, natural uid,
324
+ * birth fingerprint, encoding). Written to {@link ROW_IDENTITY_META_TABLE} under
325
+ * {@link ROW_IDENTITY_RECIPE_KEY} by the first fill; bumped by any change to a
326
+ * recipe, a frozen content or birth-fact list, or the encoding.
327
+ */
328
+ export declare const ROW_IDENTITY_RECIPE = "cleo/row-identity/v1";
329
+ /**
330
+ * Local-only key/value table of the row-identity layer. Not
331
+ * `tasks_schema_meta`: the twin collapse drops twin-only keys of that table on
332
+ * its first run (T12535), which would lose the marker.
333
+ */
334
+ export declare const ROW_IDENTITY_META_TABLE = "tasks_row_identity_meta";
335
+ /** Key holding the recipe version the store's identity values were derived with. */
336
+ export declare const ROW_IDENTITY_RECIPE_KEY = "row_identity_recipe";
337
+ /**
338
+ * Key the sync layer (T12342/T12343) writes BEFORE the
339
+ * first uid leaves the device. Once present, identity values are shared and
340
+ * are never cleared locally.
341
+ */
342
+ export declare const ROW_IDENTITY_SYNCED_KEY = "row_identity_synced";
343
+ /**
344
+ * Re-create the tables, trigger and columns the uid migration adds when they
345
+ * are missing: a store the journal probe stamped as migrated after only its
346
+ * ADD COLUMNs had run (Scenario 3, Case A) otherwise never gets them.
347
+ * Idempotent.
348
+ *
349
+ * @param db - Connection on the project `cleo.db`.
350
+ * @returns Statements that had to be run.
351
+ */
352
+ export declare function ensureIdentityTables(db: DatabaseSync): string[];
353
+ /**
354
+ * The birth fingerprint the pre-release v4/v5 build derived (the recipe that
355
+ * reached live cleocode on 2026-09-28): raw birth text, raw facts, the task
356
+ * title from the earliest `task_created` audit event, and an AC's OWNER UID
357
+ * instead of its owner's fingerprint. Used only to recognise those values.
358
+ *
359
+ * @param db - Connection on the project `cleo.db`.
360
+ * @param table - Minted table.
361
+ * @param row - The stored row.
362
+ * @returns The pre-release fingerprint, or `null` when the table had none.
363
+ */
364
+ export declare function preReleaseBirthFp(db: DatabaseSync, table: string, row: Readonly<Record<string, UidInput>>): string | null;
365
+ /**
366
+ * Record that the store's identity values follow {@link ROW_IDENTITY_RECIPE}.
367
+ * The fill writes it; {@link markRowIdentityShared} writes it too on the
368
+ * first receive (a device that pulls before it ever fills).
369
+ *
370
+ * @param db - Connection on the project `cleo.db`.
371
+ */
372
+ export declare function writeRecipeMarker(db: DatabaseSync, writers?: RowIdentityWriters): void;
373
+ /**
374
+ * Record that identity values are now SHARED with other devices: the recipe
375
+ * marker, and {@link ROW_IDENTITY_SYNCED_KEY} (first write wins, with the
376
+ * direction). Called on the first receive (a pull-first clone that never
377
+ * filled) as well as before the first send; once present, the open pass
378
+ * never clears an identity value (spec §12.1).
379
+ *
380
+ * @param db - Connection on the project `cleo.db`.
381
+ * @param direction - `receive` (the merge applied a row or op) or `send`.
382
+ * @param writers - The chokepoint writers.
383
+ * @task T12746
384
+ */
385
+ export declare function markRowIdentityShared(db: DatabaseSync, direction: 'send' | 'receive', writers?: RowIdentityWriters): void;
386
+ export declare function prepareRowIdentity(db: DatabaseSync, scope: TableScope, options?: {
387
+ readonly triggers?: boolean;
388
+ readonly writers?: RowIdentityWriters;
389
+ }): RowUidFillReport | null;
390
+ //# sourceMappingURL=row-identity.d.ts.map
@@ -0,0 +1 @@
1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