@sixb/core 0.1.14 → 0.1.16

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 (259) hide show
  1. package/dist/actions/index.js +26 -26
  2. package/dist/actions/worker.js +1 -1
  3. package/dist/agents/index.js +41 -41
  4. package/dist/agents/index.js.map +1 -1
  5. package/dist/agents/streams/index.js +2 -2
  6. package/dist/agents/streams/internal.js +2 -2
  7. package/dist/auth/index.js +6 -6
  8. package/dist/authorization/index.js +3 -3
  9. package/dist/bootstrap/index.js +44 -44
  10. package/dist/{chunk-6rzb1g6h.js → chunk-2xvgy3x5.js} +2 -2
  11. package/dist/{chunk-16jenmzw.js → chunk-3q7z9hd4.js} +33 -33
  12. package/dist/{chunk-16jenmzw.js.map → chunk-3q7z9hd4.js.map} +1 -1
  13. package/dist/{chunk-hxgj4kzd.js → chunk-40qb8wpe.js} +11 -11
  14. package/dist/{chunk-hxgj4kzd.js.map → chunk-40qb8wpe.js.map} +3 -3
  15. package/dist/{chunk-vn3yh259.js → chunk-4gmng3vf.js} +1 -1
  16. package/dist/{chunk-znw0zvy4.js → chunk-4wn7bxxa.js} +25 -7
  17. package/dist/chunk-4wn7bxxa.js.map +12 -0
  18. package/dist/{chunk-gct3m1da.js → chunk-667x4drs.js} +3 -3
  19. package/dist/{chunk-rzcjp5m2.js → chunk-69kt9q43.js} +2 -2
  20. package/dist/{chunk-3qpcrcj8.js → chunk-6aawea28.js} +2 -4
  21. package/dist/chunk-6aawea28.js.map +10 -0
  22. package/dist/{chunk-rzkr70gr.js → chunk-6fsr7y93.js} +5 -1
  23. package/dist/{chunk-rzkr70gr.js.map → chunk-6fsr7y93.js.map} +3 -3
  24. package/dist/{chunk-3fpgxpsq.js → chunk-6z1q7j19.js} +144 -73
  25. package/dist/{chunk-3fpgxpsq.js.map → chunk-6z1q7j19.js.map} +6 -6
  26. package/dist/{chunk-ypj2wqtj.js → chunk-70jmg2zx.js} +2 -2
  27. package/dist/{chunk-m8zkvep1.js → chunk-7g2gjvah.js} +1 -1
  28. package/dist/{chunk-pvgpckm1.js → chunk-8x74221e.js} +10 -10
  29. package/dist/{chunk-ma1mhh7w.js → chunk-a7ne02hk.js} +6 -6
  30. package/dist/{chunk-bxx3ms5t.js → chunk-b9y8hcm2.js} +2 -2
  31. package/dist/{chunk-ww185kt6.js → chunk-chdg6eqq.js} +2 -2
  32. package/dist/{chunk-y487ywrv.js → chunk-cq44v1a6.js} +4 -4
  33. package/dist/{chunk-4ypbe95r.js → chunk-cxj8y8t0.js} +2 -2
  34. package/dist/{chunk-3a338wrp.js → chunk-dp7yk20b.js} +1 -1
  35. package/dist/{chunk-dv4ct8mp.js → chunk-dsv8kdgk.js} +4 -4
  36. package/dist/{chunk-dsfw1bdr.js → chunk-f72rbvsb.js} +2 -2
  37. package/dist/{chunk-4tnrzqqh.js → chunk-fj1dvp37.js} +1 -1
  38. package/dist/{chunk-ht4a7mjg.js → chunk-g4rbm4a6.js} +42 -8
  39. package/dist/{chunk-ht4a7mjg.js.map → chunk-g4rbm4a6.js.map} +3 -3
  40. package/dist/{chunk-wnxabtn4.js → chunk-gkxsenvp.js} +19 -11
  41. package/dist/{chunk-wnxabtn4.js.map → chunk-gkxsenvp.js.map} +4 -4
  42. package/dist/{chunk-vef6qa14.js → chunk-gmdvns8f.js} +2 -2
  43. package/dist/{chunk-728fp090.js → chunk-h044jb97.js} +1072 -1075
  44. package/dist/chunk-h044jb97.js.map +15 -0
  45. package/dist/{chunk-00pfcqh4.js → chunk-h4138ww2.js} +130 -71
  46. package/dist/{chunk-00pfcqh4.js.map → chunk-h4138ww2.js.map} +5 -5
  47. package/dist/{chunk-yvf2jqj8.js → chunk-h866d223.js} +1 -1
  48. package/dist/{chunk-qma80ych.js → chunk-hn2r7z41.js} +3 -2
  49. package/dist/chunk-hn2r7z41.js.map +11 -0
  50. package/dist/{chunk-bdhfn0ww.js → chunk-kkqwzy6h.js} +1 -1
  51. package/dist/{chunk-wn7mznxc.js → chunk-kttr5ftm.js} +5 -5
  52. package/dist/{chunk-kxea54yg.js → chunk-kvysp909.js} +3 -3
  53. package/dist/{chunk-p1683c0v.js → chunk-kyjcwqz6.js} +5 -2
  54. package/dist/{chunk-p1683c0v.js.map → chunk-kyjcwqz6.js.map} +3 -3
  55. package/dist/{chunk-ffwvdgk1.js → chunk-nj0020ay.js} +1 -1
  56. package/dist/{chunk-q2xghyft.js → chunk-nkbev3tr.js} +5 -5
  57. package/dist/{chunk-cbn96bve.js → chunk-nvymebc1.js} +2 -2
  58. package/dist/{chunk-2fv8sajb.js → chunk-qnd7ehe5.js} +2 -2
  59. package/dist/{chunk-jfdggg1p.js → chunk-sbcm1b92.js} +5 -5
  60. package/dist/{chunk-d8yes9yx.js → chunk-swxzncrv.js} +1 -1
  61. package/dist/{chunk-drz59ve0.js → chunk-tkdbge6v.js} +1 -1
  62. package/dist/{chunk-ky7zpbtt.js → chunk-tnvafr7g.js} +1 -1
  63. package/dist/{chunk-y6vnvayj.js → chunk-vjcd8d27.js} +1 -1
  64. package/dist/{chunk-hj0n3c2p.js → chunk-vjqt7q3a.js} +45 -27
  65. package/dist/{chunk-hj0n3c2p.js.map → chunk-vjqt7q3a.js.map} +3 -3
  66. package/dist/{chunk-z9h698s8.js → chunk-vsvrv7n8.js} +1 -1
  67. package/dist/{chunk-xgptywp0.js → chunk-y2aq6ag9.js} +1 -1
  68. package/dist/{chunk-e2c5yxfe.js → chunk-zb47r1c8.js} +2 -2
  69. package/dist/{chunk-3nx8vj5a.js → chunk-zvmr2hqk.js} +3 -2
  70. package/dist/chunk-zvmr2hqk.js.map +12 -0
  71. package/dist/deploy/define.d.ts +4 -0
  72. package/dist/deploy/define.d.ts.map +1 -0
  73. package/dist/deploy/index.d.ts +3 -0
  74. package/dist/deploy/index.d.ts.map +1 -0
  75. package/dist/deploy/index.js +10 -0
  76. package/dist/deploy/index.js.map +10 -0
  77. package/dist/deploy/internal.d.ts +3 -0
  78. package/dist/deploy/internal.d.ts.map +1 -0
  79. package/dist/deploy/internal.js +244 -0
  80. package/dist/deploy/internal.js.map +11 -0
  81. package/dist/deploy/services.d.ts +8 -0
  82. package/dist/deploy/services.d.ts.map +1 -0
  83. package/dist/deploy/types.d.ts +309 -0
  84. package/dist/deploy/types.d.ts.map +1 -0
  85. package/dist/deploy/validation.d.ts +7 -0
  86. package/dist/deploy/validation.d.ts.map +1 -0
  87. package/dist/error-reporting/internal.js +3 -3
  88. package/dist/errors/catalog.d.ts +4 -0
  89. package/dist/errors/catalog.d.ts.map +1 -1
  90. package/dist/errors/internal.js +1 -1
  91. package/dist/events/index.js +3 -3
  92. package/dist/execution/agent.js +38 -38
  93. package/dist/execution/primitive.js +34 -34
  94. package/dist/execution/request.js +36 -36
  95. package/dist/execution/request.js.map +1 -1
  96. package/dist/index.js +56 -56
  97. package/dist/index.js.map +1 -1
  98. package/dist/maintenance/ontology-maintenance.d.ts +2 -0
  99. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
  100. package/dist/maintenance/types.d.ts +8 -2
  101. package/dist/maintenance/types.d.ts.map +1 -1
  102. package/dist/materialization/dataset-watermark.d.ts +6 -1
  103. package/dist/materialization/dataset-watermark.d.ts.map +1 -1
  104. package/dist/materialization/index.js +1 -1
  105. package/dist/materialization/model.d.ts +6 -0
  106. package/dist/materialization/model.d.ts.map +1 -1
  107. package/dist/materializer/index.js +22 -22
  108. package/dist/materializer/index.js.map +1 -1
  109. package/dist/materializer/projections/finish-run.d.ts.map +1 -1
  110. package/dist/materializer/projections/replace.d.ts.map +1 -1
  111. package/dist/materializer/projections/source-materialization.d.ts +6 -2
  112. package/dist/materializer/projections/source-materialization.d.ts.map +1 -1
  113. package/dist/models/embedding-model.d.ts +4 -0
  114. package/dist/models/embedding-model.d.ts.map +1 -1
  115. package/dist/models/execution/index.js +19 -19
  116. package/dist/models/index.js +2 -2
  117. package/dist/objects/index.js +25 -25
  118. package/dist/objects/query/index.js +21 -21
  119. package/dist/objects/query/index.js.map +1 -1
  120. package/dist/objects/vectors/indexing-generate.d.ts.map +1 -1
  121. package/dist/objects/vectors/profile.d.ts.map +1 -1
  122. package/dist/objects/vectors/query.d.ts +1 -1
  123. package/dist/objects/vectors/query.d.ts.map +1 -1
  124. package/dist/objects/vectors/resolve-query.d.ts.map +1 -1
  125. package/dist/objects/vectors/types.d.ts +1 -1
  126. package/dist/objects/vectors/types.d.ts.map +1 -1
  127. package/dist/ontology/builders.d.ts +13 -4
  128. package/dist/ontology/builders.d.ts.map +1 -1
  129. package/dist/ontology/index.js +3 -3
  130. package/dist/ontology/internal.js +2 -2
  131. package/dist/ontology/vector-profiles.d.ts.map +1 -1
  132. package/dist/pipelines/index.js +23 -23
  133. package/dist/projections/internal.js +20 -20
  134. package/dist/projections/types.d.ts +1 -1
  135. package/dist/projections/types.d.ts.map +1 -1
  136. package/dist/queues/in-memory.d.ts +1 -1
  137. package/dist/queues/in-memory.d.ts.map +1 -1
  138. package/dist/runtime/internal.js +23 -23
  139. package/dist/sandboxes/index.js +5 -5
  140. package/dist/shares/internal.js +18 -18
  141. package/dist/shares/internal.js.map +1 -1
  142. package/dist/storage/action-runs/failure.js +2 -2
  143. package/dist/storage/agents/provider.js +1 -1
  144. package/dist/storage/ai-limits/enforcement.js +2 -2
  145. package/dist/storage/connector-connections/provider.js +1 -1
  146. package/dist/storage/file-upload-sessions/provider.js +7 -7
  147. package/dist/storage/index.d.ts +2 -2
  148. package/dist/storage/index.d.ts.map +1 -1
  149. package/dist/storage/index.js +33 -33
  150. package/dist/storage/index.js.map +1 -1
  151. package/dist/storage/internal.js +1 -1
  152. package/dist/storage/ontology/in-memory/sources.d.ts +6 -3
  153. package/dist/storage/ontology/in-memory/sources.d.ts.map +1 -1
  154. package/dist/storage/ontology/index.d.ts +1 -1
  155. package/dist/storage/ontology/index.d.ts.map +1 -1
  156. package/dist/storage/ontology/provider.d.ts +16 -3
  157. package/dist/storage/ontology/provider.d.ts.map +1 -1
  158. package/dist/storage/ontology/provider.js +8 -4
  159. package/dist/storage/ontology/provider.js.map +1 -1
  160. package/dist/storage/ontology/sources.d.ts +36 -8
  161. package/dist/storage/ontology/sources.d.ts.map +1 -1
  162. package/dist/storage/projection-runs/in-memory.d.ts +3 -1
  163. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
  164. package/dist/storage/projection-runs/index.d.ts +1 -1
  165. package/dist/storage/projection-runs/index.d.ts.map +1 -1
  166. package/dist/storage/projection-runs/lifecycle.d.ts +12 -0
  167. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
  168. package/dist/storage/projection-runs/provider.js +10 -4
  169. package/dist/storage/projection-runs/provider.js.map +1 -1
  170. package/dist/storage/projection-runs/types.d.ts +32 -1
  171. package/dist/storage/projection-runs/types.d.ts.map +1 -1
  172. package/dist/storage/workflow-runs/provider.js +7 -7
  173. package/dist/syncs/index.js +24 -24
  174. package/dist/testing/index.js +306 -64
  175. package/dist/testing/index.js.map +4 -4
  176. package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
  177. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
  178. package/dist/webhooks/internal.js +19 -19
  179. package/dist/webhooks/internal.js.map +1 -1
  180. package/dist/workers/index.js +1 -1
  181. package/dist/workflows/index.js +41 -41
  182. package/package.json +13 -1
  183. package/src/deploy/define.ts +6 -0
  184. package/src/deploy/index.ts +41 -0
  185. package/src/deploy/internal.ts +7 -0
  186. package/src/deploy/services.ts +51 -0
  187. package/src/deploy/types.ts +338 -0
  188. package/src/deploy/validation.ts +261 -0
  189. package/src/errors/catalog.ts +4 -0
  190. package/src/maintenance/ontology-maintenance.ts +32 -2
  191. package/src/maintenance/types.ts +8 -2
  192. package/src/materialization/dataset-watermark.ts +6 -4
  193. package/src/materialization/model.ts +7 -0
  194. package/src/materializer/README.md +26 -6
  195. package/src/materializer/projections/finish-run.ts +129 -26
  196. package/src/materializer/projections/replace.ts +67 -49
  197. package/src/materializer/projections/source-materialization.ts +11 -6
  198. package/src/models/embedding-model.ts +12 -0
  199. package/src/models/execution/embedding.ts +5 -1
  200. package/src/objects/query/validate.ts +1 -10
  201. package/src/objects/vectors/README.md +8 -0
  202. package/src/objects/vectors/handle.ts +1 -1
  203. package/src/objects/vectors/indexing-generate.ts +5 -1
  204. package/src/objects/vectors/profile.ts +2 -0
  205. package/src/objects/vectors/query.ts +18 -4
  206. package/src/objects/vectors/resolve-query.ts +9 -5
  207. package/src/objects/vectors/types.ts +3 -1
  208. package/src/ontology/builders.ts +21 -7
  209. package/src/ontology/vector-profiles.ts +1 -0
  210. package/src/projections/types.ts +1 -0
  211. package/src/storage/index.ts +6 -1
  212. package/src/storage/ontology/in-memory/sources.ts +119 -55
  213. package/src/storage/ontology/index.ts +4 -1
  214. package/src/storage/ontology/provider.ts +64 -7
  215. package/src/storage/ontology/sources.ts +42 -8
  216. package/src/storage/projection-runs/in-memory.ts +41 -2
  217. package/src/storage/projection-runs/index.ts +2 -0
  218. package/src/storage/projection-runs/lifecycle.ts +61 -4
  219. package/src/storage/projection-runs/types.ts +41 -1
  220. package/src/testing/ontology-storage-contract.ts +141 -15
  221. package/src/testing/projection-run-storage-contract.ts +174 -1
  222. package/dist/chunk-3nx8vj5a.js.map +0 -12
  223. package/dist/chunk-3qpcrcj8.js.map +0 -10
  224. package/dist/chunk-728fp090.js.map +0 -15
  225. package/dist/chunk-qma80ych.js.map +0 -11
  226. package/dist/chunk-znw0zvy4.js.map +0 -12
  227. /package/dist/{chunk-6rzb1g6h.js.map → chunk-2xvgy3x5.js.map} +0 -0
  228. /package/dist/{chunk-vn3yh259.js.map → chunk-4gmng3vf.js.map} +0 -0
  229. /package/dist/{chunk-gct3m1da.js.map → chunk-667x4drs.js.map} +0 -0
  230. /package/dist/{chunk-rzcjp5m2.js.map → chunk-69kt9q43.js.map} +0 -0
  231. /package/dist/{chunk-ypj2wqtj.js.map → chunk-70jmg2zx.js.map} +0 -0
  232. /package/dist/{chunk-m8zkvep1.js.map → chunk-7g2gjvah.js.map} +0 -0
  233. /package/dist/{chunk-pvgpckm1.js.map → chunk-8x74221e.js.map} +0 -0
  234. /package/dist/{chunk-ma1mhh7w.js.map → chunk-a7ne02hk.js.map} +0 -0
  235. /package/dist/{chunk-bxx3ms5t.js.map → chunk-b9y8hcm2.js.map} +0 -0
  236. /package/dist/{chunk-ww185kt6.js.map → chunk-chdg6eqq.js.map} +0 -0
  237. /package/dist/{chunk-y487ywrv.js.map → chunk-cq44v1a6.js.map} +0 -0
  238. /package/dist/{chunk-4ypbe95r.js.map → chunk-cxj8y8t0.js.map} +0 -0
  239. /package/dist/{chunk-3a338wrp.js.map → chunk-dp7yk20b.js.map} +0 -0
  240. /package/dist/{chunk-dv4ct8mp.js.map → chunk-dsv8kdgk.js.map} +0 -0
  241. /package/dist/{chunk-dsfw1bdr.js.map → chunk-f72rbvsb.js.map} +0 -0
  242. /package/dist/{chunk-4tnrzqqh.js.map → chunk-fj1dvp37.js.map} +0 -0
  243. /package/dist/{chunk-vef6qa14.js.map → chunk-gmdvns8f.js.map} +0 -0
  244. /package/dist/{chunk-yvf2jqj8.js.map → chunk-h866d223.js.map} +0 -0
  245. /package/dist/{chunk-bdhfn0ww.js.map → chunk-kkqwzy6h.js.map} +0 -0
  246. /package/dist/{chunk-wn7mznxc.js.map → chunk-kttr5ftm.js.map} +0 -0
  247. /package/dist/{chunk-kxea54yg.js.map → chunk-kvysp909.js.map} +0 -0
  248. /package/dist/{chunk-ffwvdgk1.js.map → chunk-nj0020ay.js.map} +0 -0
  249. /package/dist/{chunk-q2xghyft.js.map → chunk-nkbev3tr.js.map} +0 -0
  250. /package/dist/{chunk-cbn96bve.js.map → chunk-nvymebc1.js.map} +0 -0
  251. /package/dist/{chunk-2fv8sajb.js.map → chunk-qnd7ehe5.js.map} +0 -0
  252. /package/dist/{chunk-jfdggg1p.js.map → chunk-sbcm1b92.js.map} +0 -0
  253. /package/dist/{chunk-d8yes9yx.js.map → chunk-swxzncrv.js.map} +0 -0
  254. /package/dist/{chunk-drz59ve0.js.map → chunk-tkdbge6v.js.map} +0 -0
  255. /package/dist/{chunk-ky7zpbtt.js.map → chunk-tnvafr7g.js.map} +0 -0
  256. /package/dist/{chunk-y6vnvayj.js.map → chunk-vjcd8d27.js.map} +0 -0
  257. /package/dist/{chunk-z9h698s8.js.map → chunk-vsvrv7n8.js.map} +0 -0
  258. /package/dist/{chunk-xgptywp0.js.map → chunk-y2aq6ag9.js.map} +0 -0
  259. /package/dist/{chunk-e2c5yxfe.js.map → chunk-zb47r1c8.js.map} +0 -0
@@ -2,24 +2,24 @@
2
2
  import {
3
3
  AuthStorageError2,
4
4
  SYSTEM_PRINCIPAL2
5
- } from "../chunk-6rzb1g6h.js";
5
+ } from "../chunk-2xvgy3x5.js";
6
6
  import {
7
7
  defineProjection2,
8
8
  agentServiceAccountId2,
9
9
  MAX_OBJECT_READ_FACETS2
10
- } from "../chunk-rzcjp5m2.js";
11
- import"../chunk-rzkr70gr.js";
10
+ } from "../chunk-69kt9q43.js";
11
+ import"../chunk-6fsr7y93.js";
12
12
  import"../chunk-z3y5kg1x.js";
13
13
  import {
14
14
  compileSelectedObjectReadScope2
15
15
  } from "../chunk-v4jbb3rs.js";
16
- import"../chunk-d8yes9yx.js";
16
+ import"../chunk-swxzncrv.js";
17
17
  import {
18
18
  ref2
19
- } from "../chunk-drz59ve0.js";
19
+ } from "../chunk-tkdbge6v.js";
20
20
  import"../chunk-2jntasmh.js";
21
21
  import"../chunk-pqajwytd.js";
22
- import"../chunk-ky7zpbtt.js";
22
+ import"../chunk-tnvafr7g.js";
23
23
  import"../chunk-gfdh9kqa.js";
24
24
  import {
25
25
  computeBlobDigest2,
@@ -31,7 +31,7 @@ import {
31
31
  import {
32
32
  AiUsageStorageError2
33
33
  } from "../chunk-xnx96gfy.js";
34
- import"../chunk-xgptywp0.js";
34
+ import"../chunk-y2aq6ag9.js";
35
35
  import"../chunk-fc5zfxy1.js";
36
36
  import {
37
37
  aiLimitCalendarMonth2
@@ -39,7 +39,7 @@ import {
39
39
  import {
40
40
  DEFAULT_FILE_UPLOAD_TERMINAL_SESSION_TTL_MS2
41
41
  } from "../chunk-h89wz928.js";
42
- import"../chunk-3a338wrp.js";
42
+ import"../chunk-dp7yk20b.js";
43
43
  import"../chunk-tw03bsmb.js";
44
44
  import {
45
45
  OntologyRegistry2,
@@ -47,10 +47,10 @@ import {
47
47
  prop2,
48
48
  link2,
49
49
  stringEnum2
50
- } from "../chunk-3nx8vj5a.js";
50
+ } from "../chunk-zvmr2hqk.js";
51
51
  import {
52
52
  createEventId2
53
- } from "../chunk-ht4a7mjg.js";
53
+ } from "../chunk-g4rbm4a6.js";
54
54
  import {
55
55
  AGENT_MESSAGE_CONTENT_VERSION2,
56
56
  AiCostStorageError2,
@@ -59,54 +59,54 @@ import {
59
59
  objectLinkCursor2,
60
60
  WorkflowInterventionError2,
61
61
  InMemoryStorage2
62
- } from "../chunk-3fpgxpsq.js";
62
+ } from "../chunk-6z1q7j19.js";
63
63
  import"../chunk-7ytf06d3.js";
64
64
  import"../chunk-mr60an99.js";
65
65
  import"../chunk-mmagke4x.js";
66
- import"../chunk-qma80ych.js";
67
- import"../chunk-znw0zvy4.js";
66
+ import"../chunk-hn2r7z41.js";
67
+ import"../chunk-4wn7bxxa.js";
68
68
  import"../chunk-jmfet9r4.js";
69
69
  import"../chunk-qf954wje.js";
70
- import"../chunk-gct3m1da.js";
70
+ import"../chunk-667x4drs.js";
71
71
  import {
72
72
  ProjectionRegistry2,
73
73
  createLinkScopeFingerprint2,
74
74
  createOntologyMaterializer2
75
- } from "../chunk-00pfcqh4.js";
75
+ } from "../chunk-h4138ww2.js";
76
76
  import {
77
77
  bindModelExecutionAttempt,
78
78
  isBoundSixb
79
- } from "../chunk-16jenmzw.js";
79
+ } from "../chunk-3q7z9hd4.js";
80
80
  import"../chunk-5a4a52tq.js";
81
81
  import {
82
82
  SixbHost2
83
- } from "../chunk-hj0n3c2p.js";
84
- import"../chunk-y6vnvayj.js";
85
- import"../chunk-ypj2wqtj.js";
83
+ } from "../chunk-vjqt7q3a.js";
84
+ import"../chunk-vjcd8d27.js";
85
+ import"../chunk-70jmg2zx.js";
86
86
  import"../chunk-r2y23egw.js";
87
87
  import"../chunk-dfm066qg.js";
88
88
  import {
89
- planObjectQuery2,
90
89
  validateObjectQuery2,
91
90
  collectObjectQueryValidationIssues2,
91
+ planObjectQuery2,
92
92
  executeObjectQuery2,
93
93
  countObjects2,
94
94
  existsObjects2,
95
95
  facetObjects2,
96
96
  executeObjectQueryLinks2
97
- } from "../chunk-728fp090.js";
98
- import"../chunk-pvgpckm1.js";
97
+ } from "../chunk-h044jb97.js";
98
+ import"../chunk-8x74221e.js";
99
99
  import"../chunk-3qms4nax.js";
100
100
  import"../chunk-f85hpqnm.js";
101
- import"../chunk-4tnrzqqh.js";
102
- import"../chunk-wnxabtn4.js";
103
- import"../chunk-y487ywrv.js";
101
+ import"../chunk-fj1dvp37.js";
102
+ import"../chunk-gkxsenvp.js";
103
+ import"../chunk-cq44v1a6.js";
104
104
  import"../chunk-fb3feg1e.js";
105
105
  import"../chunk-z5rnrmz1.js";
106
106
  import"../chunk-85cd7e8c.js";
107
107
  import"../chunk-wr8qp979.js";
108
- import"../chunk-dv4ct8mp.js";
109
- import"../chunk-dsfw1bdr.js";
108
+ import"../chunk-dsv8kdgk.js";
109
+ import"../chunk-f72rbvsb.js";
110
110
  import {
111
111
  col2,
112
112
  defineDataset2,
@@ -115,14 +115,14 @@ import {
115
115
  import"../chunk-e1c18xjx.js";
116
116
  import"../chunk-9vx5e9g1.js";
117
117
  import"../chunk-dmn70ztd.js";
118
- import"../chunk-cbn96bve.js";
118
+ import"../chunk-nvymebc1.js";
119
119
  import {
120
120
  writeDataset2
121
121
  } from "../chunk-91kcnbf0.js";
122
- import"../chunk-vn3yh259.js";
122
+ import"../chunk-4gmng3vf.js";
123
123
  import {
124
124
  workflowAgentStepActorId2
125
- } from "../chunk-wn7mznxc.js";
125
+ } from "../chunk-kttr5ftm.js";
126
126
  import {
127
127
  BrokerError2,
128
128
  InMemoryBroker2
@@ -134,23 +134,23 @@ import {
134
134
  import"../chunk-mdnw7nj8.js";
135
135
  import {
136
136
  SandboxNotRunningError2
137
- } from "../chunk-vef6qa14.js";
138
- import"../chunk-e2c5yxfe.js";
139
- import"../chunk-yvf2jqj8.js";
137
+ } from "../chunk-gmdvns8f.js";
138
+ import"../chunk-zb47r1c8.js";
139
+ import"../chunk-h866d223.js";
140
140
  import"../chunk-7n30ybym.js";
141
- import"../chunk-ma1mhh7w.js";
141
+ import"../chunk-a7ne02hk.js";
142
142
  import {
143
143
  createTestingScope
144
- } from "../chunk-z9h698s8.js";
144
+ } from "../chunk-vsvrv7n8.js";
145
145
  import"../chunk-x9v4cx1d.js";
146
- import"../chunk-ffwvdgk1.js";
147
- import"../chunk-q2xghyft.js";
148
- import"../chunk-ww185kt6.js";
149
- import"../chunk-4ypbe95r.js";
150
- import"../chunk-hxgj4kzd.js";
151
- import"../chunk-jfdggg1p.js";
152
- import"../chunk-bxx3ms5t.js";
153
- import"../chunk-kxea54yg.js";
146
+ import"../chunk-nj0020ay.js";
147
+ import"../chunk-nkbev3tr.js";
148
+ import"../chunk-cxj8y8t0.js";
149
+ import"../chunk-chdg6eqq.js";
150
+ import"../chunk-b9y8hcm2.js";
151
+ import"../chunk-kvysp909.js";
152
+ import"../chunk-40qb8wpe.js";
153
+ import"../chunk-sbcm1b92.js";
154
154
  import {
155
155
  LakeStorageError2
156
156
  } from "../chunk-rb143ggb.js";
@@ -160,12 +160,12 @@ import {
160
160
  } from "../chunk-a0073121.js";
161
161
  import {
162
162
  restoreTrustedPrimitiveExecutionScope
163
- } from "../chunk-m8zkvep1.js";
164
- import"../chunk-zdkcdshk.js";
163
+ } from "../chunk-7g2gjvah.js";
165
164
  import"../chunk-br3k6qbf.js";
165
+ import"../chunk-zdkcdshk.js";
166
166
  import"../chunk-s3csryxe.js";
167
- import"../chunk-bdhfn0ww.js";
168
- import"../chunk-2fv8sajb.js";
167
+ import"../chunk-kkqwzy6h.js";
168
+ import"../chunk-qnd7ehe5.js";
169
169
  import {
170
170
  blobIdFromDigest2
171
171
  } from "../chunk-h3v76ams.js";
@@ -13160,33 +13160,140 @@ function runOntologyStorageContractSuite(label, options) {
13160
13160
  execution,
13161
13161
  abandonedAt: "2026-01-01T00:03:00.000Z"
13162
13162
  })).rejects.toMatchObject({ kind: "execution-lost" });
13163
+ const adopted = await storage.ontology.sources.adopt({
13164
+ projectId: "contract-project",
13165
+ source,
13166
+ execution: reclaimed.execution,
13167
+ adoptedAt: "2026-01-01T00:01:30.000Z"
13168
+ });
13169
+ expect21(adopted).toMatchObject({
13170
+ record: {
13171
+ materializationId: "staging-candidate",
13172
+ status: "ready",
13173
+ executionToken: reclaimed.execution.executionToken,
13174
+ updatedAt: "2026-01-01T00:01:30.000Z"
13175
+ },
13176
+ resumeStagingOrdinal: 1
13177
+ });
13178
+ expect21(await storage.ontology.sources.adopt({
13179
+ projectId: "contract-project",
13180
+ source,
13181
+ execution: reclaimed.execution,
13182
+ adoptedAt: "2026-01-01T00:01:40.000Z"
13183
+ })).toMatchObject({ record: { executionToken: reclaimed.execution.executionToken } });
13163
13184
  const abandoned = await storage.ontology.sources.abandon({
13164
- kind: "reclaim",
13185
+ kind: "run",
13165
13186
  projectId: "contract-project",
13166
13187
  source,
13167
13188
  execution: reclaimed.execution,
13168
13189
  abandonedAt: "2026-01-01T00:02:00.000Z"
13169
13190
  });
13170
13191
  expect21(abandoned).toMatchObject({ status: "abandoned", executionToken: null });
13171
- expect21(await storage.ontology.sources.summarizeTerminal({ projectId: "contract-project" })).toEqual({ count: 1, oldestTerminalAt: "2026-01-01T00:02:00.000Z" });
13172
- expect21(await storage.ontology.sources.cleanupTerminal({
13192
+ expect21(await storage.ontology.sources.abandon({
13193
+ kind: "run",
13173
13194
  projectId: "contract-project",
13174
- terminalBefore: "2026-02-01T00:00:00.000Z",
13175
- limit: 1
13176
- })).toEqual({ rowsDeleted: 1, materializationsDeleted: 0 });
13177
- expect21(await storage.ontology.sources.cleanupTerminal({
13195
+ source,
13196
+ execution: reclaimed.execution,
13197
+ abandonedAt: "2026-01-01T00:02:00.000Z"
13198
+ })).toBeNull();
13199
+ expect21(await storage.ontology.sources.adopt({
13178
13200
  projectId: "contract-project",
13179
- terminalBefore: "2026-02-01T00:00:00.000Z",
13180
- limit: 1
13181
- })).toEqual({ rowsDeleted: 1, materializationsDeleted: 0 });
13201
+ source,
13202
+ execution: reclaimed.execution,
13203
+ adoptedAt: "2026-01-01T00:02:10.000Z"
13204
+ })).toBeNull();
13205
+ expect21(await storage.ontology.sources.summarizeTerminal({ projectId: "contract-project" })).toEqual({ count: 1, oldestTerminalAt: "2026-01-01T00:02:00.000Z" });
13182
13206
  expect21(await storage.ontology.sources.cleanupTerminal({
13183
13207
  projectId: "contract-project",
13184
13208
  terminalBefore: "2026-02-01T00:00:00.000Z",
13185
- limit: 1
13186
- })).toEqual({ rowsDeleted: 0, materializationsDeleted: 1 });
13209
+ limit: 10
13210
+ })).toEqual({ rowsDeleted: 0, materializationsDeleted: 0 });
13211
+ expect21(await storage.ontology.sources.purgeAbandoned({ projectId: "contract-project", limit: 1 })).toEqual({ rowsDeleted: 1, materializationsDeleted: 0 });
13212
+ expect21(await storage.ontology.sources.purgeAbandoned({ projectId: "contract-project", limit: 1 })).toEqual({ rowsDeleted: 1, materializationsDeleted: 0 });
13213
+ expect21(await storage.ontology.sources.purgeAbandoned({ projectId: "contract-project", limit: 1 })).toEqual({ rowsDeleted: 0, materializationsDeleted: 1 });
13187
13214
  expect21(await storage.ontology.sources.summarizeTerminal({ projectId: "contract-project" })).toEqual({ count: 0, oldestTerminalAt: null });
13188
13215
  });
13189
13216
  });
13217
+ test21("adopts a staging candidate at its last staged root", async () => {
13218
+ await withStorage(async (storage) => {
13219
+ const identity = replacementIdentity("01");
13220
+ const claimed = await startTestProjectionRun(storage, {
13221
+ id: "resumed-run",
13222
+ projectId: "contract-project",
13223
+ identity,
13224
+ target: { objectTypeId: "ContractDevice" }
13225
+ });
13226
+ const source = { projectionId: identity.projectionId };
13227
+ await storage.ontology.sources.beginMaterialization({
13228
+ projectId: "contract-project",
13229
+ source,
13230
+ materializationId: "resumed-candidate",
13231
+ execution: claimed.execution,
13232
+ projectionKind: "object",
13233
+ protocol: "replacement",
13234
+ datasetVersion: identity.datasetVersion,
13235
+ projectionRevision: identity.projectionRevision,
13236
+ ownershipHash: identity.ownershipHash,
13237
+ ontologyRevision: identity.ontologyRevision,
13238
+ createdAt: "2026-01-01T00:00:00.000Z"
13239
+ });
13240
+ const row = (primaryId, stagingOrdinal) => ({
13241
+ root: { kind: "object", ref: { objectTypeId: "ContractDevice", primaryId } },
13242
+ assertion: {
13243
+ kind: "object",
13244
+ ref: { objectTypeId: "ContractDevice", primaryId },
13245
+ properties: { name: primaryId }
13246
+ },
13247
+ stagingOrdinal
13248
+ });
13249
+ await storage.ontology.sources.stageRows({
13250
+ projectId: "contract-project",
13251
+ source,
13252
+ materializationId: "resumed-candidate",
13253
+ execution: claimed.execution,
13254
+ rows: [row("zero", 0), row("one", 1)]
13255
+ });
13256
+ const reclaimed = await storage.projectionRuns.startOrReclaim({
13257
+ id: claimed.run.id,
13258
+ projectId: claimed.run.projectId,
13259
+ identity,
13260
+ target: { objectTypeId: "ContractDevice" }
13261
+ });
13262
+ const adopted = await storage.ontology.sources.adopt({
13263
+ projectId: "contract-project",
13264
+ source,
13265
+ execution: reclaimed.execution,
13266
+ adoptedAt: "2026-01-01T00:01:00.000Z"
13267
+ });
13268
+ expect21(adopted).toMatchObject({
13269
+ record: { status: "staging", executionToken: reclaimed.execution.executionToken },
13270
+ resumeStagingOrdinal: 1
13271
+ });
13272
+ await expect21(storage.ontology.sources.stageRows({
13273
+ projectId: "contract-project",
13274
+ source,
13275
+ materializationId: "resumed-candidate",
13276
+ execution: claimed.execution,
13277
+ rows: [row("two", 2)]
13278
+ })).rejects.toMatchObject({ kind: "execution-lost" });
13279
+ expect21(await storage.ontology.sources.stageRows({
13280
+ projectId: "contract-project",
13281
+ source,
13282
+ materializationId: "resumed-candidate",
13283
+ execution: reclaimed.execution,
13284
+ rows: [row("one", 1), row("two", 2)]
13285
+ })).toEqual({ inserted: 1, unchanged: 1 });
13286
+ expect21(await storage.ontology.sources.markReady({
13287
+ projectId: "contract-project",
13288
+ source,
13289
+ materializationId: "resumed-candidate",
13290
+ execution: reclaimed.execution,
13291
+ rootCount: 3,
13292
+ assertionCount: 3,
13293
+ readyAt: "2026-01-01T00:02:00.000Z"
13294
+ })).toMatchObject({ status: "ready", rootCount: 3 });
13295
+ });
13296
+ });
13190
13297
  test21("atomically activates explicit empty candidates and rejects competing stale heads", async () => {
13191
13298
  await withStorage(async (storage) => {
13192
13299
  const first = await createReadyEmptyCandidate(storage, "run-one", "candidate-one", "01");
@@ -13225,15 +13332,14 @@ function runOntologyStorageContractSuite(label, options) {
13225
13332
  });
13226
13333
  await expect21(activateEmptyCandidate(storage, stale, currentActive, "commit-stale-activation", "2026-01-06T00:00:00.000Z")).rejects.toThrow("execution token is stale");
13227
13334
  await storage.ontology.sources.abandon({
13228
- kind: "reclaim",
13335
+ kind: "run",
13229
13336
  projectId: "contract-project",
13230
13337
  source: stale.source,
13231
13338
  execution: reclaimed.execution,
13232
13339
  abandonedAt: "2026-01-06T00:01:00.000Z"
13233
13340
  });
13234
- const cleanup = await storage.ontology.sources.cleanupTerminal({
13341
+ const cleanup = await storage.ontology.sources.purgeAbandoned({
13235
13342
  projectId: "contract-project",
13236
- terminalBefore: "2026-02-01T00:00:00.000Z",
13237
13343
  limit: 10
13238
13344
  });
13239
13345
  expect21(cleanup.materializationsDeleted).toBeGreaterThanOrEqual(1);
@@ -13731,6 +13837,12 @@ var failure2 = {
13731
13837
  at: "2026-06-01T12:00:00.000Z",
13732
13838
  details: { projectionId: "contract.devices", runId: "failed-run" }
13733
13839
  };
13840
+ var attemptFailure = {
13841
+ code: "storage.unavailable",
13842
+ message: "Storage is temporarily unavailable.",
13843
+ retryable: true,
13844
+ at: "2026-06-01T11:00:00.000Z"
13845
+ };
13734
13846
  var replacementIdentity2 = {
13735
13847
  projectionId: "contract.devices",
13736
13848
  projectionKind: "object",
@@ -13818,11 +13930,120 @@ function runProjectionRunStorageContractSuite(label, options) {
13818
13930
  status: "failed",
13819
13931
  error: { code: "queue.enqueue_failed", message: "queue unavailable" }
13820
13932
  });
13821
- await expect22(context.projectionRuns.queue(admission)).resolves.toMatchObject({
13933
+ const requeued = await context.projectionRuns.queue(admission);
13934
+ expect22(requeued).toMatchObject({
13822
13935
  executionId: admission.executionId,
13823
13936
  status: "queued",
13824
13937
  attempt: 0
13825
13938
  });
13939
+ expect22(requeued.error).toBeUndefined();
13940
+ });
13941
+ });
13942
+ test22("keeps the failure of a retried attempt until the run ends", async () => {
13943
+ await withStorage(async (context) => {
13944
+ const storage = context.projectionRuns;
13945
+ const input = replacementInput("retried-run");
13946
+ await admitProjectionRun(context, input);
13947
+ const first = await storage.startOrReclaim(input);
13948
+ const failed = await storage.recordAttemptFailure({
13949
+ ...executionInput(first),
13950
+ error: attemptFailure
13951
+ });
13952
+ expect22(failed).toMatchObject({ status: "running", error: attemptFailure });
13953
+ const second = await storage.startOrReclaim(input);
13954
+ expect22(second.run).toMatchObject({ attempt: 2, error: attemptFailure });
13955
+ await expect22(storage.recordAttemptFailure({ ...executionInput(first), error: failure2 })).rejects.toThrow("execution token is stale");
13956
+ await expect22(storage.recordAttemptFailure({
13957
+ ...executionInput(second),
13958
+ error: { ...failure2, code: "dataset.not_found" }
13959
+ })).rejects.toThrow("code is not allowed by this failure contract");
13960
+ const succeeded = await storage.finish({
13961
+ ...executionInput(second),
13962
+ protocol: "replacement",
13963
+ status: "succeeded"
13964
+ });
13965
+ expect22(succeeded).toMatchObject({ status: "succeeded" });
13966
+ expect22(succeeded.error).toBeUndefined();
13967
+ await expect22(storage.recordAttemptFailure({ ...executionInput(second), error: failure2 })).rejects.toThrow("already terminal");
13968
+ });
13969
+ });
13970
+ test22("finds the newest later run that still stands to replace a source", async () => {
13971
+ await withStorage(async (context) => {
13972
+ const storage = context.projectionRuns;
13973
+ const current = replacementInput("current-run");
13974
+ const earlier = versionedReplacementInput("earlier-run", "version-0", "2025-12-31");
13975
+ const later = versionedReplacementInput("later-run", "version-2", "2026-01-02");
13976
+ const latest = versionedReplacementInput("latest-run", "version-3", "2026-01-03");
13977
+ const otherProjection = {
13978
+ ...versionedReplacementInput("other-projection-run", "version-4", "2026-01-04"),
13979
+ identity: {
13980
+ ...versionedReplacementInput("other", "version-4", "2026-01-04").identity,
13981
+ projectionId: "contract.rooms"
13982
+ }
13983
+ };
13984
+ for (const input of [current, earlier, later, latest, otherProjection]) {
13985
+ await admitProjectionRun(context, input);
13986
+ }
13987
+ const superseding = () => storage.findSupersedingRun({ projectId: projectId13, id: current.id });
13988
+ await expect22(superseding()).resolves.toMatchObject({ id: latest.id, status: "queued" });
13989
+ await expect22(storage.findSupersedingRun({ projectId: projectId13, id: latest.id })).resolves.toBeNull();
13990
+ await finishClaimed(context, latest, "failed");
13991
+ await expect22(superseding()).resolves.toMatchObject({ id: later.id });
13992
+ await finishClaimed(context, later, "cancelled");
13993
+ await expect22(superseding()).resolves.toBeNull();
13994
+ const telemetry = {
13995
+ id: "telemetry-run",
13996
+ projectId: projectId13,
13997
+ identity: telemetryIdentity,
13998
+ target: objectTarget,
13999
+ fixedBatchSize: 2
14000
+ };
14001
+ await admitProjectionRun(context, telemetry);
14002
+ await expect22(storage.findSupersedingRun({ projectId: projectId13, id: telemetry.id })).resolves.toBeNull();
14003
+ await expect22(storage.findSupersedingRun({ projectId: projectId13, id: "missing-run" })).rejects.toThrow("not found");
14004
+ });
14005
+ });
14006
+ test22("ends a superseded run without a failure and never reports it as the latest", async () => {
14007
+ await withStorage(async (context) => {
14008
+ const storage = context.projectionRuns;
14009
+ const stale = replacementInput("stale-run");
14010
+ const newer = versionedReplacementInput("newer-run", "version-2", "2026-01-02");
14011
+ await admitProjectionRun(context, stale);
14012
+ await admitProjectionRun(context, newer);
14013
+ const claim = await storage.startOrReclaim({
14014
+ ...stale,
14015
+ startedAt: new Date("2026-01-01T00:00:05.000Z")
14016
+ });
14017
+ const superseded = await storage.finish({
14018
+ ...executionInput(claim),
14019
+ protocol: "replacement",
14020
+ status: "superseded"
14021
+ });
14022
+ expect22(superseded).toMatchObject({ status: "superseded", attempt: 1 });
14023
+ expect22(superseded.error).toBeUndefined();
14024
+ expect22(superseded.finishedAt).toBeInstanceOf(Date);
14025
+ await expect22(storage.listLatestByProjectionIds({
14026
+ projectId: projectId13,
14027
+ projectionIds: [replacementIdentity2.projectionId]
14028
+ })).resolves.toMatchObject({ runs: [{ id: newer.id, status: "queued" }] });
14029
+ await expect22(storage.list({ projectId: projectId13, statuses: ["superseded"] })).resolves.toMatchObject({
14030
+ runs: [{ id: stale.id }],
14031
+ total: 1
14032
+ });
14033
+ const telemetry = {
14034
+ id: "telemetry-run",
14035
+ projectId: projectId13,
14036
+ identity: telemetryIdentity,
14037
+ target: objectTarget,
14038
+ fixedBatchSize: 2
14039
+ };
14040
+ await admitProjectionRun(context, telemetry);
14041
+ const telemetryClaim = await storage.startOrReclaim(telemetry);
14042
+ await expect22(storage.finish({
14043
+ ...executionInput(telemetryClaim),
14044
+ protocol: "telemetry",
14045
+ status: "superseded"
14046
+ })).rejects.toThrow("cannot be superseded");
13826
14047
  });
13827
14048
  });
13828
14049
  test22("keeps one run while reclaim rotates its execution", async () => {
@@ -14164,6 +14385,27 @@ async function admitProjectionRun(context, input) {
14164
14385
  function replacementInput(id) {
14165
14386
  return { id, projectId: projectId13, identity: replacementIdentity2, target: objectTarget };
14166
14387
  }
14388
+ function versionedReplacementInput(id, versionId, day) {
14389
+ return {
14390
+ ...replacementInput(id),
14391
+ identity: {
14392
+ ...replacementIdentity2,
14393
+ datasetVersion: {
14394
+ ...replacementIdentity2.datasetVersion,
14395
+ versionId,
14396
+ createdAt: `${day}T00:00:00.000Z`
14397
+ }
14398
+ }
14399
+ };
14400
+ }
14401
+ async function finishClaimed(context, input, status) {
14402
+ const claim = await context.projectionRuns.startOrReclaim(input);
14403
+ await context.projectionRuns.finish({
14404
+ ...executionInput(claim),
14405
+ protocol: "replacement",
14406
+ status
14407
+ });
14408
+ }
14167
14409
  function executionInput(claim) {
14168
14410
  return {
14169
14411
  id: claim.run.id,
@@ -15992,4 +16234,4 @@ export {
15992
16234
  startTestWebhookRun
15993
16235
  };
15994
16236
 
15995
- //# debugId=3E6B1E78CE757E1764756E2164756E21
16237
+ //# debugId=C29F884EB428EEBD64756E2164756E21