@noy-db/hub 0.3.0-pre.11 → 0.3.0-pre.13

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 (395) hide show
  1. package/dist/aggregate/index.js +4 -4
  2. package/dist/api-ZGS6LCOF.js +20 -0
  3. package/dist/as/index.js +11 -11
  4. package/dist/attestation/index.js +18 -18
  5. package/dist/{backup-XA5STIYQ.js → backup-BJ57IKAO.js} +28 -11
  6. package/dist/backup-BJ57IKAO.js.map +1 -0
  7. package/dist/blobs/index.js +12 -10
  8. package/dist/blobs/index.js.map +1 -1
  9. package/dist/broker/index.js +12 -12
  10. package/dist/bundle/index.js +25 -22
  11. package/dist/bundle/index.js.map +1 -1
  12. package/dist/by/index.js +2 -2
  13. package/dist/cargo/index.js +22 -22
  14. package/dist/{chunk-WGV4CUZT.js → chunk-2NVOWNI3.js} +4 -4
  15. package/dist/{chunk-WGV4CUZT.js.map → chunk-2NVOWNI3.js.map} +1 -1
  16. package/dist/{chunk-OFJ5GPNA.js → chunk-3B5VVCNY.js} +2 -2
  17. package/dist/{chunk-KPGX66PM.js → chunk-3LQ2YKO4.js} +2 -2
  18. package/dist/{chunk-D26JB3LZ.js → chunk-3QCRBHCY.js} +2 -2
  19. package/dist/{chunk-H6CZSDWK.js → chunk-454JXE57.js} +3 -3
  20. package/dist/{chunk-H6CZSDWK.js.map → chunk-454JXE57.js.map} +1 -1
  21. package/dist/{chunk-DGH65E7Q.js → chunk-4CTHCN4J.js} +24 -10
  22. package/dist/chunk-4CTHCN4J.js.map +1 -0
  23. package/dist/{chunk-4N5QFSNQ.js → chunk-4JBYV75E.js} +5 -5
  24. package/dist/{chunk-UTLEAJXC.js → chunk-4NXKCLLQ.js} +2 -2
  25. package/dist/{chunk-ARSAMO24.js → chunk-4VNQOLML.js} +2 -2
  26. package/dist/{chunk-X6CMGUAG.js → chunk-5M5DVGV7.js} +2 -2
  27. package/dist/{chunk-DJ3VKYFA.js → chunk-5O3XF4DV.js} +4 -4
  28. package/dist/chunk-5O3XF4DV.js.map +1 -0
  29. package/dist/{chunk-XHV25KBM.js → chunk-5YOLBEQ6.js} +2 -2
  30. package/dist/{chunk-CB25ONKC.js → chunk-6CRIV7DE.js} +2 -2
  31. package/dist/{chunk-BE7N3AXA.js → chunk-6JTIAGHD.js} +3 -3
  32. package/dist/{chunk-JOQ53DMI.js → chunk-6QTNZJBS.js} +3 -3
  33. package/dist/{chunk-BZO4WCJI.js → chunk-6T2SCQRU.js} +4 -4
  34. package/dist/{chunk-FQQF23MC.js → chunk-7DSTRQIJ.js} +2 -2
  35. package/dist/{chunk-IP2QBAGS.js → chunk-AUSTCW2X.js} +10 -10
  36. package/dist/{chunk-A2Y6YFVN.js → chunk-B3HJYUOF.js} +2 -2
  37. package/dist/{chunk-SRVQHVNX.js → chunk-BDVFPG6Y.js} +5 -5
  38. package/dist/{chunk-FH542DDY.js → chunk-BIOUI4HL.js} +50 -1
  39. package/dist/chunk-BIOUI4HL.js.map +1 -0
  40. package/dist/{chunk-YXOUQ2H7.js → chunk-CAF6WOK7.js} +2 -2
  41. package/dist/{chunk-H6HM6CVR.js → chunk-CDUQTA3Z.js} +114 -12
  42. package/dist/chunk-CDUQTA3Z.js.map +1 -0
  43. package/dist/{chunk-HUS3J5WM.js → chunk-CIE2BASH.js} +2 -2
  44. package/dist/{chunk-DIRRS7WP.js → chunk-CRI4OUV4.js} +2 -2
  45. package/dist/{chunk-FXK4X4BL.js → chunk-DLG74CNB.js} +4 -4
  46. package/dist/{chunk-WTUNZACT.js → chunk-E5ZQT5KX.js} +2 -2
  47. package/dist/{chunk-DMFNPHCX.js → chunk-EQO2UVP4.js} +6 -6
  48. package/dist/{chunk-MCEKIAO4.js → chunk-ERJ7FU55.js} +3 -3
  49. package/dist/{chunk-6QILBDZU.js → chunk-EVVGJDRQ.js} +3 -3
  50. package/dist/{chunk-7VSGW5KJ.js → chunk-EVX47VBM.js} +2 -2
  51. package/dist/{chunk-D3EFFFOL.js → chunk-EXK7QRWF.js} +5 -5
  52. package/dist/{chunk-5JB73NMC.js → chunk-EYZ6IQ6X.js} +5 -5
  53. package/dist/{chunk-BCYQA5BK.js → chunk-F64IRYG3.js} +2 -2
  54. package/dist/{chunk-K62IUKOD.js → chunk-FHS2HQSH.js} +5 -5
  55. package/dist/{chunk-2JMMY7HZ.js → chunk-FM3G3NOY.js} +27 -9
  56. package/dist/chunk-FM3G3NOY.js.map +1 -0
  57. package/dist/{chunk-67TNU77I.js → chunk-FUG4SFN3.js} +2 -2
  58. package/dist/{chunk-ZP5PL65C.js → chunk-GKEWXIV5.js} +2 -2
  59. package/dist/{chunk-RKRGDAS7.js → chunk-GTGPO5KW.js} +5 -5
  60. package/dist/{chunk-MSPNM2OM.js → chunk-HB3RFQSC.js} +3 -3
  61. package/dist/{chunk-W5D62AQD.js → chunk-HDMEGAQE.js} +20 -7
  62. package/dist/chunk-HDMEGAQE.js.map +1 -0
  63. package/dist/chunk-HDQIIUPH.js +135 -0
  64. package/dist/chunk-HDQIIUPH.js.map +1 -0
  65. package/dist/{chunk-7QIXUSDQ.js → chunk-HTJQYHZP.js} +15 -12
  66. package/dist/chunk-HTJQYHZP.js.map +1 -0
  67. package/dist/{chunk-OOLO4LQG.js → chunk-I6GALP6E.js} +6 -6
  68. package/dist/{chunk-57V5S7PW.js → chunk-IL6POWCW.js} +6 -6
  69. package/dist/{chunk-7NS43EXZ.js → chunk-IU6SNYX6.js} +5 -5
  70. package/dist/{chunk-5ZOSG3RJ.js → chunk-J2ZX2XUV.js} +5 -5
  71. package/dist/{chunk-L2SNBIV7.js → chunk-JIF24JPM.js} +57 -15
  72. package/dist/chunk-JIF24JPM.js.map +1 -0
  73. package/dist/{chunk-SYMS4546.js → chunk-JKJOGPZN.js} +2 -2
  74. package/dist/{chunk-CKZW6P5V.js → chunk-JNAI2HN2.js} +1 -1
  75. package/dist/chunk-JNAI2HN2.js.map +1 -0
  76. package/dist/{chunk-AWB5JZW6.js → chunk-JZUV47FZ.js} +2 -2
  77. package/dist/{chunk-ODJWBC5I.js → chunk-K5IMOGHB.js} +2 -2
  78. package/dist/{chunk-3G4KMVUN.js → chunk-KSKBRKGJ.js} +3 -3
  79. package/dist/{chunk-HFJIGWJC.js → chunk-LASZKVMO.js} +3 -3
  80. package/dist/{chunk-IGJHJYM6.js → chunk-LXEXBTKL.js} +4 -4
  81. package/dist/{chunk-3CNQ7FQ3.js → chunk-M4CV6BRT.js} +119 -25
  82. package/dist/chunk-M4CV6BRT.js.map +1 -0
  83. package/dist/{chunk-H44ZE4IE.js → chunk-MEFJPTZ4.js} +33 -17
  84. package/dist/chunk-MEFJPTZ4.js.map +1 -0
  85. package/dist/{chunk-PR5LC5YX.js → chunk-MV43JSJF.js} +4 -4
  86. package/dist/{chunk-ELNBMFOS.js → chunk-NJ4EOKMB.js} +4 -4
  87. package/dist/{chunk-PXWVF7MC.js → chunk-NR5LT5RY.js} +7 -7
  88. package/dist/{chunk-QYPKGVT4.js → chunk-NWSGI5C7.js} +3 -3
  89. package/dist/{chunk-P5RY4ZWD.js → chunk-OSDB5WW3.js} +92 -15
  90. package/dist/chunk-OSDB5WW3.js.map +1 -0
  91. package/dist/chunk-PN2XMATY.js +37 -0
  92. package/dist/chunk-PN2XMATY.js.map +1 -0
  93. package/dist/{chunk-25NDNMQ7.js → chunk-Q5VNKNE5.js} +3 -3
  94. package/dist/{chunk-CIKY6I4W.js → chunk-QLWMEXCT.js} +2 -2
  95. package/dist/{chunk-VA4ZWLFY.js → chunk-QRB7NAOJ.js} +2 -2
  96. package/dist/{chunk-3MSQLQNZ.js → chunk-R4ROFEYC.js} +2 -2
  97. package/dist/{chunk-BEIRE5K4.js → chunk-RCVJZMFE.js} +4 -4
  98. package/dist/{chunk-VR24ILCR.js → chunk-RIX4V2TB.js} +3 -3
  99. package/dist/{chunk-Q3XSMOZM.js → chunk-RYCTDFUX.js} +2 -2
  100. package/dist/{chunk-7E67FJ33.js → chunk-RZ5SVOYR.js} +2 -2
  101. package/dist/{chunk-IDIV5NVH.js → chunk-SLFHQTTW.js} +5 -5
  102. package/dist/chunk-SNZ6URZZ.js +2782 -0
  103. package/dist/chunk-SNZ6URZZ.js.map +1 -0
  104. package/dist/{chunk-C3YH34IL.js → chunk-T2FFWNPK.js} +3 -3
  105. package/dist/{chunk-O2DYPAZY.js → chunk-UNFPPVNI.js} +2 -2
  106. package/dist/{chunk-MELR46EF.js → chunk-VFUPHI2Z.js} +63 -10
  107. package/dist/chunk-VFUPHI2Z.js.map +1 -0
  108. package/dist/{chunk-GA2QHD6P.js → chunk-VLFCJYTL.js} +9 -9
  109. package/dist/{chunk-YSXEFGND.js → chunk-VN3DBQAU.js} +2 -2
  110. package/dist/{chunk-C7NTK5I3.js → chunk-VZRODIM3.js} +4 -4
  111. package/dist/{chunk-QLLKLFE2.js → chunk-W22IKJE2.js} +2 -2
  112. package/dist/{chunk-5XIPOCQC.js → chunk-X3YYQWOQ.js} +3 -3
  113. package/dist/{chunk-A2QF4JUE.js → chunk-X7QBD67R.js} +625 -293
  114. package/dist/chunk-X7QBD67R.js.map +1 -0
  115. package/dist/{chunk-QQJXBZCO.js → chunk-XDYREZWE.js} +82 -10
  116. package/dist/chunk-XDYREZWE.js.map +1 -0
  117. package/dist/{chunk-OEAATWH5.js → chunk-XWZVFISC.js} +40 -6
  118. package/dist/{chunk-OEAATWH5.js.map → chunk-XWZVFISC.js.map} +1 -1
  119. package/dist/{chunk-XFXUTFWQ.js → chunk-YFXZEAYK.js} +6 -6
  120. package/dist/{chunk-7ITPJFGC.js → chunk-ZAJAVEXY.js} +2 -2
  121. package/dist/{chunk-4R4Q64W5.js → chunk-ZICD77GM.js} +2 -2
  122. package/dist/{chunk-45ZZLTFH.js → chunk-ZJ2AK4V7.js} +2 -2
  123. package/dist/{chunk-UFILRICG.js → chunk-ZUODRVHY.js} +2 -2
  124. package/dist/classified/index.js +5 -5
  125. package/dist/{classified-marker-LQWWQNIJ.js → classified-marker-CZKA6ITE.js} +8 -4
  126. package/dist/classified-marker-CZKA6ITE.js.map +1 -0
  127. package/dist/collection-facade-TLWIPI76.js +44 -0
  128. package/dist/{computed-W6MVAMWZ.js → computed-ZIQTYTDI.js} +3 -3
  129. package/dist/consent/index.js +9 -9
  130. package/dist/{dead-filter-4KXZEB3X.js → dead-filter-ESOBZZP5.js} +2 -2
  131. package/dist/delegation-W7ZV2322.js +25 -0
  132. package/dist/derivations/index.js +12 -12
  133. package/dist/derive-H2BJTLUI.js +21 -0
  134. package/dist/{enclave-VXAQD4XJ.js → enclave-AP3I5W7O.js} +15 -9
  135. package/dist/executor-KGWTNEQD.js +9 -0
  136. package/dist/executor-OVEXR6RT.js +9 -0
  137. package/dist/executor-UNEH5ZYH.js +25 -0
  138. package/dist/export-accessible-PCMXSUZS.js +23 -0
  139. package/dist/extract-partition-SWHFSYJO.js +38 -0
  140. package/dist/{fanout-sidecar-CKYFH33E.js → fanout-sidecar-A765THMX.js} +9 -9
  141. package/dist/find-N6345CNT.js +11 -0
  142. package/dist/forget/index.js +9 -9
  143. package/dist/guards/index.js +3 -3
  144. package/dist/history/index.js +14 -11
  145. package/dist/history/index.js.map +1 -1
  146. package/dist/i18n/index.js +14 -14
  147. package/dist/index.d.ts +5 -1
  148. package/dist/index.js +108 -89
  149. package/dist/index.js.map +1 -1
  150. package/dist/indexing/index.js +5 -5
  151. package/dist/indexing/index.js.map +1 -1
  152. package/dist/issue-5OKB6I2R.js +19 -0
  153. package/dist/kernel/best-effort-revert.d.ts +52 -0
  154. package/dist/kernel/collection-config.d.ts +28 -0
  155. package/dist/kernel/collection.d.ts +49 -32
  156. package/dist/kernel/enclave/classify/verify.d.ts +3 -0
  157. package/dist/kernel/enclave/index.d.ts +2 -1
  158. package/dist/kernel/enclave/record-keys/deterministic.d.ts +1 -0
  159. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +50 -0
  160. package/dist/kernel/enclave/record-keys/record-codec.d.ts +27 -0
  161. package/dist/kernel/errors.d.ts +75 -1
  162. package/dist/kernel/lazy-count.d.ts +13 -0
  163. package/dist/kernel/noydb.d.ts +8 -0
  164. package/dist/kernel/tier-visibility.d.ts +54 -0
  165. package/dist/kernel/types.d.ts +92 -0
  166. package/dist/kernel/vault.d.ts +23 -6
  167. package/dist/kernel/via/dispatch.d.ts +10 -0
  168. package/dist/kernel/via/graph.d.ts +2 -1
  169. package/dist/{ledger-FU6GH5EH.js → ledger-GFBKVPV4.js} +11 -11
  170. package/dist/legacy/bundle.d.ts +1 -1
  171. package/dist/liberate-3VDOT4KO.js +24 -0
  172. package/dist/{link-set-MNADSH5M.js → link-set-Z7Q2ASFX.js} +11 -11
  173. package/dist/materialized-views/index.js +18 -18
  174. package/dist/noydb-ZCJOYBDI.js +68 -0
  175. package/dist/on/index.js +9 -9
  176. package/dist/overlay-views/index.js +4 -4
  177. package/dist/periods/index.js +12 -12
  178. package/dist/pod/index.js +11 -11
  179. package/dist/{policy-JTFOPPUU.js → policy-Z3RUAIY2.js} +5 -5
  180. package/dist/port/with/blob-strategy.d.ts +17 -0
  181. package/dist/port/with/lookup-strategy.d.ts +2 -1
  182. package/dist/portability/index.js +8 -8
  183. package/dist/{post-register-HAWO3O7O.js → post-register-JTH76BLY.js} +12 -7
  184. package/dist/post-register-JTH76BLY.js.map +1 -0
  185. package/dist/{public-envelope-NJVB7LPA.js → public-envelope-B4KNWVUA.js} +4 -4
  186. package/dist/query/index.js +5 -5
  187. package/dist/register-VAHONCID.js +23 -0
  188. package/dist/registry-7MLVD3VO.js +19 -0
  189. package/dist/registry-EPKPD5SM.js +18 -0
  190. package/dist/registry-P5T7PS2U.js +9 -0
  191. package/dist/request-withdrawal-TI3A5WPS.js +31 -0
  192. package/dist/{reveal-BOY7XYFH.js → reveal-DIBHLUZX.js} +7 -7
  193. package/dist/reveal-DIBHLUZX.js.map +1 -0
  194. package/dist/revoke-FDRD6GRW.js +24 -0
  195. package/dist/satellites/index.js +1 -1
  196. package/dist/sealed-record/index.js +12 -12
  197. package/dist/{seed-4RRXT42N.js → seed-Q6M2IZFL.js} +11 -11
  198. package/dist/session/index.js +9 -9
  199. package/dist/shadow/index.js +2 -2
  200. package/dist/signer-MUWEIUI6.js +25 -0
  201. package/dist/snapshots/index.js +10 -10
  202. package/dist/stale-OSQ7J3AA.js +29 -0
  203. package/dist/storage-MVFCGEQE.js +23 -0
  204. package/dist/{store-coordination-provider-HPYVFJCV.js → store-coordination-provider-64OEZFGS.js} +3 -3
  205. package/dist/sync/index.js +9 -9
  206. package/dist/team/index.js +15 -15
  207. package/dist/tiers/index.js +14 -10
  208. package/dist/to/index.js +1 -1
  209. package/dist/tx/index.js +3 -3
  210. package/dist/util/index.js +1 -1
  211. package/dist/{verify-66RHOW7N.js → verify-ZASTRNPR.js} +9 -8
  212. package/dist/verify-ZASTRNPR.js.map +1 -0
  213. package/dist/via/lookup/registry.d.ts +9 -0
  214. package/dist/via/money/where.d.ts +27 -6
  215. package/dist/{walk-2RWEOCAS.js → walk-SVNDIZ62.js} +11 -11
  216. package/dist/with/index.js +11 -11
  217. package/dist/with-audit/forget/strategy.d.ts +22 -0
  218. package/dist/with-audit/tiers/index.d.ts +275 -3
  219. package/dist/with-audit/tiers/strategy.d.ts +5 -4
  220. package/dist/with-cargo/describe-extraction.d.ts +9 -1
  221. package/dist/with-cargo/extract-partition.d.ts +9 -1
  222. package/dist/with-cargo/walk-closure.d.ts +32 -3
  223. package/dist/with-commit/history/history.d.ts +46 -0
  224. package/dist/with-commit/history/ledger/store.d.ts +21 -0
  225. package/dist/with-commit/history/strategy.d.ts +10 -0
  226. package/dist/with-commit/history/time-machine.d.ts +23 -0
  227. package/dist/with-commit/tx/elevated-handle.d.ts +2 -1
  228. package/dist/with-commit/tx/transaction.d.ts +5 -0
  229. package/dist/with-formula/materialized-views/executor.d.ts +9 -0
  230. package/dist/with-formula/materialized-views/stale.d.ts +52 -1
  231. package/dist/with-lookup/embeddings/index.d.ts +1 -0
  232. package/dist/with-lookup/embeddings/vec-id.d.ts +47 -0
  233. package/dist/with-lookup/indexing/collection-facade.d.ts +38 -1
  234. package/dist/with-lookup/indexing/lazy-builder.d.ts +35 -2
  235. package/dist/with-lookup/indexing/persisted-indexes.d.ts +44 -1
  236. package/dist/with-lookup/search/collection-facade.d.ts +40 -0
  237. package/dist/with-lookup/search/persisted-index-store.d.ts +82 -2
  238. package/dist/with-lookup/search/strategy.d.ts +4 -0
  239. package/dist/with-party/team/sync.d.ts +9 -0
  240. package/dist/with-shape/blobs/blob-intent.d.ts +153 -0
  241. package/dist/with-shape/blobs/blob-set.d.ts +949 -5
  242. package/dist/with-shape/satellites/fanout.d.ts +5 -4
  243. package/dist/with-shape/satellites/migrate-cek.d.ts +26 -0
  244. package/dist/with-shape/satellites/types.d.ts +11 -0
  245. package/dist/withdraw-accessible-WZIEVWSR.js +28 -0
  246. package/package.json +3 -3
  247. package/dist/api-YGMINAET.js +0 -20
  248. package/dist/backup-XA5STIYQ.js.map +0 -1
  249. package/dist/chunk-2JMMY7HZ.js.map +0 -1
  250. package/dist/chunk-3CNQ7FQ3.js.map +0 -1
  251. package/dist/chunk-7QIXUSDQ.js.map +0 -1
  252. package/dist/chunk-A2QF4JUE.js.map +0 -1
  253. package/dist/chunk-AOVDSIL3.js +0 -1221
  254. package/dist/chunk-AOVDSIL3.js.map +0 -1
  255. package/dist/chunk-CKZW6P5V.js.map +0 -1
  256. package/dist/chunk-DGH65E7Q.js.map +0 -1
  257. package/dist/chunk-DJ3VKYFA.js.map +0 -1
  258. package/dist/chunk-FH542DDY.js.map +0 -1
  259. package/dist/chunk-H44ZE4IE.js.map +0 -1
  260. package/dist/chunk-H6HM6CVR.js.map +0 -1
  261. package/dist/chunk-L2SNBIV7.js.map +0 -1
  262. package/dist/chunk-MELR46EF.js.map +0 -1
  263. package/dist/chunk-P5RY4ZWD.js.map +0 -1
  264. package/dist/chunk-QQJXBZCO.js.map +0 -1
  265. package/dist/chunk-TPH5EO6L.js +0 -54
  266. package/dist/chunk-TPH5EO6L.js.map +0 -1
  267. package/dist/chunk-W5D62AQD.js.map +0 -1
  268. package/dist/classified-marker-LQWWQNIJ.js.map +0 -1
  269. package/dist/collection-facade-YE2O4J4O.js +0 -39
  270. package/dist/delegation-OPUU3R2E.js +0 -25
  271. package/dist/derive-BGUHU663.js +0 -21
  272. package/dist/executor-GTVSUUBX.js +0 -25
  273. package/dist/executor-GZWMTOXB.js +0 -9
  274. package/dist/executor-XXGS4S3K.js +0 -9
  275. package/dist/export-accessible-BMULIOYB.js +0 -23
  276. package/dist/extract-partition-JUQTWDXR.js +0 -36
  277. package/dist/find-XRGCNGNN.js +0 -11
  278. package/dist/issue-UB6AA5M6.js +0 -19
  279. package/dist/liberate-YUN7W5QG.js +0 -24
  280. package/dist/noydb-6JLBZU4U.js +0 -67
  281. package/dist/post-register-HAWO3O7O.js.map +0 -1
  282. package/dist/register-VCKOBWKT.js +0 -23
  283. package/dist/registry-72UKJ2L4.js +0 -9
  284. package/dist/registry-BZFLJNEH.js +0 -18
  285. package/dist/registry-YJEYSYI5.js +0 -19
  286. package/dist/request-withdrawal-6MJRMFHF.js +0 -31
  287. package/dist/reveal-BOY7XYFH.js.map +0 -1
  288. package/dist/revoke-4KUNSVJC.js +0 -24
  289. package/dist/signer-DDDXP5JD.js +0 -25
  290. package/dist/stale-NXPT56JA.js +0 -14
  291. package/dist/storage-IR6EEAV2.js +0 -23
  292. package/dist/verify-66RHOW7N.js.map +0 -1
  293. package/dist/withdraw-accessible-CLMZEHQT.js +0 -28
  294. /package/dist/{api-YGMINAET.js.map → api-ZGS6LCOF.js.map} +0 -0
  295. /package/dist/{chunk-OFJ5GPNA.js.map → chunk-3B5VVCNY.js.map} +0 -0
  296. /package/dist/{chunk-KPGX66PM.js.map → chunk-3LQ2YKO4.js.map} +0 -0
  297. /package/dist/{chunk-D26JB3LZ.js.map → chunk-3QCRBHCY.js.map} +0 -0
  298. /package/dist/{chunk-4N5QFSNQ.js.map → chunk-4JBYV75E.js.map} +0 -0
  299. /package/dist/{chunk-UTLEAJXC.js.map → chunk-4NXKCLLQ.js.map} +0 -0
  300. /package/dist/{chunk-ARSAMO24.js.map → chunk-4VNQOLML.js.map} +0 -0
  301. /package/dist/{chunk-X6CMGUAG.js.map → chunk-5M5DVGV7.js.map} +0 -0
  302. /package/dist/{chunk-XHV25KBM.js.map → chunk-5YOLBEQ6.js.map} +0 -0
  303. /package/dist/{chunk-CB25ONKC.js.map → chunk-6CRIV7DE.js.map} +0 -0
  304. /package/dist/{chunk-BE7N3AXA.js.map → chunk-6JTIAGHD.js.map} +0 -0
  305. /package/dist/{chunk-JOQ53DMI.js.map → chunk-6QTNZJBS.js.map} +0 -0
  306. /package/dist/{chunk-BZO4WCJI.js.map → chunk-6T2SCQRU.js.map} +0 -0
  307. /package/dist/{chunk-FQQF23MC.js.map → chunk-7DSTRQIJ.js.map} +0 -0
  308. /package/dist/{chunk-IP2QBAGS.js.map → chunk-AUSTCW2X.js.map} +0 -0
  309. /package/dist/{chunk-A2Y6YFVN.js.map → chunk-B3HJYUOF.js.map} +0 -0
  310. /package/dist/{chunk-SRVQHVNX.js.map → chunk-BDVFPG6Y.js.map} +0 -0
  311. /package/dist/{chunk-YXOUQ2H7.js.map → chunk-CAF6WOK7.js.map} +0 -0
  312. /package/dist/{chunk-HUS3J5WM.js.map → chunk-CIE2BASH.js.map} +0 -0
  313. /package/dist/{chunk-DIRRS7WP.js.map → chunk-CRI4OUV4.js.map} +0 -0
  314. /package/dist/{chunk-FXK4X4BL.js.map → chunk-DLG74CNB.js.map} +0 -0
  315. /package/dist/{chunk-WTUNZACT.js.map → chunk-E5ZQT5KX.js.map} +0 -0
  316. /package/dist/{chunk-DMFNPHCX.js.map → chunk-EQO2UVP4.js.map} +0 -0
  317. /package/dist/{chunk-MCEKIAO4.js.map → chunk-ERJ7FU55.js.map} +0 -0
  318. /package/dist/{chunk-6QILBDZU.js.map → chunk-EVVGJDRQ.js.map} +0 -0
  319. /package/dist/{chunk-7VSGW5KJ.js.map → chunk-EVX47VBM.js.map} +0 -0
  320. /package/dist/{chunk-D3EFFFOL.js.map → chunk-EXK7QRWF.js.map} +0 -0
  321. /package/dist/{chunk-5JB73NMC.js.map → chunk-EYZ6IQ6X.js.map} +0 -0
  322. /package/dist/{chunk-BCYQA5BK.js.map → chunk-F64IRYG3.js.map} +0 -0
  323. /package/dist/{chunk-K62IUKOD.js.map → chunk-FHS2HQSH.js.map} +0 -0
  324. /package/dist/{chunk-67TNU77I.js.map → chunk-FUG4SFN3.js.map} +0 -0
  325. /package/dist/{chunk-ZP5PL65C.js.map → chunk-GKEWXIV5.js.map} +0 -0
  326. /package/dist/{chunk-RKRGDAS7.js.map → chunk-GTGPO5KW.js.map} +0 -0
  327. /package/dist/{chunk-MSPNM2OM.js.map → chunk-HB3RFQSC.js.map} +0 -0
  328. /package/dist/{chunk-OOLO4LQG.js.map → chunk-I6GALP6E.js.map} +0 -0
  329. /package/dist/{chunk-57V5S7PW.js.map → chunk-IL6POWCW.js.map} +0 -0
  330. /package/dist/{chunk-7NS43EXZ.js.map → chunk-IU6SNYX6.js.map} +0 -0
  331. /package/dist/{chunk-5ZOSG3RJ.js.map → chunk-J2ZX2XUV.js.map} +0 -0
  332. /package/dist/{chunk-SYMS4546.js.map → chunk-JKJOGPZN.js.map} +0 -0
  333. /package/dist/{chunk-AWB5JZW6.js.map → chunk-JZUV47FZ.js.map} +0 -0
  334. /package/dist/{chunk-ODJWBC5I.js.map → chunk-K5IMOGHB.js.map} +0 -0
  335. /package/dist/{chunk-3G4KMVUN.js.map → chunk-KSKBRKGJ.js.map} +0 -0
  336. /package/dist/{chunk-HFJIGWJC.js.map → chunk-LASZKVMO.js.map} +0 -0
  337. /package/dist/{chunk-IGJHJYM6.js.map → chunk-LXEXBTKL.js.map} +0 -0
  338. /package/dist/{chunk-PR5LC5YX.js.map → chunk-MV43JSJF.js.map} +0 -0
  339. /package/dist/{chunk-ELNBMFOS.js.map → chunk-NJ4EOKMB.js.map} +0 -0
  340. /package/dist/{chunk-PXWVF7MC.js.map → chunk-NR5LT5RY.js.map} +0 -0
  341. /package/dist/{chunk-QYPKGVT4.js.map → chunk-NWSGI5C7.js.map} +0 -0
  342. /package/dist/{chunk-25NDNMQ7.js.map → chunk-Q5VNKNE5.js.map} +0 -0
  343. /package/dist/{chunk-CIKY6I4W.js.map → chunk-QLWMEXCT.js.map} +0 -0
  344. /package/dist/{chunk-VA4ZWLFY.js.map → chunk-QRB7NAOJ.js.map} +0 -0
  345. /package/dist/{chunk-3MSQLQNZ.js.map → chunk-R4ROFEYC.js.map} +0 -0
  346. /package/dist/{chunk-BEIRE5K4.js.map → chunk-RCVJZMFE.js.map} +0 -0
  347. /package/dist/{chunk-VR24ILCR.js.map → chunk-RIX4V2TB.js.map} +0 -0
  348. /package/dist/{chunk-Q3XSMOZM.js.map → chunk-RYCTDFUX.js.map} +0 -0
  349. /package/dist/{chunk-7E67FJ33.js.map → chunk-RZ5SVOYR.js.map} +0 -0
  350. /package/dist/{chunk-IDIV5NVH.js.map → chunk-SLFHQTTW.js.map} +0 -0
  351. /package/dist/{chunk-C3YH34IL.js.map → chunk-T2FFWNPK.js.map} +0 -0
  352. /package/dist/{chunk-O2DYPAZY.js.map → chunk-UNFPPVNI.js.map} +0 -0
  353. /package/dist/{chunk-GA2QHD6P.js.map → chunk-VLFCJYTL.js.map} +0 -0
  354. /package/dist/{chunk-YSXEFGND.js.map → chunk-VN3DBQAU.js.map} +0 -0
  355. /package/dist/{chunk-C7NTK5I3.js.map → chunk-VZRODIM3.js.map} +0 -0
  356. /package/dist/{chunk-QLLKLFE2.js.map → chunk-W22IKJE2.js.map} +0 -0
  357. /package/dist/{chunk-5XIPOCQC.js.map → chunk-X3YYQWOQ.js.map} +0 -0
  358. /package/dist/{chunk-XFXUTFWQ.js.map → chunk-YFXZEAYK.js.map} +0 -0
  359. /package/dist/{chunk-7ITPJFGC.js.map → chunk-ZAJAVEXY.js.map} +0 -0
  360. /package/dist/{chunk-4R4Q64W5.js.map → chunk-ZICD77GM.js.map} +0 -0
  361. /package/dist/{chunk-45ZZLTFH.js.map → chunk-ZJ2AK4V7.js.map} +0 -0
  362. /package/dist/{chunk-UFILRICG.js.map → chunk-ZUODRVHY.js.map} +0 -0
  363. /package/dist/{collection-facade-YE2O4J4O.js.map → collection-facade-TLWIPI76.js.map} +0 -0
  364. /package/dist/{computed-W6MVAMWZ.js.map → computed-ZIQTYTDI.js.map} +0 -0
  365. /package/dist/{dead-filter-4KXZEB3X.js.map → dead-filter-ESOBZZP5.js.map} +0 -0
  366. /package/dist/{delegation-OPUU3R2E.js.map → delegation-W7ZV2322.js.map} +0 -0
  367. /package/dist/{derive-BGUHU663.js.map → derive-H2BJTLUI.js.map} +0 -0
  368. /package/dist/{enclave-VXAQD4XJ.js.map → enclave-AP3I5W7O.js.map} +0 -0
  369. /package/dist/{executor-GTVSUUBX.js.map → executor-KGWTNEQD.js.map} +0 -0
  370. /package/dist/{executor-GZWMTOXB.js.map → executor-OVEXR6RT.js.map} +0 -0
  371. /package/dist/{executor-XXGS4S3K.js.map → executor-UNEH5ZYH.js.map} +0 -0
  372. /package/dist/{export-accessible-BMULIOYB.js.map → export-accessible-PCMXSUZS.js.map} +0 -0
  373. /package/dist/{extract-partition-JUQTWDXR.js.map → extract-partition-SWHFSYJO.js.map} +0 -0
  374. /package/dist/{fanout-sidecar-CKYFH33E.js.map → fanout-sidecar-A765THMX.js.map} +0 -0
  375. /package/dist/{find-XRGCNGNN.js.map → find-N6345CNT.js.map} +0 -0
  376. /package/dist/{issue-UB6AA5M6.js.map → issue-5OKB6I2R.js.map} +0 -0
  377. /package/dist/{ledger-FU6GH5EH.js.map → ledger-GFBKVPV4.js.map} +0 -0
  378. /package/dist/{liberate-YUN7W5QG.js.map → liberate-3VDOT4KO.js.map} +0 -0
  379. /package/dist/{link-set-MNADSH5M.js.map → link-set-Z7Q2ASFX.js.map} +0 -0
  380. /package/dist/{noydb-6JLBZU4U.js.map → noydb-ZCJOYBDI.js.map} +0 -0
  381. /package/dist/{policy-JTFOPPUU.js.map → policy-Z3RUAIY2.js.map} +0 -0
  382. /package/dist/{public-envelope-NJVB7LPA.js.map → public-envelope-B4KNWVUA.js.map} +0 -0
  383. /package/dist/{register-VCKOBWKT.js.map → register-VAHONCID.js.map} +0 -0
  384. /package/dist/{registry-72UKJ2L4.js.map → registry-7MLVD3VO.js.map} +0 -0
  385. /package/dist/{registry-BZFLJNEH.js.map → registry-EPKPD5SM.js.map} +0 -0
  386. /package/dist/{registry-YJEYSYI5.js.map → registry-P5T7PS2U.js.map} +0 -0
  387. /package/dist/{request-withdrawal-6MJRMFHF.js.map → request-withdrawal-TI3A5WPS.js.map} +0 -0
  388. /package/dist/{revoke-4KUNSVJC.js.map → revoke-FDRD6GRW.js.map} +0 -0
  389. /package/dist/{seed-4RRXT42N.js.map → seed-Q6M2IZFL.js.map} +0 -0
  390. /package/dist/{signer-DDDXP5JD.js.map → signer-MUWEIUI6.js.map} +0 -0
  391. /package/dist/{stale-NXPT56JA.js.map → stale-OSQ7J3AA.js.map} +0 -0
  392. /package/dist/{storage-IR6EEAV2.js.map → storage-MVFCGEQE.js.map} +0 -0
  393. /package/dist/{store-coordination-provider-HPYVFJCV.js.map → store-coordination-provider-64OEZFGS.js.map} +0 -0
  394. /package/dist/{walk-2RWEOCAS.js.map → walk-SVNDIZ62.js.map} +0 -0
  395. /package/dist/{withdraw-accessible-CLMZEHQT.js.map → withdraw-accessible-WZIEVWSR.js.map} +0 -0
@@ -26,6 +26,7 @@ export { TiersNotEnabledError } from '../../kernel/errors.js';
26
26
  import { 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
+ import type { BlobFieldsConfig } from '../../with-shape/blobs/blob-compaction.js';
29
30
  import { type NoydbStore, type EncryptedEnvelope, type GhostRecord, type TierMode, type CrossTierAccessEvent } from '../../kernel/types.js';
30
31
  /** Everything the moving tier methods touched on `this.*`, as a flat context. */
31
32
  export interface TiersContext<T> {
@@ -46,6 +47,168 @@ export interface TiersContext<T> {
46
47
  * owns. `null` → no caching.
47
48
  */
48
49
  readonly cekCache: Lru<string, EnclaveKey> | null;
50
+ /**
51
+ * Sync the collection's decoded-record cache after a tier move rewraps the
52
+ * envelope (#691). The lazy LRU is evicted on EVERY call — it is never
53
+ * re-seeded, since a lazy `#getRaw` miss refetches and decodes the fresh
54
+ * envelope via its adapter fallback (a stale LRU entry after a tier-0
55
+ * `putAtTier` overwrite was the #702 lazy-mode gap). `null` → also evict
56
+ * the eager cache entry; an `entry` → set the eager cache to the given
57
+ * decoded record/version (used by `demote()` landing back at tier 0 and
58
+ * `putAtTier`'s tier-0 write, #702 — the record is tier-0, so it must stay
59
+ * plain-`get()`-readable in-session).
60
+ */
61
+ syncCache(id: string, entry: {
62
+ record: T;
63
+ version: number;
64
+ } | null): void;
65
+ /**
66
+ * Sync the collection's indexes after a tier move rewraps the envelope
67
+ * (#709). Persisted `_idx/<field>/<recordId>` side-cars hold the indexed
68
+ * field's PLAINTEXT value and are always encrypted under the tier-0 DEK,
69
+ * whatever the record's own tier — the same leak class `forget()` fixed
70
+ * via `purgePersistedIndexes` ("forget() crypto-shreds the body but keeps
71
+ * the collection DEK, under which these side-cars are encrypted — so
72
+ * without this they leave the indexed field VALUES readable"). `null` →
73
+ * the record just left tier 0: purge its persisted side-cars and drop its
74
+ * in-memory index entries. A record → it is tier-0 again: (re)build its
75
+ * entries from that record. Call this BEFORE {@link syncCache} — the
76
+ * implementation reads the pre-write cached value as "previous" to clean
77
+ * up stale index buckets, so it must run while that entry is still live.
78
+ * `version` stamps a rebuilt side-car's own envelope version — every
79
+ * caller has one in scope (the envelope it just wrote), including the
80
+ * purge (`null`) branches, which pass it along even though it's ignored
81
+ * there (#720: keeps the parameter honestly required, no dead default).
82
+ * `priorEnvelope` (#720) — the RAW envelope read BEFORE this call's own
83
+ * overwrite (already in scope as `existing`/`envelope` at every record-
84
+ * branch call site), so a lazy same-tier value change (a `putAtTier(0)`
85
+ * dropping an indexed field, a `demote(0)` off an elevated record) can
86
+ * still be tier-gate-decoded as "previous" once the live envelope itself
87
+ * has already moved past it. The `null`-record branches never pass one —
88
+ * see the implementation's doc comment for why they don't need to.
89
+ */
90
+ syncIndexes(id: string, record: T | null, version: number, priorEnvelope?: EncryptedEnvelope): Promise<void>;
91
+ /** Sync the collection's SEARCH artifacts after a tier move (#721). Both the
92
+ * lexical `_ftindex` blob and the `_vec/<id>` embedding are encrypted under
93
+ * the tier-0 DEK and hold the record's derived plaintext (full field text /
94
+ * a text-invertible vector), so leaving them means elevation never hid what
95
+ * the record was searchable by — the `forget()` precedent, unapplied to
96
+ * elevate. `null` → the record left tier 0: purge its `_vec`, and
97
+ * invalidate the `_ftindex` blob (the cache-driven rebuild then excludes
98
+ * it). A record → it is tier-0 again: re-embed it, and invalidate
99
+ * `_ftindex` (rebuild includes it). No-op fast when the collection has no
100
+ * search. */
101
+ syncSearch(id: string, record: T | null, version?: number): Promise<void>;
102
+ /**
103
+ * Sync a record's `_history` snapshots after a tier move rewraps the live
104
+ * envelope (#712, at-rest hardening). Each snapshot carries its own key
105
+ * material (a direct DEK wrap, or a per-record `_cek` itself wrapped under
106
+ * the tier DEK) — `elevate()`'s live-body rewrap moves only the live
107
+ * envelope, leaving prior versions decryptable at rest under the tier the
108
+ * record has moved away from (the same leak class `forget()`'s
109
+ * `tombstoneHistory` closed for erasure). `fromDek`/`toDek` are the SAME
110
+ * DEKs the caller already resolved for the live rewrap — reuse them, don't
111
+ * recompute. No-op when the strategy is `NO_HISTORY`.
112
+ */
113
+ syncHistory(id: string, fromDek: EnclaveKey, toDek: EnclaveKey): Promise<void>;
114
+ /**
115
+ * Save a raw pre-move envelope as a `_history` snapshot (#728). Tier moves
116
+ * (`putAtTier`/`elevate`/`demote`) bump `_v` and overwrite the live
117
+ * envelope without ever snapshotting the version that existed just before
118
+ * the move — so `history()` silently lost it. The caller (`tiers/index.ts`)
119
+ * builds `envelope` by reusing the SAME `rewrapBodyToDek(envelope, fromDek,
120
+ * toDek)` result it already computed for the live write, so the snapshot
121
+ * lands wrapped under the DESTINATION tier's DEK — never `ctx.codec.
122
+ * encryptRecord`, which always resolves the tier-0 DEK and would leak the
123
+ * pre-move body whenever `fromTier > 0`. No-op when history is disabled
124
+ * (folds the `historyConfig.enabled` gate so `tiers/index.ts` stays simple).
125
+ */
126
+ saveHistorySnapshot(id: string, envelope: EncryptedEnvelope): Promise<void>;
127
+ /**
128
+ * `true` iff a real history strategy is wired (not `NO_HISTORY`) AND not
129
+ * explicitly disabled via `historyConfig.enabled`. `putAtTier` checks this
130
+ * BEFORE decrypting `existing` to build a snapshot (#728, #737 regression
131
+ * fix) — unlike elevate/demote, which reuse a `body` rewrap their live
132
+ * write needs unconditionally, putAtTier's live write never decrypts the
133
+ * prior envelope, so building a snapshot is the ONLY reason it would
134
+ * touch (and potentially throw decrypting) `existing`'s ciphertext. A
135
+ * derivation-free, history-disabled collection must not pay that decode —
136
+ * or risk it, on a corrupted/inaccessible prior body — same law
137
+ * `hasDerivedOutputs` already enforces for the derived-outputs decode.
138
+ */
139
+ readonly historyEnabled: boolean;
140
+ /**
141
+ * Rehome a record's blob attachments after a tier move (#724 Arc 10 Task
142
+ * 2, at-rest hardening). A blob's home tier is its owning record's tier —
143
+ * the `_blob` DEK is tier-scoped (`dekKey('_blob', tier)`), so a solo-
144
+ * owned blob's content CEK must move with the record or it stays
145
+ * tier-0-unwrappable at rest even once the live body has moved (the same
146
+ * leak class `syncHistory` closes for `_history` snapshots). Delegates to
147
+ * `BlobSet.rehomeForTier`; no-op fast when the collection has no blob
148
+ * fields. Order-independent with the other sync hooks — touches only
149
+ * blob side structures, not this collection's own cache/indexes.
150
+ */
151
+ syncBlobs(id: string, fromTier: number, toTier: number): Promise<void>;
152
+ /**
153
+ * Purge a record's tier-0-era plaintext ledger deltas after a tier move
154
+ * lands it above tier 0 (#729). The audit ledger is a flat, vault-wide,
155
+ * hash-chained log — a record's reverse-JSON-Patch deltas in
156
+ * `_ledger_deltas` are encrypted under one collection-wide `_ledger` DEK
157
+ * (not the record's own tier DEK), so `elevate()`/`putAtTier()`'s live-body
158
+ * rewrap never moves them: they stay readable at rest to any tier-0
159
+ * caller, the same leak class `syncHistory` closed for `_history`
160
+ * snapshots. Chain-safe: `verify()` reads only `_ledger` entry fields
161
+ * (including `deltaHash`, which lives on the entry, not the deleted delta
162
+ * row), never `_ledger_deltas`, so a purge cannot break it.
163
+ * **Irreversible** — the deleted plaintext cannot be restored by
164
+ * `demote()`. **Metadata-retained** — the `_ledger` entries (that the
165
+ * record was mutated, at which version/timestamp/actor) are untouched;
166
+ * only the delta *content* is purged. No-op when the collection has no
167
+ * ledger (`withHistory()` not enabled).
168
+ */
169
+ syncLedger(id: string): Promise<void>;
170
+ /**
171
+ * Sync a record's derived outputs (materialized-view rows, rollup
172
+ * contributions, `withDerivation` outputs) after a tier move (#722).
173
+ * Those outputs are computed from this record and written to OTHER
174
+ * (output) collections via a plain `put` at tier 0 — `elevate()`'s live-
175
+ * body rewrap moves only the source envelope, so the output rows keep
176
+ * holding the source's tier-0-era plaintext, the same leak class
177
+ * `syncSearch`/`syncIndexes` closed for THIS collection's own artifacts.
178
+ * `elevated` (landing tier > 0) reuses the SAME onDelete fanout
179
+ * `forgetDerivedFanout` drives for `forget()` (`kernel/via/dispatch.ts`)
180
+ * — minus its `'ref'` cascade edge (elevate/demote never erase a
181
+ * *different* record) — to recompute this record's derived outputs as
182
+ * REMOVED. Recompute is tier-safe: the fanout's own source scan reads
183
+ * the elevated-excluding cache (#701/#709/#712), so it naturally omits
184
+ * the now-elevated record instead of re-embedding its plaintext. Landing
185
+ * back at tier 0 (`elevated === false`) is the reverse (Task 2, #722):
186
+ * `syncDerivedOutputs` instead runs the ordinary local-write add-
187
+ * dispatchers (`dispatchDerivations`/`dispatchMaterializedViews`, the
188
+ * same ones a plain `put()` fires) to restore the contribution —
189
+ * reversible, since the source's plaintext survives the elevate/demote
190
+ * rewrap round-trip. `record` is the decoded source record (PRE-move on
191
+ * the remove side, POST-move on the add side); only the rollup edge
192
+ * consumes it on remove, both add-dispatchers require it on add; `null`
193
+ * (tombstone/delete-marker) skips both. `version` stamps the add-
194
+ * dispatchers' `_derivedFrom.sourceVersion` metadata — reuses the version
195
+ * the tier op already has, no re-read; unused on the remove side. No-op
196
+ * fast when the collection has no MV/derivation source — each dispatcher
197
+ * below checks its own source before doing any work.
198
+ */
199
+ syncDerived(id: string, record: T | null, elevated: boolean, version?: number): Promise<void>;
200
+ /**
201
+ * `true` iff the collection has a materialized-view or derivation source
202
+ * attached. Gates the {@link syncDerived} pre-move decode on the remove
203
+ * direction (`elevate()`, `putAtTier(tier>0)`, `demote()`'s intermediate-
204
+ * tier branch): those sites decode the record SOLELY to feed
205
+ * `syncDerived(..., true)`, whose dispatchers no-op immediately when the
206
+ * collection has no MV/derivation source — so a no-derivation collection
207
+ * would otherwise pay a full record-body decrypt on every tier move for
208
+ * nothing (#722 perf regression). `false` short-circuits the decode to
209
+ * `null`, which `syncDerivedOutputs` already treats safely.
210
+ */
211
+ readonly hasDerivedOutputs: boolean;
49
212
  /** Emit `_source`/`_sourceTs` provenance fields when a source is supplied. */
50
213
  readonly provenance: boolean;
51
214
  /** Declared tiers, or null when the feature is off. */
@@ -56,9 +219,108 @@ export interface TiersContext<T> {
56
219
  getDEK(key: string): Promise<EnclaveKey>;
57
220
  /** Fire a cross-tier access event (sink stays collection-resident). */
58
221
  emitCrossTierEvent(event: CrossTierAccessEvent): void;
222
+ /**
223
+ * Register this record's ref in the encrypted `_subject_index` (#766).
224
+ * `putAtTier`'s raw `ctx.adapter.put` bypasses `Collection.put()`'s write-
225
+ * hook pipeline — the `onAfterWrite` hook that normally does this — so a
226
+ * record whose FIRST persistence is `putAtTier` (sensitive from birth, a
227
+ * documented legitimate use) would otherwise never enter the index and
228
+ * stay unreachable by `vault.forget()`. Idempotent (safe on every call,
229
+ * including a repeat write of an already-registered record) and a no-op
230
+ * when the collection declares no forget-subject field.
231
+ */
232
+ addSubjectRef(id: string, record: T): Promise<void>;
59
233
  }
60
234
  export declare function assertTiersEnabled<T>(ctx: TiersContext<T>): void;
61
235
  export declare function assertDeclaredTier<T>(ctx: TiersContext<T>, tier: number): void;
236
+ /**
237
+ * Tier-composition guard (#724 / Arc 7 of the tier-invisibility campaign).
238
+ *
239
+ * Refuses `tiers` declared together with a derived-artifact feature whose
240
+ * crypto has not yet been made tier-aware — i.e. a feature `elevate()` /
241
+ * `demote()` does not re-key when a record moves tiers, so an elevated
242
+ * record's data for that feature would stay readable at tier 0.
243
+ *
244
+ * **Status:** the original call site (`Collection` constructor, beside
245
+ * `buildUniqueConstraintSet`) was removed by Arc 10 Task 1 (#724) — the
246
+ * `tiers + blobFields` refusal below was superseded by a runtime read gate
247
+ * on `collection.blob(id)` (`with-shape/blobs/blob-set.ts`), so this
248
+ * function currently has no caller. Relocated here from
249
+ * `with-lookup/indexing/unique-constraints.ts` (#733) so the tier-domain
250
+ * guard lives in the tier domain, rather than an indexing file it only
251
+ * borrowed for a grandfathered import specifier.
252
+ *
253
+ * ## #724 verified: `tiers + blobFields` leaks
254
+ *
255
+ * `collection.blob(id)` (`Collection.blob()`) never checks the live
256
+ * record's tier before returning a `BlobSet` handle, and `BlobSet`'s crypto
257
+ * is entirely orthogonal to the tier ladder:
258
+ * - the slot map (`_blob_slots_{collection}/{id}`) is encrypted under the
259
+ * collection's TIER-0 DEK (`getDEK(name)` ≡ `dekKey(name, 0)` — see
260
+ * `dekKey` in `with-party/team/tiers.ts`), never a tier-N DEK;
261
+ * - chunk content (`_blob_index` / `_blob_chunks`) is encrypted under the
262
+ * vault-shared `_blob` DEK (`BLOB_COLLECTION`), which has no tier
263
+ * dimension at all.
264
+ * `elevate()`/`demote()` (this file) rewrap only the live record body,
265
+ * `_history` snapshots (#712), and index side-cars — blob slots and chunks
266
+ * are untouched. A caller whose keyring never held the record's elevated
267
+ * tier DEK can still open `collection.blob(id).get(slot)` and read full
268
+ * plaintext, even though `collection.get(id)` correctly reports the same
269
+ * record as invisible. See `__tests__/tier-composition-guard.test.ts` for
270
+ * the reproduction.
271
+ *
272
+ * ## Safe today — no check needed here
273
+ *
274
+ * Field indexes, search (`textIndexes`/`embeddings`), `withHistory`
275
+ * (snapshot keys are rewrapped by `elevate()`/`demote()`, #712), and the
276
+ * decoded-record cache (evicted on tier moves) are already tier-safe. They
277
+ * are not enumerated below; only known-unsafe features are refused, so any
278
+ * combination not named here passes silently by default.
279
+ *
280
+ * ## Deliberately NOT handled here
281
+ *
282
+ * - `ledger` — `withHistory` threads a ledger writer onto every tiered
283
+ * collection by default in shipped usage; refusing `tiers + ledger` would
284
+ * break that default. A ledger-specific tier-rekey handler (rewrap ledger
285
+ * entries, or scope ledger visibility to tier) is a separate arc.
286
+ * - materialized-view (MV) output — an MV's fanout spec lives on the
287
+ * SOURCE collection, not on the MV collection's own config, so it is not
288
+ * visible at `vault.collection()` registration time and this guard cannot
289
+ * detect it structurally.
290
+ */
291
+ export declare function assertTierComposition(collectionName: string, cfg: {
292
+ readonly tiers: boolean;
293
+ readonly blobFields: BlobFieldsConfig | undefined;
294
+ }): void;
295
+ /**
296
+ * Structural surface {@link syncDerivedOutputs} needs from the owning
297
+ * collection — the SAME onDelete dispatchers `forgetDerivedFanout` already
298
+ * drives (`kernel/via/dispatch.ts`), reused as-is (#722). Narrower than
299
+ * `Collection<T>` (avoids an import cycle: collection.ts constructs
300
+ * `TiersContext` FROM `this`, which already satisfies this shape
301
+ * structurally — no cast needed at the `tiersContext()` call site).
302
+ */
303
+ export interface DerivedOutputsHost<T> {
304
+ dispatchMaterializedViewsOnDelete(id: string): Promise<{
305
+ deleted: number;
306
+ residueUndecodable: string[];
307
+ residueDeclined: string[];
308
+ }>;
309
+ dispatchArrayDerivationsOnDelete(id: string, eraseRecordShapeToo?: boolean): Promise<number>;
310
+ dispatchRollupsOnDelete(id: string, deleted: T): Promise<unknown>;
311
+ /** Task 2 (#722) add-direction: the same local-write dispatchers an ordinary `put()` fires. */
312
+ dispatchMaterializedViews(id: string, record: T): Promise<void>;
313
+ dispatchDerivations(id: string, record: T, version: number): Promise<void>;
314
+ }
315
+ /**
316
+ * The {@link TiersContext.syncDerived} implementation collection.ts's
317
+ * `tiersContext()` binds `this` into (#722). See that field's doc comment
318
+ * for the design; `host` is `this` — every dispatcher below is a public
319
+ * Collection method, already self-guarding (no-op) when the collection has
320
+ * no materialized-view/derivation source, so no separate fast-path check is
321
+ * needed here.
322
+ */
323
+ export declare function syncDerivedOutputs<T>(host: DerivedOutputsHost<T>, id: string, record: T | null, elevated: boolean, version?: number): Promise<void>;
62
324
  /**
63
325
  * tier-aware put. Encrypts the record with the collection's tier-N DEK and
64
326
  * stamps `_tier: N` on the envelope. The caller's keyring must hold the tier-N
@@ -78,7 +340,7 @@ export declare function putAtTier<T>(ctx: TiersContext<T>, id: string, record: T
78
340
  };
79
341
  source?: string;
80
342
  sourceTs?: string;
81
- }): Promise<void>;
343
+ }): Promise<TierMoveResult>;
82
344
  /**
83
345
  * tier-aware get. When the stored record is at a tier the caller cannot
84
346
  * decrypt:
@@ -100,18 +362,28 @@ export declare function listAtTier<T>(ctx: TiersContext<T>): Promise<Array<{
100
362
  tier: number;
101
363
  readable: boolean;
102
364
  }>>;
365
+ /**
366
+ * Result of a completed `elevate()`/`demote()` (#764). The record move
367
+ * (put + indexes/cache/ledger/derived/history/blobs sync) always completes —
368
+ * `searchResidue: true` means only the search-index side (`_vec`/`_ftindex`)
369
+ * was left in a needs-retry state (a stuck `PersistedIndexCompensationError`),
370
+ * mirroring `forget()`'s `indexResidue` posture rather than aborting the move.
371
+ */
372
+ export interface TierMoveResult {
373
+ readonly searchResidue: boolean;
374
+ }
103
375
  /**
104
376
  * elevate a record to a higher tier. Re-encrypts with the target tier's DEK.
105
377
  * The caller must hold DEKs for both the current tier (to decrypt) and the
106
378
  * target tier (to re-encrypt). Stamps `_elevatedBy` with the caller id so
107
379
  * `demote()` can check the reverse operation.
108
380
  */
109
- export declare function elevate<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<void>;
381
+ export declare function elevate<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<TierMoveResult>;
110
382
  /**
111
383
  * demote a record to a lower tier. Allowed only for the user who performed the
112
384
  * last elevation or an owner.
113
385
  */
114
- export declare function demote<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<void>;
386
+ export declare function demote<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<TierMoveResult>;
115
387
  /**
116
388
  * Classify a live envelope's `_sealed` slots for crypto-shred completeness
117
389
  * (#M-1). Thin delegate to {@link RecordCodec.classifySealedShred}; surfaced
@@ -8,7 +8,8 @@
8
8
  * @internal
9
9
  */
10
10
  import type { GhostRecord } from '../../kernel/types.js';
11
- import type { TiersContext } from './index.js';
11
+ import type { TiersContext, TierMoveResult } from './index.js';
12
+ export type { TierMoveResult };
12
13
  export interface TiersStrategy {
13
14
  putAtTier<T>(ctx: TiersContext<T>, id: string, record: T, tier: number, opts?: {
14
15
  elevation?: {
@@ -17,15 +18,15 @@ export interface TiersStrategy {
17
18
  };
18
19
  source?: string;
19
20
  sourceTs?: string;
20
- }): Promise<void>;
21
+ }): Promise<TierMoveResult>;
21
22
  getAtTier<T>(ctx: TiersContext<T>, id: string): Promise<T | GhostRecord | null>;
22
23
  listAtTier<T>(ctx: TiersContext<T>): Promise<Array<{
23
24
  id: string;
24
25
  tier: number;
25
26
  readable: boolean;
26
27
  }>>;
27
- elevate<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<void>;
28
- demote<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<void>;
28
+ elevate<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<TierMoveResult>;
29
+ demote<T>(ctx: TiersContext<T>, id: string, toTier: number): Promise<TierMoveResult>;
29
30
  }
30
31
  /**
31
32
  * No-op stub — the floor default. Every capability method throws
@@ -7,7 +7,7 @@
7
7
  * @module
8
8
  */
9
9
  import type { Vault } from '../kernel/vault.js';
10
- import { type WalkClosureOptions } from './walk-closure.js';
10
+ import { type WalkClosureOptions, type DanglingRefNotice } from './walk-closure.js';
11
11
  export interface ExtractionPreview {
12
12
  readonly totalRecords: number;
13
13
  /** Sum of serialized encrypted-envelope sizes (bytes). */
@@ -29,5 +29,13 @@ export interface ExtractionPreview {
29
29
  readonly collection: string;
30
30
  readonly id: string;
31
31
  }>;
32
+ /**
33
+ * #772: outbound FK edges whose referenced parent was excluded from the
34
+ * closure (missing, or tier-elevated and therefore invisible) — mirrors
35
+ * `ExtractPartitionResult.danglingRefs` (#759) so a preview/extract pair
36
+ * gives the SAME signal. A parent excluded this way never appears in
37
+ * `byCollection` at all; this is the only preview-time indicator.
38
+ */
39
+ readonly danglingRefs: ReadonlyArray<DanglingRefNotice>;
32
40
  }
33
41
  export declare function describeExtraction(vault: Vault, opts: WalkClosureOptions): Promise<ExtractionPreview>;
@@ -9,7 +9,7 @@
9
9
  import type { Vault } from '../kernel/vault.js';
10
10
  import type { EncryptedEnvelope } from '../kernel/types.js';
11
11
  import { type EnclaveKey } from '../kernel/enclave/index.js';
12
- import { type WalkClosureOptions } from './walk-closure.js';
12
+ import { type WalkClosureOptions, type DanglingRefNotice } from './walk-closure.js';
13
13
  import { type TransferSealPayload } from '../with-pod/bundle.js';
14
14
  /** Re-keyed collections snapshot + the fresh DEKs used. */
15
15
  export interface ReKeyResult {
@@ -113,6 +113,14 @@ export interface ExtractPartitionResult {
113
113
  /** Raw 32-byte transfer key — deliver out-of-band; required to adopt. */
114
114
  readonly transferKey: Uint8Array;
115
115
  readonly sealId: string;
116
+ /**
117
+ * #759: outbound FK edges whose referenced parent was excluded from the
118
+ * partition (missing, or tier-elevated and therefore invisible). The
119
+ * child record still carries its FK value; the parent did not travel —
120
+ * callers should surface this to the operator rather than assume
121
+ * referential completeness.
122
+ */
123
+ readonly danglingRefs: ReadonlyArray<DanglingRefNotice>;
116
124
  }
117
125
  /**
118
126
  * Extract a re-keyed, transfer-sealed partition. Owner-only
@@ -8,9 +8,10 @@
8
8
  * 1. INBOUND expansion: from selected records, pull every record
9
9
  * that references them (children travel with parents), to a
10
10
  * fixed point.
11
- * 2. OUTBOUND completion: pull every parent the selected set
12
- * references (no dangling FKs), transitively, WITHOUT
13
- * re-expanding inbound from those parents (bounds the closure).
11
+ * 2. OUTBOUND completion: pull every VISIBLE parent the selected set
12
+ * references, transitively, WITHOUT re-expanding inbound from those
13
+ * parents (bounds the closure). A tier-elevated (or missing) parent is
14
+ * excluded rather than admitted — see `danglingRefs` on the result.
14
15
  *
15
16
  * The FK graph is auto-derived from the vault's existing RefRegistry
16
17
  * (the `ref('target')` declarations on collections) — no hand-written
@@ -25,6 +26,32 @@ export interface WalkClosureOptions {
25
26
  /** Max fixed-point iterations before throwing. Default 16. */
26
27
  readonly maxDepth?: number;
27
28
  }
29
+ /**
30
+ * #759: an outbound FK edge whose referenced parent was excluded from the
31
+ * closure — either because it doesn't exist, or because it is tier-elevated
32
+ * and therefore invisible (same "elevated ≡ missing" semantics as root
33
+ * selection / inbound expansion). The child keeps its FK value; the parent
34
+ * does not travel. Callers (extract-partition) surface this as a residue
35
+ * notice rather than silently dropping it.
36
+ */
37
+ export interface DanglingRefNotice {
38
+ /** Collection of the child record that holds the dangling FK. */
39
+ readonly collection: string;
40
+ /** Id of the child record. */
41
+ readonly id: string;
42
+ /** FK field on the child that references the missing/elevated parent. */
43
+ readonly field: string;
44
+ /** Target collection the FK points at. */
45
+ readonly target: string;
46
+ /** Id of the missing/elevated parent. */
47
+ readonly targetId: string;
48
+ /**
49
+ * #772: distinguishes an intentional tier boundary (`'elevated'` — the
50
+ * parent exists but is above the caller's readable tier) from a genuine
51
+ * data-integrity gap (`'missing'` — no envelope for `targetId` at all).
52
+ */
53
+ readonly reason: 'missing' | 'elevated';
54
+ }
28
55
  export interface ClosureResult {
29
56
  /** collection → set of record ids that travel together. */
30
57
  readonly closure: Map<string, Set<string>>;
@@ -34,5 +61,7 @@ export interface ClosureResult {
34
61
  /** True if an edge pointed back to an already-selected node. */
35
62
  readonly cyclesDetected: boolean;
36
63
  };
64
+ /** #759: outbound FK edges whose parent was excluded (missing or elevated). */
65
+ readonly danglingRefs: ReadonlyArray<DanglingRefNotice>;
37
66
  }
38
67
  export declare function walkClosure(vault: Vault, opts: WalkClosureOptions): Promise<ClosureResult>;
@@ -1,4 +1,5 @@
1
1
  import type { NoydbStore, EncryptedEnvelope, HistoryOptions, PruneOptions } from '../../kernel/types.js';
2
+ import { type EnclaveKey } from '../../kernel/enclave/index.js';
2
3
  /** Save a history entry (a complete encrypted envelope snapshot). */
3
4
  export declare function saveHistory(adapter: NoydbStore, vault: string, collection: string, recordId: string, envelope: EncryptedEnvelope): Promise<void>;
4
5
  /** Get history entries for a record, sorted newest-first. */
@@ -25,3 +26,48 @@ export declare function clearHistory(adapter: NoydbStore, vault: string, collect
25
26
  * Returns the number of history versions newly tombstoned.
26
27
  */
27
28
  export declare function tombstoneHistory(adapter: NoydbStore, vault: string, collection: string, recordId: string, actor: string, encrypted: boolean): Promise<number>;
29
+ /**
30
+ * Re-key every `_history` snapshot of a record from `fromDek` to `toDek`.
31
+ * Mirrors what `rewrapBodyToDek` already does for a record's LIVE body on a
32
+ * tier move (elevate/demote/putAtTier) — each `_history` envelope also
33
+ * carries its own `_cek`, wrapped under the collection's tier-0 DEK at write
34
+ * time (`record-codec.ts`), so a tier move that rewraps only the live
35
+ * envelope leaves prior versions decryptable at rest under the tier the
36
+ * record left. This is defense-in-depth *beneath* the read-gate
37
+ * (`history()`/`getVersion()` already return empty for an elevated record;
38
+ * this protects the ciphertext even if that gate is bypassed).
39
+ *
40
+ * Rewraps content in place — unlike `tombstoneHistory`, it does NOT blank
41
+ * `_iv`/`_data`/`_cek` — so a subsequent `demote()` restores tier-0
42
+ * readability. Tombstone-shaped entries (a forgotten/shredded version —
43
+ * blanked `_data`, no `_cek`) are skipped: there is no key material left to
44
+ * rewrap.
45
+ *
46
+ * **Legacy fallback.** A snapshot written before this fix stays wrapped
47
+ * under the tier-0 DEK even after its live record has since moved tiers, so
48
+ * a rewrap attempted with a tier-N `fromDek` fails to unwrap/decrypt. When
49
+ * the caller supplies `tier0Dek`, a failed rewrap is retried once with
50
+ * `tier0Dek` as `fromDek` (the only other key a pre-fix snapshot can be
51
+ * wrapped under — history is written only by tier-0 `put()`). The output is
52
+ * always wrapped under `toDek` regardless of which `fromDek` succeeded. A
53
+ * rewrap that fails under BOTH keys re-throws — that is real corruption, not
54
+ * a tier mismatch, and must not be swallowed.
55
+ *
56
+ * **Crash-atomicity / idempotency (#712 whole-branch-fix-3).** This loop has
57
+ * no transaction around it: a crash after some entries have been rewritten
58
+ * under `toDek` but before the loop finishes leaves the record's history
59
+ * split across two keys. A retry of the SAME call must not re-fail on the
60
+ * entries that already made it — so each entry is probed with
61
+ * `isRewrappedUnder(env, toDek)` FIRST; a match means it's already at the
62
+ * target key and is skipped (put nothing). This makes same-target retries
63
+ * and demote-after-crash fully self-healing. It does NOT close every crash
64
+ * window: a crash that lands SOME entries under `toDek` while the record's
65
+ * NEXT move target differs from this call's `toDek` (an intermediate-tier
66
+ * crash — e.g. elevate 0→1 crashes mid-loop, then the record is moved 1→2)
67
+ * still finds those entries unreadable under either `fromDek` or the
68
+ * tier-0 fallback, since `toDek` is a third key the next call never probes
69
+ * for. That residual window is an accepted, fail-closed limitation (see
70
+ * `.changeset/history-at-rest.md` and the design doc) — availability is
71
+ * lost, never confidentiality.
72
+ */
73
+ export declare function rewrapHistory(adapter: NoydbStore, vault: string, collection: string, recordId: string, fromDek: EnclaveKey, toDek: EnclaveKey, tier0Dek?: EnclaveKey): Promise<void>;
@@ -216,6 +216,27 @@ export declare class LedgerStore {
216
216
  * backward" signal and falls back to the on-disk current value.
217
217
  */
218
218
  loadDelta(index: number): Promise<JsonPatch | null>;
219
+ /**
220
+ * Purge a record's tier-0-era plaintext deltas (#729). Deletes each
221
+ * `_ledger_deltas/<paddedIndex>` row whose entry matches
222
+ * `(collection, id)` and carries a delta, then returns the count
223
+ * deleted.
224
+ *
225
+ * Chain-safe by construction: `verify()` recomputes the tamper-chain
226
+ * from each `_ledger` entry's own canonical fields — including the
227
+ * stored `deltaHash` field, which lives on the entry, not on the
228
+ * `_ledger_deltas` row — and never re-reads `_ledger_deltas`.
229
+ * Deleting a delta row therefore cannot break `verify()`.
230
+ * `reconstruct()` already treats a missing delta (`loadDelta` →
231
+ * `null`) as a pruned stop, so a purge just makes the pre-purge
232
+ * plaintext unreachable rather than corrupting anything.
233
+ *
234
+ * No `_ledger` entry is touched and nothing is re-encrypted — this
235
+ * is irreversible (the deleted plaintext cannot be recovered) but
236
+ * leaves the entry metadata (that the record was mutated, at which
237
+ * version/timestamp/actor) fully intact for audit purposes.
238
+ */
239
+ purgeRecordDeltas(collection: string, id: string): Promise<number>;
219
240
  /** Encrypt a JSON Patch into an envelope for storage. Mirrors encryptEntry. */
220
241
  private encryptDelta;
221
242
  /**
@@ -85,6 +85,16 @@ export interface HistoryStrategy {
85
85
  * tombstoned, or `0` under `NO_HISTORY` (no history = nothing to shred).
86
86
  */
87
87
  tombstoneHistory(adapter: NoydbStore, vault: string, collection: string, recordId: string, actor: string, encrypted: boolean): Promise<number>;
88
+ /**
89
+ * Re-key every `_history` snapshot of a record from `fromDek` to `toDek`
90
+ * on a tier move (elevate/demote/putAtTier), mirroring the live-body
91
+ * rewrap so prior versions are not left decryptable at rest under a tier
92
+ * the record has moved away from. Optional `tier0Dek` enables the legacy
93
+ * fallback for snapshots written before this rewrap existed (see
94
+ * `history.ts` for the full contract). No-op under `NO_HISTORY` (no
95
+ * history = nothing to rewrap).
96
+ */
97
+ rewrapHistory(adapter: NoydbStore, vault: string, collection: string, recordId: string, fromDek: EnclaveKey, toDek: EnclaveKey, tier0Dek?: EnclaveKey): Promise<void>;
88
98
  /**
89
99
  * Compute the SHA-256 hash of an envelope's encrypted payload, used
90
100
  * by `LedgerStore.append` to track tamper-evidence. Returns the
@@ -119,6 +119,16 @@ export declare class CollectionInstant<T = unknown> {
119
119
  * Return the record as it existed at the target timestamp, or
120
120
  * `null` if the record had not been created yet or had already been
121
121
  * deleted by then.
122
+ *
123
+ * Gated on the LIVE record's current tier — #730, mirroring the #712
124
+ * read-gate `history()`/`getVersion()` already apply: an elevated record
125
+ * is invisible through the whole time-machine surface, not just a
126
+ * decrypt failure. See {@link resolveVisibleEnvelope}.
127
+ *
128
+ * Decrypts through {@link openEnvelopeJson}, the `_cek`-aware envelope
129
+ * body opener — a snapshot from a `perRecordKeys` collection is encrypted
130
+ * under its own per-record CEK (wrapped in `_cek`), not the collection
131
+ * DEK directly.
122
132
  */
123
133
  get(id: string): Promise<T | null>;
124
134
  /**
@@ -134,6 +144,19 @@ export declare class CollectionInstant<T = unknown> {
134
144
  put(_id: string, _record: T): Promise<never>;
135
145
  delete(_id: string): Promise<never>;
136
146
  update(_id: string, _patch: Partial<T>): Promise<never>;
147
+ /**
148
+ * {@link resolveEnvelope}, additionally gated on the record's LIVE
149
+ * (current, not historical) tier — #730. Mirrors the #712 read-gate
150
+ * `history()`/`getVersion()` apply: history snapshots keep their
151
+ * tier-0-wrapped CEKs and carry no `_tier` of their own, so an elevated
152
+ * record's prior versions would otherwise stay tier-0-decryptable here.
153
+ * `null` for a resolved envelope carrying its own `_tier > 0` (a
154
+ * tier-aware snapshot reached some other way) or whose LIVE record is
155
+ * currently elevated — both `get()` and `list()` route through this so
156
+ * the invisibility law holds on the whole time-machine read surface, not
157
+ * just a decrypt failure.
158
+ */
159
+ private resolveVisibleEnvelope;
137
160
  /**
138
161
  * Return the envelope that represents the record's state at
139
162
  * `targetTs`, accounting for deletes. `null` if the record didn't
@@ -1,4 +1,5 @@
1
1
  import type { Vault } from '../../kernel/vault.js';
2
+ import type { TierMoveResult } from '../../with-audit/tiers/index.js';
2
3
  /**
3
4
  * Reserved collection that holds the audit ledger of elevation
4
5
  * sessions. One envelope per `vault.elevate(...)` call.
@@ -44,7 +45,7 @@ export declare class ElevatedHandle {
44
45
  * unprivileged" trivially true.
45
46
  */
46
47
  collection<T>(name: string): {
47
- put(id: string, record: T): Promise<void>;
48
+ put(id: string, record: T): Promise<TierMoveResult>;
48
49
  };
49
50
  /**
50
51
  * Manually revert the elevation. Idempotent — calling twice (or
@@ -199,6 +199,11 @@ export declare function runTransaction<T>(db: Noydb, fn: (tx: TxContext) => Prom
199
199
  * state can still reconstruct it by walking the ledger through the
200
200
  * failed-tx timestamp.
201
201
  *
202
+ * Delegates the reverse/best-effort/raw-revert shape to the shared
203
+ * `bestEffortRevert` helper (`kernel/best-effort-revert.ts`); the cache
204
+ * invalidation below rides along as that helper's per-leg `compensate`
205
+ * callback, gated on `db` exactly as before.
206
+ *
202
207
  * @internal — shared between `runTransaction` and
203
208
  * `Collection.putManyAtomic`. Both register source ops + nested
204
209
  * derivation side-effect ops onto `_executed`; this helper unwinds the
@@ -36,6 +36,15 @@ export interface RefreshResult {
36
36
  deleted: number;
37
37
  /** Failed row writes (non-strict mode). */
38
38
  failed: number;
39
+ /** #782/#785 — `outputCollection:id` entries from the tombstone pass whose ownership stamp
40
+ * couldn't be decoded under the collection's default DEK (undecodable, mirroring
41
+ * `invalidateMVAtRest`'s #776 posture) — ownership UNCONFIRMED. Only populated when
42
+ * `onEmpty: 'delete'`. */
43
+ residueUndecodable: string[];
44
+ /** #782/#785 — `outputCollection:id` entries that decoded, stamp-matched this MV, but
45
+ * `_internalDelete` declined (the #718 tier-elevation gate) — ownership CONFIRMED, a real
46
+ * silent survival, surfaced rather than dropped. Only populated when `onEmpty: 'delete'`. */
47
+ residueDeclined: string[];
39
48
  }
40
49
  /**
41
50
  * Run an MV's `query()` and write the result rows to the output