@origintrail-official/dkg-agent 10.0.19 → 10.0.21

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 (733) hide show
  1. package/dist/approved-private-replica.d.ts +54 -0
  2. package/dist/approved-private-replica.d.ts.map +1 -0
  3. package/dist/approved-private-replica.js +148 -0
  4. package/dist/approved-private-replica.js.map +1 -0
  5. package/dist/bounded-operation.d.ts +2 -0
  6. package/dist/bounded-operation.d.ts.map +1 -1
  7. package/dist/bounded-operation.js +5 -0
  8. package/dist/bounded-operation.js.map +1 -1
  9. package/dist/chain-finality-confirmations-v1.d.ts +7 -0
  10. package/dist/chain-finality-confirmations-v1.d.ts.map +1 -0
  11. package/dist/chain-finality-confirmations-v1.js +9 -0
  12. package/dist/chain-finality-confirmations-v1.js.map +1 -0
  13. package/dist/chain-reconciler.d.ts +23 -0
  14. package/dist/chain-reconciler.d.ts.map +1 -1
  15. package/dist/chain-reconciler.js +35 -0
  16. package/dist/chain-reconciler.js.map +1 -1
  17. package/dist/confirmed-graph-scoped-vm-resolver.d.ts +7 -1
  18. package/dist/confirmed-graph-scoped-vm-resolver.d.ts.map +1 -1
  19. package/dist/confirmed-graph-scoped-vm-resolver.js +5 -3
  20. package/dist/confirmed-graph-scoped-vm-resolver.js.map +1 -1
  21. package/dist/context-graph-authority-dependency.d.ts +11 -0
  22. package/dist/context-graph-authority-dependency.d.ts.map +1 -0
  23. package/dist/context-graph-authority-dependency.js +50 -0
  24. package/dist/context-graph-authority-dependency.js.map +1 -0
  25. package/dist/context-graph-binding-state.d.ts +6 -0
  26. package/dist/context-graph-binding-state.d.ts.map +1 -1
  27. package/dist/context-graph-binding-state.js +17 -10
  28. package/dist/context-graph-binding-state.js.map +1 -1
  29. package/dist/context-graph-claim-proof.d.ts +74 -0
  30. package/dist/context-graph-claim-proof.d.ts.map +1 -0
  31. package/dist/context-graph-claim-proof.js +137 -0
  32. package/dist/context-graph-claim-proof.js.map +1 -0
  33. package/dist/context-graph-member-proof.d.ts +33 -0
  34. package/dist/context-graph-member-proof.d.ts.map +1 -0
  35. package/dist/context-graph-member-proof.js +142 -0
  36. package/dist/context-graph-member-proof.js.map +1 -0
  37. package/dist/context-graph-membership-persist-scheduler.d.ts +7 -23
  38. package/dist/context-graph-membership-persist-scheduler.d.ts.map +1 -1
  39. package/dist/context-graph-membership-persist-scheduler.js +12 -88
  40. package/dist/context-graph-membership-persist-scheduler.js.map +1 -1
  41. package/dist/context-graph-meta-confirmation.d.ts +22 -2
  42. package/dist/context-graph-meta-confirmation.d.ts.map +1 -1
  43. package/dist/context-graph-meta-confirmation.js +54 -23
  44. package/dist/context-graph-meta-confirmation.js.map +1 -1
  45. package/dist/context-graph-meta-projection.d.ts +13 -2
  46. package/dist/context-graph-meta-projection.d.ts.map +1 -1
  47. package/dist/context-graph-meta-projection.js +61 -24
  48. package/dist/context-graph-meta-projection.js.map +1 -1
  49. package/dist/context-graph-metadata-relocation.d.ts +18 -30
  50. package/dist/context-graph-metadata-relocation.d.ts.map +1 -1
  51. package/dist/context-graph-metadata-relocation.js +32 -2
  52. package/dist/context-graph-metadata-relocation.js.map +1 -1
  53. package/dist/context-graph-private-meta-proof.d.ts +8 -9
  54. package/dist/context-graph-private-meta-proof.d.ts.map +1 -1
  55. package/dist/context-graph-private-meta-proof.js +25 -89
  56. package/dist/context-graph-private-meta-proof.js.map +1 -1
  57. package/dist/context-graph-public-meta-proof.d.ts +11 -1
  58. package/dist/context-graph-public-meta-proof.d.ts.map +1 -1
  59. package/dist/context-graph-public-meta-proof.js +23 -3
  60. package/dist/context-graph-public-meta-proof.js.map +1 -1
  61. package/dist/context-graph-read-authority.d.ts +30 -3
  62. package/dist/context-graph-read-authority.d.ts.map +1 -1
  63. package/dist/context-graph-read-authority.js +62 -18
  64. package/dist/context-graph-read-authority.js.map +1 -1
  65. package/dist/context-graph-storage-discovery.d.ts +14 -4
  66. package/dist/context-graph-storage-discovery.d.ts.map +1 -1
  67. package/dist/context-graph-storage-discovery.js +27 -7
  68. package/dist/context-graph-storage-discovery.js.map +1 -1
  69. package/dist/context-graph-subscription-authority-recovery.d.ts +7 -0
  70. package/dist/context-graph-subscription-authority-recovery.d.ts.map +1 -1
  71. package/dist/context-graph-subscription-authority-recovery.js +1 -0
  72. package/dist/context-graph-subscription-authority-recovery.js.map +1 -1
  73. package/dist/context-graph-subscription-persist-scheduler.d.ts +52 -0
  74. package/dist/context-graph-subscription-persist-scheduler.d.ts.map +1 -0
  75. package/dist/context-graph-subscription-persist-scheduler.js +78 -0
  76. package/dist/context-graph-subscription-persist-scheduler.js.map +1 -0
  77. package/dist/curator-dial-address.d.ts +16 -0
  78. package/dist/curator-dial-address.d.ts.map +1 -0
  79. package/dist/curator-dial-address.js +58 -0
  80. package/dist/curator-dial-address.js.map +1 -0
  81. package/dist/curator-meta-refresh.d.ts +18 -4
  82. package/dist/curator-meta-refresh.d.ts.map +1 -1
  83. package/dist/curator-meta-refresh.js +61 -58
  84. package/dist/curator-meta-refresh.js.map +1 -1
  85. package/dist/curator-peer-connection.d.ts +21 -0
  86. package/dist/curator-peer-connection.d.ts.map +1 -0
  87. package/dist/curator-peer-connection.js +41 -0
  88. package/dist/curator-peer-connection.js.map +1 -0
  89. package/dist/dkg-agent-agents-phonebook.d.ts +41 -0
  90. package/dist/dkg-agent-agents-phonebook.d.ts.map +1 -0
  91. package/dist/dkg-agent-agents-phonebook.js +155 -0
  92. package/dist/dkg-agent-agents-phonebook.js.map +1 -0
  93. package/dist/dkg-agent-base.d.ts +162 -24
  94. package/dist/dkg-agent-base.d.ts.map +1 -1
  95. package/dist/dkg-agent-base.js +175 -147
  96. package/dist/dkg-agent-base.js.map +1 -1
  97. package/dist/dkg-agent-cg-chain-observation.d.ts +6 -1
  98. package/dist/dkg-agent-cg-chain-observation.d.ts.map +1 -1
  99. package/dist/dkg-agent-cg-chain-observation.js +20 -5
  100. package/dist/dkg-agent-cg-chain-observation.js.map +1 -1
  101. package/dist/dkg-agent-cg-name-resolution.d.ts +38 -2
  102. package/dist/dkg-agent-cg-name-resolution.d.ts.map +1 -1
  103. package/dist/dkg-agent-cg-name-resolution.js +100 -8
  104. package/dist/dkg-agent-cg-name-resolution.js.map +1 -1
  105. package/dist/dkg-agent-cg-registry.d.ts +43 -3
  106. package/dist/dkg-agent-cg-registry.d.ts.map +1 -1
  107. package/dist/dkg-agent-cg-registry.js +267 -129
  108. package/dist/dkg-agent-cg-registry.js.map +1 -1
  109. package/dist/dkg-agent-cg-resolve.d.ts +6 -4
  110. package/dist/dkg-agent-cg-resolve.d.ts.map +1 -1
  111. package/dist/dkg-agent-cg-resolve.js +40 -18
  112. package/dist/dkg-agent-cg-resolve.js.map +1 -1
  113. package/dist/dkg-agent-constants.d.ts +10 -2
  114. package/dist/dkg-agent-constants.d.ts.map +1 -1
  115. package/dist/dkg-agent-constants.js +10 -2
  116. package/dist/dkg-agent-constants.js.map +1 -1
  117. package/dist/dkg-agent-context-graph.d.ts.map +1 -1
  118. package/dist/dkg-agent-context-graph.js +1 -5
  119. package/dist/dkg-agent-context-graph.js.map +1 -1
  120. package/dist/dkg-agent-crypto.d.ts +128 -21
  121. package/dist/dkg-agent-crypto.d.ts.map +1 -1
  122. package/dist/dkg-agent-crypto.js +824 -176
  123. package/dist/dkg-agent-crypto.js.map +1 -1
  124. package/dist/dkg-agent-diagnostics.d.ts.map +1 -1
  125. package/dist/dkg-agent-diagnostics.js +4 -3
  126. package/dist/dkg-agent-diagnostics.js.map +1 -1
  127. package/dist/dkg-agent-helpers.d.ts +2 -2
  128. package/dist/dkg-agent-helpers.d.ts.map +1 -1
  129. package/dist/dkg-agent-helpers.js +3 -3
  130. package/dist/dkg-agent-helpers.js.map +1 -1
  131. package/dist/dkg-agent-join.d.ts +12 -1
  132. package/dist/dkg-agent-join.d.ts.map +1 -1
  133. package/dist/dkg-agent-join.js +80 -92
  134. package/dist/dkg-agent-join.js.map +1 -1
  135. package/dist/dkg-agent-lifecycle.d.ts +129 -22
  136. package/dist/dkg-agent-lifecycle.d.ts.map +1 -1
  137. package/dist/dkg-agent-lifecycle.js +690 -211
  138. package/dist/dkg-agent-lifecycle.js.map +1 -1
  139. package/dist/dkg-agent-publish.d.ts +33 -40
  140. package/dist/dkg-agent-publish.d.ts.map +1 -1
  141. package/dist/dkg-agent-publish.js +194 -281
  142. package/dist/dkg-agent-publish.js.map +1 -1
  143. package/dist/dkg-agent-query.d.ts +7 -0
  144. package/dist/dkg-agent-query.d.ts.map +1 -1
  145. package/dist/dkg-agent-query.js +102 -86
  146. package/dist/dkg-agent-query.js.map +1 -1
  147. package/dist/dkg-agent-registered-private-empty-vm.d.ts +70 -0
  148. package/dist/dkg-agent-registered-private-empty-vm.d.ts.map +1 -0
  149. package/dist/dkg-agent-registered-private-empty-vm.js +133 -0
  150. package/dist/dkg-agent-registered-private-empty-vm.js.map +1 -0
  151. package/dist/dkg-agent-rfc64-catalog-auto-publish.d.ts +8 -3
  152. package/dist/dkg-agent-rfc64-catalog-auto-publish.d.ts.map +1 -1
  153. package/dist/dkg-agent-rfc64-catalog-auto-publish.js +45 -51
  154. package/dist/dkg-agent-rfc64-catalog-auto-publish.js.map +1 -1
  155. package/dist/dkg-agent-rfc64-catalog.d.ts +87 -80
  156. package/dist/dkg-agent-rfc64-catalog.d.ts.map +1 -1
  157. package/dist/dkg-agent-rfc64-catalog.js +726 -476
  158. package/dist/dkg-agent-rfc64-catalog.js.map +1 -1
  159. package/dist/dkg-agent-rfc64-meta-bootstrap.d.ts +6 -1
  160. package/dist/dkg-agent-rfc64-meta-bootstrap.d.ts.map +1 -1
  161. package/dist/dkg-agent-rfc64-meta-bootstrap.js +29 -13
  162. package/dist/dkg-agent-rfc64-meta-bootstrap.js.map +1 -1
  163. package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.d.ts +8 -0
  164. package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.d.ts.map +1 -1
  165. package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.js +249 -40
  166. package/dist/dkg-agent-rfc64-swm-catalog-projection-supervisor.js.map +1 -1
  167. package/dist/dkg-agent-rfc64-swm-catalog-projection.d.ts.map +1 -1
  168. package/dist/dkg-agent-rfc64-swm-catalog-projection.js +3 -2
  169. package/dist/dkg-agent-rfc64-swm-catalog-projection.js.map +1 -1
  170. package/dist/dkg-agent-swm-host.d.ts +217 -52
  171. package/dist/dkg-agent-swm-host.d.ts.map +1 -1
  172. package/dist/dkg-agent-swm-host.js +1305 -858
  173. package/dist/dkg-agent-swm-host.js.map +1 -1
  174. package/dist/dkg-agent-swm-state.d.ts +15 -0
  175. package/dist/dkg-agent-swm-state.d.ts.map +1 -1
  176. package/dist/dkg-agent-swm-state.js +43 -0
  177. package/dist/dkg-agent-swm-state.js.map +1 -1
  178. package/dist/dkg-agent-swm-substrate.d.ts +49 -8
  179. package/dist/dkg-agent-swm-substrate.d.ts.map +1 -1
  180. package/dist/dkg-agent-swm-substrate.js +219 -46
  181. package/dist/dkg-agent-swm-substrate.js.map +1 -1
  182. package/dist/dkg-agent-types.d.ts +86 -27
  183. package/dist/dkg-agent-types.d.ts.map +1 -1
  184. package/dist/dkg-agent-types.js.map +1 -1
  185. package/dist/dkg-agent-vm-promotion.d.ts +4 -0
  186. package/dist/dkg-agent-vm-promotion.d.ts.map +1 -1
  187. package/dist/dkg-agent-vm-promotion.js +40 -5
  188. package/dist/dkg-agent-vm-promotion.js.map +1 -1
  189. package/dist/dkg-agent-vm-reconcile-scheduling.d.ts +7 -0
  190. package/dist/dkg-agent-vm-reconcile-scheduling.d.ts.map +1 -1
  191. package/dist/dkg-agent-vm-reconcile-scheduling.js +18 -0
  192. package/dist/dkg-agent-vm-reconcile-scheduling.js.map +1 -1
  193. package/dist/dkg-agent.d.ts +31 -2
  194. package/dist/dkg-agent.d.ts.map +1 -1
  195. package/dist/dkg-agent.js +188 -72
  196. package/dist/dkg-agent.js.map +1 -1
  197. package/dist/exact-graph-content-verifier.d.ts.map +1 -1
  198. package/dist/exact-graph-content-verifier.js +3 -2
  199. package/dist/exact-graph-content-verifier.js.map +1 -1
  200. package/dist/finalization-handler.d.ts +26 -211
  201. package/dist/finalization-handler.d.ts.map +1 -1
  202. package/dist/finalization-handler.js +94 -1652
  203. package/dist/finalization-handler.js.map +1 -1
  204. package/dist/finalization-recovery-sqlite-displacement.d.ts +37 -0
  205. package/dist/finalization-recovery-sqlite-displacement.d.ts.map +1 -0
  206. package/dist/finalization-recovery-sqlite-displacement.js +102 -0
  207. package/dist/finalization-recovery-sqlite-displacement.js.map +1 -0
  208. package/dist/finalization-recovery-sqlite-policy.d.ts +20 -4
  209. package/dist/finalization-recovery-sqlite-policy.d.ts.map +1 -1
  210. package/dist/finalization-recovery-sqlite-policy.js +21 -5
  211. package/dist/finalization-recovery-sqlite-policy.js.map +1 -1
  212. package/dist/finalization-recovery-sqlite-rows.d.ts +53 -0
  213. package/dist/finalization-recovery-sqlite-rows.d.ts.map +1 -0
  214. package/dist/finalization-recovery-sqlite-rows.js +77 -0
  215. package/dist/finalization-recovery-sqlite-rows.js.map +1 -0
  216. package/dist/finalization-recovery-sqlite-store.d.ts +10 -4
  217. package/dist/finalization-recovery-sqlite-store.d.ts.map +1 -1
  218. package/dist/finalization-recovery-sqlite-store.js +49 -50
  219. package/dist/finalization-recovery-sqlite-store.js.map +1 -1
  220. package/dist/finalization-recovery-store.d.ts +18 -0
  221. package/dist/finalization-recovery-store.d.ts.map +1 -1
  222. package/dist/finalization-recovery-store.js +24 -0
  223. package/dist/finalization-recovery-store.js.map +1 -1
  224. package/dist/finalization-recovery-worker.js +1 -1
  225. package/dist/finalization-recovery-worker.js.map +1 -1
  226. package/dist/finalization-recovery.d.ts +2 -3
  227. package/dist/finalization-recovery.d.ts.map +1 -1
  228. package/dist/finalization-recovery.js +12 -9
  229. package/dist/finalization-recovery.js.map +1 -1
  230. package/dist/finalized-authority-cold-resolution.d.ts +6 -1
  231. package/dist/finalized-authority-cold-resolution.d.ts.map +1 -1
  232. package/dist/finalized-authority-cold-resolution.js +22 -3
  233. package/dist/finalized-authority-cold-resolution.js.map +1 -1
  234. package/dist/gossip-publish-handler.d.ts.map +1 -1
  235. package/dist/gossip-publish-handler.js +4 -2
  236. package/dist/gossip-publish-handler.js.map +1 -1
  237. package/dist/gossip-session.d.ts +29 -0
  238. package/dist/gossip-session.d.ts.map +1 -0
  239. package/dist/gossip-session.js +48 -0
  240. package/dist/gossip-session.js.map +1 -0
  241. package/dist/index.d.ts +4 -1
  242. package/dist/index.d.ts.map +1 -1
  243. package/dist/index.js +4 -0
  244. package/dist/index.js.map +1 -1
  245. package/dist/internal/context-graph-authority/approved-member-acceptance.d.ts +61 -0
  246. package/dist/internal/context-graph-authority/approved-member-acceptance.d.ts.map +1 -0
  247. package/dist/internal/context-graph-authority/approved-member-acceptance.js +75 -0
  248. package/dist/internal/context-graph-authority/approved-member-acceptance.js.map +1 -0
  249. package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.d.ts +5 -5
  250. package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.d.ts.map +1 -1
  251. package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.js +59 -49
  252. package/dist/internal/context-graph-authority/context-graph-agent-gate-authority.js.map +1 -1
  253. package/dist/internal/context-graph-authority/context-graph-authority.d.ts +1 -0
  254. package/dist/internal/context-graph-authority/context-graph-authority.d.ts.map +1 -1
  255. package/dist/internal/context-graph-authority/context-graph-authority.js +25 -0
  256. package/dist/internal/context-graph-authority/context-graph-authority.js.map +1 -1
  257. package/dist/internal/context-graph-authority/finalized-target-projection.d.ts +17 -0
  258. package/dist/internal/context-graph-authority/finalized-target-projection.d.ts.map +1 -0
  259. package/dist/internal/context-graph-authority/finalized-target-projection.js +36 -0
  260. package/dist/internal/context-graph-authority/finalized-target-projection.js.map +1 -0
  261. package/dist/internal/context-graph-authority/swm-transport-authority.d.ts +84 -0
  262. package/dist/internal/context-graph-authority/swm-transport-authority.d.ts.map +1 -0
  263. package/dist/internal/context-graph-authority/swm-transport-authority.js +175 -0
  264. package/dist/internal/context-graph-authority/swm-transport-authority.js.map +1 -0
  265. package/dist/internal/context-graph-binding-abort.d.ts +3 -0
  266. package/dist/internal/context-graph-binding-abort.d.ts.map +1 -0
  267. package/dist/internal/context-graph-binding-abort.js +32 -0
  268. package/dist/internal/context-graph-binding-abort.js.map +1 -0
  269. package/dist/internal/context-graph-cache-invalidating-store.d.ts +3 -0
  270. package/dist/internal/context-graph-cache-invalidating-store.d.ts.map +1 -0
  271. package/dist/internal/context-graph-cache-invalidating-store.js +167 -0
  272. package/dist/internal/context-graph-cache-invalidating-store.js.map +1 -0
  273. package/dist/internal/context-graph-meta-record-copy.d.ts +3 -0
  274. package/dist/internal/context-graph-meta-record-copy.d.ts.map +1 -0
  275. package/dist/internal/context-graph-meta-record-copy.js +21 -0
  276. package/dist/internal/context-graph-meta-record-copy.js.map +1 -0
  277. package/dist/internal/gossip/host-mode-handler.d.ts +11 -0
  278. package/dist/internal/gossip/host-mode-handler.d.ts.map +1 -0
  279. package/dist/internal/gossip/host-mode-handler.js +41 -0
  280. package/dist/internal/gossip/host-mode-handler.js.map +1 -0
  281. package/dist/internal/join-encryption-key-bundle.d.ts +10 -0
  282. package/dist/internal/join-encryption-key-bundle.d.ts.map +1 -0
  283. package/dist/internal/join-encryption-key-bundle.js +72 -0
  284. package/dist/internal/join-encryption-key-bundle.js.map +1 -0
  285. package/dist/internal/knowledge-asset-vm-publish-request.d.ts +31 -0
  286. package/dist/internal/knowledge-asset-vm-publish-request.d.ts.map +1 -0
  287. package/dist/internal/knowledge-asset-vm-publish-request.js +91 -0
  288. package/dist/internal/knowledge-asset-vm-publish-request.js.map +1 -0
  289. package/dist/internal/lifecycle-sync-policy.d.ts +5 -0
  290. package/dist/internal/lifecycle-sync-policy.d.ts.map +1 -0
  291. package/dist/internal/lifecycle-sync-policy.js +12 -0
  292. package/dist/internal/lifecycle-sync-policy.js.map +1 -0
  293. package/dist/internal/local-private-member.d.ts +14 -0
  294. package/dist/internal/local-private-member.d.ts.map +1 -0
  295. package/dist/internal/local-private-member.js +21 -0
  296. package/dist/internal/local-private-member.js.map +1 -0
  297. package/dist/internal/promote/assertion-promote-precommit.d.ts +41 -1
  298. package/dist/internal/promote/assertion-promote-precommit.d.ts.map +1 -1
  299. package/dist/internal/promote/assertion-promote-precommit.js +79 -22
  300. package/dist/internal/promote/assertion-promote-precommit.js.map +1 -1
  301. package/dist/internal/storage-ack-owned-request.d.ts +16 -0
  302. package/dist/internal/storage-ack-owned-request.d.ts.map +1 -0
  303. package/dist/internal/storage-ack-owned-request.js +16 -0
  304. package/dist/internal/storage-ack-owned-request.js.map +1 -0
  305. package/dist/internal/vm-reconcile-local-admission-wait.d.ts +96 -0
  306. package/dist/internal/vm-reconcile-local-admission-wait.d.ts.map +1 -0
  307. package/dist/internal/vm-reconcile-local-admission-wait.js +226 -0
  308. package/dist/internal/vm-reconcile-local-admission-wait.js.map +1 -0
  309. package/dist/internal/vm-reconcile-read-authority.d.ts +27 -0
  310. package/dist/internal/vm-reconcile-read-authority.d.ts.map +1 -0
  311. package/dist/internal/vm-reconcile-read-authority.js +33 -0
  312. package/dist/internal/vm-reconcile-read-authority.js.map +1 -0
  313. package/dist/internal/vm-reconcile-sweep-admission.d.ts +2 -0
  314. package/dist/internal/vm-reconcile-sweep-admission.d.ts.map +1 -1
  315. package/dist/internal/vm-reconcile-sweep.d.ts +16 -4
  316. package/dist/internal/vm-reconcile-sweep.d.ts.map +1 -1
  317. package/dist/internal/vm-reconcile-sweep.js +91 -50
  318. package/dist/internal/vm-reconcile-sweep.js.map +1 -1
  319. package/dist/internal/workspace-projected-delegatees.d.ts +3 -0
  320. package/dist/internal/workspace-projected-delegatees.d.ts.map +1 -0
  321. package/dist/internal/workspace-projected-delegatees.js +34 -0
  322. package/dist/internal/workspace-projected-delegatees.js.map +1 -0
  323. package/dist/join-approval-restart-projection.d.ts +14 -0
  324. package/dist/join-approval-restart-projection.d.ts.map +1 -0
  325. package/dist/join-approval-restart-projection.js +32 -0
  326. package/dist/join-approval-restart-projection.js.map +1 -0
  327. package/dist/keyed-persist-scheduler.d.ts +72 -0
  328. package/dist/keyed-persist-scheduler.d.ts.map +1 -0
  329. package/dist/keyed-persist-scheduler.js +140 -0
  330. package/dist/keyed-persist-scheduler.js.map +1 -0
  331. package/dist/map-with-concurrency.d.ts +7 -0
  332. package/dist/map-with-concurrency.d.ts.map +1 -1
  333. package/dist/map-with-concurrency.js +36 -0
  334. package/dist/map-with-concurrency.js.map +1 -1
  335. package/dist/p2p/network-admission-coordinator.d.ts +15 -0
  336. package/dist/p2p/network-admission-coordinator.d.ts.map +1 -1
  337. package/dist/p2p/network-admission-coordinator.js +20 -2
  338. package/dist/p2p/network-admission-coordinator.js.map +1 -1
  339. package/dist/p2p/peer-connect.d.ts +10 -1
  340. package/dist/p2p/peer-connect.d.ts.map +1 -1
  341. package/dist/p2p/peer-connect.js +11 -2
  342. package/dist/p2p/peer-connect.js.map +1 -1
  343. package/dist/p2p/peer-selection.d.ts +8 -0
  344. package/dist/p2p/peer-selection.d.ts.map +1 -1
  345. package/dist/p2p/peer-selection.js +21 -12
  346. package/dist/p2p/peer-selection.js.map +1 -1
  347. package/dist/p2p/protocol-readiness.d.ts +3 -3
  348. package/dist/p2p/protocol-readiness.d.ts.map +1 -1
  349. package/dist/p2p/protocol-readiness.js +4 -3
  350. package/dist/p2p/protocol-readiness.js.map +1 -1
  351. package/dist/prepare-unscoped-context-graph-read-checks.d.ts.map +1 -1
  352. package/dist/prepare-unscoped-context-graph-read-checks.js +12 -0
  353. package/dist/prepare-unscoped-context-graph-read-checks.js.map +1 -1
  354. package/dist/registered-context-graph-authority.d.ts +19 -0
  355. package/dist/registered-context-graph-authority.d.ts.map +1 -1
  356. package/dist/registered-private-empty-vm-attempt-v1.d.ts +34 -0
  357. package/dist/registered-private-empty-vm-attempt-v1.d.ts.map +1 -0
  358. package/dist/registered-private-empty-vm-attempt-v1.js +120 -0
  359. package/dist/registered-private-empty-vm-attempt-v1.js.map +1 -0
  360. package/dist/reserved-ka-id-allocation.d.ts +12 -0
  361. package/dist/reserved-ka-id-allocation.d.ts.map +1 -0
  362. package/dist/reserved-ka-id-allocation.js +25 -0
  363. package/dist/reserved-ka-id-allocation.js.map +1 -0
  364. package/dist/rfc64/applied-catalog-authority-transition-v1.d.ts.map +1 -1
  365. package/dist/rfc64/applied-catalog-authority-transition-v1.js +15 -17
  366. package/dist/rfc64/applied-catalog-authority-transition-v1.js.map +1 -1
  367. package/dist/rfc64/authority-rpc-circuit-breaker-v1.d.ts +5 -3
  368. package/dist/rfc64/authority-rpc-circuit-breaker-v1.d.ts.map +1 -1
  369. package/dist/rfc64/authority-rpc-circuit-breaker-v1.js +9 -0
  370. package/dist/rfc64/authority-rpc-circuit-breaker-v1.js.map +1 -1
  371. package/dist/rfc64/catalog-completion-evidence-v1.d.ts +38 -0
  372. package/dist/rfc64/catalog-completion-evidence-v1.d.ts.map +1 -0
  373. package/dist/rfc64/catalog-completion-evidence-v1.js +49 -0
  374. package/dist/rfc64/catalog-completion-evidence-v1.js.map +1 -0
  375. package/dist/rfc64/catalog-operational-applied-heads-v1.d.ts +12 -13
  376. package/dist/rfc64/catalog-operational-applied-heads-v1.d.ts.map +1 -1
  377. package/dist/rfc64/catalog-operational-applied-heads-v1.js +17 -52
  378. package/dist/rfc64/catalog-operational-applied-heads-v1.js.map +1 -1
  379. package/dist/rfc64/catalog-operational-reads-v1.d.ts +13 -0
  380. package/dist/rfc64/catalog-operational-reads-v1.d.ts.map +1 -0
  381. package/dist/rfc64/catalog-operational-reads-v1.js +56 -0
  382. package/dist/rfc64/catalog-operational-reads-v1.js.map +1 -0
  383. package/dist/rfc64/catalog-operational-targets-v1.d.ts +55 -0
  384. package/dist/rfc64/catalog-operational-targets-v1.d.ts.map +1 -0
  385. package/dist/rfc64/catalog-operational-targets-v1.js +379 -0
  386. package/dist/rfc64/catalog-operational-targets-v1.js.map +1 -0
  387. package/dist/rfc64/catalog-repair-diagnostics-v1.d.ts +28 -0
  388. package/dist/rfc64/catalog-repair-diagnostics-v1.d.ts.map +1 -0
  389. package/dist/rfc64/catalog-repair-diagnostics-v1.js +93 -0
  390. package/dist/rfc64/catalog-repair-diagnostics-v1.js.map +1 -0
  391. package/dist/rfc64/catalog-repair-retry-v1.d.ts +13 -0
  392. package/dist/rfc64/catalog-repair-retry-v1.d.ts.map +1 -0
  393. package/dist/rfc64/catalog-repair-retry-v1.js +39 -0
  394. package/dist/rfc64/catalog-repair-retry-v1.js.map +1 -0
  395. package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts +52 -0
  396. package/dist/rfc64/catalog-replay-recovery-runtime-v1.d.ts.map +1 -1
  397. package/dist/rfc64/catalog-replay-recovery-runtime-v1.js +188 -32
  398. package/dist/rfc64/catalog-replay-recovery-runtime-v1.js.map +1 -1
  399. package/dist/rfc64/catalog-replay-snapshot-runtime-v1.d.ts +2 -8
  400. package/dist/rfc64/catalog-replay-snapshot-runtime-v1.d.ts.map +1 -1
  401. package/dist/rfc64/catalog-replay-snapshot-runtime-v1.js +10 -37
  402. package/dist/rfc64/catalog-replay-snapshot-runtime-v1.js.map +1 -1
  403. package/dist/rfc64/catalog-rollout-authority-v1.d.ts +13 -0
  404. package/dist/rfc64/catalog-rollout-authority-v1.d.ts.map +1 -1
  405. package/dist/rfc64/catalog-rollout-authority-v1.js +11 -0
  406. package/dist/rfc64/catalog-rollout-authority-v1.js.map +1 -1
  407. package/dist/rfc64/catalog-row-authorship.d.ts +12 -0
  408. package/dist/rfc64/catalog-row-authorship.d.ts.map +1 -1
  409. package/dist/rfc64/catalog-row-authorship.js +110 -57
  410. package/dist/rfc64/catalog-row-authorship.js.map +1 -1
  411. package/dist/rfc64/inventory-v1/candidate.d.ts +31 -10
  412. package/dist/rfc64/inventory-v1/candidate.d.ts.map +1 -1
  413. package/dist/rfc64/inventory-v1/candidate.js +51 -16
  414. package/dist/rfc64/inventory-v1/candidate.js.map +1 -1
  415. package/dist/rfc64/inventory-v1/index.d.ts +1 -1
  416. package/dist/rfc64/inventory-v1/index.d.ts.map +1 -1
  417. package/dist/rfc64/inventory-v1/index.js +1 -1
  418. package/dist/rfc64/inventory-v1/index.js.map +1 -1
  419. package/dist/rfc64/inventory-v1/open.d.ts.map +1 -1
  420. package/dist/rfc64/inventory-v1/open.js +7 -4
  421. package/dist/rfc64/inventory-v1/open.js.map +1 -1
  422. package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.d.ts +3 -1
  423. package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.d.ts.map +1 -1
  424. package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.js +15 -0
  425. package/dist/rfc64/inventory-v1/swm-author-inventory-persistence.js.map +1 -1
  426. package/dist/rfc64/legacy-swm-boundary-codec-v1.d.ts +25 -0
  427. package/dist/rfc64/legacy-swm-boundary-codec-v1.d.ts.map +1 -0
  428. package/dist/rfc64/legacy-swm-boundary-codec-v1.js +127 -0
  429. package/dist/rfc64/legacy-swm-boundary-codec-v1.js.map +1 -0
  430. package/dist/rfc64/legacy-swm-boundary-v1.d.ts +12 -0
  431. package/dist/rfc64/legacy-swm-boundary-v1.d.ts.map +1 -1
  432. package/dist/rfc64/legacy-swm-boundary-v1.js +83 -144
  433. package/dist/rfc64/legacy-swm-boundary-v1.js.map +1 -1
  434. package/dist/rfc64/private-catalog-subscription-readiness-v1.d.ts +33 -0
  435. package/dist/rfc64/private-catalog-subscription-readiness-v1.d.ts.map +1 -0
  436. package/dist/rfc64/private-catalog-subscription-readiness-v1.js +97 -0
  437. package/dist/rfc64/private-catalog-subscription-readiness-v1.js.map +1 -0
  438. package/dist/rfc64/private-read-roster-v1.d.ts +14 -0
  439. package/dist/rfc64/private-read-roster-v1.d.ts.map +1 -0
  440. package/dist/rfc64/private-read-roster-v1.js +57 -0
  441. package/dist/rfc64/private-read-roster-v1.js.map +1 -0
  442. package/dist/rfc64/public-catalog-native-receiver-v1.d.ts.map +1 -1
  443. package/dist/rfc64/public-catalog-native-receiver-v1.js +26 -21
  444. package/dist/rfc64/public-catalog-native-receiver-v1.js.map +1 -1
  445. package/dist/rfc64/public-catalog-native-reconciler-v1.d.ts +17 -11
  446. package/dist/rfc64/public-catalog-native-reconciler-v1.d.ts.map +1 -1
  447. package/dist/rfc64/public-catalog-native-reconciler-v1.js +10 -8
  448. package/dist/rfc64/public-catalog-native-reconciler-v1.js.map +1 -1
  449. package/dist/rfc64/public-catalog-receiver-v1.d.ts +9 -0
  450. package/dist/rfc64/public-catalog-receiver-v1.d.ts.map +1 -1
  451. package/dist/rfc64/public-catalog-receiver-v1.js +11 -2
  452. package/dist/rfc64/public-catalog-receiver-v1.js.map +1 -1
  453. package/dist/rfc64/public-catalog-service-v1.d.ts.map +1 -1
  454. package/dist/rfc64/public-catalog-service-v1.js +21 -22
  455. package/dist/rfc64/public-catalog-service-v1.js.map +1 -1
  456. package/dist/rfc64/public-catalog-successor-producer-v1.d.ts.map +1 -1
  457. package/dist/rfc64/public-catalog-successor-producer-v1.js +5 -4
  458. package/dist/rfc64/public-catalog-successor-producer-v1.js.map +1 -1
  459. package/dist/rfc64/registered-private-empty-vm-proof-v1.d.ts +20 -0
  460. package/dist/rfc64/registered-private-empty-vm-proof-v1.d.ts.map +1 -0
  461. package/dist/rfc64/registered-private-empty-vm-proof-v1.js +26 -0
  462. package/dist/rfc64/registered-private-empty-vm-proof-v1.js.map +1 -0
  463. package/dist/rfc64/swm-catalog-durable-asset-resolver-v1.d.ts.map +1 -1
  464. package/dist/rfc64/swm-catalog-durable-asset-resolver-v1.js +60 -53
  465. package/dist/rfc64/swm-catalog-durable-asset-resolver-v1.js.map +1 -1
  466. package/dist/rfc64/swm-inventory-catalog-reconciler-v1.d.ts +2 -1
  467. package/dist/rfc64/swm-inventory-catalog-reconciler-v1.d.ts.map +1 -1
  468. package/dist/rfc64/swm-inventory-catalog-reconciler-v1.js +44 -4
  469. package/dist/rfc64/swm-inventory-catalog-reconciler-v1.js.map +1 -1
  470. package/dist/rfc64/swm-inventory-shadow-runtime-v1.d.ts +3 -1
  471. package/dist/rfc64/swm-inventory-shadow-runtime-v1.d.ts.map +1 -1
  472. package/dist/rfc64/swm-inventory-shadow-runtime-v1.js +34 -0
  473. package/dist/rfc64/swm-inventory-shadow-runtime-v1.js.map +1 -1
  474. package/dist/sync/auth/pipe-request-tail.d.ts +5 -1
  475. package/dist/sync/auth/pipe-request-tail.d.ts.map +1 -1
  476. package/dist/sync/auth/pipe-request-tail.js +13 -3
  477. package/dist/sync/auth/pipe-request-tail.js.map +1 -1
  478. package/dist/sync/auth/request-build.d.ts +3 -0
  479. package/dist/sync/auth/request-build.d.ts.map +1 -1
  480. package/dist/sync/auth/request-build.js +11 -2
  481. package/dist/sync/auth/request-build.js.map +1 -1
  482. package/dist/sync/backpressure.d.ts +27 -16
  483. package/dist/sync/backpressure.d.ts.map +1 -1
  484. package/dist/sync/backpressure.js +66 -40
  485. package/dist/sync/backpressure.js.map +1 -1
  486. package/dist/sync/catchup-policy.d.ts +2 -0
  487. package/dist/sync/catchup-policy.d.ts.map +1 -1
  488. package/dist/sync/catchup-policy.js +2 -0
  489. package/dist/sync/catchup-policy.js.map +1 -1
  490. package/dist/sync/exact-asset-fetch.d.ts +22 -0
  491. package/dist/sync/exact-asset-fetch.d.ts.map +1 -1
  492. package/dist/sync/exact-asset-fetch.js +30 -3
  493. package/dist/sync/exact-asset-fetch.js.map +1 -1
  494. package/dist/sync/exact-assets.d.ts +7 -5
  495. package/dist/sync/exact-assets.d.ts.map +1 -1
  496. package/dist/sync/exact-assets.js +13 -8
  497. package/dist/sync/exact-assets.js.map +1 -1
  498. package/dist/sync/exact-batch-observation.d.ts +3 -0
  499. package/dist/sync/exact-batch-observation.d.ts.map +1 -0
  500. package/dist/sync/exact-batch-observation.js +13 -0
  501. package/dist/sync/exact-batch-observation.js.map +1 -0
  502. package/dist/sync/exact-batch-stream-capability.d.ts +24 -0
  503. package/dist/sync/exact-batch-stream-capability.d.ts.map +1 -0
  504. package/dist/sync/exact-batch-stream-capability.js +88 -0
  505. package/dist/sync/exact-batch-stream-capability.js.map +1 -0
  506. package/dist/sync/exact-batch-stream-contract.d.ts +78 -0
  507. package/dist/sync/exact-batch-stream-contract.d.ts.map +1 -0
  508. package/dist/sync/exact-batch-stream-contract.js +206 -0
  509. package/dist/sync/exact-batch-stream-contract.js.map +1 -0
  510. package/dist/sync/on-connect/sync-on-connect.d.ts +1 -1
  511. package/dist/sync/on-connect/sync-on-connect.d.ts.map +1 -1
  512. package/dist/sync/on-connect/sync-on-connect.js +3 -3
  513. package/dist/sync/on-connect/sync-on-connect.js.map +1 -1
  514. package/dist/sync/on-demand-agents-phonebook.d.ts +162 -0
  515. package/dist/sync/on-demand-agents-phonebook.d.ts.map +1 -0
  516. package/dist/sync/on-demand-agents-phonebook.js +571 -0
  517. package/dist/sync/on-demand-agents-phonebook.js.map +1 -0
  518. package/dist/sync/peer-connection.d.ts.map +1 -1
  519. package/dist/sync/peer-connection.js +11 -2
  520. package/dist/sync/peer-connection.js.map +1 -1
  521. package/dist/sync/priority-admission-queue.d.ts +17 -0
  522. package/dist/sync/priority-admission-queue.d.ts.map +1 -1
  523. package/dist/sync/priority-admission-queue.js +58 -37
  524. package/dist/sync/priority-admission-queue.js.map +1 -1
  525. package/dist/sync/requester/admission-boundary.d.ts +12 -0
  526. package/dist/sync/requester/admission-boundary.d.ts.map +1 -0
  527. package/dist/sync/requester/admission-boundary.js +22 -0
  528. package/dist/sync/requester/admission-boundary.js.map +1 -0
  529. package/dist/sync/requester/durable-sync.d.ts +2 -1
  530. package/dist/sync/requester/durable-sync.d.ts.map +1 -1
  531. package/dist/sync/requester/durable-sync.js +3 -188
  532. package/dist/sync/requester/durable-sync.js.map +1 -1
  533. package/dist/sync/requester/exact-batch-stream-driver.d.ts +83 -0
  534. package/dist/sync/requester/exact-batch-stream-driver.d.ts.map +1 -0
  535. package/dist/sync/requester/exact-batch-stream-driver.js +299 -0
  536. package/dist/sync/requester/exact-batch-stream-driver.js.map +1 -0
  537. package/dist/sync/requester/exact-batch-stream.d.ts +72 -0
  538. package/dist/sync/requester/exact-batch-stream.d.ts.map +1 -0
  539. package/dist/sync/requester/exact-batch-stream.js +267 -0
  540. package/dist/sync/requester/exact-batch-stream.js.map +1 -0
  541. package/dist/sync/requester/exact-recovery-transport.d.ts +19 -0
  542. package/dist/sync/requester/exact-recovery-transport.d.ts.map +1 -0
  543. package/dist/sync/requester/exact-recovery-transport.js +3 -0
  544. package/dist/sync/requester/exact-recovery-transport.js.map +1 -0
  545. package/dist/sync/requester/finalized-swm-twin-reconciliation.js +12 -3
  546. package/dist/sync/requester/finalized-swm-twin-reconciliation.js.map +1 -1
  547. package/dist/sync/requester/graph-scoped-materialization.d.ts.map +1 -1
  548. package/dist/sync/requester/graph-scoped-materialization.js +61 -27
  549. package/dist/sync/requester/graph-scoped-materialization.js.map +1 -1
  550. package/dist/sync/requester/page-fetch.d.ts +7 -0
  551. package/dist/sync/requester/page-fetch.d.ts.map +1 -1
  552. package/dist/sync/requester/page-fetch.js +103 -49
  553. package/dist/sync/requester/page-fetch.js.map +1 -1
  554. package/dist/sync/requester/shared-memory-sync.d.ts +10 -5
  555. package/dist/sync/requester/shared-memory-sync.d.ts.map +1 -1
  556. package/dist/sync/requester/shared-memory-sync.js +149 -150
  557. package/dist/sync/requester/shared-memory-sync.js.map +1 -1
  558. package/dist/sync/requester/swm-materialization-memo.d.ts +12 -0
  559. package/dist/sync/requester/swm-materialization-memo.d.ts.map +1 -0
  560. package/dist/sync/requester/swm-materialization-memo.js +54 -0
  561. package/dist/sync/requester/swm-materialization-memo.js.map +1 -0
  562. package/dist/sync/requester/swm-recovery.d.ts +3 -29
  563. package/dist/sync/requester/swm-recovery.d.ts.map +1 -1
  564. package/dist/sync/requester/swm-recovery.js +11 -10
  565. package/dist/sync/requester/swm-recovery.js.map +1 -1
  566. package/dist/sync/requester/swm-snapshot-materializer.d.ts.map +1 -1
  567. package/dist/sync/requester/swm-snapshot-materializer.js +18 -0
  568. package/dist/sync/requester/swm-snapshot-materializer.js.map +1 -1
  569. package/dist/sync/requester/swm-target-executor.d.ts +6 -0
  570. package/dist/sync/requester/swm-target-executor.d.ts.map +1 -1
  571. package/dist/sync/requester/swm-target-executor.js +24 -3
  572. package/dist/sync/requester/swm-target-executor.js.map +1 -1
  573. package/dist/sync/requester/verified-asset-preparation.d.ts +9 -0
  574. package/dist/sync/requester/verified-asset-preparation.d.ts.map +1 -0
  575. package/dist/sync/requester/verified-asset-preparation.js +190 -0
  576. package/dist/sync/requester/verified-asset-preparation.js.map +1 -0
  577. package/dist/sync/responder/asset-metadata.d.ts +18 -0
  578. package/dist/sync/responder/asset-metadata.d.ts.map +1 -0
  579. package/dist/sync/responder/asset-metadata.js +27 -0
  580. package/dist/sync/responder/asset-metadata.js.map +1 -0
  581. package/dist/sync/responder/durable-data-request-policy.d.ts +2 -16
  582. package/dist/sync/responder/durable-data-request-policy.d.ts.map +1 -1
  583. package/dist/sync/responder/durable-data-request-policy.js +1 -31
  584. package/dist/sync/responder/durable-data-request-policy.js.map +1 -1
  585. package/dist/sync/responder/exact-asset-export-cache.d.ts +89 -0
  586. package/dist/sync/responder/exact-asset-export-cache.d.ts.map +1 -0
  587. package/dist/sync/responder/exact-asset-export-cache.js +550 -0
  588. package/dist/sync/responder/exact-asset-export-cache.js.map +1 -0
  589. package/dist/sync/responder/exact-batch-stream.d.ts +47 -0
  590. package/dist/sync/responder/exact-batch-stream.d.ts.map +1 -0
  591. package/dist/sync/responder/exact-batch-stream.js +151 -0
  592. package/dist/sync/responder/exact-batch-stream.js.map +1 -0
  593. package/dist/sync/responder/exact-data-session.d.ts +67 -0
  594. package/dist/sync/responder/exact-data-session.d.ts.map +1 -0
  595. package/dist/sync/responder/exact-data-session.js +130 -0
  596. package/dist/sync/responder/exact-data-session.js.map +1 -0
  597. package/dist/sync/responder/exact-graph-cursor-filter.d.ts +9 -0
  598. package/dist/sync/responder/exact-graph-cursor-filter.d.ts.map +1 -0
  599. package/dist/sync/responder/exact-graph-cursor-filter.js +101 -0
  600. package/dist/sync/responder/exact-graph-cursor-filter.js.map +1 -0
  601. package/dist/sync/responder/exact-graph-reader.d.ts +95 -0
  602. package/dist/sync/responder/exact-graph-reader.d.ts.map +1 -0
  603. package/dist/sync/responder/exact-graph-reader.js +623 -0
  604. package/dist/sync/responder/exact-graph-reader.js.map +1 -0
  605. package/dist/sync/responder/exact-page-reader.d.ts +37 -0
  606. package/dist/sync/responder/exact-page-reader.d.ts.map +1 -0
  607. package/dist/sync/responder/exact-page-reader.js +130 -0
  608. package/dist/sync/responder/exact-page-reader.js.map +1 -0
  609. package/dist/sync/responder/graph-plan.d.ts +19 -85
  610. package/dist/sync/responder/graph-plan.d.ts.map +1 -1
  611. package/dist/sync/responder/graph-plan.js +51 -988
  612. package/dist/sync/responder/graph-plan.js.map +1 -1
  613. package/dist/sync/responder/page-framing-policy.d.ts +31 -0
  614. package/dist/sync/responder/page-framing-policy.d.ts.map +1 -0
  615. package/dist/sync/responder/page-framing-policy.js +41 -0
  616. package/dist/sync/responder/page-framing-policy.js.map +1 -0
  617. package/dist/sync/responder/responder-row-page.d.ts +85 -0
  618. package/dist/sync/responder/responder-row-page.d.ts.map +1 -0
  619. package/dist/sync/responder/responder-row-page.js +181 -0
  620. package/dist/sync/responder/responder-row-page.js.map +1 -0
  621. package/dist/sync/responder/row-serialization.d.ts +34 -0
  622. package/dist/sync/responder/row-serialization.d.ts.map +1 -0
  623. package/dist/sync/responder/row-serialization.js +69 -0
  624. package/dist/sync/responder/row-serialization.js.map +1 -0
  625. package/dist/sync/responder/session-plan-memo.d.ts +20 -0
  626. package/dist/sync/responder/session-plan-memo.d.ts.map +1 -0
  627. package/dist/sync/responder/session-plan-memo.js +135 -0
  628. package/dist/sync/responder/session-plan-memo.js.map +1 -0
  629. package/dist/sync/responder/sync-handler.d.ts +26 -1
  630. package/dist/sync/responder/sync-handler.d.ts.map +1 -1
  631. package/dist/sync/responder/sync-handler.js +107 -58
  632. package/dist/sync/responder/sync-handler.js.map +1 -1
  633. package/dist/sync/shared-memory-completion.d.ts +30 -0
  634. package/dist/sync/shared-memory-completion.d.ts.map +1 -1
  635. package/dist/sync/shared-memory-completion.js +13 -0
  636. package/dist/sync/shared-memory-completion.js.map +1 -1
  637. package/dist/sync/system-context-graph-policy.d.ts +10 -0
  638. package/dist/sync/system-context-graph-policy.d.ts.map +1 -1
  639. package/dist/sync/system-context-graph-policy.js +11 -0
  640. package/dist/sync/system-context-graph-policy.js.map +1 -1
  641. package/dist/sync/wire-compression.d.ts +47 -0
  642. package/dist/sync/wire-compression.d.ts.map +1 -0
  643. package/dist/sync/wire-compression.js +111 -0
  644. package/dist/sync/wire-compression.js.map +1 -0
  645. package/dist/unscoped-query-consistency.d.ts +12 -0
  646. package/dist/unscoped-query-consistency.d.ts.map +1 -1
  647. package/dist/unscoped-query-consistency.js +17 -1
  648. package/dist/unscoped-query-consistency.js.map +1 -1
  649. package/dist/vm-promotion-audit.d.ts +2 -2
  650. package/dist/vm-promotion-audit.d.ts.map +1 -1
  651. package/dist/vm-promotion-audit.js +26 -9
  652. package/dist/vm-promotion-audit.js.map +1 -1
  653. package/dist/vm-publish-snapshot-preflight.d.ts +13 -0
  654. package/dist/vm-publish-snapshot-preflight.d.ts.map +1 -0
  655. package/dist/vm-publish-snapshot-preflight.js +94 -0
  656. package/dist/vm-publish-snapshot-preflight.js.map +1 -0
  657. package/dist/vm-reconcile-dispatcher.d.ts +42 -1
  658. package/dist/vm-reconcile-dispatcher.d.ts.map +1 -1
  659. package/dist/vm-reconcile-dispatcher.js +103 -4
  660. package/dist/vm-reconcile-dispatcher.js.map +1 -1
  661. package/dist/vm-reconcile-peer-topology.d.ts +7 -9
  662. package/dist/vm-reconcile-peer-topology.d.ts.map +1 -1
  663. package/dist/vm-reconcile-peer-topology.js +1 -37
  664. package/dist/vm-reconcile-peer-topology.js.map +1 -1
  665. package/dist/vm-recovery-candidate-order.d.ts +16 -0
  666. package/dist/vm-recovery-candidate-order.d.ts.map +1 -0
  667. package/dist/vm-recovery-candidate-order.js +24 -0
  668. package/dist/vm-recovery-candidate-order.js.map +1 -0
  669. package/dist/vm-recovery-core-transport-preference.d.ts +69 -0
  670. package/dist/vm-recovery-core-transport-preference.d.ts.map +1 -0
  671. package/dist/vm-recovery-core-transport-preference.js +131 -0
  672. package/dist/vm-recovery-core-transport-preference.js.map +1 -0
  673. package/dist/vm-recovery-experiment-policy.d.ts +24 -0
  674. package/dist/vm-recovery-experiment-policy.d.ts.map +1 -0
  675. package/dist/vm-recovery-experiment-policy.js +18 -0
  676. package/dist/vm-recovery-experiment-policy.js.map +1 -0
  677. package/dist/vm-recovery-footprint.d.ts +54 -0
  678. package/dist/vm-recovery-footprint.d.ts.map +1 -1
  679. package/dist/vm-recovery-footprint.js +88 -24
  680. package/dist/vm-recovery-footprint.js.map +1 -1
  681. package/dist/vm-recovery-microbatch.d.ts +2 -0
  682. package/dist/vm-recovery-microbatch.d.ts.map +1 -1
  683. package/dist/vm-recovery-microbatch.js +7 -3
  684. package/dist/vm-recovery-microbatch.js.map +1 -1
  685. package/dist/vm-recovery-pass-authority.d.ts +84 -0
  686. package/dist/vm-recovery-pass-authority.d.ts.map +1 -0
  687. package/dist/vm-recovery-pass-authority.js +126 -0
  688. package/dist/vm-recovery-pass-authority.js.map +1 -0
  689. package/dist/vm-recovery-phase-timing.d.ts +75 -0
  690. package/dist/vm-recovery-phase-timing.d.ts.map +1 -0
  691. package/dist/vm-recovery-phase-timing.js +236 -0
  692. package/dist/vm-recovery-phase-timing.js.map +1 -0
  693. package/dist/vm-recovery-preparation.d.ts +143 -0
  694. package/dist/vm-recovery-preparation.d.ts.map +1 -0
  695. package/dist/vm-recovery-preparation.js +433 -0
  696. package/dist/vm-recovery-preparation.js.map +1 -0
  697. package/dist/vm-recovery-provider-policy.d.ts +13 -1
  698. package/dist/vm-recovery-provider-policy.d.ts.map +1 -1
  699. package/dist/vm-recovery-provider-policy.js +37 -5
  700. package/dist/vm-recovery-provider-policy.js.map +1 -1
  701. package/dist/vm-recovery-stream-profile.d.ts +15 -0
  702. package/dist/vm-recovery-stream-profile.d.ts.map +1 -0
  703. package/dist/vm-recovery-stream-profile.js +53 -0
  704. package/dist/vm-recovery-stream-profile.js.map +1 -0
  705. package/dist/vm-recovery-stream-setback-policy.d.ts +54 -0
  706. package/dist/vm-recovery-stream-setback-policy.d.ts.map +1 -0
  707. package/dist/vm-recovery-stream-setback-policy.js +85 -0
  708. package/dist/vm-recovery-stream-setback-policy.js.map +1 -0
  709. package/dist/vm-recovery-timing-observer.d.ts +27 -0
  710. package/dist/vm-recovery-timing-observer.d.ts.map +1 -0
  711. package/dist/vm-recovery-timing-observer.js +49 -0
  712. package/dist/vm-recovery-timing-observer.js.map +1 -0
  713. package/dist/vm-recovery-transport-budget-policy.d.ts +32 -0
  714. package/dist/vm-recovery-transport-budget-policy.d.ts.map +1 -0
  715. package/dist/vm-recovery-transport-budget-policy.js +55 -0
  716. package/dist/vm-recovery-transport-budget-policy.js.map +1 -0
  717. package/dist/vm-recovery-transport-plan.d.ts +83 -0
  718. package/dist/vm-recovery-transport-plan.d.ts.map +1 -0
  719. package/dist/vm-recovery-transport-plan.js +117 -0
  720. package/dist/vm-recovery-transport-plan.js.map +1 -0
  721. package/dist/vm-refresh.d.ts +138 -0
  722. package/dist/vm-refresh.d.ts.map +1 -0
  723. package/dist/vm-refresh.js +201 -0
  724. package/dist/vm-refresh.js.map +1 -0
  725. package/package.json +19 -9
  726. package/dist/finalization-annotations.d.ts +0 -5
  727. package/dist/finalization-annotations.d.ts.map +0 -1
  728. package/dist/finalization-annotations.js +0 -6
  729. package/dist/finalization-annotations.js.map +0 -1
  730. package/dist/swm-ka-bound.d.ts +0 -21
  731. package/dist/swm-ka-bound.d.ts.map +0 -1
  732. package/dist/swm-ka-bound.js +0 -36
  733. package/dist/swm-ka-bound.js.map +0 -1
@@ -7,111 +7,34 @@
7
7
  * register/batch/identity entrypoints. Bodies are a 1:1 move; methods take
8
8
  * `this: DKGAgent` so cross-calls resolve against the composed class.
9
9
  */
10
- import { createHash, randomUUID } from 'node:crypto';
11
- import { PROTOCOL_SWM_UPDATE, contextGraphPublishTopic, contextGraphWorkspaceTopic, contextGraphUpdateTopic, contextGraphFinalizationTopic, contextGraphDataGraphUri, contextGraphMetaGraphUri, contextGraphWorkspaceMetaGraphUri, contextGraphSharedMemoryUri, contextGraphDataUri, contextGraphMetaUri, assertionLifecycleUri, contextGraphAssertionUri, contextGraphCatalogUri, contextGraphLayerUri, MemoryLayer, encodeKAUpdateRequest, encodeGossipEnvelope, GOSSIP_ENVELOPE_VERSION, encodeFinalizationMessage, SYSTEM_CONTEXT_GRAPHS, DKG_ONTOLOGY, createOperationContext, escapeSparqlLiteral, isSafeIri, assertSafeIri, isTrustLevelQuad, buildAuthorAttestationTypedData, buildUpdateAuthorAttestationTypedData, AUTHOR_SCHEME_VERSION_V1, buildAssertionSealQuads, buildAssertionPublishReceiptQuads, parseAssertionSealQuads, ASSERTION_SEAL_PREDICATES, GRAPH_KA_CONTENT_SCOPE_VERSION, LegacyKnowledgeAssetReadOnlyError, createGraphKnowledgeAssetScope, knowledgeAssetLayerGraphUri, computeSwmSenderKeyMembershipHash, encryptV10PublishPayload, encryptChunked, buildCiphertextChunksRoot, computeGossipSigningPayloadV2, GOSSIP_TYPE_WORKSPACE_PUBLISH_CHUNKED, ciphertextChunkStoreGraph, ciphertextChunkStoreSubject, CIPHERTEXT_CHUNK_PREDICATE, withSpan, getMetrics, assertQuadLiteralsMutf8Safe, PUBLISH_AUTHOR_NOT_CUSTODIAL_CODE, PUBLISH_AUTHOR_SELECTION_CONFLICT_CODE, formatPublishAuthorNotCustodialMessage, } from '@origintrail-official/dkg-core';
10
+ import { planKnowledgeAssetVmPublication, isGraphScopedKnowledgeAssetVmPublishRequest, assertionSealFromQueuedKnowledgeAssetVmPublishRequest, createKnowledgeAssetVmPublishIntentKey } from './internal/knowledge-asset-vm-publish-request.js';
11
+ export { createKnowledgeAssetVmPublishIntentKey } from './internal/knowledge-asset-vm-publish-request.js';
12
+ import { randomUUID } from 'node:crypto';
13
+ import { preflightKnowledgeAssetVmPublishSnapshot } from './vm-publish-snapshot-preflight.js';
14
+ import { PROTOCOL_SWM_UPDATE, contextGraphPublishTopic, contextGraphWorkspaceTopic, contextGraphUpdateTopic, contextGraphFinalizationTopic, contextGraphDataGraphUri, contextGraphMetaGraphUri, contextGraphSharedMemoryUri, contextGraphDataUri, contextGraphMetaUri, assertionLifecycleUri, contextGraphAssertionUri, contextGraphCatalogUri, contextGraphLayerUri, MemoryLayer, encodeKAUpdateRequest, encodeGossipEnvelope, GOSSIP_ENVELOPE_VERSION, encodeFinalizationMessage, SYSTEM_CONTEXT_GRAPHS, DKG_ONTOLOGY, createOperationContext, escapeSparqlLiteral, assertSafeIri, isTrustLevelQuad, buildAuthorAttestationTypedData, buildUpdateAuthorAttestationTypedData, AUTHOR_SCHEME_VERSION_V1, buildAssertionSealQuads, buildAssertionPublishReceiptQuads, parseAssertionSealQuads, ASSERTION_SEAL_PREDICATES, GRAPH_KA_CONTENT_SCOPE_VERSION, LegacyKnowledgeAssetReadOnlyError, createGraphKnowledgeAssetScope, knowledgeAssetLayerGraphUri, computeSwmSenderKeyMembershipHash, encryptV10PublishPayload, encryptChunked, buildCiphertextChunksRoot, computeGossipSigningPayloadV2, GOSSIP_TYPE_WORKSPACE_PUBLISH_CHUNKED, ciphertextChunkStoreGraph, ciphertextChunkStoreSubject, CIPHERTEXT_CHUNK_PREDICATE, withSpan, getMetrics, assertQuadLiteralsMutf8Safe, PUBLISH_AUTHOR_NOT_CUSTODIAL_CODE, PUBLISH_AUTHOR_SELECTION_CONFLICT_CODE, formatPublishAuthorNotCustodialMessage, } from '@origintrail-official/dkg-core';
12
15
  import { SpanStatusCode } from '@opentelemetry/api';
13
- import { deleteByPatternWithoutCount, GraphManager, PrivateContentStore, loadSharedMemoryQuadsForScope, canonicalSharedMemoryScopeWriteGraph, } from '@origintrail-official/dkg-storage';
14
- import { computeFlatKCRootV10 as computeFlatKCRoot, computePrivateRootV10 as computePrivateRoot, skolemizeKnowledgeAssetParts, assertNoKnowledgeAssetPayloadNamedGraphs, assertValidPrecomputedUpdateAttestation, isReservedSubject, canonicalPublishPayload, generatedPrivateCatalogTripleKeys, appendMissingGeneratedPrivateCatalogFloor, createKnowledgeAssetVmPublishSnapshotMetadata, createKnowledgeAssetVmPublishSnapshotRequest, resolveLiftWorkspaceSlice, resolveKnowledgeAssetOperationPublicQuads, resolveKnowledgeAssetWorkspaceHead, workspaceHeadIncludesShareOperationId, KnowledgeAssetOperationPublicSnapshotNotFoundError, workspacePublicQuadsDigest, validateLiftPublishPayload, TripleStoreAsyncLiftPublisher,
15
- // OT-RFC-43 A2 — per-layer pointer + KA-id predicates and stamp helpers.
16
- KA_ID_PRED, RESERVED_UAL_PRED, WM_CURRENT_ASSERTION_PRED, SWM_CURRENT_ASSERTION_PRED, VM_CURRENT_ASSERTION_PRED, createResolveCurrentWorkspaceGossipPayload, parseEncodedWorkspaceGossipPayload, assertPublicationPricingPolicyApplicable, } from '@origintrail-official/dkg-publisher';
16
+ import { deleteByPatternWithoutCount, GraphManager, PrivateContentStore, loadSharedMemoryQuadsForScope, } from '@origintrail-official/dkg-storage';
17
+ import { computeFlatKCRootV10 as computeFlatKCRoot, computePrivateRootV10 as computePrivateRoot, skolemizeKnowledgeAssetParts, assertNoKnowledgeAssetPayloadNamedGraphs, assertValidPrecomputedUpdateAttestation, isReservedSubject, canonicalPublishPayload, generatedPrivateCatalogTripleKeys, resolveKnowledgeAssetOperationPublicQuads, resolveKnowledgeAssetWorkspaceHead, workspaceHeadIncludesShareOperationId, KnowledgeAssetOperationPublicSnapshotNotFoundError, workspacePublicQuadsDigest, TripleStoreAsyncLiftPublisher, KA_ID_PRED, RESERVED_UAL_PRED, WM_CURRENT_ASSERTION_PRED, SWM_CURRENT_ASSERTION_PRED, VM_CURRENT_ASSERTION_PRED, createResolveCurrentWorkspaceGossipPayload, parseEncodedWorkspaceGossipPayload, } from '@origintrail-official/dkg-publisher';
17
18
  import { pickPublishLifecycleHooks } from '@origintrail-official/dkg-publisher';
18
19
  import { ethers } from 'ethers';
19
20
  import { buildAuthoritativePublicMetaQuads } from './context-graph-public-meta-proof.js';
20
21
  import { resolveFinalizedAssertionAuthor } from './finalized-assertion-author.js';
21
- import { RootlessUpdateError } from './rootless-update-error.js';
22
+ import { RootlessUpdateError, isRootlessUpdateError } from './rootless-update-error.js';
22
23
  import { emitPublicProjection, buildPublicProjection } from './context-graph-public-projection.js';
23
24
  import { chooseFanOutTier, executeSubstrateFanOut, classifySendResult, } from './swm/substrate-fanout.js';
24
25
  import { classifySwmFanoutPeerOutcome, } from './swm/swm-fanout-peer-selection.js';
25
- import { KEEP_ROOT_COPY_PREDICATE } from './finalization-handler.js';
26
26
  import { applyPublishedNamedKaVmLifecycle } from './named-ka-vm-lifecycle.js';
27
+ import { packKnowledgeAssetIdFromIdentity } from './ka-identity.js';
27
28
  import { normalizeRecoveredNamedKaPublish, throwIfRecoveryDeadlineReached, } from './named-ka-publish-recovery.js';
28
29
  import { stripLiteral, jsonLdToQuads, } from './dkg-agent-utils.js';
29
30
  import { PRIVATE_DATA_ANCHOR, } from './dkg-agent-constants.js';
30
31
  import { ContextGraphNotFoundError, InvalidContentError, } from './dkg-agent-types.js';
31
32
  import { normalizePublishContextGraphId, isPublishAsyncQuadEnvelope, assertQuadArray, sliceIntoCiphertextChunks, } from './dkg-agent-helpers.js';
32
33
  import { readMaxKaNumberWithRetry, isTransientChainError } from './allocator.js';
33
- import { swmSenderStateKey, } from './dkg-agent-swm-state.js';
34
+ import { computeSwmSenderKeyRecipientRouteHash, swmSenderStateKey, } from './dkg-agent-swm-state.js';
34
35
  import { DKGAgentBase } from './dkg-agent-base.js';
35
36
  import { CONTEXT_GRAPH_AUTHORITY_RPC_SITES as CG_AUTH_RPC_SITES, withRpcUsageSite, } from '@origintrail-official/dkg-chain';
36
37
  import { createLocalContextGraphOriginMembershipRecord } from './local-context-graph-provenance.js';
37
- /** One operation discriminator shared by admission, sync, and queued execution. */
38
- function planKnowledgeAssetVmPublication(input) {
39
- if (input.vmCurrentAssertion) {
40
- assertPublicationPricingPolicyApplicable(input.pricingPolicy, { kind: 'update' });
41
- return { kind: 'update', vmCurrentAssertion: input.vmCurrentAssertion };
42
- }
43
- assertPublicationPricingPolicyApplicable(input.pricingPolicy, {
44
- kind: 'initial',
45
- graphScoped: true,
46
- });
47
- return { kind: 'initial', pricingPolicy: input.pricingPolicy };
48
- }
49
- /** Rebuild the immutable graph-scoped seal carried by one queued VM request. */
50
- function assertionSealFromQueuedKnowledgeAssetVmPublishRequest(request) {
51
- // Both execution boundaries validate the immutable graph-scoped envelope
52
- // before calling this shared reconstruction helper.
53
- const graphScope = createGraphKnowledgeAssetScope(request.kaUal, request.assertionVersion);
54
- return {
55
- merkleRoot: ethers.getBytes(request.seal.merkleRoot),
56
- authorAddress: ethers.getAddress(request.seal.authorAddress),
57
- authorAttestationR: ethers.getBytes(request.seal.signature.r),
58
- authorAttestationVS: ethers.getBytes(request.seal.signature.vs),
59
- authorSchemeVersion: request.seal.schemeVersion,
60
- chainId: BigInt(request.sealChainId),
61
- kav10Address: ethers.getAddress(request.sealKav10Address),
62
- finalizedAtIso: request.sealFinalizedAtIso,
63
- contentScopeVersion: GRAPH_KA_CONTENT_SCOPE_VERSION,
64
- kaUal: graphScope.ual,
65
- assertionVersion: graphScope.assertionVersion,
66
- publicTripleCount: request.publicTripleCount,
67
- ...(request.privateMerkleRoot
68
- ? { privateMerkleRoot: ethers.getBytes(request.privateMerkleRoot) }
69
- : {}),
70
- privateTripleCount: request.privateTripleCount,
71
- rootEntities: [],
72
- ...(request.seal.reservedKaId !== undefined
73
- ? { reservedKaId: BigInt(request.seal.reservedKaId) }
74
- : {}),
75
- };
76
- }
77
- /** Canonical immutable projection of the persisted queued-publish request. */
78
- export function createKnowledgeAssetVmPublishIntentKey(request) {
79
- const canonicalIntent = {
80
- contextGraphId: request.contextGraphId,
81
- name: request.name,
82
- agentAddress: request.agentAddress ?? null,
83
- subGraphName: request.subGraphName ?? null,
84
- shareOperationId: request.shareOperationId,
85
- roots: request.roots,
86
- contentScopeVersion: request.contentScopeVersion ?? null,
87
- kaUal: request.kaUal ?? null,
88
- assertionVersion: request.assertionVersion ?? null,
89
- publicTripleCount: request.publicTripleCount ?? null,
90
- privateMerkleRoot: request.privateMerkleRoot?.toLowerCase() ?? null,
91
- privateTripleCount: request.privateTripleCount ?? null,
92
- accessPolicy: request.accessPolicy ?? null,
93
- allowedPeers: request.allowedPeers ?? [],
94
- entityProofs: request.entityProofs ?? null,
95
- sealMerkleRoot: request.sealMerkleRoot.toLowerCase(),
96
- seal: request.seal,
97
- sealChainId: request.sealChainId,
98
- sealKav10Address: request.sealKav10Address,
99
- sealFinalizedAtIso: request.sealFinalizedAtIso,
100
- wmCurrentAssertion: request.wmCurrentAssertion ?? null,
101
- swmCurrentAssertion: request.swmCurrentAssertion ?? null,
102
- vmCurrentAssertion: request.vmCurrentAssertion ?? null,
103
- kaNumber: request.kaNumber ?? null,
104
- reservedUal: request.reservedUal ?? null,
105
- publishEpochs: request.publishEpochs ?? null,
106
- // Keep the pre-feature canonical JSON unchanged when the policy is omitted.
107
- ...(request.pricingPolicy !== undefined
108
- ? { pricingPolicy: request.pricingPolicy }
109
- : {}),
110
- clearSharedMemoryAfter: request.clearSharedMemoryAfter ?? null,
111
- publisherNodeIdentityIdOverride: request.publisherNodeIdentityIdOverride ?? null,
112
- };
113
- return `sha256:${createHash('sha256').update(JSON.stringify(canonicalIntent)).digest('hex')}`;
114
- }
115
38
  /**
116
39
  * #1116 (round 11) — stable code tagged on the `assertionFinalize` throws that are
117
40
  * recoverable SIGNING/CHAIN CAPABILITY GAPS (no local signing key, non-V10 chain
@@ -155,6 +78,24 @@ function updateAttestationNotCustodialError(authorAddress) {
155
78
  function rootlessUpdateError(code, message) {
156
79
  return new RootlessUpdateError(code, message);
157
80
  }
81
+ /**
82
+ * GH#2958 — a finalized update numbered anything but `confirmed + 1` can never be published: the
83
+ * publisher, the StorageACK handler, peers and the chain all require exactly that number. Coded
84
+ * `PUBLISH_INTENT_STALE` (the draft no longer matches what can be published) so the async lane
85
+ * records a terminal pre-send failure instead of the retryable `rpc_unavailable` an untyped
86
+ * error falls into, and both publish routes answer 409. The recovery depends on which way the
87
+ * number is off: a draft numbered too high keeps its shared content, a draft numbered too low
88
+ * means the published version moved on, so it is re-based on that.
89
+ */
90
+ function versionGapError(kaUal, sealVersion, requiredVersion) {
91
+ const sealed = BigInt(sealVersion);
92
+ const recovery = sealed > requiredVersion
93
+ ? 'Re-open the draft with wm/pull-from (layer "swm" keeps the shared content), then finalize and share it again.'
94
+ : 'The published version has moved on since this draft was finalized: re-base it with wm/pull-from '
95
+ + '(layer "vm"), re-apply your edits, then finalize and share it again.';
96
+ return Object.assign(new Error(`Cannot publish the update of ${kaUal}: this finalized version is numbered ${sealed}, but the next `
97
+ + `publishable version is ${requiredVersion} (the confirmed version is ${requiredVersion - 1n}). ${recovery}`), { code: 'PUBLISH_INTENT_STALE' });
98
+ }
158
99
  function latestShareOperationId(history) {
159
100
  const promoted = [...history.events]
160
101
  .reverse()
@@ -986,14 +927,25 @@ export class PublishMethods extends DKGAgentBase {
986
927
  if (!opts?.localOnly && promoted.gossipPayload) {
987
928
  await this.publishWorkspaceGossip(contextGraphId, promoted.gossipPayload, ctx, gossipSigner, promoted.shareOperationId);
988
929
  }
989
- await this.afterDurableSwmPromotionV1({
990
- contextGraphId,
991
- subGraphName: opts?.subGraphName,
992
- assertionCoordinate: assertionName,
993
- lifecycleAgentAddress,
994
- shareOperationId: promoted.shareOperationId,
995
- ctx,
996
- });
930
+ try {
931
+ await this.afterDurableSwmPromotionV1({
932
+ contextGraphId,
933
+ subGraphName: opts?.subGraphName,
934
+ assertionCoordinate: assertionName,
935
+ lifecycleAgentAddress,
936
+ shareOperationId: promoted.shareOperationId,
937
+ ctx,
938
+ });
939
+ }
940
+ catch {
941
+ // Deliberately best-effort here (the stamp already logged its cause).
942
+ // This entry point mints a fresh `async-<uuid>` assertion per call, so
943
+ // surfacing the error would hand the caller a failure for a name it
944
+ // cannot replay, inviting a re-publish under a NEW identity. The VM
945
+ // publish queued below stamps `vmCurrentAssertion`, and an absent swm
946
+ // pointer is then the valid divergence-only shape (swm == vm).
947
+ // Named-KA shares (`assertion.promote`) do surface and replay the failure.
948
+ }
997
949
  const intent = await this.resolveFinalizedAssertionVmPublishIntent(contextGraphId, assertionName, {
998
950
  agentAddress: lifecycleAgentAddress,
999
951
  subGraphName: opts?.subGraphName,
@@ -1350,8 +1302,7 @@ export class PublishMethods extends DKGAgentBase {
1350
1302
  }
1351
1303
  if (opts.assertionVersion !== undefined
1352
1304
  && BigInt(opts.assertionVersion) !== BigInt(nextAssertionVersion)) {
1353
- throw new Error(`Graph-scoped update assertionVersion ${String(opts.assertionVersion)} must advance ` +
1354
- `the durable current version to ${nextAssertionVersion}`);
1305
+ throw versionGapError(updateScope.ual, opts.assertionVersion, BigInt(nextAssertionVersion));
1355
1306
  }
1356
1307
  if (opts.publicTripleCount !== undefined
1357
1308
  && opts.publicTripleCount !== canonicalParts.publicQuads.length) {
@@ -1505,7 +1456,10 @@ export class PublishMethods extends DKGAgentBase {
1505
1456
  const result = await publisher.updateKnowledgeAssetFromStagedSharedWorkingMemoryV1(kaId, publisherUpdateOptions);
1506
1457
  this.log.info(ctx, `Update complete — status=${result.status}`);
1507
1458
  onPhase?.('broadcast', 'start');
1508
- if (result.onChainResult && result.publicQuads) {
1459
+ // Members of a curated graph pick up an update from the chain update
1460
+ // event, which refreshes their Verifiable Memory from the curator. The
1461
+ // graph's update topic carries public updates only.
1462
+ if (result.onChainResult && result.publicQuads && !isCuratedUpdate) {
1509
1463
  try {
1510
1464
  const dataGraph = knowledgeAssetLayerGraphUri(contextGraphId, MemoryLayer.VerifiableMemory, updateScope, opts?.subGraphName);
1511
1465
  const nquadsStr = result.publicQuads
@@ -2238,6 +2192,18 @@ export class PublishMethods extends DKGAgentBase {
2238
2192
  `KaNumberAllocator on the agent (daemon lifecycle) or supply a ` +
2239
2193
  `preSignedAuthorAttestation whose reservedKaId lives in the author's namespace.`), { code: SEAL_CAPABILITY_GAP_CODE });
2240
2194
  }
2195
+ // GH#2958 — a draft of a PUBLISHED KA is numbered from the confirmed record `update()` will
2196
+ // validate, not from the lifecycle counter. That counter is "last FINALIZED": it only ever
2197
+ // grows, so every finalized update that is abandoned before it is published (superseded,
2198
+ // discarded, replaced by pull-from) would push the next draft one number too high, past
2199
+ // what `update()`, the publisher and the chain accept, and the KA could never be updated
2200
+ // again. An abandoned draft instead shares its number with its successor, as an
2201
+ // unpublished mint already does. The lifecycle counter above stays the fallback for a
2202
+ // record that cannot answer. The number is not signed (the attestation binds merkleRoot,
2203
+ // author, reservedKaId and scheme), so deriving it here changes no signature.
2204
+ if (hasConfirmedVm) {
2205
+ assertionVersion = await this._nextUpdateVersionOrUndefined(reservedKaId, contextGraphId, opts?.subGraphName) ?? assertionVersion;
2206
+ }
2241
2207
  // 8. Build EIP-712 typed data (binds reservedKaId — OT-RFC-43 §F2).
2242
2208
  const typedData = buildAuthorAttestationTypedData({
2243
2209
  chainId,
@@ -2748,12 +2714,21 @@ export class PublishMethods extends DKGAgentBase {
2748
2714
  recipientKeyId: r.recipientKeyId,
2749
2715
  })),
2750
2716
  });
2717
+ const recipientRouteHash = computeSwmSenderKeyRecipientRouteHash({
2718
+ contextGraphId,
2719
+ subGraphName,
2720
+ recipients: resolution.recipients,
2721
+ });
2751
2722
  const stateKey = swmSenderStateKey(contextGraphId, subGraphName, senderAddress);
2752
2723
  let state = this.swmSenderKeySendStates.get(stateKey);
2753
- if (!state || state.membershipHash !== membershipHash) {
2724
+ if (!state
2725
+ || state.membershipHash !== membershipHash
2726
+ || state.recipientRouteHash !== recipientRouteHash) {
2754
2727
  const reason = !state
2755
2728
  ? 'no persisted state'
2756
- : `membership changed (was=${state.membershipHash} now=${membershipHash})`;
2729
+ : state.membershipHash !== membershipHash
2730
+ ? `membership changed (was=${state.membershipHash} now=${membershipHash})`
2731
+ : `recipient routes changed (was=${state.recipientRouteHash ?? 'legacy-untracked'} now=${recipientRouteHash})`;
2757
2732
  this.log.info(ctx, `${logPrefix}: bootstrapping/rotating swm-sender-key epoch for curated CG ${contextGraphId} ` +
2758
2733
  `(sender=${senderAddress}, recipients=${resolution.recipients.length}, reason=${reason})`);
2759
2734
  const pruned = this.prunePendingSenderKeysForEpochRotation({
@@ -2778,7 +2753,12 @@ export class PublishMethods extends DKGAgentBase {
2778
2753
  await this.saveSwmSenderKeyState();
2779
2754
  }
2780
2755
  else {
2781
- await this.drainPendingSenderKeyForRecipients(resolution.recipients, ctx);
2756
+ await this.drainPendingSenderKeyForRecipients(resolution.recipients, ctx, {
2757
+ contextGraphId,
2758
+ subGraphName,
2759
+ senderAgentAddress: state.senderAgentAddress,
2760
+ epochId: state.epochId,
2761
+ });
2782
2762
  }
2783
2763
  return {
2784
2764
  chainKey: state.chainKey,
@@ -3202,6 +3182,17 @@ export class PublishMethods extends DKGAgentBase {
3202
3182
  throw Object.assign(new Error(`Cannot publish "${name}" asynchronously: the current SWM share has no sealed assertion pointer. ` +
3203
3183
  `Finalize and share the full asset before publishing.`), { code: 'PUBLISH_INTENT_STALE' });
3204
3184
  }
3185
+ if (operationPlan.kind === 'update') {
3186
+ // GH#2958 — refuse a finalized update `update()` is going to refuse, here, before a job
3187
+ // exists, so the client learns it at the moment it can act. Last, so every recovery this
3188
+ // error recommends (re-open from the shared copy) is possible whenever it is raised. A
3189
+ // confirmed record that cannot answer leaves the decision to `update()`.
3190
+ const sealScope = createGraphKnowledgeAssetScope(seal.kaUal, seal.assertionVersion);
3191
+ const requiredVersion = await this._nextUpdateVersionOrUndefined(packKnowledgeAssetIdFromIdentity(sealScope), contextGraphId, opts?.subGraphName);
3192
+ if (requiredVersion !== undefined && requiredVersion !== BigInt(seal.assertionVersion)) {
3193
+ throw versionGapError(seal.kaUal, seal.assertionVersion, requiredVersion);
3194
+ }
3195
+ }
3205
3196
  const sealMerkleRoot = (merkleBare.startsWith('0x') ? merkleBare : `0x${merkleBare}`);
3206
3197
  const queuedSeal = {
3207
3198
  merkleRoot: ethers.hexlify(seal.merkleRoot),
@@ -3261,43 +3252,32 @@ export class PublishMethods extends DKGAgentBase {
3261
3252
  intentKey: createKnowledgeAssetVmPublishIntentKey(request),
3262
3253
  };
3263
3254
  }
3264
- async preflightKnowledgeAssetVmPublishSnapshot(request) {
3265
- const snapshot = createKnowledgeAssetVmPublishSnapshotRequest(request);
3266
- const snapshotMetadata = createKnowledgeAssetVmPublishSnapshotMetadata(request);
3255
+ /**
3256
+ * GH#2958 — the version a finalized update of this KA must carry, read from the SAME confirmed
3257
+ * record `update()` validates, so the number a draft is sealed with and the number `update()`
3258
+ * demands cannot disagree. `undefined` when that record cannot answer (not materialized here,
3259
+ * not confirmed yet, corrupt or legacy): the caller then falls back to its own rule. Anything
3260
+ * else (a store failure) propagates - a transient read error must never silently pick a number.
3261
+ */
3262
+ async _nextUpdateVersionOrUndefined(kaId, contextGraphId, subGraphName) {
3267
3263
  try {
3268
- const resolved = await resolveLiftWorkspaceSlice({
3269
- store: this.store,
3270
- graphManager: new GraphManager(this.store),
3271
- request: snapshot,
3272
- publicSnapshotStore: this.publicSnapshotStore,
3273
- });
3274
- validateLiftPublishPayload({
3275
- request: snapshot,
3276
- metadata: snapshotMetadata,
3277
- resolved,
3278
- });
3279
- if (resolved.quads.length === 0 && (resolved.privateQuads ?? []).length === 0) {
3280
- throw new Error(`No queued shared-memory snapshot quads for context graph ${request.contextGraphId} ` +
3281
- `share operation ${request.shareOperationId}`);
3282
- }
3264
+ const scope = await resolveDirectRootlessUpdateScope(this, this.chain.chainId, kaId, contextGraphId, subGraphName);
3265
+ return BigInt(scope.assertionVersion);
3283
3266
  }
3284
3267
  catch (err) {
3285
- if (err instanceof LegacyKnowledgeAssetReadOnlyError)
3268
+ if (!isRootlessUpdateError(err) && !(err instanceof LegacyKnowledgeAssetReadOnlyError))
3286
3269
  throw err;
3287
- const wrapped = new Error(`Cannot enqueue VM publish for "${request.name}" because share snapshot ` +
3288
- `${request.shareOperationId} is unavailable or stale. Re-share the knowledge asset before enqueueing: ` +
3289
- (err instanceof Error ? err.message : String(err)));
3290
- wrapped.code = 'PUBLISH_INTENT_STALE';
3291
- throw wrapped;
3270
+ this.log.debug(createOperationContext('publish'), `The confirmed record of KA ${kaId} cannot number its next update (${err.code}); using the lifecycle counter`);
3271
+ return undefined;
3292
3272
  }
3293
3273
  }
3274
+ async preflightKnowledgeAssetVmPublishSnapshot(request) {
3275
+ return preflightKnowledgeAssetVmPublishSnapshot({
3276
+ store: this.store, publicSnapshotStore: this.publicSnapshotStore, log: this.log, request,
3277
+ });
3278
+ }
3294
3279
  async preflightQueuedKnowledgeAssetVmPublishExecution(request, opts) {
3295
- if (request.contentScopeVersion !== GRAPH_KA_CONTENT_SCOPE_VERSION
3296
- || request.kaUal === undefined
3297
- || request.assertionVersion === undefined
3298
- || request.publicTripleCount === undefined
3299
- || request.privateTripleCount === undefined
3300
- || request.roots.length !== 0) {
3280
+ if (!isGraphScopedKnowledgeAssetVmPublishRequest(request)) {
3301
3281
  throw new LegacyKnowledgeAssetReadOnlyError();
3302
3282
  }
3303
3283
  createGraphKnowledgeAssetScope(request.kaUal, request.assertionVersion);
@@ -3380,10 +3360,10 @@ export class PublishMethods extends DKGAgentBase {
3380
3360
  throw stale(`Knowledge asset VM publish intent for "${request.name}" changed after enqueue: ` +
3381
3361
  'the immutable SWM access envelope no longer matches the queued request.');
3382
3362
  }
3383
- // `_stampSwmPointer` is explicitly a best-effort post-commit projection.
3384
- // A managed-store restart can therefore leave this optional lifecycle row
3385
- // absent even though the complete-share marker and immutable graph-scoped
3386
- // head both committed. Absence alone is not proof that the queued content
3363
+ // The swm pointer is a divergence-only projection, and `publishAsync`
3364
+ // keeps its stamp best-effort. The lifecycle row can therefore be absent
3365
+ // even though the complete-share marker and immutable graph-scoped head
3366
+ // both committed. Absence alone is not proof that the queued content
3387
3367
  // changed: the exact operation id, assertion version, access envelope and
3388
3368
  // queued WM root above are the durable authority. A present-but-different
3389
3369
  // SWM pointer remains terminally stale via the comparison above.
@@ -3484,12 +3464,7 @@ export class PublishMethods extends DKGAgentBase {
3484
3464
  }
3485
3465
  async _finalizeRecoveredQueuedKnowledgeAssetVmPublish(input, ctx) {
3486
3466
  const { request, job, lookup, recovery, signal } = input;
3487
- if (request.contentScopeVersion !== GRAPH_KA_CONTENT_SCOPE_VERSION
3488
- || request.kaUal === undefined
3489
- || request.assertionVersion === undefined
3490
- || request.publicTripleCount === undefined
3491
- || request.privateTripleCount === undefined
3492
- || request.roots.length !== 0) {
3467
+ if (!isGraphScopedKnowledgeAssetVmPublishRequest(request)) {
3493
3468
  throw new LegacyKnowledgeAssetReadOnlyError();
3494
3469
  }
3495
3470
  const recovered = await normalizeRecoveredNamedKaPublish({
@@ -3697,11 +3672,7 @@ export class PublishMethods extends DKGAgentBase {
3697
3672
  if (request.contentScopeVersion !== GRAPH_KA_CONTENT_SCOPE_VERSION) {
3698
3673
  throw new LegacyKnowledgeAssetReadOnlyError();
3699
3674
  }
3700
- if (request.roots.length !== 0
3701
- || request.kaUal === undefined
3702
- || request.assertionVersion === undefined
3703
- || request.publicTripleCount === undefined
3704
- || request.privateTripleCount === undefined) {
3675
+ if (!isGraphScopedKnowledgeAssetVmPublishRequest(request)) {
3705
3676
  throw new Error('Queued graph-scoped VM publish has an incomplete KA content envelope');
3706
3677
  }
3707
3678
  const graphScope = createGraphKnowledgeAssetScope(request.kaUal, request.assertionVersion);
@@ -3791,12 +3762,14 @@ export class PublishMethods extends DKGAgentBase {
3791
3762
  let result;
3792
3763
  const clearPublishedGraph = async (label) => {
3793
3764
  try {
3794
- await publisher.clearPublishedKnowledgeAssetSwm(request.contextGraphId, sharedMemoryScope, request.subGraphName, ctx, graphScope.ual);
3765
+ await publisher.clearPublishedKnowledgeAssetSwm(request.contextGraphId, sharedMemoryScope, request.subGraphName, ctx, graphScope.ual, graphScope.assertionVersion);
3795
3766
  }
3796
3767
  catch (err) {
3797
3768
  this.log.warn(ctx, `Failed to clear published SWM graph after confirmed queued ${label} of <${lifecycleUri}>: ` +
3798
3769
  (err instanceof Error ? err.message : String(err)));
3770
+ return;
3799
3771
  }
3772
+ await this.retireLegacySwmAfterConfirmedLocalPublish(request.contextGraphId, graphScope.ual, graphScope.assertionVersion, request.subGraphName, ctx);
3800
3773
  };
3801
3774
  const clearRemainingSharedMemory = async () => {
3802
3775
  try {
@@ -4022,29 +3995,6 @@ export class PublishMethods extends DKGAgentBase {
4022
3995
  catch {
4023
3996
  this.log.warn(ctx, `No peers subscribed to ${topic} yet`);
4024
3997
  }
4025
- try {
4026
- const gm = new GraphManager(this.store);
4027
- const wsMetaGraph = request.subGraphName
4028
- ? gm.sharedMemoryMetaUri(request.contextGraphId, request.subGraphName)
4029
- : contextGraphWorkspaceMetaGraphUri(request.contextGraphId);
4030
- const keepLiteral = `"${keepRootCopyOnLabel}"`;
4031
- for (const root of rootEntities.filter(isSafeIri)) {
4032
- await deleteByPatternWithoutCount(this.store, {
4033
- subject: root,
4034
- predicate: KEEP_ROOT_COPY_PREDICATE,
4035
- graph: wsMetaGraph,
4036
- });
4037
- await this.store.insert([{
4038
- subject: root,
4039
- predicate: KEEP_ROOT_COPY_PREDICATE,
4040
- object: keepLiteral,
4041
- graph: wsMetaGraph,
4042
- }]);
4043
- }
4044
- }
4045
- catch (err) {
4046
- this.log.warn(ctx, `Failed to persist keepRootCopyOnLabel signal for ${result.ual}: ${err instanceof Error ? err.message : String(err)}`);
4047
- }
4048
3998
  }
4049
3999
  if (result.status === 'confirmed') {
4050
4000
  try {
@@ -4261,7 +4211,8 @@ export class PublishMethods extends DKGAgentBase {
4261
4211
  // that mirrored the share), so SWM and VM permanently disagreed.
4262
4212
  if (result.status === 'confirmed') {
4263
4213
  try {
4264
- await publisher.clearPublishedKnowledgeAssetSwm(contextGraphId, sharedMemoryScope, opts?.subGraphName, opts?.operationCtx ?? createOperationContext('publishFromSWM'), graphScope.ual);
4214
+ await publisher.clearPublishedKnowledgeAssetSwm(contextGraphId, sharedMemoryScope, opts?.subGraphName, opts?.operationCtx ?? createOperationContext('publishFromSWM'), graphScope.ual, graphScope.assertionVersion);
4215
+ await this.retireLegacySwmAfterConfirmedLocalPublish(contextGraphId, graphScope.ual, graphScope.assertionVersion, opts?.subGraphName, opts?.operationCtx ?? createOperationContext('publishFromSWM'));
4265
4216
  }
4266
4217
  catch (err) {
4267
4218
  this.log.warn(opts?.operationCtx ?? createOperationContext('publishFromSWM'), `Failed to clear SWM after confirmed update of <${lifecycleUri}>: ` +
@@ -4527,6 +4478,21 @@ export class PublishMethods extends DKGAgentBase {
4527
4478
  return;
4528
4479
  await this.observeRfc64ConfirmedVmV1(input);
4529
4480
  }
4481
+ /** The local confirmed publisher has already written VM and drained this exact SWM root. */
4482
+ async retireLegacySwmAfterConfirmedLocalPublish(contextGraphId, kaUal, assertionVersion, subGraphName, ctx) {
4483
+ try {
4484
+ await this.retireLegacySwmAfterVerifiedVmTwin({
4485
+ contextGraphId,
4486
+ kaUal,
4487
+ assertionVersion,
4488
+ subGraphName,
4489
+ });
4490
+ }
4491
+ catch (err) {
4492
+ this.log.warn(ctx, `Failed to retire the legacy SWM boundary after confirmed local VM publish: ` +
4493
+ (err instanceof Error ? err.message : String(err)));
4494
+ }
4495
+ }
4530
4496
  /**
4531
4497
  * OT-RFC-43 A2 — mint a `precomputedUpdateAttestation` over
4532
4498
  * `UpdateAuthorAttestation(kaId, newMerkleRoot=seal.merkleRoot, author)` for
@@ -4641,10 +4607,16 @@ export class PublishMethods extends DKGAgentBase {
4641
4607
  * OT-RFC-43 A2 (decision 2) — stamp `dkg:swmCurrentAssertion` on the
4642
4608
  * lifecycle URN when an assertion is promoted/shared into SWM. The pointer
4643
4609
  * value is the assertion's sealed merkle root hex (read from the seal on the
4644
- * assertion-graph URI). Best-effort: a missing seal (a non-finalized
4645
- * promote) leaves the SWM pointer unset, which `deriveStatus` reads as "not
4646
- * yet wm-sealed for SWM". Never throws — the SWM share itself already
4647
- * committed.
4610
+ * assertion-graph URI). A missing seal (a non-finalized promote) leaves the
4611
+ * SWM pointer unset, which `deriveStatus` reads as "not yet wm-sealed for
4612
+ * SWM".
4613
+ *
4614
+ * A store failure is logged and RETHROWN. The SWM share already committed, so
4615
+ * the caller owns the classification: swallowing it here left a share that
4616
+ * reported success with a permanently missing root (GH#2901). The stamp is an
4617
+ * idempotent drop-then-set, so replaying the already-committed operation is
4618
+ * the repair. The drop and the set are two store calls: until that replay, a
4619
+ * failure between them leaves the committed share with no pointer.
4648
4620
  */
4649
4621
  async _stampSwmPointer(contextGraphId, name, agentAddress, subGraphName) {
4650
4622
  try {
@@ -4665,52 +4637,26 @@ export class PublishMethods extends DKGAgentBase {
4665
4637
  catch (err) {
4666
4638
  this.log.warn(createOperationContext('share'), `Failed to stamp swmCurrentAssertion for "${name}" in "${contextGraphId}": ` +
4667
4639
  (err instanceof Error ? err.message : String(err)));
4640
+ throw err;
4668
4641
  }
4669
4642
  }
4670
- /**
4671
- * OT-RFC-49 legacy compatibility — ensure a curated CG's public `_catalog`
4672
- * floor is in SWM for an arbitrary root-selected combined-model publish.
4673
- *
4674
- * New graph-scoped KAs never call this helper: they keep the catalog detached
4675
- * from WM/SWM and derive its proof material at the publisher boundary. This
4676
- * remains only for legacy selection-based publishes whose author seal and KC
4677
- * root intentionally use the historical combined model.
4678
- *
4679
- * IDEMPOTENT: repeated insertion dedupes in the store/V10 Merkle path because
4680
- * the floor is deterministic, so `catalogLeafCount` stays stable across
4681
- * repeated legacy selection publishes.
4682
- *
4683
- * Returns a possibly-extended `selection`: for a `{rootEntities}` publish the
4684
- * CG-DID catalog subject is appended so it is in scope for BOTH the author seal
4685
- * (`_loadSelectedSWMQuads`) and the publisher's reload — which scope identically.
4686
- * For `selection: 'all'` the selection is returned unchanged (both already read
4687
- * the whole SWM graph). The generated floor is written into the same explicit
4688
- * graph scope as the publish; otherwise an exact named-lifecycle read would
4689
- * correctly exclude a floor left in the legacy bucket.
4690
- */
4691
- async _ensureCuratedCatalogInSwm(contextGraphId, selection, subGraphName, ctx, scope = { kind: 'complete-family' }) {
4692
- const swmGraph = contextGraphSharedMemoryUri(contextGraphId, subGraphName);
4693
- const catalogTargetGraph = canonicalSharedMemoryScopeWriteGraph(swmGraph, scope);
4694
- const cgDid = contextGraphDataUri(contextGraphId);
4695
- const { quads: catalogQuads } = appendMissingGeneratedPrivateCatalogFloor(contextGraphId, [], catalogTargetGraph);
4696
- await this.store.insert(catalogQuads);
4697
- this.log.info(ctx, `OT-RFC-49: ensured ${catalogQuads.length}-quad public _catalog floor in SWM for curated CG ${contextGraphId} (from-SWM publish without finalize)`);
4698
- if (selection !== 'all' && !selection.rootEntities.includes(cgDid)) {
4699
- return { rootEntities: [...selection.rootEntities, cgDid] };
4700
- }
4701
- return selection;
4702
- }
4703
4643
  /**
4704
4644
  * Publish shared memory content: read from SWM graph and publish with full finality (data graph + chain).
4705
4645
  * After on-chain confirmation, broadcasts a lightweight FinalizationMessage so peers with matching
4706
4646
  * SWM state can promote it to canonical without re-downloading the full payload.
4707
4647
  *
4708
- * #1116 (round 9) — INTENTIONALLY NOT marker-gated. This is the
4709
- * "publish an arbitrary caller-selected SWM slice" internal escape hatch
4710
- * retained for substrate mechanics (#1087): it mints a FRESH inline seal over the
4711
- * selected slice rather than consuming a finalized named lifecycle, so the
4712
- * swmShareComplete full-share invariant does not apply. The marker gate lives on
4713
- * `publishFromFinalizedAssertion` (the named-lifecycle /vm/publish path) only.
4648
+ * The publish must be graph-scoped (`contentScopeVersion`, `kaUal`,
4649
+ * `assertionVersion`): a call without that scope is refused with
4650
+ * `LegacyKnowledgeAssetReadOnlyError`. `publishFromFinalizedAssertion`
4651
+ * supplies the scope from the finalized seal and is the entry point for
4652
+ * callers that hold a named assertion.
4653
+ *
4654
+ * #1116 (round 9) — INTENTIONALLY NOT marker-gated. This is the internal
4655
+ * substrate entry (#1087): without a precomputed seal it mints a FRESH inline
4656
+ * seal over the selected slice rather than consuming a finalized named
4657
+ * lifecycle, so the swmShareComplete full-share invariant does not apply. The
4658
+ * marker gate lives on `publishFromFinalizedAssertion` (the named-lifecycle
4659
+ * /vm/publish path) only.
4714
4660
  */
4715
4661
  async publishFromSharedMemory(contextGraphId, selection, options) {
4716
4662
  return withSpan('agent.publish_from_swm', async (span) => {
@@ -4725,6 +4671,16 @@ export class PublishMethods extends DKGAgentBase {
4725
4671
  ...(chainId ? { 'dkg.chain_id': chainId } : {}),
4726
4672
  });
4727
4673
  const ctx = options?.operationCtx ?? createOperationContext('publishFromSWM');
4674
+ // A publish names the Knowledge Asset's own graph. Root-entity Knowledge
4675
+ // Assets are read-only: peers finalize nothing else, and a Core keeps no
4676
+ // copy of such a publish that it could promote.
4677
+ if (options?.contentScopeVersion !== GRAPH_KA_CONTENT_SCOPE_VERSION) {
4678
+ const scopeVersion = options?.contentScopeVersion;
4679
+ if (scopeVersion === undefined || scopeVersion === 0 || scopeVersion === 1) {
4680
+ throw new LegacyKnowledgeAssetReadOnlyError();
4681
+ }
4682
+ throw new Error(`Unsupported KA content scope version ${scopeVersion}`);
4683
+ }
4728
4684
  const effectiveSubCG = options?.subContextGraphId ?? options?.contextGraphId;
4729
4685
  // `ctxGraphIdStr` doubles as `publishContextGraphId` for REMAP-flow
4730
4686
  // publishes — the publisher uses its presence as a signal to DELETE the
@@ -4733,17 +4689,6 @@ export class PublishMethods extends DKGAgentBase {
4733
4689
  const ctxGraphIdStr = effectiveSubCG != null ? String(effectiveSubCG) : undefined;
4734
4690
  const onChainId = ctxGraphIdStr ?? (await this.getContextGraphOnChainId(contextGraphId)) ?? undefined;
4735
4691
  const v10ACKProvider = this.createV10ACKProvider(contextGraphId);
4736
- // OT-RFC-49 catalog handling differs by content model. Legacy arbitrary
4737
- // SWM selections retain their combined-model floor injection. A V2 named
4738
- // lifecycle carries only the trusted floor capability: the publisher
4739
- // derives a detached catalog commitment without altering the exact KA
4740
- // graph or its author seal.
4741
- const graphScopedPublish = options?.contentScopeVersion === GRAPH_KA_CONTENT_SCOPE_VERSION;
4742
- let localTrustedNonManifestCatalogTriples;
4743
- if (!graphScopedPublish && onChainId != null && (await this.isPrivateContextGraph(contextGraphId))) {
4744
- localTrustedNonManifestCatalogTriples = generatedPrivateCatalogTripleKeys(contextGraphId);
4745
- selection = await this._ensureCuratedCatalogInSwm(contextGraphId, selection, options?.subGraphName, ctx, options?.sharedMemoryScope);
4746
- }
4747
4692
  // RFC-001 §9.x — selection-based publish bridge. If the caller
4748
4693
  // already sealed the content (named-assertion lifecycle) they
4749
4694
  // pass `precomputedAttestation` through and we forward verbatim.
@@ -4769,7 +4714,7 @@ export class PublishMethods extends DKGAgentBase {
4769
4714
  ...(options?.schemeVersion !== undefined
4770
4715
  ? { schemeVersion: options.schemeVersion }
4771
4716
  : {}),
4772
- graphScoped: graphScopedPublish,
4717
+ graphScoped: true,
4773
4718
  });
4774
4719
  }
4775
4720
  }
@@ -4802,17 +4747,16 @@ export class PublishMethods extends DKGAgentBase {
4802
4747
  this.log.info(ctx, `LU-11: curated CG ${contextGraphId} — chunked path active (per-chunk SWM gossip + V2 ACK)`);
4803
4748
  }
4804
4749
  // V2 curation is decided by the live chain-aware encryption resolver, not
4805
- // by a second local `_meta` read. Keep the legacy combined-model behavior
4806
- // unchanged, but make graph-scoped publishes carry the detached catalog
4807
- // whenever the exact same operation was resolved as curated.
4808
- const trustedNonManifestCatalogTriples = graphScopedPublish
4809
- ? resolveCuratedV2CatalogCapability({
4810
- contextGraphId,
4811
- graphScoped: true,
4812
- onChainContextGraphId: onChainId,
4813
- encryptInlinePayload,
4814
- })
4815
- : localTrustedNonManifestCatalogTriples;
4750
+ // by a second local `_meta` read. The publish carries the detached catalog
4751
+ // (OT-RFC-49) whenever the exact same operation was resolved as curated:
4752
+ // the publisher derives its commitment without altering the exact KA graph
4753
+ // or its author seal.
4754
+ const trustedNonManifestCatalogTriples = resolveCuratedV2CatalogCapability({
4755
+ contextGraphId,
4756
+ graphScoped: true,
4757
+ onChainContextGraphId: onChainId,
4758
+ encryptInlinePayload,
4759
+ });
4816
4760
  const publisher = options?.publisherOverride ?? this.publisher;
4817
4761
  const result = await publisher.publishFromSharedMemory(contextGraphId, selection, {
4818
4762
  operationCtx: ctx,
@@ -4841,6 +4785,11 @@ export class PublishMethods extends DKGAgentBase {
4841
4785
  encryptInlinePayload,
4842
4786
  encryptInlineChunked,
4843
4787
  });
4788
+ if (result.status === 'confirmed'
4789
+ && options?.kaUal !== undefined
4790
+ && options.assertionVersion !== undefined) {
4791
+ await this.retireLegacySwmAfterConfirmedLocalPublish(contextGraphId, options.kaUal, String(options.assertionVersion), options.subGraphName, ctx);
4792
+ }
4844
4793
  span.setAttribute('dkg.publish_status', result.status);
4845
4794
  if (result.status === 'failed') {
4846
4795
  span.setStatus({ code: SpanStatusCode.ERROR });
@@ -4892,19 +4841,15 @@ export class PublishMethods extends DKGAgentBase {
4892
4841
  targetContextGraphId: result.contextGraphError ? undefined : broadcastCgId,
4893
4842
  subGraphName: options?.subGraphName,
4894
4843
  keepRootCopyOnLabel,
4895
- ...(options?.contentScopeVersion === GRAPH_KA_CONTENT_SCOPE_VERSION
4896
- ? {
4897
- contentScopeVersion: GRAPH_KA_CONTENT_SCOPE_VERSION,
4898
- assertionVersion: String(options.assertionVersion),
4899
- publicTripleCount: options.publicTripleCount ?? 0,
4900
- ...(options.privateMerkleRoot
4901
- ? { privateMerkleRoot: options.privateMerkleRoot }
4902
- : {}),
4903
- privateTripleCount: options.privateTripleCount ?? 0,
4904
- accessPolicy: result.accessPolicy ?? 'ownerOnly',
4905
- allowedPeers: result.allowedPeers ?? [],
4906
- }
4844
+ contentScopeVersion: GRAPH_KA_CONTENT_SCOPE_VERSION,
4845
+ assertionVersion: String(options.assertionVersion),
4846
+ publicTripleCount: options.publicTripleCount ?? 0,
4847
+ ...(options.privateMerkleRoot
4848
+ ? { privateMerkleRoot: options.privateMerkleRoot }
4907
4849
  : {}),
4850
+ privateTripleCount: options.privateTripleCount ?? 0,
4851
+ accessPolicy: result.accessPolicy ?? 'ownerOnly',
4852
+ allowedPeers: result.allowedPeers ?? [],
4908
4853
  };
4909
4854
  const topic = contextGraphFinalizationTopic(contextGraphId);
4910
4855
  try {
@@ -4914,38 +4859,6 @@ export class PublishMethods extends DKGAgentBase {
4914
4859
  catch {
4915
4860
  this.log.warn(ctx, `No peers subscribed to ${topic} yet`);
4916
4861
  }
4917
- // Durable keep-root signal. The gossip envelope's `keepRootCopyOnLabel`
4918
- // only reaches peers online for the broadcast; a subscriber that missed
4919
- // it later recovers the publish via the chain-driven reconcile sweep,
4920
- // which has no wire to learn the dual-write intent from. Persist the same
4921
- // decision per root into SWM workspace meta — co-located with the per-root
4922
- // `privateMerkleRoot` that already replicates to subscribers — so the
4923
- // reconcile path can mirror the gossip dual-write decision. Read back by
4924
- // `FinalizationHandler.getKeepRootCopySignal`. Updates reuse a root
4925
- // entity, so replace any prior value rather than accumulate.
4926
- try {
4927
- const gm = new GraphManager(this.store);
4928
- const wsMetaGraph = options?.subGraphName
4929
- ? gm.sharedMemoryMetaUri(contextGraphId, options.subGraphName)
4930
- : contextGraphWorkspaceMetaGraphUri(contextGraphId);
4931
- const keepLiteral = `"${keepRootCopyOnLabel}"`;
4932
- for (const root of rootEntities.filter(isSafeIri)) {
4933
- await deleteByPatternWithoutCount(this.store, {
4934
- subject: root,
4935
- predicate: KEEP_ROOT_COPY_PREDICATE,
4936
- graph: wsMetaGraph,
4937
- });
4938
- await this.store.insert([{
4939
- subject: root,
4940
- predicate: KEEP_ROOT_COPY_PREDICATE,
4941
- object: keepLiteral,
4942
- graph: wsMetaGraph,
4943
- }]);
4944
- }
4945
- }
4946
- catch (err) {
4947
- this.log.warn(ctx, `Failed to persist keepRootCopyOnLabel signal for ${result.ual}: ${err instanceof Error ? err.message : String(err)}`);
4948
- }
4949
4862
  }
4950
4863
  recordPublishOutcome(result.status, 'swm', publishStartedAt, chainId);
4951
4864
  return result;