@noy-db/hub 0.4.0 → 0.5.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 (325) hide show
  1. package/dist/api-M7REIE7H.js +20 -0
  2. package/dist/attestation/index.js +16 -16
  3. package/dist/{backup-X7F3TCFV.js → backup-ENTZYW37.js} +9 -9
  4. package/dist/blobs/index.js +11 -11
  5. package/dist/broker/index.js +10 -10
  6. package/dist/cargo/index.js +26 -26
  7. package/dist/{chunk-6ZNSB3H6.js → chunk-3LYMOSY7.js} +2 -2
  8. package/dist/{chunk-LXRTP3AQ.js → chunk-4DGBZEV6.js} +2 -2
  9. package/dist/{chunk-LRRX57UA.js → chunk-4MSNAB64.js} +4 -4
  10. package/dist/{chunk-MXUT7FTE.js → chunk-4SG5TOXK.js} +2 -2
  11. package/dist/{chunk-W66AM5IB.js → chunk-4TXO442D.js} +2 -2
  12. package/dist/{chunk-UADPR6F4.js → chunk-5EKL6BXI.js} +3 -3
  13. package/dist/{chunk-ZBYFMI6D.js → chunk-5UKUOMO6.js} +247 -136
  14. package/dist/chunk-5UKUOMO6.js.map +1 -0
  15. package/dist/{chunk-SU6SGWXM.js → chunk-623QEHDB.js} +6 -6
  16. package/dist/{chunk-IVYQAVWO.js → chunk-653KOQ7A.js} +7 -7
  17. package/dist/{chunk-2BET5QTS.js → chunk-6PFST3FC.js} +4 -4
  18. package/dist/{chunk-PWPYO73B.js → chunk-6RDTG6E5.js} +5 -5
  19. package/dist/{chunk-DAFBJS4Y.js → chunk-7P4LL3JH.js} +3 -3
  20. package/dist/{chunk-S7GIXBXV.js → chunk-AJAOXFCF.js} +8 -8
  21. package/dist/chunk-AJAOXFCF.js.map +1 -0
  22. package/dist/{chunk-L3YYLT4E.js → chunk-ALUVACKT.js} +2 -2
  23. package/dist/{chunk-QZWTRENR.js → chunk-AR5D76T2.js} +5 -1
  24. package/dist/chunk-AR5D76T2.js.map +1 -0
  25. package/dist/{chunk-5DRROK5W.js → chunk-BFG7LD6Z.js} +2 -2
  26. package/dist/{chunk-6UBZ6I5Z.js → chunk-DDB626I7.js} +2 -2
  27. package/dist/{chunk-W3G5REIU.js → chunk-EAN4TAPC.js} +2 -2
  28. package/dist/{chunk-4JQK3L4V.js → chunk-EBETHILL.js} +2 -2
  29. package/dist/{chunk-467SWYT5.js → chunk-ECGDJU5R.js} +3 -3
  30. package/dist/{chunk-WYUAEZSC.js → chunk-ELJOLQIG.js} +14 -13
  31. package/dist/chunk-ELJOLQIG.js.map +1 -0
  32. package/dist/{chunk-ZFG5EBI3.js → chunk-F2WWHKO7.js} +5 -5
  33. package/dist/{chunk-NJ4DYYO5.js → chunk-F5UWVF6Z.js} +2 -2
  34. package/dist/{chunk-Q36YXK77.js → chunk-FHK6WWUE.js} +2 -2
  35. package/dist/{chunk-SHEEBRZ4.js → chunk-FT5Y4VSP.js} +2 -2
  36. package/dist/{chunk-JQ2AX4T5.js → chunk-FUECZSRM.js} +2 -2
  37. package/dist/{chunk-Q5YJCVJY.js → chunk-FZAP4JNC.js} +4 -4
  38. package/dist/{chunk-SFBYQMZM.js → chunk-G3ORJ3IQ.js} +4 -4
  39. package/dist/{chunk-HLKXPJ4V.js → chunk-G7ZIMGPQ.js} +5 -5
  40. package/dist/{chunk-QJNCB5SK.js → chunk-GIGLOQL7.js} +2 -2
  41. package/dist/{chunk-ERGECZEI.js → chunk-GTQF32TP.js} +5 -5
  42. package/dist/{chunk-JYJFGD2H.js → chunk-GYJRDALN.js} +2 -2
  43. package/dist/{chunk-HZZP2ZIG.js → chunk-HGDXJVK2.js} +4 -4
  44. package/dist/{chunk-ZNWSG7XC.js → chunk-IHYSIPEK.js} +6 -6
  45. package/dist/{chunk-5GQEU4DN.js → chunk-IJV56FWY.js} +2 -2
  46. package/dist/{chunk-5UQ7Y6SQ.js → chunk-IM2KST7E.js} +3 -3
  47. package/dist/{chunk-7H3WWH6J.js → chunk-IQ423YMK.js} +3 -3
  48. package/dist/{chunk-P4JO3H6R.js → chunk-J7YVY7TW.js} +2 -2
  49. package/dist/{chunk-YGK2HMLR.js → chunk-JLBCK7XM.js} +8 -8
  50. package/dist/chunk-JLBCK7XM.js.map +1 -0
  51. package/dist/{chunk-2J6UEN2V.js → chunk-K5OFKXUG.js} +2 -2
  52. package/dist/{chunk-JEI6JJNI.js → chunk-KDWBVCIX.js} +5 -5
  53. package/dist/{chunk-T2MOJF76.js → chunk-KJNMTE2W.js} +6 -6
  54. package/dist/{chunk-NFZGZ4AK.js → chunk-L67H6FAQ.js} +2 -2
  55. package/dist/{chunk-RBTVFPHF.js → chunk-LQVRK2XJ.js} +4 -4
  56. package/dist/{chunk-MHMLXJ3I.js → chunk-LXRVTJ5D.js} +2 -2
  57. package/dist/{chunk-LLYIMSQQ.js → chunk-MDRCEA56.js} +10 -10
  58. package/dist/{chunk-KRCBZYTZ.js → chunk-MFW466PX.js} +4 -4
  59. package/dist/{chunk-RO5NM6UI.js → chunk-MGXUAID4.js} +2 -2
  60. package/dist/{chunk-OWHP3H5C.js → chunk-MPW6AHTC.js} +3 -3
  61. package/dist/{chunk-35NMVJ7I.js → chunk-MYSNNMJ3.js} +3 -3
  62. package/dist/{chunk-QGIBI6GL.js → chunk-NG4AQIYJ.js} +4 -4
  63. package/dist/{chunk-BLBAQRBM.js → chunk-NIKQQXI2.js} +2 -2
  64. package/dist/{chunk-55LX6FSX.js → chunk-NJHQE4LT.js} +2 -2
  65. package/dist/{chunk-TS5XLBZR.js → chunk-NMYH55MW.js} +4 -4
  66. package/dist/{chunk-GTYFIVIZ.js → chunk-NWK6SVBM.js} +5 -5
  67. package/dist/chunk-NWK6SVBM.js.map +1 -0
  68. package/dist/{chunk-IFOH7RBI.js → chunk-NZEGQWQ5.js} +4 -4
  69. package/dist/{chunk-DTFA5DO4.js → chunk-ODCEOSJF.js} +2 -2
  70. package/dist/{chunk-NYEFP7DY.js → chunk-OKBNFUUX.js} +2 -2
  71. package/dist/{chunk-SGDPRCC4.js → chunk-OKRXXFZZ.js} +3 -3
  72. package/dist/{chunk-IG6KUWBX.js → chunk-P6UIVLZK.js} +2 -2
  73. package/dist/{chunk-V6UQZA2H.js → chunk-PKBONLCP.js} +2 -2
  74. package/dist/{chunk-MSMJJB4J.js → chunk-PTSVGKSR.js} +2 -2
  75. package/dist/{chunk-IXNCZTWA.js → chunk-PWEMRXPO.js} +2 -2
  76. package/dist/{chunk-PTHKZWEH.js → chunk-PZRYKOKP.js} +2 -2
  77. package/dist/{chunk-KD4HGBJV.js → chunk-Q6MXHDSE.js} +3 -3
  78. package/dist/{chunk-RQ4ZI4ZI.js → chunk-QITP2JGX.js} +5 -5
  79. package/dist/{chunk-WBKZUO5V.js → chunk-QMCWYN6O.js} +3 -3
  80. package/dist/{chunk-4ZKNC6A6.js → chunk-QQL6XPPG.js} +2 -2
  81. package/dist/{chunk-TG634KCO.js → chunk-QTMZDMJ6.js} +2 -2
  82. package/dist/{chunk-AT2JJEKJ.js → chunk-RM4FIXY2.js} +4 -4
  83. package/dist/{chunk-AKKRXT23.js → chunk-RPWMDIGK.js} +2 -2
  84. package/dist/{chunk-NBXFCQX4.js → chunk-RQILGK3N.js} +8 -8
  85. package/dist/chunk-RQILGK3N.js.map +1 -0
  86. package/dist/{chunk-NM5UYF6Q.js → chunk-SBGXQK5I.js} +2 -2
  87. package/dist/{chunk-SF2ZIRD6.js → chunk-SL3PLML2.js} +3 -3
  88. package/dist/{chunk-3ECU57YH.js → chunk-TJOUKMWF.js} +8 -8
  89. package/dist/{chunk-QD46HPZG.js → chunk-U2ID5A2I.js} +2 -2
  90. package/dist/{chunk-X4MVWPHV.js → chunk-UC5Y7OEJ.js} +3 -3
  91. package/dist/{chunk-SBHN6QUT.js → chunk-US2AR4BI.js} +2 -2
  92. package/dist/{chunk-DQZXPGGZ.js → chunk-V3EGXDFN.js} +3 -3
  93. package/dist/{chunk-ZHDSUZQU.js → chunk-V4O6YZSP.js} +3 -3
  94. package/dist/{chunk-3HUYRN24.js → chunk-W7C7MMIS.js} +3 -3
  95. package/dist/{chunk-NLYALJMY.js → chunk-WFYKIDCS.js} +30 -11
  96. package/dist/chunk-WFYKIDCS.js.map +1 -0
  97. package/dist/{chunk-TWPK7KUJ.js → chunk-XID22NOA.js} +5 -5
  98. package/dist/{chunk-E23UGFVC.js → chunk-XVK7TULT.js} +2 -2
  99. package/dist/{chunk-WUHEP3HH.js → chunk-XX7YB5BI.js} +4 -4
  100. package/dist/{chunk-ZTLOXFPB.js → chunk-Y2PTKKIN.js} +2 -2
  101. package/dist/{chunk-KYRDJI5O.js → chunk-YA7Y3EZP.js} +10 -10
  102. package/dist/classified/index.js +4 -4
  103. package/dist/{classified-marker-LE54HWSX.js → classified-marker-ZALWKOBC.js} +3 -3
  104. package/dist/{collection-facade-DO2AABZT.js → collection-facade-KI53O6QB.js} +15 -15
  105. package/dist/{computed-AB45PS4V.js → computed-YOQCGUCS.js} +3 -3
  106. package/dist/consent/index.js +7 -7
  107. package/dist/cover/index.js +2 -2
  108. package/dist/custody/index.js +9 -9
  109. package/dist/{dead-filter-V3LVWYEJ.js → dead-filter-6DVWST6U.js} +2 -2
  110. package/dist/debug/index.js +1 -1
  111. package/dist/{delegation-JDUMAF6L.js → delegation-WMO3Q3O5.js} +8 -8
  112. package/dist/derivations/index.js +10 -10
  113. package/dist/{derive-ZPGVLE2Q.js → derive-P2NXWUNB.js} +8 -8
  114. package/dist/directory/index.js +8 -8
  115. package/dist/{dispatch-W7NWQ637.js → dispatch-TKV4UCKB.js} +16 -16
  116. package/dist/{dispatch-6TV3DGO6.js → dispatch-VNR3TLBX.js} +5 -5
  117. package/dist/{enclave-YFCLPIDR.js → enclave-YWP3QAIQ.js} +7 -7
  118. package/dist/executor-M4ZZNX6S.js +28 -0
  119. package/dist/executor-TI64S4LE.js +9 -0
  120. package/dist/executor-YBK3I2OT.js +9 -0
  121. package/dist/export-accessible-GBLYLGW4.js +23 -0
  122. package/dist/extract-partition-SFV35U2R.js +38 -0
  123. package/dist/{fanout-sidecar-273RDMYS.js → fanout-sidecar-WYXO6QQT.js} +7 -7
  124. package/dist/find-HUSSZRBR.js +11 -0
  125. package/dist/forget/index.js +7 -7
  126. package/dist/guards/index.js +5 -5
  127. package/dist/history/index.js +10 -10
  128. package/dist/i18n/index.js +12 -12
  129. package/dist/index.d.ts +1 -1
  130. package/dist/index.js +86 -84
  131. package/dist/index.js.map +1 -1
  132. package/dist/indexing/index.js +2 -2
  133. package/dist/introspection/index.js +9 -9
  134. package/dist/issue-6TIJYWKS.js +19 -0
  135. package/dist/kernel/collection-config.d.ts +4 -0
  136. package/dist/kernel/collection.d.ts +24 -6
  137. package/dist/kernel/errors.d.ts +15 -0
  138. package/dist/kernel/put-many-atomic.d.ts +45 -0
  139. package/dist/kernel/vault.d.ts +14 -0
  140. package/dist/{ledger-XE7JF2I2.js → ledger-BLYDYRTQ.js} +9 -9
  141. package/dist/liberate-TSOW7IG5.js +24 -0
  142. package/dist/{link-set-CGYC3OH5.js → link-set-7F5ZPDEB.js} +9 -9
  143. package/dist/materialized-views/index.js +22 -22
  144. package/dist/money/index.js +3 -3
  145. package/dist/noydb-KFN6M6UJ.js +81 -0
  146. package/dist/overlay-views/index.js +4 -4
  147. package/dist/periods/index.js +11 -11
  148. package/dist/pod/index.js +9 -9
  149. package/dist/policy/index.js +2 -2
  150. package/dist/port/with/write-hooks.d.ts +6 -0
  151. package/dist/portability/index.js +8 -8
  152. package/dist/{post-register-LY35EDTJ.js → post-register-PQSY544J.js} +6 -6
  153. package/dist/query/index.js +3 -3
  154. package/dist/reduce/index.js +4 -4
  155. package/dist/{register-6RIBIT3I.js → register-S3ECUZPV.js} +10 -10
  156. package/dist/registry-FZOHKUME.js +18 -0
  157. package/dist/registry-RISV7IDZ.js +19 -0
  158. package/dist/registry-ZE35A7WC.js +9 -0
  159. package/dist/{request-withdrawal-FT3ORAWN.js → request-withdrawal-KXVTQKR5.js} +12 -12
  160. package/dist/{reveal-T34ADTPY.js → reveal-HY7DZST4.js} +4 -4
  161. package/dist/{revoke-HC7WG3HE.js → revoke-J473JJ22.js} +9 -9
  162. package/dist/satellites/index.js +1 -1
  163. package/dist/schema-update/index.js +2 -2
  164. package/dist/sealed-record/index.js +10 -10
  165. package/dist/search/index.js +4 -4
  166. package/dist/{seed-JOV54PB3.js → seed-ALU3BHFS.js} +13 -13
  167. package/dist/seed-ALU3BHFS.js.map +1 -0
  168. package/dist/sequence/index.js +7 -7
  169. package/dist/session/index.js +7 -7
  170. package/dist/shadow/index.js +2 -2
  171. package/dist/{signer-CTWOH6KT.js → signer-XLUKCCH3.js} +8 -8
  172. package/dist/snapshots/index.js +8 -8
  173. package/dist/{stale-T3V7XEOB.js → stale-U3WO5MYN.js} +8 -8
  174. package/dist/{storage-LLNLPWWB.js → storage-IQONEOYY.js} +8 -8
  175. package/dist/sync/index.js +8 -8
  176. package/dist/team/index.js +11 -11
  177. package/dist/tiers/index.js +8 -8
  178. package/dist/to/index.js +1 -1
  179. package/dist/transactions/index.js +3 -3
  180. package/dist/util/index.js +1 -1
  181. package/dist/{verify-7XWHJWUN.js → verify-JEIXSK5U.js} +5 -5
  182. package/dist/walk-BF36V4SR.js +21 -0
  183. package/dist/with-commit/tx/atomic-eligibility.d.ts +13 -11
  184. package/dist/with-sync/engine.d.ts +13 -0
  185. package/dist/{withdraw-accessible-ANSVG6XG.js → withdraw-accessible-TYTA23XH.js} +11 -11
  186. package/package.json +3 -3
  187. package/dist/api-SI2IVBQO.js +0 -20
  188. package/dist/chunk-GTYFIVIZ.js.map +0 -1
  189. package/dist/chunk-NBXFCQX4.js.map +0 -1
  190. package/dist/chunk-NLYALJMY.js.map +0 -1
  191. package/dist/chunk-QZWTRENR.js.map +0 -1
  192. package/dist/chunk-S7GIXBXV.js.map +0 -1
  193. package/dist/chunk-WYUAEZSC.js.map +0 -1
  194. package/dist/chunk-YGK2HMLR.js.map +0 -1
  195. package/dist/chunk-ZBYFMI6D.js.map +0 -1
  196. package/dist/executor-FPHKWDWT.js +0 -28
  197. package/dist/executor-IEBLTBCW.js +0 -9
  198. package/dist/executor-RM7XWQDU.js +0 -9
  199. package/dist/export-accessible-EKM3HGB2.js +0 -23
  200. package/dist/extract-partition-LS4ET5A6.js +0 -38
  201. package/dist/find-OZMTRIK3.js +0 -11
  202. package/dist/issue-LIA7FXBJ.js +0 -19
  203. package/dist/liberate-WZ3RHVKW.js +0 -24
  204. package/dist/noydb-ZLPVCDES.js +0 -81
  205. package/dist/registry-7Y5WF7GS.js +0 -9
  206. package/dist/registry-MUSL4AW6.js +0 -19
  207. package/dist/registry-RON4WHAP.js +0 -18
  208. package/dist/seed-JOV54PB3.js.map +0 -1
  209. package/dist/walk-G3NFEP5L.js +0 -21
  210. /package/dist/{api-SI2IVBQO.js.map → api-M7REIE7H.js.map} +0 -0
  211. /package/dist/{backup-X7F3TCFV.js.map → backup-ENTZYW37.js.map} +0 -0
  212. /package/dist/{chunk-6ZNSB3H6.js.map → chunk-3LYMOSY7.js.map} +0 -0
  213. /package/dist/{chunk-LXRTP3AQ.js.map → chunk-4DGBZEV6.js.map} +0 -0
  214. /package/dist/{chunk-LRRX57UA.js.map → chunk-4MSNAB64.js.map} +0 -0
  215. /package/dist/{chunk-MXUT7FTE.js.map → chunk-4SG5TOXK.js.map} +0 -0
  216. /package/dist/{chunk-W66AM5IB.js.map → chunk-4TXO442D.js.map} +0 -0
  217. /package/dist/{chunk-UADPR6F4.js.map → chunk-5EKL6BXI.js.map} +0 -0
  218. /package/dist/{chunk-SU6SGWXM.js.map → chunk-623QEHDB.js.map} +0 -0
  219. /package/dist/{chunk-IVYQAVWO.js.map → chunk-653KOQ7A.js.map} +0 -0
  220. /package/dist/{chunk-2BET5QTS.js.map → chunk-6PFST3FC.js.map} +0 -0
  221. /package/dist/{chunk-PWPYO73B.js.map → chunk-6RDTG6E5.js.map} +0 -0
  222. /package/dist/{chunk-DAFBJS4Y.js.map → chunk-7P4LL3JH.js.map} +0 -0
  223. /package/dist/{chunk-L3YYLT4E.js.map → chunk-ALUVACKT.js.map} +0 -0
  224. /package/dist/{chunk-5DRROK5W.js.map → chunk-BFG7LD6Z.js.map} +0 -0
  225. /package/dist/{chunk-6UBZ6I5Z.js.map → chunk-DDB626I7.js.map} +0 -0
  226. /package/dist/{chunk-W3G5REIU.js.map → chunk-EAN4TAPC.js.map} +0 -0
  227. /package/dist/{chunk-4JQK3L4V.js.map → chunk-EBETHILL.js.map} +0 -0
  228. /package/dist/{chunk-467SWYT5.js.map → chunk-ECGDJU5R.js.map} +0 -0
  229. /package/dist/{chunk-ZFG5EBI3.js.map → chunk-F2WWHKO7.js.map} +0 -0
  230. /package/dist/{chunk-NJ4DYYO5.js.map → chunk-F5UWVF6Z.js.map} +0 -0
  231. /package/dist/{chunk-Q36YXK77.js.map → chunk-FHK6WWUE.js.map} +0 -0
  232. /package/dist/{chunk-SHEEBRZ4.js.map → chunk-FT5Y4VSP.js.map} +0 -0
  233. /package/dist/{chunk-JQ2AX4T5.js.map → chunk-FUECZSRM.js.map} +0 -0
  234. /package/dist/{chunk-Q5YJCVJY.js.map → chunk-FZAP4JNC.js.map} +0 -0
  235. /package/dist/{chunk-SFBYQMZM.js.map → chunk-G3ORJ3IQ.js.map} +0 -0
  236. /package/dist/{chunk-HLKXPJ4V.js.map → chunk-G7ZIMGPQ.js.map} +0 -0
  237. /package/dist/{chunk-QJNCB5SK.js.map → chunk-GIGLOQL7.js.map} +0 -0
  238. /package/dist/{chunk-ERGECZEI.js.map → chunk-GTQF32TP.js.map} +0 -0
  239. /package/dist/{chunk-JYJFGD2H.js.map → chunk-GYJRDALN.js.map} +0 -0
  240. /package/dist/{chunk-HZZP2ZIG.js.map → chunk-HGDXJVK2.js.map} +0 -0
  241. /package/dist/{chunk-ZNWSG7XC.js.map → chunk-IHYSIPEK.js.map} +0 -0
  242. /package/dist/{chunk-5GQEU4DN.js.map → chunk-IJV56FWY.js.map} +0 -0
  243. /package/dist/{chunk-5UQ7Y6SQ.js.map → chunk-IM2KST7E.js.map} +0 -0
  244. /package/dist/{chunk-7H3WWH6J.js.map → chunk-IQ423YMK.js.map} +0 -0
  245. /package/dist/{chunk-P4JO3H6R.js.map → chunk-J7YVY7TW.js.map} +0 -0
  246. /package/dist/{chunk-2J6UEN2V.js.map → chunk-K5OFKXUG.js.map} +0 -0
  247. /package/dist/{chunk-JEI6JJNI.js.map → chunk-KDWBVCIX.js.map} +0 -0
  248. /package/dist/{chunk-T2MOJF76.js.map → chunk-KJNMTE2W.js.map} +0 -0
  249. /package/dist/{chunk-NFZGZ4AK.js.map → chunk-L67H6FAQ.js.map} +0 -0
  250. /package/dist/{chunk-RBTVFPHF.js.map → chunk-LQVRK2XJ.js.map} +0 -0
  251. /package/dist/{chunk-MHMLXJ3I.js.map → chunk-LXRVTJ5D.js.map} +0 -0
  252. /package/dist/{chunk-LLYIMSQQ.js.map → chunk-MDRCEA56.js.map} +0 -0
  253. /package/dist/{chunk-KRCBZYTZ.js.map → chunk-MFW466PX.js.map} +0 -0
  254. /package/dist/{chunk-RO5NM6UI.js.map → chunk-MGXUAID4.js.map} +0 -0
  255. /package/dist/{chunk-OWHP3H5C.js.map → chunk-MPW6AHTC.js.map} +0 -0
  256. /package/dist/{chunk-35NMVJ7I.js.map → chunk-MYSNNMJ3.js.map} +0 -0
  257. /package/dist/{chunk-QGIBI6GL.js.map → chunk-NG4AQIYJ.js.map} +0 -0
  258. /package/dist/{chunk-BLBAQRBM.js.map → chunk-NIKQQXI2.js.map} +0 -0
  259. /package/dist/{chunk-55LX6FSX.js.map → chunk-NJHQE4LT.js.map} +0 -0
  260. /package/dist/{chunk-TS5XLBZR.js.map → chunk-NMYH55MW.js.map} +0 -0
  261. /package/dist/{chunk-IFOH7RBI.js.map → chunk-NZEGQWQ5.js.map} +0 -0
  262. /package/dist/{chunk-DTFA5DO4.js.map → chunk-ODCEOSJF.js.map} +0 -0
  263. /package/dist/{chunk-NYEFP7DY.js.map → chunk-OKBNFUUX.js.map} +0 -0
  264. /package/dist/{chunk-SGDPRCC4.js.map → chunk-OKRXXFZZ.js.map} +0 -0
  265. /package/dist/{chunk-IG6KUWBX.js.map → chunk-P6UIVLZK.js.map} +0 -0
  266. /package/dist/{chunk-V6UQZA2H.js.map → chunk-PKBONLCP.js.map} +0 -0
  267. /package/dist/{chunk-MSMJJB4J.js.map → chunk-PTSVGKSR.js.map} +0 -0
  268. /package/dist/{chunk-IXNCZTWA.js.map → chunk-PWEMRXPO.js.map} +0 -0
  269. /package/dist/{chunk-PTHKZWEH.js.map → chunk-PZRYKOKP.js.map} +0 -0
  270. /package/dist/{chunk-KD4HGBJV.js.map → chunk-Q6MXHDSE.js.map} +0 -0
  271. /package/dist/{chunk-RQ4ZI4ZI.js.map → chunk-QITP2JGX.js.map} +0 -0
  272. /package/dist/{chunk-WBKZUO5V.js.map → chunk-QMCWYN6O.js.map} +0 -0
  273. /package/dist/{chunk-4ZKNC6A6.js.map → chunk-QQL6XPPG.js.map} +0 -0
  274. /package/dist/{chunk-TG634KCO.js.map → chunk-QTMZDMJ6.js.map} +0 -0
  275. /package/dist/{chunk-AT2JJEKJ.js.map → chunk-RM4FIXY2.js.map} +0 -0
  276. /package/dist/{chunk-AKKRXT23.js.map → chunk-RPWMDIGK.js.map} +0 -0
  277. /package/dist/{chunk-NM5UYF6Q.js.map → chunk-SBGXQK5I.js.map} +0 -0
  278. /package/dist/{chunk-SF2ZIRD6.js.map → chunk-SL3PLML2.js.map} +0 -0
  279. /package/dist/{chunk-3ECU57YH.js.map → chunk-TJOUKMWF.js.map} +0 -0
  280. /package/dist/{chunk-QD46HPZG.js.map → chunk-U2ID5A2I.js.map} +0 -0
  281. /package/dist/{chunk-X4MVWPHV.js.map → chunk-UC5Y7OEJ.js.map} +0 -0
  282. /package/dist/{chunk-SBHN6QUT.js.map → chunk-US2AR4BI.js.map} +0 -0
  283. /package/dist/{chunk-DQZXPGGZ.js.map → chunk-V3EGXDFN.js.map} +0 -0
  284. /package/dist/{chunk-ZHDSUZQU.js.map → chunk-V4O6YZSP.js.map} +0 -0
  285. /package/dist/{chunk-3HUYRN24.js.map → chunk-W7C7MMIS.js.map} +0 -0
  286. /package/dist/{chunk-TWPK7KUJ.js.map → chunk-XID22NOA.js.map} +0 -0
  287. /package/dist/{chunk-E23UGFVC.js.map → chunk-XVK7TULT.js.map} +0 -0
  288. /package/dist/{chunk-WUHEP3HH.js.map → chunk-XX7YB5BI.js.map} +0 -0
  289. /package/dist/{chunk-ZTLOXFPB.js.map → chunk-Y2PTKKIN.js.map} +0 -0
  290. /package/dist/{chunk-KYRDJI5O.js.map → chunk-YA7Y3EZP.js.map} +0 -0
  291. /package/dist/{classified-marker-LE54HWSX.js.map → classified-marker-ZALWKOBC.js.map} +0 -0
  292. /package/dist/{collection-facade-DO2AABZT.js.map → collection-facade-KI53O6QB.js.map} +0 -0
  293. /package/dist/{computed-AB45PS4V.js.map → computed-YOQCGUCS.js.map} +0 -0
  294. /package/dist/{dead-filter-V3LVWYEJ.js.map → dead-filter-6DVWST6U.js.map} +0 -0
  295. /package/dist/{delegation-JDUMAF6L.js.map → delegation-WMO3Q3O5.js.map} +0 -0
  296. /package/dist/{derive-ZPGVLE2Q.js.map → derive-P2NXWUNB.js.map} +0 -0
  297. /package/dist/{dispatch-W7NWQ637.js.map → dispatch-TKV4UCKB.js.map} +0 -0
  298. /package/dist/{dispatch-6TV3DGO6.js.map → dispatch-VNR3TLBX.js.map} +0 -0
  299. /package/dist/{enclave-YFCLPIDR.js.map → enclave-YWP3QAIQ.js.map} +0 -0
  300. /package/dist/{executor-FPHKWDWT.js.map → executor-M4ZZNX6S.js.map} +0 -0
  301. /package/dist/{executor-IEBLTBCW.js.map → executor-TI64S4LE.js.map} +0 -0
  302. /package/dist/{executor-RM7XWQDU.js.map → executor-YBK3I2OT.js.map} +0 -0
  303. /package/dist/{export-accessible-EKM3HGB2.js.map → export-accessible-GBLYLGW4.js.map} +0 -0
  304. /package/dist/{extract-partition-LS4ET5A6.js.map → extract-partition-SFV35U2R.js.map} +0 -0
  305. /package/dist/{fanout-sidecar-273RDMYS.js.map → fanout-sidecar-WYXO6QQT.js.map} +0 -0
  306. /package/dist/{find-OZMTRIK3.js.map → find-HUSSZRBR.js.map} +0 -0
  307. /package/dist/{issue-LIA7FXBJ.js.map → issue-6TIJYWKS.js.map} +0 -0
  308. /package/dist/{ledger-XE7JF2I2.js.map → ledger-BLYDYRTQ.js.map} +0 -0
  309. /package/dist/{liberate-WZ3RHVKW.js.map → liberate-TSOW7IG5.js.map} +0 -0
  310. /package/dist/{link-set-CGYC3OH5.js.map → link-set-7F5ZPDEB.js.map} +0 -0
  311. /package/dist/{noydb-ZLPVCDES.js.map → noydb-KFN6M6UJ.js.map} +0 -0
  312. /package/dist/{post-register-LY35EDTJ.js.map → post-register-PQSY544J.js.map} +0 -0
  313. /package/dist/{register-6RIBIT3I.js.map → register-S3ECUZPV.js.map} +0 -0
  314. /package/dist/{registry-7Y5WF7GS.js.map → registry-FZOHKUME.js.map} +0 -0
  315. /package/dist/{registry-MUSL4AW6.js.map → registry-RISV7IDZ.js.map} +0 -0
  316. /package/dist/{registry-RON4WHAP.js.map → registry-ZE35A7WC.js.map} +0 -0
  317. /package/dist/{request-withdrawal-FT3ORAWN.js.map → request-withdrawal-KXVTQKR5.js.map} +0 -0
  318. /package/dist/{reveal-T34ADTPY.js.map → reveal-HY7DZST4.js.map} +0 -0
  319. /package/dist/{revoke-HC7WG3HE.js.map → revoke-J473JJ22.js.map} +0 -0
  320. /package/dist/{signer-CTWOH6KT.js.map → signer-XLUKCCH3.js.map} +0 -0
  321. /package/dist/{stale-T3V7XEOB.js.map → stale-U3WO5MYN.js.map} +0 -0
  322. /package/dist/{storage-LLNLPWWB.js.map → storage-IQONEOYY.js.map} +0 -0
  323. /package/dist/{verify-7XWHJWUN.js.map → verify-JEIXSK5U.js.map} +0 -0
  324. /package/dist/{walk-G3NFEP5L.js.map → walk-BF36V4SR.js.map} +0 -0
  325. /package/dist/{withdraw-accessible-ANSVG6XG.js.map → withdraw-accessible-TYTA23XH.js.map} +0 -0
@@ -201,7 +201,7 @@ var engineCtx = (ctx) => ({
201
201
  function withClassified() {
202
202
  return {
203
203
  async reveal(ctx, id, field) {
204
- const { revealSealedField } = await import("./reveal-T34ADTPY.js");
204
+ const { revealSealedField } = await import("./reveal-HY7DZST4.js");
205
205
  const value = await revealSealedField({
206
206
  collection: ctx.collection,
207
207
  encrypted: ctx.encrypted,
@@ -213,26 +213,26 @@ function withClassified() {
213
213
  return value;
214
214
  },
215
215
  async verify(ctx, id, field, candidate) {
216
- const { verifyDigestField } = await import("./verify-7XWHJWUN.js");
216
+ const { verifyDigestField } = await import("./verify-JEIXSK5U.js");
217
217
  const verdict = await verifyDigestField(engineCtx(ctx), id, field, candidate, policyOf(ctx.spec));
218
218
  await ctx.onAccess?.("verify", id);
219
219
  return verdict;
220
220
  },
221
221
  async verifyText(ctx, id, field, candidate) {
222
- const { verifyTextField } = await import("./verify-7XWHJWUN.js");
222
+ const { verifyTextField } = await import("./verify-JEIXSK5U.js");
223
223
  const verdict = await verifyTextField(engineCtx(ctx), id, field, candidate, ctx.spec.verifyNormalize ?? "password");
224
224
  await ctx.onAccess?.("verify", id);
225
225
  return verdict;
226
226
  },
227
227
  async matchGroup(ctx, id, answers, opts) {
228
- const { matchGroupFields } = await import("./verify-7XWHJWUN.js");
228
+ const { matchGroupFields } = await import("./verify-JEIXSK5U.js");
229
229
  const members = (ctx.groupMembers ?? []).map((m) => ({ field: m.field, policy: policyOf(m.spec) }));
230
230
  const result = await matchGroupFields(engineCtx(ctx), id, answers, members, opts);
231
231
  await ctx.onAccess?.("verify", id);
232
232
  return result;
233
233
  },
234
234
  async computeTarget(ctx, field, candidate, costByte) {
235
- const { computeBidxTarget } = await import("./find-OZMTRIK3.js");
235
+ const { computeBidxTarget } = await import("./find-HUSSZRBR.js");
236
236
  const dek = await ctx.getDEK();
237
237
  return computeBidxTarget(candidate, policyOf(ctx.spec).normalize, dek, ctx.collection, field, costByte);
238
238
  }
@@ -244,4 +244,4 @@ export {
244
244
  classified,
245
245
  withClassified
246
246
  };
247
- //# sourceMappingURL=chunk-T2MOJF76.js.map
247
+ //# sourceMappingURL=chunk-KJNMTE2W.js.map
@@ -2,7 +2,7 @@ import {
2
2
  decrypt,
3
3
  deriveSealedFieldKey,
4
4
  deriveSealedFieldKeyFromCek
5
- } from "./chunk-AKKRXT23.js";
5
+ } from "./chunk-RPWMDIGK.js";
6
6
 
7
7
  // src/kernel/enclave/record-keys/sealed-slot.ts
8
8
  function parseSealedSlot(blob) {
@@ -26,4 +26,4 @@ export {
26
26
  parseSealedSlot,
27
27
  dualReadSealedSlot
28
28
  };
29
- //# sourceMappingURL=chunk-NFZGZ4AK.js.map
29
+ //# sourceMappingURL=chunk-L67H6FAQ.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  ATTESTATIONS_COLLECTION,
3
3
  loadOrCreateSigner
4
- } from "./chunk-IFOH7RBI.js";
4
+ } from "./chunk-NZEGQWQ5.js";
5
5
  import {
6
6
  generateULID
7
7
  } from "./chunk-ZJADGNYF.js";
8
8
  import {
9
9
  encrypt
10
- } from "./chunk-AKKRXT23.js";
10
+ } from "./chunk-RPWMDIGK.js";
11
11
  import {
12
12
  NOYDB_FORMAT_VERSION
13
13
  } from "./chunk-77AEMXFA.js";
14
14
  import {
15
15
  AttestationError
16
- } from "./chunk-QZWTRENR.js";
16
+ } from "./chunk-AR5D76T2.js";
17
17
 
18
18
  // src/with-audit/attestation/issue.ts
19
19
  import {
@@ -56,4 +56,4 @@ async function issueAttestationCore(ctx, args) {
56
56
  export {
57
57
  issueAttestationCore
58
58
  };
59
- //# sourceMappingURL=chunk-RBTVFPHF.js.map
59
+ //# sourceMappingURL=chunk-LQVRK2XJ.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DerivationCapExceededError,
3
3
  DerivationOutputShapeError
4
- } from "./chunk-QZWTRENR.js";
4
+ } from "./chunk-AR5D76T2.js";
5
5
 
6
6
  // src/with-formula/derivations/executor.ts
7
7
  var DerivationExecutor = {
@@ -121,4 +121,4 @@ var DerivationExecutor = {
121
121
  export {
122
122
  DerivationExecutor
123
123
  };
124
- //# sourceMappingURL=chunk-MHMLXJ3I.js.map
124
+ //# sourceMappingURL=chunk-LXRVTJ5D.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  walkClosure
3
- } from "./chunk-3ECU57YH.js";
3
+ } from "./chunk-TJOUKMWF.js";
4
4
  import {
5
5
  resolveManagedSecret
6
6
  } from "./chunk-CLE3TMIS.js";
@@ -8,31 +8,31 @@ import {
8
8
  parseExtractedPartitionBody,
9
9
  readPod,
10
10
  readPodHeader
11
- } from "./chunk-JEI6JJNI.js";
11
+ } from "./chunk-KDWBVCIX.js";
12
12
  import {
13
13
  createOwnerKeyring
14
- } from "./chunk-Q5YJCVJY.js";
14
+ } from "./chunk-FZAP4JNC.js";
15
15
  import {
16
16
  diff
17
17
  } from "./chunk-SVLR4POP.js";
18
18
  import {
19
19
  LedgerStore
20
- } from "./chunk-YGK2HMLR.js";
20
+ } from "./chunk-JLBCK7XM.js";
21
21
  import {
22
22
  LEDGER_COLLECTION
23
23
  } from "./chunk-I7FD46FF.js";
24
24
  import {
25
25
  openEnvelopeJson
26
- } from "./chunk-SU6SGWXM.js";
26
+ } from "./chunk-623QEHDB.js";
27
27
  import {
28
28
  base64ToBuffer,
29
29
  wrapKey
30
- } from "./chunk-AKKRXT23.js";
30
+ } from "./chunk-RPWMDIGK.js";
31
31
  import {
32
32
  AdoptionStateError,
33
33
  TransferSealError,
34
34
  ValidationError
35
- } from "./chunk-QZWTRENR.js";
35
+ } from "./chunk-AR5D76T2.js";
36
36
 
37
37
  // src/with-cargo/vault-diff.ts
38
38
  async function diffVault(vault, candidate, options = {}) {
@@ -193,7 +193,7 @@ function shortJSON(value) {
193
193
  function withCargo() {
194
194
  return {
195
195
  async extractPartition(vault, opts) {
196
- const { extractPartitionCore } = await import("./extract-partition-LS4ET5A6.js");
196
+ const { extractPartitionCore } = await import("./extract-partition-SFV35U2R.js");
197
197
  return extractPartitionCore(vault, opts);
198
198
  }
199
199
  };
@@ -399,7 +399,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
399
399
  }
400
400
  }
401
401
  if (isManaged(opts)) {
402
- const { createNoydb } = await import("./noydb-ZLPVCDES.js");
402
+ const { createNoydb } = await import("./noydb-KFN6M6UJ.js");
403
403
  const db = await createNoydb({
404
404
  store,
405
405
  user: userId,
@@ -455,4 +455,4 @@ export {
455
455
  withCargo,
456
456
  describeExtraction
457
457
  };
458
- //# sourceMappingURL=chunk-LLYIMSQQ.js.map
458
+ //# sourceMappingURL=chunk-MDRCEA56.js.map
@@ -9,13 +9,13 @@ import {
9
9
  } from "./chunk-IGJCYUT5.js";
10
10
  import {
11
11
  applyI18nLocale
12
- } from "./chunk-UADPR6F4.js";
12
+ } from "./chunk-5EKL6BXI.js";
13
13
  import {
14
14
  viaBinder
15
- } from "./chunk-6UBZ6I5Z.js";
15
+ } from "./chunk-DDB626I7.js";
16
16
  import {
17
17
  GroupCardinalityError
18
- } from "./chunk-QZWTRENR.js";
18
+ } from "./chunk-AR5D76T2.js";
19
19
 
20
20
  // src/with-lookup/reduce/reduction.ts
21
21
  function reduceRecords(records, spec) {
@@ -361,4 +361,4 @@ export {
361
361
  groupAndReduce,
362
362
  GroupedReduction
363
363
  };
364
- //# sourceMappingURL=chunk-KRCBZYTZ.js.map
364
+ //# sourceMappingURL=chunk-MFW466PX.js.map
@@ -2,7 +2,7 @@ import {
2
2
  IllegalTransitionError,
3
3
  RecordLockedError,
4
4
  ValidationError
5
- } from "./chunk-QZWTRENR.js";
5
+ } from "./chunk-AR5D76T2.js";
6
6
 
7
7
  // src/with-audit/guards/with-guard.ts
8
8
  function withGuard(strategy) {
@@ -120,4 +120,4 @@ export {
120
120
  immutableGuard,
121
121
  transitionGuard
122
122
  };
123
- //# sourceMappingURL=chunk-RO5NM6UI.js.map
123
+ //# sourceMappingURL=chunk-MGXUAID4.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  envelopePayloadHash
3
- } from "./chunk-DQZXPGGZ.js";
3
+ } from "./chunk-V3EGXDFN.js";
4
4
  import {
5
5
  NOYDB_FORMAT_VERSION
6
6
  } from "./chunk-77AEMXFA.js";
7
7
  import {
8
8
  DictKeyMissingError,
9
9
  PermissionDeniedError
10
- } from "./chunk-QZWTRENR.js";
10
+ } from "./chunk-AR5D76T2.js";
11
11
 
12
12
  // src/via/lookup/handle.ts
13
13
  function isDeleteMarker(envelope) {
@@ -389,4 +389,4 @@ export {
389
389
  dictCollectionName,
390
390
  LookupHandle
391
391
  };
392
- //# sourceMappingURL=chunk-OWHP3H5C.js.map
392
+ //# sourceMappingURL=chunk-MPW6AHTC.js.map
@@ -2,10 +2,10 @@ import {
2
2
  base64ToBuffer,
3
3
  decryptBytesWithAAD,
4
4
  encryptBytesWithAAD
5
- } from "./chunk-AKKRXT23.js";
5
+ } from "./chunk-RPWMDIGK.js";
6
6
  import {
7
7
  TamperedError
8
- } from "./chunk-QZWTRENR.js";
8
+ } from "./chunk-AR5D76T2.js";
9
9
 
10
10
  // src/kernel/enclave/classify/compare.ts
11
11
  var subtle = globalThis.crypto.subtle;
@@ -92,4 +92,4 @@ export {
92
92
  openVdigPayload,
93
93
  evaluateKofN
94
94
  };
95
- //# sourceMappingURL=chunk-35NMVJ7I.js.map
95
+ //# sourceMappingURL=chunk-MYSNNMJ3.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  freezeAndDeleteClosure,
3
3
  randomId
4
- } from "./chunk-SFBYQMZM.js";
4
+ } from "./chunk-G3ORJ3IQ.js";
5
5
  import {
6
6
  buildAccessibleBundle,
7
7
  resolveAccessibleCollections
8
- } from "./chunk-P4JO3H6R.js";
8
+ } from "./chunk-J7YVY7TW.js";
9
9
  import {
10
10
  NOYDB_FORMAT_VERSION
11
11
  } from "./chunk-77AEMXFA.js";
12
12
  import {
13
13
  NoydbError
14
- } from "./chunk-QZWTRENR.js";
14
+ } from "./chunk-AR5D76T2.js";
15
15
 
16
16
  // src/with-audit/portability/request-withdrawal.ts
17
17
  var WITHDRAWAL_REQUESTS_COLLECTION = "_user_withdrawal_requests";
@@ -161,4 +161,4 @@ export {
161
161
  approveWithdrawal,
162
162
  rejectWithdrawal
163
163
  };
164
- //# sourceMappingURL=chunk-QGIBI6GL.js.map
164
+ //# sourceMappingURL=chunk-NG4AQIYJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PortabilityNotEnabledError
3
- } from "./chunk-QZWTRENR.js";
3
+ } from "./chunk-AR5D76T2.js";
4
4
 
5
5
  // src/with-audit/portability/strategy.ts
6
6
  var NO_PORTABILITY = {
@@ -27,4 +27,4 @@ var NO_PORTABILITY = {
27
27
  export {
28
28
  NO_PORTABILITY
29
29
  };
30
- //# sourceMappingURL=chunk-BLBAQRBM.js.map
30
+ //# sourceMappingURL=chunk-NIKQQXI2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ReadOnlyFrameError
3
- } from "./chunk-QZWTRENR.js";
3
+ } from "./chunk-AR5D76T2.js";
4
4
 
5
5
  // src/with-fork/shadow/vault-frame.ts
6
6
  var VaultFrame = class {
@@ -71,4 +71,4 @@ export {
71
71
  VaultFrame,
72
72
  CollectionFrame
73
73
  };
74
- //# sourceMappingURL=chunk-55LX6FSX.js.map
74
+ //# sourceMappingURL=chunk-NJHQE4LT.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  grant,
3
3
  revoke
4
- } from "./chunk-Q5YJCVJY.js";
4
+ } from "./chunk-FZAP4JNC.js";
5
5
  import {
6
6
  CustodyNotEnabledError
7
- } from "./chunk-QZWTRENR.js";
7
+ } from "./chunk-AR5D76T2.js";
8
8
 
9
9
  // src/with-party/custody/active.ts
10
10
  function withCustody() {
@@ -16,7 +16,7 @@ function withCustody() {
16
16
  return host._revokeCustodianImpl(revoke, vault, options, factors);
17
17
  },
18
18
  async liberate(vault, opts) {
19
- const { liberateVault } = await import("./liberate-WZ3RHVKW.js");
19
+ const { liberateVault } = await import("./liberate-TSOW7IG5.js");
20
20
  return liberateVault(vault, opts);
21
21
  }
22
22
  };
@@ -74,4 +74,4 @@ export {
74
74
  withCustody,
75
75
  CustodyApi
76
76
  };
77
- //# sourceMappingURL=chunk-TS5XLBZR.js.map
77
+ //# sourceMappingURL=chunk-NMYH55MW.js.map
@@ -6,7 +6,7 @@ import {
6
6
  ConflictError,
7
7
  InvariantError,
8
8
  ValidationError
9
- } from "./chunk-QZWTRENR.js";
9
+ } from "./chunk-AR5D76T2.js";
10
10
 
11
11
  // src/with-commit/tx/atomic-eligibility.ts
12
12
  function canCommitAtomically(db, ctx) {
@@ -270,7 +270,7 @@ async function runTransaction(db, fn, options, txInvariants) {
270
270
  db._clearActiveTxContext(ctx);
271
271
  }
272
272
  if (ctx._amendment) {
273
- const { GuardExecutor } = await import("./executor-RM7XWQDU.js");
273
+ const { GuardExecutor } = await import("./executor-YBK3I2OT.js");
274
274
  try {
275
275
  for (const [vaultName, v] of ctx._amendmentVaults) {
276
276
  const registry = v._getGuardRegistry();
@@ -413,6 +413,7 @@ async function commitAtomicBatch(db, ctx, priorEnvelopes) {
413
413
  for (const leg of legs) {
414
414
  if (leg.op.type === "put") await leg.coll._finalizePut(leg.prepared);
415
415
  else await leg.coll._finalizeDelete(leg.prepared);
416
+ await leg.coll._fireAtomicAfterWrite(leg.op.type, leg.prepared);
416
417
  }
417
418
  } catch (err) {
418
419
  await revertExecuted(ctx._executed, store, db);
@@ -444,7 +445,6 @@ export {
444
445
  TxContext,
445
446
  TxVault,
446
447
  TxCollection,
447
- runTransaction,
448
- revertExecuted
448
+ runTransaction
449
449
  };
450
- //# sourceMappingURL=chunk-GTYFIVIZ.js.map
450
+ //# sourceMappingURL=chunk-NWK6SVBM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-commit/tx/atomic-eligibility.ts","../src/kernel/best-effort-revert.ts","../src/with-commit/tx/transaction.ts"],"sourcesContent":["/**\n * #893/#906-prep — the atomic-commit eligibility gate.\n *\n * `runTransaction` (Task 5) consults `canCommitAtomically` right after the\n * body returns, to decide whether the whole staged batch can be prepared and\n * submitted as ONE `store.tx(ops)` call instead of the per-op abortable\n * path (Phase 1 pre-flight + Phase 2 Collection-layer execute + Phase 3\n * best-effort revert — see `transaction.ts`'s module doc).\n *\n * Pure decision logic: no side effects, no store reads. Every input is\n * already sitting on `db` / `ctx`.\n *\n * ALL of the following must hold. (Commit-time changeset invariants are NOT a\n * condition: that phase lives after Phase 2 in `runTransaction` and runs\n * unchanged on either path — a failing invariant reverts the atomic batch\n * through the same `ctx._executed` plan.)\n *\n * 1. The store declares `capabilities.txAtomic === true` AND implements\n * `tx()`. Both — mirrors the pairing rule `bestEffortRevert` already\n * enforces (`kernel/best-effort-revert.ts:78`): an undeclared `tx()` is\n * never used, even if present.\n * 2. Not an amendment transaction (`ctx._amendment === false`) — amendments\n * need the guard-registry change-set + invariant machinery the atomic\n * path skips entirely.\n * 3. No `(vault, collection, id)` is touched twice in the batch. The\n * abortable path's Phase 1 snapshots each key once and Phase 2 replays\n * every op against that same snapshot in order; a single `store.tx()`\n * write set can't express \"this key changes twice in sequence.\"\n * 4. Every touched collection reports `_txAtomicSafe(op.type)` — see that\n * method's doc comment on `Collection` for what it excludes and why.\n * #931: of the wrapper-level write signals, only a live `onBeforeWrite`\n * hook still excludes — it may REFUSE a write, which only\n * `Collection.put()`/`.delete()` honors. After-hooks and the\n * `afterPut`/`afterDelete` observe bus are refusal-free observers, so\n * the atomic path fires them itself per leg post-finalize\n * (`Collection._fireAtomicAfterWrite`) instead of forfeiting the batch.\n * Delete gates on the enforcer's `_deleteCascadesPossible(name)` (#922):\n * `Vault.enforceRefsOnDelete` cascades from THREE sources (lookup-ref\n * edges, classic inbound refs, managed-link `onDelete`), and the Vault\n * predicate unions exactly those three — a `getInbound`-only check would\n * be narrower and wrongly admit unsafe atomic deletes, because\n * `_prepareDelete` runs the cascades DURING prepare (see\n * `with-shape/links/vault-facade.ts` `enforceRefsOnDelete`).\n *\n * @internal\n */\n\nimport type { Noydb } from '../../kernel/noydb.js'\nimport type { TxContext } from './transaction.js'\nimport { keyOf } from './transaction.js'\n\nexport function canCommitAtomically(db: Noydb, ctx: TxContext): boolean {\n const store = db._store\n if (store.capabilities?.txAtomic !== true || typeof store.tx !== 'function') return false\n if (ctx._amendment) return false\n\n const seen = new Set<string>()\n for (const op of ctx._ops) {\n const key = keyOf(op)\n if (seen.has(key)) return false\n seen.add(key)\n }\n\n for (const op of ctx._ops) {\n const coll = db.vault(op.vaultName).collection(op.collectionName)\n if (!coll._txAtomicSafe(op.type)) return false\n }\n\n return true\n}\n","/**\n * Best-effort reverse-revert — the shape shared by two independent rollback\n * paths that used to duplicate it: satellite fan-out\n * (`with-shape/satellites/fanout.ts`'s `revertAndCompensate`) and\n * multi-record transactions (`with-commit/tx/transaction.ts`'s\n * `revertExecuted`). Both revert a list of already-executed writes on\n * failure by walking them in REVERSE order and, per leg, restoring the\n * captured prior envelope straight through the raw adapter — `put(prior)`\n * when one existed, `delete` when the leg was a fresh insert — bypassing\n * the Collection layer so the revert itself doesn't re-fire\n * encryption/ledger/change-event machinery. Each leg's raw-adapter revert\n * is best-effort: a throw is swallowed so a revert-path failure never masks\n * the original error that triggered the rollback, and the loop moves on to\n * the next leg.\n *\n * An optional per-leg `compensate` callback runs immediately after a\n * successful raw-adapter revert (still inside the same try, so a throwing\n * callback is swallowed the same way as a throwing raw revert). What the\n * callback does is entirely caller-defined — satellites' fan-out fires\n * `_compensateRevertedWrite` only for legs whose write actually landed\n * (#596); with-commit's transaction executor invalidates the Collection\n * cache. Neither concern belongs here: this helper only knows the generic\n * reverse/best-effort/raw-revert shape.\n *\n * Lives in `kernel/` — not a `with-*` service — so both consumers (one a\n * gated service, `with-commit`; one an always-on schema feature,\n * `with-shape/satellites`) can import it without creating a\n * `with-* → with-*` edge, which would force either family to always bundle\n * the other and defeat the opt-in tree-shaking both are built around.\n *\n * @internal — implementation-sharing only, not part of the public surface.\n */\nimport type { EncryptedEnvelope, StoreCapabilities, TxOp } from './types.js'\n\n/** One already-executed write a revert pass needs to unwind. */\nexport interface BestEffortRevertLeg {\n readonly vaultName: string\n readonly collectionName: string\n readonly id: string\n /** Envelope captured before the write, or `null` if the id didn't exist yet. */\n readonly prior: EncryptedEnvelope | null\n}\n\n/** The subset of `NoydbStore` a raw-adapter revert needs. */\nexport interface BestEffortRevertAdapter {\n put(vaultName: string, collectionName: string, id: string, envelope: EncryptedEnvelope): Promise<void>\n delete(vaultName: string, collectionName: string, id: string): Promise<void>\n /**\n * Optional storage-layer transaction (#886). When the store declares\n * `txAtomic`, the whole revert is submitted as ONE operation instead of a\n * per-leg loop, so a crash mid-revert can no longer leave the vault\n * half-unwound.\n */\n tx?(ops: readonly TxOp[]): Promise<void>\n readonly capabilities?: StoreCapabilities\n}\n\n/**\n * Revert `executed` in reverse order via the raw adapter, best-effort.\n * `compensate`, when supplied, runs once per leg immediately after that\n * leg's own raw revert succeeds.\n */\nexport async function bestEffortRevert<T extends BestEffortRevertLeg>(\n executed: readonly T[],\n adapter: BestEffortRevertAdapter,\n compensate?: (leg: T) => Promise<void> | void,\n): Promise<void> {\n const legs = [...executed].reverse()\n\n // #886 — atomic revert when the store can do it. The legs already carry RAW\n // prior envelopes (captured pre-write), which is exactly the shape `tx()`\n // wants, so this needs none of the Collection-layer machinery that makes\n // delegating the FORWARD write path a much larger job.\n //\n // Failure stays best-effort: if the store rejects the batch we fall through\n // to the per-leg loop rather than surfacing a revert-path error, because a\n // revert failure must never mask the original error that triggered it.\n if (adapter.capabilities?.txAtomic === true && typeof adapter.tx === 'function') {\n const ops: TxOp[] = legs.map(leg =>\n leg.prior !== null\n ? { type: 'put', vault: leg.vaultName, collection: leg.collectionName, id: leg.id, envelope: leg.prior }\n : { type: 'delete', vault: leg.vaultName, collection: leg.collectionName, id: leg.id },\n )\n try {\n await adapter.tx(ops)\n if (compensate) for (const leg of legs) { try { await compensate(leg) } catch { /* best-effort */ } }\n return\n } catch {\n // fall through to the per-leg path below\n }\n }\n\n for (const leg of legs) {\n try {\n if (leg.prior !== null) {\n await adapter.put(leg.vaultName, leg.collectionName, leg.id, leg.prior)\n } else {\n await adapter.delete(leg.vaultName, leg.collectionName, leg.id)\n }\n if (compensate) await compensate(leg)\n } catch {\n // best-effort — a revert-path failure must not mask the original\n // error that triggered the rollback (matches both callers' prior\n // independent implementations).\n }\n }\n}\n","/**\n * Multi-record atomic transactions.\n *\n * Lets an application stage writes across two or more collections (or\n * vaults) and commit them all-or-nothing.\n *\n * ```ts\n * await db.transaction(async (tx) => {\n * const inv = tx.vault('acme').collection<Invoice>('invoices')\n * const pay = tx.vault('acme').collection<Payment>('payments')\n * await inv.put(invoiceId, { ...invoice, status: 'paid' })\n * await pay.put(paymentId, { invoiceId, amount, paidAt })\n * })\n * // If the body throws before returning: nothing persisted.\n * // If the body returns: all puts committed; any CAS mismatch rolls\n * // the batch back and surfaces as ConflictError.\n * ```\n *\n * ## Atomicity semantics\n *\n * Ops are buffered during the body. On body-return the hub:\n *\n * 1. **Pre-flight** — re-reads every touched envelope and enforces\n * any caller-supplied `expectedVersion`. A mismatch throws\n * `ConflictError` with *no* writes performed.\n * 2. **Execute** — calls `Collection.put()` / `.delete()` for each\n * staged op in declaration order. History snapshots, ledger\n * appends, and change events fire as normal per op.\n * 3. **Unwind on failure** — if step 2 throws mid-batch, each\n * already-committed op is reverted via the raw store (restoring\n * the captured prior envelope, or deleting if none existed). The\n * ledger is NOT rewritten — audit history preserves the partial\n * commit and the revert.\n *\n * **Atomic delegation (#906).** Steps 1–3 above describe the OCC\n * fallback. When the store declares `StoreCapabilities.txAtomic` AND\n * implements `tx()`, AND the staged batch is statically safe\n * (`canCommitAtomically` — see `atomic-eligibility.ts`), the commit\n * instead: prepares every op through `Collection._preparePut` /\n * `_prepareDelete` (encrypt, resolve the prior version, mint the #589\n * marker — no observable side effect), submits the whole write set as\n * ONE `store.tx(ops)` call with a per-leg `expectedVersion`, then\n * finalizes each op in staged order. The visible difference: history\n * snapshots, ledger entries and change events all fire AFTER the bytes\n * are durable, instead of interleaving per op.\n *\n * **Crash window.** On the OCC fallback, steps 2–3 are not a\n * storage-layer transaction — if the process dies between two executed\n * ops, the on-disk state is partial. The atomic path above closes that\n * window for the write set itself (`to-memory` and the SQL stores in\n * `noy-db-to` implement `tx()`); a crash between the batch landing and\n * the finalize loop finishing still leaves per-op side effects (history,\n * ledger, cache) incomplete. Stores that cannot commit a batch\n * atomically (file, S3) omit `tx()` and keep the fallback.\n *\n * ## Not covered\n *\n * - Cross-sync-peer atomicity. Transactions commit against the\n * primary store only; the sync engine pushes on its normal\n * schedule. For cross-peer two-phase commit use `SyncTransaction`\n * via `db.transaction(vaultName)`.\n * - Read-your-writes within the body. `tx.collection().get(id)`\n * returns the most-recently-staged value for that id when one\n * exists; if no staged op has touched the id, it reads the current\n * committed state. Version numbers returned by `get` reflect the\n * pre-transaction state (staged puts have no version yet).\n *\n * @module\n */\n\nimport type { Noydb } from '../../kernel/noydb.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { Collection } from '../../kernel/collection.js'\nimport type { EncryptedEnvelope, TxOp } from '../../kernel/types.js'\nimport type { PreparedPut, PreparedDelete } from '../../kernel/prepared-write.js'\nimport { canCommitAtomically } from './atomic-eligibility.js'\nimport {\n AmendmentForbiddenError,\n ConflictError,\n InvariantError,\n ValidationError,\n} from '../../kernel/errors.js'\nimport { generateULID } from '../../with-pod/ulid.js'\nimport type { GuardExecutor as GuardExecutorModule } from '../../with-audit/guards/executor.js'\nimport type { LedgerEntry } from '../history/ledger/entry.js'\nimport type { TransactionInvariant } from './invariants.js'\nimport type { GuardChange, GuardContext, ReadOnlyVaultFacade } from '../../with-audit/guards/types.js'\nimport { bestEffortRevert } from '../../kernel/best-effort-revert.js'\n\n/** One op buffered inside a running `TxContext`. @internal */\nexport interface StagedOp {\n type: 'put' | 'delete'\n vaultName: string\n collectionName: string\n id: string\n record?: unknown\n expectedVersion?: number\n /**\n * Optional human-readable tag forwarded to the resulting ledger\n * entry's `reason` field. Set by callers via\n * `tx.vault(v).collection(c).put(id, record, { reason })`.\n */\n reason?: string\n}\n\n/**\n * One executed op (main staged op or recursive side-effect like a\n * derivation output) paired with the envelope captured before the write.\n * `revertExecuted` walks this array in reverse on rollback.\n * @internal\n */\nexport interface ExecutedOp {\n op: StagedOp\n priorEnvelope: EncryptedEnvelope | null\n}\n\n/**\n * Options accepted by `db.transaction({ amendment, reason }, fn)`.\n * Only the amendment variant uses these — a plain `db.transaction(fn)`\n * never sees this shape.\n */\nexport interface AmendmentTxOptions {\n /** Opt into amendment mode. Required to be `true`. */\n readonly amendment: true\n /** Human-readable rationale recorded in the ledger entry. Required. */\n readonly reason: string\n}\n\n/**\n * Transaction handle passed to the user's body. Use\n * `tx.vault(name).collection<T>(name)` to get a per-collection\n * facade; its `put`/`delete`/`get` calls stage ops against the tx.\n */\nexport class TxContext {\n /** Stable id for this transaction; shared by all writes it performs. */\n readonly txId: string = generateULID()\n /** @internal */\n readonly _ops: StagedOp[] = []\n /**\n * @internal — write log built up in Phase 2. Each entry records the\n * envelope captured BEFORE the write so a mid-batch failure can\n * restore prior state via `revertExecuted`. Side-effect writes (e.g.\n * recursive derivation outputs fired inside `Collection.put`) are\n * appended here in execution order so they roll back alongside the\n * main staged ops.\n */\n readonly _executed: ExecutedOp[] = []\n /** @internal */\n readonly _db: Noydb\n /**\n * @internal — true when this TxContext was opened in amendment\n * mode. Toggles the lazy-`beginAmendment` + role-check path on first\n * `tx.vault(name)` and unlocks the post-Phase-2 invariant + audit run.\n */\n readonly _amendment: boolean\n /** @internal — vaults that have already had `beginAmendment` called. */\n readonly _amendmentVaults = new Map<string, Vault>()\n\n /** @internal */\n constructor(db: Noydb, amendment = false) {\n this._db = db\n this._amendment = amendment\n }\n\n /** Scope subsequent `collection()` calls to the named vault. */\n vault(name: string): TxVault {\n const v = this._db.vault(name)\n if (this._amendment && !this._amendmentVaults.has(name)) {\n // Role check is per-vault. The task spec (\"only admin or owner\n // can open an amendment\") is implemented lazy-on-first-touch\n // because the role lives on the vault's keyring, and `tx.vault()`\n // is the first place we know which vault we're addressing. The\n // observable effect is identical to an eager check in the single-\n // vault case the tests exercise; multi-vault amendments check\n // each touched vault as they first appear.\n const role = v.role\n // FR-6: custodian is admin-rank for operational mutations, and an\n // amendment is an operational (data-correcting) act — not an ownership\n // meta-capability — so custodian is allowed alongside owner/admin.\n if (role !== 'admin' && role !== 'owner' && role !== 'custodian') {\n throw new AmendmentForbiddenError(v.userId, role)\n }\n // Amendments require an initialised guard registry — they\n // produce a structured invariant + change-set audit. A vault\n // opened without `guardStrategies` (or via the sync fallback\n // path) has a null registry and cannot run an amendment.\n const reg = v._getGuardRegistry()\n if (reg === null) {\n throw new ValidationError(\n `Vault \"${name}\": amendment mode requires at least one ` +\n `guardStrategy registered via createNoydb({ guardStrategies }). ` +\n `Open the vault with guardStrategies before calling ` +\n `db.transaction({ amendment: true }).`,\n )\n }\n reg.beginAmendment()\n this._amendmentVaults.set(name, v)\n }\n return new TxVault(this, v)\n }\n}\n\n/** Per-vault facade inside a running transaction. */\nexport class TxVault {\n /** @internal */\n readonly _ctx: TxContext\n /** @internal */\n readonly _vault: Vault\n\n /** @internal */\n constructor(ctx: TxContext, vault: Vault) {\n this._ctx = ctx\n this._vault = vault\n }\n\n /** Scope subsequent op calls to the named collection. */\n collection<T>(name: string): TxCollection<T> {\n const c = this._vault.collection<T>(name)\n return new TxCollection<T>(this._ctx, this._vault, c, name)\n }\n}\n\n/** Per-collection facade inside a running transaction. */\nexport class TxCollection<T> {\n /** @internal */\n readonly _ctx: TxContext\n /** @internal */\n readonly _vault: Vault\n /** @internal */\n readonly _coll: Collection<T>\n /** @internal */\n readonly _name: string\n\n /** @internal */\n constructor(ctx: TxContext, vault: Vault, coll: Collection<T>, name: string) {\n this._ctx = ctx\n this._vault = vault\n this._coll = coll\n this._name = name\n }\n\n /**\n * Read the current committed value, or the most-recently-staged\n * value from the same transaction if one exists.\n */\n async get(id: string): Promise<T | null> {\n for (let i = this._ctx._ops.length - 1; i >= 0; i--) {\n const op = this._ctx._ops[i]!\n if (\n op.vaultName === this._vault.name &&\n op.collectionName === this._name &&\n op.id === id\n ) {\n if (op.type === 'delete') return null\n return op.record as T\n }\n }\n return this._coll.get(id)\n }\n\n /**\n * Stage a put. Does not write until the transaction body returns.\n * Supply `{ expectedVersion }` to enforce optimistic concurrency\n * during the commit pre-flight.\n */\n put(id: string, record: T, options?: { expectedVersion?: number; reason?: string }): void {\n const op: StagedOp = {\n type: 'put',\n vaultName: this._vault.name,\n collectionName: this._name,\n id,\n record,\n }\n if (options?.expectedVersion !== undefined) op.expectedVersion = options.expectedVersion\n if (options?.reason !== undefined) op.reason = options.reason\n this._ctx._ops.push(op)\n }\n\n /**\n * Stage a delete. Does not write until the transaction body returns.\n * Supply `{ expectedVersion }` to enforce optimistic concurrency\n * during the commit pre-flight.\n */\n delete(id: string, options?: { expectedVersion?: number }): void {\n const op: StagedOp = {\n type: 'delete',\n vaultName: this._vault.name,\n collectionName: this._name,\n id,\n }\n if (options?.expectedVersion !== undefined) op.expectedVersion = options.expectedVersion\n this._ctx._ops.push(op)\n }\n}\n\n/**\n * Commit plan: pre-flight check + execution + revert plan.\n *\n * @internal — driven by `withTransactions()` (via `tx/active.ts`) for\n * user-facing `db.transaction(...)` calls and by the `amendment` path\n * in `noydb.ts`. `Collection.putManyAtomic` runs its own Phase 2 loop\n * but shares the `_activeTxContext` mechanism (and the `revertExecuted`\n * helper) so nested side-effect derivation writes get registered for\n * revert alongside the bulk-put source ops.\n */\nexport async function runTransaction<T>(\n db: Noydb,\n fn: (tx: TxContext) => Promise<T> | T,\n options?: AmendmentTxOptions,\n txInvariants?: ReadonlyArray<TransactionInvariant>,\n): Promise<T> {\n // ─── Amendment-mode pre-flight ───────────────────────────────\n // `reason` is the only thing we can validate before the body runs;\n // the per-vault role check happens lazily on first `tx.vault(name)`\n // because we don't know which vaults the body will touch ahead of\n // time. Throwing here keeps the failure mode close to the call site\n // so the developer doesn't have to walk an async stack to find the\n // missing-reason mistake.\n if (options?.amendment) {\n if (typeof options.reason !== 'string' || options.reason.trim().length === 0) {\n throw new ValidationError(\n 'db.transaction({ amendment: true }) requires a non-empty `reason` string.',\n )\n }\n }\n\n const ctx = new TxContext(db, options?.amendment === true)\n const bodyResult = await fn(ctx)\n\n if (ctx._ops.length === 0) {\n // Body produced no ops. If amendment mode was active we still\n // need to close any opened windows so a subsequent (unrelated)\n // write doesn't surprise-collect into a stale change-set. Each\n // `beginAmendment` is matched by exactly one `consumeChanges`.\n if (ctx._amendment) {\n for (const v of ctx._amendmentVaults.values()) {\n // Registry is guaranteed non-null here — `tx.vault(name)`\n // threw above if it was null before adding to\n // `_amendmentVaults`.\n const reg = v._getGuardRegistry()\n if (reg !== null) {\n reg.consumeChanges()\n reg.consumeMeta()\n }\n }\n }\n return bodyResult\n }\n\n // Phase 1 — pre-flight: snapshot every touched envelope and enforce\n // any caller-supplied expectedVersion. Same (vault, coll, id) touched\n // more than once in one tx snapshots only the *initial* committed\n // state; the in-order replay in Phase 2 takes care of successor ops.\n const priorEnvelopes = new Map<string, EncryptedEnvelope | null>()\n const store = db._store\n\n // Commit-time changeset invariants need PLAINTEXT prior records\n // for `before`, but `priorEnvelopes` holds ENCRYPTED envelopes. So for\n // ops in a watched scope we additionally decrypt the prior record here,\n // in Phase 1, BEFORE Phase 2 overwrites it. Snapshots only the initial\n // committed state per (vault, coll, id), matching the envelope snapshot.\n const invariants = txInvariants ?? []\n const watchedScopes = new Set(invariants.map(i => i.scope))\n const plainBefore = new Map<string, unknown>()\n\n for (const op of ctx._ops) {\n const key = keyOf(op)\n if (!priorEnvelopes.has(key)) {\n const env = await store.get(op.vaultName, op.collectionName, op.id)\n priorEnvelopes.set(key, env)\n }\n if (watchedScopes.has(op.collectionName) && !plainBefore.has(key)) {\n const prior = await db\n .vault(op.vaultName)\n .collection(op.collectionName)\n .get(op.id)\n plainBefore.set(key, prior ?? null)\n }\n if (op.expectedVersion !== undefined) {\n const env = priorEnvelopes.get(key) ?? null\n const actual = env?._v ?? 0\n if (actual !== op.expectedVersion) {\n throw new ConflictError(\n actual,\n `Transaction pre-flight: ${op.vaultName}/${op.collectionName}/${op.id} ` +\n `expected v${op.expectedVersion}, found v${actual}`,\n )\n }\n }\n }\n\n // Phase 2 — execute via the Collection layer so history snapshots,\n // ledger entries, and change events fire normally. We capture each\n // successful op so a mid-batch throw can revert in Phase 3.\n //\n // `_activeTxContext` is published on the Noydb instance for the\n // duration of Phase 2 so recursive writes triggered inside\n // `Collection.put` (today: eager derivation outputs) can register\n // their own envelopes onto `ctx._executed` and roll back alongside\n // the main staged ops. The `finally` clears it before the\n // amendment commit phase runs.\n db._setActiveTxContext(ctx)\n try {\n if (canCommitAtomically(db, ctx)) {\n // #906 — the whole batch goes to the store as ONE `tx()` write set.\n // Tracked here because the atomic path bypasses `Collection.put()`,\n // which is where an ordinary write enters the queue: without this,\n // `hub.writeQueue.pending` would read false for the entire commit.\n // One tracked unit, not one per op — the batch IS one logical write.\n await db._writeQueueTracker.track(() => commitAtomicBatch(db, ctx, priorEnvelopes))\n } else {\n try {\n for (const op of ctx._ops) {\n const coll = db.vault(op.vaultName).collection(op.collectionName)\n const key = keyOf(op)\n const prior = priorEnvelopes.get(key) ?? null\n // Record the revert plan BEFORE the call so a mid-`coll.put` throw\n // (e.g. strict-mode derivation failure firing after `store.put`\n // has already committed the envelope) still has its source write\n // reverted. `revertExecuted` is best-effort: putting prior back is\n // idempotent when the failing op never actually wrote, and\n // `_invalidateCacheEntry` is a no-op when the collection isn't\n // hydrated.\n ctx._executed.push({ op, priorEnvelope: prior })\n if (op.type === 'put') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n await coll.put(op.id, op.record as any, op.reason !== undefined ? { reason: op.reason } : undefined)\n } else {\n await coll.delete(op.id)\n }\n }\n } catch (err) {\n // Phase 3 — best-effort revert. See helper docstring.\n await revertExecuted(ctx._executed, store, db)\n // Drain amendment windows so the next transaction starts clean.\n if (ctx._amendment) {\n for (const v of ctx._amendmentVaults.values()) {\n const reg = v._getGuardRegistry()\n if (reg !== null) {\n reg.consumeChanges()\n reg.consumeMeta()\n }\n }\n }\n throw err\n }\n }\n } finally {\n db._clearActiveTxContext(ctx)\n }\n\n // ─── Amendment commit phase (only if amendment === true) ────\n // Body succeeded — now run each touched vault's invariants over the\n // collected change-set, then append a structured ledger entry. If\n // any invariant throws, treat it exactly like a mid-Phase-2 failure:\n // revert every executed op and re-throw the InvariantError.\n if (ctx._amendment) {\n // Lazy-load GuardExecutor at the dispatch site — keeps the floor\n // bundle free of the guards service when amendments aren't used.\n // Mirrors the deferred-load pattern from elsewhere in this module.\n const { GuardExecutor } = (await import('../../with-audit/guards/executor.js')) as {\n GuardExecutor: typeof GuardExecutorModule\n }\n try {\n for (const [vaultName, v] of ctx._amendmentVaults) {\n const registry = v._getGuardRegistry()\n // Registry is guaranteed non-null at this point — the\n // `tx.vault(name)` path that populates `_amendmentVaults`\n // throws if the registry is null. The defensive check here\n // is for TypeScript's narrowing.\n if (registry === null) continue\n const changesByCollection = registry.consumeChanges()\n const meta = registry.consumeMeta()\n if (changesByCollection.size === 0) continue\n\n const readOnlyVault = v._getReadOnlyFacade()\n if (readOnlyVault === null) continue\n\n // Build the invariant ctx once per vault — it's the same shape\n // every guard sees on the normal `check` path, just with a\n // synthetic `existing: null` (invariants get the full change\n // set in their first parameter; `existing` is a per-record\n // concept that doesn't apply here).\n const invariantsPassed: string[] = []\n for (const [collection, changes] of changesByCollection) {\n const guards = registry.guardsFor(collection).filter(g => g.amendment !== undefined)\n for (const guard of guards) {\n await GuardExecutor.runInvariant(guard, changes, {\n existing: null,\n vault: readOnlyVault,\n userId: v.userId,\n role: v.role,\n })\n }\n if (guards.length > 0) invariantsPassed.push(collection)\n }\n\n // Append the audit ledger entry. Silent no-op when the\n // history strategy isn't configured — the records still\n // committed, only the multi-record summary is unavailable.\n const ledger = v._getLedgerOrNull()\n if (ledger) {\n const role = v.role as 'admin' | 'owner'\n const amendment: NonNullable<LedgerEntry['amendment']> = {\n reason: options!.reason,\n role,\n changes: meta,\n invariantsPassed,\n }\n await ledger.append({\n op: 'amendment',\n collection: '',\n id: '',\n version: 0,\n actor: v.userId,\n // No payload to hash — the per-record entries already\n // captured `payloadHash` at their own append time. We use\n // a sha256 of the canonical reason string so the field is\n // populated with something deterministic and non-empty.\n payloadHash: '',\n amendment,\n })\n }\n void vaultName\n }\n } catch (err) {\n await revertExecuted(ctx._executed, store, db)\n throw err instanceof InvariantError ? err : new InvariantError(\n err instanceof Error ? err.message : `invariant violated: ${String(err)}`,\n )\n }\n }\n\n // ─── Commit-time changeset invariant phase ───────────\n // Runs for BOTH ordinary and amendment transactions (placed after the\n // amendment phase so an amendment commit is still subject to these\n // set-level constraints). Assemble the changeset from the executed\n // staged ops, deduped to the LAST write per (vault, coll, id) while\n // preserving write order, then group `GuardChange` by collection\n // (scope) and run each matching invariant. A throw mirrors the\n // amendment-phase failure mode exactly: revert every executed op and\n // re-throw as `InvariantError`.\n if (invariants.length > 0) {\n // Dedup ctx._ops to the last write per key, preserving first-seen\n // (write) order so the changeset is stable and order-meaningful.\n const lastOp = new Map<string, StagedOp>()\n const order: string[] = []\n for (const op of ctx._ops) {\n const key = keyOf(op)\n if (!lastOp.has(key)) order.push(key)\n lastOp.set(key, op)\n }\n\n // Group {before, after} pairs by collection name (the invariant\n // scope). `before` is the plaintext prior captured in Phase 1 (null\n // for inserts / unwatched — only watched scopes were captured, and\n // every grouped key belongs to a watched scope). `after` is the\n // written record, null for a delete.\n const changesByScope = new Map<string, GuardChange<unknown>[]>()\n // Parallel map: scope → the vault name of its (last-seen) op, used to\n // build the per-invariant read-only ctx (facade + userId + role).\n const scopeVault = new Map<string, string>()\n for (const key of order) {\n const op = lastOp.get(key)!\n if (!watchedScopes.has(op.collectionName)) continue\n const before = plainBefore.get(key) ?? null\n const after = op.type === 'delete' ? null : (op.record ?? null)\n const change = { before, after } as GuardChange<unknown>\n const arr = changesByScope.get(op.collectionName)\n if (arr) arr.push(change)\n else changesByScope.set(op.collectionName, [change])\n\n // Stash the vault name alongside so we can build a per-vault ctx.\n // (All ops in a scope group could span vaults; we resolve the\n // vault per change below via a parallel map keyed the same way.)\n scopeVault.set(op.collectionName, op.vaultName)\n }\n\n try {\n for (const inv of invariants) {\n const changes = changesByScope.get(inv.scope)\n if (changes === undefined || changes.length === 0) continue\n const vaultName = scopeVault.get(inv.scope)!\n const v = db.vault(vaultName)\n // Prefer the real read-only facade so the invariant can read\n // sibling collections; fall back to a minimal read-only stub.\n const facade: ReadOnlyVaultFacade =\n v._getReadOnlyFacade() ?? {\n collection<R = unknown>(name: string) {\n const c = v.collection<R>(name)\n return {\n get: (id: string) => c.get(id),\n list: () => c.list(),\n query: () => c.query(),\n }\n },\n }\n const ctxForInv: GuardContext<unknown> = {\n existing: null,\n vault: facade,\n userId: v.userId,\n role: v.role,\n }\n await inv.check(changes, ctxForInv)\n }\n } catch (err) {\n await revertExecuted(ctx._executed, store, db)\n throw err instanceof InvariantError ? err : new InvariantError(\n err instanceof Error ? err.message : `invariant violated: ${String(err)}`,\n )\n }\n }\n\n return bodyResult\n}\n\n/**\n * One prepared leg of an atomic batch: the `store.tx()` op to submit plus the\n * carrier its finalize half needs.\n * @internal\n */\ninterface AtomicLeg {\n readonly op: StagedOp\n readonly coll: Collection<unknown>\n readonly txOp: TxOp\n readonly prepared: PreparedPut<unknown> | PreparedDelete<unknown>\n}\n\n/**\n * #906 — the atomic commit path: prepare every staged op, submit the whole\n * write set as ONE `store.tx()` call, then finalize each op in staged order.\n *\n * Only ever reached through `canCommitAtomically` (`atomic-eligibility.ts`),\n * whose exclusions are what make this safe — no CRDT, no refs, no\n * derivation/MV source, no unique constraints, no amendment, no id touched\n * twice. Do not call it without that blessing.\n *\n * @internal\n */\nasync function commitAtomicBatch(\n db: Noydb,\n ctx: TxContext,\n priorEnvelopes: ReadonlyMap<string, EncryptedEnvelope | null>,\n): Promise<void> {\n const store = db._store\n const legs: AtomicLeg[] = []\n\n // ─── Prepare ───────────────────────────────────────────────────\n // Encrypt, resolve the prior version, mint the #589 marker — with zero\n // observable side effects on the collections the gate admits. A throw here\n // therefore needs no unwind: nothing has been written yet, and the caller\n // sees the refusal exactly as it would from `Collection.put()`. The revert\n // plan is recorded all the same, because a FINALIZE failure below does need\n // it (same record-before-the-call convention as the OCC loop).\n for (const op of ctx._ops) {\n const coll = db.vault(op.vaultName).collection(op.collectionName)\n // The two refusals `Collection.put()` / `.delete()` assert before anything\n // else — schema-update gate + schema fence. They live in those wrappers,\n // not in the prepare halves this path calls, so assert them here, per op.\n await coll._assertWriteGates()\n const prior = priorEnvelopes.get(keyOf(op)) ?? null\n // Every leg carries CAS against the Phase-1 snapshot, so a writer landing\n // between the body returning and the batch reaching the store loses.\n const base = { vault: op.vaultName, collection: op.collectionName, id: op.id, expectedVersion: prior?._v ?? 0 }\n ctx._executed.push({ op, priorEnvelope: prior })\n if (op.type === 'put') {\n const prepared = await coll._preparePut(op.id, op.record, op.reason !== undefined ? { reason: op.reason } : undefined)\n legs.push({ op, coll, prepared, txOp: { type: 'put', ...base, envelope: prepared.envelope } })\n } else {\n const prepared = await coll._prepareDelete(op.id, false)\n if (prepared === null) {\n // Nothing to delete (no live record / already a marker / shredded) —\n // the case `_doDelete` answers with `false`. Drop the op and its\n // revert entry rather than sending a leg for it.\n ctx._executed.pop()\n continue\n }\n legs.push({\n op, coll, prepared,\n // Under sync the delete is a marker PUT at `live._v + 1` (#589);\n // without sync it is a physical removal.\n txOp: prepared.marker ? { type: 'put', ...base, envelope: prepared.marker } : { type: 'delete', ...base },\n })\n }\n }\n\n // Every op turned out to be a no-op delete — same as the OCC loop, which\n // would have written nothing either. Don't hand the store an empty batch.\n if (legs.length === 0) return\n\n // ─── The batch ─────────────────────────────────────────────────\n // Deliberately NOT inside a revert-guarded try: a rejection means the store\n // applied nothing (all-or-nothing is the capability we gated on), so there\n // is nothing to unwind and a revert pass would write over records this\n // transaction never touched. No ledger entry, history snapshot or change\n // event has fired either — every one of those lives in finalize below. The\n // error (a `ConflictError` when a leg lost its CAS) surfaces unwrapped.\n await store.tx!(legs.map(l => l.txOp))\n\n // ─── Finalize ──────────────────────────────────────────────────\n // History snapshot, ledger entry, cache/index update, change event — per op,\n // in staged order, all AFTER the bytes are durable (where the OCC loop\n // interleaves them per op). #931: then the after-write observers (user\n // `onAfterWrite` hooks + the `afterPut`/`afterDelete` observe bus), which\n // no longer gate eligibility — they cannot refuse a completed write.\n try {\n for (const leg of legs) {\n if (leg.op.type === 'put') await leg.coll._finalizePut(leg.prepared as PreparedPut<unknown>)\n else await leg.coll._finalizeDelete(leg.prepared as PreparedDelete<unknown>)\n await leg.coll._fireAtomicAfterWrite(leg.op.type, leg.prepared)\n }\n } catch (err) {\n // The bytes ARE durable now, so this is today's best-effort unwind over\n // the plan recorded above. No amendment window to drain — the gate\n // excludes amendment transactions.\n await revertExecuted(ctx._executed, store, db)\n throw err\n }\n}\n\n/**\n * Phase 3 helper — restore captured prior envelopes via the raw store\n * to avoid re-firing Collection-level side effects (we don't want a\n * cascade of change events undoing themselves). The ledger is left\n * as-is: each committed op appended an entry; the revert is\n * deliberately NOT recorded as a compensating entry because the\n * caller-facing contract is \"atomic or not at all,\" not \"every write\n * visible in the audit trail.\" Auditors who need the intermediate\n * state can still reconstruct it by walking the ledger through the\n * failed-tx timestamp.\n *\n * Delegates the reverse/best-effort/raw-revert shape to the shared\n * `bestEffortRevert` helper (`kernel/best-effort-revert.ts`); the cache\n * invalidation below rides along as that helper's per-leg `compensate`\n * callback, gated on `db` exactly as before.\n *\n * @internal — shared between `runTransaction` and\n * `Collection.putManyAtomic`. Both register source ops + nested\n * derivation side-effect ops onto `_executed`; this helper unwinds the\n * combined list in reverse on rollback.\n */\nexport async function revertExecuted(\n executed: ReadonlyArray<ExecutedOp>,\n store: Noydb['_store'],\n db?: Noydb,\n): Promise<void> {\n const legs = executed.map(({ op, priorEnvelope }) => ({\n vaultName: op.vaultName,\n collectionName: op.collectionName,\n id: op.id,\n prior: priorEnvelope,\n }))\n await bestEffortRevert(\n legs,\n store,\n db\n ? async (leg) => {\n // Sync the Collection-layer cache with what we just wrote at\n // the raw store. Without this, eager-mode `get` would still\n // return the rolled-back record from its in-memory map. The\n // Collection's `_invalidateCacheEntry` is a no-op when the\n // collection hasn't yet been hydrated.\n const coll = db.vault(leg.vaultName).collection(leg.collectionName)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n await (coll as any)._invalidateCacheEntry(leg.id)\n }\n : undefined,\n )\n}\n\n/** @internal — shared (vault, collection, id) key shape; also used by `atomic-eligibility.ts`'s duplicate-key scan. */\nexport function keyOf(op: StagedOp): string {\n return `${op.vaultName}\\x00${op.collectionName}\\x00${op.id}`\n}\n"],"mappings":";;;;;;;;;;;AAmDO,SAAS,oBAAoB,IAAW,KAAyB;AACtE,QAAM,QAAQ,GAAG;AACjB,MAAI,MAAM,cAAc,aAAa,QAAQ,OAAO,MAAM,OAAO,WAAY,QAAO;AACpF,MAAI,IAAI,WAAY,QAAO;AAE3B,QAAM,OAAO,oBAAI,IAAY;AAC7B,aAAW,MAAM,IAAI,MAAM;AACzB,UAAM,MAAM,MAAM,EAAE;AACpB,QAAI,KAAK,IAAI,GAAG,EAAG,QAAO;AAC1B,SAAK,IAAI,GAAG;AAAA,EACd;AAEA,aAAW,MAAM,IAAI,MAAM;AACzB,UAAM,OAAO,GAAG,MAAM,GAAG,SAAS,EAAE,WAAW,GAAG,cAAc;AAChE,QAAI,CAAC,KAAK,cAAc,GAAG,IAAI,EAAG,QAAO;AAAA,EAC3C;AAEA,SAAO;AACT;;;ACPA,eAAsB,iBACpB,UACA,SACA,YACe;AACf,QAAM,OAAO,CAAC,GAAG,QAAQ,EAAE,QAAQ;AAUnC,MAAI,QAAQ,cAAc,aAAa,QAAQ,OAAO,QAAQ,OAAO,YAAY;AAC/E,UAAM,MAAc,KAAK;AAAA,MAAI,SAC3B,IA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AM,IAAI,KAAK,sBAAsB,IAAI,GAAG,MAAM,IAAI,QAAQ;AAAA,IAChE;AAAA,EACF,SAAS,KAAK;AAIZ,UAAM,eAAe,IAAI,WAAW,OAAO,EAAE;AAC7C,UAAM;AAAA,EACR;AACF;AAuBA,eAAsB,eACpB,UACA,OACA,IACe;AACf,QAAM,OAAO,SAAS,IAAI,CAAC,EAAE,IAAI,cAAc,OAAO;AAAA,IACpD,WAAW,GAAG;AAAA,IACd,gBAAgB,GAAG;AAAA,IACnB,IAAI,GAAG;AAAA,IACP,OAAO;AAAA,EACT,EAAE;AACF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,KACI,OAAO,QAAQ;AAMb,YAAM,OAAO,GAAG,MAAM,IAAI,SAAS,EAAE,WAAW,IAAI,cAAc;AAElE,YAAO,KAAa,sBAAsB,IAAI,EAAE;AAAA,IAClD,IACA;AAAA,EACN;AACF;AAGO,SAAS,MAAM,IAAsB;AAC1C,SAAO,GAAG,GAAG,SAAS,KAAO,GAAG,cAAc,KAAO,GAAG,EAAE;AAC5D;","names":[]}
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  openEnvelopeJson
3
- } from "./chunk-SU6SGWXM.js";
3
+ } from "./chunk-623QEHDB.js";
4
4
  import {
5
5
  encrypt
6
- } from "./chunk-AKKRXT23.js";
6
+ } from "./chunk-RPWMDIGK.js";
7
7
  import {
8
8
  NOYDB_FORMAT_VERSION
9
9
  } from "./chunk-77AEMXFA.js";
10
10
  import {
11
11
  ConflictError
12
- } from "./chunk-QZWTRENR.js";
12
+ } from "./chunk-AR5D76T2.js";
13
13
 
14
14
  // src/with-audit/attestation/signer.ts
15
15
  import { generateDocSigningKeyPair } from "@noy-db/attestation";
@@ -56,4 +56,4 @@ export {
56
56
  loadSigner,
57
57
  loadOrCreateSigner
58
58
  };
59
- //# sourceMappingURL=chunk-IFOH7RBI.js.map
59
+ //# sourceMappingURL=chunk-NZEGQWQ5.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  PolicyDeniedError,
7
7
  ValidationError
8
- } from "./chunk-QZWTRENR.js";
8
+ } from "./chunk-AR5D76T2.js";
9
9
 
10
10
  // src/with-party/policy/presets.ts
11
11
  var PERSONAL_POLICY = Object.freeze({
@@ -364,4 +364,4 @@ export {
364
364
  describeGate,
365
365
  createNoydbPolicy
366
366
  };
367
- //# sourceMappingURL=chunk-DTFA5DO4.js.map
367
+ //# sourceMappingURL=chunk-ODCEOSJF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ValidationError
3
- } from "./chunk-QZWTRENR.js";
3
+ } from "./chunk-AR5D76T2.js";
4
4
 
5
5
  // src/with-formula/derivations/with-derivation.ts
6
6
  function withDerivation(spec) {
@@ -126,4 +126,4 @@ export {
126
126
  withDerivation,
127
127
  withRollup
128
128
  };
129
- //# sourceMappingURL=chunk-NYEFP7DY.js.map
129
+ //# sourceMappingURL=chunk-OKBNFUUX.js.map
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-IGJCYUT5.js";
4
4
  import {
5
5
  installViaBinder
6
- } from "./chunk-6UBZ6I5Z.js";
6
+ } from "./chunk-DDB626I7.js";
7
7
  import {
8
8
  NoydbError,
9
9
  ValidationError
10
- } from "./chunk-QZWTRENR.js";
10
+ } from "./chunk-AR5D76T2.js";
11
11
 
12
12
  // src/via/money/iso4217.ts
13
13
  var MINOR_UNITS = {
@@ -1072,4 +1072,4 @@ export {
1072
1072
  isMoneyString,
1073
1073
  moneyNumber
1074
1074
  };
1075
- //# sourceMappingURL=chunk-SGDPRCC4.js.map
1075
+ //# sourceMappingURL=chunk-OKRXXFZZ.js.map
@@ -2,7 +2,7 @@ import {
2
2
  OverlayBaseIsVirtualError,
3
3
  OverlayCollectionUnavailableError,
4
4
  OverlayNameCollisionError
5
- } from "./chunk-QZWTRENR.js";
5
+ } from "./chunk-AR5D76T2.js";
6
6
 
7
7
  // src/with-formula/overlay-views/registry.ts
8
8
  var OverlayedViewRegistry = class {
@@ -68,4 +68,4 @@ var OverlayedViewRegistry = class {
68
68
  export {
69
69
  OverlayedViewRegistry
70
70
  };
71
- //# sourceMappingURL=chunk-IG6KUWBX.js.map
71
+ //# sourceMappingURL=chunk-P6UIVLZK.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  DanglingReferenceError,
6
6
  JoinTooLargeError
7
- } from "./chunk-QZWTRENR.js";
7
+ } from "./chunk-AR5D76T2.js";
8
8
 
9
9
  // src/kernel/query/join.ts
10
10
  var DEFAULT_JOIN_MAX_ROWS = 5e4;
@@ -170,4 +170,4 @@ export {
170
170
  applyJoins,
171
171
  resetJoinWarnings
172
172
  };
173
- //# sourceMappingURL=chunk-V6UQZA2H.js.map
173
+ //# sourceMappingURL=chunk-PKBONLCP.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ValidationError
3
- } from "./chunk-QZWTRENR.js";
3
+ } from "./chunk-AR5D76T2.js";
4
4
 
5
5
  // src/with-formula/overlay-views/with-overlayed-view.ts
6
6
  function withOverlayedView(spec) {
@@ -33,4 +33,4 @@ function withOverlayedView(spec) {
33
33
  export {
34
34
  withOverlayedView
35
35
  };
36
- //# sourceMappingURL=chunk-MSMJJB4J.js.map
36
+ //# sourceMappingURL=chunk-PTSVGKSR.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BrokerNotEnabledError
3
- } from "./chunk-QZWTRENR.js";
3
+ } from "./chunk-AR5D76T2.js";
4
4
 
5
5
  // src/port/with/broker-strategy.ts
6
6
  var NO_BROKER = {
@@ -27,4 +27,4 @@ export {
27
27
  NO_BROKER,
28
28
  buildCredentialBrokerHandle
29
29
  };
30
- //# sourceMappingURL=chunk-IXNCZTWA.js.map
30
+ //# sourceMappingURL=chunk-PWEMRXPO.js.map