@sentropic/cluster-mesh 0.18.0 → 0.19.0

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 (540) hide show
  1. package/README.md +30 -0
  2. package/assets/storage/comments/oracle/conformance.mjs +1 -0
  3. package/assets/storage/comments/oracle/manifest.json +24 -0
  4. package/assets/storage/comments/oracle/revision-hash-v1.json +1 -0
  5. package/assets/storage/comments/transport-v1.json +1 -0
  6. package/assets/storage/postgres/001-core.sql +51 -0
  7. package/assets/storage/postgres/002-map.sql +83 -0
  8. package/assets/storage/postgres/003-staged.sql +11 -0
  9. package/assets/storage/postgres/004-queries.sql +20 -0
  10. package/assets/storage/postgres/005-cleanup.sql +3 -0
  11. package/assets/storage/postgres/006-staged-coverage.sql +5 -0
  12. package/assets/storage/postgres/comments/001-projections.sql +18 -0
  13. package/assets/storage/postgres/comments/002-transport.sql +13 -0
  14. package/assets/storage/postgres/comments/003-exports.sql +9 -0
  15. package/assets/storage/postgres/comments/004-authority.sql +7 -0
  16. package/assets/storage/postgres/comments/005-lifecycle-evidence.sql +3 -0
  17. package/assets/storage/postgres/comments/006-review-evidence.sql +6 -0
  18. package/assets/storage/postgres/comments/manifest.json +89 -0
  19. package/assets/storage/postgres/manifest.json +81 -0
  20. package/dist/comments/admission.d.ts +11 -0
  21. package/dist/comments/admission.d.ts.map +1 -0
  22. package/dist/comments/admission.js +44 -0
  23. package/dist/comments/admission.js.map +1 -0
  24. package/dist/comments/authority-projection.d.ts +6 -0
  25. package/dist/comments/authority-projection.d.ts.map +1 -0
  26. package/dist/comments/authority-projection.js +80 -0
  27. package/dist/comments/authority-projection.js.map +1 -0
  28. package/dist/comments/authority.d.ts +14 -0
  29. package/dist/comments/authority.d.ts.map +1 -0
  30. package/dist/comments/authority.js +73 -0
  31. package/dist/comments/authority.js.map +1 -0
  32. package/dist/comments/binding-codec.d.ts +6 -0
  33. package/dist/comments/binding-codec.d.ts.map +1 -0
  34. package/dist/comments/binding-codec.js +86 -0
  35. package/dist/comments/binding-codec.js.map +1 -0
  36. package/dist/comments/boundary-codec.d.ts +27 -0
  37. package/dist/comments/boundary-codec.d.ts.map +1 -0
  38. package/dist/comments/boundary-codec.js +56 -0
  39. package/dist/comments/boundary-codec.js.map +1 -0
  40. package/dist/comments/command-contracts.d.ts +22 -0
  41. package/dist/comments/command-contracts.d.ts.map +1 -0
  42. package/dist/comments/command-contracts.js +2 -0
  43. package/dist/comments/command-contracts.js.map +1 -0
  44. package/dist/comments/command-services.d.ts +10 -0
  45. package/dist/comments/command-services.d.ts.map +1 -0
  46. package/dist/comments/command-services.js +21 -0
  47. package/dist/comments/command-services.js.map +1 -0
  48. package/dist/comments/context.d.ts +26 -0
  49. package/dist/comments/context.d.ts.map +1 -0
  50. package/dist/comments/context.js +123 -0
  51. package/dist/comments/context.js.map +1 -0
  52. package/dist/comments/contract.d.ts +2 -0
  53. package/dist/comments/contract.d.ts.map +1 -0
  54. package/dist/comments/contract.js +2 -0
  55. package/dist/comments/contract.js.map +1 -0
  56. package/dist/comments/export-authority.d.ts +5 -0
  57. package/dist/comments/export-authority.d.ts.map +1 -0
  58. package/dist/comments/export-authority.js +17 -0
  59. package/dist/comments/export-authority.js.map +1 -0
  60. package/dist/comments/export-control.d.ts +7 -0
  61. package/dist/comments/export-control.d.ts.map +1 -0
  62. package/dist/comments/export-control.js +58 -0
  63. package/dist/comments/export-control.js.map +1 -0
  64. package/dist/comments/export-pages.d.ts +7 -0
  65. package/dist/comments/export-pages.d.ts.map +1 -0
  66. package/dist/comments/export-pages.js +90 -0
  67. package/dist/comments/export-pages.js.map +1 -0
  68. package/dist/comments/export-prepare.d.ts +5 -0
  69. package/dist/comments/export-prepare.d.ts.map +1 -0
  70. package/dist/comments/export-prepare.js +112 -0
  71. package/dist/comments/export-prepare.js.map +1 -0
  72. package/dist/comments/export-readers.d.ts +18 -0
  73. package/dist/comments/export-readers.d.ts.map +1 -0
  74. package/dist/comments/export-readers.js +91 -0
  75. package/dist/comments/export-readers.js.map +1 -0
  76. package/dist/comments/export-services.d.ts +9 -0
  77. package/dist/comments/export-services.d.ts.map +1 -0
  78. package/dist/comments/export-services.js +30 -0
  79. package/dist/comments/export-services.js.map +1 -0
  80. package/dist/comments/fragment-codec.d.ts +8 -0
  81. package/dist/comments/fragment-codec.d.ts.map +1 -0
  82. package/dist/comments/fragment-codec.js +72 -0
  83. package/dist/comments/fragment-codec.js.map +1 -0
  84. package/dist/comments/http-authority.d.ts +12 -0
  85. package/dist/comments/http-authority.d.ts.map +1 -0
  86. package/dist/comments/http-authority.js +61 -0
  87. package/dist/comments/http-authority.js.map +1 -0
  88. package/dist/comments/http-boundary.d.ts +25 -0
  89. package/dist/comments/http-boundary.d.ts.map +1 -0
  90. package/dist/comments/http-boundary.js +76 -0
  91. package/dist/comments/http-boundary.js.map +1 -0
  92. package/dist/comments/import-authority.d.ts +5 -0
  93. package/dist/comments/import-authority.d.ts.map +1 -0
  94. package/dist/comments/import-authority.js +41 -0
  95. package/dist/comments/import-authority.js.map +1 -0
  96. package/dist/comments/import-control.d.ts +17 -0
  97. package/dist/comments/import-control.d.ts.map +1 -0
  98. package/dist/comments/import-control.js +82 -0
  99. package/dist/comments/import-control.js.map +1 -0
  100. package/dist/comments/import-effects.d.ts +12 -0
  101. package/dist/comments/import-effects.d.ts.map +1 -0
  102. package/dist/comments/import-effects.js +167 -0
  103. package/dist/comments/import-effects.js.map +1 -0
  104. package/dist/comments/import-policy.d.ts +4 -0
  105. package/dist/comments/import-policy.d.ts.map +1 -0
  106. package/dist/comments/import-policy.js +35 -0
  107. package/dist/comments/import-policy.js.map +1 -0
  108. package/dist/comments/import-prepare.d.ts +5 -0
  109. package/dist/comments/import-prepare.d.ts.map +1 -0
  110. package/dist/comments/import-prepare.js +123 -0
  111. package/dist/comments/import-prepare.js.map +1 -0
  112. package/dist/comments/import-projection.d.ts +5 -0
  113. package/dist/comments/import-projection.d.ts.map +1 -0
  114. package/dist/comments/import-projection.js +76 -0
  115. package/dist/comments/import-projection.js.map +1 -0
  116. package/dist/comments/import-recovery.d.ts +22 -0
  117. package/dist/comments/import-recovery.d.ts.map +1 -0
  118. package/dist/comments/import-recovery.js +95 -0
  119. package/dist/comments/import-recovery.js.map +1 -0
  120. package/dist/comments/import-services.d.ts +36 -0
  121. package/dist/comments/import-services.d.ts.map +1 -0
  122. package/dist/comments/import-services.js +38 -0
  123. package/dist/comments/import-services.js.map +1 -0
  124. package/dist/comments/import-state.d.ts +42 -0
  125. package/dist/comments/import-state.d.ts.map +1 -0
  126. package/dist/comments/import-state.js +33 -0
  127. package/dist/comments/import-state.js.map +1 -0
  128. package/dist/comments/index.d.ts +56 -0
  129. package/dist/comments/index.d.ts.map +1 -0
  130. package/dist/comments/index.js +28 -0
  131. package/dist/comments/index.js.map +1 -0
  132. package/dist/comments/installed-store.d.ts +4 -0
  133. package/dist/comments/installed-store.d.ts.map +1 -0
  134. package/dist/comments/installed-store.js +30 -0
  135. package/dist/comments/installed-store.js.map +1 -0
  136. package/dist/comments/lifecycle-contracts.d.ts +27 -0
  137. package/dist/comments/lifecycle-contracts.d.ts.map +1 -0
  138. package/dist/comments/lifecycle-contracts.js +3 -0
  139. package/dist/comments/lifecycle-contracts.js.map +1 -0
  140. package/dist/comments/lifecycle-evidence.d.ts +4 -0
  141. package/dist/comments/lifecycle-evidence.d.ts.map +1 -0
  142. package/dist/comments/lifecycle-evidence.js +31 -0
  143. package/dist/comments/lifecycle-evidence.js.map +1 -0
  144. package/dist/comments/lifecycle-io.d.ts +13 -0
  145. package/dist/comments/lifecycle-io.d.ts.map +1 -0
  146. package/dist/comments/lifecycle-io.js +69 -0
  147. package/dist/comments/lifecycle-io.js.map +1 -0
  148. package/dist/comments/lifecycle.d.ts +4 -0
  149. package/dist/comments/lifecycle.d.ts.map +1 -0
  150. package/dist/comments/lifecycle.js +135 -0
  151. package/dist/comments/lifecycle.js.map +1 -0
  152. package/dist/comments/limits.d.ts +4 -0
  153. package/dist/comments/limits.d.ts.map +1 -0
  154. package/dist/comments/limits.js +14 -0
  155. package/dist/comments/limits.js.map +1 -0
  156. package/dist/comments/postgres-projections.d.ts +5 -0
  157. package/dist/comments/postgres-projections.d.ts.map +1 -0
  158. package/dist/comments/postgres-projections.js +58 -0
  159. package/dist/comments/postgres-projections.js.map +1 -0
  160. package/dist/comments/postgres-queries.d.ts +3 -0
  161. package/dist/comments/postgres-queries.d.ts.map +1 -0
  162. package/dist/comments/postgres-queries.js +75 -0
  163. package/dist/comments/postgres-queries.js.map +1 -0
  164. package/dist/comments/postgres-records.d.ts +6 -0
  165. package/dist/comments/postgres-records.d.ts.map +1 -0
  166. package/dist/comments/postgres-records.js +74 -0
  167. package/dist/comments/postgres-records.js.map +1 -0
  168. package/dist/comments/postgres.d.ts +47 -0
  169. package/dist/comments/postgres.d.ts.map +1 -0
  170. package/dist/comments/postgres.js +142 -0
  171. package/dist/comments/postgres.js.map +1 -0
  172. package/dist/comments/purge.d.ts +5 -0
  173. package/dist/comments/purge.d.ts.map +1 -0
  174. package/dist/comments/purge.js +41 -0
  175. package/dist/comments/purge.js.map +1 -0
  176. package/dist/comments/read-audience.d.ts +3 -0
  177. package/dist/comments/read-audience.d.ts.map +1 -0
  178. package/dist/comments/read-audience.js +7 -0
  179. package/dist/comments/read-audience.js.map +1 -0
  180. package/dist/comments/read-command.d.ts +18 -0
  181. package/dist/comments/read-command.d.ts.map +1 -0
  182. package/dist/comments/read-command.js +65 -0
  183. package/dist/comments/read-command.js.map +1 -0
  184. package/dist/comments/record-effects.d.ts +4 -0
  185. package/dist/comments/record-effects.d.ts.map +1 -0
  186. package/dist/comments/record-effects.js +22 -0
  187. package/dist/comments/record-effects.js.map +1 -0
  188. package/dist/comments/record-validation.d.ts +4 -0
  189. package/dist/comments/record-validation.d.ts.map +1 -0
  190. package/dist/comments/record-validation.js +70 -0
  191. package/dist/comments/record-validation.js.map +1 -0
  192. package/dist/comments/relationships.d.ts +4 -0
  193. package/dist/comments/relationships.d.ts.map +1 -0
  194. package/dist/comments/relationships.js +19 -0
  195. package/dist/comments/relationships.js.map +1 -0
  196. package/dist/comments/review-evidence.d.ts +4 -0
  197. package/dist/comments/review-evidence.d.ts.map +1 -0
  198. package/dist/comments/review-evidence.js +52 -0
  199. package/dist/comments/review-evidence.js.map +1 -0
  200. package/dist/comments/revision-command.d.ts +5 -0
  201. package/dist/comments/revision-command.d.ts.map +1 -0
  202. package/dist/comments/revision-command.js +80 -0
  203. package/dist/comments/revision-command.js.map +1 -0
  204. package/dist/comments/router-binding.d.ts +9 -0
  205. package/dist/comments/router-binding.d.ts.map +1 -0
  206. package/dist/comments/router-binding.js +6 -0
  207. package/dist/comments/router-binding.js.map +1 -0
  208. package/dist/comments/services.d.ts +43 -0
  209. package/dist/comments/services.d.ts.map +1 -0
  210. package/dist/comments/services.js +20 -0
  211. package/dist/comments/services.js.map +1 -0
  212. package/dist/comments/storage-adapter.d.ts +16 -0
  213. package/dist/comments/storage-adapter.d.ts.map +1 -0
  214. package/dist/comments/storage-adapter.js +108 -0
  215. package/dist/comments/storage-adapter.js.map +1 -0
  216. package/dist/comments/storage-contracts.d.ts +57 -0
  217. package/dist/comments/storage-contracts.d.ts.map +1 -0
  218. package/dist/comments/storage-contracts.js +2 -0
  219. package/dist/comments/storage-contracts.js.map +1 -0
  220. package/dist/comments/storage-schema.d.ts +32 -0
  221. package/dist/comments/storage-schema.d.ts.map +1 -0
  222. package/dist/comments/storage-schema.js +70 -0
  223. package/dist/comments/storage-schema.js.map +1 -0
  224. package/dist/comments/store.d.ts +5 -0
  225. package/dist/comments/store.d.ts.map +1 -0
  226. package/dist/comments/store.js +43 -0
  227. package/dist/comments/store.js.map +1 -0
  228. package/dist/comments/transport-contracts.d.ts +110 -0
  229. package/dist/comments/transport-contracts.d.ts.map +1 -0
  230. package/dist/comments/transport-contracts.js +29 -0
  231. package/dist/comments/transport-contracts.js.map +1 -0
  232. package/dist/compose/comments.d.ts +31 -0
  233. package/dist/compose/comments.d.ts.map +1 -0
  234. package/dist/compose/comments.js +48 -0
  235. package/dist/compose/comments.js.map +1 -0
  236. package/dist/hono/comments-router.d.ts +4 -0
  237. package/dist/hono/comments-router.d.ts.map +1 -0
  238. package/dist/hono/comments-router.js +83 -0
  239. package/dist/hono/comments-router.js.map +1 -0
  240. package/dist/integrations/comments/index.d.ts +3 -0
  241. package/dist/integrations/comments/index.d.ts.map +1 -0
  242. package/dist/integrations/comments/index.js +3 -0
  243. package/dist/integrations/comments/index.js.map +1 -0
  244. package/dist/loaders/comments/index.d.ts +5 -0
  245. package/dist/loaders/comments/index.d.ts.map +1 -0
  246. package/dist/loaders/comments/index.js +6 -0
  247. package/dist/loaders/comments/index.js.map +1 -0
  248. package/dist/modules/catalog.d.ts +1 -0
  249. package/dist/modules/catalog.d.ts.map +1 -1
  250. package/dist/modules/catalog.js +4 -1
  251. package/dist/modules/catalog.js.map +1 -1
  252. package/dist/modules/contracts.d.ts +2 -2
  253. package/dist/modules/contracts.d.ts.map +1 -1
  254. package/dist/modules/contracts.js +1 -1
  255. package/dist/modules/contracts.js.map +1 -1
  256. package/dist/storage/atomic.d.ts +108 -0
  257. package/dist/storage/atomic.d.ts.map +1 -0
  258. package/dist/storage/atomic.js +163 -0
  259. package/dist/storage/atomic.js.map +1 -0
  260. package/dist/storage/authority.d.ts +37 -0
  261. package/dist/storage/authority.d.ts.map +1 -0
  262. package/dist/storage/authority.js +88 -0
  263. package/dist/storage/authority.js.map +1 -0
  264. package/dist/storage/backend.d.ts +80 -0
  265. package/dist/storage/backend.d.ts.map +1 -0
  266. package/dist/storage/backend.js +92 -0
  267. package/dist/storage/backend.js.map +1 -0
  268. package/dist/storage/contracts.d.ts +64 -0
  269. package/dist/storage/contracts.d.ts.map +1 -0
  270. package/dist/storage/contracts.js +129 -0
  271. package/dist/storage/contracts.js.map +1 -0
  272. package/dist/storage/descriptor.d.ts +52 -0
  273. package/dist/storage/descriptor.d.ts.map +1 -0
  274. package/dist/storage/descriptor.js +94 -0
  275. package/dist/storage/descriptor.js.map +1 -0
  276. package/dist/storage/errors.d.ts +49 -0
  277. package/dist/storage/errors.d.ts.map +1 -0
  278. package/dist/storage/errors.js +119 -0
  279. package/dist/storage/errors.js.map +1 -0
  280. package/dist/storage/index.d.ts +16 -0
  281. package/dist/storage/index.d.ts.map +1 -0
  282. package/dist/storage/index.js +15 -0
  283. package/dist/storage/index.js.map +1 -0
  284. package/dist/storage/indexed-history.d.ts +15 -0
  285. package/dist/storage/indexed-history.d.ts.map +1 -0
  286. package/dist/storage/indexed-history.js +37 -0
  287. package/dist/storage/indexed-history.js.map +1 -0
  288. package/dist/storage/indexed-map.d.ts +20 -0
  289. package/dist/storage/indexed-map.d.ts.map +1 -0
  290. package/dist/storage/indexed-map.js +50 -0
  291. package/dist/storage/indexed-map.js.map +1 -0
  292. package/dist/storage/indexed-tree.d.ts +16 -0
  293. package/dist/storage/indexed-tree.d.ts.map +1 -0
  294. package/dist/storage/indexed-tree.js +86 -0
  295. package/dist/storage/indexed-tree.js.map +1 -0
  296. package/dist/storage/kernel.d.ts +49 -0
  297. package/dist/storage/kernel.d.ts.map +1 -0
  298. package/dist/storage/kernel.js +104 -0
  299. package/dist/storage/kernel.js.map +1 -0
  300. package/dist/storage/manifest.d.ts +56 -0
  301. package/dist/storage/manifest.d.ts.map +1 -0
  302. package/dist/storage/manifest.js +131 -0
  303. package/dist/storage/manifest.js.map +1 -0
  304. package/dist/storage/mutation-coordinator.d.ts +35 -0
  305. package/dist/storage/mutation-coordinator.d.ts.map +1 -0
  306. package/dist/storage/mutation-coordinator.js +123 -0
  307. package/dist/storage/mutation-coordinator.js.map +1 -0
  308. package/dist/storage/postgres/blobs.d.ts +5 -0
  309. package/dist/storage/postgres/blobs.d.ts.map +1 -0
  310. package/dist/storage/postgres/blobs.js +45 -0
  311. package/dist/storage/postgres/blobs.js.map +1 -0
  312. package/dist/storage/postgres/cleanup.d.ts +17 -0
  313. package/dist/storage/postgres/cleanup.d.ts.map +1 -0
  314. package/dist/storage/postgres/cleanup.js +70 -0
  315. package/dist/storage/postgres/cleanup.js.map +1 -0
  316. package/dist/storage/postgres/codec.d.ts +9 -0
  317. package/dist/storage/postgres/codec.d.ts.map +1 -0
  318. package/dist/storage/postgres/codec.js +34 -0
  319. package/dist/storage/postgres/codec.js.map +1 -0
  320. package/dist/storage/postgres/core.d.ts +53 -0
  321. package/dist/storage/postgres/core.d.ts.map +1 -0
  322. package/dist/storage/postgres/core.js +210 -0
  323. package/dist/storage/postgres/core.js.map +1 -0
  324. package/dist/storage/postgres/coverage.d.ts +4 -0
  325. package/dist/storage/postgres/coverage.d.ts.map +1 -0
  326. package/dist/storage/postgres/coverage.js +28 -0
  327. package/dist/storage/postgres/coverage.js.map +1 -0
  328. package/dist/storage/postgres/digest.d.ts +14 -0
  329. package/dist/storage/postgres/digest.d.ts.map +1 -0
  330. package/dist/storage/postgres/digest.js +67 -0
  331. package/dist/storage/postgres/digest.js.map +1 -0
  332. package/dist/storage/postgres/effects.d.ts +27 -0
  333. package/dist/storage/postgres/effects.d.ts.map +1 -0
  334. package/dist/storage/postgres/effects.js +130 -0
  335. package/dist/storage/postgres/effects.js.map +1 -0
  336. package/dist/storage/postgres/errors.d.ts +16 -0
  337. package/dist/storage/postgres/errors.d.ts.map +1 -0
  338. package/dist/storage/postgres/errors.js +51 -0
  339. package/dist/storage/postgres/errors.js.map +1 -0
  340. package/dist/storage/postgres/hidden-coverage.d.ts +12 -0
  341. package/dist/storage/postgres/hidden-coverage.d.ts.map +1 -0
  342. package/dist/storage/postgres/hidden-coverage.js +43 -0
  343. package/dist/storage/postgres/hidden-coverage.js.map +1 -0
  344. package/dist/storage/postgres/hidden-session.d.ts +6 -0
  345. package/dist/storage/postgres/hidden-session.d.ts.map +1 -0
  346. package/dist/storage/postgres/hidden-session.js +20 -0
  347. package/dist/storage/postgres/hidden-session.js.map +1 -0
  348. package/dist/storage/postgres/index.d.ts +29 -0
  349. package/dist/storage/postgres/index.d.ts.map +1 -0
  350. package/dist/storage/postgres/index.js +40 -0
  351. package/dist/storage/postgres/index.js.map +1 -0
  352. package/dist/storage/postgres/installed-contracts.d.ts +41 -0
  353. package/dist/storage/postgres/installed-contracts.d.ts.map +1 -0
  354. package/dist/storage/postgres/installed-contracts.js +2 -0
  355. package/dist/storage/postgres/installed-contracts.js.map +1 -0
  356. package/dist/storage/postgres/installed.d.ts +9 -0
  357. package/dist/storage/postgres/installed.d.ts.map +1 -0
  358. package/dist/storage/postgres/installed.js +197 -0
  359. package/dist/storage/postgres/installed.js.map +1 -0
  360. package/dist/storage/postgres/journal.d.ts +24 -0
  361. package/dist/storage/postgres/journal.d.ts.map +1 -0
  362. package/dist/storage/postgres/journal.js +237 -0
  363. package/dist/storage/postgres/journal.js.map +1 -0
  364. package/dist/storage/postgres/lifecycle.d.ts +8 -0
  365. package/dist/storage/postgres/lifecycle.d.ts.map +1 -0
  366. package/dist/storage/postgres/lifecycle.js +164 -0
  367. package/dist/storage/postgres/lifecycle.js.map +1 -0
  368. package/dist/storage/postgres/maintenance-readers.d.ts +22 -0
  369. package/dist/storage/postgres/maintenance-readers.d.ts.map +1 -0
  370. package/dist/storage/postgres/maintenance-readers.js +60 -0
  371. package/dist/storage/postgres/maintenance-readers.js.map +1 -0
  372. package/dist/storage/postgres/manifests.d.ts +11 -0
  373. package/dist/storage/postgres/manifests.d.ts.map +1 -0
  374. package/dist/storage/postgres/manifests.js +105 -0
  375. package/dist/storage/postgres/manifests.js.map +1 -0
  376. package/dist/storage/postgres/migrations.d.ts +46 -0
  377. package/dist/storage/postgres/migrations.d.ts.map +1 -0
  378. package/dist/storage/postgres/migrations.js +182 -0
  379. package/dist/storage/postgres/migrations.js.map +1 -0
  380. package/dist/storage/postgres/module-effects.d.ts +7 -0
  381. package/dist/storage/postgres/module-effects.d.ts.map +1 -0
  382. package/dist/storage/postgres/module-effects.js +59 -0
  383. package/dist/storage/postgres/module-effects.js.map +1 -0
  384. package/dist/storage/postgres/ordinary-transactions.d.ts +12 -0
  385. package/dist/storage/postgres/ordinary-transactions.d.ts.map +1 -0
  386. package/dist/storage/postgres/ordinary-transactions.js +168 -0
  387. package/dist/storage/postgres/ordinary-transactions.js.map +1 -0
  388. package/dist/storage/postgres/preparation.d.ts +12 -0
  389. package/dist/storage/postgres/preparation.d.ts.map +1 -0
  390. package/dist/storage/postgres/preparation.js +127 -0
  391. package/dist/storage/postgres/preparation.js.map +1 -0
  392. package/dist/storage/postgres/profiles.d.ts +107 -0
  393. package/dist/storage/postgres/profiles.d.ts.map +1 -0
  394. package/dist/storage/postgres/profiles.js +75 -0
  395. package/dist/storage/postgres/profiles.js.map +1 -0
  396. package/dist/storage/postgres/protocol.d.ts +115 -0
  397. package/dist/storage/postgres/protocol.d.ts.map +1 -0
  398. package/dist/storage/postgres/protocol.js +20 -0
  399. package/dist/storage/postgres/protocol.js.map +1 -0
  400. package/dist/storage/postgres/queries.d.ts +22 -0
  401. package/dist/storage/postgres/queries.d.ts.map +1 -0
  402. package/dist/storage/postgres/queries.js +113 -0
  403. package/dist/storage/postgres/queries.js.map +1 -0
  404. package/dist/storage/postgres/readers.d.ts +43 -0
  405. package/dist/storage/postgres/readers.d.ts.map +1 -0
  406. package/dist/storage/postgres/readers.js +139 -0
  407. package/dist/storage/postgres/readers.js.map +1 -0
  408. package/dist/storage/postgres/recovery.d.ts +15 -0
  409. package/dist/storage/postgres/recovery.d.ts.map +1 -0
  410. package/dist/storage/postgres/recovery.js +71 -0
  411. package/dist/storage/postgres/recovery.js.map +1 -0
  412. package/dist/storage/postgres/registered-effects.d.ts +2 -0
  413. package/dist/storage/postgres/registered-effects.d.ts.map +1 -0
  414. package/dist/storage/postgres/registered-effects.js +2 -0
  415. package/dist/storage/postgres/registered-effects.js.map +1 -0
  416. package/dist/storage/postgres/roots.d.ts +34 -0
  417. package/dist/storage/postgres/roots.d.ts.map +1 -0
  418. package/dist/storage/postgres/roots.js +127 -0
  419. package/dist/storage/postgres/roots.js.map +1 -0
  420. package/dist/storage/postgres/scope.d.ts +136 -0
  421. package/dist/storage/postgres/scope.d.ts.map +1 -0
  422. package/dist/storage/postgres/scope.js +275 -0
  423. package/dist/storage/postgres/scope.js.map +1 -0
  424. package/dist/storage/postgres/seals.d.ts +23 -0
  425. package/dist/storage/postgres/seals.d.ts.map +1 -0
  426. package/dist/storage/postgres/seals.js +149 -0
  427. package/dist/storage/postgres/seals.js.map +1 -0
  428. package/dist/storage/postgres/snapshots.d.ts +13 -0
  429. package/dist/storage/postgres/snapshots.d.ts.map +1 -0
  430. package/dist/storage/postgres/snapshots.js +55 -0
  431. package/dist/storage/postgres/snapshots.js.map +1 -0
  432. package/dist/storage/postgres/staged-module.d.ts +23 -0
  433. package/dist/storage/postgres/staged-module.d.ts.map +1 -0
  434. package/dist/storage/postgres/staged-module.js +38 -0
  435. package/dist/storage/postgres/staged-module.js.map +1 -0
  436. package/dist/storage/postgres/staged.d.ts +15 -0
  437. package/dist/storage/postgres/staged.d.ts.map +1 -0
  438. package/dist/storage/postgres/staged.js +190 -0
  439. package/dist/storage/postgres/staged.js.map +1 -0
  440. package/dist/storage/postgres/transactions.d.ts +9 -0
  441. package/dist/storage/postgres/transactions.d.ts.map +1 -0
  442. package/dist/storage/postgres/transactions.js +86 -0
  443. package/dist/storage/postgres/transactions.js.map +1 -0
  444. package/dist/storage/postgres/units.d.ts +55 -0
  445. package/dist/storage/postgres/units.d.ts.map +1 -0
  446. package/dist/storage/postgres/units.js +57 -0
  447. package/dist/storage/postgres/units.js.map +1 -0
  448. package/dist/storage/profiles.d.ts +24 -0
  449. package/dist/storage/profiles.d.ts.map +1 -0
  450. package/dist/storage/profiles.js +88 -0
  451. package/dist/storage/profiles.js.map +1 -0
  452. package/dist/storage/projection-runtime.d.ts +46 -0
  453. package/dist/storage/projection-runtime.d.ts.map +1 -0
  454. package/dist/storage/projection-runtime.js +105 -0
  455. package/dist/storage/projection-runtime.js.map +1 -0
  456. package/dist/storage/readers.d.ts +47 -0
  457. package/dist/storage/readers.d.ts.map +1 -0
  458. package/dist/storage/readers.js +136 -0
  459. package/dist/storage/readers.js.map +1 -0
  460. package/dist/storage/record-runtime.d.ts +85 -0
  461. package/dist/storage/record-runtime.d.ts.map +1 -0
  462. package/dist/storage/record-runtime.js +387 -0
  463. package/dist/storage/record-runtime.js.map +1 -0
  464. package/dist/storage/root-facade.d.ts +128 -0
  465. package/dist/storage/root-facade.d.ts.map +1 -0
  466. package/dist/storage/root-facade.js +116 -0
  467. package/dist/storage/root-facade.js.map +1 -0
  468. package/dist/storage/root-journal.d.ts +25 -0
  469. package/dist/storage/root-journal.d.ts.map +1 -0
  470. package/dist/storage/root-journal.js +121 -0
  471. package/dist/storage/root-journal.js.map +1 -0
  472. package/dist/storage/root-lifecycle.d.ts +11 -0
  473. package/dist/storage/root-lifecycle.d.ts.map +1 -0
  474. package/dist/storage/root-lifecycle.js +114 -0
  475. package/dist/storage/root-lifecycle.js.map +1 -0
  476. package/dist/storage/root-manifest.d.ts +15 -0
  477. package/dist/storage/root-manifest.d.ts.map +1 -0
  478. package/dist/storage/root-manifest.js +79 -0
  479. package/dist/storage/root-manifest.js.map +1 -0
  480. package/dist/storage/root-profiles.d.ts +104 -0
  481. package/dist/storage/root-profiles.d.ts.map +1 -0
  482. package/dist/storage/root-profiles.js +35 -0
  483. package/dist/storage/root-profiles.js.map +1 -0
  484. package/dist/storage/root-query.d.ts +31 -0
  485. package/dist/storage/root-query.d.ts.map +1 -0
  486. package/dist/storage/root-query.js +70 -0
  487. package/dist/storage/root-query.js.map +1 -0
  488. package/dist/storage/root-snapshot.d.ts +13 -0
  489. package/dist/storage/root-snapshot.d.ts.map +1 -0
  490. package/dist/storage/root-snapshot.js +59 -0
  491. package/dist/storage/root-snapshot.js.map +1 -0
  492. package/dist/storage/scope-runtime.d.ts +155 -0
  493. package/dist/storage/scope-runtime.d.ts.map +1 -0
  494. package/dist/storage/scope-runtime.js +597 -0
  495. package/dist/storage/scope-runtime.js.map +1 -0
  496. package/dist/storage/staged-codec.d.ts +32 -0
  497. package/dist/storage/staged-codec.d.ts.map +1 -0
  498. package/dist/storage/staged-codec.js +86 -0
  499. package/dist/storage/staged-codec.js.map +1 -0
  500. package/dist/storage/staged-core.d.ts +43 -0
  501. package/dist/storage/staged-core.d.ts.map +1 -0
  502. package/dist/storage/staged-core.js +120 -0
  503. package/dist/storage/staged-core.js.map +1 -0
  504. package/dist/storage/staged-effects.d.ts +13 -0
  505. package/dist/storage/staged-effects.d.ts.map +1 -0
  506. package/dist/storage/staged-effects.js +101 -0
  507. package/dist/storage/staged-effects.js.map +1 -0
  508. package/dist/storage/staged-factory.d.ts +22 -0
  509. package/dist/storage/staged-factory.d.ts.map +1 -0
  510. package/dist/storage/staged-factory.js +36 -0
  511. package/dist/storage/staged-factory.js.map +1 -0
  512. package/dist/storage/staged-operations.d.ts +22 -0
  513. package/dist/storage/staged-operations.d.ts.map +1 -0
  514. package/dist/storage/staged-operations.js +125 -0
  515. package/dist/storage/staged-operations.js.map +1 -0
  516. package/dist/storage/staged-preparation.d.ts +19 -0
  517. package/dist/storage/staged-preparation.d.ts.map +1 -0
  518. package/dist/storage/staged-preparation.js +128 -0
  519. package/dist/storage/staged-preparation.js.map +1 -0
  520. package/dist/storage/staged-recovery.d.ts +27 -0
  521. package/dist/storage/staged-recovery.d.ts.map +1 -0
  522. package/dist/storage/staged-recovery.js +49 -0
  523. package/dist/storage/staged-recovery.js.map +1 -0
  524. package/dist/storage/staged-seal.d.ts +37 -0
  525. package/dist/storage/staged-seal.d.ts.map +1 -0
  526. package/dist/storage/staged-seal.js +120 -0
  527. package/dist/storage/staged-seal.js.map +1 -0
  528. package/dist/storage/staged-state.d.ts +156 -0
  529. package/dist/storage/staged-state.d.ts.map +1 -0
  530. package/dist/storage/staged-state.js +43 -0
  531. package/dist/storage/staged-state.js.map +1 -0
  532. package/dist/storage/staged-units.d.ts +95 -0
  533. package/dist/storage/staged-units.d.ts.map +1 -0
  534. package/dist/storage/staged-units.js +129 -0
  535. package/dist/storage/staged-units.js.map +1 -0
  536. package/dist/storage/tokens.d.ts +50 -0
  537. package/dist/storage/tokens.d.ts.map +1 -0
  538. package/dist/storage/tokens.js +135 -0
  539. package/dist/storage/tokens.js.map +1 -0
  540. package/package.json +29 -1
@@ -0,0 +1,597 @@
1
+ // K3 scope binding and ordinary transactions (L3a v4.1 frozen §4, §5).
2
+ // Grants are JSON DTOs: bind keeps a deeply frozen copy, so caller-side
3
+ // mutation can never escalate authority or switch scope. Every operation
4
+ // revalidates expiry, revocation and the required storage operation.
5
+ // transact() runs in a request-local asynchronous context: independent calls
6
+ // stay isolated while a nested call on the same handle joins the outer
7
+ // overlay and can only mark it rollback-only. The commit id is reserved
8
+ // upfront; a joined call returns a frozen provisional copy of the reserved
9
+ // receipt (zero effects before the outer commits) and only the outer commit
10
+ // returns the final counts. An empty transaction commits nothing and is
11
+ // refused. Physically disposed chains deny full getters and leak no
12
+ // continuation. Reads return copies, never canonical state.
13
+ import { AsyncLocalStorage } from 'node:async_hooks';
14
+ import { createHash } from 'node:crypto';
15
+ import { canOperate, validateScopeGrant } from './authority.js';
16
+ import { StorageCasConflictError, StorageDeniedError, StorageIdempotencyConflictError, StorageInvalidCommandError, UnsupportedProfileError, } from './errors.js';
17
+ import { requireProfile } from './profiles.js';
18
+ import { incrementBackendAllocation } from './backend.js';
19
+ import { appendChainToScope, commitAtomicToScope, commitUnitsToScope, disposeChainInScope, genesisToScope, readPageFromScope, } from './record-runtime.js';
20
+ import { forkIndexedMap } from './indexed-map.js';
21
+ import { forkIndexedHistory } from './indexed-history.js';
22
+ import { validatePageLimits } from './contracts.js';
23
+ // Semantic profile definitions: each digest is the SHA-256 of the K3
24
+ // ordinary meaning of the profile, not of its bare label (m8). A mutant
25
+ // hashing only the label produces a different digest.
26
+ const PROFILE_DEFINITIONS = {
27
+ 'atomic-units-v1': 'atomic-units-v1:sequential-CAS-staging;full-rollback;equal-digest-replace;empty-refused',
28
+ 'immutable-chains-v1': 'immutable-chains-v1:exact-head-CAS;per-chain-allocation;disposed-denies-getters;payload-erased',
29
+ 'immutable-boundaries-v1': 'immutable-boundaries-v1:cursor-v2[HMAC-SHA256-128(module,scope,incarnation,keyId,selection,head,seq,allocation,ordering,position)];unknown-boundary-incomplete;no-lease;no-clock-expiry',
30
+ 'scope-outbox-v1': 'scope-outbox-v1:not-advertised-by-k3-ordinary',
31
+ 'visibility-barriers-v1': 'visibility-barriers-v1:not-advertised-by-k3-ordinary',
32
+ 'staged-units-v1': 'staged-units-v1:not-advertised-by-k3-ordinary',
33
+ 'purge-jobs-v1': 'purge-jobs-v1:not-advertised-by-k3-ordinary',
34
+ 'generations-v1': 'generations-v1:not-advertised-by-k3-ordinary',
35
+ 'leased-snapshots-v1': 'leased-snapshots-v1:not-advertised-by-k3-ordinary',
36
+ 'fenced-writers-v1': 'fenced-writers-v1:refused-verify-in-s1-p1',
37
+ 'restore-witness-v1': 'restore-witness-v1:not-advertised-by-k3-ordinary',
38
+ };
39
+ const profileDigest = (profile) => createHash('sha256').update(`k3-ordinary-v1:${profile}:${PROFILE_DEFINITIONS[profile]}`, 'utf8').digest('hex');
40
+ export const ORDINARY_PROFILES = [
41
+ { profile: 'atomic-units-v1', version: '1', digest: profileDigest('atomic-units-v1') },
42
+ { profile: 'immutable-chains-v1', version: '1', digest: profileDigest('immutable-chains-v1') },
43
+ { profile: 'immutable-boundaries-v1', version: '1', digest: profileDigest('immutable-boundaries-v1') },
44
+ ];
45
+ // Frozen capability advertisements (m1): the array and every declaration
46
+ // are sealed, so planting an entry through one handle can never widen what
47
+ // another handle advertises.
48
+ for (const entry of ORDINARY_PROFILES)
49
+ Object.freeze(entry);
50
+ Object.freeze(ORDINARY_PROFILES);
51
+ const deepCopyGrant = (grant) => JSON.parse(JSON.stringify(grant));
52
+ const deepFreeze = (value) => {
53
+ if (typeof value !== 'object' || value === null || Object.isFrozen(value))
54
+ return;
55
+ for (const entry of Object.values(value))
56
+ deepFreeze(entry);
57
+ Object.freeze(value);
58
+ };
59
+ const nonEmpty = (value) => typeof value === 'string' && value.length > 0;
60
+ // Request-local transaction contexts (§5.5 isolation between concurrent
61
+ // contexts): one overlay per kernel-plus-module-plus-scope per asynchronous
62
+ // call chain, so two handles of one kernel bound to the same grant and
63
+ // scope join instead of committing independently (m3). Distinct kernels,
64
+ // modules or scopes never join (Sol-2): independent kernels own independent
65
+ // backends, and a cross-kernel join would commit foreign units to the wrong
66
+ // store under one receipt.
67
+ const txScope = new AsyncLocalStorage();
68
+ const txJoinKey = (kernelId, moduleId, scope) => JSON.stringify(['tx', kernelId, moduleId, scope.tenantId, scope.workspaceId]);
69
+ export class ScopedRuntime {
70
+ moduleId;
71
+ grant;
72
+ boundScope;
73
+ /** True private issuance state (R-MAJ-5): invisible at runtime, so
74
+ * `(handle as any).deps` is undefined and Adapter handles carry no
75
+ * emission, revocation or backend reach. */
76
+ #deps;
77
+ constructor(grant, moduleId, deps) {
78
+ this.moduleId = moduleId;
79
+ const copy = deepCopyGrant(grant);
80
+ deepFreeze(copy);
81
+ this.grant = copy;
82
+ this.boundScope = Object.freeze({ tenantId: copy.scope.tenantId, workspaceId: copy.scope.workspaceId });
83
+ this.#deps = deps;
84
+ // Sealed handle (Sol-1, realm-limited): the instance is frozen, the
85
+ // shared prototype is frozen (see below) and boundScope is frozen, so
86
+ // escalation, tenant-switch or method wrapping by property assignment
87
+ // throws instead of redirecting authority. Intrinsic realm objects
88
+ // (Array.prototype and friends) stay outside this guarantee: full
89
+ // isolation needs a realm or process boundary (spec §6.5). Every
90
+ // operation re-attests authority and grant/scope equality through
91
+ // requireOperation; the commit-time contributor revalidation below is
92
+ // inline, and backend addressing reads the frozen boundScope directly
93
+ // (safe: frozen at bind, and the scope getter copies).
94
+ Object.freeze(this);
95
+ }
96
+ get scope() {
97
+ // A copy: callers can never retarget the bound scope object (the
98
+ // cross-scope check in requireOperation stays meaningful).
99
+ return { ...this.boundScope };
100
+ }
101
+ get profiles() {
102
+ return ORDINARY_PROFILES;
103
+ }
104
+ capability(profile) {
105
+ requireProfile(ORDINARY_PROFILES.map((entry) => entry.profile), profile);
106
+ const claim = ORDINARY_PROFILES.find((entry) => entry.profile === profile);
107
+ if (!claim)
108
+ throw new UnsupportedProfileError(String(profile));
109
+ return { profile: claim.profile, version: claim.version, digest: claim.digest };
110
+ }
111
+ requireOperation(op) {
112
+ const validity = validateScopeGrant(this.grant, { nowIso: this.#deps.clock() });
113
+ if (!validity.ok)
114
+ throw new StorageDeniedError(validity.errors.join('; '));
115
+ if (this.#deps.revoked.has(this.grant.token))
116
+ throw new StorageDeniedError('grant revoked');
117
+ // The authority port is re-attested on every operation (§4.3, m7): a
118
+ // changed issuer or revision pin denies here even though the frozen
119
+ // grant copy is unchanged. The default structural port only enforces
120
+ // explicitly configured expectations; shape and lifetime stay with
121
+ // validateScopeGrant above.
122
+ this.#deps.authority.attest(this.grant);
123
+ if (!canOperate(this.grant, op))
124
+ throw new StorageDeniedError(`grant lacks ${op}`);
125
+ if (this.grant.scope.tenantId !== this.boundScope.tenantId || this.grant.scope.workspaceId !== this.boundScope.workspaceId) {
126
+ throw new StorageDeniedError('cross-scope handle');
127
+ }
128
+ }
129
+ commitContext(commitId = this.#deps.nextCommitId()) {
130
+ return { moduleId: this.moduleId, scope: this.boundScope, clock: this.#deps.clock,
131
+ commitId, predicates: this.#deps.predicates };
132
+ }
133
+ change(kind, keys, operation) {
134
+ const coordinator = this.#deps.coordinator;
135
+ return coordinator
136
+ ? coordinator.mutate(this.grant, kind, keys, operation, this.commitContext(), () => this.requireOperation(kind === 'dispose' ? 'maintain' : 'write'))
137
+ : operation(this.#deps.backend.scopeState(this.boundScope));
138
+ }
139
+ accessible(kind, key) {
140
+ return this.#deps.coordinator?.accessible(this.grant, kind, key) ?? true;
141
+ }
142
+ assertAccessible(kind, key) {
143
+ if (!this.accessible(kind, key))
144
+ throw new StorageDeniedError('current root denies this subject');
145
+ }
146
+ async appendChain(chainId, record, expectation) {
147
+ this.requireOperation('write');
148
+ return this.change('append', [chainId], (state) => appendChainToScope(state, chainId, record, expectation));
149
+ }
150
+ async genesis(kind, id, hash, value) {
151
+ this.requireOperation('write');
152
+ return this.change('genesis', [`${kind}:${id}`], (state) => genesisToScope(state, kind, id, hash, value));
153
+ }
154
+ async indexGet(key) {
155
+ this.requireOperation('read');
156
+ this.assertAccessible('index', key);
157
+ const stored = this.#deps.backend.scopeState(this.boundScope).index.get(key);
158
+ if (!stored)
159
+ return null;
160
+ return { digest: stored.digest, resultIds: [...stored.resultIds], resultHash: stored.resultHash };
161
+ }
162
+ async indexPut(key, entry) {
163
+ this.requireOperation('write');
164
+ return this.change('index', [key], (state) => {
165
+ const stored = state.index.get(key);
166
+ // Detached copies: the caller's entry object never aliases canonical
167
+ // state (Sol-3/m4).
168
+ const detached = { digest: entry.digest, resultIds: [...entry.resultIds], resultHash: entry.resultHash };
169
+ if (!stored) {
170
+ state.index.set(key, detached);
171
+ return 'insert';
172
+ }
173
+ if (stored.digest === entry.digest) {
174
+ state.index.set(key, detached);
175
+ return 'replace';
176
+ }
177
+ throw new StorageIdempotencyConflictError('index digest conflict');
178
+ });
179
+ }
180
+ async readHead(chainId) {
181
+ this.requireOperation('read');
182
+ this.assertAccessible('chain', chainId);
183
+ const chain = this.#deps.backend.scopeState(this.boundScope).chains.get(chainId);
184
+ if (chain?.disposed)
185
+ throw new StorageDeniedError('chain disposed');
186
+ return chain?.head ?? null;
187
+ }
188
+ async readRecord(key) {
189
+ this.requireOperation('read');
190
+ this.assertAccessible('record', key);
191
+ const stored = this.#deps.backend.scopeState(this.boundScope).records.get(key);
192
+ if (!stored)
193
+ return null;
194
+ return { bytes: { ...stored.bytes }, contentHash: stored.contentHash };
195
+ }
196
+ async readAggregate(key) {
197
+ this.requireOperation('read');
198
+ this.assertAccessible('aggregate', key);
199
+ const stored = this.#deps.backend.scopeState(this.boundScope).aggregates.get(key);
200
+ if (!stored)
201
+ return null;
202
+ return { version: stored.version, value: { ...stored.value } };
203
+ }
204
+ async readChain(chainId) {
205
+ this.requireOperation('read');
206
+ this.assertAccessible('chain', chainId);
207
+ const chain = this.#deps.backend.scopeState(this.boundScope).chains.get(chainId);
208
+ if (chain?.disposed)
209
+ throw new StorageDeniedError('chain disposed');
210
+ return (chain?.records ?? []).map((entry) => ({ ...entry }));
211
+ }
212
+ async readPage(chainId, limit, cursor, maxEncodedBytes) {
213
+ this.requireOperation('read');
214
+ if (this.#deps.coordinator) {
215
+ if (!nonEmpty(chainId) || !Number.isSafeInteger(limit) || limit <= 0 ||
216
+ !Number.isSafeInteger(maxEncodedBytes) || maxEncodedBytes <= 0) {
217
+ throw new StorageInvalidCommandError('invalid coordinated page arguments');
218
+ }
219
+ if (cursor != null && this.#deps.provider.verify(chainId, cursor, {
220
+ moduleId: this.moduleId, scope: this.boundScope, incarnation: this.#deps.incarnation,
221
+ }) === null)
222
+ throw new StorageInvalidCommandError('invalid cursor');
223
+ }
224
+ if (!this.accessible('chain', chainId))
225
+ return { outcome: 'inaccessible', records: [], nextCursor: null };
226
+ return readPageFromScope(this.#deps.backend.scopeState(this.boundScope), chainId, limit, cursor, maxEncodedBytes, {
227
+ moduleId: this.moduleId,
228
+ scope: this.boundScope,
229
+ incarnation: this.#deps.incarnation,
230
+ provider: this.#deps.provider,
231
+ });
232
+ }
233
+ async disposeChain(chainId) {
234
+ this.requireOperation('maintain');
235
+ this.change('dispose', [chainId], (state) => disposeChainInScope(state, chainId));
236
+ }
237
+ async commitAtomic(unit, options = {}) {
238
+ this.requireOperation('write');
239
+ const ctx = this.commitContext();
240
+ return this.#deps.coordinator
241
+ ? this.#deps.coordinator.commit(this.grant, [unit], options, ctx, () => this.requireOperation('write'))
242
+ : commitAtomicToScope(this.#deps.backend.scopeState(this.boundScope), unit, options, ctx);
243
+ }
244
+ /** §5.5 ordinary transaction with kernel-bound join.
245
+ *
246
+ * A joined call (same kernel, module and scope) never receives the shared
247
+ * mutable receipt: it returns a frozen provisional copy carrying the
248
+ * reserved commit id with zero effects (`effectiveRecords` and
249
+ * `effectiveAppends` read 0 until the outer commits). Only the outer
250
+ * commit returns the final counts, likewise as a frozen copy, so a joined
251
+ * contributor holding a provisional copy can never rewrite them. A
252
+ * reserved commit id whose outer fails never commits.
253
+ */
254
+ async transact(options, operation) {
255
+ this.requireOperation('write');
256
+ const ambient = txScope.getStore();
257
+ const joinKey = txJoinKey(this.#deps.kernelId, this.moduleId, this.boundScope);
258
+ const joined = ambient?.get(joinKey);
259
+ if (joined) {
260
+ // A live overlay for this module and scope joins (§5.5). A closed one
261
+ // means detached work outliving its context: refuse it instead of
262
+ // opening an independent transaction (R-MAJ-3).
263
+ if (joined.closed)
264
+ throw new StorageInvalidCommandError('transaction closed');
265
+ joined.contributors.set(this.grant.token, this.grant);
266
+ try {
267
+ const value = await operation(this.makeTx(joined));
268
+ // Provisional receipt copy (m2): the joined call returns a frozen
269
+ // snapshot of the reserved commit (zero effects before the outer
270
+ // commits), never the shared mutable receipt object. A reserved
271
+ // commit id that never commits means the outer failed (§5.5: the
272
+ // callback result returns only after commit).
273
+ const provisional = { ...joined.receipt, scope: { ...joined.receipt.scope } };
274
+ Object.freeze(provisional.scope);
275
+ Object.freeze(provisional);
276
+ return { value, receipt: provisional };
277
+ }
278
+ catch (error) {
279
+ joined.rollbackOnly = true;
280
+ joined.savedError = error;
281
+ throw error;
282
+ }
283
+ }
284
+ // The commit id is reserved before the operation runs; every joined call
285
+ // reports that id on its own frozen provisional copy, never the shared
286
+ // mutable receipt, and only the outer commit returns the final counts.
287
+ const commitId = this.#deps.nextCommitId();
288
+ const receipt = { commitId, moduleId: this.moduleId, scope: { ...this.boundScope }, committedAt: this.#deps.clock(), effectiveRecords: 0, effectiveAppends: 0, journalCursor: `cursor-${commitId}` };
289
+ const overlay = { units: [], heads: new Map(), created: new Set(), aggregateVersions: new Map(), aggregateWrites: new Map(), recordWrites: new Map(), chainAppends: new Map(), indexAppends: new Map(), rollbackOnly: false, savedError: null, closed: false, receipt, contributors: new Map([[this.grant.token, this.grant]]), scope: { ...this.boundScope } };
290
+ const nested = new Map(ambient);
291
+ nested.set(joinKey, overlay);
292
+ try {
293
+ const value = await txScope.run(nested, () => operation(this.makeTx(overlay)));
294
+ if (overlay.rollbackOnly)
295
+ throw overlay.savedError ?? new StorageInvalidCommandError('transaction rolled back');
296
+ this.requireOperation('write');
297
+ if (overlay.units.length === 0)
298
+ throw new StorageInvalidCommandError('empty transaction commits nothing');
299
+ // Commit-time revalidation of every contributor (§4.3 m3): a handle
300
+ // revoked or expired between its apply and the outer commit cannot
301
+ // smuggle its units in.
302
+ const revalidate = () => {
303
+ this.requireOperation('write');
304
+ for (const grant of overlay.contributors.values()) {
305
+ const validity = validateScopeGrant(grant, { nowIso: this.#deps.clock() });
306
+ if (!validity.ok)
307
+ throw new StorageDeniedError(validity.errors.join('; '));
308
+ if (this.#deps.revoked.has(grant.token))
309
+ throw new StorageDeniedError('grant revoked');
310
+ this.#deps.authority.attest(grant);
311
+ if (!canOperate(grant, 'write'))
312
+ throw new StorageDeniedError('grant lacks write');
313
+ if (grant.scope.tenantId !== overlay.scope.tenantId || grant.scope.workspaceId !== overlay.scope.workspaceId) {
314
+ throw new StorageDeniedError('cross-scope handle');
315
+ }
316
+ }
317
+ };
318
+ revalidate();
319
+ const context = this.commitContext(commitId);
320
+ const committed = this.#deps.coordinator
321
+ ? this.#deps.coordinator.commit(this.grant, overlay.units, options, context, revalidate)
322
+ : commitUnitsToScope(this.#deps.backend.scopeState(this.boundScope), overlay.units, options, context);
323
+ Object.assign(overlay.receipt, committed);
324
+ // Final receipt copy (m2): the outer commit returns its own frozen
325
+ // snapshot, so a joined contributor holding a provisional copy can
326
+ // never rewrite the committed counts.
327
+ const finalReceipt = { ...overlay.receipt, scope: { ...overlay.receipt.scope } };
328
+ Object.freeze(finalReceipt.scope);
329
+ Object.freeze(finalReceipt);
330
+ return { value, receipt: finalReceipt };
331
+ }
332
+ catch (error) {
333
+ if (!overlay.rollbackOnly) {
334
+ overlay.rollbackOnly = true;
335
+ overlay.savedError = error;
336
+ throw error;
337
+ }
338
+ throw overlay.savedError ?? error;
339
+ }
340
+ finally {
341
+ overlay.closed = true;
342
+ }
343
+ }
344
+ makeTx(overlay) {
345
+ const backendState = () => this.#deps.backend.scopeState(this.boundScope);
346
+ const effectiveHead = (chainId) => {
347
+ if (overlay.heads.has(chainId))
348
+ return overlay.heads.get(chainId) ?? null;
349
+ return backendState().chains.get(chainId)?.head ?? null;
350
+ };
351
+ const effectiveAggregateVersion = (key) => {
352
+ if (overlay.aggregateVersions.has(key))
353
+ return overlay.aggregateVersions.get(key);
354
+ return backendState().aggregates.get(key)?.version;
355
+ };
356
+ const markFailed = (error) => {
357
+ overlay.rollbackOnly = true;
358
+ overlay.savedError = error;
359
+ throw error;
360
+ };
361
+ // Predicate view over the overlay: base state plus pending writes, so
362
+ // apply-time evaluation already sees read-your-writes (R-MAJ-6). The
363
+ // commit re-evaluates every guard against the staged state, which is the
364
+ // predicate dependency tracking for K3: no guard survives unevaluated.
365
+ const overlayView = () => ({
366
+ readHead: (chainId) => effectiveHead(chainId),
367
+ hasChain: (chainId) => overlay.created.has(chainId) || backendState().chains.has(chainId),
368
+ readRecord: (key) => {
369
+ const pending = overlay.recordWrites.get(key);
370
+ if (pending)
371
+ return { bytes: { ...pending.bytes }, contentHash: pending.contentHash };
372
+ const stored = backendState().records.get(key);
373
+ if (!stored)
374
+ return null;
375
+ return { bytes: { ...stored.bytes }, contentHash: stored.contentHash };
376
+ },
377
+ readAggregateVersion: (key) => effectiveAggregateVersion(key),
378
+ });
379
+ const predicateContext = (predicateId) => ({
380
+ moduleId: this.moduleId,
381
+ scope: { ...this.boundScope },
382
+ predicateId,
383
+ view: overlayView(),
384
+ });
385
+ const checkApplyGuard = (guard) => {
386
+ if (guard.kind === 'head') {
387
+ if (effectiveHead(guard.chainId) !== guard.hash)
388
+ throw new StorageCasConflictError('guard head mismatch');
389
+ }
390
+ else if (guard.kind === 'absent') {
391
+ if (overlay.created.has(guard.chainId) || backendState().chains.has(guard.chainId)) {
392
+ throw new StorageIdempotencyConflictError('guard absent violated');
393
+ }
394
+ }
395
+ else if (guard.kind === 'aggregate-version') {
396
+ if (effectiveAggregateVersion(guard.key) !== guard.version) {
397
+ throw new StorageCasConflictError('guard aggregate version mismatch');
398
+ }
399
+ }
400
+ else if (guard.kind === 'predicate') {
401
+ if (!nonEmpty(guard.predicateId) || !nonEmpty(guard.dependency)) {
402
+ throw new StorageInvalidCommandError('predicate guard requires an id and dependency');
403
+ }
404
+ // Own-property lookup only (O3): an inherited key such as
405
+ // 'constructor' must read as unregistered, never as an evaluator.
406
+ const registry = this.#deps.predicates;
407
+ const evaluator = registry !== undefined && Object.hasOwn(registry, guard.predicateId) ? registry[guard.predicateId] : undefined;
408
+ if (!evaluator)
409
+ throw new UnsupportedProfileError(`predicate:${guard.predicateId}`);
410
+ if (!evaluator(guard.dependency, predicateContext(guard.predicateId))) {
411
+ throw new StorageCasConflictError('predicate guard mismatch');
412
+ }
413
+ }
414
+ else {
415
+ throw new StorageInvalidCommandError(`unknown guard kind:${guard.kind}`);
416
+ }
417
+ };
418
+ // Every transactional read revalidates authority (§4.3, R-MAJ-4): a
419
+ // write-only grant cannot read through its transaction, and a grant
420
+ // revoked or expired mid-callback denies the next read.
421
+ const txReadGuard = () => {
422
+ if (overlay.closed)
423
+ throw new StorageInvalidCommandError('transaction closed');
424
+ this.requireOperation('read');
425
+ };
426
+ return {
427
+ apply: async (unit) => {
428
+ if (overlay.closed)
429
+ throw new StorageInvalidCommandError('transaction closed');
430
+ try {
431
+ this.requireOperation('write');
432
+ for (const guard of unit.guards)
433
+ checkApplyGuard(guard);
434
+ // Sequential provisional checks (Sol-4): each append is CAS-checked
435
+ // against the heads advanced by the earlier appends of this same
436
+ // unit, so a create-then-append unit applies together.
437
+ for (const append of unit.appends) {
438
+ if (append.expectation.kind === 'absent') {
439
+ if (overlay.created.has(append.chainId) || backendState().chains.has(append.chainId)) {
440
+ throw new StorageIdempotencyConflictError('stale creation expectation');
441
+ }
442
+ overlay.created.add(append.chainId);
443
+ }
444
+ else {
445
+ if (effectiveHead(append.chainId) !== append.expectation.hash) {
446
+ throw new StorageCasConflictError('stale head at commit');
447
+ }
448
+ }
449
+ overlay.heads.set(append.chainId, append.record.hash);
450
+ const pending = overlay.chainAppends.get(append.chainId) ?? [];
451
+ pending.push({ ...append.record });
452
+ overlay.chainAppends.set(append.chainId, pending);
453
+ }
454
+ for (const update of unit.updates) {
455
+ overlay.aggregateVersions.set(update.key, update.version);
456
+ overlay.aggregateWrites.set(update.key, { version: update.version, value: { ...update.value } });
457
+ }
458
+ for (const record of unit.records) {
459
+ overlay.recordWrites.set(record.key, { bytes: { ...record.bytes }, contentHash: record.contentHash });
460
+ }
461
+ for (const write of unit.indexWrites) {
462
+ overlay.indexAppends.set(write.key, { digest: write.digest, resultIds: [...write.resultIds], resultHash: write.resultHash });
463
+ }
464
+ }
465
+ catch (error) {
466
+ markFailed(error);
467
+ }
468
+ // The flush plan is frozen: later caller-side mutation of the unit
469
+ // cannot change what the commit stages.
470
+ const frozen = JSON.parse(JSON.stringify(unit));
471
+ overlay.units.push(frozen);
472
+ },
473
+ readHead: async (chainId) => {
474
+ txReadGuard();
475
+ this.assertAccessible('chain', chainId);
476
+ if (backendState().chains.get(chainId)?.disposed)
477
+ throw new StorageDeniedError('chain disposed');
478
+ return effectiveHead(chainId);
479
+ },
480
+ readAggregate: async (key) => {
481
+ txReadGuard();
482
+ this.assertAccessible('aggregate', key);
483
+ const pending = overlay.aggregateWrites.get(key);
484
+ if (pending)
485
+ return { version: pending.version, value: { ...pending.value } };
486
+ const stored = backendState().aggregates.get(key);
487
+ if (!stored)
488
+ return null;
489
+ return { version: stored.version, value: { ...stored.value } };
490
+ },
491
+ readRecord: async (key) => {
492
+ txReadGuard();
493
+ this.assertAccessible('record', key);
494
+ const pending = overlay.recordWrites.get(key);
495
+ if (pending)
496
+ return { bytes: { ...pending.bytes }, contentHash: pending.contentHash };
497
+ const stored = backendState().records.get(key);
498
+ if (!stored)
499
+ return null;
500
+ return { bytes: { ...stored.bytes }, contentHash: stored.contentHash };
501
+ },
502
+ readChain: async (input) => {
503
+ txReadGuard();
504
+ if (typeof input !== 'object' || input === null)
505
+ throw new StorageInvalidCommandError('chain read requires a request');
506
+ const { chainId, limit, maxEncodedBytes } = input;
507
+ const cursor = input.cursor ?? null;
508
+ if (!nonEmpty(chainId))
509
+ throw new StorageInvalidCommandError('chain read requires a chainId');
510
+ if (!Number.isSafeInteger(limit) || limit <= 0)
511
+ throw new StorageInvalidCommandError('invalid limit');
512
+ if (!Number.isSafeInteger(maxEncodedBytes) || maxEncodedBytes <= 0) {
513
+ throw new StorageInvalidCommandError('invalid byte budget');
514
+ }
515
+ if (cursor != null && this.#deps.provider.verify(chainId, cursor, {
516
+ moduleId: this.moduleId, scope: this.boundScope, incarnation: this.#deps.incarnation,
517
+ }) === null)
518
+ throw new StorageInvalidCommandError('invalid cursor');
519
+ if (!this.accessible('chain', chainId))
520
+ return { outcome: 'inaccessible', records: [], nextCursor: null };
521
+ // Paginated over the combined committed-plus-pending view: delegate
522
+ // to the committed pager on a scratch scope state, so tx pages share
523
+ // the exact budget, floor and cursor semantics of readPage (§5.2).
524
+ // The scratch state is discarded; canonical state is never touched.
525
+ const state = backendState();
526
+ const committed = state.chains.get(chainId);
527
+ let allocation = committed?.allocation ?? '0';
528
+ const combined = forkIndexedHistory(committed?.records ?? []);
529
+ for (const record of overlay.chainAppends.get(chainId) ?? []) {
530
+ allocation = incrementBackendAllocation(allocation);
531
+ combined.push({ id: record.id, seq: combined.length, hash: record.hash, bytes: record.bytes });
532
+ }
533
+ const scratch = {
534
+ ...state,
535
+ chains: forkIndexedMap(state.chains).set(chainId, {
536
+ allocation,
537
+ head: combined.length === 0 ? null : combined.at(-1).hash,
538
+ records: combined,
539
+ disposed: committed?.disposed ?? false,
540
+ }),
541
+ };
542
+ return readPageFromScope(scratch, chainId, limit, cursor, maxEncodedBytes, {
543
+ moduleId: this.moduleId,
544
+ scope: this.boundScope,
545
+ incarnation: this.#deps.incarnation,
546
+ provider: this.#deps.provider,
547
+ });
548
+ },
549
+ findIdempotency: async (selector) => {
550
+ txReadGuard();
551
+ this.assertAccessible('index', selector.key);
552
+ // K1 command index (§5.4) with read-your-writes: pending index
553
+ // writes of this transaction win over committed state (R-MAJ-7).
554
+ const pending = overlay.indexAppends.get(selector.key);
555
+ if (pending)
556
+ return { digest: pending.digest, resultIds: [...pending.resultIds], resultHash: pending.resultHash };
557
+ const stored = backendState().index.get(selector.key);
558
+ if (!stored)
559
+ return null;
560
+ return { digest: stored.digest, resultIds: [...stored.resultIds], resultHash: stored.resultHash };
561
+ },
562
+ readRecords: async (keys, limits) => {
563
+ txReadGuard();
564
+ // Limits are mandatory (§5.2): an absent or malformed budget refuses
565
+ // instead of reading unbounded.
566
+ if (!validatePageLimits(limits).ok)
567
+ throw new StorageInvalidCommandError('record read requires valid limits');
568
+ if (keys.length > limits.maxRecords) {
569
+ throw new StorageInvalidCommandError('record read exceeds maxRecords');
570
+ }
571
+ const rows = [];
572
+ for (const key of keys) {
573
+ this.assertAccessible('record', key);
574
+ const pending = overlay.recordWrites.get(key);
575
+ if (pending) {
576
+ rows.push({ key, bytes: { ...pending.bytes }, contentHash: pending.contentHash });
577
+ continue;
578
+ }
579
+ const stored = backendState().records.get(key);
580
+ if (stored)
581
+ rows.push({ key, bytes: { ...stored.bytes }, contentHash: stored.contentHash });
582
+ }
583
+ // The byte budget applies to the encoded result: an over-budget
584
+ // result refuses fail-closed instead of truncating silently.
585
+ if (Buffer.byteLength(JSON.stringify(rows), 'utf8') > limits.maxEncodedBytes) {
586
+ throw new StorageInvalidCommandError('record read exceeds maxEncodedBytes');
587
+ }
588
+ return rows;
589
+ },
590
+ };
591
+ }
592
+ }
593
+ // The prototype is shared by every handle of every kernel in this realm:
594
+ // freezing it closes the cross-module channel (Sol-1 cases A and D), so
595
+ // replacing requireOperation or wrapping a method throws for all handles.
596
+ Object.freeze(ScopedRuntime.prototype);
597
+ //# sourceMappingURL=scope-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-runtime.js","sourceRoot":"","sources":["../../src/storage/scope-runtime.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,yEAAyE;AACzE,qEAAqE;AACrE,6EAA6E;AAC7E,uEAAuE;AACvE,wEAAwE;AACxE,2EAA2E;AAC3E,4EAA4E;AAC5E,wEAAwE;AACxE,oEAAoE;AACpE,4DAA4D;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAmB,MAAM,gBAAgB,CAAC;AACjF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAqC,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAA8C,MAAM,cAAc,CAAC;AACtG,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,GAOlB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAsC,MAAM,gBAAgB,CAAC;AAExF,qEAAqE;AACrE,wEAAwE;AACxE,sDAAsD;AACtD,MAAM,mBAAmB,GAAwC;IAC/D,iBAAiB,EACf,yFAAyF;IAC3F,qBAAqB,EACnB,gGAAgG;IAClG,yBAAyB,EACvB,yLAAyL;IAC3L,iBAAiB,EAAE,+CAA+C;IAClE,wBAAwB,EAAE,sDAAsD;IAChF,iBAAiB,EAAE,+CAA+C;IAClE,eAAe,EAAE,6CAA6C;IAC9D,gBA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