@cleocode/core 2026.9.26 → 2026.10.2

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 (410) hide show
  1. package/dist/build-provenance.json +2 -2
  2. package/dist/cloud/journal.d.ts +9 -5
  3. package/dist/cloud/journal.d.ts.map +1 -1
  4. package/dist/cloud/journal.js +29 -8
  5. package/dist/cloud/journal.js.map +1 -1
  6. package/dist/cloud/manifest-check.d.ts +140 -4
  7. package/dist/cloud/manifest-check.d.ts.map +1 -1
  8. package/dist/cloud/manifest-check.js +309 -10
  9. package/dist/cloud/manifest-check.js.map +1 -1
  10. package/dist/cloud/nexus-attach.d.ts +119 -0
  11. package/dist/cloud/nexus-attach.d.ts.map +1 -0
  12. package/dist/cloud/nexus-attach.js +267 -0
  13. package/dist/cloud/nexus-attach.js.map +1 -0
  14. package/dist/cloud/nexus-auth.d.ts +15 -3
  15. package/dist/cloud/nexus-auth.d.ts.map +1 -1
  16. package/dist/cloud/nexus-auth.js +90 -6
  17. package/dist/cloud/nexus-auth.js.map +1 -1
  18. package/dist/cloud/nexus-cloud-activity.d.ts +37 -0
  19. package/dist/cloud/nexus-cloud-activity.d.ts.map +1 -0
  20. package/dist/cloud/nexus-cloud-activity.js +79 -0
  21. package/dist/cloud/nexus-cloud-activity.js.map +1 -0
  22. package/dist/cloud/nexus-cloud-status.d.ts +132 -0
  23. package/dist/cloud/nexus-cloud-status.d.ts.map +1 -0
  24. package/dist/cloud/nexus-cloud-status.js +476 -0
  25. package/dist/cloud/nexus-cloud-status.js.map +1 -0
  26. package/dist/cloud/nexus-cloud.d.ts +179 -0
  27. package/dist/cloud/nexus-cloud.d.ts.map +1 -0
  28. package/dist/cloud/nexus-cloud.js +296 -0
  29. package/dist/cloud/nexus-cloud.js.map +1 -0
  30. package/dist/cloud/nexus-device.d.ts +32 -7
  31. package/dist/cloud/nexus-device.d.ts.map +1 -1
  32. package/dist/cloud/nexus-device.js +54 -7
  33. package/dist/cloud/nexus-device.js.map +1 -1
  34. package/dist/cloud/nexus-enrol.d.ts +35 -4
  35. package/dist/cloud/nexus-enrol.d.ts.map +1 -1
  36. package/dist/cloud/nexus-enrol.js +192 -47
  37. package/dist/cloud/nexus-enrol.js.map +1 -1
  38. package/dist/cloud/nexus-home.d.ts +74 -0
  39. package/dist/cloud/nexus-home.d.ts.map +1 -0
  40. package/dist/cloud/nexus-home.js +97 -0
  41. package/dist/cloud/nexus-home.js.map +1 -0
  42. package/dist/cloud/nexus-link.d.ts +8 -1
  43. package/dist/cloud/nexus-link.d.ts.map +1 -1
  44. package/dist/cloud/nexus-link.js +138 -11
  45. package/dist/cloud/nexus-link.js.map +1 -1
  46. package/dist/cloud/nexus-logout.d.ts +114 -0
  47. package/dist/cloud/nexus-logout.d.ts.map +1 -0
  48. package/dist/cloud/nexus-logout.js +429 -0
  49. package/dist/cloud/nexus-logout.js.map +1 -0
  50. package/dist/cloud/nexus-vault-keys.d.ts +129 -0
  51. package/dist/cloud/nexus-vault-keys.d.ts.map +1 -0
  52. package/dist/cloud/nexus-vault-keys.js +277 -0
  53. package/dist/cloud/nexus-vault-keys.js.map +1 -0
  54. package/dist/cloud/nexus-vault-state.d.ts +121 -0
  55. package/dist/cloud/nexus-vault-state.d.ts.map +1 -0
  56. package/dist/cloud/nexus-vault-state.js +274 -0
  57. package/dist/cloud/nexus-vault-state.js.map +1 -0
  58. package/dist/cloud/nexus-vault.d.ts +160 -0
  59. package/dist/cloud/nexus-vault.d.ts.map +1 -0
  60. package/dist/cloud/nexus-vault.js +1733 -0
  61. package/dist/cloud/nexus-vault.js.map +1 -0
  62. package/dist/cloud/signing.d.ts +24 -8
  63. package/dist/cloud/signing.d.ts.map +1 -1
  64. package/dist/cloud/signing.js +61 -15
  65. package/dist/cloud/signing.js.map +1 -1
  66. package/dist/docs/export-document.js +8341 -3317
  67. package/dist/docs/export-document.js.map +3 -3
  68. package/dist/doctor/migrations.d.ts +75 -0
  69. package/dist/doctor/migrations.d.ts.map +1 -0
  70. package/dist/doctor/migrations.js +136 -0
  71. package/dist/doctor/migrations.js.map +1 -0
  72. package/dist/doctor/sync-sealer.d.ts +48 -0
  73. package/dist/doctor/sync-sealer.d.ts.map +1 -0
  74. package/dist/doctor/sync-sealer.js +109 -0
  75. package/dist/doctor/sync-sealer.js.map +1 -0
  76. package/dist/doctor/sync-triggers.d.ts +53 -0
  77. package/dist/doctor/sync-triggers.d.ts.map +1 -0
  78. package/dist/doctor/sync-triggers.js +157 -0
  79. package/dist/doctor/sync-triggers.js.map +1 -0
  80. package/dist/init.d.ts.map +1 -1
  81. package/dist/init.js +5 -1
  82. package/dist/init.js.map +1 -1
  83. package/dist/internal.d.ts +1 -1
  84. package/dist/internal.d.ts.map +1 -1
  85. package/dist/internal.js +1 -1
  86. package/dist/internal.js.map +1 -1
  87. package/dist/llm/plugin-facade.js +8668 -3644
  88. package/dist/llm/plugin-facade.js.map +3 -3
  89. package/dist/nexus/projects-clean.d.ts +3 -0
  90. package/dist/nexus/projects-clean.d.ts.map +1 -1
  91. package/dist/nexus/projects-clean.js +9 -3
  92. package/dist/nexus/projects-clean.js.map +1 -1
  93. package/dist/nexus/registry-roots.d.ts +3 -1
  94. package/dist/nexus/registry-roots.d.ts.map +1 -1
  95. package/dist/nexus/registry-roots.js +5 -2
  96. package/dist/nexus/registry-roots.js.map +1 -1
  97. package/dist/nexus/registry.d.ts +8 -1
  98. package/dist/nexus/registry.d.ts.map +1 -1
  99. package/dist/nexus/registry.js +24 -10
  100. package/dist/nexus/registry.js.map +1 -1
  101. package/dist/nexus/workspace.d.ts +4 -1
  102. package/dist/nexus/workspace.d.ts.map +1 -1
  103. package/dist/nexus/workspace.js +10 -4
  104. package/dist/nexus/workspace.js.map +1 -1
  105. package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
  106. package/dist/orchestrate/spawn-ops.js +7 -2
  107. package/dist/orchestrate/spawn-ops.js.map +1 -1
  108. package/dist/orchestrate/worker-verify.d.ts +121 -12
  109. package/dist/orchestrate/worker-verify.d.ts.map +1 -1
  110. package/dist/orchestrate/worker-verify.js +172 -21
  111. package/dist/orchestrate/worker-verify.js.map +1 -1
  112. package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
  113. package/dist/orchestration/spawn-prompt.js +15 -9
  114. package/dist/orchestration/spawn-prompt.js.map +1 -1
  115. package/dist/release/ci-evidence.d.ts +9 -0
  116. package/dist/release/ci-evidence.d.ts.map +1 -1
  117. package/dist/release/ci-evidence.js +9 -2
  118. package/dist/release/ci-evidence.js.map +1 -1
  119. package/dist/resources/backend.d.ts +15 -3
  120. package/dist/resources/backend.d.ts.map +1 -1
  121. package/dist/resources/backend.js +7 -3
  122. package/dist/resources/backend.js.map +1 -1
  123. package/dist/resources/darwin-backend.d.ts +142 -0
  124. package/dist/resources/darwin-backend.d.ts.map +1 -0
  125. package/dist/resources/darwin-backend.js +288 -0
  126. package/dist/resources/darwin-backend.js.map +1 -0
  127. package/dist/resources/governor.d.ts +44 -1
  128. package/dist/resources/governor.d.ts.map +1 -1
  129. package/dist/resources/governor.js +100 -36
  130. package/dist/resources/governor.js.map +1 -1
  131. package/dist/resources/heavy-command.d.ts +132 -0
  132. package/dist/resources/heavy-command.d.ts.map +1 -0
  133. package/dist/resources/heavy-command.js +768 -0
  134. package/dist/resources/heavy-command.js.map +1 -0
  135. package/dist/resources/monitor.d.ts +50 -1
  136. package/dist/resources/monitor.d.ts.map +1 -1
  137. package/dist/resources/monitor.js +83 -1
  138. package/dist/resources/monitor.js.map +1 -1
  139. package/dist/resources/run-admission.d.ts +303 -0
  140. package/dist/resources/run-admission.d.ts.map +1 -0
  141. package/dist/resources/run-admission.js +648 -0
  142. package/dist/resources/run-admission.js.map +1 -0
  143. package/dist/resources/run-class.d.ts +111 -0
  144. package/dist/resources/run-class.d.ts.map +1 -0
  145. package/dist/resources/run-class.js +658 -0
  146. package/dist/resources/run-class.js.map +1 -0
  147. package/dist/resources/run-governed.d.ts +158 -0
  148. package/dist/resources/run-governed.d.ts.map +1 -0
  149. package/dist/resources/run-governed.js +406 -0
  150. package/dist/resources/run-governed.js.map +1 -0
  151. package/dist/resources/slot-holder.d.ts +267 -0
  152. package/dist/resources/slot-holder.d.ts.map +1 -0
  153. package/dist/resources/slot-holder.js +505 -0
  154. package/dist/resources/slot-holder.js.map +1 -0
  155. package/dist/resources/tool-groups.d.ts +74 -0
  156. package/dist/resources/tool-groups.d.ts.map +1 -0
  157. package/dist/resources/tool-groups.js +118 -0
  158. package/dist/resources/tool-groups.js.map +1 -0
  159. package/dist/routing/build-command-groups.d.ts.map +1 -1
  160. package/dist/routing/build-command-groups.js +1 -0
  161. package/dist/routing/build-command-groups.js.map +1 -1
  162. package/dist/selfimprove/fix-gen.js +8676 -3652
  163. package/dist/selfimprove/fix-gen.js.map +3 -3
  164. package/dist/sentient/cross-project-hygiene.d.ts +3 -2
  165. package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
  166. package/dist/sentient/cross-project-hygiene.js +5 -2
  167. package/dist/sentient/cross-project-hygiene.js.map +1 -1
  168. package/dist/sentient/state.d.ts +7 -0
  169. package/dist/sentient/state.d.ts.map +1 -1
  170. package/dist/sentient/state.js.map +1 -1
  171. package/dist/sentient/tick.d.ts +14 -2
  172. package/dist/sentient/tick.d.ts.map +1 -1
  173. package/dist/sentient/tick.js +63 -4
  174. package/dist/sentient/tick.js.map +1 -1
  175. package/dist/setup/sections/nexus-account.d.ts +8 -6
  176. package/dist/setup/sections/nexus-account.d.ts.map +1 -1
  177. package/dist/setup/sections/nexus-account.js +53 -9
  178. package/dist/setup/sections/nexus-account.js.map +1 -1
  179. package/dist/store/backup-recover.d.ts.map +1 -1
  180. package/dist/store/backup-recover.js +5 -0
  181. package/dist/store/backup-recover.js.map +1 -1
  182. package/dist/store/data-accessor.d.ts +1 -0
  183. package/dist/store/data-accessor.d.ts.map +1 -1
  184. package/dist/store/data-accessor.js +7 -0
  185. package/dist/store/data-accessor.js.map +1 -1
  186. package/dist/store/dual-scope-db.d.ts +23 -1
  187. package/dist/store/dual-scope-db.d.ts.map +1 -1
  188. package/dist/store/dual-scope-db.js +126 -36
  189. package/dist/store/dual-scope-db.js.map +1 -1
  190. package/dist/store/exodus/recovery.d.ts.map +1 -1
  191. package/dist/store/exodus/recovery.js +15 -0
  192. package/dist/store/exodus/recovery.js.map +1 -1
  193. package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
  194. package/dist/store/legacy-tasks-lineage.js +5 -0
  195. package/dist/store/legacy-tasks-lineage.js.map +1 -1
  196. package/dist/store/lock.d.ts +8 -1
  197. package/dist/store/lock.d.ts.map +1 -1
  198. package/dist/store/lock.js +10 -2
  199. package/dist/store/lock.js.map +1 -1
  200. package/dist/store/migration-manager.d.ts +5 -0
  201. package/dist/store/migration-manager.d.ts.map +1 -1
  202. package/dist/store/migration-manager.js +11 -0
  203. package/dist/store/migration-manager.js.map +1 -1
  204. package/dist/store/migration-runner.d.ts +158 -0
  205. package/dist/store/migration-runner.d.ts.map +1 -0
  206. package/dist/store/migration-runner.js +493 -0
  207. package/dist/store/migration-runner.js.map +1 -0
  208. package/dist/store/portable-bundle-import.d.ts +15 -1
  209. package/dist/store/portable-bundle-import.d.ts.map +1 -1
  210. package/dist/store/portable-bundle-import.js +24 -4
  211. package/dist/store/portable-bundle-import.js.map +1 -1
  212. package/dist/store/portable-bundle-relocate.d.ts +43 -0
  213. package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
  214. package/dist/store/portable-bundle-relocate.js +79 -5
  215. package/dist/store/portable-bundle-relocate.js.map +1 -1
  216. package/dist/store/portable-bundle-scan.d.ts +20 -0
  217. package/dist/store/portable-bundle-scan.d.ts.map +1 -1
  218. package/dist/store/portable-bundle-scan.js +38 -3
  219. package/dist/store/portable-bundle-scan.js.map +1 -1
  220. package/dist/store/portable-bundle.d.ts +33 -0
  221. package/dist/store/portable-bundle.d.ts.map +1 -1
  222. package/dist/store/portable-bundle.js +34 -7
  223. package/dist/store/portable-bundle.js.map +1 -1
  224. package/dist/store/row-identity-registry.d.ts +137 -7
  225. package/dist/store/row-identity-registry.d.ts.map +1 -1
  226. package/dist/store/row-identity-registry.js +364 -9
  227. package/dist/store/row-identity-registry.js.map +1 -1
  228. package/dist/store/row-identity.d.ts.map +1 -1
  229. package/dist/store/row-identity.js +9 -10
  230. package/dist/store/row-identity.js.map +1 -1
  231. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  232. package/dist/store/sqlite-data-accessor.js +10 -0
  233. package/dist/store/sqlite-data-accessor.js.map +1 -1
  234. package/dist/store/sqlite.d.ts +31 -0
  235. package/dist/store/sqlite.d.ts.map +1 -1
  236. package/dist/store/sqlite.js +5 -1
  237. package/dist/store/sqlite.js.map +1 -1
  238. package/dist/store/sync/capture.d.ts +203 -0
  239. package/dist/store/sync/capture.d.ts.map +1 -0
  240. package/dist/store/sync/capture.js +562 -0
  241. package/dist/store/sync/capture.js.map +1 -0
  242. package/dist/store/sync/clock-store.d.ts.map +1 -1
  243. package/dist/store/sync/clock-store.js +2 -0
  244. package/dist/store/sync/clock-store.js.map +1 -1
  245. package/dist/store/sync/fk-orphans.d.ts +133 -0
  246. package/dist/store/sync/fk-orphans.d.ts.map +1 -0
  247. package/dist/store/sync/fk-orphans.js +265 -0
  248. package/dist/store/sync/fk-orphans.js.map +1 -0
  249. package/dist/store/sync/flags.d.ts +7 -0
  250. package/dist/store/sync/flags.d.ts.map +1 -1
  251. package/dist/store/sync/flags.js +16 -0
  252. package/dist/store/sync/flags.js.map +1 -1
  253. package/dist/store/sync/hlc.d.ts.map +1 -1
  254. package/dist/store/sync/hlc.js +4 -0
  255. package/dist/store/sync/hlc.js.map +1 -1
  256. package/dist/store/sync/identity-fill.d.ts +45 -0
  257. package/dist/store/sync/identity-fill.d.ts.map +1 -0
  258. package/dist/store/sync/identity-fill.js +85 -0
  259. package/dist/store/sync/identity-fill.js.map +1 -0
  260. package/dist/store/sync/machinery.d.ts +27 -0
  261. package/dist/store/sync/machinery.d.ts.map +1 -0
  262. package/dist/store/sync/machinery.js +44 -0
  263. package/dist/store/sync/machinery.js.map +1 -0
  264. package/dist/store/sync/netting.d.ts +120 -0
  265. package/dist/store/sync/netting.d.ts.map +1 -0
  266. package/dist/store/sync/netting.js +336 -0
  267. package/dist/store/sync/netting.js.map +1 -0
  268. package/dist/store/sync/replica.d.ts +59 -3
  269. package/dist/store/sync/replica.d.ts.map +1 -1
  270. package/dist/store/sync/replica.js +84 -3
  271. package/dist/store/sync/replica.js.map +1 -1
  272. package/dist/store/sync/schema.d.ts +18 -3
  273. package/dist/store/sync/schema.d.ts.map +1 -1
  274. package/dist/store/sync/schema.js +27 -3
  275. package/dist/store/sync/schema.js.map +1 -1
  276. package/dist/store/sync/seal-backlog.d.ts +21 -0
  277. package/dist/store/sync/seal-backlog.d.ts.map +1 -0
  278. package/dist/store/sync/seal-backlog.js +24 -0
  279. package/dist/store/sync/seal-backlog.js.map +1 -0
  280. package/dist/store/sync/sealer-values.d.ts +34 -0
  281. package/dist/store/sync/sealer-values.d.ts.map +1 -0
  282. package/dist/store/sync/sealer-values.js +53 -0
  283. package/dist/store/sync/sealer-values.js.map +1 -0
  284. package/dist/store/sync/sealer.d.ts +145 -0
  285. package/dist/store/sync/sealer.d.ts.map +1 -0
  286. package/dist/store/sync/sealer.js +906 -0
  287. package/dist/store/sync/sealer.js.map +1 -0
  288. package/dist/store/sync/structural.d.ts +63 -0
  289. package/dist/store/sync/structural.d.ts.map +1 -0
  290. package/dist/store/sync/structural.js +180 -0
  291. package/dist/store/sync/structural.js.map +1 -0
  292. package/dist/store/sync/timestamps.d.ts +92 -0
  293. package/dist/store/sync/timestamps.d.ts.map +1 -0
  294. package/dist/store/sync/timestamps.js +228 -0
  295. package/dist/store/sync/timestamps.js.map +1 -0
  296. package/dist/store/sync/tombstones.d.ts +75 -0
  297. package/dist/store/sync/tombstones.d.ts.map +1 -0
  298. package/dist/store/sync/tombstones.js +103 -0
  299. package/dist/store/sync/tombstones.js.map +1 -0
  300. package/dist/store/sync/trigger-classes.d.ts +221 -0
  301. package/dist/store/sync/trigger-classes.d.ts.map +1 -0
  302. package/dist/store/sync/trigger-classes.js +441 -0
  303. package/dist/store/sync/trigger-classes.js.map +1 -0
  304. package/dist/store/sync/trigger-suspend-at-path.d.ts +23 -0
  305. package/dist/store/sync/trigger-suspend-at-path.d.ts.map +1 -0
  306. package/dist/store/sync/trigger-suspend-at-path.js +44 -0
  307. package/dist/store/sync/trigger-suspend-at-path.js.map +1 -0
  308. package/dist/store/sync/writer-version.d.ts +43 -0
  309. package/dist/store/sync/writer-version.d.ts.map +1 -0
  310. package/dist/store/sync/writer-version.js +90 -0
  311. package/dist/store/sync/writer-version.js.map +1 -0
  312. package/dist/store/table-classification.d.ts.map +1 -1
  313. package/dist/store/table-classification.js +102 -0
  314. package/dist/store/table-classification.js.map +1 -1
  315. package/dist/store/trigger-suspend-schema.d.ts +44 -0
  316. package/dist/store/trigger-suspend-schema.d.ts.map +1 -0
  317. package/dist/store/trigger-suspend-schema.js +25 -0
  318. package/dist/store/trigger-suspend-schema.js.map +1 -0
  319. package/dist/store/vault-manifest.d.ts +365 -0
  320. package/dist/store/vault-manifest.d.ts.map +1 -0
  321. package/dist/store/vault-manifest.js +812 -0
  322. package/dist/store/vault-manifest.js.map +1 -0
  323. package/dist/store/writer-lease.d.ts +31 -0
  324. package/dist/store/writer-lease.d.ts.map +1 -1
  325. package/dist/store/writer-lease.js +65 -2
  326. package/dist/store/writer-lease.js.map +1 -1
  327. package/dist/system/health.d.ts.map +1 -1
  328. package/dist/system/health.js +21 -0
  329. package/dist/system/health.js.map +1 -1
  330. package/dist/system/project-health.d.ts.map +1 -1
  331. package/dist/system/project-health.js +3 -1
  332. package/dist/system/project-health.js.map +1 -1
  333. package/dist/tasks/affected-packages.d.ts +58 -0
  334. package/dist/tasks/affected-packages.d.ts.map +1 -1
  335. package/dist/tasks/affected-packages.js +75 -6
  336. package/dist/tasks/affected-packages.js.map +1 -1
  337. package/dist/tasks/affected-scope.d.ts +150 -23
  338. package/dist/tasks/affected-scope.d.ts.map +1 -1
  339. package/dist/tasks/affected-scope.js +320 -32
  340. package/dist/tasks/affected-scope.js.map +1 -1
  341. package/dist/tasks/change-set.d.ts +96 -0
  342. package/dist/tasks/change-set.d.ts.map +1 -1
  343. package/dist/tasks/change-set.js +169 -4
  344. package/dist/tasks/change-set.js.map +1 -1
  345. package/dist/tasks/complete-ci.d.ts +115 -0
  346. package/dist/tasks/complete-ci.d.ts.map +1 -0
  347. package/dist/tasks/complete-ci.js +171 -0
  348. package/dist/tasks/complete-ci.js.map +1 -0
  349. package/dist/tasks/complete.d.ts.map +1 -1
  350. package/dist/tasks/complete.js +50 -17
  351. package/dist/tasks/complete.js.map +1 -1
  352. package/dist/tasks/compute-task-view.d.ts.map +1 -1
  353. package/dist/tasks/compute-task-view.js +7 -0
  354. package/dist/tasks/compute-task-view.js.map +1 -1
  355. package/dist/tasks/done-plan.d.ts.map +1 -1
  356. package/dist/tasks/done-plan.js +51 -30
  357. package/dist/tasks/done-plan.js.map +1 -1
  358. package/dist/tasks/done-record.d.ts +6 -0
  359. package/dist/tasks/done-record.d.ts.map +1 -1
  360. package/dist/tasks/done-record.js +9 -3
  361. package/dist/tasks/done-record.js.map +1 -1
  362. package/dist/tasks/evidence.d.ts +3 -2
  363. package/dist/tasks/evidence.d.ts.map +1 -1
  364. package/dist/tasks/evidence.js +143 -12
  365. package/dist/tasks/evidence.js.map +1 -1
  366. package/dist/tasks/gate-notes.d.ts +22 -0
  367. package/dist/tasks/gate-notes.d.ts.map +1 -0
  368. package/dist/tasks/gate-notes.js +33 -0
  369. package/dist/tasks/gate-notes.js.map +1 -0
  370. package/dist/tasks/index.d.ts +2 -1
  371. package/dist/tasks/index.d.ts.map +1 -1
  372. package/dist/tasks/index.js +2 -1
  373. package/dist/tasks/index.js.map +1 -1
  374. package/dist/tasks/test-run-binding.d.ts +117 -0
  375. package/dist/tasks/test-run-binding.d.ts.map +1 -0
  376. package/dist/tasks/test-run-binding.js +365 -0
  377. package/dist/tasks/test-run-binding.js.map +1 -0
  378. package/dist/tasks/tool-cache-env.d.ts +123 -0
  379. package/dist/tasks/tool-cache-env.d.ts.map +1 -0
  380. package/dist/tasks/tool-cache-env.js +287 -0
  381. package/dist/tasks/tool-cache-env.js.map +1 -0
  382. package/dist/tasks/tool-cache-failed-first.d.ts +155 -0
  383. package/dist/tasks/tool-cache-failed-first.d.ts.map +1 -0
  384. package/dist/tasks/tool-cache-failed-first.js +285 -0
  385. package/dist/tasks/tool-cache-failed-first.js.map +1 -0
  386. package/dist/tasks/tool-cache.d.ts +375 -55
  387. package/dist/tasks/tool-cache.d.ts.map +1 -1
  388. package/dist/tasks/tool-cache.js +912 -303
  389. package/dist/tasks/tool-cache.js.map +1 -1
  390. package/dist/tasks/tool-resolver.d.ts +4 -3
  391. package/dist/tasks/tool-resolver.d.ts.map +1 -1
  392. package/dist/tasks/tool-resolver.js +15 -4
  393. package/dist/tasks/tool-resolver.js.map +1 -1
  394. package/dist/tasks/tool-semaphore.d.ts +67 -7
  395. package/dist/tasks/tool-semaphore.d.ts.map +1 -1
  396. package/dist/tasks/tool-semaphore.js +134 -56
  397. package/dist/tasks/tool-semaphore.js.map +1 -1
  398. package/dist/upgrade.d.ts.map +1 -1
  399. package/dist/upgrade.js +4 -0
  400. package/dist/upgrade.js.map +1 -1
  401. package/dist/validation/engine-ops.d.ts +6 -0
  402. package/dist/validation/engine-ops.d.ts.map +1 -1
  403. package/dist/validation/engine-ops.js +8 -0
  404. package/dist/validation/engine-ops.js.map +1 -1
  405. package/migrations/drizzle-cleo-project/20260930170000_t12819-trigger-suspend-clause/migration.sql +367 -0
  406. package/migrations/sync-journal/20260930120000_t12343-capture/migration.sql +47 -0
  407. package/migrations/sync-journal/20261001170000_t12984-sealer/migration.sql +101 -0
  408. package/package.json +13 -13
  409. package/templates/CLEO-INJECTION.md +5 -5
  410. package/templates/CLEO-REFERENCE.md +8 -4
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The open-time row-identity fill under capture (journal spec §2.3a rule 1;
3
+ * the S2 capture interactions of T12806 and T12801).
4
+ *
5
+ * The fill, the refill of pre-release fingerprints and the graveyard re-link
6
+ * are DERIVED rewrites: every value they write is a deterministic function of
7
+ * the store (spec §12.1), and a refill runs only before any uid has synced.
8
+ * Capturing them would journal one K and one F per filled row under shadow
9
+ * capture. So on a store with the sync schema they run inside
10
+ * {@link withSyncTriggersSuspended}, and the tables they wrote are marked
11
+ * suspect, for the sealer's repair diff (S3).
12
+ *
13
+ * One exception is journaled: a row whose identity a CAPTURED write cleared
14
+ * (a snapshot-overwrite import, K old → NULL) gets the K that records its
15
+ * new uid ({@link captureRemints}), in a `remint` frame, so the pair nets to
16
+ * old → new instead of leaving the new identity unjournaled.
17
+ *
18
+ * @task T12343
19
+ * @module store/sync/identity-fill
20
+ */
21
+ import { getLogger } from '../../logger.js';
22
+ import { prepareRowIdentity, ROW_IDENTITY } from '../row-identity.js';
23
+ import { captureRemints, clearCaptureFrame, finishCaptureFrame, openCaptureFrame, } from './capture.js';
24
+ import { readSyncFlags } from './flags.js';
25
+ import { hasTable } from './schema.js';
26
+ import { markSuspect, touchSet, withSyncTriggersSuspended } from './structural.js';
27
+ /** The tables a fill report says were written. */
28
+ export function filledTables(scope, report) {
29
+ const written = new Set();
30
+ const add = (counts) => {
31
+ for (const [key, n] of Object.entries(counts)) {
32
+ if (n > 0)
33
+ written.add(key.split('.')[0]);
34
+ }
35
+ };
36
+ add(report.filled);
37
+ add(report.fingerprinted);
38
+ add(report.refsFilled);
39
+ if (report.relinked > 0)
40
+ written.add('tasks_task_acceptance_criteria');
41
+ if (report.refill === 'cleared') {
42
+ for (const spec of ROW_IDENTITY[scope])
43
+ written.add(spec.table);
44
+ }
45
+ return [...written];
46
+ }
47
+ /**
48
+ * Run the open-time identity fill ({@link prepareRowIdentity}). With
49
+ * `sync.capture` on: with the capture triggers dropped, the written tables
50
+ * marked suspect, and re-mint K captures for identities a captured write
51
+ * cleared. With it off: exactly {@link prepareRowIdentity}, even when the
52
+ * sync tables exist (`cleo project link` creates them, T13025).
53
+ *
54
+ * Never throws, like {@link prepareRowIdentity}: a failed bracket (busy,
55
+ * a broken sync schema) is logged and reported as no fill.
56
+ */
57
+ export function prepareRowIdentityUnderCapture(db, scope, options = {}) {
58
+ const capture = readSyncFlags(db)['sync.capture'] && hasTable(db, '_sync_capture');
59
+ if (!capture) {
60
+ return { report: prepareRowIdentity(db, scope, options), suspect: [], remints: {} };
61
+ }
62
+ try {
63
+ return bracketedFill(db, scope, options);
64
+ }
65
+ catch (err) {
66
+ getLogger('row-identity').warn({ scope, err: err instanceof Error ? err.message : String(err) }, 'identity fill under capture failed; the store opens without it (T13025)');
67
+ return { report: null, suspect: [], remints: {} };
68
+ }
69
+ }
70
+ function bracketedFill(db, scope, options) {
71
+ return withSyncTriggersSuspended(db, scope, () => {
72
+ const report = prepareRowIdentity(db, scope, options);
73
+ const suspect = report ? markSuspect(db, scope, touchSet(db, filledTables(scope, report))) : [];
74
+ const frame = openCaptureFrame(db, 'remint');
75
+ try {
76
+ const remints = captureRemints(db, scope);
77
+ finishCaptureFrame(db, frame);
78
+ return { report, suspect, remints };
79
+ }
80
+ finally {
81
+ clearCaptureFrame(db, frame);
82
+ }
83
+ });
84
+ }
85
+ //# sourceMappingURL=identity-fill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-fill.js","sourceRoot":"","sources":["../../../src/store/sync/identity-fill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAyB,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAA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AAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QACtC,CAAC;gBAAS,CAAC;YACT,iBAAiB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Removing the change journal from a store (journal spec §2.3a rules 4 and 10).
3
+ *
4
+ * {@link dropSyncMachinery} is the ONLY code allowed to drop `_sync_*`
5
+ * tables; gate 36 forbids `DROP TABLE _sync_…` anywhere else. It drops every
6
+ * capture trigger first, then the tables, in one transaction, so no state
7
+ * with a trigger but without `_sync_capture` is ever committed.
8
+ *
9
+ * It never drops `cleo_trigger_suspend`: that table is schema-owned, and the
10
+ * owned guard and side-effect triggers read it (C2). Nor does anything else;
11
+ * gate 36 forbids dropping it.
12
+ *
13
+ * @task T12819
14
+ * @module store/sync/machinery
15
+ */
16
+ import type { DatabaseSync } from 'node:sqlite';
17
+ /** What {@link dropSyncMachinery} removed. */
18
+ export interface DroppedSyncMachinery {
19
+ readonly triggers: string[];
20
+ readonly tables: string[];
21
+ }
22
+ /**
23
+ * Drop every capture trigger, then every `_sync_*` table, in one
24
+ * transaction (a savepoint when the caller holds one).
25
+ */
26
+ export declare function dropSyncMachinery(db: DatabaseSync): DroppedSyncMachinery;
27
+ //# sourceMappingURL=machinery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machinery.d.ts","sourceRoot":"","sources":["../../../src/store/sync/machinery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,8CAA8C;AAC9C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,oBAAoB,CAuBxE"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Removing the change journal from a store (journal spec §2.3a rules 4 and 10).
3
+ *
4
+ * {@link dropSyncMachinery} is the ONLY code allowed to drop `_sync_*`
5
+ * tables; gate 36 forbids `DROP TABLE _sync_…` anywhere else. It drops every
6
+ * capture trigger first, then the tables, in one transaction, so no state
7
+ * with a trigger but without `_sync_capture` is ever committed.
8
+ *
9
+ * It never drops `cleo_trigger_suspend`: that table is schema-owned, and the
10
+ * owned guard and side-effect triggers read it (C2). Nor does anything else;
11
+ * gate 36 forbids dropping it.
12
+ *
13
+ * @task T12819
14
+ * @module store/sync/machinery
15
+ */
16
+ import { removeCaptureStamp } from './capture.js';
17
+ import { CAPTURE_TRIGGER_PREFIX, TRIGGER_SUSPEND_TABLE } from './trigger-classes.js';
18
+ /**
19
+ * Drop every capture trigger, then every `_sync_*` table, in one
20
+ * transaction (a savepoint when the caller holds one).
21
+ */
22
+ export function dropSyncMachinery(db) {
23
+ const names = (type, prefix) => db
24
+ .prepare('SELECT name FROM main.sqlite_master WHERE type = ? AND substr(name, 1, length(?)) = ? ORDER BY name')
25
+ .all(type, prefix, prefix).map((r) => r.name);
26
+ const triggers = names('trigger', CAPTURE_TRIGGER_PREFIX);
27
+ const tables = names('table', '_sync_').filter((t) => t !== TRIGGER_SUSPEND_TABLE);
28
+ const nested = db.isTransaction;
29
+ removeCaptureStamp(db);
30
+ db.exec(nested ? 'SAVEPOINT drop_sync_machinery' : 'BEGIN IMMEDIATE');
31
+ try {
32
+ for (const t of triggers)
33
+ db.exec(`DROP TRIGGER IF EXISTS "${t}"`);
34
+ for (const t of tables)
35
+ db.exec(`DROP TABLE IF EXISTS "${t}"`);
36
+ db.exec(nested ? 'RELEASE drop_sync_machinery' : 'COMMIT');
37
+ }
38
+ catch (err) {
39
+ db.exec(nested ? 'ROLLBACK TO drop_sync_machinery; RELEASE drop_sync_machinery' : 'ROLLBACK');
40
+ throw err;
41
+ }
42
+ return { triggers, tables };
43
+ }
44
+ //# sourceMappingURL=machinery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machinery.js","sourceRoot":"","sources":["../../../src/store/sync/machinery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAQrF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAgB;IAChD,MAAM,KAAK,GAAG,CAAC,IAAyB,EAAE,MAAc,EAAE,EAAE,CAExD,EAAE;SACC,OAAO,CACN,qGAAqG,CACtG;SACA,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAC5B,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,qBAAqB,CAAC,CAAC;IACnF,MAAM,MAAM,GAAG,EAAE,CAAC,aAAa,CAAC;IAChC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACvB,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;IACtE,IAAI,CAAC;QACH,KAAK,MAAM,CAAC,IAAI,QAAQ;YAAE,EAAE,CAAC,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;QACnE,KAAK,MAAM,CAAC,IAAI,MAAM;YAAE,EAAE,CAAC,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;QAC/D,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,8DAA8D,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAC9F,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Netting inside one transaction (journal spec §2.4, R8, N8; S3b, T12985).
3
+ *
4
+ * The sealer builds one draft op per capture; {@link netTransaction} reduces a
5
+ * transaction's drafts to the ops a receiver needs. Netting is per (table,
6
+ * uid) (§2.4): drafts are first chained per (table, local key `rk`), because a
7
+ * re-key changes the uid but never the local key, and then chains with no K
8
+ * that carry the same uid merge, so a delete of one local row and an insert
9
+ * of another under the same uid (an AC relink) net to one U (T13035).
10
+ *
11
+ * Per chain:
12
+ *
13
+ * 1. **Re-keys.** Adjacent K ops collapse: K(x → NULL) followed by the fill's
14
+ * K(NULL → y) is one K(x → y) (N8). A K whose old uid no sealed op ever
15
+ * carried (no row meta) is **dropped**: every op of the chain then uses the
16
+ * final uid, and the caller moves the row meta ({@link NetResult.renames}).
17
+ * A K on a uid row meta knows is **kept** (T13035): ops sealed earlier on
18
+ * the old uid are never rewritten, so the K is what links them to the new
19
+ * uid. Ops before a kept K use the old uid, ops after it the new one.
20
+ * 2. **Net each stretch between kept K ops** (§2.4 table):
21
+ *
22
+ * | sequence | result |
23
+ * |---|---|
24
+ * | I, then any U | I with the final image |
25
+ * | U, U, … | one U: first before, last after per column; unchanged columns dropped; no op when nothing changed |
26
+ * | I … D | nothing |
27
+ * | D, then I | U of the non-key columns that differ, or nothing |
28
+ * | D, I, D | D, before-image from the first D |
29
+ * | U … D | D, before-image from the first U's before |
30
+ * | I on a uid row meta knows live, not deleted earlier in the transaction (foreign REPLACE) | U against it |
31
+ *
32
+ * 3. **Counters (§2.6).** On a U, a column declared in
33
+ * {@link SYNC_COUNTER_COLUMNS} carries `{$inc: after − before}` instead of
34
+ * the absolute value; the before-image keeps the old value.
35
+ *
36
+ * Each op keeps its first capture's `seq` (output order) and records its last
37
+ * capture's in `last`: the sealer takes the op's HLC time and local key from
38
+ * the last capture (T13037).
39
+ *
40
+ * Apply-intent subtraction (§3.3) needs `_sync_apply_intent`, which arrives
41
+ * with pull/apply (S5); {@link subtractIntents} is the seam and is a no-op
42
+ * until then, so the sealer refuses apply and rebase frames. Across
43
+ * transactions, the sealer drops the dead incarnation of a row that never got
44
+ * a uid (I … D, T13036); the rest of cross-transaction compaction is S4,
45
+ * where segment state exists.
46
+ *
47
+ * Pure: no database access; the caller supplies row-meta facts.
48
+ *
49
+ * @module store/sync/netting
50
+ * @task T12985
51
+ * @epic T12323
52
+ */
53
+ import { type WireValue } from './sealer-values.js';
54
+ /**
55
+ * In-place counter columns per table (§2.6, `SYNC_COUNTER_COLUMNS`): sealed
56
+ * as `{$inc: delta}` on update. Empty while no counter-bearing table is in
57
+ * the sync set (brain_patterns joins with T12894).
58
+ */
59
+ export declare const SYNC_COUNTER_COLUMNS: Readonly<Record<string, readonly string[]>>;
60
+ /** A counter delta on the wire (§2.6). */
61
+ export interface IncValue {
62
+ readonly $inc: number;
63
+ }
64
+ /** A draft op: one capture, before netting. `u`/`nu` may be NULL mid-re-key. */
65
+ export interface DraftOp {
66
+ readonly t: string;
67
+ /** Local key of the row (the capture's `rk`): stable across re-keys. */
68
+ readonly rk: string;
69
+ /** Capture seq, for ordering. */
70
+ readonly seq: number;
71
+ readonly o: 'I' | 'U' | 'D' | 'K';
72
+ /** Row uid; for K the OLD uid. NULL when not yet known. */
73
+ readonly u: string | null;
74
+ /** K only: the new uid (NULL for a clear). */
75
+ readonly nu?: string | null;
76
+ readonly bfp?: string;
77
+ readonly obfp?: string;
78
+ readonly k?: Record<string, WireValue>;
79
+ readonly a?: Record<string, WireValue | IncValue>;
80
+ readonly b?: Record<string, WireValue>;
81
+ }
82
+ /** A netted op, ready for an HLC. `last` is its last capture's seq. */
83
+ export type NettedOp = Omit<DraftOp, 'rk'> & {
84
+ readonly u: string | null;
85
+ readonly last: number;
86
+ };
87
+ /** Row-meta facts the netting needs. */
88
+ export interface MetaFacts {
89
+ /** Whether a persisted segment ever carried this uid (`sent = 1`). */
90
+ sent(table: string, uid: string): boolean;
91
+ /** Whether row meta knows this uid as a LIVE row (not a tombstone). */
92
+ live(table: string, uid: string): boolean;
93
+ /** Whether row meta knows this uid at all: some sealed op carried it. */
94
+ known(table: string, uid: string): boolean;
95
+ }
96
+ /** Netting options beyond row meta. */
97
+ export interface NetOptions {
98
+ /** In-place counter columns per table (§2.6). */
99
+ readonly counters?: Readonly<Record<string, readonly string[]>>;
100
+ /** A table's key columns: a D-then-I U never carries them (§2.4). */
101
+ readonly keyColumns?: (table: string) => readonly string[];
102
+ }
103
+ /** What netting produced. */
104
+ export interface NetResult {
105
+ readonly ops: NettedOp[];
106
+ /** Dropped re-keys: move row meta `from` → `to` without an op. */
107
+ readonly renames: ReadonlyArray<{
108
+ readonly t: string;
109
+ readonly from: string;
110
+ readonly to: string;
111
+ }>;
112
+ }
113
+ /** Intent subtraction (§3.3): the S5 seam. No apply intents exist before pull. */
114
+ export declare function subtractIntents(ops: readonly DraftOp[]): DraftOp[];
115
+ /**
116
+ * Net one transaction's drafts (§2.4). Output is ordered by each op's first
117
+ * capture seq; kept K ops sit between their chain's stretches.
118
+ */
119
+ export declare function netTransaction(drafts: readonly DraftOp[], facts: MetaFacts, options?: NetOptions): NetResult;
120
+ //# sourceMappingURL=netting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"netting.d.ts","sourceRoot":"","sources":["../../../src/store/sync/netting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,EAAiB,KAA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er builds one draft op per capture; {@link netTransaction} reduces a
5
+ * transaction's drafts to the ops a receiver needs. Netting is per (table,
6
+ * uid) (§2.4): drafts are first chained per (table, local key `rk`), because a
7
+ * re-key changes the uid but never the local key, and then chains with no K
8
+ * that carry the same uid merge, so a delete of one local row and an insert
9
+ * of another under the same uid (an AC relink) net to one U (T13035).
10
+ *
11
+ * Per chain:
12
+ *
13
+ * 1. **Re-keys.** Adjacent K ops collapse: K(x → NULL) followed by the fill's
14
+ * K(NULL → y) is one K(x → y) (N8). A K whose old uid no sealed op ever
15
+ * carried (no row meta) is **dropped**: every op of the chain then uses the
16
+ * final uid, and the caller moves the row meta ({@link NetResult.renames}).
17
+ * A K on a uid row meta knows is **kept** (T13035): ops sealed earlier on
18
+ * the old uid are never rewritten, so the K is what links them to the new
19
+ * uid. Ops before a kept K use the old uid, ops after it the new one.
20
+ * 2. **Net each stretch between kept K ops** (§2.4 table):
21
+ *
22
+ * | sequence | result |
23
+ * |---|---|
24
+ * | I, then any U | I with the final image |
25
+ * | U, U, … | one U: first before, last after per column; unchanged columns dropped; no op when nothing changed |
26
+ * | I … D | nothing |
27
+ * | D, then I | U of the non-key columns that differ, or nothing |
28
+ * | D, I, D | D, before-image from the first D |
29
+ * | U … D | D, before-image from the first U's before |
30
+ * | I on a uid row meta knows live, not deleted earlier in the transaction (foreign REPLACE) | U against it |
31
+ *
32
+ * 3. **Counters (§2.6).** On a U, a column declared in
33
+ * {@link SYNC_COUNTER_COLUMNS} carries `{$inc: after − before}` instead of
34
+ * the absolute value; the before-image keeps the old value.
35
+ *
36
+ * Each op keeps its first capture's `seq` (output order) and records its last
37
+ * capture's in `last`: the sealer takes the op's HLC time and local key from
38
+ * the last capture (T13037).
39
+ *
40
+ * Apply-intent subtraction (§3.3) needs `_sync_apply_intent`, which arrives
41
+ * with pull/apply (S5); {@link subtractIntents} is the seam and is a no-op
42
+ * until then, so the sealer refuses apply and rebase frames. Across
43
+ * transactions, the sealer drops the dead incarnation of a row that never got
44
+ * a uid (I … D, T13036); the rest of cross-transaction compaction is S4,
45
+ * where segment state exists.
46
+ *
47
+ * Pure: no database access; the caller supplies row-meta facts.
48
+ *
49
+ * @module store/sync/netting
50
+ * @task T12985
51
+ * @epic T12323
52
+ */
53
+ import { canonicalJson } from './sealer-values.js';
54
+ /**
55
+ * In-place counter columns per table (§2.6, `SYNC_COUNTER_COLUMNS`): sealed
56
+ * as `{$inc: delta}` on update. Empty while no counter-bearing table is in
57
+ * the sync set (brain_patterns joins with T12894).
58
+ */
59
+ export const SYNC_COUNTER_COLUMNS = Object.freeze({});
60
+ const same = (x, y) => canonicalJson(x) === canonicalJson(y);
61
+ /** Collapse adjacent K ops of a chain: x→a then a→b is x→b (N8). */
62
+ function collapseRekeys(chain) {
63
+ const out = [];
64
+ for (const op of chain) {
65
+ const prev = out[out.length - 1];
66
+ if (op.o === 'K' && prev?.o === 'K' && (prev.nu ?? null) === (op.u ?? null)) {
67
+ out[out.length - 1] = {
68
+ ...prev,
69
+ nu: op.nu ?? null,
70
+ ...(op.bfp !== undefined ? { bfp: op.bfp } : {}),
71
+ };
72
+ continue;
73
+ }
74
+ out.push(op);
75
+ }
76
+ return out;
77
+ }
78
+ function step(acc, op) {
79
+ const a = op.a ?? {};
80
+ const b = op.b ?? {};
81
+ switch (acc.s) {
82
+ case 'none':
83
+ if (op.o === 'I')
84
+ return { s: 'I', a: { ...a }, first: op };
85
+ if (op.o === 'U')
86
+ return { s: 'U', a: { ...a }, b: { ...b }, first: op };
87
+ return { s: 'D', b: { ...b }, first: op };
88
+ case 'gone':
89
+ // I … D, then more: start again from here.
90
+ return step({ s: 'none' }, op);
91
+ case 'I':
92
+ if (op.o === 'U')
93
+ return { ...acc, a: { ...acc.a, ...a } };
94
+ if (op.o === 'D')
95
+ return { s: 'gone', first: acc.first };
96
+ return { s: 'I', a: { ...a }, first: acc.first }; // I, I: the later image
97
+ case 'U':
98
+ if (op.o === 'U')
99
+ return { ...acc, a: { ...acc.a, ...a }, b: { ...b, ...acc.b } };
100
+ if (op.o === 'D')
101
+ return { s: 'D', b: { ...b, ...acc.b }, first: acc.first };
102
+ return { s: 'I', a: { ...a }, first: acc.first };
103
+ case 'D':
104
+ if (op.o === 'I')
105
+ return { s: 'DI', b: acc.b, a: { ...a }, first: acc.first, ins: op };
106
+ return acc; // D, D (or U after D): the first before-image stands
107
+ case 'DI':
108
+ if (op.o === 'U')
109
+ return { ...acc, a: { ...acc.a, ...a } };
110
+ if (op.o === 'D')
111
+ return { s: 'D', b: acc.b, first: acc.first };
112
+ return { ...acc, a: { ...a } };
113
+ }
114
+ }
115
+ function counterize(table, a, b, registry) {
116
+ const counters = registry[table];
117
+ if (!counters || counters.length === 0)
118
+ return a;
119
+ const out = { ...a };
120
+ for (const col of counters) {
121
+ const after = a[col];
122
+ const before = b[col];
123
+ if (typeof after === 'number' && typeof before === 'number')
124
+ out[col] = { $inc: after - before };
125
+ }
126
+ return out;
127
+ }
128
+ /** Turn one stretch's accumulator into at most one op. */
129
+ function settle(acc, lastOp, uid, bfp, live, counters, keys) {
130
+ const base = (first) => ({
131
+ t: first.t,
132
+ seq: first.seq,
133
+ last: lastOp.seq,
134
+ u: uid,
135
+ ...(bfp !== undefined ? { bfp } : {}),
136
+ ...(first.k !== undefined ? { k: first.k } : {}),
137
+ });
138
+ switch (acc.s) {
139
+ case 'none':
140
+ case 'gone':
141
+ return null;
142
+ case 'I': {
143
+ // A foreign REPLACE: an insert of a uid row meta already knows as live.
144
+ if (uid !== null && acc.first.o === 'I' && live(acc.first.t, uid, acc.first.seq)) {
145
+ return { ...base(acc.first), o: 'U', a: acc.a };
146
+ }
147
+ return { ...base(acc.first), o: 'I', a: acc.a };
148
+ }
149
+ case 'U': {
150
+ const a = {};
151
+ const b = {};
152
+ for (const col of new Set([...Object.keys(acc.a), ...Object.keys(acc.b)])) {
153
+ if (same(acc.a[col] ?? null, acc.b[col] ?? null))
154
+ continue;
155
+ if (col in acc.a)
156
+ a[col] = acc.a[col];
157
+ if (col in acc.b)
158
+ b[col] = acc.b[col];
159
+ }
160
+ if (Object.keys(a).length === 0)
161
+ return null;
162
+ return { ...base(acc.first), o: 'U', a: counterize(acc.first.t, a, b, counters), b };
163
+ }
164
+ case 'D':
165
+ return { ...base(acc.first), o: 'D', b: acc.b };
166
+ case 'DI': {
167
+ // D then I: never a tombstone plus an insert; the columns that differ.
168
+ const a = {};
169
+ const b = {};
170
+ for (const col of new Set([...Object.keys(acc.a), ...Object.keys(acc.b)])) {
171
+ if (keys.includes(col))
172
+ continue;
173
+ const now = acc.a[col] ?? null;
174
+ const was = acc.b[col] ?? null;
175
+ if (same(now, was))
176
+ continue;
177
+ a[col] = now;
178
+ b[col] = was;
179
+ }
180
+ if (Object.keys(a).length === 0)
181
+ return null;
182
+ return { ...base(acc.first), o: 'U', a: counterize(acc.first.t, a, b, counters), b };
183
+ }
184
+ }
185
+ }
186
+ /** Intent subtraction (§3.3): the S5 seam. No apply intents exist before pull. */
187
+ export function subtractIntents(ops) {
188
+ return [...ops];
189
+ }
190
+ /**
191
+ * Chain drafts per (table, rk), then merge the chains that carry the same
192
+ * single uid (§2.4 nets per uid; T13035). A chain's uid is its one non-NULL
193
+ * uid, counting a fill's K(NULL → y) as y. A chain with a real re-key (a K
194
+ * from a non-NULL uid) stays on its own: its uid changes along the chain, so
195
+ * merging it by uid could put a collision loser's ops on the winner's row.
196
+ */
197
+ function chainsOf(drafts) {
198
+ const byRk = new Map();
199
+ for (const d of drafts) {
200
+ const key = `${d.t}\u0000${d.rk}`;
201
+ let c = byRk.get(key);
202
+ if (!c) {
203
+ c = [];
204
+ byRk.set(key, c);
205
+ }
206
+ c.push(d);
207
+ }
208
+ const out = [];
209
+ const byUid = new Map();
210
+ for (const chain of byRk.values()) {
211
+ const rekeys = chain.some((d) => d.o === 'K' && d.u !== null);
212
+ const uids = new Set();
213
+ for (const d of chain) {
214
+ const u = d.o === 'K' ? (d.nu ?? null) : d.u;
215
+ if (u !== null)
216
+ uids.add(u);
217
+ }
218
+ const only = uids.size === 1 ? [...uids][0] : undefined;
219
+ if (rekeys || only === undefined) {
220
+ out.push(chain);
221
+ continue;
222
+ }
223
+ const key = `${chain[0]?.t}\u0000${only}`;
224
+ const into = byUid.get(key);
225
+ if (into) {
226
+ into.push(...chain);
227
+ into.sort((x, y) => x.seq - y.seq);
228
+ }
229
+ else {
230
+ byUid.set(key, chain);
231
+ out.push(chain);
232
+ }
233
+ }
234
+ return out;
235
+ }
236
+ /**
237
+ * Net one transaction's drafts (§2.4). Output is ordered by each op's first
238
+ * capture seq; kept K ops sit between their chain's stretches.
239
+ */
240
+ export function netTransaction(drafts, facts, options = {}) {
241
+ const counters = options.counters ?? SYNC_COUNTER_COLUMNS;
242
+ const keyColumns = options.keyColumns ?? (() => []);
243
+ const input = subtractIntents(drafts);
244
+ // A uid deleted earlier in this transaction is not live for a later I,
245
+ // whatever row meta says (T13035): that I stays an I.
246
+ const deletedAt = new Map();
247
+ for (const d of input) {
248
+ if (d.o !== 'D' || d.u === null)
249
+ continue;
250
+ const key = `${d.t}\u0000${d.u}`;
251
+ if (!deletedAt.has(key))
252
+ deletedAt.set(key, d.seq);
253
+ }
254
+ const live = (t, u, seq) => {
255
+ const at = deletedAt.get(`${t}\u0000${u}`);
256
+ return (at === undefined || at > seq) && facts.live(t, u);
257
+ };
258
+ const out = [];
259
+ const renames = [];
260
+ for (const raw of chainsOf(input)) {
261
+ const chain = collapseRekeys(raw);
262
+ const keys = chain[0] ? keyColumns(chain[0].t) : [];
263
+ // The uid each stretch uses: a dropped K renames the whole chain to its
264
+ // final uid; a kept K splits it.
265
+ const kept = new Set();
266
+ let finalUid = null;
267
+ for (const op of chain) {
268
+ if (op.o !== 'K') {
269
+ finalUid = finalUid ?? op.u;
270
+ continue;
271
+ }
272
+ const from = op.u ?? null;
273
+ const to = op.nu ?? null;
274
+ if (from !== null && (facts.sent(op.t, from) || facts.known(op.t, from)))
275
+ kept.add(op);
276
+ // A K that keeps its uid (only birth_fp changed) renames nothing.
277
+ else if (from !== null && to !== null && from !== to)
278
+ renames.push({ t: op.t, from, to });
279
+ finalUid = to;
280
+ }
281
+ let acc = { s: 'none' };
282
+ let last = null;
283
+ // The birth_fp the stretch ends with: a dropped K's new value wins.
284
+ let bfp;
285
+ // Stretch uid: before a kept K its old uid; otherwise the uid after the
286
+ // last K in the stretch (a dropped K rewrites earlier ops).
287
+ const stretchUid = (start, end) => {
288
+ for (let i = end - 1; i >= start; i--) {
289
+ const op = chain[i];
290
+ if (op.o === 'K')
291
+ return op.nu ?? null;
292
+ }
293
+ for (let i = start; i < end; i++) {
294
+ const op = chain[i];
295
+ if (op.u !== null)
296
+ return op.u;
297
+ }
298
+ return null;
299
+ };
300
+ let start = 0;
301
+ const flush = (end) => {
302
+ if (last !== null) {
303
+ const keptAfter = chain[end] && kept.has(chain[end]) ? chain[end] : null;
304
+ const uid = keptAfter ? (keptAfter.u ?? null) : (stretchUid(start, end) ?? finalUid);
305
+ const settled = settle(acc, last, uid, bfp, live, counters, keys);
306
+ if (settled)
307
+ out.push(settled);
308
+ }
309
+ acc = { s: 'none' };
310
+ last = null;
311
+ bfp = undefined;
312
+ };
313
+ chain.forEach((op, i) => {
314
+ if (op.o === 'K') {
315
+ if (kept.has(op)) {
316
+ flush(i);
317
+ const { rk: _rk, ...k } = op;
318
+ out.push({ ...k, last: op.seq });
319
+ start = i + 1;
320
+ }
321
+ else if (op.bfp !== undefined) {
322
+ bfp = op.bfp;
323
+ }
324
+ return;
325
+ }
326
+ acc = step(acc, op);
327
+ last = op;
328
+ if (op.bfp !== undefined)
329
+ bfp = op.bfp;
330
+ });
331
+ flush(chain.length);
332
+ }
333
+ out.sort((x, y) => (x.seq ?? 0) - (y.seq ?? 0));
334
+ return { ops: out, renames };
335
+ }
336
+ //# sourceMappingURL=netting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"netting.js","sourceRoot":"","sources":["../../../src/store/sync/netting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;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