@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,529 @@
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 QuarantineRow } from './sqlite-data-accessor.js';
75
+ /** Physical name of the display-id alias table. */
76
+ export declare const DISPLAY_ID_ALIAS_TABLE = "tasks_display_id_aliases";
77
+ /** Physical name of the uid re-key alias table. */
78
+ export declare const UID_ALIAS_TABLE = "tasks_uid_aliases";
79
+ /** Physical name of the identity quarantine (local-only). */
80
+ export declare const QUARANTINE_TABLE = "tasks_identity_quarantine";
81
+ /** Why a display id was displaced. */
82
+ export type DisplayIdAliasReason = 'collision-remint' | 'superseded-remint' | 'split-brain-import' | 'manual';
83
+ /**
84
+ * A hybrid logical clock value (T12342 owns the clock; this module needs only
85
+ * its total order and its physical time). Encoded as
86
+ * `<physical ms, 15 digits>.<counter, 6 digits>.<node>` so that string order
87
+ * is HLC order.
88
+ */
89
+ export interface Hlc {
90
+ readonly physicalMs: number;
91
+ readonly counter: number;
92
+ readonly node: string;
93
+ }
94
+ /**
95
+ * Encode an HLC value.
96
+ *
97
+ * @param hlc - The value.
98
+ * @returns Its sortable string form.
99
+ */
100
+ export declare function encodeHlc(hlc: Hlc): string;
101
+ /**
102
+ * Parse an encoded HLC value.
103
+ *
104
+ * @param value - Encoded HLC.
105
+ * @returns The value.
106
+ * @throws Error when the value is not an encoded HLC.
107
+ */
108
+ export declare function parseHlc(value: string): Hlc;
109
+ /**
110
+ * Total order of two encoded HLC values.
111
+ *
112
+ * @param a - One value.
113
+ * @param b - The other.
114
+ * @returns Negative, zero or positive.
115
+ */
116
+ export declare function compareHlc(a: string, b: string): number;
117
+ /**
118
+ * Of two rows that carry the same display id, the one that must be re-minted:
119
+ * the greater uid. Every replica picks the same one for the same pair, and for
120
+ * UUIDv7 uids the older row keeps its id.
121
+ *
122
+ * @param a - Uid of one claimant.
123
+ * @param b - Uid of the other.
124
+ * @returns The uid to re-mint.
125
+ */
126
+ export declare function collisionLoser(a: string, b: string): string;
127
+ /** A replica of the project, as the authority rule sees it (synced membership). */
128
+ export interface ProjectReplica {
129
+ /** Replica id (T12342). */
130
+ readonly id: string;
131
+ /** HLC at which it joined the project. */
132
+ readonly joinedHlc: string;
133
+ /** HLC at which it was retired, when it was. */
134
+ readonly retiredHlc?: string | null;
135
+ }
136
+ /** Why {@link remintAuthority} chose its authority. */
137
+ export type RemintAuthorityReason = 'server' | 'origin' | 'fallback';
138
+ /** Default length of one authority window (HLC physical time). */
139
+ export declare const REMINT_TAKEOVER_MS: number;
140
+ /** Inputs of {@link remintAuthority}: all synced, so every replica has the same. */
141
+ export interface RemintAuthorityInput {
142
+ /** The project syncs to cloud: the server is the authority. */
143
+ readonly cloudSynced: boolean;
144
+ /** Replica that originated the losing row (`null`: backfilled before sync). */
145
+ readonly origin: string | null;
146
+ /** Project membership. */
147
+ readonly replicas: readonly ProjectReplica[];
148
+ /** When the collision came to exist: the later creation HLC of the two rows. */
149
+ readonly collisionHlc: string;
150
+ /** The HLC time to evaluate at (a replica's clock, or an op's HLC). */
151
+ readonly atHlc: string;
152
+ /** Window length; default {@link REMINT_TAKEOVER_MS}. */
153
+ readonly takeoverAfterMs?: number;
154
+ }
155
+ /**
156
+ * Which replica may re-mint the losing row of a display-id collision at HLC
157
+ * time `atHlc` (spec §9.2). A pure function of synced inputs: every replica
158
+ * evaluating the same time names the same authority.
159
+ *
160
+ * 1. The project syncs to cloud → the server.
161
+ * 2. Else the origin, while it is an active member, for the first window
162
+ * after the collision.
163
+ * 3. Else the FALLBACK CHAIN: the active members other than the origin,
164
+ * sorted, one window each, cycling. A fallback that stays silent loses its
165
+ * turn when its window ends, so a collision never waits forever.
166
+ *
167
+ * @param input - The facts every replica can see.
168
+ * @returns The authority, the rule, and the window index (0 = origin).
169
+ */
170
+ export declare function remintAuthority(input: RemintAuthorityInput): {
171
+ readonly authority: string;
172
+ readonly reason: RemintAuthorityReason;
173
+ readonly slot: number;
174
+ };
175
+ /** Where a displacement came from: the replica that authored it, and when (HLC). */
176
+ export interface Displacement {
177
+ /** Replica that authored the displacement (the authority). */
178
+ readonly origin?: string | null;
179
+ /** HLC of the displacement. */
180
+ readonly displacedHlc?: string | null;
181
+ /** Wall-clock record time; defaults to now. */
182
+ readonly now?: string;
183
+ }
184
+ /**
185
+ * Record that `displayId` used to name the row (`entityUid`, `entityBirthFp`).
186
+ * Idempotent.
187
+ *
188
+ * @param db - Connection on the project `cleo.db`.
189
+ * @param entry - The displaced id, the row that carried it, and the displacement.
190
+ */
191
+ export declare function recordDisplayIdAlias(db: DatabaseSync, entry: Displacement & {
192
+ readonly table: string;
193
+ readonly displayId: string;
194
+ readonly entityUid: string;
195
+ readonly entityBirthFp: string | null;
196
+ readonly reason: DisplayIdAliasReason;
197
+ }): void;
198
+ /** A row that carries, or carried, a display id. */
199
+ export interface DisplayIdClaimant {
200
+ /** Uid of the row (`null` for a live row whose uid is not filled yet). */
201
+ readonly uid: string | null;
202
+ /** Its display id today (`null`: the row is not placed here). */
203
+ readonly currentId: string | null;
204
+ /** `live` when it carries the id now, `alias` when it carried it before. */
205
+ readonly via: 'live' | 'alias';
206
+ /** Alias only: the replica that displaced it. */
207
+ readonly origin?: string | null;
208
+ /** Alias only: the HLC of the displacement. */
209
+ readonly displacedHlc?: string | null;
210
+ }
211
+ /** Outcome of resolving a display id. */
212
+ export type DisplayIdResolution = {
213
+ readonly status: 'none';
214
+ } | {
215
+ readonly status: 'resolved';
216
+ readonly claimant: DisplayIdClaimant;
217
+ /** Rows that carried this id before (history; the live row still wins). */
218
+ readonly alsoKnownAs: readonly DisplayIdClaimant[];
219
+ } | {
220
+ readonly status: 'ambiguous';
221
+ readonly candidates: readonly DisplayIdClaimant[];
222
+ };
223
+ /**
224
+ * Resolve a display id: a live row always wins (aliases come back as
225
+ * history); with no live row, one alias resolves and several are ambiguous.
226
+ *
227
+ * @param db - Connection on the project `cleo.db`.
228
+ * @param table - Display-id table (e.g. `tasks_tasks`).
229
+ * @param displayId - The id to resolve.
230
+ * @returns `resolved` (live, or the single alias), `ambiguous` with every
231
+ * candidate (callers report it as an error and never pick), or `none`.
232
+ */
233
+ export declare function resolveDisplayId(db: DatabaseSync, table: string, displayId: string): DisplayIdResolution;
234
+ /**
235
+ * Allocate the next `T####` on the caller's handle, with the same lower bound
236
+ * `allocateNextTaskId` uses (the highest stored numeric id). Only the re-mint
237
+ * authority allocates for a collision.
238
+ *
239
+ * @param db - Connection on the project `cleo.db`.
240
+ * @returns The new display id.
241
+ */
242
+ export declare function allocateTaskDisplayId(db: DatabaseSync): string;
243
+ /**
244
+ * The re-mint the authority publishes. Other replicas apply it verbatim
245
+ * ({@link applyRemintOp}); they never recompute the number.
246
+ */
247
+ export interface RemintOp {
248
+ /** Uid of the re-minted task. */
249
+ readonly uid: string;
250
+ /** Its birth fingerprint (a uid can be shared by two rows during a uid collision). */
251
+ readonly birthFp: string;
252
+ /** The contested display id it was displaced from. */
253
+ readonly oldId: string;
254
+ /** The display id the authority gave it. */
255
+ readonly newId: string;
256
+ /** The authority that re-minted. */
257
+ readonly origin: string | null;
258
+ /** HLC of the re-mint: the greater HLC wins on every replica. */
259
+ readonly hlc: string;
260
+ }
261
+ /** Receipt of a local re-mint: the op plus what was rewritten here. */
262
+ export interface RemintReceipt extends RemintOp {
263
+ /** Rows rewritten per `table.column`. */
264
+ readonly rewritten: Readonly<Record<string, number>>;
265
+ /** Held rows placed because the re-mint freed their id. */
266
+ readonly released: readonly HeldRowKey[];
267
+ }
268
+ /** The applied re-mint record of a row (meta key → JSON). */
269
+ interface RemintRecord {
270
+ readonly newId: string;
271
+ readonly hlc: string;
272
+ readonly origin: string | null;
273
+ }
274
+ /**
275
+ * AUTHORITY ONLY ({@link remintAuthority}): give the losing task of a
276
+ * display-id collision a new display id. Allocates the next `T####`, renames
277
+ * through the chokepoint (version CAS, claim columns kept), records the
278
+ * contested id as an alias and the op as the row's re-mint record, places any
279
+ * held row the freed id unblocks, and returns the op to publish.
280
+ *
281
+ * @param db - Connection on the project `cleo.db`.
282
+ * @param taskId - Current local display id of the task to re-mint.
283
+ * @param options - The contested id (default: `taskId`), why, the authority,
284
+ * the op's HLC, and an optional version / claim guard for a manual rename.
285
+ * @returns The op to publish, with what was rewritten here.
286
+ * @throws CleoError NOT_FOUND when the task does not exist or has no identity yet.
287
+ */
288
+ export declare function remintTaskDisplayId(db: DatabaseSync, taskId: string, options: {
289
+ readonly reason: DisplayIdAliasReason;
290
+ readonly origin: string | null;
291
+ readonly hlc: string;
292
+ readonly contestedId?: string;
293
+ readonly now?: string;
294
+ readonly guard?: {
295
+ readonly expectedUpdatedAt?: string;
296
+ readonly claim?: TaskClaimGuard;
297
+ };
298
+ }): RemintReceipt;
299
+ /** Outcome of {@link applyRemintOp}. */
300
+ export type ApplyRemintResult = {
301
+ readonly status: 'applied';
302
+ readonly receipt: RemintReceipt;
303
+ }
304
+ /** The row is not placed here (held or not yet received): the op is recorded
305
+ * and the row takes `newId` when it is placed. */
306
+ | {
307
+ readonly status: 'recorded';
308
+ readonly released: readonly HeldRowKey[];
309
+ } | {
310
+ readonly status: 'already-applied';
311
+ }
312
+ /** An op with a greater HLC was applied already; this one's number became an alias. */
313
+ | {
314
+ readonly status: 'superseded';
315
+ readonly winner: RemintRecord;
316
+ }
317
+ /** The new id is held here by another row: a NEW collision for its authority. */
318
+ | {
319
+ readonly status: 'conflict';
320
+ readonly holderUid: string | null;
321
+ };
322
+ /**
323
+ * NON-AUTHORITY: apply a re-mint an authority published. Of several ops for
324
+ * one row, the one with the greatest HLC wins on every replica, whatever the
325
+ * arrival order: a lesser op is recorded as an alias (`superseded`), a greater
326
+ * one renames the row again and turns the previous number into an alias.
327
+ * Never allocates.
328
+ *
329
+ * @param db - Connection on the project `cleo.db`.
330
+ * @param op - The published re-mint.
331
+ * @returns What happened.
332
+ */
333
+ export declare function applyRemintOp(db: DatabaseSync, op: RemintOp): ApplyRemintResult;
334
+ /** A value a wire row carries. */
335
+ export type WireValue = string | number | null;
336
+ /** A reference on the wire: the referenced row's uid and birth fingerprint. */
337
+ export interface WireRef {
338
+ readonly uid: string;
339
+ /** `null` for a natural target (its uid is a pure function; no fingerprint). */
340
+ readonly birthFp: string | null;
341
+ }
342
+ /** An incoming row (the merge engine, T12344, builds these from the outbox). */
343
+ export interface WireRow {
344
+ readonly table: string;
345
+ readonly uid: string;
346
+ /** Birth fingerprint (minted tables); `null` for natural rows. */
347
+ readonly birthFp: string | null;
348
+ /** Column values. Reference columns are replaced by resolving {@link refs}. */
349
+ readonly values: Readonly<Record<string, WireValue>>;
350
+ /** Reference column → the referenced row's identity, or `null` for NULL. */
351
+ readonly refs?: Readonly<Record<string, WireRef | null>>;
352
+ }
353
+ /** Why a row is held. */
354
+ export type HoldReason = QuarantineRow['reason'];
355
+ /** The key of a held row. */
356
+ export interface HeldRowKey {
357
+ readonly entityTable: string;
358
+ readonly uid: string;
359
+ readonly birthFp: string;
360
+ }
361
+ /** A uid collision found while receiving. */
362
+ export interface UidCollision {
363
+ readonly kind: 'uid';
364
+ readonly table: string;
365
+ readonly uid: string;
366
+ /** The smaller fingerprint keeps the uid. */
367
+ readonly winnerBirthFp: string;
368
+ /** The greater fingerprint is re-keyed by its authority. */
369
+ readonly loserBirthFp: string;
370
+ /** True when the local (placed) row is the loser. */
371
+ readonly localIsLoser: boolean;
372
+ }
373
+ /** A display-id collision found while receiving. */
374
+ export interface DisplayIdCollision {
375
+ readonly kind: 'display-id';
376
+ readonly table: string;
377
+ readonly displayId: string;
378
+ readonly loserUid: string;
379
+ readonly localIsLoser: boolean;
380
+ }
381
+ /** Outcome of {@link receiveRow}. */
382
+ export type ReceiveResult = {
383
+ readonly status: 'inserted';
384
+ readonly key: string;
385
+ readonly uid: string;
386
+ } | {
387
+ readonly status: 'duplicate';
388
+ readonly uid: string;
389
+ } | {
390
+ readonly status: 'held';
391
+ readonly reason: HoldReason;
392
+ readonly collision?: UidCollision | DisplayIdCollision;
393
+ };
394
+ /** Outcome of {@link resolveWireRef}. */
395
+ export type WireRefResolution = {
396
+ readonly status: 'row';
397
+ readonly key: string;
398
+ readonly uid: string;
399
+ } | {
400
+ readonly status: 'held';
401
+ } | {
402
+ readonly status: 'pending';
403
+ };
404
+ /**
405
+ * Resolve a wire reference to a local row: the row with that uid AND that
406
+ * birth fingerprint, following `tasks_uid_aliases` when the target was
407
+ * re-keyed. A row that has the uid with ANOTHER fingerprint (the other side of
408
+ * a uid collision) never matches: the reference is `held` (its target waits
409
+ * in the quarantine) or `pending` (its target has not arrived, or its re-key
410
+ * has not), and the referencing row waits too.
411
+ *
412
+ * @param db - Connection on the project `cleo.db`.
413
+ * @param table - The referenced table.
414
+ * @param ref - The reference.
415
+ * @returns Where it points.
416
+ */
417
+ export declare function resolveWireRef(db: DatabaseSync, table: string, ref: WireRef): WireRefResolution;
418
+ /**
419
+ * Receive one row: place it, or hold it (module docs). The first receive
420
+ * marks the store's identity values as shared, so the open pass never
421
+ * clears them (T12746).
422
+ *
423
+ * @param db - Connection on the project `cleo.db`, inside the merge transaction.
424
+ * @param wire - The incoming row.
425
+ * @returns What happened; a `held` result carries the collision for the caller
426
+ * (the merge engine) to hand to its authority.
427
+ */
428
+ export declare function receiveRow(db: DatabaseSync, wire: WireRow): ReceiveResult;
429
+ /**
430
+ * Re-try the held rows now (after an op this module did not apply).
431
+ *
432
+ * @param db - Connection on the project `cleo.db`.
433
+ * @returns The rows placed.
434
+ */
435
+ export declare function releaseHeld(db: DatabaseSync): HeldRowKey[];
436
+ /** A held row, as `cleo doctor` and the merge status report it. */
437
+ export interface HeldRow extends HeldRowKey {
438
+ readonly reason: HoldReason;
439
+ readonly contestedId: string | null;
440
+ readonly createdAt: string;
441
+ readonly row: WireRow;
442
+ }
443
+ /**
444
+ * Every held row (read-only: held rows are never edited in place).
445
+ *
446
+ * @param db - Connection on the project `cleo.db`.
447
+ * @returns The held rows, oldest first.
448
+ */
449
+ export declare function listHeldRows(db: DatabaseSync): HeldRow[];
450
+ /**
451
+ * The wire form of a local row (what a sender publishes): values without the
452
+ * identity columns, and every declared reference as the target's uid and
453
+ * birth fingerprint.
454
+ *
455
+ * @param db - Connection on the project `cleo.db`.
456
+ * @param table - Declared table.
457
+ * @param uid - The row's uid.
458
+ * @returns The wire row.
459
+ */
460
+ export declare function wireRowOf(db: DatabaseSync, table: string, uid: string): WireRow;
461
+ /** A natural row whose uid was re-derived because a re-keyed row is in its key. */
462
+ export interface NaturalRederive {
463
+ readonly table: string;
464
+ readonly oldUid: string;
465
+ readonly newUid: string;
466
+ }
467
+ /** Receipt of {@link rekeyRowUid}: one re-keyed row and everything that followed. */
468
+ export interface RekeyReceipt {
469
+ /** Table of the re-keyed row. */
470
+ readonly table: string;
471
+ /** The colliding uid it carried. */
472
+ readonly oldUid: string;
473
+ /** Its birth fingerprint (unchanged; keys the alias and every match). */
474
+ readonly birthFp: string;
475
+ /** The new uid. */
476
+ readonly newUid: string;
477
+ /** Natural rows re-derived (dependencies, relations, labels, display aliases). */
478
+ readonly natural: readonly NaturalRederive[];
479
+ /** Minted children re-keyed with it ({@link rekeyedChildUid}), recursively. */
480
+ readonly cascaded: readonly RekeyReceipt[];
481
+ /** The authority that re-keyed. */
482
+ readonly origin: string | null;
483
+ /** HLC of the re-key. */
484
+ readonly hlc: string | null;
485
+ }
486
+ /**
487
+ * AUTHORITY ONLY: re-key the LOSER of a uid collision (same uid, different
488
+ * birth fingerprints; the loser is the greater fingerprint). The caller names
489
+ * the loser by its fingerprint and the call asserts it: the row re-keyed is
490
+ * the one with `loserBirthFp`, wherever it is here (placed, or held because
491
+ * the winner arrived first), and a fingerprint that is not the greater of the
492
+ * pair is refused. The row gets a random uid; the cascade follows from stored
493
+ * identity (module docs). Held rows the re-key unblocks are placed.
494
+ *
495
+ * @param db - Connection on the project `cleo.db`.
496
+ * @param table - Minted table of the row.
497
+ * @param uid - The colliding uid.
498
+ * @param loserBirthFp - The loser's birth fingerprint.
499
+ * @param options - The authority and the HLC of the re-key.
500
+ * @returns The receipt to publish, with its cascade and natural uids.
501
+ * @throws CleoError when this replica has no row (uid, loserBirthFp), or the
502
+ * fingerprint is not the loser's.
503
+ */
504
+ export declare function rekeyRowUid(db: DatabaseSync, table: string, uid: string, loserBirthFp: string, options?: Displacement): RekeyReceipt;
505
+ /** Outcome of {@link applyRekey} for one row of the receipt. */
506
+ export type RekeyApplyStatus = 'applied' | 'applied-held' | 'already-applied' | 'alias-only';
507
+ /**
508
+ * RECEIVER: apply a published {@link RekeyReceipt}. Every entry moves the row
509
+ * with (old uid, birth fingerprint) to the published new uid, wherever it is
510
+ * here: a placed row (with its stored copies, display aliases and the
511
+ * published natural uids), a held row (its wire form), or nowhere (the uid
512
+ * alias is recorded, so the row takes its new uid when it arrives). A row
513
+ * with the old uid and ANOTHER fingerprint (the winner) is never touched.
514
+ * Nothing is recomputed. Held rows the re-key unblocks are placed.
515
+ *
516
+ * @param db - Connection on the project `cleo.db`.
517
+ * @param receipt - The published receipt.
518
+ * @returns Per-row outcome, and the held rows placed.
519
+ */
520
+ export declare function applyRekey(db: DatabaseSync, receipt: RekeyReceipt): {
521
+ readonly rows: ReadonlyArray<{
522
+ table: string;
523
+ oldUid: string;
524
+ status: RekeyApplyStatus;
525
+ }>;
526
+ readonly released: readonly HeldRowKey[];
527
+ };
528
+ export {};
529
+ //# 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,EAAkC,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAe1F,OAAO,EAUL,KAAK,aAAa,EAQnB,MAAM,2BAA2B,CAAC;AAEnC,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,GACnB,oBAAoB,GACpB,QAAQ,CAAC;AAIb;;;;;GAKG;AACH,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAE1C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAI3C;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMvD;A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