@noy-db/hub 0.7.1-pre.0 → 0.8.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 (812) hide show
  1. package/CHANGELOG.md +147 -14
  2. package/LICENSE +202 -21
  3. package/NOTICE +1 -0
  4. package/README.md +5 -5
  5. package/codemods/0.8.0-pre.json +61 -0
  6. package/dist/api-OS747DS4.js +18 -0
  7. package/dist/as/index.js +11 -12
  8. package/dist/as/index.js.map +1 -1
  9. package/dist/at/index.js +9 -10
  10. package/dist/attestation/index.js +37 -26
  11. package/dist/attestation/index.js.map +1 -1
  12. package/dist/{backup-XKCXVKV3.js → backup-YE2VQ26S.js} +15 -16
  13. package/dist/backup-YE2VQ26S.js.map +1 -0
  14. package/dist/blobs/index.js +13 -14
  15. package/dist/blobs/index.js.map +1 -1
  16. package/dist/broker/index.js +12 -13
  17. package/dist/broker/index.js.map +1 -1
  18. package/dist/by/index.js +2 -2
  19. package/dist/capsule/contract.d.ts +159 -0
  20. package/dist/capsule/contract.js +95 -0
  21. package/dist/capsule/enclave-aes/bound.d.ts +52 -0
  22. package/dist/capsule/enclave-aes/capabilities.d.ts +2 -0
  23. package/dist/capsule/enclave-aes/classify/compare.d.ts +20 -0
  24. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/find.d.ts +1 -1
  25. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/reveal.d.ts +1 -1
  26. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/verify.d.ts +2 -2
  27. package/dist/{kernel/enclave → capsule/enclave-aes}/classify/write.d.ts +1 -1
  28. package/dist/{kernel/enclave → capsule/enclave-aes}/crypto.d.ts +33 -129
  29. package/dist/capsule/enclave-aes/index.d.ts +113 -0
  30. package/dist/capsule/enclave-aes/index.js +335 -0
  31. package/dist/capsule/enclave-aes/index.js.map +1 -0
  32. package/dist/capsule/enclave-aes/primitives.d.ts +29 -0
  33. package/dist/capsule/index.d.ts +27 -0
  34. package/dist/capsule/plumbing/ct-equal.d.ts +11 -0
  35. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/deterministic.d.ts +8 -21
  36. package/dist/capsule/plumbing/digest.d.ts +122 -0
  37. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/envelope-body.d.ts +44 -48
  38. package/dist/capsule/plumbing/index.d.ts +100 -0
  39. package/dist/capsule/plumbing/lifecycle.d.ts +50 -0
  40. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/record-codec.d.ts +80 -20
  41. package/dist/{kernel/enclave → capsule/plumbing}/record-envelope.d.ts +1 -1
  42. package/dist/capsule/plumbing/rekey-blob.d.ts +33 -0
  43. package/dist/capsule/plumbing/rekey.d.ts +44 -0
  44. package/dist/capsule/plumbing/sealed-slot.d.ts +22 -0
  45. package/dist/capsule/plumbing/sealed-slots.d.ts +37 -0
  46. package/dist/capsule/plumbing/sealing.d.ts +29 -0
  47. package/dist/capsule/plumbing/sign.d.ts +9 -0
  48. package/dist/{kernel/enclave/record-keys → capsule/plumbing}/tombstone.d.ts +2 -2
  49. package/dist/capsule-VOLX3QRQ.js +209 -0
  50. package/dist/cargo/index.js +39 -36
  51. package/dist/{chunk-Q2MPFCQ7.js → chunk-23D6M6VM.js} +5 -5
  52. package/dist/chunk-23D6M6VM.js.map +1 -0
  53. package/dist/{chunk-R7BX2NB3.js → chunk-244QBK7Z.js} +4 -4
  54. package/dist/chunk-244QBK7Z.js.map +1 -0
  55. package/dist/chunk-2AFX33YA.js +936 -0
  56. package/dist/chunk-2AFX33YA.js.map +1 -0
  57. package/dist/{chunk-MVMXZYXT.js → chunk-2GHDLTPE.js} +2 -2
  58. package/dist/{chunk-GYGLAVCX.js → chunk-2MG3SW7Q.js} +6 -2
  59. package/dist/chunk-2MG3SW7Q.js.map +1 -0
  60. package/dist/{chunk-XLMEZIAJ.js → chunk-2ODVB6LZ.js} +2 -2
  61. package/dist/{chunk-HJUWN7JN.js → chunk-2PVXF5CS.js} +33 -8
  62. package/dist/chunk-2PVXF5CS.js.map +1 -0
  63. package/dist/{chunk-YJRT5UQM.js → chunk-2RH777HH.js} +21 -20
  64. package/dist/{chunk-YJRT5UQM.js.map → chunk-2RH777HH.js.map} +1 -1
  65. package/dist/{chunk-7O3Y4PPD.js → chunk-37EPTBBR.js} +153 -16
  66. package/dist/chunk-37EPTBBR.js.map +1 -0
  67. package/dist/{chunk-2ENE6445.js → chunk-3A5DUZ56.js} +102 -16
  68. package/dist/chunk-3A5DUZ56.js.map +1 -0
  69. package/dist/chunk-3EWS67C7.js +461 -0
  70. package/dist/chunk-3EWS67C7.js.map +1 -0
  71. package/dist/{chunk-SGZAIJCV.js → chunk-3L2NBKDR.js} +4 -8
  72. package/dist/chunk-3L2NBKDR.js.map +1 -0
  73. package/dist/{chunk-YMUFFJCO.js → chunk-3TDUWVWB.js} +5 -2
  74. package/dist/chunk-3TDUWVWB.js.map +1 -0
  75. package/dist/{chunk-4GVM6QZA.js → chunk-3XJQBBZD.js} +26 -28
  76. package/dist/chunk-3XJQBBZD.js.map +1 -0
  77. package/dist/{chunk-4ZS56W5S.js → chunk-42ALPZ2B.js} +672 -664
  78. package/dist/chunk-42ALPZ2B.js.map +1 -0
  79. package/dist/chunk-4CIQDWRB.js +524 -0
  80. package/dist/chunk-4CIQDWRB.js.map +1 -0
  81. package/dist/{chunk-RMS3NEA3.js → chunk-4JPMZTJY.js} +2 -2
  82. package/dist/{chunk-P3MG6QCN.js → chunk-4T3SE27M.js} +5 -9
  83. package/dist/chunk-4T3SE27M.js.map +1 -0
  84. package/dist/chunk-4V3Q35WG.js +204 -0
  85. package/dist/chunk-4V3Q35WG.js.map +1 -0
  86. package/dist/{chunk-NQKIUNW5.js → chunk-52MGURXO.js} +2 -2
  87. package/dist/{chunk-EQEYOJBM.js → chunk-5A4345TG.js} +4 -4
  88. package/dist/chunk-5A4345TG.js.map +1 -0
  89. package/dist/{chunk-334WSVOW.js → chunk-5FE75J4S.js} +6 -6
  90. package/dist/chunk-5FE75J4S.js.map +1 -0
  91. package/dist/chunk-5KC7QYEC.js +565 -0
  92. package/dist/chunk-5KC7QYEC.js.map +1 -0
  93. package/dist/{chunk-RSGLUIO6.js → chunk-5UMK7GRI.js} +13 -12
  94. package/dist/chunk-5UMK7GRI.js.map +1 -0
  95. package/dist/chunk-5WWDGFOS.js +275 -0
  96. package/dist/chunk-5WWDGFOS.js.map +1 -0
  97. package/dist/{chunk-QPQUVOZ2.js → chunk-6QVKPHBF.js} +3 -5
  98. package/dist/chunk-6QVKPHBF.js.map +1 -0
  99. package/dist/{chunk-ACAQ2DSG.js → chunk-747G6CT3.js} +2 -2
  100. package/dist/chunk-747G6CT3.js.map +1 -0
  101. package/dist/{chunk-QTQUH4DS.js → chunk-7R2Q7CPL.js} +16 -16
  102. package/dist/chunk-7R2Q7CPL.js.map +1 -0
  103. package/dist/{chunk-UGTBXF5U.js → chunk-7XMHMVTS.js} +3 -3
  104. package/dist/{chunk-YJX7EOJD.js → chunk-A4XMIZT3.js} +6 -6
  105. package/dist/{chunk-YJX7EOJD.js.map → chunk-A4XMIZT3.js.map} +1 -1
  106. package/dist/{chunk-A66I4JOA.js → chunk-AEQGFRU4.js} +4 -4
  107. package/dist/chunk-AEQGFRU4.js.map +1 -0
  108. package/dist/chunk-AL6ML4LA.js +1558 -0
  109. package/dist/chunk-AL6ML4LA.js.map +1 -0
  110. package/dist/{chunk-BZ3534YM.js → chunk-AUKKUPVB.js} +2 -2
  111. package/dist/{chunk-CUZLNGD5.js → chunk-B2YY6WDD.js} +1 -1
  112. package/dist/chunk-B2YY6WDD.js.map +1 -0
  113. package/dist/chunk-BKT776R5.js +1 -0
  114. package/dist/chunk-BNWA3WG5.js +22 -0
  115. package/dist/chunk-BNWA3WG5.js.map +1 -0
  116. package/dist/{chunk-VXANTWBJ.js → chunk-BPWYQ25R.js} +92 -6
  117. package/dist/{chunk-VXANTWBJ.js.map → chunk-BPWYQ25R.js.map} +1 -1
  118. package/dist/{chunk-6LKOJBV6.js → chunk-BVCUTXE3.js} +2 -2
  119. package/dist/chunk-CY2CYVWZ.js +41 -0
  120. package/dist/chunk-CY2CYVWZ.js.map +1 -0
  121. package/dist/{chunk-M4YPHYEH.js → chunk-DHHGL42E.js} +70 -25
  122. package/dist/chunk-DHHGL42E.js.map +1 -0
  123. package/dist/{chunk-VTFVLCUH.js → chunk-DIZLQVAA.js} +2 -2
  124. package/dist/{chunk-G73UVHCA.js → chunk-DLD5LGDS.js} +11 -12
  125. package/dist/chunk-DLD5LGDS.js.map +1 -0
  126. package/dist/{chunk-WQBG4SZS.js → chunk-DQESF6RP.js} +60 -49
  127. package/dist/chunk-DQESF6RP.js.map +1 -0
  128. package/dist/{chunk-LWBCUYZW.js → chunk-E2N2T5ZO.js} +2 -2
  129. package/dist/{chunk-3PGS7TYR.js → chunk-EGVJ7TM4.js} +29 -32
  130. package/dist/chunk-EGVJ7TM4.js.map +1 -0
  131. package/dist/{chunk-JVIBCBC7.js → chunk-EJLV62NI.js} +2 -2
  132. package/dist/{chunk-KKEESNPE.js → chunk-EYG2CY2X.js} +126 -19
  133. package/dist/chunk-EYG2CY2X.js.map +1 -0
  134. package/dist/{enclave-55PAM4YO.js → chunk-EZGV6F47.js} +83 -56
  135. package/dist/chunk-EZGV6F47.js.map +1 -0
  136. package/dist/{chunk-CHQCZZWC.js → chunk-EZOAKKTB.js} +36 -27
  137. package/dist/chunk-EZOAKKTB.js.map +1 -0
  138. package/dist/chunk-F6NCB7KT.js +13 -0
  139. package/dist/chunk-F6NCB7KT.js.map +1 -0
  140. package/dist/chunk-FFJFE4T7.js +100 -0
  141. package/dist/chunk-FFJFE4T7.js.map +1 -0
  142. package/dist/{chunk-JMGDHKQF.js → chunk-FLPCETP6.js} +2 -2
  143. package/dist/chunk-FOEDQATO.js +53 -0
  144. package/dist/chunk-FOEDQATO.js.map +1 -0
  145. package/dist/{chunk-DGOZ4UZD.js → chunk-FVH5QYY2.js} +2 -2
  146. package/dist/{chunk-HIWCKBEY.js → chunk-G2MVBDFP.js} +54 -28
  147. package/dist/chunk-G2MVBDFP.js.map +1 -0
  148. package/dist/chunk-GMKGGY7V.js +234 -0
  149. package/dist/chunk-GMKGGY7V.js.map +1 -0
  150. package/dist/{chunk-EIPVYUEP.js → chunk-GQ4MF3CM.js} +3 -3
  151. package/dist/chunk-GQ4MF3CM.js.map +1 -0
  152. package/dist/{chunk-PEOZ34EM.js → chunk-GSAK56VF.js} +1 -1
  153. package/dist/chunk-GSAK56VF.js.map +1 -0
  154. package/dist/{chunk-5VCRVKOZ.js → chunk-GUZET4SG.js} +12 -4
  155. package/dist/chunk-GUZET4SG.js.map +1 -0
  156. package/dist/{chunk-JBDFMYKQ.js → chunk-GZT3NQRA.js} +2 -2
  157. package/dist/{chunk-K23VKTN4.js → chunk-H23XHRTT.js} +19 -34
  158. package/dist/chunk-H23XHRTT.js.map +1 -0
  159. package/dist/{chunk-TFR7DSOV.js → chunk-H427H63K.js} +2 -2
  160. package/dist/{chunk-DFMWUOU5.js → chunk-H7JBY4P7.js} +23 -32
  161. package/dist/chunk-H7JBY4P7.js.map +1 -0
  162. package/dist/{chunk-SKGMN35F.js → chunk-HS554XAF.js} +3 -3
  163. package/dist/chunk-HS554XAF.js.map +1 -0
  164. package/dist/{chunk-HK67PX4J.js → chunk-HW7CMKUG.js} +1 -1
  165. package/dist/chunk-HW7CMKUG.js.map +1 -0
  166. package/dist/{chunk-3BVH633C.js → chunk-IMQKWR46.js} +5 -7
  167. package/dist/chunk-IMQKWR46.js.map +1 -0
  168. package/dist/{chunk-R42NSZI6.js → chunk-IUBMZPHM.js} +7 -7
  169. package/dist/chunk-IUBMZPHM.js.map +1 -0
  170. package/dist/{chunk-CUQPWYRX.js → chunk-IUT3GWP3.js} +75 -386
  171. package/dist/chunk-IUT3GWP3.js.map +1 -0
  172. package/dist/{chunk-RF6D3Y5E.js → chunk-JDEYF3PJ.js} +4 -8
  173. package/dist/{chunk-RF6D3Y5E.js.map → chunk-JDEYF3PJ.js.map} +1 -1
  174. package/dist/{chunk-PPTHY5QO.js → chunk-JIBUPZHA.js} +99 -8
  175. package/dist/chunk-JIBUPZHA.js.map +1 -0
  176. package/dist/{chunk-SMH6SRX7.js → chunk-JOSPH3E5.js} +2 -2
  177. package/dist/chunk-JQYKPKG6.js +193 -0
  178. package/dist/chunk-JQYKPKG6.js.map +1 -0
  179. package/dist/{chunk-7APJ6CO6.js → chunk-JSMTXZR3.js} +45 -13
  180. package/dist/chunk-JSMTXZR3.js.map +1 -0
  181. package/dist/chunk-JWWYRR4Q.js +12 -0
  182. package/dist/chunk-JWWYRR4Q.js.map +1 -0
  183. package/dist/{chunk-BVN6KXL2.js → chunk-KZXDLBY6.js} +14 -9
  184. package/dist/chunk-KZXDLBY6.js.map +1 -0
  185. package/dist/chunk-LGNDFRYC.js +23 -0
  186. package/dist/chunk-LGNDFRYC.js.map +1 -0
  187. package/dist/{chunk-XKWGNJ26.js → chunk-LIOVX5TJ.js} +7 -11
  188. package/dist/chunk-LIOVX5TJ.js.map +1 -0
  189. package/dist/{chunk-AYX7AINO.js → chunk-LNSVGRHO.js} +5 -7
  190. package/dist/chunk-LNSVGRHO.js.map +1 -0
  191. package/dist/chunk-M5B2W6YY.js +293 -0
  192. package/dist/chunk-M5B2W6YY.js.map +1 -0
  193. package/dist/chunk-MBMTND6D.js +456 -0
  194. package/dist/chunk-MBMTND6D.js.map +1 -0
  195. package/dist/{chunk-3BZZJJMQ.js → chunk-MILI22XQ.js} +3 -3
  196. package/dist/{chunk-A2HKRLPV.js → chunk-MXKI4ABF.js} +18 -59
  197. package/dist/chunk-MXKI4ABF.js.map +1 -0
  198. package/dist/{chunk-ZYIYHJ5R.js → chunk-MXOQ5JCG.js} +869 -238
  199. package/dist/chunk-MXOQ5JCG.js.map +1 -0
  200. package/dist/{chunk-V7ZRRCRJ.js → chunk-N7EVQD5S.js} +9 -13
  201. package/dist/chunk-N7EVQD5S.js.map +1 -0
  202. package/dist/chunk-N7UDP5VU.js +757 -0
  203. package/dist/chunk-N7UDP5VU.js.map +1 -0
  204. package/dist/chunk-NBQ3KK6X.js +270 -0
  205. package/dist/chunk-NBQ3KK6X.js.map +1 -0
  206. package/dist/{chunk-ZORTV6NH.js → chunk-NCO25JZO.js} +88 -4
  207. package/dist/chunk-NCO25JZO.js.map +1 -0
  208. package/dist/chunk-NH2UOV3B.js +18 -0
  209. package/dist/chunk-NH2UOV3B.js.map +1 -0
  210. package/dist/chunk-NYMLINRP.js +28 -0
  211. package/dist/chunk-NYMLINRP.js.map +1 -0
  212. package/dist/{chunk-YYP7WSEB.js → chunk-O2IMQSNA.js} +2 -2
  213. package/dist/chunk-O46CHQT7.js +215 -0
  214. package/dist/chunk-O46CHQT7.js.map +1 -0
  215. package/dist/chunk-OIEO4WDL.js +27 -0
  216. package/dist/chunk-OIEO4WDL.js.map +1 -0
  217. package/dist/{chunk-TRGTKX5E.js → chunk-OKSTSITU.js} +27 -4
  218. package/dist/chunk-OKSTSITU.js.map +1 -0
  219. package/dist/chunk-OYW3I5M4.js +31 -0
  220. package/dist/chunk-OYW3I5M4.js.map +1 -0
  221. package/dist/{chunk-Q7HZX3IF.js → chunk-PD64727P.js} +2 -2
  222. package/dist/chunk-PD64727P.js.map +1 -0
  223. package/dist/{chunk-FET5XCAT.js → chunk-PP3K67AJ.js} +34 -6
  224. package/dist/chunk-PP3K67AJ.js.map +1 -0
  225. package/dist/chunk-Q2XRFWOI.js +40 -0
  226. package/dist/chunk-Q2XRFWOI.js.map +1 -0
  227. package/dist/{chunk-QIZPZMUI.js → chunk-Q4UHJ5SN.js} +2 -2
  228. package/dist/{chunk-FAHMLERK.js → chunk-QBLT6POL.js} +2 -2
  229. package/dist/chunk-QMWY2FDS.js +157 -0
  230. package/dist/chunk-QMWY2FDS.js.map +1 -0
  231. package/dist/{chunk-LH5A3ZPG.js → chunk-RB4DOPGZ.js} +150 -22
  232. package/dist/chunk-RB4DOPGZ.js.map +1 -0
  233. package/dist/chunk-RHVMZSUU.js +7 -0
  234. package/dist/chunk-RHVMZSUU.js.map +1 -0
  235. package/dist/{chunk-BUE2D7PX.js → chunk-SMV2HRDU.js} +2 -2
  236. package/dist/chunk-SUZKW6UR.js +25 -0
  237. package/dist/chunk-SUZKW6UR.js.map +1 -0
  238. package/dist/{chunk-7MG7SJT7.js → chunk-SV2PM2OY.js} +1 -1
  239. package/dist/chunk-SV2PM2OY.js.map +1 -0
  240. package/dist/{chunk-UXVWEX5L.js → chunk-SYNY3VB5.js} +6 -2
  241. package/dist/chunk-SYNY3VB5.js.map +1 -0
  242. package/dist/{chunk-4GFX6MPA.js → chunk-TEHHROZL.js} +6 -8
  243. package/dist/chunk-TEHHROZL.js.map +1 -0
  244. package/dist/chunk-TKVUE4JF.js +1289 -0
  245. package/dist/chunk-TKVUE4JF.js.map +1 -0
  246. package/dist/{chunk-SFAWCTEM.js → chunk-TZZBXPZK.js} +2 -2
  247. package/dist/{chunk-F3W6YMDC.js → chunk-U2FZNEWJ.js} +4 -4
  248. package/dist/chunk-U2FZNEWJ.js.map +1 -0
  249. package/dist/{chunk-BLN54W3L.js → chunk-UA372JHH.js} +56 -3
  250. package/dist/chunk-UA372JHH.js.map +1 -0
  251. package/dist/{chunk-6YXCPL4T.js → chunk-UEFOQH74.js} +2 -2
  252. package/dist/chunk-UEFOQH74.js.map +1 -0
  253. package/dist/{chunk-2N5ML6HT.js → chunk-UIYESRD6.js} +9 -11
  254. package/dist/chunk-UIYESRD6.js.map +1 -0
  255. package/dist/{chunk-UHHPLO3I.js → chunk-V3RWOOSO.js} +4 -4
  256. package/dist/{chunk-KTFRCC5C.js → chunk-V7ADQF5O.js} +82 -8
  257. package/dist/chunk-V7ADQF5O.js.map +1 -0
  258. package/dist/{chunk-453F654R.js → chunk-VAORSCSU.js} +3 -3
  259. package/dist/chunk-VAORSCSU.js.map +1 -0
  260. package/dist/{chunk-GPNTB4Y7.js → chunk-VFHCKG5M.js} +6 -10
  261. package/dist/chunk-VFHCKG5M.js.map +1 -0
  262. package/dist/{chunk-2577DKXB.js → chunk-VHBKYN2J.js} +3 -3
  263. package/dist/chunk-VHBKYN2J.js.map +1 -0
  264. package/dist/chunk-VHM7HCKB.js +220 -0
  265. package/dist/chunk-VHM7HCKB.js.map +1 -0
  266. package/dist/{chunk-ZHKOPKE3.js → chunk-VKI2EB3N.js} +3 -3
  267. package/dist/chunk-VKI2EB3N.js.map +1 -0
  268. package/dist/{chunk-UDHWDSRL.js → chunk-VMV5SBE4.js} +16 -17
  269. package/dist/chunk-VMV5SBE4.js.map +1 -0
  270. package/dist/{chunk-SPYWXKJN.js → chunk-VQDZYB2B.js} +3 -3
  271. package/dist/chunk-VQDZYB2B.js.map +1 -0
  272. package/dist/{chunk-Q2PU57HC.js → chunk-VVOLDVIR.js} +2 -2
  273. package/dist/{chunk-3VF3WQ4F.js → chunk-WPOYWFSE.js} +7 -7
  274. package/dist/{chunk-3VF3WQ4F.js.map → chunk-WPOYWFSE.js.map} +1 -1
  275. package/dist/{chunk-OTQZ7ZWU.js → chunk-WXE4W2U6.js} +7 -11
  276. package/dist/chunk-WXE4W2U6.js.map +1 -0
  277. package/dist/chunk-XBKH4FOC.js +195 -0
  278. package/dist/chunk-XBKH4FOC.js.map +1 -0
  279. package/dist/{chunk-TUFM4UZP.js → chunk-XQRFSKYM.js} +2 -2
  280. package/dist/{chunk-3V4KWFX7.js → chunk-XSPFDUDG.js} +58 -53
  281. package/dist/chunk-XSPFDUDG.js.map +1 -0
  282. package/dist/{chunk-GY4WYNNG.js → chunk-Y2RKVFKR.js} +2 -2
  283. package/dist/{chunk-UP4BECPY.js → chunk-Y3LPTBG7.js} +89 -27
  284. package/dist/chunk-Y3LPTBG7.js.map +1 -0
  285. package/dist/{chunk-4OZNXTO4.js → chunk-YRXFFWG4.js} +2 -2
  286. package/dist/classified/index.js +5 -5
  287. package/dist/{classified-marker-BWOFVYAC.js → classified-marker-SIYKUU5L.js} +3 -3
  288. package/dist/classified-marker-SIYKUU5L.js.map +1 -0
  289. package/dist/collection-facade-CS7CA2XO.js +47 -0
  290. package/dist/{computed-VPOKQK4N.js → computed-FAD7SED4.js} +3 -3
  291. package/dist/consent/index.js +10 -11
  292. package/dist/consent/index.js.map +1 -1
  293. package/dist/cover/index.js +10 -11
  294. package/dist/coverage/index.js +306 -0
  295. package/dist/coverage/index.js.map +1 -0
  296. package/dist/custody/index.js +12 -13
  297. package/dist/{dead-filter-PKQDLOT4.js → dead-filter-4F3LWYKH.js} +11 -3
  298. package/dist/dead-filter-4F3LWYKH.js.map +1 -0
  299. package/dist/debug/index.js +11 -2
  300. package/dist/debug/index.js.map +1 -1
  301. package/dist/{delegation-DS5NRILW.js → delegation-NANZDG4N.js} +13 -16
  302. package/dist/delegation-NANZDG4N.js.map +1 -0
  303. package/dist/derivations/index.js +25 -23
  304. package/dist/derive-XLOJVXPU.js +20 -0
  305. package/dist/directory/index.js +10 -11
  306. package/dist/{dispatch-IEPAVQUM.js → dispatch-H4HV32AM.js} +5 -5
  307. package/dist/{dispatch-Q6MWLOJY.js → dispatch-JDZNGEB3.js} +20 -21
  308. package/dist/dispatch-JDZNGEB3.js.map +1 -0
  309. package/dist/executor-FMPVN6DT.js +35 -0
  310. package/dist/executor-LBBBRTN5.js +8 -0
  311. package/dist/executor-OSRZST2U.js +8 -0
  312. package/dist/export-accessible-RAOJAAU5.js +22 -0
  313. package/dist/extract-partition-JD5CUSTG.js +37 -0
  314. package/dist/{fanout-sidecar-S3QL53YX.js → fanout-sidecar-L7NHPIOC.js} +13 -15
  315. package/dist/fanout-sidecar-L7NHPIOC.js.map +1 -0
  316. package/dist/find-JRN4RNQ5.js +10 -0
  317. package/dist/forget/index.js +9 -10
  318. package/dist/forget/index.js.map +1 -1
  319. package/dist/guards/index.js +4 -4
  320. package/dist/history/index.js +13 -14
  321. package/dist/history/index.js.map +1 -1
  322. package/dist/i18n/index.js +14 -15
  323. package/dist/i18n/index.js.map +1 -1
  324. package/dist/index.d.ts +36 -14
  325. package/dist/index.js +970 -163
  326. package/dist/index.js.map +1 -1
  327. package/dist/indexing/index.js +13 -5
  328. package/dist/indexing/index.js.map +1 -1
  329. package/dist/introspection/index.js +11 -12
  330. package/dist/issue-YIVBZUTH.js +19 -0
  331. package/dist/ivf-flat-UZ6DQDLS.js +314 -0
  332. package/dist/ivf-flat-UZ6DQDLS.js.map +1 -0
  333. package/dist/{json-schema-V3M5MUCM.js → json-schema-3SHX72CC.js} +2 -1
  334. package/dist/json-schema-3SHX72CC.js.map +1 -0
  335. package/dist/kernel/attestation-types.d.ts +62 -0
  336. package/dist/kernel/collection-config.d.ts +5 -68
  337. package/dist/kernel/collection.d.ts +30 -9
  338. package/dist/kernel/cutover-transform.d.ts +1 -1
  339. package/dist/kernel/errors.d.ts +257 -38
  340. package/dist/kernel/generation-map.d.ts +48 -0
  341. package/dist/kernel/merge-authority.d.ts +1 -1
  342. package/dist/kernel/noydb.d.ts +6 -1
  343. package/dist/kernel/paths.d.ts +29 -5
  344. package/dist/kernel/prepared-write.d.ts +1 -1
  345. package/dist/kernel/present-cache.d.ts +58 -0
  346. package/dist/kernel/query/all.d.ts +7 -0
  347. package/dist/kernel/query/builder.d.ts +601 -270
  348. package/dist/kernel/query/civil-date.d.ts +64 -0
  349. package/dist/kernel/query/cursor.d.ts +40 -0
  350. package/dist/kernel/query/distinct-key.d.ts +98 -0
  351. package/dist/kernel/query/hydration.d.ts +76 -0
  352. package/dist/kernel/query/index.d.ts +31 -15
  353. package/dist/kernel/query/internal/core.d.ts +30 -0
  354. package/dist/kernel/query/internal/hooks.d.ts +22 -0
  355. package/dist/kernel/query/internal/maintenance.d.ts +43 -0
  356. package/dist/kernel/query/live/incremental.d.ts +314 -0
  357. package/dist/kernel/query/live/index.d.ts +22 -0
  358. package/dist/kernel/query/live/install.d.ts +2 -0
  359. package/dist/kernel/query/{live.d.ts → live/live.d.ts} +39 -9
  360. package/dist/kernel/query/live/methods.d.ts +107 -0
  361. package/dist/kernel/query/predicate.d.ts +119 -1
  362. package/dist/kernel/query/reduce/date-trunc.d.ts +75 -0
  363. package/dist/kernel/query/reduce/index.d.ts +36 -0
  364. package/dist/kernel/query/reduce/install.d.ts +2 -0
  365. package/dist/kernel/query/reduce/methods.d.ts +259 -0
  366. package/dist/kernel/query/reduce/scan-methods.d.ts +121 -0
  367. package/dist/kernel/query/relate/explain.d.ts +199 -0
  368. package/dist/kernel/query/relate/index.d.ts +48 -0
  369. package/dist/kernel/query/relate/install.d.ts +2 -0
  370. package/dist/kernel/query/relate/join-on.d.ts +126 -0
  371. package/dist/kernel/query/relate/join-reduce.d.ts +16 -0
  372. package/dist/kernel/query/relate/join.d.ts +452 -0
  373. package/dist/kernel/query/relate/methods.d.ts +426 -0
  374. package/dist/kernel/query/relate/partition.d.ts +87 -0
  375. package/dist/kernel/query/relate/scan-methods.d.ts +163 -0
  376. package/dist/kernel/query/relate/traverse.d.ts +109 -0
  377. package/dist/kernel/query/scan-builder.d.ts +79 -176
  378. package/dist/kernel/query/sort-key.d.ts +52 -0
  379. package/dist/kernel/secret-mode.d.ts +1 -1
  380. package/dist/kernel/tx-write-gate.d.ts +77 -0
  381. package/dist/kernel/types.d.ts +113 -8
  382. package/dist/kernel/validation.d.ts +27 -10
  383. package/dist/kernel/vault.d.ts +11 -6
  384. package/dist/kernel/via/compose.d.ts +3 -0
  385. package/dist/kernel/via/index.d.ts +56 -0
  386. package/dist/kernel/via/pipeline.d.ts +48 -0
  387. package/dist/kernel/write-queue.d.ts +17 -0
  388. package/dist/{ledger-EDXFFZQL.js → ledger-5ZMGE44K.js} +11 -12
  389. package/dist/liberate-WZSZM2W6.js +24 -0
  390. package/dist/link-set-MFXC24VK.js +29 -0
  391. package/dist/{managed-secret-NCWEMPUQ.js → managed-secret-MFTFT22X.js} +10 -11
  392. package/dist/materialized-views/index.js +30 -24
  393. package/dist/{migrate-cek-5ENH64AA.js → migrate-cek-DZRFFOHW.js} +2 -2
  394. package/dist/money/index.js +5 -5
  395. package/dist/noydb-ITIGNKUF.js +96 -0
  396. package/dist/overlay-views/index.js +4 -4
  397. package/dist/periods/index.js +12 -13
  398. package/dist/pod/index.js +74 -67
  399. package/dist/{pod-handle-ECVCDIXW.js → pod-handle-A3LET7NO.js} +10 -11
  400. package/dist/pod-handle-A3LET7NO.js.map +1 -0
  401. package/dist/policy/index.js +10 -11
  402. package/dist/port/on/index.d.ts +1 -1
  403. package/dist/port/to/index.d.ts +1 -1
  404. package/dist/port/with/blob-strategy.d.ts +10 -1
  405. package/dist/port/with/classified-strategy.d.ts +1 -1
  406. package/dist/port/with/collection-options.d.ts +6 -1
  407. package/dist/port/with/collection-registries.d.ts +1 -1
  408. package/dist/port/with/coverage-strategy.d.ts +83 -0
  409. package/dist/port/with/lookup-strategy.d.ts +2 -2
  410. package/dist/port/with/service-bus.d.ts +46 -0
  411. package/dist/port/with/strategies.d.ts +2 -0
  412. package/dist/portability/index.js +8 -8
  413. package/dist/{post-register-3IPCSG6Q.js → post-register-7ND27CF2.js} +6 -6
  414. package/dist/post-register-7ND27CF2.js.map +1 -0
  415. package/dist/query/all/index.js +31 -0
  416. package/dist/query/index.js +20 -32
  417. package/dist/query/live/index.js +21 -0
  418. package/dist/query/live/index.js.map +1 -0
  419. package/dist/query/reduce/index.js +33 -0
  420. package/dist/query/reduce/index.js.map +1 -0
  421. package/dist/query/relate/index.js +56 -0
  422. package/dist/query/relate/index.js.map +1 -0
  423. package/dist/reduce/index.js +72 -18
  424. package/dist/reduce/index.js.map +1 -1
  425. package/dist/register-DT5HZ2LZ.js +30 -0
  426. package/dist/registry-BHRZGZHF.js +8 -0
  427. package/dist/registry-ET6ZFFWA.js +34 -0
  428. package/dist/registry-HXFGLGTG.js +8 -0
  429. package/dist/registry-THCPDEOD.js +23 -0
  430. package/dist/request-withdrawal-AV2MJJKY.js +30 -0
  431. package/dist/{reveal-QZDHSGD4.js → reveal-B2TLP4JQ.js} +10 -9
  432. package/dist/reveal-B2TLP4JQ.js.map +1 -0
  433. package/dist/revoke-6DWIEOCV.js +24 -0
  434. package/dist/satellites/index.js +1 -1
  435. package/dist/schema-update/index.js +2 -2
  436. package/dist/sealed-record/index.js +16 -18
  437. package/dist/sealed-record/index.js.map +1 -1
  438. package/dist/search/index.js +11 -5
  439. package/dist/{seed-X5CC22CQ.js → seed-XNSE4U3S.js} +15 -18
  440. package/dist/seed-XNSE4U3S.js.map +1 -0
  441. package/dist/sequence/index.js +9 -10
  442. package/dist/session/index.js +9 -10
  443. package/dist/session/index.js.map +1 -1
  444. package/dist/shadow/index.js +2 -2
  445. package/dist/signer-MHGW3OIL.js +23 -0
  446. package/dist/snapshots/index.js +11 -11
  447. package/dist/stale-6GCFMOOR.js +28 -0
  448. package/dist/storage-BYN5LO6Z.js +21 -0
  449. package/dist/storage-BYN5LO6Z.js.map +1 -0
  450. package/dist/store/index.js +1 -1
  451. package/dist/{store-coordination-provider-4WZAIRHC.js → store-coordination-provider-C4BPT5XF.js} +11 -12
  452. package/dist/store-coordination-provider-C4BPT5XF.js.map +1 -0
  453. package/dist/sync/index.js +10 -11
  454. package/dist/sync/index.js.map +1 -1
  455. package/dist/team/index.js +17 -16
  456. package/dist/tiers/index.js +13 -12
  457. package/dist/to/index.js +2 -2
  458. package/dist/transactions/index.js +3 -3
  459. package/dist/util/index.js +1 -1
  460. package/dist/vault-head/index.js +11 -14
  461. package/dist/vault-head/index.js.map +1 -1
  462. package/dist/{verify-6MDTIUEV.js → verify-UKALW7C2.js} +14 -12
  463. package/dist/verify-UKALW7C2.js.map +1 -0
  464. package/dist/via/blob/index.d.ts +1 -0
  465. package/dist/via/classified/binding.d.ts +2 -2
  466. package/dist/via/classified/config-drift.d.ts +2 -2
  467. package/dist/via/classified/errors.d.ts +1 -1
  468. package/dist/via/geo/binding.d.ts +31 -0
  469. package/dist/via/geo/descriptor.d.ts +54 -0
  470. package/dist/via/geo/geohash.d.ts +95 -0
  471. package/dist/via/geo/index.d.ts +13 -0
  472. package/dist/via/geo/where.d.ts +50 -0
  473. package/dist/via/i18n/core.d.ts +1 -1
  474. package/dist/via/lookup/handle.d.ts +4 -4
  475. package/dist/via/lookup/registry.d.ts +1 -1
  476. package/dist/via/lookup/snapshot.d.ts +3 -3
  477. package/dist/walk-4VPK7AS4.js +20 -0
  478. package/dist/walk-4VPK7AS4.js.map +1 -0
  479. package/dist/with-audit/attestation/index.d.ts +2 -1
  480. package/dist/with-audit/attestation/issue.d.ts +2 -2
  481. package/dist/with-audit/attestation/revoke.d.ts +2 -2
  482. package/dist/with-audit/attestation/scheme.d.ts +7 -0
  483. package/dist/with-audit/attestation/signer.d.ts +1 -1
  484. package/dist/with-audit/attestation/strategy.d.ts +2 -2
  485. package/dist/with-audit/attestation/types.d.ts +10 -0
  486. package/dist/with-audit/attestation/vault-facade.d.ts +2 -2
  487. package/dist/with-audit/attestation/verifier.d.ts +6 -0
  488. package/dist/with-audit/consent/consent.d.ts +1 -1
  489. package/dist/with-audit/consent/strategy.d.ts +1 -1
  490. package/dist/with-audit/coverage/accounting.d.ts +112 -0
  491. package/dist/with-audit/coverage/active.d.ts +29 -0
  492. package/dist/with-audit/coverage/index.d.ts +61 -0
  493. package/dist/with-audit/coverage/sketch.d.ts +75 -0
  494. package/dist/with-audit/forget/subject-index.d.ts +1 -1
  495. package/dist/with-audit/periods/periods.d.ts +55 -7
  496. package/dist/with-audit/periods/reserved-collections.d.ts +3 -0
  497. package/dist/with-audit/periods/vault-facade.d.ts +18 -1
  498. package/dist/with-audit/sealed-record/index.d.ts +2 -2
  499. package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
  500. package/dist/with-audit/tiers/index.d.ts +53 -2
  501. package/dist/with-audit/tiers/strategy.d.ts +8 -0
  502. package/dist/with-cargo/adopt-partition.d.ts +1 -1
  503. package/dist/with-cargo/extract-partition.d.ts +1 -1
  504. package/dist/with-cargo/floor.d.ts +3 -3
  505. package/dist/with-commit/history/history.d.ts +2 -2
  506. package/dist/with-commit/history/index.d.ts +1 -1
  507. package/dist/with-commit/history/ledger/store.d.ts +1 -1
  508. package/dist/with-commit/history/strategy.d.ts +1 -1
  509. package/dist/with-commit/history/time-machine.d.ts +1 -1
  510. package/dist/with-commit/numbering/index.d.ts +1 -1
  511. package/dist/with-commit/sequence/index.d.ts +1 -1
  512. package/dist/with-commit/tx/invariants.d.ts +1 -1
  513. package/dist/with-commit/tx/transaction.d.ts +13 -3
  514. package/dist/with-commit/vault-head/head.d.ts +1 -1
  515. package/dist/with-commit/vault-head/index.d.ts +1 -1
  516. package/dist/with-commit/vault-head/strategy.d.ts +1 -1
  517. package/dist/with-commit/vault-head/verify.d.ts +1 -1
  518. package/dist/with-formula/derivations/dispatch.d.ts +1 -1
  519. package/dist/with-formula/derivations/fanout-sidecar.d.ts +1 -1
  520. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +4 -3
  521. package/dist/with-formula/materialized-views/emit-memo.d.ts +40 -0
  522. package/dist/with-formula/materialized-views/executor.d.ts +8 -0
  523. package/dist/with-formula/materialized-views/index.d.ts +1 -1
  524. package/dist/with-formula/materialized-views/registry.d.ts +15 -0
  525. package/dist/with-formula/materialized-views/types.d.ts +106 -14
  526. package/dist/with-formula/materialized-views/window-stage.d.ts +11 -0
  527. package/dist/with-formula/overlay-views/types.d.ts +1 -1
  528. package/dist/with-formula/overlay-views/virtual-collection.d.ts +13 -4
  529. package/dist/with-lookup/embeddings/chunks.d.ts +79 -0
  530. package/dist/with-lookup/embeddings/descriptor.d.ts +21 -0
  531. package/dist/with-lookup/embeddings/index.d.ts +3 -0
  532. package/dist/with-lookup/embeddings/ivf-flat.d.ts +93 -0
  533. package/dist/with-lookup/embeddings/vector-index.d.ts +73 -0
  534. package/dist/with-lookup/embeddings/vector-set.d.ts +94 -1
  535. package/dist/with-lookup/embeddings/with-vector-index.d.ts +67 -0
  536. package/dist/with-lookup/indexing/collection-facade.d.ts +86 -3
  537. package/dist/with-lookup/indexing/compound-indexes.d.ts +129 -0
  538. package/dist/with-lookup/indexing/eager-indexes.d.ts +170 -1
  539. package/dist/with-lookup/indexing/index-snapshot.d.ts +62 -0
  540. package/dist/with-lookup/indexing/lazy-builder.d.ts +33 -0
  541. package/dist/with-lookup/indexing/persisted-field-indexes.d.ts +104 -0
  542. package/dist/with-lookup/indexing/persisted-indexes.d.ts +12 -0
  543. package/dist/with-lookup/indexing/sorted-indexes.d.ts +117 -0
  544. package/dist/with-lookup/indexing/unique-constraints.d.ts +106 -23
  545. package/dist/with-lookup/reduce/active.d.ts +2 -24
  546. package/dist/with-lookup/reduce/group-core.d.ts +43 -0
  547. package/dist/with-lookup/reduce/groupby.d.ts +195 -36
  548. package/dist/with-lookup/reduce/incremental-group.d.ts +153 -0
  549. package/dist/with-lookup/reduce/index.d.ts +26 -5
  550. package/dist/with-lookup/reduce/reducers.d.ts +255 -1
  551. package/dist/with-lookup/reduce/reduction.d.ts +44 -13
  552. package/dist/with-lookup/reduce/strategy.d.ts +43 -3
  553. package/dist/with-lookup/reduce/window.d.ts +262 -0
  554. package/dist/with-lookup/search/collection-facade.d.ts +45 -9
  555. package/dist/with-lookup/search/index-store.d.ts +5 -3
  556. package/dist/with-lookup/search/index.d.ts +4 -2
  557. package/dist/with-lookup/search/inverted-index.d.ts +38 -2
  558. package/dist/with-lookup/search/persisted-index-store.d.ts +5 -2
  559. package/dist/with-lookup/search/phrase.d.ts +28 -0
  560. package/dist/with-lookup/search/retrieve-types.d.ts +57 -1
  561. package/dist/with-lookup/search/serialize.d.ts +29 -3
  562. package/dist/with-lookup/search/strategy.d.ts +2 -6
  563. package/dist/with-party/broker/index.d.ts +3 -3
  564. package/dist/with-party/directory/cover/index.d.ts +1 -1
  565. package/dist/with-party/directory/cover/storage.d.ts +1 -1
  566. package/dist/with-party/directory/cover/types.d.ts +1 -1
  567. package/dist/with-party/directory/index.d.ts +1 -1
  568. package/dist/with-party/directory/types.d.ts +1 -1
  569. package/dist/with-party/directory/user-envelope/api.d.ts +1 -1
  570. package/dist/with-party/directory/user-envelope/storage.d.ts +1 -1
  571. package/dist/with-party/policy/engine.d.ts +1 -1
  572. package/dist/with-party/policy/index.d.ts +1 -1
  573. package/dist/with-party/policy/presets.d.ts +1 -1
  574. package/dist/with-party/team/authenticators.d.ts +91 -1
  575. package/dist/with-party/team/delegation.d.ts +1 -1
  576. package/dist/with-party/team/echo-secret.d.ts +2 -2
  577. package/dist/with-party/team/index.d.ts +4 -3
  578. package/dist/with-party/team/keyring.d.ts +2 -2
  579. package/dist/with-party/team/magic-link-grant.d.ts +1 -1
  580. package/dist/with-party/team/managed-secret.d.ts +1 -1
  581. package/dist/with-party/team/noydb-facade.d.ts +12 -3
  582. package/dist/with-party/team/recovery.d.ts +1 -1
  583. package/dist/with-party/team/roster-tag.d.ts +1 -1
  584. package/dist/with-party/team/rotate-recover.d.ts +1 -1
  585. package/dist/with-party/team/wrapped-deks.d.ts +1 -1
  586. package/dist/with-pod/format.d.ts +1 -1
  587. package/dist/with-pod/index.d.ts +1 -1
  588. package/dist/with-pod/pod.d.ts +1 -1
  589. package/dist/with-shape/blobs/blob-compaction.d.ts +17 -1
  590. package/dist/with-shape/blobs/blob-intent.d.ts +1 -1
  591. package/dist/with-shape/blobs/blob-set.d.ts +23 -4
  592. package/dist/with-shape/blobs/legacy-sweep.d.ts +35 -0
  593. package/dist/with-shape/introspection/describe.d.ts +7 -1
  594. package/dist/with-shape/introspection/field-meta.d.ts +18 -0
  595. package/dist/with-shape/introspection/types.d.ts +57 -1
  596. package/dist/with-shape/introspection/walk.d.ts +1 -1
  597. package/dist/with-shape/links/lazy-handle.d.ts +1 -1
  598. package/dist/with-shape/links/link-set.d.ts +1 -1
  599. package/dist/with-shape/links/vault-facade.d.ts +1 -1
  600. package/dist/with-shape/manifest/derive.d.ts +1 -1
  601. package/dist/with-shape/manifest/storage.d.ts +1 -1
  602. package/dist/with-shape/persisted-schemas/register.d.ts +1 -1
  603. package/dist/with-shape/persisted-schemas/storage.d.ts +1 -1
  604. package/dist/with-shape/satellites/dead-filter.d.ts +1 -1
  605. package/dist/with-shape/satellites/declare.d.ts +1 -1
  606. package/dist/with-shape/satellites/marker.d.ts +1 -1
  607. package/dist/with-shape/satellites/post-register.d.ts +1 -1
  608. package/dist/with-store/partitioned/index.d.ts +337 -0
  609. package/dist/with-sync/change-broadcast.d.ts +153 -0
  610. package/dist/with-sync/presence.d.ts +5 -10
  611. package/dist/withdraw-accessible-HL7GACUE.js +27 -0
  612. package/dist/withdraw-accessible-HL7GACUE.js.map +1 -0
  613. package/package.json +48 -12
  614. package/dist/api-WYW4YEQG.js +0 -19
  615. package/dist/backup-XKCXVKV3.js.map +0 -1
  616. package/dist/chunk-2577DKXB.js.map +0 -1
  617. package/dist/chunk-2ENE6445.js.map +0 -1
  618. package/dist/chunk-2N5ML6HT.js.map +0 -1
  619. package/dist/chunk-334WSVOW.js.map +0 -1
  620. package/dist/chunk-3BVH633C.js.map +0 -1
  621. package/dist/chunk-3PGS7TYR.js.map +0 -1
  622. package/dist/chunk-3V4KWFX7.js.map +0 -1
  623. package/dist/chunk-453F654R.js.map +0 -1
  624. package/dist/chunk-4GFX6MPA.js.map +0 -1
  625. package/dist/chunk-4GVM6QZA.js.map +0 -1
  626. package/dist/chunk-4ZS56W5S.js.map +0 -1
  627. package/dist/chunk-5VCRVKOZ.js.map +0 -1
  628. package/dist/chunk-6YXCPL4T.js.map +0 -1
  629. package/dist/chunk-7APJ6CO6.js.map +0 -1
  630. package/dist/chunk-7MG2LHO5.js +0 -1616
  631. package/dist/chunk-7MG2LHO5.js.map +0 -1
  632. package/dist/chunk-7MG7SJT7.js.map +0 -1
  633. package/dist/chunk-7O3Y4PPD.js.map +0 -1
  634. package/dist/chunk-A2HKRLPV.js.map +0 -1
  635. package/dist/chunk-A66I4JOA.js.map +0 -1
  636. package/dist/chunk-ACAQ2DSG.js.map +0 -1
  637. package/dist/chunk-ATL3ZVXT.js +0 -151
  638. package/dist/chunk-ATL3ZVXT.js.map +0 -1
  639. package/dist/chunk-AYX7AINO.js.map +0 -1
  640. package/dist/chunk-BLN54W3L.js.map +0 -1
  641. package/dist/chunk-BRLKZUBT.js +0 -95
  642. package/dist/chunk-BRLKZUBT.js.map +0 -1
  643. package/dist/chunk-BTDR2PXY.js +0 -29
  644. package/dist/chunk-BTDR2PXY.js.map +0 -1
  645. package/dist/chunk-BVN6KXL2.js.map +0 -1
  646. package/dist/chunk-CHQCZZWC.js.map +0 -1
  647. package/dist/chunk-CUQPWYRX.js.map +0 -1
  648. package/dist/chunk-CUZLNGD5.js.map +0 -1
  649. package/dist/chunk-DFMWUOU5.js.map +0 -1
  650. package/dist/chunk-EIPVYUEP.js.map +0 -1
  651. package/dist/chunk-EQEYOJBM.js.map +0 -1
  652. package/dist/chunk-F3W6YMDC.js.map +0 -1
  653. package/dist/chunk-FET5XCAT.js.map +0 -1
  654. package/dist/chunk-G73UVHCA.js.map +0 -1
  655. package/dist/chunk-GPNTB4Y7.js.map +0 -1
  656. package/dist/chunk-GYGLAVCX.js.map +0 -1
  657. package/dist/chunk-HIWCKBEY.js.map +0 -1
  658. package/dist/chunk-HJUWN7JN.js.map +0 -1
  659. package/dist/chunk-HK67PX4J.js.map +0 -1
  660. package/dist/chunk-HPVZCW43.js +0 -479
  661. package/dist/chunk-HPVZCW43.js.map +0 -1
  662. package/dist/chunk-I3ISCYT7.js +0 -159
  663. package/dist/chunk-I3ISCYT7.js.map +0 -1
  664. package/dist/chunk-K23VKTN4.js.map +0 -1
  665. package/dist/chunk-KKEESNPE.js.map +0 -1
  666. package/dist/chunk-KTFRCC5C.js.map +0 -1
  667. package/dist/chunk-LH5A3ZPG.js.map +0 -1
  668. package/dist/chunk-LP7BEXCT.js +0 -32
  669. package/dist/chunk-LP7BEXCT.js.map +0 -1
  670. package/dist/chunk-M4YPHYEH.js.map +0 -1
  671. package/dist/chunk-NSITFOCJ.js +0 -99
  672. package/dist/chunk-NSITFOCJ.js.map +0 -1
  673. package/dist/chunk-OTQZ7ZWU.js.map +0 -1
  674. package/dist/chunk-P3MG6QCN.js.map +0 -1
  675. package/dist/chunk-PEOZ34EM.js.map +0 -1
  676. package/dist/chunk-PPTHY5QO.js.map +0 -1
  677. package/dist/chunk-Q2MPFCQ7.js.map +0 -1
  678. package/dist/chunk-Q7HZX3IF.js.map +0 -1
  679. package/dist/chunk-QPQUVOZ2.js.map +0 -1
  680. package/dist/chunk-QTQUH4DS.js.map +0 -1
  681. package/dist/chunk-R42NSZI6.js.map +0 -1
  682. package/dist/chunk-R7BX2NB3.js.map +0 -1
  683. package/dist/chunk-RSGLUIO6.js.map +0 -1
  684. package/dist/chunk-RTBJ5IOO.js +0 -87
  685. package/dist/chunk-RTBJ5IOO.js.map +0 -1
  686. package/dist/chunk-SGZAIJCV.js.map +0 -1
  687. package/dist/chunk-SKGMN35F.js.map +0 -1
  688. package/dist/chunk-SPYWXKJN.js.map +0 -1
  689. package/dist/chunk-SZJ3DLZA.js +0 -66
  690. package/dist/chunk-SZJ3DLZA.js.map +0 -1
  691. package/dist/chunk-TRGTKX5E.js.map +0 -1
  692. package/dist/chunk-UDHWDSRL.js.map +0 -1
  693. package/dist/chunk-UP4BECPY.js.map +0 -1
  694. package/dist/chunk-UXVWEX5L.js.map +0 -1
  695. package/dist/chunk-V7ZRRCRJ.js.map +0 -1
  696. package/dist/chunk-WQBG4SZS.js.map +0 -1
  697. package/dist/chunk-XKWGNJ26.js.map +0 -1
  698. package/dist/chunk-YMUFFJCO.js.map +0 -1
  699. package/dist/chunk-ZHKOPKE3.js.map +0 -1
  700. package/dist/chunk-ZN4FD4PE.js +0 -364
  701. package/dist/chunk-ZN4FD4PE.js.map +0 -1
  702. package/dist/chunk-ZORTV6NH.js.map +0 -1
  703. package/dist/chunk-ZYIYHJ5R.js.map +0 -1
  704. package/dist/classified-marker-BWOFVYAC.js.map +0 -1
  705. package/dist/collection-facade-JSJYIKS4.js +0 -45
  706. package/dist/dead-filter-PKQDLOT4.js.map +0 -1
  707. package/dist/delegation-DS5NRILW.js.map +0 -1
  708. package/dist/derive-E642AOUB.js +0 -21
  709. package/dist/dispatch-Q6MWLOJY.js.map +0 -1
  710. package/dist/executor-5NIMLSKZ.js +0 -8
  711. package/dist/executor-7UQ3BZ4F.js +0 -29
  712. package/dist/executor-AQVXV5GZ.js +0 -8
  713. package/dist/export-accessible-ORMKLA3E.js +0 -22
  714. package/dist/extract-partition-NKYO3WNG.js +0 -37
  715. package/dist/fanout-sidecar-S3QL53YX.js.map +0 -1
  716. package/dist/find-NOGJ25VX.js +0 -10
  717. package/dist/issue-3DTQ7VJJ.js +0 -18
  718. package/dist/json-schema-V3M5MUCM.js.map +0 -1
  719. package/dist/kernel/enclave/classify/compare.d.ts +0 -10
  720. package/dist/kernel/enclave/index.d.ts +0 -87
  721. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +0 -124
  722. package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +0 -88
  723. package/dist/kernel/enclave/record-keys/rekey.d.ts +0 -91
  724. package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +0 -14
  725. package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +0 -123
  726. package/dist/kernel/enclave/record-keys/sealing.d.ts +0 -70
  727. package/dist/kernel/query/join.d.ts +0 -232
  728. package/dist/liberate-V35QUHJP.js +0 -24
  729. package/dist/link-set-2TTM3IZC.js +0 -30
  730. package/dist/noydb-62MX4QUG.js +0 -90
  731. package/dist/pod-handle-ECVCDIXW.js.map +0 -1
  732. package/dist/post-register-3IPCSG6Q.js.map +0 -1
  733. package/dist/register-HHLXEQDN.js +0 -31
  734. package/dist/registry-23WF3TGH.js +0 -8
  735. package/dist/registry-4AYVUNXK.js +0 -8
  736. package/dist/registry-JS3YFQQM.js +0 -18
  737. package/dist/registry-XX2Z7B46.js +0 -32
  738. package/dist/request-withdrawal-CHPATE4G.js +0 -30
  739. package/dist/reveal-QZDHSGD4.js.map +0 -1
  740. package/dist/revoke-7M2VW4ON.js +0 -23
  741. package/dist/seed-X5CC22CQ.js.map +0 -1
  742. package/dist/signer-SJQJVSM6.js +0 -24
  743. package/dist/stale-BZS6H2RY.js +0 -29
  744. package/dist/storage-RW4QBS23.js +0 -22
  745. package/dist/store-coordination-provider-4WZAIRHC.js.map +0 -1
  746. package/dist/verify-6MDTIUEV.js.map +0 -1
  747. package/dist/walk-ZURCH6RZ.js +0 -21
  748. package/dist/withdraw-accessible-PXR4IXDX.js +0 -27
  749. /package/dist/{api-WYW4YEQG.js.map → api-OS747DS4.js.map} +0 -0
  750. /package/dist/{computed-VPOKQK4N.js.map → capsule/contract.js.map} +0 -0
  751. /package/dist/{kernel/enclave → capsule/enclave-aes}/broker/proof.d.ts +0 -0
  752. /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/bidx.d.ts +0 -0
  753. /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/digest.d.ts +0 -0
  754. /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/vdig.d.ts +0 -0
  755. /package/dist/{kernel/enclave/classify → capsule/plumbing}/kofn.d.ts +0 -0
  756. /package/dist/{kernel/enclave/classify → capsule/plumbing}/normalize.d.ts +0 -0
  757. /package/dist/{kernel/enclave → capsule/plumbing}/record-aad.d.ts +0 -0
  758. /package/dist/{collection-facade-JSJYIKS4.js.map → capsule-VOLX3QRQ.js.map} +0 -0
  759. /package/dist/{chunk-MVMXZYXT.js.map → chunk-2GHDLTPE.js.map} +0 -0
  760. /package/dist/{chunk-XLMEZIAJ.js.map → chunk-2ODVB6LZ.js.map} +0 -0
  761. /package/dist/{chunk-RMS3NEA3.js.map → chunk-4JPMZTJY.js.map} +0 -0
  762. /package/dist/{chunk-NQKIUNW5.js.map → chunk-52MGURXO.js.map} +0 -0
  763. /package/dist/{chunk-UGTBXF5U.js.map → chunk-7XMHMVTS.js.map} +0 -0
  764. /package/dist/{chunk-BZ3534YM.js.map → chunk-AUKKUPVB.js.map} +0 -0
  765. /package/dist/{derive-E642AOUB.js.map → chunk-BKT776R5.js.map} +0 -0
  766. /package/dist/{chunk-6LKOJBV6.js.map → chunk-BVCUTXE3.js.map} +0 -0
  767. /package/dist/{chunk-VTFVLCUH.js.map → chunk-DIZLQVAA.js.map} +0 -0
  768. /package/dist/{chunk-LWBCUYZW.js.map → chunk-E2N2T5ZO.js.map} +0 -0
  769. /package/dist/{chunk-JVIBCBC7.js.map → chunk-EJLV62NI.js.map} +0 -0
  770. /package/dist/{chunk-JMGDHKQF.js.map → chunk-FLPCETP6.js.map} +0 -0
  771. /package/dist/{chunk-DGOZ4UZD.js.map → chunk-FVH5QYY2.js.map} +0 -0
  772. /package/dist/{chunk-JBDFMYKQ.js.map → chunk-GZT3NQRA.js.map} +0 -0
  773. /package/dist/{chunk-TFR7DSOV.js.map → chunk-H427H63K.js.map} +0 -0
  774. /package/dist/{chunk-SMH6SRX7.js.map → chunk-JOSPH3E5.js.map} +0 -0
  775. /package/dist/{chunk-3BZZJJMQ.js.map → chunk-MILI22XQ.js.map} +0 -0
  776. /package/dist/{chunk-YYP7WSEB.js.map → chunk-O2IMQSNA.js.map} +0 -0
  777. /package/dist/{chunk-QIZPZMUI.js.map → chunk-Q4UHJ5SN.js.map} +0 -0
  778. /package/dist/{chunk-FAHMLERK.js.map → chunk-QBLT6POL.js.map} +0 -0
  779. /package/dist/{chunk-BUE2D7PX.js.map → chunk-SMV2HRDU.js.map} +0 -0
  780. /package/dist/{chunk-SFAWCTEM.js.map → chunk-TZZBXPZK.js.map} +0 -0
  781. /package/dist/{chunk-UHHPLO3I.js.map → chunk-V3RWOOSO.js.map} +0 -0
  782. /package/dist/{chunk-Q2PU57HC.js.map → chunk-VVOLDVIR.js.map} +0 -0
  783. /package/dist/{chunk-TUFM4UZP.js.map → chunk-XQRFSKYM.js.map} +0 -0
  784. /package/dist/{chunk-GY4WYNNG.js.map → chunk-Y2RKVFKR.js.map} +0 -0
  785. /package/dist/{chunk-4OZNXTO4.js.map → chunk-YRXFFWG4.js.map} +0 -0
  786. /package/dist/{enclave-55PAM4YO.js.map → collection-facade-CS7CA2XO.js.map} +0 -0
  787. /package/dist/{executor-5NIMLSKZ.js.map → computed-FAD7SED4.js.map} +0 -0
  788. /package/dist/{executor-7UQ3BZ4F.js.map → derive-XLOJVXPU.js.map} +0 -0
  789. /package/dist/{dispatch-IEPAVQUM.js.map → dispatch-H4HV32AM.js.map} +0 -0
  790. /package/dist/{executor-AQVXV5GZ.js.map → executor-FMPVN6DT.js.map} +0 -0
  791. /package/dist/{export-accessible-ORMKLA3E.js.map → executor-LBBBRTN5.js.map} +0 -0
  792. /package/dist/{extract-partition-NKYO3WNG.js.map → executor-OSRZST2U.js.map} +0 -0
  793. /package/dist/{find-NOGJ25VX.js.map → export-accessible-RAOJAAU5.js.map} +0 -0
  794. /package/dist/{issue-3DTQ7VJJ.js.map → extract-partition-JD5CUSTG.js.map} +0 -0
  795. /package/dist/{ledger-EDXFFZQL.js.map → find-JRN4RNQ5.js.map} +0 -0
  796. /package/dist/{liberate-V35QUHJP.js.map → issue-YIVBZUTH.js.map} +0 -0
  797. /package/dist/{link-set-2TTM3IZC.js.map → ledger-5ZMGE44K.js.map} +0 -0
  798. /package/dist/{managed-secret-NCWEMPUQ.js.map → liberate-WZSZM2W6.js.map} +0 -0
  799. /package/dist/{noydb-62MX4QUG.js.map → link-set-MFXC24VK.js.map} +0 -0
  800. /package/dist/{register-HHLXEQDN.js.map → managed-secret-MFTFT22X.js.map} +0 -0
  801. /package/dist/{migrate-cek-5ENH64AA.js.map → migrate-cek-DZRFFOHW.js.map} +0 -0
  802. /package/dist/{registry-23WF3TGH.js.map → noydb-ITIGNKUF.js.map} +0 -0
  803. /package/dist/{registry-4AYVUNXK.js.map → query/all/index.js.map} +0 -0
  804. /package/dist/{registry-JS3YFQQM.js.map → register-DT5HZ2LZ.js.map} +0 -0
  805. /package/dist/{registry-XX2Z7B46.js.map → registry-BHRZGZHF.js.map} +0 -0
  806. /package/dist/{request-withdrawal-CHPATE4G.js.map → registry-ET6ZFFWA.js.map} +0 -0
  807. /package/dist/{revoke-7M2VW4ON.js.map → registry-HXFGLGTG.js.map} +0 -0
  808. /package/dist/{signer-SJQJVSM6.js.map → registry-THCPDEOD.js.map} +0 -0
  809. /package/dist/{stale-BZS6H2RY.js.map → request-withdrawal-AV2MJJKY.js.map} +0 -0
  810. /package/dist/{storage-RW4QBS23.js.map → revoke-6DWIEOCV.js.map} +0 -0
  811. /package/dist/{walk-ZURCH6RZ.js.map → signer-MHGW3OIL.js.map} +0 -0
  812. /package/dist/{withdraw-accessible-PXR4IXDX.js.map → stale-6GCFMOOR.js.map} +0 -0
@@ -7,92 +7,80 @@ import {
7
7
  isLinkCollectionName,
8
8
  linkCollectionName,
9
9
  linkRowKey
10
- } from "./chunk-QIZPZMUI.js";
10
+ } from "./chunk-Q4UHJ5SN.js";
11
11
  import {
12
12
  hashFields,
13
13
  validateSatelliteDeclaration
14
- } from "./chunk-TUFM4UZP.js";
14
+ } from "./chunk-XQRFSKYM.js";
15
15
  import {
16
16
  resolveStaleOnRead
17
- } from "./chunk-SMH6SRX7.js";
17
+ } from "./chunk-JOSPH3E5.js";
18
18
  import {
19
19
  loadFence
20
- } from "./chunk-453F654R.js";
20
+ } from "./chunk-VAORSCSU.js";
21
21
  import {
22
22
  buildPersistedIndexCallbacks,
23
23
  syncTierSearch
24
- } from "./chunk-UP4BECPY.js";
24
+ } from "./chunk-Y3LPTBG7.js";
25
25
  import {
26
26
  isBaseLive,
27
27
  liveBaseIdSet
28
- } from "./chunk-GYGLAVCX.js";
28
+ } from "./chunk-2MG3SW7Q.js";
29
29
  import {
30
30
  SchemaUpdateGate
31
31
  } from "./chunk-6LJY7X5A.js";
32
- import {
33
- NO_ATTESTATION
34
- } from "./chunk-Q7HZX3IF.js";
35
32
  import {
36
33
  NO_TIERS,
37
34
  classifySealedShred,
38
35
  syncDerivedOutputs
39
- } from "./chunk-M4YPHYEH.js";
36
+ } from "./chunk-DHHGL42E.js";
40
37
  import {
41
38
  NO_PORTABILITY
42
- } from "./chunk-BZ3534YM.js";
39
+ } from "./chunk-AUKKUPVB.js";
43
40
  import {
44
41
  NO_CARGO
45
- } from "./chunk-NQKIUNW5.js";
42
+ } from "./chunk-52MGURXO.js";
46
43
  import {
47
44
  saveSealedSecret
48
- } from "./chunk-4GVM6QZA.js";
45
+ } from "./chunk-3XJQBBZD.js";
49
46
  import {
50
47
  runDrainBarrier
51
- } from "./chunk-VTFVLCUH.js";
48
+ } from "./chunk-DIZLQVAA.js";
52
49
  import {
53
50
  fallbackDerivationName
54
51
  } from "./chunk-RXLYKVTF.js";
55
- import {
56
- NO_SEQUENCE,
57
- SEQUENCE_COLLECTION,
58
- compileSequenceFormat,
59
- resolveSequenceKey
60
- } from "./chunk-GPNTB4Y7.js";
61
52
  import {
62
53
  CustodyApi,
63
54
  NO_CUSTODY
64
- } from "./chunk-UHHPLO3I.js";
55
+ } from "./chunk-V3RWOOSO.js";
65
56
  import {
66
57
  DEFAULT_POSTURE,
67
- EXPORT_REDACTION_MARKER,
68
58
  ViaGraph,
69
- ViaPipeline,
70
59
  buildDescription,
71
60
  collectKnownFieldNames,
72
61
  computedEntryParts,
73
62
  deriveZodFields,
74
- exportRedact,
75
63
  guardReconcileCollisions,
76
64
  mergeViaFields,
77
65
  resolveCollectionConfig,
78
66
  resolveComputedEdges,
79
67
  resolveDescribeFieldIds,
80
68
  resolveVirtualMoneyFields
81
- } from "./chunk-CUQPWYRX.js";
69
+ } from "./chunk-IUT3GWP3.js";
82
70
  import {
83
71
  findMatchingIdsByPairs
84
72
  } from "./chunk-TFMM5DBB.js";
85
73
  import {
86
74
  encodeVecId
87
- } from "./chunk-RTBJ5IOO.js";
75
+ } from "./chunk-M5B2W6YY.js";
88
76
  import {
89
77
  NO_CLASSIFIED,
90
78
  guardClassifiedCompat,
91
79
  resolveClassifiedFields
92
- } from "./chunk-5VCRVKOZ.js";
80
+ } from "./chunk-GUZET4SG.js";
93
81
  import {
94
82
  derivePersistedSchema
95
- } from "./chunk-ACAQ2DSG.js";
83
+ } from "./chunk-747G6CT3.js";
96
84
  import {
97
85
  findRollupSpecForIntent,
98
86
  forgetDerivedFanout,
@@ -102,7 +90,7 @@ import {
102
90
  runGraphDispatchWave,
103
91
  selfWriteFieldEqual,
104
92
  touchFor
105
- } from "./chunk-3BZZJJMQ.js";
93
+ } from "./chunk-MILI22XQ.js";
106
94
  import {
107
95
  buildLookupAltIndex,
108
96
  buildLookupSnapshotRows,
@@ -117,25 +105,30 @@ import {
117
105
  resolveDictSource,
118
106
  resolveLabelFromMap,
119
107
  updateReferencingRecords
120
- } from "./chunk-R7BX2NB3.js";
108
+ } from "./chunk-244QBK7Z.js";
121
109
  import {
122
110
  OverlayedCollection
123
- } from "./chunk-SKGMN35F.js";
111
+ } from "./chunk-HS554XAF.js";
124
112
  import {
125
113
  INDEXED_STORE_POLICY,
126
114
  NO_SYNC
127
115
  } from "./chunk-T7IR4N2S.js";
128
116
  import {
129
- NO_CONSENT
130
- } from "./chunk-PEOZ34EM.js";
117
+ NO_ATTESTATION
118
+ } from "./chunk-PD64727P.js";
119
+ import {
120
+ NO_COVERAGE
121
+ } from "./chunk-RHVMZSUU.js";
131
122
  import {
132
123
  NO_PERIODS,
133
124
  isEffectivelyReopened,
125
+ isOrderableBusinessDate,
126
+ malformedBusinessDate,
134
127
  purgeMarkersOn,
135
128
  resolvePeriodKey,
136
129
  resolveReopenState,
137
130
  samePartition
138
- } from "./chunk-2ENE6445.js";
131
+ } from "./chunk-3A5DUZ56.js";
139
132
  import {
140
133
  PERIODS_COLLECTION,
141
134
  PERIOD_ARCHIVES_COLLECTION,
@@ -143,7 +136,7 @@ import {
143
136
  PERIOD_REOPENS_COLLECTION,
144
137
  PERIOD_TARGET_PURGES_COLLECTION,
145
138
  periodExclusiveUpperBound
146
- } from "./chunk-FAHMLERK.js";
139
+ } from "./chunk-QBLT6POL.js";
147
140
  import {
148
141
  NO_SHADOW
149
142
  } from "./chunk-SMY5X46Z.js";
@@ -152,38 +145,37 @@ import {
152
145
  } from "./chunk-DZFQVICS.js";
153
146
  import {
154
147
  TxContext,
155
- bestEffortRevert
156
- } from "./chunk-BLN54W3L.js";
148
+ bestEffortRevert,
149
+ trackKeyedWrite
150
+ } from "./chunk-UA372JHH.js";
157
151
  import {
158
152
  lazy
159
153
  } from "./chunk-5D2ALSM5.js";
160
154
  import {
155
+ INDEX_SNAPSHOT_VERSION,
161
156
  InvertedIndex,
162
157
  MemoryIndexStore,
163
158
  NO_SEARCH
164
- } from "./chunk-LH5A3ZPG.js";
165
- import {
166
- NO_SEALED_RECORD
167
- } from "./chunk-6YXCPL4T.js";
159
+ } from "./chunk-RB4DOPGZ.js";
168
160
  import {
169
- Query,
170
- ScanBuilder
171
- } from "./chunk-7MG2LHO5.js";
161
+ NO_SEQUENCE,
162
+ SEQUENCE_COLLECTION,
163
+ compileSequenceFormat,
164
+ resolveSequenceKey
165
+ } from "./chunk-VFHCKG5M.js";
172
166
  import {
173
167
  EXPORT_AUDIT_COLLECTION,
174
168
  NO_BLOBS,
175
169
  createExportBlobsHandle,
176
170
  runCompaction
177
- } from "./chunk-7APJ6CO6.js";
171
+ } from "./chunk-JSMTXZR3.js";
178
172
  import {
179
173
  LazyQuery,
180
174
  NO_INDEXING,
175
+ compositeKey,
181
176
  decodeIdxId,
182
177
  encodeIdxId
183
- } from "./chunk-KTFRCC5C.js";
184
- import {
185
- normalizeIndexDefs
186
- } from "./chunk-I3ISCYT7.js";
178
+ } from "./chunk-V7ADQF5O.js";
187
179
  import {
188
180
  IMPLICIT_LAZY
189
181
  } from "./chunk-66TQOPFM.js";
@@ -193,28 +185,49 @@ import {
193
185
  import {
194
186
  canonicalGroupKey
195
187
  } from "./chunk-XZHEOSQ2.js";
188
+ import {
189
+ NO_CRDT
190
+ } from "./chunk-PVEWA2DU.js";
191
+ import {
192
+ NO_CONSENT
193
+ } from "./chunk-GSAK56VF.js";
194
+ import {
195
+ NO_SEALED_RECORD
196
+ } from "./chunk-UEFOQH74.js";
197
+ import {
198
+ normalizeIndexDefs,
199
+ parseFieldIndexSnapshot
200
+ } from "./chunk-2AFX33YA.js";
201
+ import {
202
+ EXPORT_REDACTION_MARKER,
203
+ ViaPipeline,
204
+ exportRedact
205
+ } from "./chunk-3EWS67C7.js";
206
+ import {
207
+ ScanBuilder
208
+ } from "./chunk-JQYKPKG6.js";
209
+ import {
210
+ Query
211
+ } from "./chunk-AL6ML4LA.js";
196
212
  import {
197
213
  NO_REDUCE
198
- } from "./chunk-YMUFFJCO.js";
214
+ } from "./chunk-3TDUWVWB.js";
199
215
  import {
200
216
  readPath
201
- } from "./chunk-NSITFOCJ.js";
202
- import {
203
- NO_CRDT
204
- } from "./chunk-PVEWA2DU.js";
217
+ } from "./chunk-5WWDGFOS.js";
205
218
  import {
206
219
  dictCollectionName
207
- } from "./chunk-Q2MPFCQ7.js";
220
+ } from "./chunk-23D6M6VM.js";
208
221
  import {
209
222
  NO_I18N,
210
223
  getAtPath,
211
224
  isDictCollectionName,
212
225
  isStaticDictDescriptor
213
- } from "./chunk-TRGTKX5E.js";
226
+ } from "./chunk-OKSTSITU.js";
214
227
  import {
215
228
  isViaInstalled,
216
229
  viaBinder
217
- } from "./chunk-UXVWEX5L.js";
230
+ } from "./chunk-SYNY3VB5.js";
218
231
  import {
219
232
  NO_TEAM,
220
233
  describeAllUsersAuth,
@@ -237,7 +250,7 @@ import {
237
250
  saveShamirRecoveryEntries,
238
251
  updateAuthenticator,
239
252
  writeMagicLinkGrant
240
- } from "./chunk-WQBG4SZS.js";
253
+ } from "./chunk-DQESF6RP.js";
241
254
  import {
242
255
  assertKeyringOpenAllowed,
243
256
  buildRecipientKeyringFile,
@@ -252,15 +265,15 @@ import {
252
265
  listUsers,
253
266
  loadKeyring,
254
267
  updateKeyringIdentity
255
- } from "./chunk-3V4KWFX7.js";
268
+ } from "./chunk-XSPFDUDG.js";
256
269
  import {
257
270
  persistDirectoryConfig,
258
271
  readDirectoryConfig
259
- } from "./chunk-XKWGNJ26.js";
272
+ } from "./chunk-LIOVX5TJ.js";
260
273
  import {
261
274
  NO_BROKER,
262
275
  buildCredentialBrokerHandle
263
- } from "./chunk-JBDFMYKQ.js";
276
+ } from "./chunk-GZT3NQRA.js";
264
277
  import {
265
278
  NO_SESSION
266
279
  } from "./chunk-VKQCVU2Z.js";
@@ -269,19 +282,19 @@ import {
269
282
  } from "./chunk-4AOERLTV.js";
270
283
  import {
271
284
  NO_HISTORY
272
- } from "./chunk-AYX7AINO.js";
285
+ } from "./chunk-LNSVGRHO.js";
273
286
  import {
274
287
  sha256Hex
275
- } from "./chunk-QPQUVOZ2.js";
288
+ } from "./chunk-6QVKPHBF.js";
276
289
  import {
277
290
  assertCutoverTierSafe,
278
291
  assertTierWritable,
279
292
  dekKey,
280
293
  liveRecordIsElevated
281
- } from "./chunk-JMGDHKQF.js";
294
+ } from "./chunk-FLPCETP6.js";
282
295
  import {
283
296
  NO_VAULT_HEAD
284
- } from "./chunk-HK67PX4J.js";
297
+ } from "./chunk-HW7CMKUG.js";
285
298
  import {
286
299
  NO_FORGET,
287
300
  addSubjectRef,
@@ -290,36 +303,34 @@ import {
290
303
  readDottedPath,
291
304
  rebuildSubjectIndex,
292
305
  removeSubjectRef
293
- } from "./chunk-RF6D3Y5E.js";
306
+ } from "./chunk-JDEYF3PJ.js";
294
307
  import {
295
308
  RecordCodec,
296
309
  SEALED_CEK_NS,
297
310
  applyRewrappedBody,
311
+ buildDeleteMarker,
298
312
  buildRecordAad,
313
+ buildRecordEnvelope,
314
+ buildTombstone,
315
+ encrypt,
299
316
  findByDet,
300
317
  hasPerRecordKey,
301
318
  hasSealedBody,
319
+ isDeleteMarker,
320
+ isTombstone,
302
321
  makeReservedEnvelopes,
303
322
  openEnvelopeJson,
304
323
  queryByDet,
305
324
  resolveStableCek,
306
325
  rewrapBodyToDek,
307
- validateSchemaInput,
308
326
  verifyRecordIdentity
309
- } from "./chunk-4ZS56W5S.js";
310
- import {
311
- buildDeleteMarker,
312
- buildRecordEnvelope,
313
- buildTombstone,
314
- isDeleteMarker,
315
- isTombstone
316
- } from "./chunk-SZJ3DLZA.js";
327
+ } from "./chunk-EZGV6F47.js";
317
328
  import {
318
- encrypt
319
- } from "./chunk-HPVZCW43.js";
329
+ validateSchemaInput
330
+ } from "./chunk-42ALPZ2B.js";
320
331
  import {
321
332
  SealedHandle
322
- } from "./chunk-7MG7SJT7.js";
333
+ } from "./chunk-SV2PM2OY.js";
323
334
  import {
324
335
  AlreadyElevatedError,
325
336
  AttestationError,
@@ -357,10 +368,9 @@ import {
357
368
  TierNotGrantedError,
358
369
  USER_ENVELOPE_COLLECTION,
359
370
  UniqueConstraintError,
360
- UnsupportedIndexOptionError,
361
371
  ValidationError,
362
372
  isConflictError
363
- } from "./chunk-7O3Y4PPD.js";
373
+ } from "./chunk-37EPTBBR.js";
364
374
 
365
375
  // src/kernel/merge-authority.ts
366
376
  function buildMergeAuthority(keyring) {
@@ -442,6 +452,7 @@ var STRATEGY_DEFAULTS = {
442
452
  cargo: NO_CARGO,
443
453
  classified: NO_CLASSIFIED,
444
454
  consent: NO_CONSENT,
455
+ coverage: NO_COVERAGE,
445
456
  crdt: NO_CRDT,
446
457
  custody: NO_CUSTODY,
447
458
  forget: NO_FORGET,
@@ -540,7 +551,7 @@ function validateSecretModeOptions(options) {
540
551
  }
541
552
  async function resolveEffectiveSecret(options, store, vault) {
542
553
  if (options.secretMode === "managed") {
543
- const { resolveManagedSecret } = await import("./managed-secret-NCWEMPUQ.js");
554
+ const { resolveManagedSecret } = await import("./managed-secret-MFTFT22X.js");
544
555
  return resolveManagedSecret(store, vault, options.sealingKey);
545
556
  }
546
557
  return options.secret;
@@ -558,7 +569,7 @@ function ownerKeyringOptions(options, secret) {
558
569
 
559
570
  // src/port/by/default-provider.ts
560
571
  async function createDefaultMesh(store) {
561
- const { StoreMesh } = await import("./store-coordination-provider-4WZAIRHC.js");
572
+ const { StoreMesh } = await import("./store-coordination-provider-C4BPT5XF.js");
562
573
  return new StoreMesh(store);
563
574
  }
564
575
 
@@ -613,6 +624,60 @@ function populateCollectionRegistries(r, collectionName, options, effectiveViaFi
613
624
  }
614
625
  }
615
626
 
627
+ // src/kernel/generation-map.ts
628
+ var tick = 0;
629
+ var GenerationMap = class extends Map {
630
+ /**
631
+ * ⚠️ NOT a `#private` field, and not readonly-initialised, deliberately.
632
+ * `Map`'s constructor calls `this.set()` for each entry of an iterable
633
+ * argument — which runs BEFORE this class's fields are installed. A
634
+ * `#private` field throws `TypeError` on touch at that point; a declared
635
+ * property is merely `undefined`, and assigning to it is safe. The
636
+ * initializer below then runs and resets it to 0, which is the correct
637
+ * resting state for a freshly built map.
638
+ */
639
+ gen = 0;
640
+ /** Mutation stamp. Equal across two reads means nothing changed between them. */
641
+ get generation() {
642
+ return this.gen;
643
+ }
644
+ set(key, value) {
645
+ this.gen = ++tick;
646
+ return super.set(key, value);
647
+ }
648
+ delete(key) {
649
+ this.gen = ++tick;
650
+ return super.delete(key);
651
+ }
652
+ clear() {
653
+ this.gen = ++tick;
654
+ super.clear();
655
+ }
656
+ };
657
+
658
+ // src/kernel/present-cache.ts
659
+ var memo = /* @__PURE__ */ new WeakMap();
660
+ function presentVariantKey(locale, layer, fallback) {
661
+ const chain = fallback === void 0 ? "" : Array.isArray(fallback) ? fallback.join(",") : String(fallback);
662
+ return `${locale ?? ""} ${layer} ${chain}`;
663
+ }
664
+ function memoizePresent(record, variant, compute) {
665
+ let variants = memo.get(record);
666
+ if (!variants) {
667
+ variants = /* @__PURE__ */ new Map();
668
+ memo.set(record, variants);
669
+ }
670
+ const hit = variants.get(variant);
671
+ if (hit !== void 0) return hit;
672
+ const scope = variants;
673
+ const pending = compute().catch((err) => {
674
+ scope.delete(variant);
675
+ throw err;
676
+ });
677
+ scope.set(variant, pending);
678
+ return pending;
679
+ }
680
+
616
681
  // src/kernel/lazy-count.ts
617
682
  var COUNT_PAGE_SIZE = 1e3;
618
683
  function isLive(env, storeCiphertext) {
@@ -675,6 +740,121 @@ async function applyCutoverTransform(ctx) {
675
740
  return count;
676
741
  }
677
742
 
743
+ // src/with-lookup/indexing/persisted-field-indexes.ts
744
+ function fieldIndexFingerprint(cache) {
745
+ let sum = 0;
746
+ let xor = 0;
747
+ let maxVersion = 0;
748
+ for (const [id, entry] of cache) {
749
+ const h = fnv1a(`${id} ${entry.version}`);
750
+ sum = sum + h >>> 0;
751
+ xor = (xor ^ h) >>> 0;
752
+ if (entry.version > maxVersion) maxVersion = entry.version;
753
+ }
754
+ return { count: cache.size, maxVersion, digest: `${sum.toString(36)}.${xor.toString(36)}` };
755
+ }
756
+ function fnv1a(s) {
757
+ let h = 2166136261;
758
+ for (let i = 0; i < s.length; i++) {
759
+ h ^= s.charCodeAt(i);
760
+ h = Math.imul(h, 16777619) >>> 0;
761
+ }
762
+ return h >>> 0;
763
+ }
764
+ function fpEqual(a, b) {
765
+ return a.count === b.count && a.maxVersion === b.maxVersion && a.digest === b.digest;
766
+ }
767
+ var PersistedFieldIndexes = class {
768
+ constructor(cb) {
769
+ this.cb = cb;
770
+ this.debounceMs = cb.debounceMs ?? 1e3;
771
+ }
772
+ cb;
773
+ timer = null;
774
+ debounceMs;
775
+ /** True when at least one index on this collection asked to be persisted. */
776
+ get enabled() {
777
+ return this.cb.keys().length > 0;
778
+ }
779
+ /**
780
+ * Restore whatever is fresh. Returns the sidecar keys that were adopted —
781
+ * the caller rebuilds every other declared index from the cache. Never
782
+ * throws for a bad blob: an unreadable sidecar is indistinguishable from an
783
+ * absent one, and both mean "rebuild".
784
+ */
785
+ async restore(isLive2) {
786
+ const keys = this.cb.keys();
787
+ if (keys.length === 0) return EMPTY;
788
+ const live = this.cb.currentFingerprint();
789
+ const restored = /* @__PURE__ */ new Set();
790
+ for (const key of keys) {
791
+ let loaded = null;
792
+ try {
793
+ loaded = await this.cb.load(key);
794
+ } catch {
795
+ continue;
796
+ }
797
+ if (loaded === null || !fpEqual(loaded.fingerprint, live)) continue;
798
+ const snap = parseFieldIndexSnapshot(loaded.json);
799
+ if (snap === null) continue;
800
+ if (this.cb.restore(key, snap, isLive2)) restored.add(key);
801
+ }
802
+ return restored;
803
+ }
804
+ /** Schedule a debounced write of every opted-in sidecar. */
805
+ markDirty() {
806
+ if (this.cb.keys().length === 0) return;
807
+ if (this.timer) clearTimeout(this.timer);
808
+ this.timer = setTimeout(() => {
809
+ this.timer = null;
810
+ void this.persist().catch(() => {
811
+ });
812
+ }, this.debounceMs);
813
+ }
814
+ /** Force an immediate write (cancels any pending debounce). */
815
+ async flush() {
816
+ if (this.timer) {
817
+ clearTimeout(this.timer);
818
+ this.timer = null;
819
+ }
820
+ await this.persist();
821
+ }
822
+ /** Delete every sidecar — erasure, and any point the blobs must not survive. */
823
+ async removeAll() {
824
+ if (this.timer) {
825
+ clearTimeout(this.timer);
826
+ this.timer = null;
827
+ }
828
+ let purged = 0;
829
+ const residue = [];
830
+ for (const key of this.cb.keys()) {
831
+ try {
832
+ await this.cb.remove(key);
833
+ purged++;
834
+ } catch {
835
+ residue.push(key);
836
+ }
837
+ }
838
+ return { purged, residue };
839
+ }
840
+ /** Drop a pending debounce without writing (collection teardown). */
841
+ dispose() {
842
+ if (this.timer) {
843
+ clearTimeout(this.timer);
844
+ this.timer = null;
845
+ }
846
+ }
847
+ async persist() {
848
+ const fp = this.cb.currentFingerprint();
849
+ for (const key of this.cb.keys()) {
850
+ const snap = this.cb.snapshot(key);
851
+ if (!snap) continue;
852
+ await this.cb.save(key, JSON.stringify(snap), fp);
853
+ }
854
+ }
855
+ };
856
+ var EMPTY = /* @__PURE__ */ new Set();
857
+
678
858
  // src/with-lookup/indexing/collection-facade.ts
679
859
  function readPersistedValue(record, field) {
680
860
  if (!field.includes(".")) return record[field];
@@ -713,14 +893,98 @@ function valuesMatch(stored, live) {
713
893
  return false;
714
894
  }
715
895
  }
716
- function rebuildEagerIndexesFromCache(ctx) {
896
+ function rebuildEagerIndexesFromCache(ctx, skip) {
717
897
  const eager = ctx.indexes;
718
898
  if (!eager || eager.fields().length === 0) return;
719
899
  const snapshot = [];
720
900
  for (const [id, entry] of ctx.cache) {
721
901
  snapshot.push({ id, record: entry.record });
722
902
  }
723
- eager.build(snapshot);
903
+ eager.build(snapshot, skip);
904
+ }
905
+ var FIELD_IDX = "_fieldidx";
906
+ function buildFieldIndexCallbacks(provideCtx, debounceMs) {
907
+ const sidecarId = (name, key) => `${name}/${key}`;
908
+ return {
909
+ keys: () => provideCtx().indexes?.persistableKeys() ?? [],
910
+ snapshot: (key) => provideCtx().indexes?.snapshotIndex(key),
911
+ restore: (key, snap, isLive2) => provideCtx().indexes?.restoreIndex(key, snap, isLive2) ?? false,
912
+ load: async (key) => {
913
+ const ctx = provideCtx();
914
+ const id = sidecarId(ctx.name, key);
915
+ const env = await ctx.adapter.get(ctx.vault, FIELD_IDX, id);
916
+ if (!env) return null;
917
+ const body = await ctx.codec.decryptJsonString({ collection: FIELD_IDX, id }, env);
918
+ if (body === null) return null;
919
+ try {
920
+ const wrapped = JSON.parse(body);
921
+ if (typeof wrapped?.idx !== "string" || typeof wrapped?.fp?.digest !== "string") return null;
922
+ return { json: wrapped.idx, fingerprint: wrapped.fp };
923
+ } catch {
924
+ return null;
925
+ }
926
+ },
927
+ save: async (key, json, fp) => {
928
+ const ctx = provideCtx();
929
+ const id = sidecarId(ctx.name, key);
930
+ const body = JSON.stringify({ fp, idx: json });
931
+ const env = await ctx.codec.encryptJsonString({ collection: FIELD_IDX, id }, body, fp.count);
932
+ await ctx.adapter.put(ctx.vault, FIELD_IDX, id, env);
933
+ },
934
+ remove: async (key) => {
935
+ const ctx = provideCtx();
936
+ await ctx.adapter.delete(ctx.vault, FIELD_IDX, sidecarId(ctx.name, key));
937
+ },
938
+ currentFingerprint: () => fieldIndexFingerprint(provideCtx().cache),
939
+ ...debounceMs !== void 0 ? { debounceMs } : {}
940
+ };
941
+ }
942
+ function createPersistedFieldIndexes(provideCtx, indexes) {
943
+ if ((indexes?.persistableKeys().length ?? 0) === 0) return null;
944
+ return new PersistedFieldIndexes(buildFieldIndexCallbacks(provideCtx));
945
+ }
946
+ async function hydrateEagerIndexes(ctx) {
947
+ const store = ctx.fieldIndexes;
948
+ if (!store || !store.enabled || !ctx.indexes) {
949
+ rebuildEagerIndexesFromCache(ctx);
950
+ return;
951
+ }
952
+ const restored = await store.restore((id) => ctx.cache.has(id));
953
+ rebuildEagerIndexesFromCache(ctx, restored);
954
+ if (restored.size < ctx.indexes.persistableKeys().length) store.markDirty();
955
+ }
956
+ async function checkUniqueOnPut(ctx, id, record) {
957
+ const set = ctx.uniqueConstraints;
958
+ if (!set || set.enforcement === "detect") return;
959
+ if (!ctx.lazy) {
960
+ set.check(id, record);
961
+ return;
962
+ }
963
+ const persisted = ctx.persistedIndexes;
964
+ if (!persisted) {
965
+ throw new Error(
966
+ `Collection "${ctx.name}": a unique index in lazy mode (prefetch: false) needs the indexing service. Pass \`withIndexing()\` from "@noy-db/hub/indexing" to \`createNoydb({ indexingStrategy })\`.`
967
+ );
968
+ }
969
+ await ctx.ensurePersistedIndexesLoaded();
970
+ const rec = record;
971
+ for (const fields of set.fieldTuples()) {
972
+ const values = [];
973
+ for (const f of fields) {
974
+ const v = readPersistedValue(rec, f);
975
+ if (v === null || v === void 0) {
976
+ values.length = 0;
977
+ break;
978
+ }
979
+ values.push(v);
980
+ }
981
+ if (values.length === 0) continue;
982
+ const holders = persisted.probeEqual(compositeKey(fields), fields.length === 1 ? values[0] : values);
983
+ if (!holders) continue;
984
+ for (const holder of holders) {
985
+ if (holder !== id) throw new UniqueConstraintError(ctx.name, id, fields, holder);
986
+ }
987
+ }
724
988
  }
725
989
  function rebuildUniqueConstraintsFromCache(ctx) {
726
990
  if (!ctx.uniqueConstraints) return;
@@ -916,10 +1180,11 @@ async function maintainPersistedIndexesOnDelete(ctx, id, previousRecord) {
916
1180
  }
917
1181
  }
918
1182
  async function purgePersistedIndexes(ctx, id) {
1183
+ const field = ctx.fieldIndexes ? await ctx.fieldIndexes.removeAll() : { purged: 0, residue: [] };
919
1184
  const persisted = ctx.persistedIndexes;
920
- if (!persisted) return { purged: 0, residue: [] };
921
- let purged = 0;
922
- const residue = [];
1185
+ if (!persisted) return field;
1186
+ let purged = field.purged;
1187
+ const residue = [...field.residue];
923
1188
  for (const def of persisted.definitions()) {
924
1189
  try {
925
1190
  await ctx.adapter.delete(ctx.vault, ctx.name, encodeIdxId(def.key, id));
@@ -947,19 +1212,108 @@ async function resolveTierSyncPrior(ctx, id, priorEnvelope) {
947
1212
  if (!ctx.lazy || !priorEnvelope || (priorEnvelope._tier ?? 0) > 0) return null;
948
1213
  return await ctx.codec.decryptRecord({ collection: ctx.name, id }, priorEnvelope, { skipValidation: true });
949
1214
  }
1215
+ function resolveDeclaredIndexes(defs, collectionName, indexingEnabled) {
1216
+ const declared = normalizeIndexDefs(defs);
1217
+ if (indexingEnabled || declared.length === 0) return declared;
1218
+ const fields = [...new Set(declared.flatMap((d) => [...d.fields]))];
1219
+ console.warn(
1220
+ `[noy-db] collection "${collectionName}" declares indexes ${JSON.stringify(fields)} but no indexingStrategy was passed to createNoydb() \u2014 every query on it will scan. Pass \`indexingStrategy: withIndexing()\` from "@noy-db/hub/indexing", or drop the \`indexes:\` declaration if a scan is intended.`
1221
+ );
1222
+ return declared;
1223
+ }
950
1224
 
951
1225
  // src/with-lookup/search/serialize.ts
952
1226
  function serializeIndex(idx) {
953
1227
  return JSON.stringify(idx.toSnapshot());
954
1228
  }
955
1229
  function deserializeIndex(json) {
956
- return InvertedIndex.fromSnapshot(JSON.parse(json));
1230
+ const snap = parseIndexSnapshot(json);
1231
+ return snap === null ? null : InvertedIndex.fromSnapshot(snap);
1232
+ }
1233
+ function parseIndexSnapshot(json) {
1234
+ let raw;
1235
+ try {
1236
+ raw = JSON.parse(json);
1237
+ } catch {
1238
+ return null;
1239
+ }
1240
+ if (typeof raw !== "object" || raw === null) return null;
1241
+ const o = raw;
1242
+ if (o["v"] !== INDEX_SNAPSHOT_VERSION) return null;
1243
+ if (!isStringArray(o["posFields"])) return null;
1244
+ if (!Array.isArray(o["fieldStats"]) || !Array.isArray(o["docs"])) return null;
1245
+ const posFields = new Set(o["posFields"]);
1246
+ const fieldStats = [];
1247
+ for (const e of o["fieldStats"]) {
1248
+ if (!Array.isArray(e) || e.length !== 2 || typeof e[0] !== "string") return null;
1249
+ const s = e[1];
1250
+ if (typeof s !== "object" || s === null) return null;
1251
+ if (!isCountPairs(s["df"]) || !isNonNegInt(s["n"]) || !isNonNegInt(s["totalLen"])) return null;
1252
+ fieldStats.push([e[0], { df: s["df"], n: s["n"], totalLen: s["totalLen"] }]);
1253
+ }
1254
+ const docs = [];
1255
+ for (const e of o["docs"]) {
1256
+ if (typeof e !== "object" || e === null) return null;
1257
+ const d = e;
1258
+ if (typeof d["id"] !== "string" || typeof d["field"] !== "string" || typeof d["text"] !== "string") return null;
1259
+ if (!isNonNegInt(d["len"])) return null;
1260
+ if (d["locale"] !== void 0 && typeof d["locale"] !== "string") return null;
1261
+ if (!isCountPairs(d["tf"]) || !isCountPairs(d["firstOffset"])) return null;
1262
+ const wantsPos = posFields.has(d["field"]);
1263
+ if (wantsPos !== (d["pos"] !== void 0)) return null;
1264
+ let pos;
1265
+ if (d["pos"] !== void 0) {
1266
+ if (!isPositionPairs(d["pos"], d["len"])) return null;
1267
+ pos = d["pos"];
1268
+ }
1269
+ docs.push({
1270
+ id: d["id"],
1271
+ field: d["field"],
1272
+ text: d["text"],
1273
+ len: d["len"],
1274
+ tf: d["tf"],
1275
+ firstOffset: d["firstOffset"],
1276
+ ...d["locale"] !== void 0 ? { locale: d["locale"] } : {},
1277
+ ...pos !== void 0 ? { pos } : {}
1278
+ });
1279
+ }
1280
+ return { v: INDEX_SNAPSHOT_VERSION, posFields: o["posFields"], fieldStats, docs };
1281
+ }
1282
+ function isNonNegInt(x) {
1283
+ return typeof x === "number" && Number.isInteger(x) && x >= 0;
1284
+ }
1285
+ function isStringArray(x) {
1286
+ return Array.isArray(x) && x.every((s) => typeof s === "string");
1287
+ }
1288
+ function isCountPairs(x) {
1289
+ return Array.isArray(x) && x.every((p) => Array.isArray(p) && p.length === 2 && typeof p[0] === "string" && isNonNegInt(p[1]));
1290
+ }
1291
+ function isPositionPairs(x, len) {
1292
+ if (!Array.isArray(x)) return false;
1293
+ for (const p of x) {
1294
+ if (!Array.isArray(p) || p.length !== 2 || typeof p[0] !== "string") return false;
1295
+ const list = p[1];
1296
+ if (!Array.isArray(list) || list.length === 0) return false;
1297
+ let prev = -1;
1298
+ for (const n of list) {
1299
+ if (!isNonNegInt(n) || n <= prev || n >= len) return false;
1300
+ prev = n;
1301
+ }
1302
+ }
1303
+ return true;
957
1304
  }
958
1305
 
959
1306
  // src/with-lookup/search/persisted-index-store.ts
960
- function fpEqual(a, b) {
1307
+ function fpEqual2(a, b) {
961
1308
  return a.count === b.count && a.maxVersion === b.maxVersion;
962
1309
  }
1310
+ function positionsMatch(idx, opts) {
1311
+ const want = new Set(opts?.positions ?? []);
1312
+ const have = idx.positionFields;
1313
+ if (want.size !== have.size) return false;
1314
+ for (const f of want) if (!have.has(f)) return false;
1315
+ return true;
1316
+ }
963
1317
  var PersistedIndexStore = class {
964
1318
  constructor(cb) {
965
1319
  this.cb = cb;
@@ -969,6 +1323,9 @@ var PersistedIndexStore = class {
969
1323
  index;
970
1324
  timer = null;
971
1325
  lastBuild;
1326
+ /** The positional-postings opt-in the last caller asked for (#1354). A loaded
1327
+ * sidecar that does not carry exactly these fields is discarded, not adapted. */
1328
+ lastOpts;
972
1329
  debounceMs;
973
1330
  /**
974
1331
  * Bumped by every purge (removePersisted). A save() captured under a since-stale
@@ -1015,16 +1372,20 @@ var PersistedIndexStore = class {
1015
1372
  get built() {
1016
1373
  return this.index !== void 0;
1017
1374
  }
1018
- async ensureBuilt(build) {
1375
+ async ensureBuilt(build, opts) {
1019
1376
  await this.retryPendingCompensation();
1020
1377
  this.lastBuild = build;
1378
+ this.lastOpts = opts;
1021
1379
  if (this.index !== void 0) return this.index;
1022
1380
  const loaded = await this.cb.load();
1023
- if (loaded !== null && fpEqual(loaded.fingerprint, this.cb.currentFingerprint())) {
1024
- this.index = deserializeIndex(loaded.json);
1025
- return this.index;
1381
+ if (loaded !== null && fpEqual2(loaded.fingerprint, this.cb.currentFingerprint())) {
1382
+ const restored = deserializeIndex(loaded.json);
1383
+ if (restored !== null && positionsMatch(restored, opts)) {
1384
+ this.index = restored;
1385
+ return this.index;
1386
+ }
1026
1387
  }
1027
- this.index = InvertedIndex.build(build());
1388
+ this.index = InvertedIndex.build(build(), opts);
1028
1389
  await this.persist();
1029
1390
  return this.index;
1030
1391
  }
@@ -1071,7 +1432,7 @@ var PersistedIndexStore = class {
1071
1432
  await this.retryPendingCompensation();
1072
1433
  if (this.lastBuild === void 0) return;
1073
1434
  if (this.index === void 0) {
1074
- this.index = InvertedIndex.build(this.lastBuild());
1435
+ this.index = InvertedIndex.build(this.lastBuild(), this.lastOpts);
1075
1436
  }
1076
1437
  await this.persist();
1077
1438
  }
@@ -1114,21 +1475,34 @@ var PersistedIndexStore = class {
1114
1475
 
1115
1476
  // src/with-lookup/indexing/unique-constraints.ts
1116
1477
  var UniqueConstraintSet = class {
1117
- constructor(collectionName, uniqueDefs) {
1478
+ constructor(collectionName, uniqueDefs, enforcement = "prevent", report = () => {
1479
+ }) {
1118
1480
  this.collectionName = collectionName;
1481
+ this.enforcement = enforcement;
1482
+ this.report = report;
1119
1483
  this.constraints = uniqueDefs.map((fields) => ({ fields, map: /* @__PURE__ */ new Map() }));
1120
1484
  }
1121
1485
  collectionName;
1486
+ enforcement;
1487
+ report;
1122
1488
  constraints;
1123
1489
  get size() {
1124
1490
  return this.constraints.length;
1125
1491
  }
1492
+ /** The declared field tuples, in declaration order. */
1493
+ fieldTuples() {
1494
+ return this.constraints.map((c) => c.fields);
1495
+ }
1126
1496
  /**
1127
1497
  * Compute the canonical key for a record under a given constraint.
1128
1498
  * Returns `null` if any constrained field is `null` or `undefined`
1129
1499
  * (the record is exempt — no constraint is checked).
1500
+ *
1501
+ * Public because the tier scan (`with-audit/tiers/index.ts`) has to compute
1502
+ * the same key for a record it decrypted under a tier DEK, which this class
1503
+ * cannot reach — one key function, so the two paths cannot drift.
1130
1504
  */
1131
- keyFor(fields, record) {
1505
+ keyOf(fields, record) {
1132
1506
  const row = {};
1133
1507
  for (const f of fields) {
1134
1508
  const v = readPath(record, f);
@@ -1137,29 +1511,66 @@ var UniqueConstraintSet = class {
1137
1511
  }
1138
1512
  return canonicalGroupKey(fields, row);
1139
1513
  }
1514
+ /**
1515
+ * Every constraint key `record` would occupy — the probe a checker outside
1516
+ * this class (tiers, lazy) compares against its own candidates. Exempt
1517
+ * (null-distinct) constraints are omitted, so an empty result means "this
1518
+ * record is unconstrained" and the caller can skip its scan entirely.
1519
+ */
1520
+ probe(record) {
1521
+ const out = [];
1522
+ for (const c of this.constraints) {
1523
+ const key = this.keyOf(c.fields, record);
1524
+ if (key !== null) out.push({ fields: c.fields, key });
1525
+ }
1526
+ return out;
1527
+ }
1140
1528
  /**
1141
1529
  * Throw `UniqueConstraintError` if writing `id` with `record` would
1142
1530
  * collide with a DIFFERENT existing record. Call BEFORE the store write.
1531
+ *
1532
+ * In `'detect'` mode this is a deliberate NO-OP: a CRDT collection must
1533
+ * not refuse a write it has no authority to refuse (module doc). The
1534
+ * collision is reported from {@link upsert} / {@link build} instead.
1143
1535
  */
1144
1536
  check(id, record) {
1537
+ if (this.enforcement === "detect") return;
1538
+ const clash = this.collision(id, record);
1539
+ if (clash) throw clash;
1540
+ }
1541
+ /**
1542
+ * The `UniqueConstraintError` a write of `id`/`record` would produce, or
1543
+ * `null`. Never throws — the shared core of {@link check} (which throws it)
1544
+ * and the detect path (which reports it).
1545
+ */
1546
+ collision(id, record) {
1145
1547
  for (const c of this.constraints) {
1146
- const key = this.keyFor(c.fields, record);
1548
+ const key = this.keyOf(c.fields, record);
1147
1549
  if (key === null) continue;
1148
1550
  const holder = c.map.get(key);
1149
1551
  if (holder !== void 0 && holder !== id) {
1150
- throw new UniqueConstraintError(this.collectionName, id, c.fields, holder);
1552
+ return new UniqueConstraintError(this.collectionName, id, c.fields, holder);
1151
1553
  }
1152
1554
  }
1555
+ return null;
1153
1556
  }
1154
1557
  /**
1155
1558
  * Update the constraint maps after a successful write.
1156
1559
  * Pass `previous` when updating an existing record (so the old key
1157
1560
  * is removed first). Pass `null` or `undefined` for a fresh insert.
1561
+ *
1562
+ * In `'detect'` mode a collision observed here is REPORTED and the write
1563
+ * still stands (both records are kept — see the module doc). In
1564
+ * `'prevent'` mode `check()` already ran, so there is nothing to report.
1158
1565
  */
1159
1566
  upsert(id, record, previous) {
1160
1567
  if (previous != null) this.remove(id, previous);
1568
+ if (this.enforcement === "detect") {
1569
+ const clash = this.collision(id, record);
1570
+ if (clash) this.report(clash);
1571
+ }
1161
1572
  for (const c of this.constraints) {
1162
- const key = this.keyFor(c.fields, record);
1573
+ const key = this.keyOf(c.fields, record);
1163
1574
  if (key !== null) c.map.set(key, id);
1164
1575
  }
1165
1576
  }
@@ -1169,7 +1580,7 @@ var UniqueConstraintSet = class {
1169
1580
  */
1170
1581
  remove(id, record) {
1171
1582
  for (const c of this.constraints) {
1172
- const key = this.keyFor(c.fields, record);
1583
+ const key = this.keyOf(c.fields, record);
1173
1584
  if (key !== null && c.map.get(key) === id) c.map.delete(key);
1174
1585
  }
1175
1586
  }
@@ -1177,13 +1588,18 @@ var UniqueConstraintSet = class {
1177
1588
  * Rebuild all constraint maps from a full snapshot.
1178
1589
  * Called after hydration (ensureHydrated / hydrateFromSnapshot).
1179
1590
  *
1180
- * **Last-writer-wins**: this method does NOT validate pre-existing data
1181
- * for duplicates. If the store already contains two records sharing a
1182
- * constrained value (written before the unique index was declared), the
1183
- * last one processed wins the map slot and the duplicate is silently
1184
- * displaced — no error is thrown, and the earlier holder is evicted from
1185
- * the map. Callers retrofitting a unique index onto populated data should
1186
- * run a one-time uniqueness scan before relying on enforcement.
1591
+ * **In `'prevent'` mode this is last-writer-wins**: it does NOT validate
1592
+ * pre-existing data for duplicates. If the store already contains two
1593
+ * records sharing a constrained value (written before the unique index was
1594
+ * declared), the last one processed wins the map slot and the duplicate is
1595
+ * silently displaced — no error is thrown, and the earlier holder is
1596
+ * evicted from the map. Callers retrofitting a unique index onto populated
1597
+ * data should run a one-time uniqueness scan before relying on enforcement.
1598
+ *
1599
+ * **In `'detect'` mode this is the MERGE POINT** — the moment a session
1600
+ * that wrote neither record first sees them together (a CRDT replica
1601
+ * opening a store its peer has written to). Every displaced holder is
1602
+ * reported on `unique:violation` instead of being dropped in silence.
1187
1603
  */
1188
1604
  build(entries) {
1189
1605
  for (const c of this.constraints) c.map.clear();
@@ -1192,7 +1608,7 @@ var UniqueConstraintSet = class {
1192
1608
  }
1193
1609
  }
1194
1610
  };
1195
- function buildUniqueConstraintSet(collectionName, indexes, mode) {
1611
+ function buildUniqueConstraintSet(collectionName, indexes, mode, report) {
1196
1612
  const uniqueDefs = [];
1197
1613
  for (const def of indexes ?? []) {
1198
1614
  if (def !== null && typeof def === "object" && !Array.isArray(def) && def.unique === true) {
@@ -1200,25 +1616,7 @@ function buildUniqueConstraintSet(collectionName, indexes, mode) {
1200
1616
  }
1201
1617
  }
1202
1618
  if (uniqueDefs.length === 0) return null;
1203
- if (mode.lazy) {
1204
- throw new UnsupportedIndexOptionError(
1205
- "unique",
1206
- `unique indexes are not yet supported in lazy mode (prefetch:false) \u2014 use the default eager mode. Collection "${collectionName}".`
1207
- );
1208
- }
1209
- if (mode.crdt) {
1210
- throw new UnsupportedIndexOptionError(
1211
- "unique",
1212
- `unique indexes are not supported on CRDT collections (crdt mode is incompatible with eager unique enforcement). Collection "${collectionName}".`
1213
- );
1214
- }
1215
- if (mode.tiered) {
1216
- throw new UnsupportedIndexOptionError(
1217
- "unique",
1218
- `unique indexes are not supported on tiered collections (tier writes use a separate path that bypasses unique enforcement). Collection "${collectionName}".`
1219
- );
1220
- }
1221
- return new UniqueConstraintSet(collectionName, uniqueDefs);
1619
+ return new UniqueConstraintSet(collectionName, uniqueDefs, mode.crdt ? "detect" : "prevent", report);
1222
1620
  }
1223
1621
 
1224
1622
  // src/kernel/put-many-atomic.ts
@@ -1325,7 +1723,7 @@ async function commitSequentially(ctx, entries, priors) {
1325
1723
  }
1326
1724
 
1327
1725
  // src/with-formula/computed/lazy.ts
1328
- var loadComputed = lazy(() => import("./computed-VPOKQK4N.js"));
1726
+ var loadComputed = lazy(() => import("./computed-FAD7SED4.js"));
1329
1727
  async function loadEvalComputedFields() {
1330
1728
  return (await loadComputed()).evalComputedFields;
1331
1729
  }
@@ -1379,7 +1777,18 @@ var Collection = class {
1379
1777
  // In-memory cache of decrypted records (eager mode only). Lazy mode
1380
1778
  // uses `lru` instead. Both fields exist so a single Collection instance
1381
1779
  // doesn't need a runtime branch on every cache access.
1382
- cache = /* @__PURE__ */ new Map();
1780
+ cache = new GenerationMap();
1781
+ /** #1418 — mutation stamp for a derived-output memo, or `null` when one must NOT be used because a redundant re-write would still be observable (gate handler, history, sync, search) or there is no eager cache to stamp. The rules and their measured rationale live with the consumer, `with-formula/materialized-views/emit-memo.ts`. `_`-prefixed deliberately: `kernel-api-surface-golden` freezes the PUBLIC surface and this is an executor seam. @internal */
1782
+ get _cacheStamp() {
1783
+ if (this.lazy) return null;
1784
+ if (this.historyConfigExplicit && this.historyConfig.enabled !== false) return null;
1785
+ if (this.onDirty !== void 0 || this.searchIndexStore !== void 0) return null;
1786
+ return this.cache.generation;
1787
+ }
1788
+ /** #1439 — could a `beforePut` gate fire for THIS row? Asks each handler's declared scope, not merely whether any is registered — the bus is vault-wide, the gates are not. @internal */
1789
+ _derivedWriteGated(record) {
1790
+ return this.subsystemBus?.gateAppliesTo("beforePut", { vault: this.vault, collection: this.name, record }) === true;
1791
+ }
1383
1792
  hydrated = false;
1384
1793
  /**
1385
1794
  * #606: ids known to carry a delete marker in the store — lets the #589
@@ -1494,8 +1903,12 @@ var Collection = class {
1494
1903
  i18nFields;
1495
1904
  /** The configured string fields exposed to `retrieve()`; `undefined` for ordinary collections (zero-cost). */
1496
1905
  textIndexes;
1906
+ /** #1354 — the subset of `textIndexes` carrying positional postings (phrase / proximity). */
1907
+ textIndexPositions;
1497
1908
  /** Session-scoped lexical index store; `undefined` (zero-cost) unless `textIndexes` is non-empty. */
1498
1909
  searchIndexStore;
1910
+ /** Encrypted field-index sidecars (#1359); `null` (zero-cost) unless an index declared `persist: true`. */
1911
+ fieldIndexStore;
1499
1912
  /** Embedding config for write-time vector derivation; `undefined` (zero-cost) for ordinary
1500
1913
  * collections. When set, `put()` encodes the source field(s) and stores an encrypted `_vec` sidecar. */
1501
1914
  embeddings;
@@ -1712,6 +2125,7 @@ var Collection = class {
1712
2125
  this.joinResolver = cfg.joinResolver;
1713
2126
  this.i18nFields = cfg.i18nFields;
1714
2127
  this.textIndexes = cfg.textIndexes;
2128
+ this.textIndexPositions = cfg.textIndexPositions;
1715
2129
  this.searchIndexStore = opts.textIndexes && opts.textIndexes.length > 0 ? opts.textIndexPersist ? new PersistedIndexStore(buildPersistedIndexCallbacks(() => this.searchContext())) : new MemoryIndexStore() : void 0;
1716
2130
  this.embeddings = cfg.embeddings;
1717
2131
  this.vectorSet = cfg.vectorSet;
@@ -1773,6 +2187,8 @@ var Collection = class {
1773
2187
  getDEK: (collection) => this.getDEK(collection ?? this.name),
1774
2188
  cekCache: this.cekCache,
1775
2189
  classifiedMarkerDigestOnly: () => this._classifiedMarkerDigestOnly(),
2190
+ onDecrypt: this.strategies.coverage.observer(this.vault, this.name, this.keyring.userId, () => this.fieldMeta, this.emitter, opts.prefetch !== false),
2191
+ // #1363 read-coverage sensor; NO_COVERAGE returns undefined
1776
2192
  via: this.via
1777
2193
  });
1778
2194
  if (cfg.classifiedEraseCfg) cfg.classifiedEraseCfg.classifySealedShred = (live) => this.codec.classifySealedShred(live);
@@ -1854,14 +2270,15 @@ var Collection = class {
1854
2270
  defs: opts.indexes ?? [],
1855
2271
  lazy: this.lazy
1856
2272
  });
1857
- this.declaredIndexes = normalizeIndexDefs(opts.indexes ?? []);
2273
+ this.declaredIndexes = resolveDeclaredIndexes(opts.indexes ?? [], this.name, this.indexState.isEnabled);
2274
+ this.fieldIndexStore = createPersistedFieldIndexes(() => this.indexingContext(), this.indexes);
1858
2275
  this.indexes?.setCanonicalizer((f, v) => this.via?.canonicalizeIndexKey(f, v));
1859
2276
  this.persistedIndexes?.setCanonicalizer((f, v) => this.via?.canonicalizeIndexKey(f, v));
1860
2277
  this.uniqueConstraints = buildUniqueConstraintSet(this.name, opts.indexes, {
1861
2278
  lazy: this.lazy,
1862
2279
  crdt: this.crdtMode != null,
1863
2280
  tiered: this.tiers != null
1864
- });
2281
+ }, (err) => this.emitter.emit("unique:violation", { vault: this.vault, collection: this.name, id: err.recordId, fields: err.fields, conflictingId: err.conflictingId, error: err }));
1865
2282
  }
1866
2283
  /**
1867
2284
  * Return the Standard Schema validator attached to this collection,
@@ -1889,6 +2306,11 @@ var Collection = class {
1889
2306
  return this.declaredIndexes;
1890
2307
  }
1891
2308
  // declared index defs, normalized; consumed by walk.ts
2309
+ /** #1447 — `field -> via brands covering it`, for `dumpSchema()`. Brand and field only, never a binding's config; see `via/pipeline.ts#fieldCoverage`. Consumed by walk.ts. */
2310
+ getViaCoverage() {
2311
+ const c = this.via?.fieldCoverage();
2312
+ return c && Object.keys(c).length > 0 ? c : void 0;
2313
+ }
1892
2314
  /**
1893
2315
  * Aggregate all collection-level configuration options that are actively set
1894
2316
  * into a {@link CollectionConfig} snapshot. Returns `undefined` when no options
@@ -1994,7 +2416,7 @@ var Collection = class {
1994
2416
  }
1995
2417
  /** JSON Schema for this collection with describe() metadata as x- extensions. */
1996
2418
  async toJSONSchema() {
1997
- const { buildJsonSchema } = await import("./json-schema-V3M5MUCM.js");
2419
+ const { buildJsonSchema } = await import("./json-schema-3SHX72CC.js");
1998
2420
  const desc = await this.describe({});
1999
2421
  let base = null;
2000
2422
  if (this.schema !== void 0) {
@@ -2110,7 +2532,7 @@ var Collection = class {
2110
2532
  }
2111
2533
  await this.onAccess?.("find", "*");
2112
2534
  if (hits.length === 0) return [];
2113
- const { verifyDigestField } = await import("./verify-6MDTIUEV.js");
2535
+ const { verifyDigestField } = await import("./verify-UKALW7C2.js");
2114
2536
  const policy = {
2115
2537
  normalize: spec.verifyNormalize ?? "password",
2116
2538
  notLastN: spec.notLastN ?? 0,
@@ -2322,7 +2744,7 @@ var Collection = class {
2322
2744
  }
2323
2745
  }
2324
2746
  if (this.materializedViewSource !== void 0) {
2325
- const { resolveStaleMVOnRead } = await import("./stale-BZS6H2RY.js");
2747
+ const { resolveStaleMVOnRead } = await import("./stale-6GCFMOOR.js");
2326
2748
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
2327
2749
  }
2328
2750
  let record;
@@ -2439,30 +2861,39 @@ var Collection = class {
2439
2861
  * ORIGIN refresh time across vaults. (FR-4)
2440
2862
  */
2441
2863
  async put(id, record, options) {
2442
- await this.schemaUpdateGate?.assertWritable();
2443
- await this.schemaFence?.assertWritable(this.name);
2864
+ return trackKeyedWrite(this.adapter, this.vault, this.name, id, () => this.#putGated(id, record, options));
2865
+ }
2866
+ /** @internal The body of {@link put}; see the #1420 note there for why it is split. */
2867
+ async #putGated(id, record, options) {
2444
2868
  const hooksActive = this.#hooksActive();
2445
2869
  const busAfterPut = (this.subsystemBus?.hasHandlers("afterPut") ?? false) && !(this.subsystemBus?.dispatching ?? false);
2446
2870
  let event;
2447
- if (hooksActive || busAfterPut) {
2448
- const prior = await this.#priorForHook(id);
2449
- event = {
2450
- op: prior.record === null ? "create" : "update",
2451
- vault: this.vault,
2452
- collection: this.name,
2453
- docId: id,
2454
- before: prior.record,
2455
- after: record,
2456
- userId: this.keyring.userId,
2457
- timestamp: Date.now(),
2458
- txId: this.#txIdForHook(),
2459
- baseVersion: prior.version,
2460
- version: prior.version + 1
2461
- };
2462
- if (hooksActive) await this.writeHooks.runBefore(event);
2463
- }
2464
- if (this.writeQueue) await this.writeQueue.track(() => this._putInternal(id, record, options));
2465
- else await this._putInternal(id, record, options);
2871
+ const gated = async (committed) => {
2872
+ await this.schemaUpdateGate?.assertWritable();
2873
+ await this.schemaFence?.assertWritable(this.name);
2874
+ if (hooksActive || busAfterPut) {
2875
+ const prior = await this.#priorForHook(id);
2876
+ event = {
2877
+ op: prior.record === null ? "create" : "update",
2878
+ vault: this.vault,
2879
+ collection: this.name,
2880
+ docId: id,
2881
+ before: prior.record,
2882
+ after: record,
2883
+ userId: this.keyring.userId,
2884
+ timestamp: Date.now(),
2885
+ txId: this.#txIdForHook(),
2886
+ baseVersion: prior.version,
2887
+ version: prior.version + 1
2888
+ };
2889
+ if (hooksActive) await this.writeHooks.runBefore(event);
2890
+ }
2891
+ committed();
2892
+ await this._putInternal(id, record, options);
2893
+ };
2894
+ if (this.writeQueue) await this.writeQueue.trackGated(gated);
2895
+ else await gated(() => {
2896
+ });
2466
2897
  if (event) {
2467
2898
  if (hooksActive) await this.writeHooks.runAfter(event);
2468
2899
  if (busAfterPut) await this.subsystemBus.dispatch("afterPut", event);
@@ -2805,7 +3236,8 @@ var Collection = class {
2805
3236
  }
2806
3237
  if (priorRaw && isDeleteMarker(priorRaw)) version = priorRaw._v + 1;
2807
3238
  }
2808
- this.uniqueConstraints?.check(id, record);
3239
+ await checkUniqueOnPut(this.indexingContext(), id, record);
3240
+ if (this.tiers !== null && this.uniqueConstraints !== null) await this.strategies.tiers.checkUnique(this.tiersContext(), id, record);
2809
3241
  const cek = this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
2810
3242
  const vdigCtx = this.vdigFields !== null ? { id, prev: await this.adapter.get(this.vault, this.name, id) } : void 0;
2811
3243
  const envelope = await this.codec.encryptRecord({ collection: this.name, id }, record, version, cek, options?.source, options?.sourceTs, vdigCtx);
@@ -2854,7 +3286,7 @@ var Collection = class {
2854
3286
  */
2855
3287
  async dispatchMaterializedViews(id, record, wave) {
2856
3288
  if (this.materializedViewSource === void 0) return;
2857
- const { dispatchMaterializedViews } = await import("./dispatch-IEPAVQUM.js");
3289
+ const { dispatchMaterializedViews } = await import("./dispatch-H4HV32AM.js");
2858
3290
  return dispatchMaterializedViews(this.#mvDispatchCtx(this.materializedViewSource), id, record, wave);
2859
3291
  }
2860
3292
  /**
@@ -3020,13 +3452,13 @@ var Collection = class {
3020
3452
  * dispatch wave's per-target dedup; `undefined` on the local-write path (byte-identical). */
3021
3453
  async dispatchDerivations(id, record, version, wave, prior) {
3022
3454
  if (this.derivationSource === void 0) return;
3023
- const { dispatchDerivations } = await import("./dispatch-Q6MWLOJY.js");
3455
+ const { dispatchDerivations } = await import("./dispatch-JDZNGEB3.js");
3024
3456
  return dispatchDerivations(this.#derivationDispatchCtx(), id, record, version, wave, prior);
3025
3457
  }
3026
3458
  /** @internal — trigger fan-out for a deleted parent (#1249); see dispatch.ts. */
3027
3459
  async dispatchTriggerDerivationsOnDelete(id, deleted) {
3028
3460
  if (this.derivationSource === void 0) return;
3029
- const { dispatchTriggerDerivationsOnDelete } = await import("./dispatch-Q6MWLOJY.js");
3461
+ const { dispatchTriggerDerivationsOnDelete } = await import("./dispatch-JDZNGEB3.js");
3030
3462
  return dispatchTriggerDerivationsOnDelete(this.#derivationDispatchCtx(), id, deleted);
3031
3463
  }
3032
3464
  /**
@@ -3034,30 +3466,39 @@ var Collection = class {
3034
3466
  * so `hub.writeQueue.pending` reflects this write.
3035
3467
  */
3036
3468
  async delete(id) {
3037
- await this.schemaUpdateGate?.assertWritable();
3038
- await this.schemaFence?.assertWritable(this.name);
3469
+ return trackKeyedWrite(this.adapter, this.vault, this.name, id, () => this.#deleteGated(id));
3470
+ }
3471
+ /** @internal The body of {@link delete}; see the #1420 note on {@link put}. */
3472
+ async #deleteGated(id) {
3039
3473
  const hooksActive = this.#hooksActive();
3040
3474
  const busAfterDelete = (this.subsystemBus?.hasHandlers("afterDelete") ?? false) && !(this.subsystemBus?.dispatching ?? false);
3041
3475
  let event;
3042
- if (hooksActive || busAfterDelete) {
3043
- const prior = await this.#priorForHook(id);
3044
- event = {
3045
- op: "delete",
3046
- vault: this.vault,
3047
- collection: this.name,
3048
- docId: id,
3049
- before: prior.record,
3050
- after: null,
3051
- userId: this.keyring.userId,
3052
- timestamp: Date.now(),
3053
- txId: this.#txIdForHook(),
3054
- baseVersion: prior.version,
3055
- version: prior.version + 1
3056
- };
3057
- if (hooksActive) await this.writeHooks.runBefore(event);
3058
- }
3059
- if (this.writeQueue) await this.writeQueue.track(() => this._deleteInternal(id));
3060
- else await this._deleteInternal(id);
3476
+ const gated = async (committed) => {
3477
+ await this.schemaUpdateGate?.assertWritable();
3478
+ await this.schemaFence?.assertWritable(this.name);
3479
+ if (hooksActive || busAfterDelete) {
3480
+ const prior = await this.#priorForHook(id);
3481
+ event = {
3482
+ op: "delete",
3483
+ vault: this.vault,
3484
+ collection: this.name,
3485
+ docId: id,
3486
+ before: prior.record,
3487
+ after: null,
3488
+ userId: this.keyring.userId,
3489
+ timestamp: Date.now(),
3490
+ txId: this.#txIdForHook(),
3491
+ baseVersion: prior.version,
3492
+ version: prior.version + 1
3493
+ };
3494
+ if (hooksActive) await this.writeHooks.runBefore(event);
3495
+ }
3496
+ committed();
3497
+ await this._deleteInternal(id);
3498
+ };
3499
+ if (this.writeQueue) await this.writeQueue.trackGated(gated);
3500
+ else await gated(() => {
3501
+ });
3061
3502
  if (event) {
3062
3503
  if (hooksActive) await this.writeHooks.runAfter(event);
3063
3504
  if (busAfterDelete) await this.subsystemBus.dispatch("afterDelete", event);
@@ -3246,6 +3687,7 @@ var Collection = class {
3246
3687
  if (persist) await this.adapter.put(this.vault, this.name, id, marker);
3247
3688
  this.markerIds.add(id);
3248
3689
  } else if (persist) await this.adapter.delete(this.vault, this.name, id);
3690
+ if (this.strategies.blobs !== NO_BLOBS) await this.blob(id).releaseAll();
3249
3691
  if (this.ledger) {
3250
3692
  await this.ledger.append({ op: "delete", collection: this.name, id, version: existing?.version ?? 0, actor: this.keyring.userId, payloadHash: previousPayloadHash });
3251
3693
  }
@@ -3338,7 +3780,7 @@ var Collection = class {
3338
3780
  */
3339
3781
  async dispatchArrayDerivationsOnDelete(id, eraseRecordShapeToo = false) {
3340
3782
  if (this.derivationSource === void 0) return 0;
3341
- const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-Q6MWLOJY.js");
3783
+ const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-JDZNGEB3.js");
3342
3784
  return dispatchArrayDerivationsOnDelete(this.#derivationDeleteCtx(this.derivationSource), id, eraseRecordShapeToo);
3343
3785
  }
3344
3786
  /**
@@ -3352,7 +3794,7 @@ var Collection = class {
3352
3794
  */
3353
3795
  async dispatchMaterializedViewsOnDelete(id) {
3354
3796
  if (this.materializedViewSource === void 0) return { deleted: 0, residueUndecodable: [], residueDeclined: [] };
3355
- const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-IEPAVQUM.js");
3797
+ const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-H4HV32AM.js");
3356
3798
  return dispatchMaterializedViewsOnDelete(this.#mvDispatchCtx(this.materializedViewSource), id);
3357
3799
  }
3358
3800
  /**
@@ -3372,7 +3814,7 @@ var Collection = class {
3372
3814
  );
3373
3815
  }
3374
3816
  if (this.materializedViewSource !== void 0) {
3375
- const { resolveStaleMVOnRead } = await import("./stale-BZS6H2RY.js");
3817
+ const { resolveStaleMVOnRead } = await import("./stale-6GCFMOOR.js");
3376
3818
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
3377
3819
  }
3378
3820
  await this.ensureHydrated();
@@ -3430,6 +3872,7 @@ var Collection = class {
3430
3872
  cache: this.cache,
3431
3873
  lazy: this.lazy,
3432
3874
  textIndexes: this.textIndexes,
3875
+ textIndexPositions: this.textIndexPositions,
3433
3876
  i18nFields: this.i18nFields,
3434
3877
  dictKeyFields: this.dictKeyFields,
3435
3878
  blobFields: this.blobFields,
@@ -3555,7 +3998,7 @@ var Collection = class {
3555
3998
  subscribe: (cb) => {
3556
3999
  const handler = (event) => {
3557
4000
  if (event.vault === this.vault && event.collection === this.name) {
3558
- cb();
4001
+ cb(event.remote === true ? void 0 : { id: event.id, action: event.action });
3559
4002
  }
3560
4003
  };
3561
4004
  this.emitter.on("change", handler);
@@ -3567,6 +4010,11 @@ var Collection = class {
3567
4010
  getIndexes: () => this.getIndexes(),
3568
4011
  lookupById: (id) => this.cache.get(id)?.record,
3569
4012
  snapshotEntries: () => [...this.cache.entries()].map(([id, e]) => ({ id, record: e.record })),
4013
+ // Binds a keyset cursor to this collection (#1346).
4014
+ identity: `${this.vault}/${this.name}`,
4015
+ snapshotVersion: () => this.cache.generation,
4016
+ hydration: { label: `${this.vault}/${this.name}`, collection: this.name, isHydrated: () => this.hydrated, hydrate: () => this.ensureHydrated() },
4017
+ // #1414 — a never-read eager collection answers by ABSENCE; the gate makes every terminal await-able and refuse a synchronous read (query/hydration.ts)
3570
4018
  ...this.via ? { via: this.via } : {}
3571
4019
  };
3572
4020
  const resolver = this.joinResolver;
@@ -3658,6 +4106,8 @@ var Collection = class {
3658
4106
  return {
3659
4107
  snapshot: () => [...this.cache.values()].map((e) => e.record),
3660
4108
  lookupById: (id) => this.cache.get(id)?.record,
4109
+ snapshotEntries: () => [...this.cache.entries()].map(([id, e]) => ({ id, record: e.record })),
4110
+ // #1289 right/full outer join — the id is the cache KEY, not a field on the record; same `this.cache` closure as snapshot(), so the two views cannot disagree
3661
4111
  subscribe: (cb) => {
3662
4112
  const handler = (event) => {
3663
4113
  if (event.vault === this.vault && event.collection === this.name) {
@@ -3668,7 +4118,10 @@ var Collection = class {
3668
4118
  return () => this.emitter.off("change", handler);
3669
4119
  },
3670
4120
  // Sync join dressing (#650 Task 6, #626 retirement) — i18n-text + lookup-label, from this collection's own bindings.
3671
- ...this.presentForJoin !== void 0 ? { presentForJoin: this.presentForJoin } : {}
4121
+ ...this.presentForJoin !== void 0 ? { presentForJoin: this.presentForJoin } : {},
4122
+ decodeResults: (record) => this.via && this.via.hasResultDecode ? this.via.decodeResults(record) : record,
4123
+ via: () => this.via
4124
+ // #1289 Via result decode for a record served under an ALIAS, and #1337/#1338's `via()` — the pipeline ITSELF, for a record ORDERED (compareForOrder) or REDUCED (wrapReducers) under one. Contract + rationale on JoinableSource in query/join.ts. Both read `this.via` per call, never a captured value: _applyMoneyFields rebuilds the pipeline after this source is handed out — which is also why `via` is a thunk and not a property
3672
4125
  };
3673
4126
  }
3674
4127
  /**
@@ -4006,6 +4459,15 @@ var Collection = class {
4006
4459
  async _applyRemoteChange(id, action) {
4007
4460
  await this._onRecordMutated(id, action, "tab-mirror");
4008
4461
  }
4462
+ /** @internal #1362 — same as {@link _applyRemoteChange}, for a frame that carries NO verb.
4463
+ * A peer's claim about the verb is not evidence; the re-read decides it, exactly as
4464
+ * `_compensateRevertedWrite` does. Untrusted ingress is why the frame omits it. */
4465
+ async _applyRemoteSignal(id) {
4466
+ await this._invalidateCacheEntry(id);
4467
+ const action = await this.get(id) !== null ? "put" : "delete";
4468
+ this.emitter.emit("change", { vault: this.vault, collection: this.name, id, action, remote: true });
4469
+ this.searchIndexStore?.markDirty();
4470
+ }
4009
4471
  /**
4010
4472
  * Origin-tagged mutation choke point (#623 task 10) — the single dispatch
4011
4473
  * point every put/delete path funnels through, AFTER its own store write,
@@ -4035,6 +4497,7 @@ var Collection = class {
4035
4497
  await this.onDirty?.(this.name, id, "put", version);
4036
4498
  this.emitter.emit("change", { vault: this.vault, collection: this.name, id, action: "put" });
4037
4499
  this.searchIndexStore?.markDirty();
4500
+ this.fieldIndexStore?.markDirty();
4038
4501
  await this.onAccess?.("put", id);
4039
4502
  await this.dispatchDerivations(id, record, version, void 0, ctx.prior);
4040
4503
  await this.dispatchMaterializedViews(id, record);
@@ -4044,13 +4507,15 @@ var Collection = class {
4044
4507
  await this.onDirty?.(this.name, id, "put", ctx.version);
4045
4508
  this.emitter.emit("change", { vault: this.vault, collection: this.name, id, action: "delete" });
4046
4509
  this.searchIndexStore?.markDirty();
4510
+ this.fieldIndexStore?.markDirty();
4047
4511
  await this.onAccess?.("delete", id);
4048
4512
  return;
4049
4513
  }
4050
4514
  case "tab-mirror":
4051
4515
  await this._invalidateCacheEntry(id);
4052
- this.emitter.emit("change", { vault: this.vault, collection: this.name, id, action });
4516
+ this.emitter.emit("change", { vault: this.vault, collection: this.name, id, action, remote: true });
4053
4517
  this.searchIndexStore?.markDirty();
4518
+ this.fieldIndexStore?.markDirty();
4054
4519
  return;
4055
4520
  case "sync-apply": {
4056
4521
  this._invalidateCekCacheEntry(id);
@@ -4088,7 +4553,7 @@ var Collection = class {
4088
4553
  }
4089
4554
  }
4090
4555
  this.hydrated = true;
4091
- this.rebuildEagerIndexesFromCache();
4556
+ await hydrateEagerIndexes(this.indexingContext());
4092
4557
  this.rebuildUniqueConstraintsFromCache();
4093
4558
  }
4094
4559
  /** Hydrate from a pre-loaded snapshot (used by Vault). */
@@ -4104,7 +4569,7 @@ var Collection = class {
4104
4569
  this.cache.set(id, { record, version: envelope._v });
4105
4570
  }
4106
4571
  this.hydrated = true;
4107
- this.rebuildEagerIndexesFromCache();
4572
+ await hydrateEagerIndexes(this.indexingContext());
4108
4573
  this.rebuildUniqueConstraintsFromCache();
4109
4574
  }
4110
4575
  /**
@@ -4222,10 +4687,39 @@ var Collection = class {
4222
4687
  tiersActive: this.tiers !== null,
4223
4688
  keyring: this.keyring,
4224
4689
  debugPlaintext: this.keyring.debugPlaintext === true,
4690
+ assertOwnerWritable: () => this._assertRecordMutable(id),
4691
+ // #1452
4225
4692
  ...this.objectStore !== void 0 ? { objectStore: this.objectStore } : {},
4226
4693
  ...this.blobFields !== void 0 ? { blobFields: this.blobFields } : {}
4227
4694
  });
4228
4695
  }
4696
+ /**
4697
+ * #1452 — would an update of record `id` pass the `beforePut` gate bus right
4698
+ * now? Runs the bus with `incoming = existing`, so closed periods and record
4699
+ * guards refuse an attachment change exactly as they would refuse the
4700
+ * record's own update. A record with no stored body (never written, marker,
4701
+ * elevated tier) is not gated — attaching before the first `put()` was
4702
+ * always allowed. @internal
4703
+ */
4704
+ async _assertRecordMutable(id) {
4705
+ if (!this.subsystemBus?.hasGateHandlers("beforePut")) return;
4706
+ const { env, record } = await this.resolveGatePrior("beforePut", id);
4707
+ if (!env || record === null || record === void 0) return;
4708
+ const existing = this.via ? this.via.canonicalizeStored(record) : record;
4709
+ await this.subsystemBus.dispatchGate("beforePut", {
4710
+ op: "update",
4711
+ vault: this.vault,
4712
+ collection: this.name,
4713
+ docId: id,
4714
+ incoming: existing,
4715
+ existing,
4716
+ existingVersion: env._v,
4717
+ existingTs: env._ts,
4718
+ userId: this.keyring.userId,
4719
+ role: this.keyring.role,
4720
+ ...this.computed !== void 0 ? { computedFieldNames: new Set(Object.keys(this.computed)) } : {}
4721
+ });
4722
+ }
4229
4723
  /** Get all records as encrypted envelopes (for dump). */
4230
4724
  async dumpEnvelopes() {
4231
4725
  await this.ensureHydrated();
@@ -4258,9 +4752,8 @@ var Collection = class {
4258
4752
  if (!this.via) return record;
4259
4753
  const locale = localeOpts?.locale ?? this.defaultLocale;
4260
4754
  const layer = localeOpts?._layer ?? "read";
4261
- let result = record;
4262
- result = await this.via.present(result, { locale, ...localeOpts?.fallback !== void 0 ? { fallback: localeOpts.fallback } : {}, layer });
4263
- return result;
4755
+ const via = this.via;
4756
+ return memoizePresent(record, presentVariantKey(locale, layer, localeOpts?.fallback), async () => await via.present(record, { locale, ...localeOpts?.fallback !== void 0 ? { fallback: localeOpts.fallback } : {}, layer }));
4264
4757
  }
4265
4758
  /**
4266
4759
  * Low-level: encrypt a pre-serialised JSON string into an EncryptedEnvelope.
@@ -4314,7 +4807,11 @@ var Collection = class {
4314
4807
  * Called by vault.ts forget() inside a resilient try/catch; residue is reported in ForgetResult. */
4315
4808
  async _purgeVector(id) {
4316
4809
  await this.adapter.delete(this.vault, "_vec", encodeVecId(this.name, id));
4317
- this.vectorSet?.markDirty();
4810
+ this.vectorSet?.removeRecord(id);
4811
+ }
4812
+ /** @internal #1359 — force an immediate sidecar write, cancelling the debounce. No-op when none opted in. */
4813
+ async _flushFieldIndexes() {
4814
+ await this.fieldIndexStore?.flush();
4318
4815
  }
4319
4816
  /** Drop the persisted lexical-index blob (forget/erasure): an opaque
4320
4817
  * all-records index must not survive crypto-shred. Idempotent; no-op without persist. */
@@ -4482,14 +4979,14 @@ var Collection = class {
4482
4979
  /** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
4483
4980
  async _ensureClassifiedMarker() {
4484
4981
  if (this._markerPersisted || this.vdigFields === null) return;
4485
- const { persistClassifiedMarkerForFields } = await import("./classified-marker-BWOFVYAC.js");
4982
+ const { persistClassifiedMarkerForFields } = await import("./classified-marker-SIYKUU5L.js");
4486
4983
  await persistClassifiedMarkerForFields(this.adapter, this.vault, this.name, this.vdigFields, await this.getDEK(this.name));
4487
4984
  this._markerPersisted = true;
4488
4985
  }
4489
4986
  /** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
4490
4987
  async _classifiedMarkerDigestOnly() {
4491
4988
  if (this._markerDigestOnlyCache !== void 0) return this._markerDigestOnlyCache;
4492
- const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-BWOFVYAC.js");
4989
+ const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-SIYKUU5L.js");
4493
4990
  this._markerDigestOnlyCache = await readClassifiedMarkerDigestOnly(this.adapter, this.vault, this.name, await this.getDEK(this.name));
4494
4991
  return this._markerDigestOnlyCache;
4495
4992
  }
@@ -4663,7 +5160,10 @@ var Collection = class {
4663
5160
  tierMode: this.tierMode,
4664
5161
  getDEK: (key) => this.getDEK(key),
4665
5162
  emitCrossTierEvent: (event) => this.emitCrossTierEvent(event),
4666
- addSubjectRef: (id, record) => this.addSubjectRef?.(id, record) ?? Promise.resolve()
5163
+ addSubjectRef: (id, record) => this.addSubjectRef?.(id, record) ?? Promise.resolve(),
5164
+ // #1358 — undefined on a collection with no `unique` index, which is what keeps the tier scan free everywhere else.
5165
+ uniqueKeys: this.uniqueConstraints ? (record) => this.uniqueConstraints.probe(record) : void 0,
5166
+ checkUniqueLocal: this.uniqueConstraints ? (id, record) => checkUniqueOnPut(this.indexingContext(), id, record) : void 0
4667
5167
  };
4668
5168
  }
4669
5169
  /**
@@ -4684,6 +5184,7 @@ var Collection = class {
4684
5184
  indexes: this.indexes,
4685
5185
  uniqueConstraints: this.uniqueConstraints,
4686
5186
  persistedIndexes: this.persistedIndexes,
5187
+ fieldIndexes: this.fieldIndexStore,
4687
5188
  ensureHydrated: () => this.ensureHydrated(),
4688
5189
  ensurePersistedIndexesLoaded: () => this.ensurePersistedIndexesLoaded(),
4689
5190
  setPersistedIndexesLoaded: (value) => {
@@ -4693,6 +5194,18 @@ var Collection = class {
4693
5194
  }
4694
5195
  };
4695
5196
 
5197
+ // src/with-audit/periods/reserved-collections.ts
5198
+ var PERIODS_RESERVED_COLLECTIONS = /* @__PURE__ */ new Set([
5199
+ PERIODS_COLLECTION,
5200
+ PERIOD_FREEZES_COLLECTION,
5201
+ PERIOD_ARCHIVES_COLLECTION,
5202
+ PERIOD_TARGET_PURGES_COLLECTION,
5203
+ PERIOD_REOPENS_COLLECTION
5204
+ ]);
5205
+ function isPeriodsReservedCollection(name) {
5206
+ return PERIODS_RESERVED_COLLECTIONS.has(name);
5207
+ }
5208
+
4696
5209
  // src/port/with/capabilities.ts
4697
5210
  function assertCanExport(keyring, tier, format) {
4698
5211
  if (tier === "plaintext") {
@@ -4927,7 +5440,7 @@ var DeferredNumberingStore = class {
4927
5440
  async readJson(collection, id) {
4928
5441
  const env = await this.adapter.get(this.vault, collection, id);
4929
5442
  if (!env) return { env: null, value: null };
4930
- const json = this.encrypted ? await openEnvelopeJson({ collection, id }, env, await this.dek(collection)) : env._data;
5443
+ const json = this.encrypted ? await openEnvelopeJson({ collection, id }, env, await this.dek(collection)) : env._data ?? "";
4931
5444
  return { env, value: JSON.parse(json) };
4932
5445
  }
4933
5446
  async writeJson(collection, id, value, expectedVersion) {
@@ -5065,8 +5578,8 @@ var VaultPeriods = class {
5065
5578
  async closePeriod(options) {
5066
5579
  const existing = await this.loadPeriodsCache();
5067
5580
  this.deps.strategy.validatePeriodName(options.name, existing, options.partition);
5068
- if (typeof options.endDate !== "string" || options.endDate.length === 0) {
5069
- throw new ValidationError("closePeriod: endDate must be a non-empty ISO string.");
5581
+ if (typeof options.endDate !== "string" || !isOrderableBusinessDate(options.endDate)) {
5582
+ throw typeof options.endDate === "string" ? malformedBusinessDate("closePeriod: endDate", options.endDate) : new ValidationError("closePeriod: endDate must be a non-empty ISO string.");
5070
5583
  }
5071
5584
  const anchor = await this.deps.strategy.chainAnchor(existing, options.partition);
5072
5585
  const record = {
@@ -5481,6 +5994,32 @@ var VaultPeriods = class {
5481
5994
  findPeriod(all, name, options) {
5482
5995
  return all.find((p) => p.name === name && samePartition(p.partition, options?.partition));
5483
5996
  }
5997
+ /**
5998
+ * #1439 — could a closed period govern this record? Synchronous, and
5999
+ * deliberately a SUPERSET of what {@link assertTsWritable} would refuse.
6000
+ *
6001
+ * Exists so a caller can tell "the period gate is registered" from "the
6002
+ * period gate can fire for this row". Those were conflated, and the cost was
6003
+ * that installing `withPeriods()` disabled an unrelated optimisation for
6004
+ * every collection in the vault — with no period closed and no collection
6005
+ * registered as a subject (#1439, measured: 0 → 250 redundant MV writes per
6006
+ * source write).
6007
+ *
6008
+ * ⛔ Answers `true` whenever it cannot rule the gate out: the cache is not
6009
+ * loaded yet, a closed period has no `dateField` to test against, or no row
6010
+ * was supplied. A predicate that exists to permit an optimisation must fail
6011
+ * towards "the gate applies", never away from it.
6012
+ */
6013
+ couldGovern(record) {
6014
+ if (this.periodCache === null) return true;
6015
+ const now = (/* @__PURE__ */ new Date()).toISOString();
6016
+ for (const p of this.periodCache) {
6017
+ if (p.kind !== "closed" || isEffectivelyReopened(p, now)) continue;
6018
+ if (!p.dateField || record === void 0) return true;
6019
+ if (record[p.dateField] !== void 0 && record[p.dateField] !== null) return true;
6020
+ }
6021
+ return false;
6022
+ }
5484
6023
  /** Called by the gate bus before put/delete. `collection` selects the subject mapping (#1005). */
5485
6024
  async assertTsWritable(existing, incoming, collection) {
5486
6025
  if (existing === null && incoming === null) return;
@@ -5533,7 +6072,7 @@ var VaultPeriods = class {
5533
6072
  async readReserved(collection, key) {
5534
6073
  const env = await this.deps.adapter.get(this.deps.vault, collection, key);
5535
6074
  if (!env) return null;
5536
- const json = this.deps.encrypted ? await openEnvelopeJson({ collection, id: key }, env, await this.deps.getDEK(collection)) : env._data;
6075
+ const json = this.deps.encrypted ? await openEnvelopeJson({ collection, id: key }, env, await this.deps.getDEK(collection)) : env._data ?? "";
5537
6076
  return JSON.parse(json);
5538
6077
  }
5539
6078
  async decryptPeriodRecord(periodId, envelope) {
@@ -5542,7 +6081,7 @@ var VaultPeriods = class {
5542
6081
  const dek = await this.deps.getDEK(PERIODS_COLLECTION);
5543
6082
  json = await openEnvelopeJson({ collection: PERIODS_COLLECTION, id: periodId }, envelope, dek);
5544
6083
  } else {
5545
- json = envelope._data;
6084
+ json = envelope._data ?? "";
5546
6085
  }
5547
6086
  return JSON.parse(json);
5548
6087
  }
@@ -6115,7 +6654,7 @@ var VaultLinks = class {
6115
6654
  // src/with-shape/links/lazy-handle.ts
6116
6655
  function makeLazyLinkSetHandle(d) {
6117
6656
  let engine = null;
6118
- const load = () => engine ??= import("./link-set-2TTM3IZC.js").then(
6657
+ const load = () => engine ??= import("./link-set-MFXC24VK.js").then(
6119
6658
  ({ LinkSet }) => new LinkSet(d.adapter, d.vault, d.name, d.spec, d.encrypted, d.getDEK, d.actor, d.emitter, d.endpointExists)
6120
6659
  );
6121
6660
  return {
@@ -6766,7 +7305,7 @@ function declareSatellite(ctx, collectionName, options, existingRegistry) {
6766
7305
  ctx.forEachSyncEngine((e) => e.remirrorPairResolvers([spec.base, spec.satellite]));
6767
7306
  const registry = reg;
6768
7307
  const baseSchema = ctx.getBaseSchema(spec.base);
6769
- void import("./post-register-3IPCSG6Q.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
7308
+ void import("./post-register-7ND27CF2.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
6770
7309
  });
6771
7310
  return reg;
6772
7311
  }
@@ -6956,7 +7495,7 @@ function makeSatelliteProxy(target, spec, registry) {
6956
7495
  return filterLiveHits(hits, adapter, vaultName, spec.base);
6957
7496
  },
6958
7497
  // #591 Task 9 review fix: findByDet/queryByDet scan envelopes straight
6959
- // off the adapter (kernel/enclave/record-keys/deterministic.ts) and
7498
+ // off the adapter (capsule/plumbing/deterministic.ts) and
6960
7499
  // return BARE records (no id), so a post-filter can't correlate a match
6961
7500
  // back to its base row. Instead the scan itself is scoped: re-run the
6962
7501
  // same det functions over the collection's own DeterministicContext
@@ -7305,6 +7844,7 @@ var COLLECTION_PASSTHROUGH_KEYS = [
7305
7844
  "i18nFields",
7306
7845
  "embeddings",
7307
7846
  "textIndexes",
7847
+ "textIndexPositions",
7308
7848
  "warmIndexOnOpen",
7309
7849
  "textIndexPersist",
7310
7850
  "moneyFields",
@@ -7696,6 +8236,7 @@ var Vault = class {
7696
8236
  if (collectionName === SEQUENCE_COLLECTION) throw new ReservedCollectionNameError(collectionName);
7697
8237
  if (isLinkCollectionName(collectionName)) throw new ReservedCollectionNameError(collectionName);
7698
8238
  if (isSecretBearingReservedCollection(collectionName) || isManifestReservedCollection(collectionName)) throw new ReservedCollectionNameError(collectionName);
8239
+ if (isPeriodsReservedCollection(collectionName)) throw new ReservedCollectionNameError(collectionName);
7699
8240
  if (this.satelliteRegistry?.byJoined(collectionName)) {
7700
8241
  throw new SatelliteConfigError(`"${collectionName}" is a joined handle \u2014 use vault.joined('${collectionName}'), not vault.collection().`);
7701
8242
  }
@@ -7741,7 +8282,7 @@ var Vault = class {
7741
8282
  const strategies = options.schemaUpdate ?? [];
7742
8283
  const work = (async () => {
7743
8284
  const dek = await this.getDEK(collectionName);
7744
- const { persistSchemaIfNeeded } = await import("./register-HHLXEQDN.js");
8285
+ const { persistSchemaIfNeeded } = await import("./register-DT5HZ2LZ.js");
7745
8286
  const result = await persistSchemaIfNeeded({
7746
8287
  store: this.adapter,
7747
8288
  vault: this.name,
@@ -7891,7 +8432,7 @@ var Vault = class {
7891
8432
  const work = (async () => {
7892
8433
  try {
7893
8434
  const dek = await this.getDEK(collectionName);
7894
- await (await import("./register-HHLXEQDN.js")).persistSchemaIfNeeded({
8435
+ await (await import("./register-DT5HZ2LZ.js")).persistSchemaIfNeeded({
7895
8436
  store: this.adapter,
7896
8437
  vault: this.name,
7897
8438
  collectionName,
@@ -7937,7 +8478,7 @@ var Vault = class {
7937
8478
  * writes (unfenced walk — see `with-shape/satellites/migrate-cek.ts`); resumable.
7938
8479
  */
7939
8480
  async migrateSatellitePerRecordKeys(satelliteName) {
7940
- const { migrateSatelliteCek } = await import("./migrate-cek-5ENH64AA.js");
8481
+ const { migrateSatelliteCek } = await import("./migrate-cek-DZRFFOHW.js");
7941
8482
  return migrateSatelliteCek(satelliteName, this.collection(satelliteName, { perRecordKeys: true }));
7942
8483
  }
7943
8484
  /**
@@ -7980,6 +8521,10 @@ var Vault = class {
7980
8521
  if (!coll) return;
7981
8522
  await coll._applyRemoteChange(docId, action);
7982
8523
  }
8524
+ /** @internal #1362 — verb-less variant; no-op for a collection this instance never opened. */
8525
+ async _applyRemoteSignal(collectionName, docId) {
8526
+ await this.collectionCache.get(collectionName)?._applyRemoteSignal(docId);
8527
+ }
7983
8528
  /** @internal #598: refresh cache entries a sync-applied write rewrote underneath us. No-op if not loaded this session.
7984
8529
  * #650 Task 4 (#647): a reserved-lookup collection has no `Collection` instance — instead, refresh
7985
8530
  * its already-warmed `LookupHandle._syncCache` (membership/altIndex/snapshot reads never see a
@@ -8236,7 +8781,7 @@ var Vault = class {
8236
8781
  },
8237
8782
  emitter: this.emitter,
8238
8783
  buildDeleteMarker,
8239
- // #647 fix wave 1 — real kernel/enclave builder; LookupHandle can't import it directly
8784
+ // #647 fix wave 1 — real capsule/enclave-aes builder; LookupHandle can't import it directly
8240
8785
  // #650 Task 4 (#647) — choke-point participation for LOCAL writes: dirty-log tracking + a
8241
8786
  // one-shot graph-dispatch wave (local-write's `graphDispatch.collect`-equivalent; Task 5's ref edges give it dependents).
8242
8787
  onDirty: this.onDirty,
@@ -8568,7 +9113,7 @@ var Vault = class {
8568
9113
  */
8569
9114
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
8570
9115
  async _loadPodSigner() {
8571
- const { loadSigner } = await import("./signer-SJQJVSM6.js");
9116
+ const { loadSigner } = await import("./signer-MHGW3OIL.js");
8572
9117
  return loadSigner(this.adapter, this.name, this.getDEK);
8573
9118
  }
8574
9119
  async writeExportAudit(entry) {
@@ -8600,7 +9145,7 @@ var Vault = class {
8600
9145
  */
8601
9146
  async _decryptEnvelopeForBundleFilter(env, collectionName, recordId) {
8602
9147
  if (!this.encrypted) {
8603
- return JSON.parse(env._data);
9148
+ return JSON.parse(env._data ?? "");
8604
9149
  }
8605
9150
  const dek = await this.getDEK(collectionName);
8606
9151
  const json = await openEnvelopeJson({ collection: collectionName, id: recordId }, env, dek);
@@ -9058,7 +9603,7 @@ var Vault = class {
9058
9603
  async _initGuards(handles) {
9059
9604
  if (handles.length === 0) return;
9060
9605
  const [{ GuardRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
9061
- import("./registry-4AYVUNXK.js"),
9606
+ import("./registry-BHRZGZHF.js"),
9062
9607
  import("./read-only-facade-BIGO37U3.js")
9063
9608
  ]);
9064
9609
  const registry = new GuardRegistry();
@@ -9086,7 +9631,7 @@ var Vault = class {
9086
9631
  async _initDerivations(handles) {
9087
9632
  if (handles.length === 0) return;
9088
9633
  const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
9089
- import("./registry-XX2Z7B46.js"),
9634
+ import("./registry-ET6ZFFWA.js"),
9090
9635
  import("./read-only-facade-BIGO37U3.js")
9091
9636
  ]);
9092
9637
  const registry = new DerivationRegistry();
@@ -9118,7 +9663,7 @@ var Vault = class {
9118
9663
  */
9119
9664
  async _initMaterializedViews(handles) {
9120
9665
  if (handles.length === 0) return;
9121
- const { MaterializedViewRegistry } = await import("./registry-JS3YFQQM.js");
9666
+ const { MaterializedViewRegistry } = await import("./registry-THCPDEOD.js");
9122
9667
  const registry = new MaterializedViewRegistry();
9123
9668
  this.materializedViewRegistry = registry;
9124
9669
  const db = this;
@@ -9143,7 +9688,7 @@ var Vault = class {
9143
9688
  */
9144
9689
  async _initOverlayedViews(handles) {
9145
9690
  if (handles.length === 0) return;
9146
- const { OverlayedViewRegistry } = await import("./registry-23WF3TGH.js");
9691
+ const { OverlayedViewRegistry } = await import("./registry-HXFGLGTG.js");
9147
9692
  const registry = new OverlayedViewRegistry();
9148
9693
  const mvRegistry = this.materializedViewRegistry;
9149
9694
  const overlayNames = /* @__PURE__ */ new Set();
@@ -9193,27 +9738,27 @@ var Vault = class {
9193
9738
  /**
9194
9739
  * Manual re-materialize for a single registered MV (`refresh: 'manual'` consumers,
9195
9740
  * stale-bit recovery on vault reopen, bulk-recompute escape hatch after a strategy
9196
- * change). Returns `{ written, deleted, failed, residueUndecodable, residueDeclined }` (`deleted`
9197
- * always 0 without tombstoning; #785 splits the #782 leftovers — undecodable vs #718-declined). Throws if not registered.
9741
+ * change). Returns `{ written, skipped, deleted, failed, residueUndecodable, residueDeclined }` (`skipped` counts rows whose
9742
+ * content was unchanged since the last refresh, #1418; `deleted` always 0 without tombstoning; #785 splits the #782 leftovers — undecodable vs #718-declined). Throws if not registered.
9198
9743
  */
9199
9744
  async refreshView(name) {
9200
9745
  const registry = this.materializedViewRegistry;
9201
9746
  if (registry === null) {
9202
- return { written: 0, deleted: 0, failed: 0, residueUndecodable: [], residueDeclined: [] };
9747
+ return { written: 0, skipped: 0, deleted: 0, failed: 0, residueUndecodable: [], residueDeclined: [] };
9203
9748
  }
9204
9749
  await registry.resolvePendingPlans();
9205
9750
  const reg = registry.byName(name);
9206
9751
  if (!reg) {
9207
9752
  throw new Error(`refreshView: no MV registered with name "${name}"`);
9208
9753
  }
9209
- const { MaterializedViewExecutor } = await import("./executor-7UQ3BZ4F.js");
9754
+ const { MaterializedViewExecutor } = await import("./executor-FMPVN6DT.js");
9210
9755
  const result = await MaterializedViewExecutor.refresh(reg, {
9211
9756
  getCollection: (n) => this.collection(n),
9212
9757
  getActiveTxContext: () => this.noydb._activeTxContextOrNull,
9213
9758
  getQueryContext: () => this,
9214
9759
  dispatchCtx: this._dispatchCtx({ collection: name, id: "refreshView" })
9215
9760
  });
9216
- const { clearMVStaleFully } = await import("./stale-BZS6H2RY.js");
9761
+ const { clearMVStaleFully } = await import("./stale-6GCFMOOR.js");
9217
9762
  await clearMVStaleFully(this.adapter, this.name, registry, name);
9218
9763
  return result;
9219
9764
  }
@@ -9226,7 +9771,7 @@ var Vault = class {
9226
9771
  if (registry === null) return { derived: 0, failed: 0, skippedFrozen: 0 };
9227
9772
  const strategies = registry.strategiesForSource(sourceCollection);
9228
9773
  if (strategies.length === 0) return { derived: 0, failed: 0, skippedFrozen: 0 };
9229
- const { DerivationExecutor } = await import("./executor-5NIMLSKZ.js");
9774
+ const { DerivationExecutor } = await import("./executor-OSRZST2U.js");
9230
9775
  const sourceColl = this.collection(sourceCollection);
9231
9776
  const records = await sourceColl.list();
9232
9777
  const ctx = { vault: this.derivationFacade ?? new (await import("./read-only-facade-BIGO37U3.js")).ReadOnlyVaultFacade(this, "derivation") };
@@ -9253,7 +9798,7 @@ var Vault = class {
9253
9798
  if (!outSpec) continue;
9254
9799
  const outputColl = this.collection(outSpec.collection);
9255
9800
  if (out.kind === "array") {
9256
- const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-S3QL53YX.js");
9801
+ const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-L7NHPIOC.js");
9257
9802
  const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key, this.getDEK, this.encrypted);
9258
9803
  const prevKeys = new Set(prior?.keys ?? []);
9259
9804
  const newKeysList = out.entries.map((e) => e.key);
@@ -9480,7 +10025,7 @@ var Vault = class {
9480
10025
  * collection.
9481
10026
  */
9482
10027
  async delegate(opts) {
9483
- const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-DS5NRILW.js");
10028
+ const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-NANZDG4N.js");
9484
10029
  if (!this.keyring.kek) {
9485
10030
  throw new ValidationError(
9486
10031
  "issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (secret) first."
@@ -9502,7 +10047,7 @@ var Vault = class {
9502
10047
  * if the id does not exist.
9503
10048
  */
9504
10049
  async revokeDelegation(id) {
9505
- const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-DS5NRILW.js");
10050
+ const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-NANZDG4N.js");
9506
10051
  await revokeDelegation(this.adapter, this.name, id);
9507
10052
  void DELEGATIONS_COLLECTION;
9508
10053
  }
@@ -9730,6 +10275,10 @@ var Vault = class {
9730
10275
  async _assertTsWritable(existing, incoming, collection) {
9731
10276
  return this.periods.assertTsWritable(existing, incoming, collection);
9732
10277
  }
10278
+ /** #1439 — sync superset test: could a closed period govern this row? See `periods/vault-facade.ts#couldGovern`. @internal */
10279
+ _periodCouldGovern(record) {
10280
+ return this.periods.couldGovern(record);
10281
+ }
9733
10282
  /** List all collection names in this vault. */
9734
10283
  async collections() {
9735
10284
  const snapshot = await this.adapter.loadAll(this.name);
@@ -9755,7 +10304,7 @@ var Vault = class {
9755
10304
  * @see design-history/2026-05-22-schema-dump-design.md
9756
10305
  */
9757
10306
  async dumpSchema(opts = {}) {
9758
- const { dumpVaultSchema } = await import("./walk-ZURCH6RZ.js");
10307
+ const { dumpVaultSchema } = await import("./walk-4VPK7AS4.js");
9759
10308
  return dumpVaultSchema(this, opts);
9760
10309
  }
9761
10310
  /**
@@ -9851,7 +10400,7 @@ var Vault = class {
9851
10400
  * separate vault instances now.
9852
10401
  */
9853
10402
  async getPodHandle() {
9854
- const { buildPodHandle } = await import("./pod-handle-ECVCDIXW.js");
10403
+ const { buildPodHandle } = await import("./pod-handle-A3LET7NO.js");
9855
10404
  return buildPodHandle(this.adapter, this.name);
9856
10405
  }
9857
10406
  /**
@@ -9865,7 +10414,7 @@ var Vault = class {
9865
10414
  * single, already-opened `Vault` instance so the
9866
10415
  * bundle writer can snapshot it without holding a `Noydb` reference.
9867
10416
  *
9868
- * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md
10417
+ * @see https://github.com/noy-db/docs/blob/main/content/docs/services/public-envelope.md
9869
10418
  */
9870
10419
  async getCover(opts = {}) {
9871
10420
  const { readCover } = await import("./cover/index.js");
@@ -9883,7 +10432,7 @@ var Vault = class {
9883
10432
  * both modes round-trip cleanly.
9884
10433
  */
9885
10434
  async dump() {
9886
- const { dumpVault } = await import("./backup-XKCXVKV3.js");
10435
+ const { dumpVault } = await import("./backup-YE2VQ26S.js");
9887
10436
  return dumpVault(this.backupContext());
9888
10437
  }
9889
10438
  /**
@@ -9935,7 +10484,7 @@ var Vault = class {
9935
10484
  * — there's no chain to verify against.
9936
10485
  */
9937
10486
  async load(backupJson) {
9938
- const { loadVault } = await import("./backup-XKCXVKV3.js");
10487
+ const { loadVault } = await import("./backup-YE2VQ26S.js");
9939
10488
  return loadVault(this.backupContext(), backupJson);
9940
10489
  }
9941
10490
  /**
@@ -9967,7 +10516,7 @@ var Vault = class {
9967
10516
  * way to detect tampering of an in-place vault.
9968
10517
  */
9969
10518
  async verifyBackupIntegrity() {
9970
- const { verifyBackupIntegrity } = await import("./backup-XKCXVKV3.js");
10519
+ const { verifyBackupIntegrity } = await import("./backup-YE2VQ26S.js");
9971
10520
  return verifyBackupIntegrity(this.backupContext());
9972
10521
  }
9973
10522
  /**
@@ -10197,7 +10746,7 @@ var Vault = class {
10197
10746
  * is the live validator object, not a serialization of it).
10198
10747
  */
10199
10748
  async exportJSON(opts = {}) {
10200
- const { exportVaultJSON } = await import("./backup-XKCXVKV3.js");
10749
+ const { exportVaultJSON } = await import("./backup-YE2VQ26S.js");
10201
10750
  return exportVaultJSON(this.backupContext(), opts);
10202
10751
  }
10203
10752
  };
@@ -10285,6 +10834,36 @@ var WriteQueueTracker = class {
10285
10834
  throw error;
10286
10835
  }
10287
10836
  }
10837
+ /**
10838
+ * Run a write whose PRE-COMMIT phase may legitimately REFUSE — the schema
10839
+ * gates, and a user `beforeWrite` hook that throws to abort. `fn` calls
10840
+ * `committed()` at the point the store write itself begins.
10841
+ *
10842
+ * Before that point a rejection releases the depth it took but records NO
10843
+ * queue error; after it, a rejection settles as a failure like `track`.
10844
+ *
10845
+ * #11 — why the phase is inside `depth` at all: `pending` is the documented
10846
+ * shutdown guard (see the `writeQueue` getter's `beforeunload` example) and
10847
+ * the schema fence does a fresh store read per write, so leaving the gates
10848
+ * outside made `pending` read `false` during a real round-trip on every
10849
+ * write. The refusal carve-out is what the old outside-the-queue placement
10850
+ * was protecting ("a rejected write never counts toward depth") — it is kept
10851
+ * deliberately, so a refused write cannot reject a concurrent `onFlush()`.
10852
+ */
10853
+ async trackGated(fn) {
10854
+ this.begin();
10855
+ let refusable = true;
10856
+ try {
10857
+ const value = await fn(() => {
10858
+ refusable = false;
10859
+ });
10860
+ this.settle();
10861
+ return value;
10862
+ } catch (error) {
10863
+ this.settle(refusable ? void 0 : error);
10864
+ throw error;
10865
+ }
10866
+ }
10288
10867
  #emitChange() {
10289
10868
  for (const handler of this.#changeHandlers) handler();
10290
10869
  }
@@ -10439,7 +11018,7 @@ var ServiceBus = class {
10439
11018
  arr = [];
10440
11019
  this.#gateHandlers.set(point, arr);
10441
11020
  }
10442
- const entry = { fn: handler, needsPrior: opts?.needsPrior !== false };
11021
+ const entry = { fn: handler, needsPrior: opts?.needsPrior !== false, scope: opts?.scope };
10443
11022
  arr.push(entry);
10444
11023
  return () => {
10445
11024
  const a = this.#gateHandlers.get(point);
@@ -10453,6 +11032,30 @@ var ServiceBus = class {
10453
11032
  const a = this.#gateHandlers.get(point);
10454
11033
  return a !== void 0 && a.length > 0;
10455
11034
  }
11035
+ /**
11036
+ * #1439 — could a gate at `point` fire for THIS target?
11037
+ *
11038
+ * ⚠️ This is the question callers almost always mean, and
11039
+ * {@link hasGateHandlers} is not it. That one is about the bus, which is
11040
+ * shared by the whole vault; this one consults each handler's declared
11041
+ * {@link GateScope}. A handler that declares none counts as "may fire", so a
11042
+ * registrant which has not thought about scope keeps today's behaviour.
11043
+ *
11044
+ * ⛔ A scope that throws is treated as "may fire". A predicate whose job is
11045
+ * to permit an optimisation must never be able to disable a gate by failing.
11046
+ */
11047
+ gateAppliesTo(point, target) {
11048
+ const a = this.#gateHandlers.get(point);
11049
+ if (a === void 0 || a.length === 0) return false;
11050
+ return a.some((e) => {
11051
+ if (e.scope === void 0) return true;
11052
+ try {
11053
+ return e.scope(target);
11054
+ } catch {
11055
+ return true;
11056
+ }
11057
+ });
11058
+ }
10456
11059
  /**
10457
11060
  * True when at least one gate handler at `point` needs the prior record
10458
11061
  * (the default). False when the point has no handlers or every handler
@@ -11154,6 +11757,9 @@ var TeamFacade = class {
11154
11757
  this.deps.checkPolicyOperation(vault, "grant");
11155
11758
  await this.deps.checkGate(vault, "enroll-user", factors);
11156
11759
  const keyring = await this.deps.getKeyringInternal(vault);
11760
+ if (this.deps.options.periodsStrategy !== void 0) {
11761
+ await (await ensureCollectionDEK(this.deps.options.store, vault, keyring))(PERIODS_COLLECTION);
11762
+ }
11157
11763
  await engine(this.deps.options.store, vault, keyring, options);
11158
11764
  }
11159
11765
  /** Gate + run a `revoke` engine. See `Noydb.revoke` for the public contract. */
@@ -11205,9 +11811,18 @@ var TeamFacade = class {
11205
11811
  this.deps.keyringCache.set(vault, next);
11206
11812
  }
11207
11813
  /**
11208
- * Remove a tier-2 authenticator slot. Idempotent — removing a
11209
- * non-existent slot is a successful no-op. Gated by
11814
+ * Remove a tier-2 authenticator slot. Idempotent — removing a slot
11815
+ * that is not in the keyring is a successful no-op. Gated by
11210
11816
  * `remove-authenticator`.
11817
+ *
11818
+ * ⚠️ Idempotency needs the slot list to be VISIBLE, and a tier-3
11819
+ * PIN-resumed / session-restored keyring carries an empty one
11820
+ * (#1426). Such a session throws `ValidationError` rather than
11821
+ * reporting a removal it did not perform — re-authenticate at tier 1
11822
+ * first.
11823
+ *
11824
+ * @throws `ValidationError` when the active keyring cannot see its
11825
+ * slot list (`kek === null`).
11211
11826
  */
11212
11827
  async removeAuthenticator(vault, slotId, factors) {
11213
11828
  await this.deps.checkGate(vault, "remove-authenticator", factors);
@@ -12188,10 +12803,14 @@ var Noydb = class {
12188
12803
  if (!facade) return;
12189
12804
  const ctx = { existing, vault: facade, userId: e.userId, role: e.role };
12190
12805
  await registry.runChecks(e.collection, incoming, ctx);
12191
- const { GuardExecutor } = await import("./executor-AQVXV5GZ.js");
12806
+ const { GuardExecutor } = await import("./executor-LBBBRTN5.js");
12192
12807
  for (const g of guards) {
12193
12808
  await GuardExecutor.checkFrozenFields(g, e.docId, existing, incoming, e.computedFieldNames);
12194
12809
  }
12810
+ }, {
12811
+ // #1439 — this handler's own first two early-returns, hoisted so a caller can ask
12812
+ // "could a guard fire HERE" without writing. See `ServiceBus.gateAppliesTo`.
12813
+ scope: ({ vault, collection }) => (this.vaultCache.get(vault)?._getGuardRegistry()?.guardsFor(collection).length ?? 0) > 0
12195
12814
  });
12196
12815
  this.subsystemBus.registerGate("beforeDelete", async (e) => {
12197
12816
  const v = this.vaultCache.get(e.vault);
@@ -12235,6 +12854,9 @@ var Noydb = class {
12235
12854
  if (!v) return;
12236
12855
  const existing = e.op === "create" ? null : { ts: e.existingTs ?? null, record: e.existing ?? null };
12237
12856
  await v._assertTsWritable(existing, e.incoming, e.collection);
12857
+ }, {
12858
+ // #1439 — a period governs a row only through its `dateField`; see `couldGovern`.
12859
+ scope: ({ vault, record }) => this.vaultCache.get(vault)?._periodCouldGovern(record) ?? true
12238
12860
  });
12239
12861
  this.subsystemBus.registerGate("beforeDelete", async (e) => {
12240
12862
  if (e.internal) return;
@@ -13124,6 +13746,15 @@ var Noydb = class {
13124
13746
  }
13125
13747
  return { dispose: () => this.disableTabCoordination() };
13126
13748
  }
13749
+ /** @internal #1362 — `ChangeBroadcastHost`: re-read one broadcast address through THIS
13750
+ * instance's own keyring. No-op for a vault this instance has not opened. */
13751
+ _applyRemoteSignal(vaultName, collectionName, id) {
13752
+ return this.vaultCache.get(vaultName)?._applyRemoteSignal(collectionName, id) ?? Promise.resolve();
13753
+ }
13754
+ /** @internal #1362 — `ChangeBroadcastHost`: store backend name, for the default channel name. */
13755
+ get _storeName() {
13756
+ return this.options.store.name;
13757
+ }
13127
13758
  #applyRemoteWrite(vaultName, collectionName, docId, action) {
13128
13759
  const v = this.vaultCache.get(vaultName);
13129
13760
  if (!v) return Promise.resolve();
@@ -13347,7 +13978,7 @@ var Noydb = class {
13347
13978
  * keyring file at `_keyring/<userId>` and the envelope ciphertext at
13348
13979
  * `_users/<keyringId>` remain observable to anyone with direct store
13349
13980
  * read access — only the hub-level enumeration is gated. See
13350
- * `https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/user-envelope.md` → "Directory visibility".
13981
+ * `https://github.com/noy-db/docs/blob/main/content/docs/services/user-envelope.md` → "Directory visibility".
13351
13982
  */
13352
13983
  async setDirectoryEnabled(vault, enabled) {
13353
13984
  if (this.closed) throw new ValidationError("Instance is closed");
@@ -13431,7 +14062,7 @@ var Noydb = class {
13431
14062
  this.activeTier.set(vault, tier);
13432
14063
  }
13433
14064
  // ─── Tier-2 enroll / remove ─────────────────────────────────────
13434
- // ─── Cover (https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md) ──────
14065
+ // ─── Cover (https://github.com/noy-db/docs/blob/main/content/docs/services/public-envelope.md) ──────
13435
14066
  /**
13436
14067
  * Set the owner-curated cover for a vault. Throws
13437
14068
  * `ValidationError` if the developer did not opt the hub into
@@ -13560,7 +14191,7 @@ async function createNoydb(options) {
13560
14191
  if (!options.store) options = { ...options, store: memoryStore() };
13561
14192
  validateSecretModeOptions(options);
13562
14193
  if (!options.mesh) options = { ...options, mesh: await createDefaultMesh(options.store) };
13563
- if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-WYW4YEQG.js")).createUserApi };
14194
+ if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-OS747DS4.js")).createUserApi };
13564
14195
  if (!options.policyFactory) {
13565
14196
  const policyModule = await import("./policy/index.js");
13566
14197
  options = { ...options, policyFactory: policyModule.createNoydbPolicy, policyCheckGateFn: policyModule.checkGate };
@@ -13593,4 +14224,4 @@ export {
13593
14224
  Noydb,
13594
14225
  createNoydb
13595
14226
  };
13596
- //# sourceMappingURL=chunk-ZYIYHJ5R.js.map
14227
+ //# sourceMappingURL=chunk-MXOQ5JCG.js.map