@noy-db/hub 0.4.0-pre.9 → 0.4.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 (243) hide show
  1. package/dist/{api-3NKVNZPM.js → api-SI2IVBQO.js} +6 -6
  2. package/dist/attestation/index.js +12 -12
  3. package/dist/{backup-PTSVXDDW.js → backup-X7F3TCFV.js} +6 -6
  4. package/dist/blobs/index.js +5 -5
  5. package/dist/broker/index.js +6 -6
  6. package/dist/cargo/index.js +20 -20
  7. package/dist/{chunk-WZ3NCMK6.js → chunk-2BET5QTS.js} +3 -3
  8. package/dist/{chunk-Y6B6HVKC.js → chunk-2J6UEN2V.js} +41 -17
  9. package/dist/chunk-2J6UEN2V.js.map +1 -0
  10. package/dist/{chunk-BYFXLDVV.js → chunk-3ECU57YH.js} +7 -7
  11. package/dist/{chunk-ZWBKDKXC.js → chunk-467SWYT5.js} +2 -2
  12. package/dist/{chunk-MTJLOC3Y.js → chunk-55LKVALY.js} +106 -10
  13. package/dist/chunk-55LKVALY.js.map +1 -0
  14. package/dist/{chunk-XIDQKFZF.js → chunk-5UQ7Y6SQ.js} +2 -2
  15. package/dist/{chunk-GZACYEOB.js → chunk-77AEMXFA.js} +1 -1
  16. package/dist/chunk-77AEMXFA.js.map +1 -0
  17. package/dist/{chunk-IMRB2C4O.js → chunk-7H3WWH6J.js} +3 -3
  18. package/dist/{chunk-OLIWCCFM.js → chunk-CLE3TMIS.js} +2 -2
  19. package/dist/{chunk-ZFUFAHZ3.js → chunk-DAFBJS4Y.js} +2 -2
  20. package/dist/{chunk-ISRKW4YN.js → chunk-DQZXPGGZ.js} +2 -2
  21. package/dist/{chunk-FMNU7IUG.js → chunk-DTFA5DO4.js} +2 -2
  22. package/dist/{chunk-VH6SOCXH.js → chunk-EFJAAFBW.js} +2 -2
  23. package/dist/{chunk-TIVK6PRK.js → chunk-ERGECZEI.js} +5 -5
  24. package/dist/{chunk-NGSJZFGL.js → chunk-GTYFIVIZ.js} +83 -21
  25. package/dist/chunk-GTYFIVIZ.js.map +1 -0
  26. package/dist/{chunk-KW42W6SV.js → chunk-HLKXPJ4V.js} +4 -4
  27. package/dist/{chunk-MANUDU7I.js → chunk-HZZP2ZIG.js} +4 -4
  28. package/dist/{chunk-DZAF24PG.js → chunk-IFOH7RBI.js} +3 -3
  29. package/dist/{chunk-FRMW23UK.js → chunk-IVYQAVWO.js} +2 -2
  30. package/dist/{chunk-SGQ4N5FS.js → chunk-JEI6JJNI.js} +3 -3
  31. package/dist/{chunk-BN4HRYAZ.js → chunk-JQ2AX4T5.js} +2 -2
  32. package/dist/{chunk-OBPVWOSQ.js → chunk-KD4HGBJV.js} +3 -3
  33. package/dist/{chunk-QADFHRQM.js → chunk-KYRDJI5O.js} +8 -8
  34. package/dist/{chunk-2NMEGSFV.js → chunk-LLYIMSQQ.js} +9 -9
  35. package/dist/{chunk-GP3UWP22.js → chunk-LRRX57UA.js} +2 -2
  36. package/dist/{chunk-OLSARBZU.js → chunk-LXRTP3AQ.js} +2 -2
  37. package/dist/{chunk-EBKCYQ2D.js → chunk-NBXFCQX4.js} +3 -3
  38. package/dist/{chunk-BXHMZ2XW.js → chunk-NLYALJMY.js} +24 -14
  39. package/dist/chunk-NLYALJMY.js.map +1 -0
  40. package/dist/{chunk-EZNTORXE.js → chunk-NM5UYF6Q.js} +1 -1
  41. package/dist/chunk-NM5UYF6Q.js.map +1 -0
  42. package/dist/{chunk-NEX7JCMO.js → chunk-OWHP3H5C.js} +3 -3
  43. package/dist/{chunk-WO4T4OD5.js → chunk-P4JO3H6R.js} +2 -2
  44. package/dist/{chunk-CCDP6EPB.js → chunk-PWPYO73B.js} +2 -2
  45. package/dist/{chunk-56IIVAEO.js → chunk-Q2SEJMP2.js} +2 -2
  46. package/dist/{chunk-JIDLU57U.js → chunk-Q36YXK77.js} +2 -2
  47. package/dist/{chunk-KPXM4WO6.js → chunk-Q5YJCVJY.js} +3 -3
  48. package/dist/{chunk-JYV4JJV2.js → chunk-QGIBI6GL.js} +4 -4
  49. package/dist/{chunk-DGBIHDVK.js → chunk-RBTVFPHF.js} +3 -3
  50. package/dist/{chunk-6R6Q3MRN.js → chunk-RQ4ZI4ZI.js} +4 -4
  51. package/dist/{chunk-FO6RNKKW.js → chunk-S7GIXBXV.js} +2 -2
  52. package/dist/chunk-SBHN6QUT.js +25 -0
  53. package/dist/chunk-SBHN6QUT.js.map +1 -0
  54. package/dist/{chunk-3XKESW5E.js → chunk-SF2ZIRD6.js} +2 -2
  55. package/dist/{chunk-TE6LH6J2.js → chunk-SFBYQMZM.js} +3 -3
  56. package/dist/{chunk-RZPOZPZU.js → chunk-SU6SGWXM.js} +3 -3
  57. package/dist/{chunk-6L3DKWRY.js → chunk-T2MOJF76.js} +2 -2
  58. package/dist/{chunk-SKM35Y4Q.js → chunk-TS5XLBZR.js} +3 -3
  59. package/dist/{chunk-HFUAFR6B.js → chunk-TWPK7KUJ.js} +3 -3
  60. package/dist/{chunk-6M2I3DKF.js → chunk-WK7ULBTP.js} +2 -2
  61. package/dist/{chunk-IF6WNGAK.js → chunk-WUHEP3HH.js} +2 -2
  62. package/dist/{chunk-NQSO4UAH.js → chunk-WYUAEZSC.js} +3 -3
  63. package/dist/{chunk-Y6VZQGGH.js → chunk-YGK2HMLR.js} +4 -4
  64. package/dist/{chunk-OW5Y6HA6.js → chunk-ZBYFMI6D.js} +223 -119
  65. package/dist/chunk-ZBYFMI6D.js.map +1 -0
  66. package/dist/{chunk-N5PLUFH2.js → chunk-ZFG5EBI3.js} +4 -4
  67. package/dist/{chunk-KFRPNHWR.js → chunk-ZHDSUZQU.js} +3 -3
  68. package/dist/{chunk-C25JXSOR.js → chunk-ZNWSG7XC.js} +5 -5
  69. package/dist/classified/index.js +3 -3
  70. package/dist/{classified-marker-EOOSMWFC.js → classified-marker-LE54HWSX.js} +3 -3
  71. package/dist/{collection-facade-TTRF5NFJ.js → collection-facade-DO2AABZT.js} +8 -8
  72. package/dist/consent/index.js +4 -4
  73. package/dist/cover/index.js +2 -2
  74. package/dist/custody/index.js +6 -6
  75. package/dist/{dead-filter-6DYY7S64.js → dead-filter-V3LVWYEJ.js} +2 -2
  76. package/dist/debug/index.js +29 -0
  77. package/dist/debug/index.js.map +1 -0
  78. package/dist/{delegation-ONOZVPIP.js → delegation-JDUMAF6L.js} +4 -4
  79. package/dist/derivations/index.js +3 -3
  80. package/dist/{derive-IGGVSUPH.js → derive-ZPGVLE2Q.js} +4 -4
  81. package/dist/directory/index.js +5 -5
  82. package/dist/{dispatch-RPTLK7LJ.js → dispatch-6TV3DGO6.js} +5 -5
  83. package/dist/{dispatch-7T45NN7C.js → dispatch-W7NWQ637.js} +9 -9
  84. package/dist/{enclave-CLJVSDFG.js → enclave-YFCLPIDR.js} +4 -4
  85. package/dist/{executor-XZYM4KHT.js → executor-FPHKWDWT.js} +8 -8
  86. package/dist/{export-accessible-24XCCD3A.js → export-accessible-EKM3HGB2.js} +7 -7
  87. package/dist/{extract-partition-H2TPEEOF.js → extract-partition-LS4ET5A6.js} +10 -10
  88. package/dist/{fanout-sidecar-TV7CXAJ6.js → fanout-sidecar-273RDMYS.js} +4 -4
  89. package/dist/forget/index.js +4 -4
  90. package/dist/history/index.js +6 -6
  91. package/dist/i18n/index.js +6 -6
  92. package/dist/index.d.ts +7 -7
  93. package/dist/index.js +148 -96
  94. package/dist/index.js.map +1 -1
  95. package/dist/introspection/index.js +5 -5
  96. package/dist/{issue-55HJE7JF.js → issue-LIA7FXBJ.js} +6 -6
  97. package/dist/kernel/collection.d.ts +89 -2
  98. package/dist/kernel/debug.d.ts +11 -0
  99. package/dist/kernel/noydb.d.ts +3 -3
  100. package/dist/kernel/prepared-write.d.ts +70 -0
  101. package/dist/kernel/sync-policy.d.ts +75 -3
  102. package/dist/kernel/types.d.ts +27 -8
  103. package/dist/{ledger-XY6NP3J2.js → ledger-XE7JF2I2.js} +6 -6
  104. package/dist/liberate-WZ3RHVKW.js +24 -0
  105. package/dist/{link-set-POQB7BU5.js → link-set-CGYC3OH5.js} +5 -5
  106. package/dist/materialized-views/index.js +13 -13
  107. package/dist/{noydb-MGPOYDOD.js → noydb-ZLPVCDES.js} +30 -31
  108. package/dist/periods/index.js +8 -8
  109. package/dist/pod/index.js +6 -6
  110. package/dist/policy/index.js +3 -3
  111. package/dist/port/with/strategies.d.ts +1 -1
  112. package/dist/portability/index.js +6 -6
  113. package/dist/{post-register-URQANI3B.js → post-register-LY35EDTJ.js} +4 -4
  114. package/dist/{register-5W6CG4RM.js → register-6RIBIT3I.js} +6 -6
  115. package/dist/{registry-UJFP3NWF.js → registry-MUSL4AW6.js} +4 -4
  116. package/dist/{registry-MCSGBZXI.js → registry-RON4WHAP.js} +4 -4
  117. package/dist/{request-withdrawal-IWYDM4SO.js → request-withdrawal-FT3ORAWN.js} +9 -9
  118. package/dist/{reveal-BXZGWIOP.js → reveal-T34ADTPY.js} +3 -3
  119. package/dist/{revoke-TINYPHYY.js → revoke-HC7WG3HE.js} +6 -6
  120. package/dist/sealed-record/index.js +6 -6
  121. package/dist/search/index.js +1 -1
  122. package/dist/{seed-F7YYQTRC.js → seed-JOV54PB3.js} +6 -6
  123. package/dist/seed-JOV54PB3.js.map +1 -0
  124. package/dist/sequence/index.js +4 -4
  125. package/dist/session/index.js +3 -3
  126. package/dist/{signer-WMZKCNKC.js → signer-CTWOH6KT.js} +5 -5
  127. package/dist/snapshots/index.js +5 -5
  128. package/dist/{stale-JOE7GBAE.js → stale-T3V7XEOB.js} +5 -5
  129. package/dist/{storage-B3WBKXKT.js → storage-LLNLPWWB.js} +5 -5
  130. package/dist/{store-coordination-provider-5LX2UFU2.js → store-coordination-provider-AHGFEMFA.js} +3 -3
  131. package/dist/sync/index.js +9 -10
  132. package/dist/sync/index.js.map +1 -1
  133. package/dist/team/index.js +8 -30
  134. package/dist/tiers/index.js +4 -4
  135. package/dist/transactions/index.js +1 -1
  136. package/dist/{walk-6OHAWGBS.js → walk-G3NFEP5L.js} +6 -6
  137. package/dist/with-commit/tx/atomic-eligibility.d.ts +47 -0
  138. package/dist/with-commit/tx/transaction.d.ts +22 -9
  139. package/dist/with-party/broker/seed.d.ts +1 -1
  140. package/dist/with-party/team/index.d.ts +0 -5
  141. package/dist/{with-party/team/sync-active.d.ts → with-sync/active.d.ts} +1 -1
  142. package/dist/{with-party/team/sync-credentials.d.ts → with-sync/credentials.d.ts} +3 -3
  143. package/dist/{with-party/team/sync.d.ts → with-sync/engine.d.ts} +5 -5
  144. package/dist/{with-party/sync → with-sync}/index.d.ts +3 -3
  145. package/dist/{with-party/team/sync-period-scope.d.ts → with-sync/period-scope.d.ts} +2 -2
  146. package/dist/{with-party/team → with-sync}/presence.d.ts +2 -2
  147. package/dist/{with-party/team/sync-strategy.d.ts → with-sync/strategy.d.ts} +6 -6
  148. package/dist/{with-party/team/sync-transaction.d.ts → with-sync/transaction.d.ts} +3 -3
  149. package/dist/{withdraw-accessible-DEUCOO4F.js → withdraw-accessible-ANSVG6XG.js} +8 -8
  150. package/package.json +8 -4
  151. package/dist/chunk-BXHMZ2XW.js.map +0 -1
  152. package/dist/chunk-EP5L47XV.js +0 -22
  153. package/dist/chunk-EP5L47XV.js.map +0 -1
  154. package/dist/chunk-EZNTORXE.js.map +0 -1
  155. package/dist/chunk-GZACYEOB.js.map +0 -1
  156. package/dist/chunk-MTJLOC3Y.js.map +0 -1
  157. package/dist/chunk-NGSJZFGL.js.map +0 -1
  158. package/dist/chunk-OW5Y6HA6.js.map +0 -1
  159. package/dist/chunk-SHYIA73K.js +0 -99
  160. package/dist/chunk-SHYIA73K.js.map +0 -1
  161. package/dist/chunk-Y6B6HVKC.js.map +0 -1
  162. package/dist/liberate-LXOJ2EMB.js +0 -24
  163. package/dist/seed-F7YYQTRC.js.map +0 -1
  164. /package/dist/{api-3NKVNZPM.js.map → api-SI2IVBQO.js.map} +0 -0
  165. /package/dist/{backup-PTSVXDDW.js.map → backup-X7F3TCFV.js.map} +0 -0
  166. /package/dist/{chunk-WZ3NCMK6.js.map → chunk-2BET5QTS.js.map} +0 -0
  167. /package/dist/{chunk-BYFXLDVV.js.map → chunk-3ECU57YH.js.map} +0 -0
  168. /package/dist/{chunk-ZWBKDKXC.js.map → chunk-467SWYT5.js.map} +0 -0
  169. /package/dist/{chunk-XIDQKFZF.js.map → chunk-5UQ7Y6SQ.js.map} +0 -0
  170. /package/dist/{chunk-IMRB2C4O.js.map → chunk-7H3WWH6J.js.map} +0 -0
  171. /package/dist/{chunk-OLIWCCFM.js.map → chunk-CLE3TMIS.js.map} +0 -0
  172. /package/dist/{chunk-ZFUFAHZ3.js.map → chunk-DAFBJS4Y.js.map} +0 -0
  173. /package/dist/{chunk-ISRKW4YN.js.map → chunk-DQZXPGGZ.js.map} +0 -0
  174. /package/dist/{chunk-FMNU7IUG.js.map → chunk-DTFA5DO4.js.map} +0 -0
  175. /package/dist/{chunk-VH6SOCXH.js.map → chunk-EFJAAFBW.js.map} +0 -0
  176. /package/dist/{chunk-TIVK6PRK.js.map → chunk-ERGECZEI.js.map} +0 -0
  177. /package/dist/{chunk-KW42W6SV.js.map → chunk-HLKXPJ4V.js.map} +0 -0
  178. /package/dist/{chunk-MANUDU7I.js.map → chunk-HZZP2ZIG.js.map} +0 -0
  179. /package/dist/{chunk-DZAF24PG.js.map → chunk-IFOH7RBI.js.map} +0 -0
  180. /package/dist/{chunk-FRMW23UK.js.map → chunk-IVYQAVWO.js.map} +0 -0
  181. /package/dist/{chunk-SGQ4N5FS.js.map → chunk-JEI6JJNI.js.map} +0 -0
  182. /package/dist/{chunk-BN4HRYAZ.js.map → chunk-JQ2AX4T5.js.map} +0 -0
  183. /package/dist/{chunk-OBPVWOSQ.js.map → chunk-KD4HGBJV.js.map} +0 -0
  184. /package/dist/{chunk-QADFHRQM.js.map → chunk-KYRDJI5O.js.map} +0 -0
  185. /package/dist/{chunk-2NMEGSFV.js.map → chunk-LLYIMSQQ.js.map} +0 -0
  186. /package/dist/{chunk-GP3UWP22.js.map → chunk-LRRX57UA.js.map} +0 -0
  187. /package/dist/{chunk-OLSARBZU.js.map → chunk-LXRTP3AQ.js.map} +0 -0
  188. /package/dist/{chunk-EBKCYQ2D.js.map → chunk-NBXFCQX4.js.map} +0 -0
  189. /package/dist/{chunk-NEX7JCMO.js.map → chunk-OWHP3H5C.js.map} +0 -0
  190. /package/dist/{chunk-WO4T4OD5.js.map → chunk-P4JO3H6R.js.map} +0 -0
  191. /package/dist/{chunk-CCDP6EPB.js.map → chunk-PWPYO73B.js.map} +0 -0
  192. /package/dist/{chunk-56IIVAEO.js.map → chunk-Q2SEJMP2.js.map} +0 -0
  193. /package/dist/{chunk-JIDLU57U.js.map → chunk-Q36YXK77.js.map} +0 -0
  194. /package/dist/{chunk-KPXM4WO6.js.map → chunk-Q5YJCVJY.js.map} +0 -0
  195. /package/dist/{chunk-JYV4JJV2.js.map → chunk-QGIBI6GL.js.map} +0 -0
  196. /package/dist/{chunk-DGBIHDVK.js.map → chunk-RBTVFPHF.js.map} +0 -0
  197. /package/dist/{chunk-6R6Q3MRN.js.map → chunk-RQ4ZI4ZI.js.map} +0 -0
  198. /package/dist/{chunk-FO6RNKKW.js.map → chunk-S7GIXBXV.js.map} +0 -0
  199. /package/dist/{chunk-3XKESW5E.js.map → chunk-SF2ZIRD6.js.map} +0 -0
  200. /package/dist/{chunk-TE6LH6J2.js.map → chunk-SFBYQMZM.js.map} +0 -0
  201. /package/dist/{chunk-RZPOZPZU.js.map → chunk-SU6SGWXM.js.map} +0 -0
  202. /package/dist/{chunk-6L3DKWRY.js.map → chunk-T2MOJF76.js.map} +0 -0
  203. /package/dist/{chunk-SKM35Y4Q.js.map → chunk-TS5XLBZR.js.map} +0 -0
  204. /package/dist/{chunk-HFUAFR6B.js.map → chunk-TWPK7KUJ.js.map} +0 -0
  205. /package/dist/{chunk-6M2I3DKF.js.map → chunk-WK7ULBTP.js.map} +0 -0
  206. /package/dist/{chunk-IF6WNGAK.js.map → chunk-WUHEP3HH.js.map} +0 -0
  207. /package/dist/{chunk-NQSO4UAH.js.map → chunk-WYUAEZSC.js.map} +0 -0
  208. /package/dist/{chunk-Y6VZQGGH.js.map → chunk-YGK2HMLR.js.map} +0 -0
  209. /package/dist/{chunk-N5PLUFH2.js.map → chunk-ZFG5EBI3.js.map} +0 -0
  210. /package/dist/{chunk-KFRPNHWR.js.map → chunk-ZHDSUZQU.js.map} +0 -0
  211. /package/dist/{chunk-C25JXSOR.js.map → chunk-ZNWSG7XC.js.map} +0 -0
  212. /package/dist/{classified-marker-EOOSMWFC.js.map → classified-marker-LE54HWSX.js.map} +0 -0
  213. /package/dist/{collection-facade-TTRF5NFJ.js.map → collection-facade-DO2AABZT.js.map} +0 -0
  214. /package/dist/{dead-filter-6DYY7S64.js.map → dead-filter-V3LVWYEJ.js.map} +0 -0
  215. /package/dist/{delegation-ONOZVPIP.js.map → delegation-JDUMAF6L.js.map} +0 -0
  216. /package/dist/{derive-IGGVSUPH.js.map → derive-ZPGVLE2Q.js.map} +0 -0
  217. /package/dist/{dispatch-RPTLK7LJ.js.map → dispatch-6TV3DGO6.js.map} +0 -0
  218. /package/dist/{dispatch-7T45NN7C.js.map → dispatch-W7NWQ637.js.map} +0 -0
  219. /package/dist/{enclave-CLJVSDFG.js.map → enclave-YFCLPIDR.js.map} +0 -0
  220. /package/dist/{executor-XZYM4KHT.js.map → executor-FPHKWDWT.js.map} +0 -0
  221. /package/dist/{export-accessible-24XCCD3A.js.map → export-accessible-EKM3HGB2.js.map} +0 -0
  222. /package/dist/{extract-partition-H2TPEEOF.js.map → extract-partition-LS4ET5A6.js.map} +0 -0
  223. /package/dist/{fanout-sidecar-TV7CXAJ6.js.map → fanout-sidecar-273RDMYS.js.map} +0 -0
  224. /package/dist/{issue-55HJE7JF.js.map → issue-LIA7FXBJ.js.map} +0 -0
  225. /package/dist/{ledger-XY6NP3J2.js.map → ledger-XE7JF2I2.js.map} +0 -0
  226. /package/dist/{liberate-LXOJ2EMB.js.map → liberate-WZ3RHVKW.js.map} +0 -0
  227. /package/dist/{link-set-POQB7BU5.js.map → link-set-CGYC3OH5.js.map} +0 -0
  228. /package/dist/{noydb-MGPOYDOD.js.map → noydb-ZLPVCDES.js.map} +0 -0
  229. /package/dist/{post-register-URQANI3B.js.map → post-register-LY35EDTJ.js.map} +0 -0
  230. /package/dist/{register-5W6CG4RM.js.map → register-6RIBIT3I.js.map} +0 -0
  231. /package/dist/{registry-MCSGBZXI.js.map → registry-MUSL4AW6.js.map} +0 -0
  232. /package/dist/{registry-UJFP3NWF.js.map → registry-RON4WHAP.js.map} +0 -0
  233. /package/dist/{request-withdrawal-IWYDM4SO.js.map → request-withdrawal-FT3ORAWN.js.map} +0 -0
  234. /package/dist/{reveal-BXZGWIOP.js.map → reveal-T34ADTPY.js.map} +0 -0
  235. /package/dist/{revoke-TINYPHYY.js.map → revoke-HC7WG3HE.js.map} +0 -0
  236. /package/dist/{signer-WMZKCNKC.js.map → signer-CTWOH6KT.js.map} +0 -0
  237. /package/dist/{stale-JOE7GBAE.js.map → stale-T3V7XEOB.js.map} +0 -0
  238. /package/dist/{storage-B3WBKXKT.js.map → storage-LLNLPWWB.js.map} +0 -0
  239. /package/dist/{store-coordination-provider-5LX2UFU2.js.map → store-coordination-provider-AHGFEMFA.js.map} +0 -0
  240. /package/dist/{walk-6OHAWGBS.js.map → walk-G3NFEP5L.js.map} +0 -0
  241. /package/dist/{with-party → with-sync}/tab-coordination.d.ts +0 -0
  242. /package/dist/{with-party → with-sync}/tab-write-relay.d.ts +0 -0
  243. /package/dist/{withdraw-accessible-DEUCOO4F.js.map → withdraw-accessible-ANSVG6XG.js.map} +0 -0
@@ -1,3 +1,7 @@
1
+ import {
2
+ hashFields,
3
+ validateSatelliteDeclaration
4
+ } from "./chunk-SHEEBRZ4.js";
1
5
  import {
2
6
  resolveStaleOnRead
3
7
  } from "./chunk-NJ4DYYO5.js";
@@ -8,30 +12,31 @@ import {
8
12
  linkRowKey
9
13
  } from "./chunk-4JQK3L4V.js";
10
14
  import {
11
- hashFields,
12
- validateSatelliteDeclaration
13
- } from "./chunk-SHEEBRZ4.js";
15
+ isBaseLive,
16
+ liveBaseIdSet
17
+ } from "./chunk-GYGLAVCX.js";
14
18
  import {
15
19
  loadFence
16
- } from "./chunk-6M2I3DKF.js";
20
+ } from "./chunk-WK7ULBTP.js";
17
21
  import {
18
22
  VectorSet,
19
23
  buildPersistedIndexCallbacks,
20
24
  encodeVecId,
21
25
  syncTierSearch
22
- } from "./chunk-CCDP6EPB.js";
26
+ } from "./chunk-PWPYO73B.js";
23
27
  import {
24
28
  SchemaUpdateGate
25
29
  } from "./chunk-6LJY7X5A.js";
26
30
  import {
27
- isBaseLive,
28
- liveBaseIdSet
29
- } from "./chunk-GYGLAVCX.js";
31
+ NO_CLASSIFIED,
32
+ guardClassifiedCompat,
33
+ resolveClassifiedFields
34
+ } from "./chunk-DAFBJS4Y.js";
30
35
  import {
31
36
  NO_TIERS,
32
37
  classifySealedShred,
33
38
  syncDerivedOutputs
34
- } from "./chunk-6R6Q3MRN.js";
39
+ } from "./chunk-RQ4ZI4ZI.js";
35
40
  import {
36
41
  NO_PORTABILITY
37
42
  } from "./chunk-BLBAQRBM.js";
@@ -42,7 +47,7 @@ import {
42
47
  import {
43
48
  resolveManagedSecret,
44
49
  saveSealedSecret
45
- } from "./chunk-OLIWCCFM.js";
50
+ } from "./chunk-CLE3TMIS.js";
46
51
  import {
47
52
  jsonSchemaToFields
48
53
  } from "./chunk-VYYM3MEN.js";
@@ -50,6 +55,10 @@ import {
50
55
  derivePersistedSchema,
51
56
  isZod4Schema
52
57
  } from "./chunk-6ZNSB3H6.js";
58
+ import {
59
+ CustodyApi,
60
+ NO_CUSTODY
61
+ } from "./chunk-TS5XLBZR.js";
53
62
  import {
54
63
  DEFAULT_POSTURE,
55
64
  ViaGraph
@@ -77,24 +86,30 @@ import {
77
86
  selfWriteFieldEqual,
78
87
  touchFor,
79
88
  updateReferencingRecords
80
- } from "./chunk-GP3UWP22.js";
89
+ } from "./chunk-LRRX57UA.js";
81
90
  import {
82
91
  OverlayedCollection
83
92
  } from "./chunk-ZTLOXFPB.js";
84
93
  import {
94
+ INDEXED_STORE_POLICY,
85
95
  NO_SYNC
86
- } from "./chunk-EP5L47XV.js";
96
+ } from "./chunk-55LKVALY.js";
87
97
  import {
88
98
  NO_ATTESTATION
89
99
  } from "./chunk-5GQEU4DN.js";
90
100
  import {
91
- NO_CLASSIFIED,
92
- guardClassifiedCompat,
93
- resolveClassifiedFields
94
- } from "./chunk-ZFUFAHZ3.js";
101
+ NO_CONSENT
102
+ } from "./chunk-PEOZ34EM.js";
95
103
  import {
96
104
  NO_PERIODS
97
- } from "./chunk-N5PLUFH2.js";
105
+ } from "./chunk-ZFG5EBI3.js";
106
+ import {
107
+ PERIODS_COLLECTION,
108
+ PERIOD_ARCHIVES_COLLECTION,
109
+ PERIOD_FREEZES_COLLECTION,
110
+ PERIOD_TARGET_PURGES_COLLECTION,
111
+ periodExclusiveUpperBound
112
+ } from "./chunk-NM5UYF6Q.js";
98
113
  import {
99
114
  NO_SHADOW
100
115
  } from "./chunk-SMY5X46Z.js";
@@ -105,7 +120,7 @@ import {
105
120
  TxContext,
106
121
  bestEffortRevert,
107
122
  revertExecuted
108
- } from "./chunk-NGSJZFGL.js";
123
+ } from "./chunk-GTYFIVIZ.js";
109
124
  import {
110
125
  lazy
111
126
  } from "./chunk-5D2ALSM5.js";
@@ -113,17 +128,13 @@ import {
113
128
  InvertedIndex,
114
129
  MemoryIndexStore,
115
130
  NO_SEARCH
116
- } from "./chunk-QADFHRQM.js";
131
+ } from "./chunk-KYRDJI5O.js";
117
132
  import {
118
133
  NO_SEQUENCE,
119
134
  SEQUENCE_COLLECTION,
120
135
  compileSequenceFormat,
121
136
  resolveSequenceKey
122
- } from "./chunk-EBKCYQ2D.js";
123
- import {
124
- CustodyApi,
125
- NO_CUSTODY
126
- } from "./chunk-SKM35Y4Q.js";
137
+ } from "./chunk-NBXFCQX4.js";
127
138
  import {
128
139
  Query,
129
140
  ScanBuilder
@@ -133,7 +144,7 @@ import {
133
144
  NO_BLOBS,
134
145
  createExportBlobsHandle,
135
146
  runCompaction
136
- } from "./chunk-IF6WNGAK.js";
147
+ } from "./chunk-WUHEP3HH.js";
137
148
  import {
138
149
  LazyQuery,
139
150
  NO_INDEXING,
@@ -157,12 +168,9 @@ import {
157
168
  import {
158
169
  NO_CRDT
159
170
  } from "./chunk-PVEWA2DU.js";
160
- import {
161
- NO_CONSENT
162
- } from "./chunk-PEOZ34EM.js";
163
171
  import {
164
172
  dictCollectionName
165
- } from "./chunk-NEX7JCMO.js";
173
+ } from "./chunk-OWHP3H5C.js";
166
174
  import {
167
175
  NO_I18N,
168
176
  getAtPath,
@@ -197,17 +205,7 @@ import {
197
205
  saveShamirRecoveryEntries,
198
206
  updateAuthenticator,
199
207
  writeMagicLinkGrant
200
- } from "./chunk-C25JXSOR.js";
201
- import {
202
- INDEXED_STORE_POLICY
203
- } from "./chunk-MTJLOC3Y.js";
204
- import {
205
- PERIODS_COLLECTION,
206
- PERIOD_ARCHIVES_COLLECTION,
207
- PERIOD_FREEZES_COLLECTION,
208
- PERIOD_TARGET_PURGES_COLLECTION,
209
- periodExclusiveUpperBound
210
- } from "./chunk-EZNTORXE.js";
208
+ } from "./chunk-ZNWSG7XC.js";
211
209
  import {
212
210
  assertKeyringOpenAllowed,
213
211
  buildRecipientKeyringFile,
@@ -222,11 +220,11 @@ import {
222
220
  listUsers,
223
221
  loadKeyring,
224
222
  updateKeyringIdentity
225
- } from "./chunk-KPXM4WO6.js";
223
+ } from "./chunk-Q5YJCVJY.js";
226
224
  import {
227
225
  persistDirectoryConfig,
228
226
  readDirectoryConfig
229
- } from "./chunk-WZ3NCMK6.js";
227
+ } from "./chunk-2BET5QTS.js";
230
228
  import {
231
229
  NO_BROKER,
232
230
  buildCredentialBrokerHandle
@@ -247,7 +245,7 @@ import {
247
245
  } from "./chunk-JYJFGD2H.js";
248
246
  import {
249
247
  sha256Hex
250
- } from "./chunk-ISRKW4YN.js";
248
+ } from "./chunk-DQZXPGGZ.js";
251
249
  import {
252
250
  NO_FORGET,
253
251
  addSubjectRef,
@@ -256,7 +254,7 @@ import {
256
254
  readDottedPath,
257
255
  rebuildSubjectIndex,
258
256
  removeSubjectRef
259
- } from "./chunk-KFRPNHWR.js";
257
+ } from "./chunk-ZHDSUZQU.js";
260
258
  import {
261
259
  NO_SEALED_RECORD
262
260
  } from "./chunk-QD46HPZG.js";
@@ -270,20 +268,20 @@ import {
270
268
  queryByDet,
271
269
  resolveStableCek,
272
270
  validateSchemaInput
273
- } from "./chunk-RZPOZPZU.js";
271
+ } from "./chunk-SU6SGWXM.js";
274
272
  import {
275
273
  buildDeleteMarker,
276
274
  buildTombstone,
277
275
  isDeleteMarker,
278
276
  isTombstone
279
- } from "./chunk-VH6SOCXH.js";
277
+ } from "./chunk-EFJAAFBW.js";
280
278
  import {
281
279
  encrypt
282
280
  } from "./chunk-AKKRXT23.js";
283
281
  import {
284
282
  NOYDB_FORMAT_VERSION,
285
283
  SealedHandle
286
- } from "./chunk-GZACYEOB.js";
284
+ } from "./chunk-77AEMXFA.js";
287
285
  import {
288
286
  AlreadyElevatedError,
289
287
  AttestationError,
@@ -390,7 +388,7 @@ function resolveStrategies(options) {
390
388
 
391
389
  // src/port/by/default-provider.ts
392
390
  async function createDefaultCoordinationProvider(store) {
393
- const { StoreCoordinationProvider } = await import("./store-coordination-provider-5LX2UFU2.js");
391
+ const { StoreCoordinationProvider } = await import("./store-coordination-provider-AHGFEMFA.js");
394
392
  return new StoreCoordinationProvider(store);
395
393
  }
396
394
 
@@ -2237,7 +2235,7 @@ var Collection = class {
2237
2235
  * re-create version-continuity gate in `_putInternal` read the store ONLY
2238
2236
  * for a known marker prior, instead of unconditionally on every insert.
2239
2237
  * Populated on hydration (`ensureHydrated`/`hydrateFromSnapshot`), local
2240
- * delete (`_doDelete`), and the sync/tab/cutover choke point
2238
+ * delete (`_commitDelete`), and the sync/tab/cutover choke point
2241
2239
  * (`_invalidateCacheEntry`). Accepted drift: `vault._purgeDeleteMarkers`/
2242
2240
  * `_purgeMarkersOn` remove markers directly on the raw store, bypassing
2243
2241
  * Collection, so this set can hold stale ids after a purge on an
@@ -3160,7 +3158,7 @@ var Collection = class {
3160
3158
  }
3161
3159
  }
3162
3160
  if (this.materializedViewSource !== void 0) {
3163
- const { resolveStaleMVOnRead } = await import("./stale-JOE7GBAE.js");
3161
+ const { resolveStaleMVOnRead } = await import("./stale-T3V7XEOB.js");
3164
3162
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
3165
3163
  }
3166
3164
  let record;
@@ -3513,7 +3511,13 @@ var Collection = class {
3513
3511
  }
3514
3512
  await this._onRecordMutated(id, "put", "local-write", { record: event, version });
3515
3513
  }
3516
- async _putInternal(id, record, options) {
3514
+ /**
3515
+ * The pre-envelope stages both write paths share (#904): permission + tier
3516
+ * refusal, Via ingest, the beforePut gate bus, Via enforceWrite, computed
3517
+ * fields, schema validation, Via encodeWrite and ref enforcement. Reads and
3518
+ * throws; commits nothing. Returns the record in the shape that gets stored.
3519
+ */
3520
+ async #prepareWriteRecord(id, record) {
3517
3521
  if (!hasWritePermission(this.keyring, this.name)) {
3518
3522
  throw new ReadOnlyError();
3519
3523
  }
@@ -3555,7 +3559,11 @@ var Collection = class {
3555
3559
  if (this.refEnforcer !== void 0) {
3556
3560
  await this.refEnforcer.enforceRefsOnPut(this.name, record);
3557
3561
  }
3562
+ return record;
3563
+ }
3564
+ async _putInternal(id, record, options) {
3558
3565
  if (this.crdtMode) {
3566
+ record = await this.#prepareWriteRecord(id, record);
3559
3567
  const existingEnvelope = await this.adapter.get(this.vault, this.name, id);
3560
3568
  const existingVersion = existingEnvelope?._v ?? 0;
3561
3569
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -3569,20 +3577,20 @@ var Collection = class {
3569
3577
  } else {
3570
3578
  crdtState = { _crdt: "yjs", update: record };
3571
3579
  }
3572
- const version2 = existingVersion + 1;
3573
- const cek2 = this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
3574
- const envelope2 = await this.codec.encryptJsonString(JSON.stringify(crdtState), version2, cek2, options?.source, options?.sourceTs);
3575
- await this.adapter.put(this.vault, this.name, id, envelope2);
3580
+ const version = existingVersion + 1;
3581
+ const cek = this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
3582
+ const envelope = await this.codec.encryptJsonString(JSON.stringify(crdtState), version, cek, options?.source, options?.sourceTs);
3583
+ await this.adapter.put(this.vault, this.name, id, envelope);
3576
3584
  const resolvedRecord = this.strategies.crdt.resolveCrdtSnapshot(crdtState);
3577
3585
  const existingResolvedRecord = existingEnvelope ? await this.codec.decryptRecord(existingEnvelope, { skipValidation: true }) : null;
3578
3586
  const existingResolved = existingResolvedRecord !== null ? { record: existingResolvedRecord, version: existingVersion } : void 0;
3579
3587
  if (existingResolved) {
3580
- await this.#savePriorHistory(id, existingResolved, cek2, this.vdigFields !== null ? { id, prev: existingEnvelope } : void 0);
3588
+ await this.#savePriorHistory(id, existingResolved, cek, this.vdigFields !== null ? { id, prev: existingEnvelope } : void 0);
3581
3589
  }
3582
3590
  await this.#commitWriteTail({
3583
3591
  id,
3584
- envelope: envelope2,
3585
- version: version2,
3592
+ envelope,
3593
+ version,
3586
3594
  indexed: resolvedRecord,
3587
3595
  event: record,
3588
3596
  prior: existingResolved,
@@ -3590,6 +3598,23 @@ var Collection = class {
3590
3598
  });
3591
3599
  return;
3592
3600
  }
3601
+ await this._commitPut(await this._preparePut(id, record, options));
3602
+ }
3603
+ /**
3604
+ * Prepare half of the ordinary (non-CRDT) write (#893/#904): run every
3605
+ * pre-envelope stage, resolve the prior version, and produce the encrypted
3606
+ * envelope — with ZERO observable side effects. No store write, no cache or
3607
+ * index mutation, no history entry, no ledger append, no event. It may READ
3608
+ * the store (gate prior, lazy prior, vdig prior) and it may THROW; refusing
3609
+ * a write before anything commits is precisely its job.
3610
+ *
3611
+ * Pairs with {@link _commitPut}. Split out so a batch can prepare every op,
3612
+ * submit ONE `store.tx()`, then finalize each op.
3613
+ *
3614
+ * @internal
3615
+ */
3616
+ async _preparePut(id, record, options) {
3617
+ record = await this.#prepareWriteRecord(id, record);
3593
3618
  let existing;
3594
3619
  let priorRaw = null;
3595
3620
  if (this.lazy && this.lru) {
@@ -3617,19 +3642,36 @@ var Collection = class {
3617
3642
  this.uniqueConstraints?.check(id, record);
3618
3643
  const cek = this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
3619
3644
  const vdigCtx = this.vdigFields !== null ? { id, prev: await this.adapter.get(this.vault, this.name, id) } : void 0;
3620
- if (existing) await this.#savePriorHistory(id, existing, cek, vdigCtx);
3621
3645
  const envelope = await this.codec.encryptRecord(record, version, cek, options?.source, options?.sourceTs, vdigCtx, id);
3622
- await this.adapter.put(this.vault, this.name, id, envelope);
3646
+ return { id, envelope, version, indexed: record, event: record, prior: existing, cek, vdigCtx, reason: options?.reason };
3647
+ }
3648
+ /**
3649
+ * Commit half (#893/#904): the only place an ordinary put becomes
3650
+ * observable — history snapshot of the prior version, store write, marker
3651
+ * clear, then the shared write tail.
3652
+ *
3653
+ * History still runs BEFORE the store write, so a history failure leaves no
3654
+ * write behind. It now runs AFTER `encryptRecord` rather than before it —
3655
+ * the split's one sanctioned reorder, which also stops an encrypt failure
3656
+ * from leaving an orphan snapshot behind.
3657
+ *
3658
+ * @internal `persist: false` skips the `adapter.put` — see {@link _finalizePut}.
3659
+ */
3660
+ async _commitPut(prepared, persist = true) {
3661
+ const { id, envelope, version, indexed, event, prior, cek, vdigCtx, reason } = prepared;
3662
+ if (prior) await this.#savePriorHistory(id, prior, cek, vdigCtx);
3663
+ if (persist) await this.adapter.put(this.vault, this.name, id, envelope);
3623
3664
  this.markerIds.delete(id);
3624
- await this.#commitWriteTail({
3625
- id,
3626
- envelope,
3627
- version,
3628
- indexed: record,
3629
- event: record,
3630
- prior: existing,
3631
- reason: options?.reason
3632
- });
3665
+ await this.#commitWriteTail({ id, envelope, version, indexed, event, prior, reason });
3666
+ }
3667
+ /**
3668
+ * {@link _commitPut} minus the `adapter.put`: the store already holds this
3669
+ * envelope because it was written as one leg of a `store.tx()` batch.
3670
+ *
3671
+ * @internal
3672
+ */
3673
+ _finalizePut(prepared) {
3674
+ return this._commitPut(prepared, false);
3633
3675
  }
3634
3676
  /**
3635
3677
  * Fire registered MV strategies whose dependency set includes this
@@ -3646,7 +3688,7 @@ var Collection = class {
3646
3688
  */
3647
3689
  async dispatchMaterializedViews(id, record, wave) {
3648
3690
  if (this.materializedViewSource === void 0) return;
3649
- const { dispatchMaterializedViews } = await import("./dispatch-RPTLK7LJ.js");
3691
+ const { dispatchMaterializedViews } = await import("./dispatch-6TV3DGO6.js");
3650
3692
  return dispatchMaterializedViews(this.#mvDispatchCtx(this.materializedViewSource), id, record, wave);
3651
3693
  }
3652
3694
  /**
@@ -3819,7 +3861,7 @@ var Collection = class {
3819
3861
  * dispatch wave's per-target dedup; `undefined` on the local-write path (byte-identical). */
3820
3862
  async dispatchDerivations(id, record, version, wave) {
3821
3863
  if (this.derivationSource === void 0) return;
3822
- const { dispatchDerivations } = await import("./dispatch-7T45NN7C.js");
3864
+ const { dispatchDerivations } = await import("./dispatch-W7NWQ637.js");
3823
3865
  return dispatchDerivations({
3824
3866
  ...this.#derivationDeleteCtx(this.derivationSource),
3825
3867
  via: this.via,
@@ -3953,11 +3995,40 @@ var Collection = class {
3953
3995
  return await this._doDelete(id, true);
3954
3996
  }
3955
3997
  async _doDelete(id, internal) {
3998
+ const prepared = await this._prepareDelete(id, internal);
3999
+ return prepared === null ? false : await this._commitDelete(prepared);
4000
+ }
4001
+ /**
4002
+ * Prepare half of the delete (#893/#905): every refusal (write permission,
4003
+ * tier, the beforeDelete gate bus, foreign-key refs), the prior-version
4004
+ * resolution, the pre-delete payload hash, and the #589 marker DECISION —
4005
+ * the marker is minted here but NOT written.
4006
+ *
4007
+ * Commits nothing of its own: no store write, no history entry, no ledger
4008
+ * append, no cache/index mutation, no event, no `markerIds` entry. It READS
4009
+ * the store and it may THROW — refusing a delete before anything commits is
4010
+ * precisely its job. `null` is the "nothing to delete" answer that the early
4011
+ * `return false` paths gave: no live record, an already-shredded tombstone,
4012
+ * an existing marker, or the #718 elevated-internal skip.
4013
+ *
4014
+ * ONE exception to that guarantee: on a collection with `cascade` inbound
4015
+ * refs, prepare itself deletes the referencing children (via
4016
+ * `enforceRefsOnDelete`, as it always has) — prepare is NOT abortable there.
4017
+ * The transaction atomic path must never call this on such a collection; its
4018
+ * eligibility gate excludes refs-bearing collections.
4019
+ *
4020
+ * Pairs with {@link _commitDelete}. A deliberately separate split from the
4021
+ * put pair (#842c) — delete differs in hydration, in the history-read gate
4022
+ * and in the marker rules.
4023
+ *
4024
+ * @internal
4025
+ */
4026
+ async _prepareDelete(id, internal) {
3956
4027
  if (!hasWritePermission(this.keyring, this.name)) {
3957
4028
  throw new ReadOnlyError();
3958
4029
  }
3959
4030
  await assertTierWritable(this.adapter, this.vault, this.name, id, !internal && this.tiers !== null);
3960
- if (internal && this.tiers !== null && await liveRecordIsElevated(this.adapter, this.vault, this.name, id)) return false;
4031
+ if (internal && this.tiers !== null && await liveRecordIsElevated(this.adapter, this.vault, this.name, id)) return null;
3961
4032
  if (this.subsystemBus?.hasGateHandlers("beforeDelete")) {
3962
4033
  const { env: existingEnv, record: existingRecord, elided } = await this.resolveGatePrior("beforeDelete", id);
3963
4034
  if (existingEnv || elided) {
@@ -3992,32 +4063,42 @@ var Collection = class {
3992
4063
  } else {
3993
4064
  existing = await this.resolvePriorValues(id);
3994
4065
  }
3995
- if (existing && this.historyConfig.enabled !== false) {
3996
- const cek = this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
3997
- const prevForVdig = this.vdigFields !== null ? await this.adapter.get(this.vault, this.name, id) : null;
3998
- await this.strategies.history.saveHistory(this.adapter, this.vault, this.name, id, await this.codec.encryptRecord(existing.record, existing.version, cek, void 0, void 0, this.vdigFields !== null ? { id, prev: prevForVdig } : void 0, id));
3999
- }
4000
4066
  const previousEnvelope = await this.adapter.get(this.vault, this.name, id);
4001
4067
  const previousPayloadHash = await this.strategies.history.envelopePayloadHash(previousEnvelope);
4002
- let markerVersion;
4068
+ let marker;
4003
4069
  if (this.onDirty) {
4004
4070
  const live = previousEnvelope;
4005
- if (!live || isTombstone(live, this.storeCiphertext) || isDeleteMarker(live)) return false;
4006
- markerVersion = live._v + 1;
4007
- await this.adapter.put(this.vault, this.name, id, buildDeleteMarker(markerVersion, this.keyring.userId));
4008
- this.markerIds.add(id);
4009
- } else {
4010
- await this.adapter.delete(this.vault, this.name, id);
4071
+ if (!live || isTombstone(live, this.storeCiphertext) || isDeleteMarker(live)) return null;
4072
+ marker = buildDeleteMarker(live._v + 1, this.keyring.userId);
4011
4073
  }
4074
+ const snapshots = existing !== void 0 && this.historyConfig.enabled !== false;
4075
+ const cek = snapshots && this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
4076
+ const vdigCtx = snapshots && this.vdigFields !== null ? { id, prev: previousEnvelope } : void 0;
4077
+ return { id, internal, existing, previousPayloadHash, marker, cek, vdigCtx };
4078
+ }
4079
+ /**
4080
+ * Commit half (#893/#905): the only place a delete becomes observable —
4081
+ * history snapshot of the deleted version, the store write (the #589 marker
4082
+ * put, or the physical removal when sync is off), then the ledger entry,
4083
+ * cache/index teardown, the mutation event, and the user-initiated
4084
+ * derivation dispatch.
4085
+ *
4086
+ * History still runs BEFORE the store write, exactly as today, so a history
4087
+ * failure leaves no delete behind.
4088
+ *
4089
+ * @internal `persist: false` skips the store write — see {@link _finalizeDelete}.
4090
+ */
4091
+ async _commitDelete(prepared, persist = true) {
4092
+ const { id, internal, existing, previousPayloadHash, marker, cek, vdigCtx } = prepared;
4093
+ if (existing && this.historyConfig.enabled !== false) {
4094
+ await this.strategies.history.saveHistory(this.adapter, this.vault, this.name, id, await this.codec.encryptRecord(existing.record, existing.version, cek, void 0, void 0, vdigCtx, id));
4095
+ }
4096
+ if (marker) {
4097
+ if (persist) await this.adapter.put(this.vault, this.name, id, marker);
4098
+ this.markerIds.add(id);
4099
+ } else if (persist) await this.adapter.delete(this.vault, this.name, id);
4012
4100
  if (this.ledger) {
4013
- await this.ledger.append({
4014
- op: "delete",
4015
- collection: this.name,
4016
- id,
4017
- version: existing?.version ?? 0,
4018
- actor: this.keyring.userId,
4019
- payloadHash: previousPayloadHash
4020
- });
4101
+ await this.ledger.append({ op: "delete", collection: this.name, id, version: existing?.version ?? 0, actor: this.keyring.userId, payloadHash: previousPayloadHash });
4021
4102
  }
4022
4103
  if (this.lazy && this.lru) {
4023
4104
  this.lru.remove(id);
@@ -4031,7 +4112,7 @@ var Collection = class {
4031
4112
  this.uniqueConstraints?.remove(id, existing.record);
4032
4113
  }
4033
4114
  }
4034
- await this._onRecordMutated(id, "delete", "local-delete", { version: markerVersion ?? (existing?.version ?? 0) + 1 });
4115
+ await this._onRecordMutated(id, "delete", "local-delete", { version: marker?._v ?? (existing?.version ?? 0) + 1 });
4035
4116
  if (!internal) {
4036
4117
  await this.dispatchMaterializedViewsOnDelete(id);
4037
4118
  await this.dispatchArrayDerivationsOnDelete(id);
@@ -4039,6 +4120,15 @@ var Collection = class {
4039
4120
  }
4040
4121
  return true;
4041
4122
  }
4123
+ /**
4124
+ * {@link _commitDelete} minus the store write: the marker (or the removal)
4125
+ * already landed as one leg of a `store.tx()` batch.
4126
+ *
4127
+ * @internal
4128
+ */
4129
+ _finalizeDelete(prepared) {
4130
+ return this._commitDelete(prepared, false);
4131
+ }
4042
4132
  /**
4043
4133
  * @internal — GDPR crypto-shred a LIVE record to a tombstone.
4044
4134
  *
@@ -4096,7 +4186,7 @@ var Collection = class {
4096
4186
  */
4097
4187
  async dispatchArrayDerivationsOnDelete(id, eraseRecordShapeToo = false) {
4098
4188
  if (this.derivationSource === void 0) return 0;
4099
- const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-7T45NN7C.js");
4189
+ const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-W7NWQ637.js");
4100
4190
  return dispatchArrayDerivationsOnDelete(this.#derivationDeleteCtx(this.derivationSource), id, eraseRecordShapeToo);
4101
4191
  }
4102
4192
  /**
@@ -4110,7 +4200,7 @@ var Collection = class {
4110
4200
  */
4111
4201
  async dispatchMaterializedViewsOnDelete(id) {
4112
4202
  if (this.materializedViewSource === void 0) return { deleted: 0, residueUndecodable: [], residueDeclined: [] };
4113
- const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-RPTLK7LJ.js");
4203
+ const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-6TV3DGO6.js");
4114
4204
  return dispatchMaterializedViewsOnDelete(this.#mvDispatchCtx(this.materializedViewSource), id);
4115
4205
  }
4116
4206
  /**
@@ -4130,7 +4220,7 @@ var Collection = class {
4130
4220
  );
4131
4221
  }
4132
4222
  if (this.materializedViewSource !== void 0) {
4133
- const { resolveStaleMVOnRead } = await import("./stale-JOE7GBAE.js");
4223
+ const { resolveStaleMVOnRead } = await import("./stale-T3V7XEOB.js");
4134
4224
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
4135
4225
  }
4136
4226
  await this.ensureHydrated();
@@ -5283,14 +5373,14 @@ var Collection = class {
5283
5373
  /** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
5284
5374
  async _ensureClassifiedMarker() {
5285
5375
  if (this._markerPersisted || this.vdigFields === null) return;
5286
- const { persistClassifiedMarkerForFields } = await import("./classified-marker-EOOSMWFC.js");
5376
+ const { persistClassifiedMarkerForFields } = await import("./classified-marker-LE54HWSX.js");
5287
5377
  await persistClassifiedMarkerForFields(this.adapter, this.vault, this.name, this.vdigFields, await this.getDEK(this.name));
5288
5378
  this._markerPersisted = true;
5289
5379
  }
5290
5380
  /** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
5291
5381
  async _classifiedMarkerDigestOnly() {
5292
5382
  if (this._markerDigestOnlyCache !== void 0) return this._markerDigestOnlyCache;
5293
- const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-EOOSMWFC.js");
5383
+ const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-LE54HWSX.js");
5294
5384
  this._markerDigestOnlyCache = await readClassifiedMarkerDigestOnly(this.adapter, this.vault, this.name, await this.getDEK(this.name));
5295
5385
  return this._markerDigestOnlyCache;
5296
5386
  }
@@ -5384,6 +5474,16 @@ var Collection = class {
5384
5474
  return { i18nFields: this.i18nFields, lookupFields: this.lookupFields };
5385
5475
  }
5386
5476
  // @internal reconcile.ts's presentForJoin-rebuild union reader (#671 item 3)
5477
+ async _assertWriteGates() {
5478
+ await this.schemaUpdateGate?.assertWritable();
5479
+ await this.schemaFence?.assertWritable(this.name);
5480
+ }
5481
+ // @internal #906 — the two refusals `put()`/`delete()` assert BEFORE anything else: the schema-update gate (an opt-in but persistent `reject` decision) and the schema fence (stale generation → MigrationRequiredError; draining/migrating vault or pending per-collection cutover → SchemaFenceError). Neither lives in the prepare halves, and the atomic commit path calls those directly — so it asserts here, per op, mirroring put()/delete() exactly (the fence does a fresh store read per call, so per-op matches today's cost model). Deliberately NOT moved into the prepare halves: that would double-assert on the OCC path.
5482
+ _txAtomicSafe(opType) {
5483
+ if (this.materializedViewSource !== void 0 && this.materializedViewSource.registry().mvsForSource(this.name).length > 0 || this.derivationSource !== void 0 && this.derivationSource.registry().strategiesForSource(this.name).length > 0 || this.crdtMode !== void 0 || this.uniqueConstraints !== null || this.#hooksActive() || (this.subsystemBus?.hasHandlers(opType === "put" ? "afterPut" : "afterDelete") ?? false)) return false;
5484
+ return opType === "put" ? Object.keys(this._refs).length === 0 : this.refEnforcer === void 0;
5485
+ }
5486
+ // @internal #893/#906-prep atomic-commit eligibility gate (Task 4) — false on any derivation/MV source (any lifecycle), CRDT mode, unique constraints, or refs on this write direction. Put uses precise outbound `_refs`; delete deliberately uses blanket `refEnforcer` presence, NOT `refRegistry.getInbound()` — `enforceRefsOnDelete` (with-shape/links/vault-facade.ts) cascades from THREE sources (lookup-ref edges, classic inbound refs, managed links), and only the blanket check is >= as strict as all three. #906: also false while user write-hooks or an `afterPut`/`afterDelete` bus handler are live — note both signals are db-GLOBAL (one `onAfterWrite` anywhere, including the auto-registered cross-tab write relay, keeps every collection on the OCC path) — both fire in `put()`/`delete()`, which the atomic path bypasses (a `beforeWrite` hook can REFUSE a write, so silently skipping them would be a policy hole). See atomic-eligibility.ts.
5387
5487
  _reconcileReadState(patch) {
5388
5488
  if (patch.dictKeyFields) this.dictKeyFields = { ...patch.dictKeyFields, ...this.dictKeyFields };
5389
5489
  if (patch.i18nFields) this.i18nFields = { ...patch.i18nFields, ...this.i18nFields };
@@ -6733,7 +6833,7 @@ var VaultLinks = class {
6733
6833
  // src/with-shape/links/lazy-handle.ts
6734
6834
  function makeLazyLinkSetHandle(d) {
6735
6835
  let engine = null;
6736
- const load = () => engine ??= import("./link-set-POQB7BU5.js").then(
6836
+ const load = () => engine ??= import("./link-set-CGYC3OH5.js").then(
6737
6837
  ({ LinkSet }) => new LinkSet(d.adapter, d.vault, d.name, d.spec, d.encrypted, d.getDEK, d.actor, d.emitter, d.endpointExists)
6738
6838
  );
6739
6839
  return {
@@ -7271,7 +7371,7 @@ function declareSatellite(ctx, collectionName, options, existingRegistry) {
7271
7371
  ctx.forEachSyncEngine((e) => e.remirrorPairResolvers([spec.base, spec.satellite]));
7272
7372
  const registry = reg;
7273
7373
  const baseSchema = ctx.getBaseSchema(spec.base);
7274
- void import("./post-register-URQANI3B.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
7374
+ void import("./post-register-LY35EDTJ.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
7275
7375
  });
7276
7376
  return reg;
7277
7377
  }
@@ -8227,7 +8327,7 @@ var Vault = class {
8227
8327
  const strategies = options.schemaUpdate ?? [];
8228
8328
  const work = (async () => {
8229
8329
  const dek = await this.getDEK(collectionName);
8230
- const { persistSchemaIfNeeded } = await import("./register-5W6CG4RM.js");
8330
+ const { persistSchemaIfNeeded } = await import("./register-6RIBIT3I.js");
8231
8331
  const result = await persistSchemaIfNeeded({
8232
8332
  store: this.adapter,
8233
8333
  vault: this.name,
@@ -8376,7 +8476,7 @@ var Vault = class {
8376
8476
  const work = (async () => {
8377
8477
  try {
8378
8478
  const dek = await this.getDEK(collectionName);
8379
- await (await import("./register-5W6CG4RM.js")).persistSchemaIfNeeded({
8479
+ await (await import("./register-6RIBIT3I.js")).persistSchemaIfNeeded({
8380
8480
  store: this.adapter,
8381
8481
  vault: this.name,
8382
8482
  collectionName,
@@ -9563,7 +9663,7 @@ var Vault = class {
9563
9663
  async _initDerivations(handles) {
9564
9664
  if (handles.length === 0) return;
9565
9665
  const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
9566
- import("./registry-MCSGBZXI.js"),
9666
+ import("./registry-RON4WHAP.js"),
9567
9667
  import("./read-only-facade-CHCKSEPD.js")
9568
9668
  ]);
9569
9669
  const registry = new DerivationRegistry();
@@ -9595,7 +9695,7 @@ var Vault = class {
9595
9695
  */
9596
9696
  async _initMaterializedViews(handles) {
9597
9697
  if (handles.length === 0) return;
9598
- const { MaterializedViewRegistry } = await import("./registry-UJFP3NWF.js");
9698
+ const { MaterializedViewRegistry } = await import("./registry-MUSL4AW6.js");
9599
9699
  const registry = new MaterializedViewRegistry();
9600
9700
  this.materializedViewRegistry = registry;
9601
9701
  const db = this;
@@ -9667,14 +9767,14 @@ var Vault = class {
9667
9767
  if (!reg) {
9668
9768
  throw new Error(`refreshView: no MV registered with name "${name}"`);
9669
9769
  }
9670
- const { MaterializedViewExecutor } = await import("./executor-XZYM4KHT.js");
9770
+ const { MaterializedViewExecutor } = await import("./executor-FPHKWDWT.js");
9671
9771
  const result = await MaterializedViewExecutor.refresh(reg, {
9672
9772
  getCollection: (n) => this.collection(n),
9673
9773
  getActiveTxContext: () => this.noydb._activeTxContextOrNull,
9674
9774
  getQueryContext: () => this,
9675
9775
  dispatchCtx: this._dispatchCtx({ collection: name, id: "refreshView" })
9676
9776
  });
9677
- const { clearMVStaleFully } = await import("./stale-JOE7GBAE.js");
9777
+ const { clearMVStaleFully } = await import("./stale-T3V7XEOB.js");
9678
9778
  await clearMVStaleFully(this.adapter, this.name, registry, name);
9679
9779
  return result;
9680
9780
  }
@@ -9714,7 +9814,7 @@ var Vault = class {
9714
9814
  if (!outSpec) continue;
9715
9815
  const outputColl = this.collection(outSpec.collection);
9716
9816
  if (out.kind === "array") {
9717
- const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-TV7CXAJ6.js");
9817
+ const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-273RDMYS.js");
9718
9818
  const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key, this.getDEK, this.encrypted);
9719
9819
  const prevKeys = new Set(prior?.keys ?? []);
9720
9820
  const newKeysList = out.entries.map((e) => e.key);
@@ -9941,7 +10041,7 @@ var Vault = class {
9941
10041
  * collection.
9942
10042
  */
9943
10043
  async delegate(opts) {
9944
- const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-ONOZVPIP.js");
10044
+ const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-JDUMAF6L.js");
9945
10045
  if (!this.keyring.kek) {
9946
10046
  throw new ValidationError(
9947
10047
  "issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (secret) first."
@@ -9963,7 +10063,7 @@ var Vault = class {
9963
10063
  * if the id does not exist.
9964
10064
  */
9965
10065
  async revokeDelegation(id) {
9966
- const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-ONOZVPIP.js");
10066
+ const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-JDUMAF6L.js");
9967
10067
  await revokeDelegation(this.adapter, this.name, id);
9968
10068
  void DELEGATIONS_COLLECTION;
9969
10069
  }
@@ -10211,7 +10311,7 @@ var Vault = class {
10211
10311
  * @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
10212
10312
  */
10213
10313
  async dumpSchema(opts = {}) {
10214
- const { dumpVaultSchema } = await import("./walk-6OHAWGBS.js");
10314
+ const { dumpVaultSchema } = await import("./walk-G3NFEP5L.js");
10215
10315
  return dumpVaultSchema(this, opts);
10216
10316
  }
10217
10317
  /**
@@ -10361,7 +10461,7 @@ var Vault = class {
10361
10461
  * both modes round-trip cleanly.
10362
10462
  */
10363
10463
  async dump() {
10364
- const { dumpVault } = await import("./backup-PTSVXDDW.js");
10464
+ const { dumpVault } = await import("./backup-X7F3TCFV.js");
10365
10465
  return dumpVault(this.backupContext());
10366
10466
  }
10367
10467
  /**
@@ -10413,7 +10513,7 @@ var Vault = class {
10413
10513
  * — there's no chain to verify against.
10414
10514
  */
10415
10515
  async load(backupJson) {
10416
- const { loadVault } = await import("./backup-PTSVXDDW.js");
10516
+ const { loadVault } = await import("./backup-X7F3TCFV.js");
10417
10517
  return loadVault(this.backupContext(), backupJson);
10418
10518
  }
10419
10519
  /**
@@ -10445,7 +10545,7 @@ var Vault = class {
10445
10545
  * way to detect tampering of an in-place vault.
10446
10546
  */
10447
10547
  async verifyBackupIntegrity() {
10448
- const { verifyBackupIntegrity } = await import("./backup-PTSVXDDW.js");
10548
+ const { verifyBackupIntegrity } = await import("./backup-X7F3TCFV.js");
10449
10549
  return verifyBackupIntegrity(this.backupContext());
10450
10550
  }
10451
10551
  /**
@@ -10663,7 +10763,7 @@ var Vault = class {
10663
10763
  * is the live validator object, not a serialization of it).
10664
10764
  */
10665
10765
  async exportJSON(opts = {}) {
10666
- const { exportVaultJSON } = await import("./backup-PTSVXDDW.js");
10766
+ const { exportVaultJSON } = await import("./backup-X7F3TCFV.js");
10667
10767
  return exportVaultJSON(this.backupContext(), opts);
10668
10768
  }
10669
10769
  };
@@ -10943,7 +11043,7 @@ var ServiceBus = class {
10943
11043
  }
10944
11044
  };
10945
11045
 
10946
- // src/with-party/tab-coordination.ts
11046
+ // src/with-sync/tab-coordination.ts
10947
11047
  var TabCoordinator = class {
10948
11048
  tabId;
10949
11049
  role = "unknown";
@@ -11124,7 +11224,7 @@ function defaultChannel(name = "noydb:tabs") {
11124
11224
  };
11125
11225
  }
11126
11226
 
11127
- // src/with-party/tab-write-relay.ts
11227
+ // src/with-sync/tab-write-relay.ts
11128
11228
  var CrossTabWriteRelay = class {
11129
11229
  #channel;
11130
11230
  #writerId;
@@ -12676,7 +12776,8 @@ var Noydb = class {
12676
12776
  const targets = normalizeSyncTargets(this.options.sync);
12677
12777
  if (targets.length > 0) {
12678
12778
  const primary = targets.find((t) => t.role === "sync-peer") ?? targets[0];
12679
- const effectivePolicy = this.options.syncPolicy ?? primary.policy ?? INDEXED_STORE_POLICY;
12779
+ const declaredPolicy = this.options.syncPolicy ?? primary.policy;
12780
+ const effectivePolicy = declaredPolicy ?? INDEXED_STORE_POLICY;
12680
12781
  syncEngine = this.strategies.sync.buildSyncEngine({
12681
12782
  local: this.options.store,
12682
12783
  remote: primary.store,
@@ -12688,6 +12789,7 @@ var Noydb = class {
12688
12789
  ...primary.label !== void 0 ? { label: primary.label } : {}
12689
12790
  });
12690
12791
  this.syncEngines.set(name, syncEngine);
12792
+ if (declaredPolicy) syncEngine.startScheduler();
12691
12793
  for (const target of targets) {
12692
12794
  if (target === primary) continue;
12693
12795
  const targetPolicy = target.policy ?? this.options.syncPolicy ?? INDEXED_STORE_POLICY;
@@ -12703,6 +12805,7 @@ var Noydb = class {
12703
12805
  });
12704
12806
  const key = `${name}::${target.label ?? target.role}`;
12705
12807
  this.syncEngines.set(key, engine);
12808
+ if (target.policy ?? this.options.syncPolicy) engine.startScheduler();
12706
12809
  }
12707
12810
  }
12708
12811
  const comp = new Vault({
@@ -13516,6 +13619,7 @@ var Noydb = class {
13516
13619
  close() {
13517
13620
  this.closed = true;
13518
13621
  this.snapshots.stop();
13622
+ for (const engine of this.syncEngines.values()) engine.stopScheduler();
13519
13623
  if (this.sessionTimer) {
13520
13624
  clearTimeout(this.sessionTimer);
13521
13625
  this.sessionTimer = null;
@@ -13886,7 +13990,7 @@ async function createNoydb(options) {
13886
13990
  throw new ValidationError("A secret (secret) or getKeyring callback is required when encryption is enabled");
13887
13991
  }
13888
13992
  if (!options.coordinationStrategy) options = { ...options, coordinationStrategy: await createDefaultCoordinationProvider(options.store) };
13889
- if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-3NKVNZPM.js")).createUserApi };
13993
+ if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-SI2IVBQO.js")).createUserApi };
13890
13994
  if (!options.policyFactory) {
13891
13995
  const policyModule = await import("./policy/index.js");
13892
13996
  options = { ...options, policyFactory: policyModule.createNoydbPolicy, policyCheckGateFn: policyModule.checkGate };
@@ -13921,4 +14025,4 @@ export {
13921
14025
  Noydb,
13922
14026
  createNoydb
13923
14027
  };
13924
- //# sourceMappingURL=chunk-OW5Y6HA6.js.map
14028
+ //# sourceMappingURL=chunk-ZBYFMI6D.js.map