@noy-db/hub 0.6.0-pre.16 → 0.6.0-pre.18

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 (307) hide show
  1. package/dist/{api-NAY63UIE.js → api-FRFEJ6WR.js} +6 -6
  2. package/dist/attestation/index.js +12 -12
  3. package/dist/{backup-M2VND2VS.js → backup-OLBRFYY7.js} +10 -10
  4. package/dist/{backup-M2VND2VS.js.map → backup-OLBRFYY7.js.map} +1 -1
  5. package/dist/blobs/index.js +8 -8
  6. package/dist/broker/index.js +6 -6
  7. package/dist/cargo/index.js +26 -26
  8. package/dist/{chunk-4CSG6KBX.js → chunk-2ION5ZRH.js} +17 -14
  9. package/dist/chunk-2ION5ZRH.js.map +1 -0
  10. package/dist/{chunk-466KGOQB.js → chunk-2NE7ILO7.js} +2 -2
  11. package/dist/{chunk-CZV57HHC.js → chunk-3KXIGMZ4.js} +2 -2
  12. package/dist/{chunk-5CH4DWQA.js → chunk-3ODOWQMV.js} +13 -14
  13. package/dist/chunk-3ODOWQMV.js.map +1 -0
  14. package/dist/{chunk-3OEWD45V.js → chunk-3RZ7QLJ4.js} +5 -5
  15. package/dist/{chunk-SFY6NT7D.js → chunk-3Y4OFWQJ.js} +1 -1
  16. package/dist/chunk-3Y4OFWQJ.js.map +1 -0
  17. package/dist/{chunk-FZ2SSI5R.js → chunk-6AL6O4CS.js} +2 -2
  18. package/dist/{chunk-4XEUSZWN.js → chunk-6D3CN2JR.js} +2 -2
  19. package/dist/{chunk-6UAVKAG6.js → chunk-6QCXMCLZ.js} +3 -3
  20. package/dist/{chunk-B4G3JPH5.js → chunk-7EH322GJ.js} +14 -7
  21. package/dist/chunk-7EH322GJ.js.map +1 -0
  22. package/dist/{chunk-AMKCY454.js → chunk-7WD2G6K4.js} +7 -2
  23. package/dist/{chunk-AMKCY454.js.map → chunk-7WD2G6K4.js.map} +1 -1
  24. package/dist/{chunk-VUUUIKRG.js → chunk-A5QQKWCK.js} +14 -23
  25. package/dist/chunk-A5QQKWCK.js.map +1 -0
  26. package/dist/{chunk-RRMXMJUP.js → chunk-AA2WWTS3.js} +9 -7
  27. package/dist/chunk-AA2WWTS3.js.map +1 -0
  28. package/dist/{chunk-WMUN7ZUD.js → chunk-AA7LM2A3.js} +2 -2
  29. package/dist/{chunk-PJGMBELR.js → chunk-AIZNLHKN.js} +4 -4
  30. package/dist/chunk-AIZNLHKN.js.map +1 -0
  31. package/dist/{chunk-MKSTUVMJ.js → chunk-AMMYIT7F.js} +35 -31
  32. package/dist/chunk-AMMYIT7F.js.map +1 -0
  33. package/dist/{chunk-TWPTRJEU.js → chunk-BBU3OD3D.js} +2 -2
  34. package/dist/{chunk-OJEDR25M.js → chunk-BVIGGV6D.js} +33 -45
  35. package/dist/chunk-BVIGGV6D.js.map +1 -0
  36. package/dist/{chunk-IQGIPRSE.js → chunk-CFTPERGL.js} +14 -11
  37. package/dist/chunk-CFTPERGL.js.map +1 -0
  38. package/dist/{chunk-T6CCRXD3.js → chunk-CGQUSSW7.js} +26 -142
  39. package/dist/chunk-CGQUSSW7.js.map +1 -0
  40. package/dist/{chunk-4JDTLWUZ.js → chunk-DFFSCYIW.js} +9 -9
  41. package/dist/{chunk-JZVXGOJE.js → chunk-DKYEVHZH.js} +7 -10
  42. package/dist/chunk-DKYEVHZH.js.map +1 -0
  43. package/dist/{chunk-YVOW35HH.js → chunk-DL4GDOWL.js} +4 -6
  44. package/dist/chunk-DL4GDOWL.js.map +1 -0
  45. package/dist/{chunk-LGGLPURL.js → chunk-DWO55ZWE.js} +13 -22
  46. package/dist/chunk-DWO55ZWE.js.map +1 -0
  47. package/dist/{chunk-MKV2KYRV.js → chunk-ER3BQCCE.js} +2 -2
  48. package/dist/{chunk-JU3JKOY5.js → chunk-EWAGI3EM.js} +2 -2
  49. package/dist/{chunk-WMZQCXZ5.js → chunk-EZ3UHHND.js} +13 -15
  50. package/dist/chunk-EZ3UHHND.js.map +1 -0
  51. package/dist/{chunk-5TF5DUQ5.js → chunk-FDIZHZ3C.js} +29 -47
  52. package/dist/chunk-FDIZHZ3C.js.map +1 -0
  53. package/dist/{chunk-56W3T5O2.js → chunk-FOABWV7L.js} +45 -18
  54. package/dist/chunk-FOABWV7L.js.map +1 -0
  55. package/dist/{chunk-H5U4T6JK.js → chunk-FRGF56PD.js} +11 -14
  56. package/dist/chunk-FRGF56PD.js.map +1 -0
  57. package/dist/{chunk-53PWELSC.js → chunk-FY33DKPH.js} +2 -2
  58. package/dist/{chunk-KKRFL5E2.js → chunk-GSRW5MTU.js} +220 -169
  59. package/dist/chunk-GSRW5MTU.js.map +1 -0
  60. package/dist/{chunk-4VRZDYRE.js → chunk-HJRTFXAA.js} +7 -10
  61. package/dist/chunk-HJRTFXAA.js.map +1 -0
  62. package/dist/chunk-HK67PX4J.js +27 -0
  63. package/dist/chunk-HK67PX4J.js.map +1 -0
  64. package/dist/{chunk-A3WHDOWI.js → chunk-IN5EZWYQ.js} +13 -14
  65. package/dist/chunk-IN5EZWYQ.js.map +1 -0
  66. package/dist/{chunk-PZLIA5R3.js → chunk-ITXPKEDP.js} +23 -29
  67. package/dist/chunk-ITXPKEDP.js.map +1 -0
  68. package/dist/{chunk-343FH4S5.js → chunk-JYFJNSTW.js} +9 -9
  69. package/dist/chunk-JYFJNSTW.js.map +1 -0
  70. package/dist/{chunk-35RIRCGW.js → chunk-KLVGF2D4.js} +11 -9
  71. package/dist/{chunk-35RIRCGW.js.map → chunk-KLVGF2D4.js.map} +1 -1
  72. package/dist/{chunk-7LLKPODL.js → chunk-LPAGIMXJ.js} +2 -2
  73. package/dist/{chunk-3JQVA527.js → chunk-LU6NPJWN.js} +3 -3
  74. package/dist/{chunk-UVFO25FJ.js → chunk-NAAPSNCS.js} +90 -33
  75. package/dist/chunk-NAAPSNCS.js.map +1 -0
  76. package/dist/{chunk-OPGKH5RD.js → chunk-NFPSC2HL.js} +3 -3
  77. package/dist/{chunk-55B3KHZW.js → chunk-NRNTXBHT.js} +7 -10
  78. package/dist/chunk-NRNTXBHT.js.map +1 -0
  79. package/dist/{chunk-I5OLA3H6.js → chunk-O4QDBAB6.js} +7 -10
  80. package/dist/{chunk-I5OLA3H6.js.map → chunk-O4QDBAB6.js.map} +1 -1
  81. package/dist/{chunk-4DJQU3PH.js → chunk-OCCNYGKG.js} +7 -7
  82. package/dist/{chunk-76FBDG6M.js → chunk-OZD3D2DZ.js} +10 -13
  83. package/dist/chunk-OZD3D2DZ.js.map +1 -0
  84. package/dist/{chunk-YX6J3Z3Z.js → chunk-PBPYQZDW.js} +2 -2
  85. package/dist/{chunk-TTAND7MR.js → chunk-PBRIHUQ5.js} +5 -5
  86. package/dist/{chunk-TTAND7MR.js.map → chunk-PBRIHUQ5.js.map} +1 -1
  87. package/dist/{chunk-NBLLQOMR.js → chunk-Q67P7S2I.js} +14 -15
  88. package/dist/chunk-Q67P7S2I.js.map +1 -0
  89. package/dist/{chunk-NY6RQBUN.js → chunk-RAYGDC4A.js} +50 -63
  90. package/dist/chunk-RAYGDC4A.js.map +1 -0
  91. package/dist/{chunk-RVTOCAHQ.js → chunk-SQSZRCYT.js} +1 -1
  92. package/dist/chunk-SQSZRCYT.js.map +1 -0
  93. package/dist/{chunk-JN64WH3U.js → chunk-T7IR4N2S.js} +1 -1
  94. package/dist/{chunk-JN64WH3U.js.map → chunk-T7IR4N2S.js.map} +1 -1
  95. package/dist/{chunk-THUITYH7.js → chunk-TNOQNU3R.js} +5 -4
  96. package/dist/{chunk-THUITYH7.js.map → chunk-TNOQNU3R.js.map} +1 -1
  97. package/dist/{chunk-TY6N3PAC.js → chunk-TXDOMADN.js} +9 -6
  98. package/dist/chunk-TXDOMADN.js.map +1 -0
  99. package/dist/{chunk-6EF3N2MH.js → chunk-U6D5XTI5.js} +13 -13
  100. package/dist/{chunk-6EF3N2MH.js.map → chunk-U6D5XTI5.js.map} +1 -1
  101. package/dist/{chunk-HNX47VTC.js → chunk-UE72AQDZ.js} +6 -6
  102. package/dist/chunk-UIYZ5SOU.js +190 -0
  103. package/dist/chunk-UIYZ5SOU.js.map +1 -0
  104. package/dist/{chunk-IGE6XWKK.js → chunk-VXVKEWYC.js} +3 -3
  105. package/dist/{chunk-LTVETWDH.js → chunk-X3AXSYBL.js} +217 -123
  106. package/dist/chunk-X3AXSYBL.js.map +1 -0
  107. package/dist/{chunk-AD2PJGSS.js → chunk-ZDATYUYG.js} +2 -2
  108. package/dist/{chunk-LJDW6LQJ.js → chunk-ZSOTZ2RZ.js} +41 -24
  109. package/dist/chunk-ZSOTZ2RZ.js.map +1 -0
  110. package/dist/{chunk-6E2JZRBD.js → chunk-ZVAFJQZB.js} +25 -19
  111. package/dist/chunk-ZVAFJQZB.js.map +1 -0
  112. package/dist/classified/index.js +4 -4
  113. package/dist/{classified-marker-L7LXKS6Q.js → classified-marker-GWQTNDSL.js} +3 -3
  114. package/dist/{collection-facade-KN3UFKZ4.js → collection-facade-56RTPO4G.js} +12 -12
  115. package/dist/consent/index.js +4 -4
  116. package/dist/cover/index.js +9 -2
  117. package/dist/custody/index.js +6 -6
  118. package/dist/{dead-filter-6HG5FP3I.js → dead-filter-XP7MPHCJ.js} +2 -2
  119. package/dist/{delegation-7EGBYBRN.js → delegation-Q3HEAVLA.js} +18 -19
  120. package/dist/delegation-Q3HEAVLA.js.map +1 -0
  121. package/dist/derivations/index.js +3 -3
  122. package/dist/{derive-XKAYJ2OA.js → derive-SVDY36ER.js} +4 -4
  123. package/dist/directory/index.js +5 -5
  124. package/dist/{dispatch-56T7VPGE.js → dispatch-MG5KNMWG.js} +5 -5
  125. package/dist/{dispatch-BM5GNCE2.js → dispatch-RVJQ4BOL.js} +11 -11
  126. package/dist/{enclave-KDLGVX5Z.js → enclave-AOZTWFZK.js} +16 -4
  127. package/dist/{executor-LFHRV6JH.js → executor-FRUVM36Q.js} +12 -12
  128. package/dist/{export-accessible-HFBJ4JJY.js → export-accessible-HDDHZYPM.js} +7 -7
  129. package/dist/{extract-partition-7ZRFN6QP.js → extract-partition-TRADP234.js} +12 -12
  130. package/dist/{fanout-sidecar-MT2OBMZB.js → fanout-sidecar-NZA6J7QB.js} +13 -22
  131. package/dist/fanout-sidecar-NZA6J7QB.js.map +1 -0
  132. package/dist/forget/index.js +4 -4
  133. package/dist/history/index.js +18 -15
  134. package/dist/history/index.js.map +1 -1
  135. package/dist/i18n/index.js +9 -9
  136. package/dist/index.d.ts +16 -0
  137. package/dist/index.js +129 -127
  138. package/dist/index.js.map +1 -1
  139. package/dist/introspection/index.js +5 -5
  140. package/dist/{issue-LCOOEH45.js → issue-GZQDW5TQ.js} +6 -6
  141. package/dist/kernel/enclave/index.d.ts +7 -5
  142. package/dist/kernel/enclave/record-aad.d.ts +79 -7
  143. package/dist/kernel/enclave/record-envelope.d.ts +54 -7
  144. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +34 -2
  145. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +22 -5
  146. package/dist/kernel/enclave/record-keys/record-codec.d.ts +47 -14
  147. package/dist/kernel/enclave/record-keys/rekey.d.ts +68 -0
  148. package/dist/kernel/enclave/record-keys/tombstone.d.ts +3 -3
  149. package/dist/kernel/merge-authority.d.ts +25 -0
  150. package/dist/kernel/tier-visibility.d.ts +15 -0
  151. package/dist/kernel/types.d.ts +23 -0
  152. package/dist/kernel/vault.d.ts +1 -1
  153. package/dist/kernel/via/index.d.ts +11 -2
  154. package/dist/{ledger-6IHXJHDD.js → ledger-KQAJPEMZ.js} +6 -6
  155. package/dist/liberate-Z2EXJY2S.js +24 -0
  156. package/dist/{link-set-XRVHGYWC.js → link-set-XKN5V7VM.js} +5 -5
  157. package/dist/{managed-secret-IDAOXSSX.js → managed-secret-7WIIVMJ5.js} +11 -3
  158. package/dist/materialized-views/index.js +14 -14
  159. package/dist/money/index.js +3 -3
  160. package/dist/{noydb-M5WII7RP.js → noydb-NPW3C2EX.js} +39 -38
  161. package/dist/periods/index.js +6 -6
  162. package/dist/pod/index.js +42 -41
  163. package/dist/{pod-handle-BYUSBXCT.js → pod-handle-SKDKRPOR.js} +6 -6
  164. package/dist/{pod-handle-BYUSBXCT.js.map → pod-handle-SKDKRPOR.js.map} +1 -1
  165. package/dist/policy/index.js +10 -3
  166. package/dist/port/with/merge-authority.d.ts +52 -0
  167. package/dist/port/with/strategies.d.ts +2 -0
  168. package/dist/portability/index.js +6 -6
  169. package/dist/{post-register-O3YW6CGS.js → post-register-CVS7CCJE.js} +4 -4
  170. package/dist/reduce/index.js +3 -3
  171. package/dist/{register-XHOOX37G.js → register-GJ6PW4KP.js} +10 -10
  172. package/dist/{registry-OFMM4WAC.js → registry-6LUJ5IJW.js} +4 -4
  173. package/dist/{registry-CYAFB35H.js → registry-KI77RVK7.js} +4 -4
  174. package/dist/{request-withdrawal-GCE2SLNW.js → request-withdrawal-LICOUGXG.js} +9 -9
  175. package/dist/{reveal-UHBP5IH3.js → reveal-PWM47FQN.js} +3 -3
  176. package/dist/{revoke-6KY4VGZY.js → revoke-AWZKZLZB.js} +6 -6
  177. package/dist/sealed-record/index.js +14 -7
  178. package/dist/sealed-record/index.js.map +1 -1
  179. package/dist/search/index.js +3 -3
  180. package/dist/{seed-DGLQTCIO.js → seed-LNTLU2A3.js} +14 -17
  181. package/dist/seed-LNTLU2A3.js.map +1 -0
  182. package/dist/sequence/index.js +4 -4
  183. package/dist/session/index.js +3 -3
  184. package/dist/{signer-SLOMB6HS.js → signer-JE6NEURY.js} +5 -5
  185. package/dist/snapshots/index.js +5 -5
  186. package/dist/{stale-26ZJLNLG.js → stale-ZWTKUVZX.js} +5 -5
  187. package/dist/{storage-N3IMFNGS.js → storage-WCZOCA46.js} +5 -5
  188. package/dist/{store-coordination-provider-RGHCIRWV.js → store-coordination-provider-7H62VO2C.js} +18 -12
  189. package/dist/store-coordination-provider-7H62VO2C.js.map +1 -0
  190. package/dist/sync/index.js +5 -5
  191. package/dist/team/index.js +10 -9
  192. package/dist/tiers/index.js +6 -5
  193. package/dist/vault-head/index.js +111 -0
  194. package/dist/vault-head/index.js.map +1 -0
  195. package/dist/{walk-B4YFJJ7S.js → walk-HSS3NLQ3.js} +6 -6
  196. package/dist/with-audit/periods/periods.d.ts +1 -1
  197. package/dist/with-audit/periods/strategy.d.ts +1 -1
  198. package/dist/with-audit/sealed-record/index.d.ts +13 -0
  199. package/dist/with-audit/tiers/index.d.ts +17 -2
  200. package/dist/with-commit/history/history.d.ts +26 -0
  201. package/dist/with-commit/history/index.d.ts +2 -1
  202. package/dist/with-commit/history/ledger/store.d.ts +7 -1
  203. package/dist/with-commit/history/strategy.d.ts +11 -1
  204. package/dist/with-commit/vault-head/active.d.ts +2 -0
  205. package/dist/with-commit/vault-head/head.d.ts +28 -0
  206. package/dist/with-commit/vault-head/index.d.ts +10 -0
  207. package/dist/with-commit/vault-head/strategy.d.ts +127 -0
  208. package/dist/with-commit/vault-head/verify.d.ts +50 -0
  209. package/dist/with-party/directory/cover/storage.d.ts +0 -8
  210. package/dist/with-party/directory/storage.d.ts +0 -11
  211. package/dist/with-party/directory/visibility.d.ts +0 -21
  212. package/dist/with-party/policy/storage.d.ts +0 -10
  213. package/dist/with-party/team/keyring.d.ts +5 -0
  214. package/dist/with-party/team/tiers.d.ts +2 -1
  215. package/dist/with-sync/engine.d.ts +33 -5
  216. package/dist/with-sync/strategy.d.ts +3 -0
  217. package/dist/{withdraw-accessible-OYG7YZUR.js → withdraw-accessible-GHBA4DAA.js} +8 -8
  218. package/package.json +7 -3
  219. package/dist/chunk-343FH4S5.js.map +0 -1
  220. package/dist/chunk-4CSG6KBX.js.map +0 -1
  221. package/dist/chunk-4VRZDYRE.js.map +0 -1
  222. package/dist/chunk-55B3KHZW.js.map +0 -1
  223. package/dist/chunk-56W3T5O2.js.map +0 -1
  224. package/dist/chunk-5CH4DWQA.js.map +0 -1
  225. package/dist/chunk-5TF5DUQ5.js.map +0 -1
  226. package/dist/chunk-6E2JZRBD.js.map +0 -1
  227. package/dist/chunk-76FBDG6M.js.map +0 -1
  228. package/dist/chunk-A3WHDOWI.js.map +0 -1
  229. package/dist/chunk-AFHQATY4.js +0 -47
  230. package/dist/chunk-AFHQATY4.js.map +0 -1
  231. package/dist/chunk-B4G3JPH5.js.map +0 -1
  232. package/dist/chunk-H5U4T6JK.js.map +0 -1
  233. package/dist/chunk-IQGIPRSE.js.map +0 -1
  234. package/dist/chunk-JZVXGOJE.js.map +0 -1
  235. package/dist/chunk-KKRFL5E2.js.map +0 -1
  236. package/dist/chunk-LGGLPURL.js.map +0 -1
  237. package/dist/chunk-LJDW6LQJ.js.map +0 -1
  238. package/dist/chunk-LTVETWDH.js.map +0 -1
  239. package/dist/chunk-MKSTUVMJ.js.map +0 -1
  240. package/dist/chunk-NBLLQOMR.js.map +0 -1
  241. package/dist/chunk-NY6RQBUN.js.map +0 -1
  242. package/dist/chunk-OJEDR25M.js.map +0 -1
  243. package/dist/chunk-PJGMBELR.js.map +0 -1
  244. package/dist/chunk-PZLIA5R3.js.map +0 -1
  245. package/dist/chunk-RRMXMJUP.js.map +0 -1
  246. package/dist/chunk-RVTOCAHQ.js.map +0 -1
  247. package/dist/chunk-SFY6NT7D.js.map +0 -1
  248. package/dist/chunk-T6CCRXD3.js.map +0 -1
  249. package/dist/chunk-TY6N3PAC.js.map +0 -1
  250. package/dist/chunk-UVFO25FJ.js.map +0 -1
  251. package/dist/chunk-VUUUIKRG.js.map +0 -1
  252. package/dist/chunk-WMZQCXZ5.js.map +0 -1
  253. package/dist/chunk-YVOW35HH.js.map +0 -1
  254. package/dist/delegation-7EGBYBRN.js.map +0 -1
  255. package/dist/fanout-sidecar-MT2OBMZB.js.map +0 -1
  256. package/dist/liberate-UEYC4QLJ.js +0 -24
  257. package/dist/seed-DGLQTCIO.js.map +0 -1
  258. package/dist/store-coordination-provider-RGHCIRWV.js.map +0 -1
  259. /package/dist/{api-NAY63UIE.js.map → api-FRFEJ6WR.js.map} +0 -0
  260. /package/dist/{chunk-466KGOQB.js.map → chunk-2NE7ILO7.js.map} +0 -0
  261. /package/dist/{chunk-CZV57HHC.js.map → chunk-3KXIGMZ4.js.map} +0 -0
  262. /package/dist/{chunk-3OEWD45V.js.map → chunk-3RZ7QLJ4.js.map} +0 -0
  263. /package/dist/{chunk-FZ2SSI5R.js.map → chunk-6AL6O4CS.js.map} +0 -0
  264. /package/dist/{chunk-4XEUSZWN.js.map → chunk-6D3CN2JR.js.map} +0 -0
  265. /package/dist/{chunk-6UAVKAG6.js.map → chunk-6QCXMCLZ.js.map} +0 -0
  266. /package/dist/{chunk-WMUN7ZUD.js.map → chunk-AA7LM2A3.js.map} +0 -0
  267. /package/dist/{chunk-TWPTRJEU.js.map → chunk-BBU3OD3D.js.map} +0 -0
  268. /package/dist/{chunk-4JDTLWUZ.js.map → chunk-DFFSCYIW.js.map} +0 -0
  269. /package/dist/{chunk-MKV2KYRV.js.map → chunk-ER3BQCCE.js.map} +0 -0
  270. /package/dist/{chunk-JU3JKOY5.js.map → chunk-EWAGI3EM.js.map} +0 -0
  271. /package/dist/{chunk-53PWELSC.js.map → chunk-FY33DKPH.js.map} +0 -0
  272. /package/dist/{chunk-7LLKPODL.js.map → chunk-LPAGIMXJ.js.map} +0 -0
  273. /package/dist/{chunk-3JQVA527.js.map → chunk-LU6NPJWN.js.map} +0 -0
  274. /package/dist/{chunk-OPGKH5RD.js.map → chunk-NFPSC2HL.js.map} +0 -0
  275. /package/dist/{chunk-4DJQU3PH.js.map → chunk-OCCNYGKG.js.map} +0 -0
  276. /package/dist/{chunk-YX6J3Z3Z.js.map → chunk-PBPYQZDW.js.map} +0 -0
  277. /package/dist/{chunk-HNX47VTC.js.map → chunk-UE72AQDZ.js.map} +0 -0
  278. /package/dist/{chunk-IGE6XWKK.js.map → chunk-VXVKEWYC.js.map} +0 -0
  279. /package/dist/{chunk-AD2PJGSS.js.map → chunk-ZDATYUYG.js.map} +0 -0
  280. /package/dist/{classified-marker-L7LXKS6Q.js.map → classified-marker-GWQTNDSL.js.map} +0 -0
  281. /package/dist/{collection-facade-KN3UFKZ4.js.map → collection-facade-56RTPO4G.js.map} +0 -0
  282. /package/dist/{dead-filter-6HG5FP3I.js.map → dead-filter-XP7MPHCJ.js.map} +0 -0
  283. /package/dist/{derive-XKAYJ2OA.js.map → derive-SVDY36ER.js.map} +0 -0
  284. /package/dist/{dispatch-56T7VPGE.js.map → dispatch-MG5KNMWG.js.map} +0 -0
  285. /package/dist/{dispatch-BM5GNCE2.js.map → dispatch-RVJQ4BOL.js.map} +0 -0
  286. /package/dist/{enclave-KDLGVX5Z.js.map → enclave-AOZTWFZK.js.map} +0 -0
  287. /package/dist/{executor-LFHRV6JH.js.map → executor-FRUVM36Q.js.map} +0 -0
  288. /package/dist/{export-accessible-HFBJ4JJY.js.map → export-accessible-HDDHZYPM.js.map} +0 -0
  289. /package/dist/{extract-partition-7ZRFN6QP.js.map → extract-partition-TRADP234.js.map} +0 -0
  290. /package/dist/{issue-LCOOEH45.js.map → issue-GZQDW5TQ.js.map} +0 -0
  291. /package/dist/{ledger-6IHXJHDD.js.map → ledger-KQAJPEMZ.js.map} +0 -0
  292. /package/dist/{liberate-UEYC4QLJ.js.map → liberate-Z2EXJY2S.js.map} +0 -0
  293. /package/dist/{link-set-XRVHGYWC.js.map → link-set-XKN5V7VM.js.map} +0 -0
  294. /package/dist/{managed-secret-IDAOXSSX.js.map → managed-secret-7WIIVMJ5.js.map} +0 -0
  295. /package/dist/{noydb-M5WII7RP.js.map → noydb-NPW3C2EX.js.map} +0 -0
  296. /package/dist/{post-register-O3YW6CGS.js.map → post-register-CVS7CCJE.js.map} +0 -0
  297. /package/dist/{register-XHOOX37G.js.map → register-GJ6PW4KP.js.map} +0 -0
  298. /package/dist/{registry-CYAFB35H.js.map → registry-6LUJ5IJW.js.map} +0 -0
  299. /package/dist/{registry-OFMM4WAC.js.map → registry-KI77RVK7.js.map} +0 -0
  300. /package/dist/{request-withdrawal-GCE2SLNW.js.map → request-withdrawal-LICOUGXG.js.map} +0 -0
  301. /package/dist/{reveal-UHBP5IH3.js.map → reveal-PWM47FQN.js.map} +0 -0
  302. /package/dist/{revoke-6KY4VGZY.js.map → revoke-AWZKZLZB.js.map} +0 -0
  303. /package/dist/{signer-SLOMB6HS.js.map → signer-JE6NEURY.js.map} +0 -0
  304. /package/dist/{stale-26ZJLNLG.js.map → stale-ZWTKUVZX.js.map} +0 -0
  305. /package/dist/{storage-N3IMFNGS.js.map → storage-WCZOCA46.js.map} +0 -0
  306. /package/dist/{walk-B4YFJJ7S.js.map → walk-HSS3NLQ3.js.map} +0 -0
  307. /package/dist/{withdraw-accessible-OYG7YZUR.js.map → withdraw-accessible-GHBA4DAA.js.map} +0 -0
@@ -0,0 +1,111 @@
1
+ import {
2
+ DEFAULT_HEAD_BUCKETS,
3
+ NO_VAULT_HEAD,
4
+ VAULT_HEAD_COLLECTION
5
+ } from "../chunk-HK67PX4J.js";
6
+ import {
7
+ buildRecordAad,
8
+ openEnvelopeJson
9
+ } from "../chunk-X3AXSYBL.js";
10
+ import {
11
+ buildRecordEnvelope
12
+ } from "../chunk-ZVAFJQZB.js";
13
+ import "../chunk-FSZPQCDR.js";
14
+ import "../chunk-HVR74IBG.js";
15
+ import "../chunk-RBTZLXZJ.js";
16
+ import "../chunk-LP7BEXCT.js";
17
+ import {
18
+ encrypt
19
+ } from "../chunk-QTDAPDDV.js";
20
+ import "../chunk-3Y4OFWQJ.js";
21
+ import "../chunk-I64WQSN3.js";
22
+ import "../chunk-PZ5AY32C.js";
23
+
24
+ // src/with-commit/vault-head/head.ts
25
+ function bucketIndex(collection, id, buckets) {
26
+ let h = 2166136261;
27
+ const s = `${collection}/${id}`;
28
+ for (let i = 0; i < s.length; i++) {
29
+ h ^= s.charCodeAt(i);
30
+ h = Math.imul(h, 16777619) >>> 0;
31
+ }
32
+ return h % buckets;
33
+ }
34
+ function bucketId(collection, id, buckets) {
35
+ return `${collection}::${String(bucketIndex(collection, id, buckets))}`;
36
+ }
37
+ async function readBucket(store, vault, dek, bucket) {
38
+ const env = await store.get(vault, VAULT_HEAD_COLLECTION, bucket);
39
+ if (!env) return { body: {}, version: 0 };
40
+ const json = await openEnvelopeJson({ collection: VAULT_HEAD_COLLECTION, id: bucket }, env, dek);
41
+ return { body: JSON.parse(json), version: env._v };
42
+ }
43
+ async function writeBucket(store, vault, dek, bucket, body, expectedVersion) {
44
+ const identity = { collection: VAULT_HEAD_COLLECTION, id: bucket, version: expectedVersion + 1 };
45
+ const json = JSON.stringify(body);
46
+ const { iv, data } = await encrypt(json, dek, buildRecordAad(identity));
47
+ const env = buildRecordEnvelope(identity, { iv, data });
48
+ await store.put(vault, VAULT_HEAD_COLLECTION, bucket, env, expectedVersion || void 0);
49
+ }
50
+
51
+ // src/with-commit/vault-head/active.ts
52
+ function withVaultHead(opts = {}) {
53
+ const buckets = opts.buckets ?? DEFAULT_HEAD_BUCKETS;
54
+ const dekFor = (getDEK) => getDEK(VAULT_HEAD_COLLECTION);
55
+ return {
56
+ enabled: true,
57
+ bucketFor: (collection, id) => bucketId(collection, id, buckets),
58
+ async note(store, vault, getDEK, entry) {
59
+ const dek = await dekFor(getDEK);
60
+ const bucket = bucketId(entry.collection, entry.id, buckets);
61
+ const { body, version } = await readBucket(store, vault, dek, bucket);
62
+ const key = `${entry.collection}/${entry.id}`;
63
+ if ((body[key] ?? -1) >= entry.version) return;
64
+ body[key] = entry.version;
65
+ await writeBucket(store, vault, dek, bucket, body, version);
66
+ },
67
+ async expected(store, vault, getDEK, collection, id) {
68
+ const dek = await dekFor(getDEK);
69
+ const { body } = await readBucket(store, vault, dek, bucketId(collection, id, buckets));
70
+ return body[`${collection}/${id}`] ?? null;
71
+ },
72
+ async knownIn(store, vault, getDEK, collection) {
73
+ const dek = await dekFor(getDEK);
74
+ const out = /* @__PURE__ */ new Map();
75
+ const prefix = `${collection}/`;
76
+ for (const bucket of await store.list(vault, VAULT_HEAD_COLLECTION)) {
77
+ if (!bucket.startsWith(`${collection}::`)) continue;
78
+ const { body } = await readBucket(store, vault, dek, bucket);
79
+ for (const [k, v] of Object.entries(body)) {
80
+ if (k.startsWith(prefix)) out.set(k.slice(prefix.length), v);
81
+ }
82
+ }
83
+ return out;
84
+ }
85
+ };
86
+ }
87
+
88
+ // src/with-commit/vault-head/verify.ts
89
+ async function verifyVaultHead(head, store, vault, getDEK, collection) {
90
+ const known = await head.knownIn(store, vault, getDEK, collection);
91
+ const discrepancies = [];
92
+ for (const [id, expected] of known) {
93
+ const env = await store.get(vault, collection, id);
94
+ if (env === null) {
95
+ discrepancies.push({ collection, id, expected, actual: null, kind: "withheld" });
96
+ continue;
97
+ }
98
+ if (env._v < expected) {
99
+ discrepancies.push({ collection, id, expected, actual: env._v, kind: "rolled-back" });
100
+ }
101
+ }
102
+ return { checked: known.size, discrepancies, clean: discrepancies.length === 0 };
103
+ }
104
+ export {
105
+ DEFAULT_HEAD_BUCKETS,
106
+ NO_VAULT_HEAD,
107
+ VAULT_HEAD_COLLECTION,
108
+ verifyVaultHead,
109
+ withVaultHead
110
+ };
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/with-commit/vault-head/head.ts","../../src/with-commit/vault-head/active.ts","../../src/with-commit/vault-head/verify.ts"],"sourcesContent":["/**\n * The vault head's storage layer (#1044).\n *\n * A bucket is an ordinary encrypted record at `_head/<collection>::<n>`, so it\n * inherits #1041's identity binding for free: the store cannot relocate a\n * bucket, re-author it, or serve one bucket's bytes as another's. What it can\n * still do is serve an OLD bucket, which is why {@link readBucket} enforces\n * monotonicity against the caller's own record of what it last wrote.\n *\n * @packageDocumentation\n */\nimport { encrypt, buildRecordAad, openEnvelopeJson, buildRecordEnvelope, type EnclaveKey } from '../../kernel/enclave/index.js'\nimport type { NoydbStore } from '../../kernel/types.js'\nimport { VAULT_HEAD_COLLECTION } from './strategy.js'\n\n/** `{ recordId → version }` for one bucket. */\nexport type BucketBody = Record<string, number>\n\n/**\n * FNV-1a over `collection/id`. A hash, not a cipher: the bucket a record lands\n * in is not secret — the store already sees which bucket was written, and it\n * already saw the record's own address. Choosing something stronger would buy\n * nothing and cost every write.\n */\nexport function bucketIndex(collection: string, id: string, buckets: number): number {\n let h = 0x811c9dc5\n const s = `${collection}/${id}`\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i)\n h = Math.imul(h, 0x01000193) >>> 0\n }\n return h % buckets\n}\n\nexport function bucketId(collection: string, id: string, buckets: number): string {\n return `${collection}::${String(bucketIndex(collection, id, buckets))}`\n}\n\nexport async function readBucket(\n store: NoydbStore,\n vault: string,\n dek: EnclaveKey,\n bucket: string,\n): Promise<{ body: BucketBody; version: number }> {\n const env = await store.get(vault, VAULT_HEAD_COLLECTION, bucket)\n if (!env) return { body: {}, version: 0 }\n const json = await openEnvelopeJson({ collection: VAULT_HEAD_COLLECTION, id: bucket }, env, dek)\n return { body: JSON.parse(json) as BucketBody, version: env._v }\n}\n\nexport async function writeBucket(\n store: NoydbStore,\n vault: string,\n dek: EnclaveKey,\n bucket: string,\n body: BucketBody,\n expectedVersion: number,\n): Promise<void> {\n const identity = { collection: VAULT_HEAD_COLLECTION, id: bucket, version: expectedVersion + 1 }\n const json = JSON.stringify(body)\n const { iv, data } = await encrypt(json, dek, buildRecordAad(identity))\n const env = buildRecordEnvelope(identity, { iv, data })\n // CAS: two writers racing on one bucket must not silently lose an entry.\n // A lost head entry is a record the sweep stops expecting — a false clean.\n await store.put(vault, VAULT_HEAD_COLLECTION, bucket, env, expectedVersion || undefined)\n}\n","/**\n * The real {@link VaultHeadStrategy} (#1044).\n *\n * @packageDocumentation\n */\nimport type { NoydbStore } from '../../kernel/types.js'\nimport type { EnclaveKey } from '../../kernel/enclave/index.js'\nimport {\n DEFAULT_HEAD_BUCKETS,\n VAULT_HEAD_COLLECTION,\n type HeadEntry,\n type VaultHeadStrategy,\n type WithVaultHeadOptions,\n} from './strategy.js'\nimport { bucketId, readBucket, writeBucket } from './head.js'\n\nexport function withVaultHead(opts: WithVaultHeadOptions = {}): VaultHeadStrategy {\n const buckets = opts.buckets ?? DEFAULT_HEAD_BUCKETS\n\n const dekFor = (getDEK: (c: string) => Promise<EnclaveKey>) => getDEK(VAULT_HEAD_COLLECTION)\n\n return {\n enabled: true,\n bucketFor: (collection, id) => bucketId(collection, id, buckets),\n\n async note(store: NoydbStore, vault, getDEK, entry: HeadEntry) {\n const dek = await dekFor(getDEK)\n const bucket = bucketId(entry.collection, entry.id, buckets)\n const { body, version } = await readBucket(store, vault, dek, bucket)\n const key = `${entry.collection}/${entry.id}`\n // Monotonic: a head entry never moves BACKWARD. A write that would lower\n // it is either a stale retry or a rollback being laundered through the\n // client's own head, and neither should be recorded.\n if ((body[key] ?? -1) >= entry.version) return\n body[key] = entry.version\n await writeBucket(store, vault, dek, bucket, body, version)\n },\n\n async expected(store, vault, getDEK, collection, id) {\n const dek = await dekFor(getDEK)\n const { body } = await readBucket(store, vault, dek, bucketId(collection, id, buckets))\n return body[`${collection}/${id}`] ?? null\n },\n\n async knownIn(store, vault, getDEK, collection) {\n const dek = await dekFor(getDEK)\n const out = new Map<string, number>()\n const prefix = `${collection}/`\n // Sweep every bucket: a record's bucket is a function of its id, so the\n // set for one collection is spread across all of them.\n for (const bucket of await store.list(vault, VAULT_HEAD_COLLECTION)) {\n if (!bucket.startsWith(`${collection}::`)) continue\n const { body } = await readBucket(store, vault, dek, bucket)\n for (const [k, v] of Object.entries(body)) {\n if (k.startsWith(prefix)) out.set(k.slice(prefix.length), v)\n }\n }\n return out\n },\n }\n}\n","/**\n * The sweep — comparing what the head expects against what the store serves (#1044).\n *\n * This is the only place absence becomes visible. #1041 and #1042 can reject a\n * record that lies about itself; neither can notice one that never arrived, or\n * one served at an older version than the client wrote. Both are indistinguishable\n * from the truth without an independent record of what should be there.\n *\n * @packageDocumentation\n */\nimport type { NoydbStore } from '../../kernel/types.js'\nimport type { EnclaveKey } from '../../kernel/enclave/index.js'\nimport type { VaultHeadStrategy } from './strategy.js'\n\n/** One record the store is not serving faithfully. */\nexport interface HeadDiscrepancy {\n readonly collection: string\n readonly id: string\n /** What the client last committed. */\n readonly expected: number\n /**\n * What the store serves now — or `null` when it serves nothing.\n *\n * The two are different attacks wearing the same result. `null` is\n * **suppression**: the record is gone. A lower number is **rollback**: an\n * authentic older version served in place of the current one, which is the\n * case no amount of per-envelope authentication can see.\n */\n readonly actual: number | null\n readonly kind: 'withheld' | 'rolled-back'\n}\n\nexport interface HeadVerifyResult {\n readonly checked: number\n readonly discrepancies: readonly HeadDiscrepancy[]\n /** `true` when every record the head knows about is served at or above its expected version. */\n readonly clean: boolean\n}\n\n/**\n * Sweep one collection.\n *\n * **A record the store serves that the head does NOT know is not reported.**\n * That is not an oversight: the head can be enabled on an existing vault, and\n * every pre-existing record would otherwise read as an anomaly. The head's\n * claim is one-directional — *what I wrote must still be there* — and an\n * unknown record simply falls outside it.\n *\n * **A HIGHER version than expected is also not reported**, for the same reason:\n * another device legitimately advanced it. The head detects going backwards, not\n * moving forwards.\n */\nexport async function verifyVaultHead(\n head: VaultHeadStrategy,\n store: NoydbStore,\n vault: string,\n getDEK: (collection: string) => Promise<EnclaveKey>,\n collection: string,\n): Promise<HeadVerifyResult> {\n const known = await head.knownIn(store, vault, getDEK, collection)\n const discrepancies: HeadDiscrepancy[] = []\n\n for (const [id, expected] of known) {\n const env = await store.get(vault, collection, id)\n if (env === null) {\n discrepancies.push({ collection, id, expected, actual: null, kind: 'withheld' })\n continue\n }\n if (env._v < expected) {\n discrepancies.push({ collection, id, expected, actual: env._v, kind: 'rolled-back' })\n }\n }\n\n return { checked: known.size, discrepancies, clean: discrepancies.length === 0 }\n}\n"],"mappings":"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","names":[]}
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  dumpVaultSchema
3
- } from "./chunk-MKV2KYRV.js";
3
+ } from "./chunk-ER3BQCCE.js";
4
4
  import "./chunk-KHKKD62N.js";
5
5
  import "./chunk-HNOBRU24.js";
6
6
  import "./chunk-Y2NBBT6K.js";
7
- import "./chunk-A3WHDOWI.js";
8
- import "./chunk-LTVETWDH.js";
9
- import "./chunk-6E2JZRBD.js";
7
+ import "./chunk-IN5EZWYQ.js";
8
+ import "./chunk-X3AXSYBL.js";
9
+ import "./chunk-ZVAFJQZB.js";
10
10
  import "./chunk-FSZPQCDR.js";
11
11
  import "./chunk-HVR74IBG.js";
12
12
  import "./chunk-RBTZLXZJ.js";
13
13
  import "./chunk-LP7BEXCT.js";
14
14
  import "./chunk-QTDAPDDV.js";
15
- import "./chunk-SFY6NT7D.js";
15
+ import "./chunk-3Y4OFWQJ.js";
16
16
  import "./chunk-I64WQSN3.js";
17
17
  import "./chunk-PZ5AY32C.js";
18
18
  export {
19
19
  dumpVaultSchema
20
20
  };
21
- //# sourceMappingURL=walk-B4YFJJ7S.js.map
21
+ //# sourceMappingURL=walk-HSS3NLQ3.js.map
@@ -501,7 +501,7 @@ export interface ReadOnlyCollection<T> {
501
501
  * @internal — called by Vault methods that need the closed-period
502
502
  * cache. Not part of the public API surface.
503
503
  */
504
- export declare function loadPeriods(adapter: NoydbStore, vault: string, decrypt: (envelope: EncryptedEnvelope) => Promise<PeriodRecord>): Promise<PeriodRecord[]>;
504
+ export declare function loadPeriods(adapter: NoydbStore, vault: string, decrypt: (id: string, envelope: EncryptedEnvelope) => Promise<PeriodRecord>): Promise<PeriodRecord[]>;
505
505
  /**
506
506
  * Given the current ordered period list, pick the last entry that
507
507
  * belongs to the hash chain — used as the `priorPeriodHash` anchor
@@ -17,7 +17,7 @@ import type { PeriodRecord, PeriodPartition, PartitionResolver } from './periods
17
17
  * @internal
18
18
  */
19
19
  export interface PeriodsStrategy {
20
- loadPeriods(adapter: NoydbStore, vault: string, decrypt: (envelope: EncryptedEnvelope) => Promise<PeriodRecord>): Promise<PeriodRecord[]>;
20
+ loadPeriods(adapter: NoydbStore, vault: string, decrypt: (id: string, envelope: EncryptedEnvelope) => Promise<PeriodRecord>): Promise<PeriodRecord[]>;
21
21
  chainAnchor(records: readonly PeriodRecord[], partition?: PeriodPartition): Promise<{
22
22
  priorPeriodName?: string;
23
23
  priorPeriodHash: string;
@@ -46,10 +46,23 @@ export { SealedRecordNotEnabledError } from '../../kernel/errors.js';
46
46
  * @param expectedCollection Collection the caller believes `recordEnvelope` is in.
47
47
  * @param expectedId Record id the caller believes `recordEnvelope` is.
48
48
  * @returns The decrypted record body as a JSON string.
49
+ *
50
+ * ⚠️ **`recordEnvelope` must carry `_tier` and `_by`, not just the body**
51
+ * (#1041). They are plaintext metadata rather than secrets, but they are bound
52
+ * into the record's AAD, so a host handed only `{_iv, _data}` cannot
53
+ * reconstruct the identity the body was sealed against.
54
+ *
55
+ * That is a feature, not a tax: it means a host cannot be fed a body with its
56
+ * tags stripped or rewritten — a re-tiered or re-authored envelope no longer
57
+ * opens, even with a valid sealed CEK.
49
58
  */
50
59
  export declare function openSealedRecord(sealedCekEnvelope: SealedCekDeliveryEnvelope, recordEnvelope: {
51
60
  readonly _iv: string;
52
61
  readonly _data: string;
62
+ /** Bound into the AAD since #1093 — a rewound body no longer opens. */
63
+ readonly _v: number;
64
+ readonly _tier?: number | undefined;
65
+ readonly _by?: string | undefined;
53
66
  }, recipientSealer: {
54
67
  unseal(bytes: Uint8Array): Promise<Uint8Array>;
55
68
  }, expectedCollection: string, expectedId: string): Promise<string>;
@@ -23,7 +23,7 @@
23
23
  export { withTiers } from './active.js';
24
24
  export { NO_TIERS, type TiersStrategy } from './strategy.js';
25
25
  export { TiersNotEnabledError } from '../../kernel/errors.js';
26
- import { type RecordCodec, type EnclaveKey, type SealedShredSlot } from '../../kernel/enclave/index.js';
26
+ import { type RecordIdentity, type RecordCodec, type EnclaveKey, type SealedShredSlot } from '../../kernel/enclave/index.js';
27
27
  import type { UnlockedKeyring } from '../../with-party/team/keyring.js';
28
28
  import type { Lru } from '../../kernel/cache/index.js';
29
29
  import type { BlobFieldsConfig } from '../../with-shape/blobs/blob-compaction.js';
@@ -123,7 +123,22 @@ export interface TiersContext<T> {
123
123
  * pre-move body whenever `fromTier > 0`. No-op when history is disabled
124
124
  * (folds the `historyConfig.enabled` gate so `tiers/index.ts` stays simple).
125
125
  */
126
- saveHistorySnapshot(id: string, envelope: EncryptedEnvelope): Promise<void>;
126
+ /**
127
+ * Persist a `_history` snapshot of `version`, sealed against the address it
128
+ * will be STORED at (#1041).
129
+ *
130
+ * Takes a **sealer**, not a finished envelope, because the destination
131
+ * identity is not knowable here: only the history strategy owns the
132
+ * `_history` layout. It hands the address in; the caller seals to it.
133
+ *
134
+ * ⚠️ The identity passed to `rewrapBodyToDek` must be what a READER will
135
+ * recompute — `recordAadFor(address, finalEnvelope)`. A tier-move snapshot
136
+ * strips `_tier`/`_elevatedBy` but KEEPS `_by`, so the destination is
137
+ * `{...address, by: envelope._by}` with no tier. Sealing against the bare
138
+ * address would produce history nothing can open, and the failure would
139
+ * surface only when someone reads it.
140
+ */
141
+ saveHistorySnapshot(id: string, version: number, seal: (address: RecordIdentity) => Promise<EncryptedEnvelope>): Promise<void>;
127
142
  /**
128
143
  * `true` iff a real history strategy is wired (not `NO_HISTORY`) AND not
129
144
  * explicitly disabled via `historyConfig.enabled`. `putAtTier` checks this
@@ -1,5 +1,31 @@
1
+ import type { RecordIdentity } from '../../kernel/enclave/index.js';
1
2
  import type { NoydbStore, EncryptedEnvelope, HistoryOptions, PruneOptions } from '../../kernel/types.js';
2
3
  import { type EnclaveKey } from '../../kernel/enclave/index.js';
4
+ /**
5
+ * The identity a history snapshot is **sealed against** — its STORAGE location,
6
+ * not the live record it is a copy of (#1041).
7
+ *
8
+ * ## Why storage, and why this is a decision rather than a detail
9
+ *
10
+ * A snapshot is a copy, so two identities are available: the live record
11
+ * (`collection`/`recordId`) or where the bytes actually land
12
+ * (`_history`/`historyId(...)`). They are not equivalent under attack.
13
+ *
14
+ * Binding the LIVE identity makes a snapshot's AAD **indistinguishable from the
15
+ * live record's at the same version** — so an untrusted store could serve a
16
+ * history entry *as the current record* and the client would accept it. It also
17
+ * leaves entries relocatable within `_history`.
18
+ *
19
+ * Binding STORAGE identity closes both. The cost is that the id must be known
20
+ * *before* the envelope is sealed, where `saveHistory` previously derived it
21
+ * *after* (from `envelope._v`) — which is precisely the restructure this
22
+ * function exists to make possible.
23
+ *
24
+ * `saveHistory` uses this too, so the sealed identity and the put location have
25
+ * **one definition** and cannot drift apart. Changing the layout here changes
26
+ * both at once, by construction.
27
+ */
28
+ export declare function historyIdentity(collection: string, recordId: string, version: number): RecordIdentity;
3
29
  /** Save a history entry (a complete encrypted envelope snapshot). */
4
30
  export declare function saveHistory(adapter: NoydbStore, vault: string, collection: string, recordId: string, envelope: EncryptedEnvelope): Promise<void>;
5
31
  /** Get history entries for a record, sorted newest-first. */
@@ -17,7 +17,7 @@
17
17
  */
18
18
  export { withHistory } from './active.js';
19
19
  export type { HistoryStrategy } from './strategy.js';
20
- export { saveHistory, getHistory, getVersionEnvelope, pruneHistory, clearHistory, } from './history.js';
20
+ export { saveHistory, historyIdentity, getHistory, getVersionEnvelope, pruneHistory, clearHistory, } from './history.js';
21
21
  export { diff, formatDiff } from './diff.js';
22
22
  export type { ChangeType, DiffEntry } from './diff.js';
23
23
  export { LedgerStore, LEDGER_COLLECTION, LEDGER_DELTAS_COLLECTION, envelopePayloadHash, } from './ledger/store.js';
@@ -30,3 +30,4 @@ export { VaultInstant, CollectionInstant } from './time-machine.js';
30
30
  export type { VaultEngine } from './time-machine.js';
31
31
  /** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
32
32
  export { NO_HISTORY } from './strategy.js';
33
+ export type { RecordIdentity } from '../../kernel/enclave/index.js';
@@ -237,7 +237,13 @@ export declare class LedgerStore {
237
237
  * version/timestamp/actor) fully intact for audit purposes.
238
238
  */
239
239
  purgeRecordDeltas(collection: string, id: string): Promise<number>;
240
- /** Encrypt a JSON Patch into an envelope for storage. Mirrors encryptEntry. */
240
+ /**
241
+ * Encrypt a JSON Patch into an envelope for storage. Mirrors encryptEntry.
242
+ *
243
+ * `index` is the ledger index this delta will be stored under — the caller
244
+ * knows it before the entry exists, and it is what makes the envelope's
245
+ * identity bindable (#1051).
246
+ */
241
247
  private encryptDelta;
242
248
  /**
243
249
  * Read all entries in ascending-index order. Used internally by
@@ -33,7 +33,7 @@ import type { LedgerStore } from './ledger/store.js';
33
33
  import type { JsonPatch } from './ledger/patch.js';
34
34
  import type { DiffEntry } from './diff.js';
35
35
  import type { VaultInstant, VaultEngine } from './time-machine.js';
36
- import type { EnclaveKey } from '../../kernel/enclave/index.js';
36
+ import type { EnclaveKey, RecordIdentity } from '../../kernel/enclave/index.js';
37
37
  /**
38
38
  * Options accepted by `HistoryStrategy.buildLedger`. Mirrors the
39
39
  * `LedgerStore` constructor verbatim — kept in this file so `core`
@@ -58,6 +58,16 @@ export interface HistoryStrategy {
58
58
  * `NO_HISTORY`.
59
59
  */
60
60
  saveHistory(adapter: NoydbStore, vault: string, collection: string, recordId: string, envelope: EncryptedEnvelope): Promise<void>;
61
+ /**
62
+ * The identity a snapshot of `collection/recordId@version` must be **sealed
63
+ * against** — its `_history` storage location (#1041).
64
+ *
65
+ * On the port because the kernel writes history snapshots but must not import
66
+ * `with-commit` to learn its layout. Exposing it here keeps the derivation in
67
+ * the module that owns the layout, and `saveHistory` uses the same function,
68
+ * so the sealed identity and the put location cannot drift.
69
+ */
70
+ historyIdentity(collection: string, recordId: string, version: number): RecordIdentity;
61
71
  /**
62
72
  * List history envelopes for a record, newest first. Throws under
63
73
  * `NO_HISTORY` — callers reach this via `collection.history()` /
@@ -0,0 +1,2 @@
1
+ import { type VaultHeadStrategy, type WithVaultHeadOptions } from './strategy.js';
2
+ export declare function withVaultHead(opts?: WithVaultHeadOptions): VaultHeadStrategy;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The vault head's storage layer (#1044).
3
+ *
4
+ * A bucket is an ordinary encrypted record at `_head/<collection>::<n>`, so it
5
+ * inherits #1041's identity binding for free: the store cannot relocate a
6
+ * bucket, re-author it, or serve one bucket's bytes as another's. What it can
7
+ * still do is serve an OLD bucket, which is why {@link readBucket} enforces
8
+ * monotonicity against the caller's own record of what it last wrote.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import { type EnclaveKey } from '../../kernel/enclave/index.js';
13
+ import type { NoydbStore } from '../../kernel/types.js';
14
+ /** `{ recordId → version }` for one bucket. */
15
+ export type BucketBody = Record<string, number>;
16
+ /**
17
+ * FNV-1a over `collection/id`. A hash, not a cipher: the bucket a record lands
18
+ * in is not secret — the store already sees which bucket was written, and it
19
+ * already saw the record's own address. Choosing something stronger would buy
20
+ * nothing and cost every write.
21
+ */
22
+ export declare function bucketIndex(collection: string, id: string, buckets: number): number;
23
+ export declare function bucketId(collection: string, id: string, buckets: number): string;
24
+ export declare function readBucket(store: NoydbStore, vault: string, dek: EnclaveKey, bucket: string): Promise<{
25
+ body: BucketBody;
26
+ version: number;
27
+ }>;
28
+ export declare function writeBucket(store: NoydbStore, vault: string, dek: EnclaveKey, bucket: string, body: BucketBody, expectedVersion: number): Promise<void>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * `@noy-db/hub/vault-head` — detect a store that WITHHOLDS (#1044).
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export { withVaultHead } from './active.js';
7
+ export { verifyVaultHead, type HeadDiscrepancy, type HeadVerifyResult } from './verify.js';
8
+ export { NO_VAULT_HEAD, VAULT_HEAD_COLLECTION, DEFAULT_HEAD_BUCKETS, type VaultHeadStrategy, type WithVaultHeadOptions, type HeadEntry, } from './strategy.js';
9
+ export type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js';
10
+ export type { EnclaveKey } from '../../kernel/enclave/index.js';
@@ -0,0 +1,127 @@
1
+ /**
2
+ * `withVaultHead()` — the opt-in detector for **omission** (#1044).
3
+ *
4
+ * ## What it is for, and what it deliberately is not
5
+ *
6
+ * #1041 made every envelope self-authenticating at its identity, and #1042
7
+ * made the merge reject one that is not. What neither can catch is **absence**:
8
+ * a store that serves a genuine, unmodified `v1` when `v7` exists, or serves
9
+ * nothing at all. An authentic old envelope is indistinguishable from an
10
+ * authentic current one without external knowledge of what *should* be there.
11
+ *
12
+ * The head is that external knowledge: an authenticated `{id → version}`
13
+ * manifest the client writes and the store cannot forge. It is **not** a Merkle
14
+ * chain over content — content integrity is already handled, so the head needs
15
+ * only versions.
16
+ *
17
+ * ## Why it is opt-in when AAD is not
18
+ *
19
+ * AAD costs nothing to coordinate and closes *alteration*, so it is kernel. The
20
+ * head costs a write per commit and needs anti-entropy; on a single-device
21
+ * offline vault it defends against nothing. Making it kernel would tax every
22
+ * user for a multi-writer property. ADR 0003, Decision 3.
23
+ *
24
+ * `SECURITY.md` states the split exactly: a store cannot alter, relocate,
25
+ * re-tier, re-author or rewind a record; **without `withVaultHead()` it can
26
+ * still withhold or omit.**
27
+ *
28
+ * ## Bucketed, and why that is not a compromise
29
+ *
30
+ * ADR 0003 left head granularity open and asked for it to be sized early.
31
+ * Measured, at the documented 50K-record vault ceiling:
32
+ *
33
+ * | shape | write cost per commit | detection |
34
+ * |---|---|---|
35
+ * | one per-vault manifest | **1.1 MiB** | per-record |
36
+ * | one per collection | the same problem, renamed | per-record |
37
+ * | **bucketed, 256 buckets** | **~4.4 KiB** | per-record |
38
+ *
39
+ * Bucketing changes *only* write amplification. Each bucket still lists every
40
+ * one of its records' versions, so detection stays per-record — which is why
41
+ * this is not a trade-off between cost and strength. Verifying one pulled
42
+ * record reads one bucket rather than a megabyte.
43
+ *
44
+ * ## Wired as a bus OBSERVER, not a call in `collection.ts`
45
+ *
46
+ * That is what `kernel-surface` means by "register on the ServiceBus instead of
47
+ * growing this file", and it keeps the hot write path untouched for anyone who
48
+ * has not opted in: nothing is registered at all, so `hasHandlers` stays false
49
+ * and the dispatch never happens.
50
+ *
51
+ * Both `afterPut` AND `afterDelete`, because a delete is a version bump like
52
+ * any other. A head that stopped tracking deleted records would let a store
53
+ * resurrect one by withholding the tombstone — precisely the omission this
54
+ * exists to catch.
55
+ *
56
+ * ⚠️ The registration must be UNCONDITIONAL on anything but `enabled`. Its first
57
+ * draft sat inside `#registerForgetHooks()`, which returns early when no forget
58
+ * subjects are declared, so the head silently recorded nothing unless the vault
59
+ * happened to use an unrelated feature. The tests caught it only because they
60
+ * asserted a COUNT rather than "no error" — a head that records nothing raises
61
+ * no errors and sweeps perfectly clean.
62
+ *
63
+ * @packageDocumentation
64
+ */
65
+ import type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js';
66
+ import type { EnclaveKey } from '../../kernel/enclave/index.js';
67
+ /** Reserved collection the head's buckets live in. */
68
+ export declare const VAULT_HEAD_COLLECTION: "_head";
69
+ /** Default bucket count — see the sizing table above. */
70
+ export declare const DEFAULT_HEAD_BUCKETS = 256;
71
+ export interface WithVaultHeadOptions {
72
+ /**
73
+ * How many buckets the manifest is split across. Higher means smaller writes
74
+ * and more reads to sweep the whole vault; lower means the opposite.
75
+ * Changing it on an existing vault re-homes every entry, so treat it as a
76
+ * layout decision rather than a tuning knob.
77
+ */
78
+ readonly buckets?: number;
79
+ }
80
+ /** One record's expected state, as the client last committed it. */
81
+ export interface HeadEntry {
82
+ readonly collection: string;
83
+ readonly id: string;
84
+ readonly version: number;
85
+ }
86
+ export interface VaultHeadStrategy {
87
+ /**
88
+ * Is the head actually keeping a manifest?
89
+ *
90
+ * An explicit flag rather than an identity check against the stub: the kernel
91
+ * decides whether to register the write-path observer at all, and
92
+ * `port-layering` forbids it importing `NO_VAULT_HEAD` to compare. Without
93
+ * this, every write in a vault that never opted in would still pay a cache
94
+ * lookup and a no-op call.
95
+ */
96
+ readonly enabled: boolean;
97
+ /** Bucket a record id lands in — pure, so callers can pre-group a batch. */
98
+ bucketFor(collection: string, id: string): string;
99
+ /**
100
+ * Record `entry` as the client's expectation for that record.
101
+ *
102
+ * Called on every committed write, INSIDE the same logical operation, so
103
+ * there is no window where the record exists and the head does not know it.
104
+ */
105
+ note(store: NoydbStore, vault: string, getDEK: (collection: string) => Promise<EnclaveKey>, entry: HeadEntry): Promise<void>;
106
+ /**
107
+ * What the client expects for `collection/id`, or `null` if the head has
108
+ * never seen it.
109
+ */
110
+ expected(store: NoydbStore, vault: string, getDEK: (collection: string) => Promise<EnclaveKey>, collection: string, id: string): Promise<number | null>;
111
+ /**
112
+ * Every record the head knows about in `collection` — the set a sweep
113
+ * compares against what the store actually serves, which is how DELETION
114
+ * SUPPRESSION is caught. A withheld record is absent from the store but
115
+ * present here.
116
+ */
117
+ knownIn(store: NoydbStore, vault: string, getDEK: (collection: string) => Promise<EnclaveKey>, collection: string): Promise<ReadonlyMap<string, number>>;
118
+ }
119
+ /**
120
+ * The un-opted-in stub. `note` is a NO-OP rather than a throw: the write path
121
+ * calls it unconditionally, and a vault without the head must simply not keep
122
+ * one. The READ side throws, because asking what the head expects when there is
123
+ * no head is a caller error, not a silent "nothing to report" — the latter
124
+ * would look exactly like a clean sweep.
125
+ */
126
+ export declare const NO_VAULT_HEAD: VaultHeadStrategy;
127
+ export type { EncryptedEnvelope };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The sweep — comparing what the head expects against what the store serves (#1044).
3
+ *
4
+ * This is the only place absence becomes visible. #1041 and #1042 can reject a
5
+ * record that lies about itself; neither can notice one that never arrived, or
6
+ * one served at an older version than the client wrote. Both are indistinguishable
7
+ * from the truth without an independent record of what should be there.
8
+ *
9
+ * @packageDocumentation
10
+ */
11
+ import type { NoydbStore } from '../../kernel/types.js';
12
+ import type { EnclaveKey } from '../../kernel/enclave/index.js';
13
+ import type { VaultHeadStrategy } from './strategy.js';
14
+ /** One record the store is not serving faithfully. */
15
+ export interface HeadDiscrepancy {
16
+ readonly collection: string;
17
+ readonly id: string;
18
+ /** What the client last committed. */
19
+ readonly expected: number;
20
+ /**
21
+ * What the store serves now — or `null` when it serves nothing.
22
+ *
23
+ * The two are different attacks wearing the same result. `null` is
24
+ * **suppression**: the record is gone. A lower number is **rollback**: an
25
+ * authentic older version served in place of the current one, which is the
26
+ * case no amount of per-envelope authentication can see.
27
+ */
28
+ readonly actual: number | null;
29
+ readonly kind: 'withheld' | 'rolled-back';
30
+ }
31
+ export interface HeadVerifyResult {
32
+ readonly checked: number;
33
+ readonly discrepancies: readonly HeadDiscrepancy[];
34
+ /** `true` when every record the head knows about is served at or above its expected version. */
35
+ readonly clean: boolean;
36
+ }
37
+ /**
38
+ * Sweep one collection.
39
+ *
40
+ * **A record the store serves that the head does NOT know is not reported.**
41
+ * That is not an oversight: the head can be enabled on an existing vault, and
42
+ * every pre-existing record would otherwise read as an anomaly. The head's
43
+ * claim is one-directional — *what I wrote must still be there* — and an
44
+ * unknown record simply falls outside it.
45
+ *
46
+ * **A HIGHER version than expected is also not reported**, for the same reason:
47
+ * another device legitimately advanced it. The head detects going backwards, not
48
+ * moving forwards.
49
+ */
50
+ export declare function verifyVaultHead(head: VaultHeadStrategy, store: NoydbStore, vault: string, getDEK: (collection: string) => Promise<EnclaveKey>, collection: string): Promise<HeadVerifyResult>;
@@ -1,11 +1,3 @@
1
- /**
2
- * Persistence helpers for `_meta/public-envelope` — the cover's
3
- * frozen wire location. Mirrors the bypass-AES pattern used by
4
- * `_meta/handle` and `_meta/policy` — the document is plaintext
5
- * JSON, the envelope's `_iv` field is left empty.
6
- *
7
- * @module
8
- */
9
1
  import type { NoydbStore } from '../../../kernel/types.js';
10
2
  import type { Cover } from './types.js';
11
3
  /**
@@ -1,14 +1,3 @@
1
- /**
2
- * Persistence helpers for the vault-level user-directory toggle
3
- * (`_meta/directory`). Mirrors the bypass-AES pattern used by
4
- * `_meta/policy` — the directory document is plain JSON, the
5
- * envelope's `_iv` field is left empty.
6
- *
7
- * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/user-envelope.md → Directory visibility
8
- * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/plaintext-bypass.md — every `_iv: ''` write site
9
- *
10
- * @module
11
- */
12
1
  import type { NoydbStore } from '../../kernel/types.js';
13
2
  import type { DirectoryConfig } from './types.js';
14
3
  /** Reserved collection name for vault-level metadata documents. */
@@ -1,24 +1,3 @@
1
- /**
2
- * Persistence helpers for the per-user visibility flag
3
- * (`_meta/visibility/<keyringId>`). Mirrors the bypass-AES pattern used
4
- * by `_meta/policy` — the visibility document is plain JSON, the
5
- * envelope's `_iv` field is left empty.
6
- *
7
- * Stored alongside the keyring file rather than inside the encrypted
8
- * user envelope (`_users/<keyringId>`) because:
9
- *
10
- * - `UserEnvelope<T>.data` is opaque-to-hub by contract — hub does not
11
- * introspect or reserve any keys inside it. Adding `hidden` there
12
- * would violate that contract.
13
- * - `listUsersWithEnvelopes` filters by the flag, and the filter must
14
- * work even when decryption fails (legacy keyrings predating the
15
- * envelope feature, or a corrupted envelope).
16
- *
17
- * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/user-envelope.md → Directory visibility
18
- * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/plaintext-bypass.md — every `_iv: ''` write site
19
- *
20
- * @module
21
- */
22
1
  import type { NoydbStore } from '../../kernel/types.js';
23
2
  import type { UserVisibility } from './types.js';
24
3
  /** Prefix for per-user visibility records inside `_meta`. */
@@ -1,13 +1,3 @@
1
- /**
2
- * Persistence helpers for the vault-level policy document
3
- * (`_meta/policy`). Mirrors the bypass-AES pattern used by
4
- * `_meta/handle` — the policy document is plain JSON, the envelope's
5
- * `_iv` field is left empty.
6
- *
7
- * @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/session-tiers.md → Storage location
8
- *
9
- * @module
10
- */
11
1
  import type { NoydbStore, VaultPolicy } from '../../kernel/types.js';
12
2
  /** Reserved collection name for vault-level metadata documents. */
13
3
  export declare const META_COLLECTION = "_meta";
@@ -9,6 +9,11 @@ export interface UnlockedKeyring {
9
9
  readonly role: Role;
10
10
  readonly permissions: Permissions;
11
11
  readonly deks: Map<string, EnclaveKey>;
12
+ /**
13
+ * Unwrapped counterpart of {@link KeyringFile.pending_deks} — an
14
+ * uncommitted rotation (#1074). Empty in the normal state.
15
+ */
16
+ readonly pendingDeks?: Map<string, EnclaveKey> | undefined;
12
17
  /**
13
18
  * The KEK, when this keyring was unlocked via tier 1 (secret) or
14
19
  * a wrap-KEK tier-2 method (WebAuthn / OIDC). `null` when the