@noy-db/hub 0.6.0-pre.8 → 0.6.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 (512) hide show
  1. package/CHANGELOG.md +7079 -0
  2. package/codemods/0.6.0-pre.json +211 -0
  3. package/dist/api-6X2VLZ7J.js +20 -0
  4. package/dist/attestation/index.js +19 -19
  5. package/dist/{backup-KULFZ2T4.js → backup-VL4GRIEW.js} +36 -18
  6. package/dist/backup-VL4GRIEW.js.map +1 -0
  7. package/dist/blobs/index.js +22 -20
  8. package/dist/blobs/index.js.map +1 -1
  9. package/dist/broker/index.js +12 -12
  10. package/dist/cargo/index.js +35 -35
  11. package/dist/{chunk-KUDZVJKQ.js → chunk-22GR3O4J.js} +2 -2
  12. package/dist/{chunk-CCZJJ4I2.js → chunk-2CBFYXJX.js} +6 -6
  13. package/dist/{chunk-JJNOLSG5.js → chunk-2J5IT37K.js} +15 -16
  14. package/dist/chunk-2J5IT37K.js.map +1 -0
  15. package/dist/{chunk-PNKHAKQ7.js → chunk-2ZCWHCLF.js} +17 -10
  16. package/dist/chunk-2ZCWHCLF.js.map +1 -0
  17. package/dist/{chunk-2BMRJ6LQ.js → chunk-2ZT4INZ4.js} +8 -11
  18. package/dist/{chunk-2BMRJ6LQ.js.map → chunk-2ZT4INZ4.js.map} +1 -1
  19. package/dist/{chunk-FAXZQ5UF.js → chunk-323MN67Z.js} +2 -2
  20. package/dist/{chunk-VMCCGUQB.js → chunk-36CEG6CM.js} +2 -2
  21. package/dist/{chunk-PDLLCOGD.js → chunk-3OE2QNSM.js} +20 -17
  22. package/dist/chunk-3OE2QNSM.js.map +1 -0
  23. package/dist/{chunk-AHLJSVRL.js → chunk-3YGUHUJA.js} +5 -7
  24. package/dist/chunk-3YGUHUJA.js.map +1 -0
  25. package/dist/{chunk-ZJADGNYF.js → chunk-4AOERLTV.js} +1 -1
  26. package/dist/chunk-4AOERLTV.js.map +1 -0
  27. package/dist/{chunk-J7FM3RAU.js → chunk-4ATF4BLF.js} +87 -34
  28. package/dist/chunk-4ATF4BLF.js.map +1 -0
  29. package/dist/{chunk-747LRSOO.js → chunk-4K6BIMLF.js} +2 -2
  30. package/dist/{chunk-PXCBVDFY.js → chunk-5ATC6UT4.js} +40 -7
  31. package/dist/chunk-5ATC6UT4.js.map +1 -0
  32. package/dist/{chunk-4GZ6XOVW.js → chunk-5F7BZAGV.js} +44 -42
  33. package/dist/chunk-5F7BZAGV.js.map +1 -0
  34. package/dist/{chunk-FNSMZQS4.js → chunk-5IHGJHWC.js} +2 -2
  35. package/dist/{chunk-4I72F5DF.js → chunk-5LZZQMIC.js} +11 -14
  36. package/dist/chunk-5LZZQMIC.js.map +1 -0
  37. package/dist/{chunk-JXIDGFKS.js → chunk-5O5ZSW7N.js} +4 -2
  38. package/dist/chunk-5O5ZSW7N.js.map +1 -0
  39. package/dist/{chunk-CEJWMBXO.js → chunk-5OT4G5N5.js} +6 -2
  40. package/dist/chunk-5OT4G5N5.js.map +1 -0
  41. package/dist/{chunk-GAG7QOVO.js → chunk-64WHKBMP.js} +53 -18
  42. package/dist/chunk-64WHKBMP.js.map +1 -0
  43. package/dist/{chunk-7TSYBD3E.js → chunk-65JXA63J.js} +2 -2
  44. package/dist/{chunk-Z45YRGFO.js → chunk-6NR36UNB.js} +2 -2
  45. package/dist/{chunk-W77KZHCW.js → chunk-6RH7PRTL.js} +16 -17
  46. package/dist/chunk-6RH7PRTL.js.map +1 -0
  47. package/dist/{chunk-3JVXVJ7L.js → chunk-7OBIBPCV.js} +10 -10
  48. package/dist/{chunk-AR2JDFAE.js → chunk-7Q3RHOA5.js} +2 -2
  49. package/dist/chunk-7ZGPQOFV.js +190 -0
  50. package/dist/chunk-7ZGPQOFV.js.map +1 -0
  51. package/dist/{chunk-QULVCV3M.js → chunk-AJGGBXWA.js} +4 -4
  52. package/dist/{chunk-CADUYBQD.js → chunk-ATL3ZVXT.js} +2 -2
  53. package/dist/{chunk-DMQCLZ4Z.js → chunk-ATY3ZASK.js} +2 -2
  54. package/dist/{chunk-4HDYQL3J.js → chunk-B4CRUZPR.js} +2 -2
  55. package/dist/{chunk-IMZLOJTK.js → chunk-BMU2DS3S.js} +30 -21
  56. package/dist/chunk-BMU2DS3S.js.map +1 -0
  57. package/dist/{chunk-6SAFL5YE.js → chunk-BZ3WMOYX.js} +3 -3
  58. package/dist/{chunk-UHXCLPGC.js → chunk-C3XWJCG7.js} +2 -2
  59. package/dist/chunk-C3XWJCG7.js.map +1 -0
  60. package/dist/{chunk-HXGUIPQB.js → chunk-CKKN25P2.js} +3 -3
  61. package/dist/{chunk-3URQC7EH.js → chunk-CXPOG3ZY.js} +355 -132
  62. package/dist/chunk-CXPOG3ZY.js.map +1 -0
  63. package/dist/{chunk-3FSX6LDG.js → chunk-D2YFQ7XG.js} +18 -3
  64. package/dist/{chunk-3FSX6LDG.js.map → chunk-D2YFQ7XG.js.map} +1 -1
  65. package/dist/{chunk-52JPHN5N.js → chunk-D6SXRMZZ.js} +27 -149
  66. package/dist/chunk-D6SXRMZZ.js.map +1 -0
  67. package/dist/{chunk-2DHSSLOD.js → chunk-DECNV4QK.js} +13 -15
  68. package/dist/chunk-DECNV4QK.js.map +1 -0
  69. package/dist/{chunk-6BU3L4UE.js → chunk-DNKVKO7K.js} +7 -10
  70. package/dist/chunk-DNKVKO7K.js.map +1 -0
  71. package/dist/{chunk-6HFM7EIT.js → chunk-EHRIDNZX.js} +2 -2
  72. package/dist/{chunk-3737A6EA.js → chunk-EHW7NLGD.js} +127 -31
  73. package/dist/chunk-EHW7NLGD.js.map +1 -0
  74. package/dist/{chunk-BEFVYAR5.js → chunk-EQOTJL76.js} +4 -4
  75. package/dist/chunk-EQOTJL76.js.map +1 -0
  76. package/dist/{chunk-E6427JU2.js → chunk-EV2TDHQZ.js} +19 -3
  77. package/dist/chunk-EV2TDHQZ.js.map +1 -0
  78. package/dist/{chunk-WFUIE565.js → chunk-FNYCT27B.js} +17 -14
  79. package/dist/chunk-FNYCT27B.js.map +1 -0
  80. package/dist/{chunk-RTAMLDWP.js → chunk-FU5VYEYK.js} +2 -2
  81. package/dist/chunk-FX3UIDCS.js +66 -0
  82. package/dist/chunk-FX3UIDCS.js.map +1 -0
  83. package/dist/{chunk-7F4DBNSP.js → chunk-GANFIM2M.js} +135 -18
  84. package/dist/chunk-GANFIM2M.js.map +1 -0
  85. package/dist/{chunk-4VUPLMZ6.js → chunk-GCU42IG7.js} +66 -71
  86. package/dist/chunk-GCU42IG7.js.map +1 -0
  87. package/dist/{chunk-RXYYFSBB.js → chunk-GKTW3KLV.js} +4 -4
  88. package/dist/chunk-HK67PX4J.js +27 -0
  89. package/dist/chunk-HK67PX4J.js.map +1 -0
  90. package/dist/{chunk-OF3L2SD6.js → chunk-HOPNIR5R.js} +2 -2
  91. package/dist/{chunk-WLZ47GSL.js → chunk-HSJBJIB2.js} +12 -10
  92. package/dist/{chunk-WLZ47GSL.js.map → chunk-HSJBJIB2.js.map} +1 -1
  93. package/dist/{chunk-ADW22QSB.js → chunk-HWI7GHJZ.js} +4 -4
  94. package/dist/{chunk-GQ3BX5EA.js → chunk-I3ISCYT7.js} +2 -2
  95. package/dist/{chunk-YJ6IONGA.js → chunk-IWKCJCLP.js} +11 -3
  96. package/dist/{chunk-YJ6IONGA.js.map → chunk-IWKCJCLP.js.map} +1 -1
  97. package/dist/{chunk-NJDQ4YSV.js → chunk-IWQPYT6S.js} +4 -4
  98. package/dist/{chunk-JRKZTEZZ.js → chunk-J6I5VR6P.js} +444 -73
  99. package/dist/chunk-J6I5VR6P.js.map +1 -0
  100. package/dist/{chunk-2Z3NCLNX.js → chunk-JHYKSMVX.js} +7 -7
  101. package/dist/{chunk-6FJWSWFT.js → chunk-JIHWBKMQ.js} +3 -3
  102. package/dist/{chunk-YAWK6AWF.js → chunk-JKATP6OE.js} +2 -2
  103. package/dist/{chunk-PL2GHSCM.js → chunk-JMJSCI7U.js} +157 -90
  104. package/dist/chunk-JMJSCI7U.js.map +1 -0
  105. package/dist/{chunk-Q6TEJXBX.js → chunk-JXHNUYQO.js} +31 -49
  106. package/dist/chunk-JXHNUYQO.js.map +1 -0
  107. package/dist/{chunk-WK5XUYYF.js → chunk-JYPRZWCZ.js} +473 -231
  108. package/dist/chunk-JYPRZWCZ.js.map +1 -0
  109. package/dist/{chunk-5ZKS6ZE2.js → chunk-K6CPIK3R.js} +4 -4
  110. package/dist/chunk-K6CPIK3R.js.map +1 -0
  111. package/dist/{chunk-CDB2HVQW.js → chunk-KM6ZXG7U.js} +14 -15
  112. package/dist/chunk-KM6ZXG7U.js.map +1 -0
  113. package/dist/{chunk-DG27IUVI.js → chunk-LC6NE4IQ.js} +2 -2
  114. package/dist/{chunk-WASHZV34.js → chunk-LIR2DJWP.js} +63 -25
  115. package/dist/chunk-LIR2DJWP.js.map +1 -0
  116. package/dist/{chunk-VZ3XFUQ7.js → chunk-LUYPYCHY.js} +16 -22
  117. package/dist/chunk-LUYPYCHY.js.map +1 -0
  118. package/dist/{chunk-G6S5VVHP.js → chunk-M7WBE3OR.js} +10 -10
  119. package/dist/chunk-M7WBE3OR.js.map +1 -0
  120. package/dist/{chunk-VJFMXYKP.js → chunk-MPKP6L5E.js} +2 -2
  121. package/dist/{chunk-IGJCYUT5.js → chunk-NSITFOCJ.js} +1 -1
  122. package/dist/chunk-NSITFOCJ.js.map +1 -0
  123. package/dist/{chunk-FUHKW252.js → chunk-OCJ3JA4O.js} +2 -2
  124. package/dist/{chunk-VCETL77O.js → chunk-ONPVHX2Y.js} +36 -7
  125. package/dist/chunk-ONPVHX2Y.js.map +1 -0
  126. package/dist/{chunk-WLYIROCJ.js → chunk-OQMCFHUX.js} +2 -2
  127. package/dist/{chunk-JRCYZEHU.js → chunk-OR2FYRYR.js} +2 -2
  128. package/dist/{chunk-HNHCQ556.js → chunk-PFWE7FJG.js} +2 -2
  129. package/dist/{chunk-NPP5R7FF.js → chunk-PJX72ICF.js} +22 -18
  130. package/dist/chunk-PJX72ICF.js.map +1 -0
  131. package/dist/{chunk-U5O6GIWZ.js → chunk-POFYIGQ2.js} +3 -3
  132. package/dist/{chunk-35EBKWQU.js → chunk-QH47SQLD.js} +4 -4
  133. package/dist/{chunk-FZ6NYJ7L.js → chunk-QQRRKO7W.js} +11 -8
  134. package/dist/chunk-QQRRKO7W.js.map +1 -0
  135. package/dist/{chunk-HVQGCKY4.js → chunk-QVXZFJBU.js} +2 -2
  136. package/dist/{chunk-FMQJZH4R.js → chunk-RDB66EKD.js} +6 -6
  137. package/dist/{chunk-X56RTUK3.js → chunk-RJZQ2PVD.js} +3 -3
  138. package/dist/{chunk-SUFG5E73.js → chunk-RPRASGEY.js} +2 -2
  139. package/dist/{chunk-XWX7GL56.js → chunk-S2I5MYSA.js} +7 -10
  140. package/dist/chunk-S2I5MYSA.js.map +1 -0
  141. package/dist/{chunk-FFDNKRCY.js → chunk-S6PJ6ZKE.js} +2 -2
  142. package/dist/chunk-S6PJ6ZKE.js.map +1 -0
  143. package/dist/{chunk-JIUVJ4M7.js → chunk-S7PM7Z4K.js} +3 -3
  144. package/dist/{chunk-55LKVALY.js → chunk-T7IR4N2S.js} +1 -3
  145. package/dist/chunk-T7IR4N2S.js.map +1 -0
  146. package/dist/{chunk-N35NC4JH.js → chunk-TKBB62DN.js} +2 -2
  147. package/dist/{chunk-YPYHVOXP.js → chunk-UJ4Z67UQ.js} +2 -2
  148. package/dist/chunk-UJ4Z67UQ.js.map +1 -0
  149. package/dist/{chunk-7MNBICB5.js → chunk-W3HAIN6U.js} +16 -14
  150. package/dist/chunk-W3HAIN6U.js.map +1 -0
  151. package/dist/{chunk-4UVDI4XE.js → chunk-WPZ5FVAS.js} +4 -4
  152. package/dist/{chunk-MSWYQLMQ.js → chunk-XINT4VJA.js} +2 -2
  153. package/dist/{chunk-7G6VDWXB.js → chunk-XPEPMK4Y.js} +3 -3
  154. package/dist/chunk-XPEPMK4Y.js.map +1 -0
  155. package/dist/{chunk-W3TVWF6N.js → chunk-YCGLAANM.js} +2 -2
  156. package/dist/{chunk-O2ERS4UJ.js → chunk-YTUFV7U7.js} +80 -51
  157. package/dist/chunk-YTUFV7U7.js.map +1 -0
  158. package/dist/{chunk-FDX7OWWI.js → chunk-YYV53EHO.js} +2 -2
  159. package/dist/{chunk-HNGSV2YC.js → chunk-Z3BZXPRO.js} +67 -10
  160. package/dist/chunk-Z3BZXPRO.js.map +1 -0
  161. package/dist/{chunk-6NVPFKN3.js → chunk-ZIMQDXTQ.js} +92 -35
  162. package/dist/chunk-ZIMQDXTQ.js.map +1 -0
  163. package/dist/{chunk-5JY5TSVY.js → chunk-ZJUZOJVW.js} +25 -31
  164. package/dist/chunk-ZJUZOJVW.js.map +1 -0
  165. package/dist/{chunk-3IXIU6FP.js → chunk-ZY6P7M52.js} +7 -10
  166. package/dist/chunk-ZY6P7M52.js.map +1 -0
  167. package/dist/{chunk-H73G4XF4.js → chunk-ZYZJLYNS.js} +7 -11
  168. package/dist/chunk-ZYZJLYNS.js.map +1 -0
  169. package/dist/classified/index.js +5 -5
  170. package/dist/{classified-marker-2KJAXRRO.js → classified-marker-AZDSDG6V.js} +3 -3
  171. package/dist/collection-facade-WSUAYFJ4.js +45 -0
  172. package/dist/{computed-6G5M3UPH.js → computed-VG2PCM4L.js} +3 -3
  173. package/dist/consent/index.js +10 -10
  174. package/dist/cover/index.js +10 -3
  175. package/dist/custody/index.js +12 -11
  176. package/dist/{dead-filter-DCB62VWW.js → dead-filter-JNQNB3TA.js} +2 -2
  177. package/dist/debug/index.js +1 -1
  178. package/dist/{delegation-MO7YZYJS.js → delegation-5F36DRDH.js} +24 -23
  179. package/dist/delegation-5F36DRDH.js.map +1 -0
  180. package/dist/derivations/index.js +12 -12
  181. package/dist/derive-MPOGZ4NR.js +22 -0
  182. package/dist/directory/index.js +10 -10
  183. package/dist/{dispatch-MJ6SHB3Y.js → dispatch-3ZA733EY.js} +18 -18
  184. package/dist/{dispatch-FZEAWKVM.js → dispatch-TNM5CRLZ.js} +9 -6
  185. package/dist/dispatch-TNM5CRLZ.js.map +1 -0
  186. package/dist/{enclave-JU4YIEPB.js → enclave-Y2ALNDRD.js} +31 -9
  187. package/dist/executor-BBEEUFO3.js +9 -0
  188. package/dist/executor-G6G3YEWR.js +9 -0
  189. package/dist/executor-ZUTUMTPA.js +29 -0
  190. package/dist/export-accessible-S3KEB763.js +23 -0
  191. package/dist/extract-partition-KVCTSUVE.js +38 -0
  192. package/dist/{fanout-sidecar-NNAJQXMX.js → fanout-sidecar-3QZU7ZZX.js} +18 -27
  193. package/dist/fanout-sidecar-3QZU7ZZX.js.map +1 -0
  194. package/dist/find-V4FN5ITT.js +11 -0
  195. package/dist/forget/index.js +9 -9
  196. package/dist/guards/index.js +7 -7
  197. package/dist/history/index.js +23 -20
  198. package/dist/history/index.js.map +1 -1
  199. package/dist/i18n/index.js +14 -14
  200. package/dist/index.d.ts +30 -13
  201. package/dist/index.js +180 -188
  202. package/dist/index.js.map +1 -1
  203. package/dist/indexing/index.js +4 -4
  204. package/dist/introspection/index.js +11 -11
  205. package/dist/issue-5CFBWBRX.js +19 -0
  206. package/dist/kernel/collection.d.ts +8 -2
  207. package/dist/kernel/constants.d.ts +36 -0
  208. package/dist/kernel/enclave/crypto.d.ts +52 -4
  209. package/dist/kernel/enclave/index.d.ts +10 -3
  210. package/dist/kernel/enclave/record-aad.d.ts +131 -0
  211. package/dist/kernel/enclave/record-envelope.d.ts +76 -0
  212. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +34 -2
  213. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +22 -5
  214. package/dist/kernel/enclave/record-keys/record-codec.d.ts +47 -14
  215. package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +88 -0
  216. package/dist/kernel/enclave/record-keys/rekey.d.ts +91 -0
  217. package/dist/kernel/enclave/record-keys/tombstone.d.ts +3 -2
  218. package/dist/kernel/errors.d.ts +132 -12
  219. package/dist/kernel/merge-authority.d.ts +25 -0
  220. package/dist/kernel/noydb.d.ts +27 -4
  221. package/dist/kernel/query/builder.d.ts +51 -4
  222. package/dist/kernel/query/join.d.ts +27 -0
  223. package/dist/kernel/query/live.d.ts +31 -9
  224. package/dist/kernel/query/predicate.d.ts +9 -0
  225. package/dist/kernel/refs.d.ts +3 -1
  226. package/dist/kernel/sync-policy.d.ts +0 -2
  227. package/dist/kernel/tier-visibility.d.ts +34 -0
  228. package/dist/kernel/types.d.ts +111 -13
  229. package/dist/kernel/vault.d.ts +14 -8
  230. package/dist/kernel/via/index.d.ts +11 -2
  231. package/dist/kernel/via/reconcile.d.ts +12 -0
  232. package/dist/{ledger-AETNF4OM.js → ledger-MQIIOTZB.js} +11 -11
  233. package/dist/liberate-LW7OKVBH.js +25 -0
  234. package/dist/{link-set-E5HNY67I.js → link-set-5PJBBR63.js} +11 -11
  235. package/dist/{managed-secret-CWQ6PND5.js → managed-secret-ETDG6AAE.js} +11 -3
  236. package/dist/materialized-views/index.js +24 -24
  237. package/dist/migrate-cek-V3VDRV24.js +19 -0
  238. package/dist/migrate-cek-V3VDRV24.js.map +1 -0
  239. package/dist/money/index.js +5 -5
  240. package/dist/noydb-LFDRMYZ5.js +85 -0
  241. package/dist/overlay-views/index.js +4 -4
  242. package/dist/periods/index.js +18 -12
  243. package/dist/pod/index.js +79 -89
  244. package/dist/pod-handle-AZ3CXY5Y.js +41 -0
  245. package/dist/pod-handle-AZ3CXY5Y.js.map +1 -0
  246. package/dist/policy/index.js +11 -4
  247. package/dist/port/to/index.d.ts +4 -4
  248. package/dist/port/to/locator.d.ts +54 -8
  249. package/dist/port/with/i18n-strategy.d.ts +4 -1
  250. package/dist/port/with/lookup-strategy.d.ts +4 -1
  251. package/dist/port/with/merge-authority.d.ts +52 -0
  252. package/dist/port/with/service-bus.d.ts +0 -4
  253. package/dist/port/with/strategies.d.ts +2 -0
  254. package/dist/port/with/team-strategy.d.ts +5 -1
  255. package/dist/portability/index.js +8 -8
  256. package/dist/{post-register-2XSSMGEQ.js → post-register-QCJYRMIK.js} +6 -6
  257. package/dist/query/index.js +6 -6
  258. package/dist/reduce/index.js +6 -6
  259. package/dist/register-JBOEHTVX.js +32 -0
  260. package/dist/registry-5DYHQFJS.js +9 -0
  261. package/dist/registry-EANV44W2.js +9 -0
  262. package/dist/registry-J25H6VB4.js +19 -0
  263. package/dist/registry-R23SQUQH.js +18 -0
  264. package/dist/request-withdrawal-KQ4W4UT5.js +31 -0
  265. package/dist/{reveal-BW36KCOQ.js → reveal-W7BKZSUP.js} +6 -6
  266. package/dist/revoke-H3VSTAIE.js +24 -0
  267. package/dist/satellites/index.js +1 -1
  268. package/dist/schema-update/index.js +2 -2
  269. package/dist/sealed-record/index.js +20 -13
  270. package/dist/sealed-record/index.js.map +1 -1
  271. package/dist/search/index.js +4 -4
  272. package/dist/{seed-GDV5PT4R.js → seed-55FPOMYP.js} +20 -22
  273. package/dist/seed-55FPOMYP.js.map +1 -0
  274. package/dist/sequence/index.js +9 -9
  275. package/dist/session/index.js +10 -10
  276. package/dist/shadow/index.js +2 -2
  277. package/dist/share-link/index.js +1 -1
  278. package/dist/signer-53AQ3BU2.js +25 -0
  279. package/dist/snapshots/index.js +10 -10
  280. package/dist/snapshots/index.js.map +1 -1
  281. package/dist/{stale-ARHFVL5U.js → stale-TH7SSVRV.js} +10 -10
  282. package/dist/storage-WSF7ZKTL.js +23 -0
  283. package/dist/{store-coordination-provider-GFCUOBR6.js → store-coordination-provider-R27VRD6K.js} +18 -12
  284. package/dist/store-coordination-provider-R27VRD6K.js.map +1 -0
  285. package/dist/sync/index.js +11 -11
  286. package/dist/team/index.js +15 -14
  287. package/dist/tiers/index.js +11 -10
  288. package/dist/to/index.js +17 -9
  289. package/dist/to/index.js.map +1 -1
  290. package/dist/transactions/index.js +4 -4
  291. package/dist/{ulid-PTAIMDG4.js → ulid-VQW6ERQN.js} +2 -2
  292. package/dist/util/index.js +1 -1
  293. package/dist/vault-head/index.js +115 -0
  294. package/dist/vault-head/index.js.map +1 -0
  295. package/dist/{verify-RO5RTZOJ.js → verify-M5LQH43C.js} +5 -5
  296. package/dist/via/blob/index.d.ts +3 -0
  297. package/dist/via/lookup/handle.d.ts +4 -1
  298. package/dist/walk-NABCHDZN.js +21 -0
  299. package/dist/with-audit/periods/index.d.ts +3 -3
  300. package/dist/with-audit/periods/periods.d.ts +82 -2
  301. package/dist/with-audit/periods/strategy.d.ts +1 -1
  302. package/dist/with-audit/periods/vault-facade.d.ts +54 -1
  303. package/dist/with-audit/periods/window.d.ts +10 -0
  304. package/dist/with-audit/sealed-record/index.d.ts +13 -0
  305. package/dist/with-audit/tiers/index.d.ts +17 -2
  306. package/dist/with-cargo/adopt-partition.d.ts +1 -1
  307. package/dist/with-cargo/extract-partition.d.ts +1 -1
  308. package/dist/with-cargo/index.d.ts +1 -1
  309. package/dist/with-commit/history/history.d.ts +26 -0
  310. package/dist/with-commit/history/index.d.ts +2 -1
  311. package/dist/with-commit/history/ledger/store.d.ts +7 -1
  312. package/dist/with-commit/history/strategy.d.ts +11 -1
  313. package/dist/with-commit/numbering/index.d.ts +0 -5
  314. package/dist/with-commit/vault-head/active.d.ts +2 -0
  315. package/dist/with-commit/vault-head/head.d.ts +28 -0
  316. package/dist/with-commit/vault-head/index.d.ts +10 -0
  317. package/dist/with-commit/vault-head/strategy.d.ts +127 -0
  318. package/dist/with-commit/vault-head/verify.d.ts +90 -0
  319. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +4 -0
  320. package/dist/with-formula/materialized-views/projection-legs.d.ts +59 -0
  321. package/dist/with-formula/materialized-views/registry.d.ts +50 -0
  322. package/dist/with-formula/materialized-views/types.d.ts +68 -10
  323. package/dist/with-party/directory/cover/storage.d.ts +0 -8
  324. package/dist/with-party/directory/storage.d.ts +0 -11
  325. package/dist/with-party/directory/visibility.d.ts +0 -21
  326. package/dist/with-party/policy/storage.d.ts +0 -10
  327. package/dist/with-party/team/index.d.ts +1 -1
  328. package/dist/with-party/team/keyring.d.ts +139 -2
  329. package/dist/with-party/team/noydb-facade.d.ts +5 -1
  330. package/dist/with-party/team/roster-tag.d.ts +101 -0
  331. package/dist/with-party/team/tiers.d.ts +2 -1
  332. package/dist/with-pod/format.d.ts +10 -12
  333. package/dist/with-pod/index.d.ts +10 -10
  334. package/dist/with-pod/open.d.ts +2 -2
  335. package/dist/with-pod/pod-handle.d.ts +19 -0
  336. package/dist/with-pod/pod-store.d.ts +0 -8
  337. package/dist/with-pod/{bundle.d.ts → pod.d.ts} +11 -19
  338. package/dist/with-pod/ulid.d.ts +1 -1
  339. package/dist/with-shape/blobs/blob-compaction.d.ts +13 -0
  340. package/dist/with-shape/blobs/blob-set.d.ts +83 -11
  341. package/dist/with-shape/blobs/orphan-report.d.ts +62 -0
  342. package/dist/with-shape/introspection/index.d.ts +1 -0
  343. package/dist/with-sync/engine.d.ts +54 -5
  344. package/dist/with-sync/strategy.d.ts +3 -0
  345. package/dist/withdraw-accessible-VCINIG6V.js +28 -0
  346. package/package.json +10 -4
  347. package/dist/api-RXUMEKT3.js +0 -20
  348. package/dist/backup-KULFZ2T4.js.map +0 -1
  349. package/dist/bundle-handle-GFNHT52M.js +0 -36
  350. package/dist/bundle-handle-GFNHT52M.js.map +0 -1
  351. package/dist/chunk-2DHSSLOD.js.map +0 -1
  352. package/dist/chunk-3737A6EA.js.map +0 -1
  353. package/dist/chunk-3IXIU6FP.js.map +0 -1
  354. package/dist/chunk-3URQC7EH.js.map +0 -1
  355. package/dist/chunk-4GZ6XOVW.js.map +0 -1
  356. package/dist/chunk-4I72F5DF.js.map +0 -1
  357. package/dist/chunk-4VUPLMZ6.js.map +0 -1
  358. package/dist/chunk-52JPHN5N.js.map +0 -1
  359. package/dist/chunk-55LKVALY.js.map +0 -1
  360. package/dist/chunk-5JY5TSVY.js.map +0 -1
  361. package/dist/chunk-5ZKS6ZE2.js.map +0 -1
  362. package/dist/chunk-6BU3L4UE.js.map +0 -1
  363. package/dist/chunk-6NVPFKN3.js.map +0 -1
  364. package/dist/chunk-7F4DBNSP.js.map +0 -1
  365. package/dist/chunk-7G6VDWXB.js.map +0 -1
  366. package/dist/chunk-7H73RIE3.js +0 -45
  367. package/dist/chunk-7H73RIE3.js.map +0 -1
  368. package/dist/chunk-7MNBICB5.js.map +0 -1
  369. package/dist/chunk-AFHQATY4.js +0 -47
  370. package/dist/chunk-AFHQATY4.js.map +0 -1
  371. package/dist/chunk-AHLJSVRL.js.map +0 -1
  372. package/dist/chunk-BEFVYAR5.js.map +0 -1
  373. package/dist/chunk-CDB2HVQW.js.map +0 -1
  374. package/dist/chunk-CEJWMBXO.js.map +0 -1
  375. package/dist/chunk-E6427JU2.js.map +0 -1
  376. package/dist/chunk-FFDNKRCY.js.map +0 -1
  377. package/dist/chunk-FZ6NYJ7L.js.map +0 -1
  378. package/dist/chunk-G6S5VVHP.js.map +0 -1
  379. package/dist/chunk-GAG7QOVO.js.map +0 -1
  380. package/dist/chunk-H73G4XF4.js.map +0 -1
  381. package/dist/chunk-HNGSV2YC.js.map +0 -1
  382. package/dist/chunk-IGJCYUT5.js.map +0 -1
  383. package/dist/chunk-IMZLOJTK.js.map +0 -1
  384. package/dist/chunk-J7FM3RAU.js.map +0 -1
  385. package/dist/chunk-JJNOLSG5.js.map +0 -1
  386. package/dist/chunk-JRKZTEZZ.js.map +0 -1
  387. package/dist/chunk-JXIDGFKS.js.map +0 -1
  388. package/dist/chunk-NPP5R7FF.js.map +0 -1
  389. package/dist/chunk-O2ERS4UJ.js.map +0 -1
  390. package/dist/chunk-PDLLCOGD.js.map +0 -1
  391. package/dist/chunk-PL2GHSCM.js.map +0 -1
  392. package/dist/chunk-PNKHAKQ7.js.map +0 -1
  393. package/dist/chunk-PXCBVDFY.js.map +0 -1
  394. package/dist/chunk-Q6TEJXBX.js.map +0 -1
  395. package/dist/chunk-UHXCLPGC.js.map +0 -1
  396. package/dist/chunk-VCETL77O.js.map +0 -1
  397. package/dist/chunk-VZ3XFUQ7.js.map +0 -1
  398. package/dist/chunk-W77KZHCW.js.map +0 -1
  399. package/dist/chunk-WASHZV34.js.map +0 -1
  400. package/dist/chunk-WFUIE565.js.map +0 -1
  401. package/dist/chunk-WK5XUYYF.js.map +0 -1
  402. package/dist/chunk-XWX7GL56.js.map +0 -1
  403. package/dist/chunk-YPYHVOXP.js.map +0 -1
  404. package/dist/chunk-ZJADGNYF.js.map +0 -1
  405. package/dist/collection-facade-QEJIM6BC.js +0 -45
  406. package/dist/delegation-MO7YZYJS.js.map +0 -1
  407. package/dist/derive-IUA6JFLB.js +0 -22
  408. package/dist/dispatch-FZEAWKVM.js.map +0 -1
  409. package/dist/executor-CYJQLKKI.js +0 -9
  410. package/dist/executor-S4QIKEHW.js +0 -9
  411. package/dist/executor-YIQB2S6N.js +0 -29
  412. package/dist/export-accessible-4S36PQNR.js +0 -23
  413. package/dist/extract-partition-IO7FDZ2P.js +0 -38
  414. package/dist/fanout-sidecar-NNAJQXMX.js.map +0 -1
  415. package/dist/find-RBBYKXI7.js +0 -11
  416. package/dist/issue-RIVHSY2S.js +0 -19
  417. package/dist/liberate-GFN4C7RR.js +0 -24
  418. package/dist/noydb-3MT74MZS.js +0 -83
  419. package/dist/register-4EFJCVYD.js +0 -32
  420. package/dist/registry-4SDHHOJ7.js +0 -18
  421. package/dist/registry-CZVINVQH.js +0 -9
  422. package/dist/registry-IKUR2MXD.js +0 -9
  423. package/dist/registry-OYTFGWVK.js +0 -19
  424. package/dist/request-withdrawal-KGXGDPVQ.js +0 -31
  425. package/dist/revoke-JFN773KF.js +0 -24
  426. package/dist/seed-GDV5PT4R.js.map +0 -1
  427. package/dist/signer-TA55QB6R.js +0 -25
  428. package/dist/storage-V7MTFAQJ.js +0 -23
  429. package/dist/store-coordination-provider-GFCUOBR6.js.map +0 -1
  430. package/dist/walk-3ZECBFDA.js +0 -21
  431. package/dist/with-pod/bundle-handle.d.ts +0 -9
  432. package/dist/withdraw-accessible-7PG4DYQK.js +0 -28
  433. /package/dist/{api-RXUMEKT3.js.map → api-6X2VLZ7J.js.map} +0 -0
  434. /package/dist/{chunk-KUDZVJKQ.js.map → chunk-22GR3O4J.js.map} +0 -0
  435. /package/dist/{chunk-CCZJJ4I2.js.map → chunk-2CBFYXJX.js.map} +0 -0
  436. /package/dist/{chunk-FAXZQ5UF.js.map → chunk-323MN67Z.js.map} +0 -0
  437. /package/dist/{chunk-VMCCGUQB.js.map → chunk-36CEG6CM.js.map} +0 -0
  438. /package/dist/{chunk-747LRSOO.js.map → chunk-4K6BIMLF.js.map} +0 -0
  439. /package/dist/{chunk-FNSMZQS4.js.map → chunk-5IHGJHWC.js.map} +0 -0
  440. /package/dist/{chunk-7TSYBD3E.js.map → chunk-65JXA63J.js.map} +0 -0
  441. /package/dist/{chunk-Z45YRGFO.js.map → chunk-6NR36UNB.js.map} +0 -0
  442. /package/dist/{chunk-3JVXVJ7L.js.map → chunk-7OBIBPCV.js.map} +0 -0
  443. /package/dist/{chunk-AR2JDFAE.js.map → chunk-7Q3RHOA5.js.map} +0 -0
  444. /package/dist/{chunk-QULVCV3M.js.map → chunk-AJGGBXWA.js.map} +0 -0
  445. /package/dist/{chunk-CADUYBQD.js.map → chunk-ATL3ZVXT.js.map} +0 -0
  446. /package/dist/{chunk-DMQCLZ4Z.js.map → chunk-ATY3ZASK.js.map} +0 -0
  447. /package/dist/{chunk-4HDYQL3J.js.map → chunk-B4CRUZPR.js.map} +0 -0
  448. /package/dist/{chunk-6SAFL5YE.js.map → chunk-BZ3WMOYX.js.map} +0 -0
  449. /package/dist/{chunk-HXGUIPQB.js.map → chunk-CKKN25P2.js.map} +0 -0
  450. /package/dist/{chunk-6HFM7EIT.js.map → chunk-EHRIDNZX.js.map} +0 -0
  451. /package/dist/{chunk-RTAMLDWP.js.map → chunk-FU5VYEYK.js.map} +0 -0
  452. /package/dist/{chunk-RXYYFSBB.js.map → chunk-GKTW3KLV.js.map} +0 -0
  453. /package/dist/{chunk-OF3L2SD6.js.map → chunk-HOPNIR5R.js.map} +0 -0
  454. /package/dist/{chunk-ADW22QSB.js.map → chunk-HWI7GHJZ.js.map} +0 -0
  455. /package/dist/{chunk-GQ3BX5EA.js.map → chunk-I3ISCYT7.js.map} +0 -0
  456. /package/dist/{chunk-NJDQ4YSV.js.map → chunk-IWQPYT6S.js.map} +0 -0
  457. /package/dist/{chunk-2Z3NCLNX.js.map → chunk-JHYKSMVX.js.map} +0 -0
  458. /package/dist/{chunk-6FJWSWFT.js.map → chunk-JIHWBKMQ.js.map} +0 -0
  459. /package/dist/{chunk-YAWK6AWF.js.map → chunk-JKATP6OE.js.map} +0 -0
  460. /package/dist/{chunk-DG27IUVI.js.map → chunk-LC6NE4IQ.js.map} +0 -0
  461. /package/dist/{chunk-VJFMXYKP.js.map → chunk-MPKP6L5E.js.map} +0 -0
  462. /package/dist/{chunk-FUHKW252.js.map → chunk-OCJ3JA4O.js.map} +0 -0
  463. /package/dist/{chunk-WLYIROCJ.js.map → chunk-OQMCFHUX.js.map} +0 -0
  464. /package/dist/{chunk-JRCYZEHU.js.map → chunk-OR2FYRYR.js.map} +0 -0
  465. /package/dist/{chunk-HNHCQ556.js.map → chunk-PFWE7FJG.js.map} +0 -0
  466. /package/dist/{chunk-U5O6GIWZ.js.map → chunk-POFYIGQ2.js.map} +0 -0
  467. /package/dist/{chunk-35EBKWQU.js.map → chunk-QH47SQLD.js.map} +0 -0
  468. /package/dist/{chunk-HVQGCKY4.js.map → chunk-QVXZFJBU.js.map} +0 -0
  469. /package/dist/{chunk-FMQJZH4R.js.map → chunk-RDB66EKD.js.map} +0 -0
  470. /package/dist/{chunk-X56RTUK3.js.map → chunk-RJZQ2PVD.js.map} +0 -0
  471. /package/dist/{chunk-SUFG5E73.js.map → chunk-RPRASGEY.js.map} +0 -0
  472. /package/dist/{chunk-JIUVJ4M7.js.map → chunk-S7PM7Z4K.js.map} +0 -0
  473. /package/dist/{chunk-N35NC4JH.js.map → chunk-TKBB62DN.js.map} +0 -0
  474. /package/dist/{chunk-4UVDI4XE.js.map → chunk-WPZ5FVAS.js.map} +0 -0
  475. /package/dist/{chunk-MSWYQLMQ.js.map → chunk-XINT4VJA.js.map} +0 -0
  476. /package/dist/{chunk-W3TVWF6N.js.map → chunk-YCGLAANM.js.map} +0 -0
  477. /package/dist/{chunk-FDX7OWWI.js.map → chunk-YYV53EHO.js.map} +0 -0
  478. /package/dist/{classified-marker-2KJAXRRO.js.map → classified-marker-AZDSDG6V.js.map} +0 -0
  479. /package/dist/{collection-facade-QEJIM6BC.js.map → collection-facade-WSUAYFJ4.js.map} +0 -0
  480. /package/dist/{computed-6G5M3UPH.js.map → computed-VG2PCM4L.js.map} +0 -0
  481. /package/dist/{dead-filter-DCB62VWW.js.map → dead-filter-JNQNB3TA.js.map} +0 -0
  482. /package/dist/{derive-IUA6JFLB.js.map → derive-MPOGZ4NR.js.map} +0 -0
  483. /package/dist/{dispatch-MJ6SHB3Y.js.map → dispatch-3ZA733EY.js.map} +0 -0
  484. /package/dist/{enclave-JU4YIEPB.js.map → enclave-Y2ALNDRD.js.map} +0 -0
  485. /package/dist/{executor-CYJQLKKI.js.map → executor-BBEEUFO3.js.map} +0 -0
  486. /package/dist/{executor-S4QIKEHW.js.map → executor-G6G3YEWR.js.map} +0 -0
  487. /package/dist/{executor-YIQB2S6N.js.map → executor-ZUTUMTPA.js.map} +0 -0
  488. /package/dist/{export-accessible-4S36PQNR.js.map → export-accessible-S3KEB763.js.map} +0 -0
  489. /package/dist/{extract-partition-IO7FDZ2P.js.map → extract-partition-KVCTSUVE.js.map} +0 -0
  490. /package/dist/{find-RBBYKXI7.js.map → find-V4FN5ITT.js.map} +0 -0
  491. /package/dist/{issue-RIVHSY2S.js.map → issue-5CFBWBRX.js.map} +0 -0
  492. /package/dist/{ledger-AETNF4OM.js.map → ledger-MQIIOTZB.js.map} +0 -0
  493. /package/dist/{liberate-GFN4C7RR.js.map → liberate-LW7OKVBH.js.map} +0 -0
  494. /package/dist/{link-set-E5HNY67I.js.map → link-set-5PJBBR63.js.map} +0 -0
  495. /package/dist/{managed-secret-CWQ6PND5.js.map → managed-secret-ETDG6AAE.js.map} +0 -0
  496. /package/dist/{noydb-3MT74MZS.js.map → noydb-LFDRMYZ5.js.map} +0 -0
  497. /package/dist/{post-register-2XSSMGEQ.js.map → post-register-QCJYRMIK.js.map} +0 -0
  498. /package/dist/{register-4EFJCVYD.js.map → register-JBOEHTVX.js.map} +0 -0
  499. /package/dist/{registry-4SDHHOJ7.js.map → registry-5DYHQFJS.js.map} +0 -0
  500. /package/dist/{registry-CZVINVQH.js.map → registry-EANV44W2.js.map} +0 -0
  501. /package/dist/{registry-IKUR2MXD.js.map → registry-J25H6VB4.js.map} +0 -0
  502. /package/dist/{registry-OYTFGWVK.js.map → registry-R23SQUQH.js.map} +0 -0
  503. /package/dist/{request-withdrawal-KGXGDPVQ.js.map → request-withdrawal-KQ4W4UT5.js.map} +0 -0
  504. /package/dist/{reveal-BW36KCOQ.js.map → reveal-W7BKZSUP.js.map} +0 -0
  505. /package/dist/{revoke-JFN773KF.js.map → revoke-H3VSTAIE.js.map} +0 -0
  506. /package/dist/{signer-TA55QB6R.js.map → signer-53AQ3BU2.js.map} +0 -0
  507. /package/dist/{stale-ARHFVL5U.js.map → stale-TH7SSVRV.js.map} +0 -0
  508. /package/dist/{storage-V7MTFAQJ.js.map → storage-WSF7ZKTL.js.map} +0 -0
  509. /package/dist/{ulid-PTAIMDG4.js.map → ulid-VQW6ERQN.js.map} +0 -0
  510. /package/dist/{verify-RO5RTZOJ.js.map → verify-M5LQH43C.js.map} +0 -0
  511. /package/dist/{walk-3ZECBFDA.js.map → walk-NABCHDZN.js.map} +0 -0
  512. /package/dist/{withdraw-accessible-7PG4DYQK.js.map → withdraw-accessible-VCINIG6V.js.map} +0 -0
@@ -34,6 +34,7 @@ import type { PeriodsStrategy } from '../with-audit/periods/strategy.js';
34
34
  import type { ShadowStrategy } from '../with-fork/shadow/strategy.js';
35
35
  import type { TransactionsStrategy } from '../with-commit/tx/strategy.js';
36
36
  import type { HistoryStrategy } from '../with-commit/history/strategy.js';
37
+ import type { VaultHeadStrategy } from '../with-commit/vault-head/strategy.js';
37
38
  import type { ForgetStrategy } from '../with-audit/forget/strategy.js';
38
39
  import type { SnapshotsStrategy } from '../with-fork/snapshots/strategy.js';
39
40
  import type { DerivationSkippedFrozen } from './via/dispatch.js';
@@ -71,7 +72,7 @@ export type { EchoSecretParts };
71
72
  /** Format version for encrypted record envelopes. */
72
73
  export declare const NOYDB_FORMAT_VERSION: 1;
73
74
  /** Format version for keyring files. */
74
- export declare const NOYDB_KEYRING_VERSION: 1;
75
+ export declare const NOYDB_KEYRING_VERSION: 2;
75
76
  /** Format version for backup files. */
76
77
  export declare const NOYDB_BACKUP_VERSION: 1;
77
78
  /** Format version for sync metadata. */
@@ -908,6 +909,21 @@ export interface KeyringFile {
908
909
  readonly role: Role;
909
910
  readonly permissions: Permissions;
910
911
  readonly deks: Record<string, string>;
912
+ /**
913
+ * DEKs for a rotation that has STARTED but not committed (#1074).
914
+ *
915
+ * `rotateKeys` persists the new DEK here *before* rewriting any record, so an
916
+ * interruption can never strand records under a key that was only ever in
917
+ * memory. On commit these move into `deks` and this is cleared.
918
+ *
919
+ * Present on disk ⇒ a rotation was interrupted and the collection may hold
920
+ * records on both sides of the migration. Re-running `rotateKeys` resumes
921
+ * with this key rather than minting a fresh one.
922
+ *
923
+ * Optional: absent on every keyring written before this existed, and absent
924
+ * in the normal committed state.
925
+ */
926
+ readonly pending_deks?: Record<string, string>;
911
927
  readonly salt: string;
912
928
  readonly created_at: string;
913
929
  readonly granted_by: string;
@@ -915,17 +931,31 @@ export interface KeyringFile {
915
931
  * Secret canary — base64 AES-KW-wrapped form of a known constant
916
932
  * 256-bit value, wrapped under the keyring's KEK.
917
933
  *
918
- * Optional: older keyrings load with no canary and fall back to
919
- * the multi-DEK corruption heuristic. Newer keyrings
920
- * carry one and let `loadKeyring` distinguish wrong-secret
921
- * from corruption even when ALL DEKs (including a single-DEK keyring's
922
- * sole DEK) are corrupted.
934
+ * Lets `loadKeyring` distinguish wrong-secret from corruption even when
935
+ * ALL DEKs (including a single-DEK keyring's sole DEK) are corrupted: the
936
+ * canary unwrapping proves the KEK correct independent of any DEK byte.
923
937
  *
924
938
  * AES-KW is deterministic — every write site mints fresh on each
925
939
  * persist; same KEK + same constant input always produces the same
926
940
  * ciphertext, so this round-trips without state.
941
+ *
942
+ * REQUIRED as of #1096 (no-legacy policy): the pre-canary fallback
943
+ * heuristic is deleted, so an absent canary is not an old file, it is a
944
+ * store that stripped the field — `KeyringTamperedError('canary-missing')`.
945
+ */
946
+ readonly canary: string;
947
+ /**
948
+ * #1096 — AES-GCM({iv,data}) of the canonical authority fields
949
+ * (user_id, role, permissions, granted_by, expires_at, capabilities)
950
+ * under the vault roster key (carried as `deks[ROSTER_KEY_ID]`).
951
+ * Required: a valid canary with a missing or mismatching tag is refused
952
+ * as KeyringTamperedError — absence must itself be an error, or a store
953
+ * opts out of verification by deleting a plaintext field.
927
954
  */
928
- readonly canary?: string;
955
+ readonly roster_tag: {
956
+ readonly iv: string;
957
+ readonly data: string;
958
+ };
929
959
  /**
930
960
  * Tier-2 authenticator slots (multi-slot keyring extension).
931
961
  * Optional / append-only: keyring files written before the
@@ -956,7 +986,7 @@ export interface KeyringFile {
956
986
  * "this slot works for 30 days then becomes opaque to its holder."
957
987
  *
958
988
  * Absent on live keyrings written via `db.grant()` — the field is
959
- * meaningful for `BundleRecipient` slots produced by
989
+ * meaningful for `PodRecipient` slots produced by
960
990
  * `writePod({ recipients: [...] })`. Setting it on a live
961
991
  * keyring is allowed but unusual.
962
992
  */
@@ -1284,9 +1314,38 @@ export interface SyncTransactionResult {
1284
1314
  }
1285
1315
  export interface SyncStatus {
1286
1316
  readonly dirty: number;
1317
+ /**
1318
+ * ISO 8601 timestamp of the last push that completed with **no errors**, or
1319
+ * `null` if none ever has (#1036). A failed attempt does not advance it — so
1320
+ * this answers "when did my data last reach the remote?", which is the reading
1321
+ * the name invites and the one the field previously did not honour.
1322
+ */
1287
1323
  readonly lastPush: string | null;
1324
+ /** As {@link SyncStatus.lastPush}, for pulls: last pull that had no errors. */
1288
1325
  readonly lastPull: string | null;
1326
+ /**
1327
+ * Whether the **browser** reports network connectivity — driven solely by the
1328
+ * global `online`/`offline` events (#1034). It is NOT target reachability: an
1329
+ * unreachable store never flips it, and losing Wi-Fi flips it for every target
1330
+ * at once. To detect a failing target, read {@link SyncStatus.lastError}.
1331
+ */
1289
1332
  readonly online: boolean;
1333
+ /**
1334
+ * The failure that ended the most recent push/pull, cleared by the next
1335
+ * success (#1036). **Absent** when nothing has failed since the last success —
1336
+ * so `lastPush: null` with no `lastError` means "never synced", while
1337
+ * `lastPush` set plus a `lastError` means "synced then, failing since".
1338
+ *
1339
+ * Live state, not persisted: a reload cannot know whether the target still
1340
+ * fails, so it starts absent until the next attempt says otherwise.
1341
+ */
1342
+ readonly lastError?: {
1343
+ /** ISO 8601 timestamp of the failed attempt. */
1344
+ readonly at: string;
1345
+ readonly op: 'push' | 'pull';
1346
+ /** Message of the first error the attempt collected. */
1347
+ readonly message: string;
1348
+ };
1290
1349
  /**
1291
1350
  * Per-collection readiness under a `'phased'` pull policy (#809). **Absent**
1292
1351
  * for every other policy, and a collection the sequence never names is absent
@@ -1329,6 +1388,41 @@ export interface SyncTarget {
1329
1388
  * (#948). Deliberately omits any preset *name* — a resolved `SyncPolicy` doesn't
1330
1389
  * retain which preset (if any) it came from, so only its push/pull mode is surfaced.
1331
1390
  */
1391
+ /**
1392
+ * Per-target sync state (#1034). `syncStatus()` answers for the vault as a
1393
+ * whole; this answers per target, which is what a redundant topology needs in
1394
+ * order to say "the LAN store is unavailable — syncing via the cloud" rather
1395
+ * than just "something is wrong".
1396
+ *
1397
+ * Deliberately carries **no `online` flag.** `SyncStatus.online` reflects the
1398
+ * *browser's* global connectivity — it is set only by the `online`/`offline`
1399
+ * window events and no store outcome ever changes it, so every engine flips at
1400
+ * once for the same reason. Exposing it per target would make a global signal
1401
+ * look per-target: a status list would appear to update row by row while every
1402
+ * row actually moved together. Per-target *reachability* derived from real
1403
+ * store outcomes is a separate, still-unbuilt thing.
1404
+ */
1405
+ export interface SyncTargetStatus {
1406
+ /** As registered. `undefined` when the target was declared without one. */
1407
+ readonly label: string | undefined;
1408
+ readonly role: SyncTargetRole;
1409
+ /** Pending local writes for this target. */
1410
+ readonly dirty: number;
1411
+ /** Last push that completed with no errors, or `null`. See {@link SyncStatus.lastPush}. */
1412
+ readonly lastPush: string | null;
1413
+ /** Last pull that completed with no errors, or `null`. */
1414
+ readonly lastPull: string | null;
1415
+ /**
1416
+ * Nothing queued for this target — `dirty === 0`.
1417
+ *
1418
+ * Well-defined for every role: for a `sync-peer` it means the two sides
1419
+ * agree as of the last exchange; for a push-only `backup` it means every
1420
+ * local write has reached it. It is a statement about the *outbound* queue
1421
+ * only, and says nothing about whether the target holds data this client has
1422
+ * not pulled.
1423
+ */
1424
+ readonly caughtUp: boolean;
1425
+ }
1332
1426
  export interface SyncTargetInfo {
1333
1427
  readonly label: string | undefined;
1334
1428
  readonly role: SyncTargetRole;
@@ -1544,7 +1638,6 @@ export interface UpdateUserOptions {
1544
1638
  }
1545
1639
  export interface RevokeOptions {
1546
1640
  readonly userId: string;
1547
- readonly rotateKeys?: boolean;
1548
1641
  /**
1549
1642
  * Cascade behavior when the revoked user is an admin who has granted
1550
1643
  * other admins.
@@ -1868,10 +1961,10 @@ export interface CrdtStrategy {
1868
1961
  * that operate on whole-vault bundles rather than per-record KV.
1869
1962
  *
1870
1963
  * Implement `readBundle` / `writeBundle` instead of the six-method KV
1871
- * contract. Use `wrapBundleStore()` from `@noy-db/hub` to convert to a
1964
+ * contract. Use `wrapPodStore()` from `@noy-db/hub` to convert to a
1872
1965
  * `NoydbStore` that the rest of the API consumes transparently.
1873
1966
  *
1874
- * Named `NoydbPodStore` (not `NoydbBundleAdapter`) for consistency
1967
+ * Named `NoydbPodStore` for consistency
1875
1968
  * with the hub / to-* / in-* rename. Concrete implementations ship
1876
1969
  * in `@noy-db/to-*` packages starting in.
1877
1970
  */
@@ -1907,8 +2000,6 @@ export interface NoydbPodStore {
1907
2000
  size: number;
1908
2001
  }>>;
1909
2002
  }
1910
- /** @deprecated Use `NoydbPodStore`. */
1911
- export type NoydbBundleStore = NoydbPodStore;
1912
2003
  /**
1913
2004
  * Content-addressed blob object stored in the vault-level blob index.
1914
2005
  * Identified by HMAC-SHA-256(blobDEK, plaintext) — opaque to the store.
@@ -2354,6 +2445,13 @@ export interface NoydbOptions {
2354
2445
  * @internal
2355
2446
  */
2356
2447
  readonly historyStrategy?: HistoryStrategy;
2448
+ /**
2449
+ * #1044 — opt in to the vault head, which detects a store that WITHHOLDS.
2450
+ * `withVaultHead()` from `@noy-db/hub/vault-head`. Costs one small write per
2451
+ * commit; on a single-device offline vault it defends against nothing, which
2452
+ * is why it is opt-in while AAD is not.
2453
+ */
2454
+ readonly vaultHeadStrategy?: VaultHeadStrategy;
2357
2455
  /**
2358
2456
  * GDPR right-to-erasure. Pass `withForget({ subjects })`
2359
2457
  * from `@noy-db/hub/forget` to declare which collections carry erasable
@@ -6,7 +6,7 @@ import type { IssueDelegationOptions, DelegationToken } from '../with-party/team
6
6
  import { Collection } from './collection.js';
7
7
  import type { JoinableSource } from './query/index.js';
8
8
  import type { OnDirtyCallback } from './collection.js';
9
- import type { UnlockedKeyring, BundleRecipient } from '../with-party/team/keyring.js';
9
+ import type { UnlockedKeyring, PodRecipient } from '../with-party/team/keyring.js';
10
10
  import type { MaterializedViewRegistry } from '../with-formula/materialized-views/registry.js';
11
11
  import type { MaterializedViewStrategy } from '../with-formula/materialized-views/types.js';
12
12
  import type { OverlayedViewRegistry } from '../with-formula/overlay-views/registry.js';
@@ -29,7 +29,7 @@ import { type ForgetResult } from '../with-audit/forget/strategy.js';
29
29
  import { type SubjectRef } from '../with-audit/forget/subject-index.js';
30
30
  import type { VaultFrame } from '../with-fork/shadow/vault-frame.js';
31
31
  import type { ConsentContext, ConsentAuditEntry, ConsentAuditFilter, ConsentOp } from '../with-audit/consent/consent.js';
32
- import { type PeriodScope, type PeriodGuardPrior } from '../with-audit/periods/vault-facade.js';
32
+ import { type PeriodScope, type PeriodGuardPrior, type ReopenPeriodOptions, type PeriodScopeWithReason } from '../with-audit/periods/vault-facade.js';
33
33
  import { type RefDescriptor, type RefViolation } from './refs.js';
34
34
  import type { DictionaryHandle, DictionaryOptions } from '../port/with/i18n-strategy.js';
35
35
  import { type LinkSpec, type LinkSetHandle } from '../with-shape/links/names.js';
@@ -42,7 +42,7 @@ import type { DerivationRegistry } from '../with-formula/derivations/registry.js
42
42
  import type { DerivationStrategy } from '../with-formula/derivations/types.js';
43
43
  import { type BehaviorSummary } from '../with-shape/introspection/behaviors.js';
44
44
  import type { JoinedHandle } from '../with-shape/satellites/types.js';
45
- import { type PeriodRecord, type ClosePeriodOptions, type OpenPeriodOptions } from '../with-audit/periods/index.js';
45
+ import { type PeriodRecord, type PeriodReopenEvent, type ClosePeriodOptions, type OpenPeriodOptions } from '../with-audit/periods/index.js';
46
46
  import { type EnclaveKey } from './enclave/index.js';
47
47
  import type { RecipientSealer } from '../with-party/team/managed-secret.js';
48
48
  import { type ExportBlobsOptions, type ExportBlobsHandle } from '../with-shape/blobs/export-blobs.js';
@@ -336,7 +336,7 @@ export declare class Vault {
336
336
  * unblocks R-S7 when a base gains forget coverage after its satellite was
337
337
  * already declared without `perRecordKeys`. Call BEFORE re-declaring with
338
338
  * `{ satelliteOf, perRecordKeys: true }` AND before this collection serves
339
- * writes (unfenced walk — see {@link migrateSatelliteCek}); resumable.
339
+ * writes (unfenced walk — see `with-shape/satellites/migrate-cek.ts`); resumable.
340
340
  */
341
341
  migrateSatellitePerRecordKeys(satelliteName: string): Promise<{
342
342
  migrated: number;
@@ -574,7 +574,7 @@ export declare class Vault {
574
574
  *
575
575
  * @public
576
576
  */
577
- buildBundleRecipientKeyrings(recipients: readonly BundleRecipient[]): Promise<Record<string, KeyringFile>>;
577
+ buildBundleRecipientKeyrings(recipients: readonly PodRecipient[]): Promise<Record<string, KeyringFile>>;
578
578
  /**
579
579
  * Authorize an `@noy-db/as-*` export against the current keyring's
580
580
  * `exportCapability`. Throws `ExportCapabilityError` if
@@ -745,7 +745,7 @@ export declare class Vault {
745
745
  *
746
746
  * @internal
747
747
  */
748
- _decryptEnvelopeForBundleFilter(env: EncryptedEnvelope, collectionName: string): Promise<unknown>;
748
+ _decryptEnvelopeForBundleFilter(env: EncryptedEnvelope, collectionName: string, recordId: string): Promise<unknown>;
749
749
  /**
750
750
  * Read-only accessor for the invoking keyring's import capability
751
751
  * (issue ). UI affordance — returns false in every default-closed
@@ -1267,6 +1267,12 @@ export declare class Vault {
1267
1267
  * companion and is re-runnable.
1268
1268
  */
1269
1269
  purgePeriodTargets(name: string, options?: PeriodScope): Promise<PeriodRecord>;
1270
+ /** Return a closed period to writable (#1022); logged append-only, close chain untouched. */
1271
+ reopenPeriod(name: string, options?: ReopenPeriodOptions): Promise<PeriodRecord>;
1272
+ /** Seal a reopened period again (#1022) rather than waiting for its `until` to lapse. */
1273
+ reclosePeriod(name: string, options?: PeriodScopeWithReason): Promise<PeriodRecord>;
1274
+ /** The append-only reopen/reclose log for one period (#1022), in order. */
1275
+ listPeriodReopens(name: string, options?: PeriodScope): Promise<readonly PeriodReopenEvent[]>;
1270
1276
  /** @internal — called by the gate bus before put/delete. */
1271
1277
  _assertTsWritable(existing: PeriodGuardPrior | null, incoming: Record<string, unknown> | null, collection?: string): Promise<void>;
1272
1278
  /** List all collection names in this vault. */
@@ -1342,12 +1348,12 @@ export declare class Vault {
1342
1348
  * distinct handles, which is the right behavior — they're
1343
1349
  * separate vault instances now.
1344
1350
  */
1345
- getBundleHandle(): Promise<string>;
1351
+ getPodHandle(): Promise<string>;
1346
1352
  /**
1347
1353
  * Read the owner-curated cover for this vault (or `undefined` if
1348
1354
  * none is persisted). The cover lives in `_meta/public-envelope`
1349
1355
  * (the frozen wire name) as plaintext — readable without any KEK
1350
- * — so `getBundleHandle`-style callers can label a vault before
1356
+ * — so `getPodHandle`-style callers can label a vault before
1351
1357
  * unlock.
1352
1358
  *
1353
1359
  * Mirrors `Noydb.getCover(vault, opts)` but scoped to a
@@ -47,8 +47,17 @@ export interface ViaCryptoCtx {
47
47
  delete(field: string): Promise<void>;
48
48
  };
49
49
  reservedEnvelopes(prefix: string): {
50
- encrypt(collection: string, json: string, v: number): Promise<EncryptedEnvelope>;
51
- decrypt(collection: string, env: EncryptedEnvelope): Promise<string>;
50
+ /**
51
+ * `id` is the record id the envelope will be stored under. Required
52
+ * (#1051) because this function holds the DEK, so it is where record-identity
53
+ * AAD is applied — a caller that cannot name the id cannot be bound.
54
+ */
55
+ encrypt(identity: {
56
+ readonly collection: string;
57
+ readonly id: string;
58
+ readonly by?: string;
59
+ }, json: string, v: number): Promise<EncryptedEnvelope>;
60
+ decrypt(collection: string, id: string, env: EncryptedEnvelope): Promise<string>;
52
61
  };
53
62
  }
54
63
  /** Per-call erase context — `forget()`'s per-ref participation door (phase C). */
@@ -38,6 +38,7 @@ import type { Collection } from '../collection.js';
38
38
  import { type HasWritableViaPipeline } from './pipeline.js';
39
39
  import { type MergedViaFields } from './compose.js';
40
40
  import type { ViaGraph } from './graph.js';
41
+ import type { RefDescriptor } from '../refs.js';
41
42
  import { type I18nStrategy, type I18nTextDescriptor, type DictKeyDescriptor, type StaticDictDescriptor, type DictionaryHandle } from '../../port/with/i18n-strategy.js';
42
43
  import { type LookupDescriptor } from '../../port/with/lookup-strategy.js';
43
44
  type AnyCollection = Collection<Record<string, unknown>>;
@@ -56,6 +57,8 @@ export interface ReconcilableCollection extends HasWritableViaPipeline {
56
57
  _applyFieldMeta(fieldMeta: Parameters<AnyCollection['_applyFieldMeta']>[0]): void;
57
58
  _applyMeta(meta: Parameters<AnyCollection['_applyMeta']>[0]): void;
58
59
  _applyClassifiedFields(classifiedFields: Parameters<AnyCollection['_applyClassifiedFields']>[0]): void;
60
+ /** #1141 — refresh the outbound-ref snapshot after a late `refs` declaration. */
61
+ _attachDeclaredRefs(refs: Parameters<AnyCollection['_attachDeclaredRefs']>[0]): void;
59
62
  /** #671 items 1-3 — the reader + writer seam for `getDictionary`/legacy describe() lists/`presentForJoin`. */
60
63
  readonly _viaFieldsSnapshot: AnyCollection['_viaFieldsSnapshot'];
61
64
  _reconcileReadState(patch: Parameters<AnyCollection['_reconcileReadState']>[0]): void;
@@ -66,6 +69,11 @@ export interface ReconcilableCollection extends HasWritableViaPipeline {
66
69
  * `autoTranslateHook` :1111-1155), passed as plain values (never `this: Vault`) so this module
67
70
  * never imports the `Vault` class. */
68
71
  export interface ViaReconcileVaultCtx {
72
+ /** #1141 — the vault's ref registry, so a late `refs` declaration can still reach it. */
73
+ readonly refRegistry: {
74
+ register(collection: string, refs: Record<string, RefDescriptor>): void;
75
+ getOutbound(collection: string): Record<string, RefDescriptor>;
76
+ };
69
77
  readonly i18nStrategy: I18nStrategy;
70
78
  /** — named `locale`, not `defaultLocale`, to match `Vault`'s own field name 1:1 (so `this`
71
79
  * satisfies this interface structurally with zero adapter object at the call site). */
@@ -137,6 +145,10 @@ export declare function reconcileLookupFields(coll: ReconcilableCollection, vaul
137
145
  * though a bare blobFields late-attach is otherwise silently inert, matching pre-#664 behavior). */
138
146
  export interface ReconcileLateAttachPlan {
139
147
  readonly effectiveViaFields: MergedViaFields;
148
+ /** #1141 — outbound `refs` from this `vault.collection()` call. Not a via binding: it lands in
149
+ * the VAULT's `RefRegistry`, which is why it was the one declaration with no late-attach path
150
+ * and got silently dropped whenever the collection already existed. */
151
+ readonly refs?: Record<string, RefDescriptor>;
140
152
  readonly computed?: Parameters<AnyCollection['_applyComputed']>[0];
141
153
  readonly fieldMeta?: Parameters<AnyCollection['_applyFieldMeta']>[0];
142
154
  readonly meta?: Parameters<AnyCollection['_applyMeta']>[0];
@@ -3,7 +3,7 @@ import {
3
3
  LedgerStore,
4
4
  applyPatch,
5
5
  computePatch
6
- } from "./chunk-Q6TEJXBX.js";
6
+ } from "./chunk-JXHNUYQO.js";
7
7
  import {
8
8
  LEDGER_COLLECTION,
9
9
  LEDGER_DELTAS_COLLECTION
@@ -15,16 +15,16 @@ import {
15
15
  paddedIndex,
16
16
  parseIndex,
17
17
  sha256Hex
18
- } from "./chunk-6SAFL5YE.js";
19
- import "./chunk-3URQC7EH.js";
20
- import "./chunk-7H73RIE3.js";
21
- import "./chunk-HXGUIPQB.js";
22
- import "./chunk-AR2JDFAE.js";
23
- import "./chunk-747LRSOO.js";
18
+ } from "./chunk-BZ3WMOYX.js";
19
+ import "./chunk-CXPOG3ZY.js";
20
+ import "./chunk-FX3UIDCS.js";
21
+ import "./chunk-CKKN25P2.js";
22
+ import "./chunk-7Q3RHOA5.js";
23
+ import "./chunk-4K6BIMLF.js";
24
24
  import "./chunk-LP7BEXCT.js";
25
- import "./chunk-VCETL77O.js";
26
- import "./chunk-YPYHVOXP.js";
27
- import "./chunk-HNGSV2YC.js";
25
+ import "./chunk-ONPVHX2Y.js";
26
+ import "./chunk-UJ4Z67UQ.js";
27
+ import "./chunk-Z3BZXPRO.js";
28
28
  import "./chunk-PZ5AY32C.js";
29
29
  export {
30
30
  LEDGER_COLLECTION,
@@ -39,4 +39,4 @@ export {
39
39
  parseIndex,
40
40
  sha256Hex
41
41
  };
42
- //# sourceMappingURL=ledger-AETNF4OM.js.map
42
+ //# sourceMappingURL=ledger-MQIIOTZB.js.map
@@ -0,0 +1,25 @@
1
+ import {
2
+ liberateVault
3
+ } from "./chunk-PJX72ICF.js";
4
+ import "./chunk-QQRRKO7W.js";
5
+ import "./chunk-S6PJ6ZKE.js";
6
+ import "./chunk-S2I5MYSA.js";
7
+ import "./chunk-GCU42IG7.js";
8
+ import "./chunk-2ZT4INZ4.js";
9
+ import "./chunk-J6I5VR6P.js";
10
+ import "./chunk-ZJUZOJVW.js";
11
+ import "./chunk-D2YFQ7XG.js";
12
+ import "./chunk-CXPOG3ZY.js";
13
+ import "./chunk-FX3UIDCS.js";
14
+ import "./chunk-CKKN25P2.js";
15
+ import "./chunk-7Q3RHOA5.js";
16
+ import "./chunk-4K6BIMLF.js";
17
+ import "./chunk-LP7BEXCT.js";
18
+ import "./chunk-ONPVHX2Y.js";
19
+ import "./chunk-UJ4Z67UQ.js";
20
+ import "./chunk-Z3BZXPRO.js";
21
+ import "./chunk-PZ5AY32C.js";
22
+ export {
23
+ liberateVault
24
+ };
25
+ //# sourceMappingURL=liberate-LW7OKVBH.js.map
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  LinkEndpointError,
3
3
  LinkSet
4
- } from "./chunk-PDLLCOGD.js";
4
+ } from "./chunk-3OE2QNSM.js";
5
5
  import {
6
6
  LINK_COLLECTION_PREFIX,
7
7
  LinkIntegrityError,
8
8
  isLinkCollectionName,
9
9
  linkCollectionName,
10
10
  linkRowKey
11
- } from "./chunk-HNHCQ556.js";
12
- import "./chunk-3URQC7EH.js";
13
- import "./chunk-7H73RIE3.js";
14
- import "./chunk-HXGUIPQB.js";
15
- import "./chunk-AR2JDFAE.js";
16
- import "./chunk-747LRSOO.js";
11
+ } from "./chunk-PFWE7FJG.js";
12
+ import "./chunk-CXPOG3ZY.js";
13
+ import "./chunk-FX3UIDCS.js";
14
+ import "./chunk-CKKN25P2.js";
15
+ import "./chunk-7Q3RHOA5.js";
16
+ import "./chunk-4K6BIMLF.js";
17
17
  import "./chunk-LP7BEXCT.js";
18
- import "./chunk-VCETL77O.js";
19
- import "./chunk-YPYHVOXP.js";
20
- import "./chunk-HNGSV2YC.js";
18
+ import "./chunk-ONPVHX2Y.js";
19
+ import "./chunk-UJ4Z67UQ.js";
20
+ import "./chunk-Z3BZXPRO.js";
21
21
  import "./chunk-PZ5AY32C.js";
22
22
  export {
23
23
  LINK_COLLECTION_PREFIX,
@@ -28,4 +28,4 @@ export {
28
28
  linkCollectionName,
29
29
  linkRowKey
30
30
  };
31
- //# sourceMappingURL=link-set-E5HNY67I.js.map
31
+ //# sourceMappingURL=link-set-5PJBBR63.js.map
@@ -9,8 +9,16 @@ import {
9
9
  resolveManagedSecret,
10
10
  saveSealedSecret,
11
11
  sealRsaOaepTlv
12
- } from "./chunk-XWX7GL56.js";
13
- import "./chunk-YPYHVOXP.js";
12
+ } from "./chunk-S2I5MYSA.js";
13
+ import "./chunk-CXPOG3ZY.js";
14
+ import "./chunk-FX3UIDCS.js";
15
+ import "./chunk-CKKN25P2.js";
16
+ import "./chunk-7Q3RHOA5.js";
17
+ import "./chunk-4K6BIMLF.js";
18
+ import "./chunk-LP7BEXCT.js";
19
+ import "./chunk-ONPVHX2Y.js";
20
+ import "./chunk-UJ4Z67UQ.js";
21
+ import "./chunk-Z3BZXPRO.js";
14
22
  import "./chunk-PZ5AY32C.js";
15
23
  export {
16
24
  MemoryRecipientSealer,
@@ -24,4 +32,4 @@ export {
24
32
  saveSealedSecret,
25
33
  sealRsaOaepTlv
26
34
  };
27
- //# sourceMappingURL=managed-secret-CWQ6PND5.js.map
35
+ //# sourceMappingURL=managed-secret-ETDG6AAE.js.map
@@ -1,48 +1,48 @@
1
1
  import {
2
2
  withMaterializedView
3
- } from "../chunk-CEJWMBXO.js";
3
+ } from "../chunk-5OT4G5N5.js";
4
+ import {
5
+ MaterializedViewExecutor
6
+ } from "../chunk-64WHKBMP.js";
4
7
  import {
5
8
  clearMVStale,
6
9
  isMVStale,
7
10
  markMVStale,
8
11
  resolveStaleMVOnRead
9
- } from "../chunk-BEFVYAR5.js";
10
- import {
11
- MaterializedViewExecutor
12
- } from "../chunk-GAG7QOVO.js";
12
+ } from "../chunk-EQOTJL76.js";
13
13
  import {
14
14
  MaterializedViewRegistry,
15
15
  analyzeDependencies,
16
16
  canonicalizeQueryPlan,
17
17
  computeQueryHash,
18
18
  summarizeQueryPlan
19
- } from "../chunk-7F4DBNSP.js";
20
- import "../chunk-RXYYFSBB.js";
21
- import "../chunk-CCZJJ4I2.js";
22
- import "../chunk-5ZKS6ZE2.js";
19
+ } from "../chunk-GANFIM2M.js";
20
+ import "../chunk-GKTW3KLV.js";
21
+ import "../chunk-K6CPIK3R.js";
23
22
  import "../chunk-5D2ALSM5.js";
24
- import "../chunk-E6427JU2.js";
23
+ import "../chunk-EV2TDHQZ.js";
24
+ import "../chunk-2CBFYXJX.js";
25
25
  import "../chunk-XZHEOSQ2.js";
26
- import "../chunk-CADUYBQD.js";
27
- import "../chunk-IGJCYUT5.js";
28
- import "../chunk-WFUIE565.js";
29
- import "../chunk-7G6VDWXB.js";
30
- import "../chunk-UHXCLPGC.js";
31
- import "../chunk-6SAFL5YE.js";
32
- import "../chunk-3URQC7EH.js";
33
- import "../chunk-7H73RIE3.js";
34
- import "../chunk-HXGUIPQB.js";
35
- import "../chunk-AR2JDFAE.js";
36
- import "../chunk-747LRSOO.js";
26
+ import "../chunk-ATL3ZVXT.js";
27
+ import "../chunk-NSITFOCJ.js";
28
+ import "../chunk-FNYCT27B.js";
29
+ import "../chunk-XPEPMK4Y.js";
30
+ import "../chunk-C3XWJCG7.js";
31
+ import "../chunk-BZ3WMOYX.js";
32
+ import "../chunk-CXPOG3ZY.js";
33
+ import "../chunk-FX3UIDCS.js";
34
+ import "../chunk-CKKN25P2.js";
35
+ import "../chunk-7Q3RHOA5.js";
36
+ import "../chunk-4K6BIMLF.js";
37
37
  import "../chunk-LP7BEXCT.js";
38
- import "../chunk-VCETL77O.js";
39
- import "../chunk-YPYHVOXP.js";
38
+ import "../chunk-ONPVHX2Y.js";
39
+ import "../chunk-UJ4Z67UQ.js";
40
40
  import {
41
41
  MaterializedViewConfigError,
42
42
  MaterializedViewCycleError,
43
43
  MaterializedViewSourceUnknownError,
44
44
  MaterializedViewTooLargeError
45
- } from "../chunk-HNGSV2YC.js";
45
+ } from "../chunk-Z3BZXPRO.js";
46
46
  import "../chunk-PZ5AY32C.js";
47
47
  export {
48
48
  MaterializedViewConfigError,
@@ -0,0 +1,19 @@
1
+ import {
2
+ SatelliteConfigError
3
+ } from "./chunk-Z3BZXPRO.js";
4
+ import "./chunk-PZ5AY32C.js";
5
+
6
+ // src/with-shape/satellites/migrate-cek.ts
7
+ async function migrateSatelliteCek(name, coll) {
8
+ if (coll.getConfig()?.perRecordKeys !== true) {
9
+ throw new SatelliteConfigError(
10
+ `migrateSatellitePerRecordKeys: collection "${name}" was already opened this session without perRecordKeys (construction-only); migrate before its first open, or restart the session.`
11
+ );
12
+ }
13
+ const migrated = await coll._applyCutoverTransform((doc) => doc);
14
+ return { migrated };
15
+ }
16
+ export {
17
+ migrateSatelliteCek
18
+ };
19
+ //# sourceMappingURL=migrate-cek-V3VDRV24.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-shape/satellites/migrate-cek.ts"],"sourcesContent":["/**\n * Satellite per-record-CEK migration (#599) — the R-S7 retro-coverage\n * unblock.\n *\n * R-S7 (`declare.ts:89-91`) correctly refuses declaring/redeclaring a\n * satellite of a forget-covered base without `perRecordKeys: true` — but\n * `perRecordKeys` is construction-only (`kernel/collection.ts:402`), so an\n * app that shipped a satellite BEFORE its base gained forget coverage has\n * no way past the refusal: the existing records must be re-encrypted under\n * fresh per-record CEKs before the satellite can reopen in\n * `perRecordKeys: true` mode, and the only re-encrypt primitive\n * (`Collection._applyCutoverTransform`) needs the collection already\n * constructed in that mode — chicken-and-egg.\n *\n * The break: `Vault.migrateSatellitePerRecordKeys` (`kernel/vault.ts`)\n * opens the satellite collection via `vault.collection(name, {\n * perRecordKeys: true })` WITHOUT `satelliteOf` — that never enters\n * `declareSatellite`, so R-S7's gate (which only fires on the `satelliteOf`\n * declaration path) never runs for the migration pass. R-S7 stays fully\n * enforced for every NORMAL `satelliteOf` declaration; this module and its\n * call-site never touch `declare.ts`.\n *\n * `migrateSatelliteCek` then reuses `_applyCutoverTransform` verbatim (an\n * identity transform — no field/shape change, only the encryption wrapper\n * changes) rather than duplicating its mint-or-reuse-CEK logic\n * (`resolveRecordCek`/`resolveStableCek`, `collection.ts:2537-2545`): a\n * record with no `_cek` yet gets a freshly minted per-record CEK; a record\n * that already carries `_cek` (already migrated, e.g. a prior interrupted\n * run) reuses its existing CEK unchanged. That mint-or-reuse discrimination\n * is what makes re-running this after a mid-migration failure safe for\n * free — no separate resumability marker needed, no double-mint, no\n * plaintext write, no shared-DEK write.\n *\n * **Mode-assertion guard (review Important 1):** `perRecordKeys` is\n * construction-only and the vault's collection cache is first-wins with no\n * mismatch guard. If `coll`'s name was already opened THIS SESSION without\n * `perRecordKeys` (e.g. an incidental bare `vault.collection(name)` call\n * before the migration ran), `vault.collection(name, { perRecordKeys: true\n * })` cache-HITS that instance instead of constructing a fresh one — the\n * returned handle is silently NOT in per-record-CEK mode. Without a check,\n * `_applyCutoverTransform` would then pass `cek: undefined` for every\n * record (`this.perRecordCek` false) and RE-ENCRYPT EVERY RECORD UNDER THE\n * SHARED COLLECTION DEK while still reporting `{ migrated: N }` as success\n * — a security migration that silently mints nothing. `migrateSatelliteCek`\n * reads the opened handle's own `getConfig()` (the same accessor\n * `dumpSchema()` uses) to confirm `perRecordKeys` is genuinely `true`\n * before walking, and throws `SatelliteConfigError` instead of proceeding\n * if not.\n *\n * **No-quiesce precondition (review Important 2):** `_applyCutoverTransform`\n * is documented as fence-phase-only (`collection.ts:2517-2522`) — the\n * generic schema-cutover caller (`Vault.runSchemaCutover` →\n * `SchemaFenceController`) always runs it under the vault-wide schema fence,\n * which blocks concurrent writes. This migration does NOT fence: it calls\n * `_applyCutoverTransform` directly, with no fence and CAS-less\n * (`adapter.put` with no `expectedVersion`) writes. A concurrent write to\n * the same satellite collection racing the walk's `await`s can be\n * clobbered by (or clobber) a migration write. Callers MUST run this before\n * the collection serves traffic — e.g. at v2 boot, before declaring the\n * pair, before any client can write — or otherwise ensure the vault is\n * quiescent for this collection for the duration of the call.\n */\nimport { SatelliteConfigError } from '../../kernel/errors.js'\n\n/** The narrow slice of `Collection` the migration pass needs (mirrors `fanout.ts`'s `CollectionHandle` narrowing). */\nexport interface SatelliteCekMigrationTarget {\n /** Public config snapshot (`Collection.getConfig()`) — used to confirm the handle is genuinely in per-record-CEK mode before walking. */\n getConfig(): { readonly perRecordKeys?: boolean } | undefined\n _applyCutoverTransform(transform: (doc: Record<string, unknown>) => Record<string, unknown>): Promise<number>\n}\n\nexport interface SatelliteCekMigrationResult {\n /** Records touched by this call (both freshly minted and already-migrated re-touches on a resumed run). */\n readonly migrated: number\n}\n\n/**\n * Re-encrypt every record in `coll` under a per-record CEK. `coll` must be\n * a collection handle already opened with `perRecordKeys: true` — see the\n * file header for how the caller gets one past R-S7. Throws\n * `SatelliteConfigError` (does NOT proceed) if `coll` is not genuinely in\n * per-record-CEK mode — see the file header's mode-assertion note.\n * Idempotent/resumable: safe to call again after a partial failure. NOT\n * fenced against concurrent writers — see the file header's no-quiesce\n * precondition; run this before the collection serves traffic.\n *\n * @param name The satellite collection's name — used only for the error\n * message below; identical to what the caller passed to `vault.collection()`.\n */\nexport async function migrateSatelliteCek(name: string, coll: SatelliteCekMigrationTarget): Promise<SatelliteCekMigrationResult> {\n if (coll.getConfig()?.perRecordKeys !== true) {\n throw new SatelliteConfigError(\n `migrateSatellitePerRecordKeys: collection \"${name}\" was already opened this session without ` +\n `perRecordKeys (construction-only); migrate before its first open, or restart the session.`,\n )\n }\n // Ledger reason (review Minor): the walk below reuses _applyCutoverTransform's\n // hardcoded 'schema:coordinated-cutover' ledger reason — it has no reason/label\n // param, and this migration is not itself a schema cutover. Not threaded through\n // (would touch collection.ts's own ceilinged surface for a cosmetic label);\n // flagged here so the audit trail's shared reason string is documented, not silent.\n const migrated = await coll._applyCutoverTransform((doc) => doc)\n return { migrated }\n}\n"],"mappings":";;;;;;AAyFA,eAAsB,oBAAoB,MAAc,MAAyE;AAC/H,MAAI,KAAK,UAAU,GAAG,kBAAkB,MAAM;AAC5C,UAAM,IAAI;AAAA,MACR,8CAA8C,IAAI;AAAA,IAEpD;AAAA,EACF;AAMA,QAAM,WAAW,MAAM,KAAK,uBAAuB,CAAC,QAAQ,GAAG;AAC/D,SAAO,EAAE,SAAS;AACpB;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  isMoneyString,
5
5
  moneyNumber,
6
6
  mulRate
7
- } from "../chunk-N35NC4JH.js";
7
+ } from "../chunk-TKBB62DN.js";
8
8
  import {
9
9
  MoneyCurrencyError,
10
10
  MoneyPrecisionError,
@@ -13,10 +13,10 @@ import {
13
13
  isMoneyDescriptor,
14
14
  money,
15
15
  scaleForCurrency
16
- } from "../chunk-RXYYFSBB.js";
17
- import "../chunk-IGJCYUT5.js";
18
- import "../chunk-UHXCLPGC.js";
19
- import "../chunk-HNGSV2YC.js";
16
+ } from "../chunk-GKTW3KLV.js";
17
+ import "../chunk-NSITFOCJ.js";
18
+ import "../chunk-C3XWJCG7.js";
19
+ import "../chunk-Z3BZXPRO.js";
20
20
  import "../chunk-PZ5AY32C.js";
21
21
  export {
22
22
  MoneyCurrencyError,