deepline 0.3.534 → 0.3.536

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 (235) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +254 -147
  2. package/dist/bundling-sources/sdk/src/index.ts +4 -0
  3. package/dist/bundling-sources/sdk/src/plays/local-file-discovery.ts +27 -1
  4. package/dist/bundling-sources/sdk/src/plays/run-request.ts +16 -5
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/types.ts +2 -23
  7. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +26 -14
  8. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-input-contract.ts +33 -8
  9. package/dist/bundling-sources/shared_libs/monitors/fleets/count-drift-alert.ts +121 -0
  10. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
  11. package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +14 -82
  12. package/dist/bundling-sources/shared_libs/monitors/package.json +1 -0
  13. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +4 -4
  14. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +0 -26
  15. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +36 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +21 -31
  17. package/dist/bundling-sources/shared_libs/play-runtime/call-requeue-state-machine.ts +420 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +727 -102
  19. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +26 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/durable-retry-policy.ts +624 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +12 -10
  22. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +3 -1
  23. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +71 -2
  24. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +60 -1
  25. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +2 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +1 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +372 -10
  28. package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +15 -2
  29. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +21 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/prebuilt-result-quality.ts +1 -1
  31. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/fixture-capacity-simulator.ts +1 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/gradient2-concurrency-controller.ts +41 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-capacity-policy.ts +6 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-concurrency-policy.ts +9 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/provider-no-progress.ts +6 -2
  37. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +17 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +2 -2
  39. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +5 -2
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +63 -3
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +7 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +31 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +6 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +26 -1
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +11 -4
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +73 -18
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +169 -2
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +26 -4
  49. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +90 -49
  50. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +136 -30
  51. package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +13 -1
  52. package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +68 -1
  53. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +63 -13
  54. package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +57 -1
  55. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +22 -9
  56. package/dist/cli/auth-6XQKFOLG.js +43 -0
  57. package/dist/cli/{auth-MHQYIMVX.mjs → auth-KCTCUO7P.mjs} +7 -7
  58. package/dist/cli/{billing-YQLNP4S5.js → billing-4VBGZ3CT.js} +273 -112
  59. package/dist/cli/{billing-LX2PSBJ4.mjs → billing-OOJHKLNS.mjs} +185 -24
  60. package/dist/cli/{chunk-DGKTHWWH.js → chunk-2B4IOGFD.js} +406 -382
  61. package/dist/cli/{chunk-MQORQ7WL.js → chunk-2FCSUOYN.js} +55 -55
  62. package/dist/cli/{chunk-T2N3B7IQ.js → chunk-2GJZLIKW.js} +8 -8
  63. package/dist/cli/{chunk-6IFZPEJE.mjs → chunk-2YWJS76L.mjs} +1 -1
  64. package/dist/cli/{chunk-E7TP25I2.mjs → chunk-3PCYV6ZJ.mjs} +2 -2
  65. package/dist/cli/{chunk-LGRZCHKC.js → chunk-4E5JXZ3W.js} +18 -20
  66. package/dist/cli/{chunk-R4RG4FV5.mjs → chunk-4KWD3MX2.mjs} +13 -10
  67. package/dist/cli/{chunk-SUWTLXCV.js → chunk-6BBGUQJJ.js} +67 -146
  68. package/dist/cli/{chunk-JBBJDFUJ.js → chunk-6VUGBQZQ.js} +5 -5
  69. package/dist/cli/{chunk-2P3NVX65.mjs → chunk-AB2GBOD4.mjs} +40 -27
  70. package/dist/cli/{chunk-62SOZ67Y.mjs → chunk-ANUKBZ6W.mjs} +475 -11
  71. package/dist/cli/{chunk-MG6YL4M7.mjs → chunk-BASLYGXK.mjs} +101 -77
  72. package/dist/cli/{chunk-SQWET4SL.js → chunk-BBTKAASQ.js} +2 -1
  73. package/dist/cli/{chunk-NRO3NTVO.js → chunk-CBV7AKWM.js} +5 -5
  74. package/dist/cli/{chunk-RH3YRMUY.js → chunk-CIDN5K23.js} +1 -1
  75. package/dist/cli/{chunk-QNHHZ63P.mjs → chunk-CQBIO6HW.mjs} +1 -1
  76. package/dist/cli/{chunk-2KHUFWTK.js → chunk-CQDQNZGH.js} +42 -37
  77. package/dist/cli/{chunk-UWNVFAFN.js → chunk-CWSLUNA6.js} +33 -33
  78. package/dist/cli/{chunk-5FXMEEF4.mjs → chunk-CXTW7SRW.mjs} +67 -146
  79. package/dist/cli/{chunk-O53LHONF.mjs → chunk-DA2I2M7D.mjs} +2 -2
  80. package/dist/cli/{chunk-EYXUAJAU.mjs → chunk-DQHUJMCL.mjs} +5 -5
  81. package/dist/cli/{chunk-7GFR5Y4J.mjs → chunk-DUYAMLOC.mjs} +1 -1
  82. package/dist/cli/{chunk-OMVVHX4U.mjs → chunk-E24UGPGG.mjs} +13 -15
  83. package/dist/cli/{chunk-STR5LXK4.mjs → chunk-FSIVF2SI.mjs} +1 -1
  84. package/dist/cli/{chunk-KJVY7V2X.mjs → chunk-GF32SBST.mjs} +1 -1
  85. package/dist/cli/{chunk-AK622KIG.mjs → chunk-GHLDCLSC.mjs} +1 -1
  86. package/dist/cli/{chunk-A6HNT4EE.js → chunk-GTVZKY3F.js} +2 -2
  87. package/dist/cli/{chunk-BXIUZM5N.mjs → chunk-HAJQGP5V.mjs} +2 -2
  88. package/dist/cli/{chunk-6CEUQYMB.js → chunk-HWDKRN7L.js} +3 -3
  89. package/dist/cli/{chunk-5YAJGRWB.js → chunk-IPVRMYWT.js} +7 -7
  90. package/dist/cli/{chunk-ZPGGW27Q.mjs → chunk-JL2OTMSG.mjs} +1 -0
  91. package/dist/cli/{chunk-WR4WETRU.mjs → chunk-JUHDJNSI.mjs} +4 -4
  92. package/dist/cli/{chunk-TQH3533L.mjs → chunk-KPQHUVYW.mjs} +5 -5
  93. package/dist/cli/{chunk-V7SCRUFQ.js → chunk-KWYGWO4Y.js} +9 -6
  94. package/dist/cli/{chunk-DZS4JC7I.js → chunk-LDGZFDUB.js} +2 -2
  95. package/dist/cli/{chunk-EGTUOYYG.js → chunk-LN6RXDTB.js} +523 -59
  96. package/dist/cli/{chunk-DQ5ADV2J.mjs → chunk-LZXZQPA2.mjs} +4 -1
  97. package/dist/cli/{chunk-MYSKWJMA.js → chunk-MSP4DTSD.js} +13 -13
  98. package/dist/cli/{chunk-BNH4Y35W.mjs → chunk-OLH2PHMC.mjs} +2 -2
  99. package/dist/cli/{chunk-NNAE7E23.mjs → chunk-OUDTOMZC.mjs} +7 -9
  100. package/dist/cli/{chunk-GESIFFQX.mjs → chunk-OVX3Q5Q3.mjs} +1 -1
  101. package/dist/cli/{chunk-ENCA6O2D.mjs → chunk-PNY3BWHP.mjs} +2 -2
  102. package/dist/cli/{chunk-KSA2XE4T.js → chunk-Q4MNUOS4.js} +316 -303
  103. package/dist/cli/{chunk-GTXSUPCJ.js → chunk-Q5CXV3E3.js} +2 -2
  104. package/dist/cli/{chunk-VAG5YKP6.mjs → chunk-RVSSQPQO.mjs} +1 -1
  105. package/dist/cli/{chunk-VE7ZPLN2.js → chunk-SLPJ3LXI.js} +22 -22
  106. package/dist/cli/{chunk-IX45S5VC.js → chunk-TX5TUHJN.js} +17 -19
  107. package/dist/cli/{chunk-IF75RD6U.js → chunk-U2LVWCTD.js} +18 -6
  108. package/dist/cli/{chunk-ZS2WHWWL.js → chunk-UNDLNT3V.js} +1 -1
  109. package/dist/cli/{chunk-NDFNBJGL.js → chunk-VBDZIMWD.js} +26 -26
  110. package/dist/cli/{chunk-GVGQ6NZW.js → chunk-W7AEIGZR.js} +41 -41
  111. package/dist/cli/{chunk-WDNRPZED.mjs → chunk-WC5M3JXE.mjs} +2 -2
  112. package/dist/cli/{chunk-C374C22Y.js → chunk-WOQO3GV4.js} +14 -11
  113. package/dist/cli/{chunk-MQX363YF.js → chunk-XBAH3TKU.js} +5 -5
  114. package/dist/cli/{chunk-BDWZBMGV.mjs → chunk-XJD2GYUP.mjs} +5 -5
  115. package/dist/cli/{chunk-XRZJKHUA.mjs → chunk-XVZRJJDS.mjs} +4 -4
  116. package/dist/cli/{chunk-TVINIDHB.js → chunk-Y2NTPYGS.js} +17 -17
  117. package/dist/cli/{chunk-6GTGWZJG.mjs → chunk-YBMHOH6H.mjs} +4 -4
  118. package/dist/cli/{chunk-TG2UB3A5.mjs → chunk-YRLAUGQY.mjs} +3 -3
  119. package/dist/cli/{chunk-FKD3KL5Q.mjs → chunk-Z2XA6YU4.mjs} +10 -5
  120. package/dist/cli/{chunk-KXQCUX3X.mjs → chunk-Z7UIOGW4.mjs} +3 -3
  121. package/dist/cli/{chunk-HCD36BP6.js → chunk-ZEV2Y56V.js} +44 -44
  122. package/dist/cli/{chunk-MI6ZP7XI.mjs → chunk-ZG7BOECV.mjs} +18 -6
  123. package/dist/cli/{chunk-XBK6WCVA.js → chunk-ZILSRDIN.js} +8 -8
  124. package/dist/cli/{chunk-B2AS3R5W.js → chunk-ZISEH7OL.js} +16 -16
  125. package/dist/cli/{chunk-HPJAE6PP.js → chunk-ZZ4MF2GI.js} +6 -6
  126. package/dist/cli/command-docs.js +2 -2
  127. package/dist/cli/command-docs.mjs +1 -1
  128. package/dist/cli/{csv-U3M2G76R.js → csv-2V2DIFNG.js} +15 -15
  129. package/dist/cli/{csv-4ID4E5W3.mjs → csv-P3HLK4GO.mjs} +6 -6
  130. package/dist/cli/{db-IHAQIKEQ.js → db-MREAQVW6.js} +36 -36
  131. package/dist/cli/{db-LHX5BBCZ.mjs → db-ZYOY3QRQ.mjs} +9 -9
  132. package/dist/cli/describe-IKZFOADR.mjs +49 -0
  133. package/dist/cli/describe-WW3OQRLP.js +49 -0
  134. package/dist/cli/describe-core.d.mts +3 -3
  135. package/dist/cli/describe-core.d.ts +3 -3
  136. package/dist/cli/describe-core.js +5 -5
  137. package/dist/cli/describe-core.mjs +4 -4
  138. package/dist/cli/{executions-CJ5LV23G.js → executions-H5IJ7QSQ.js} +11 -11
  139. package/dist/cli/{executions-UJ6JZUL5.mjs → executions-KTSY5M34.mjs} +9 -9
  140. package/dist/cli/{feedback-TGUBVGRP.js → feedback-724QK3Z5.js} +16 -16
  141. package/dist/cli/{feedback-YGTPJBRJ.mjs → feedback-WWJRIXEU.mjs} +8 -8
  142. package/dist/cli/git-PHYRD56H.js +25 -0
  143. package/dist/cli/{git-3DOTQHJO.mjs → git-R5VRG7X6.mjs} +7 -7
  144. package/dist/cli/index.js +151 -157
  145. package/dist/cli/index.mjs +51 -57
  146. package/dist/cli/{legacy-noops-BHEHVFHI.js → legacy-noops-C6GDEGPU.js} +11 -11
  147. package/dist/cli/{legacy-noops-RBBYRVLG.mjs → legacy-noops-PWZ5XLAO.mjs} +8 -8
  148. package/dist/cli/{monitors-XECKLAXA.js → monitors-VAVQ4WCE.js} +125 -122
  149. package/dist/cli/{monitors-5AJCG6IV.mjs → monitors-WQSKMHAP.mjs} +19 -16
  150. package/dist/cli/{org-DOBAIYWG.js → org-CWWRWXZQ.js} +89 -89
  151. package/dist/cli/{org-ZAAIEZKB.mjs → org-MAL4QPVF.mjs} +9 -9
  152. package/dist/cli/{play-KLYRMQPF.mjs → play-ILW6MSNG.mjs} +174 -80
  153. package/dist/cli/{play-E74VN6B7.js → play-WJOWK5PQ.js} +690 -596
  154. package/dist/cli/{providers-XTQXV5LB.mjs → providers-4V2NMLZZ.mjs} +9 -9
  155. package/dist/cli/{providers-APZ6SOSK.js → providers-W662ANCH.js} +12 -12
  156. package/dist/cli/{quickstart-S6WN6NWW.js → quickstart-BW6EBUYX.js} +8 -8
  157. package/dist/cli/{quickstart-X7RHHQCH.mjs → quickstart-C22BR743.mjs} +6 -6
  158. package/dist/cli/{run-3YLIJJ57.js → run-KW7KW4FX.js} +50 -53
  159. package/dist/cli/{run-TZPBBSPX.mjs → run-SPAU5IMW.mjs} +31 -34
  160. package/dist/cli/search-HLE54W5G.js +32 -0
  161. package/dist/cli/{search-VLHE2CMZ.mjs → search-XPC75HLM.mjs} +10 -11
  162. package/dist/cli/{search-output-73BYB7UE.mjs → search-output-JKYJSEPM.mjs} +6 -6
  163. package/dist/cli/{search-output-GCT7PQIT.js → search-output-VJYE7USJ.js} +8 -8
  164. package/dist/cli/{secrets-RLOTGKQZ.mjs → secrets-OJG73GXQ.mjs} +9 -9
  165. package/dist/cli/{secrets-J6CEKXKQ.js → secrets-YB57KGSB.js} +18 -18
  166. package/dist/cli/{sessions-7HZ7OZ62.mjs → sessions-7ZL37BW4.mjs} +8 -8
  167. package/dist/cli/sessions-VEBYZIEU.js +22 -0
  168. package/dist/cli/{settings-WRV5XEZC.js → settings-A7DD2ZYE.js} +88 -89
  169. package/dist/cli/{settings-72K5YCIS.mjs → settings-RKSQB7FA.mjs} +15 -16
  170. package/dist/cli/{setup-KQFY6WT4.mjs → setup-NXDUTITY.mjs} +11 -12
  171. package/dist/cli/{setup-QVXWT2EQ.js → setup-S3K5YU62.js} +51 -52
  172. package/dist/cli/skills-NVQ744CN.js +36 -0
  173. package/dist/cli/{skills-C3K3E473.mjs → skills-VMFAIDO6.mjs} +9 -10
  174. package/dist/cli/{tools-4A2OH6MB.mjs → tools-52NTHBSJ.mjs} +20 -21
  175. package/dist/cli/tools-SBDUL3WB.js +56 -0
  176. package/dist/cli/update-HHVFZPCV.js +34 -0
  177. package/dist/cli/{update-BS6USKPR.mjs → update-SAKBEKMV.mjs} +11 -12
  178. package/dist/cli/{views-WB6GFTRX.mjs → views-ACRV7MD6.mjs} +54 -10
  179. package/dist/cli/{views-4NZGAXHL.js → views-C3GJOBDG.js} +66 -22
  180. package/dist/cli/{workflow-2D4WX55R.mjs → workflow-CS22E7TC.mjs} +10 -10
  181. package/dist/cli/{workflow-L2QTQZYV.js → workflow-ZNWCZEGN.js} +20 -20
  182. package/dist/{client-DoUVSkqC.d.mts → client-BlLYQDNo.d.mts} +1 -1
  183. package/dist/{client-DQm56zMs.d.ts → client-DSQlkIDO.d.ts} +1 -1
  184. package/dist/{client-core-C7KkUIE_.d.ts → client-core-CDwapXy5.d.ts} +167 -108
  185. package/dist/{client-core-CPlwsC1Q.d.mts → client-core-rX7n2H8U.d.mts} +167 -108
  186. package/dist/{compiler-manifest-DsxsQP-T.d.mts → compiler-manifest-BHNC4RL-.d.mts} +58 -21
  187. package/dist/{compiler-manifest-DsxsQP-T.d.ts → compiler-manifest-BHNC4RL-.d.ts} +58 -21
  188. package/dist/{errors-qdJUVQ3g.d.mts → errors-D7sPXrvB.d.mts} +1 -1
  189. package/dist/{errors-Bk5h1D-C.d.ts → errors-lhtIWG5Z.d.ts} +1 -1
  190. package/dist/{index-bL66eHYz.d.ts → index-CQTBHXHr.d.ts} +1 -1
  191. package/dist/{index-PaupwX1B.d.mts → index-NaDZq2xf.d.mts} +1 -1
  192. package/dist/index.d.mts +7 -7
  193. package/dist/index.d.ts +7 -7
  194. package/dist/index.js +15 -15
  195. package/dist/index.mjs +11 -11
  196. package/dist/install-integrity.json +131 -132
  197. package/dist/monitor-fleet-contract.d.mts +17 -11
  198. package/dist/monitor-fleet-contract.d.ts +17 -11
  199. package/dist/monitor-fleet-contract.js +3 -3
  200. package/dist/monitor-fleet-contract.mjs +2 -2
  201. package/dist/monitor-input-contract.js +2 -2
  202. package/dist/monitor-input-contract.mjs +1 -1
  203. package/dist/plays/bundle-play-file.d.mts +3 -3
  204. package/dist/plays/bundle-play-file.d.ts +3 -3
  205. package/dist/plays/bundle-play-file.mjs +67 -3
  206. package/dist/plays/csv-data-input.js +3 -3
  207. package/dist/plays/csv-data-input.mjs +2 -2
  208. package/dist/plays/play-description.d.mts +2 -2
  209. package/dist/plays/play-description.d.ts +2 -2
  210. package/dist/plays/run-request.d.mts +2 -2
  211. package/dist/plays/run-request.d.ts +2 -2
  212. package/dist/plays/run-request.js +3 -3
  213. package/dist/plays/run-request.mjs +2 -2
  214. package/dist/release.d.mts +1 -1
  215. package/dist/release.d.ts +1 -1
  216. package/dist/release.js +2 -2
  217. package/dist/release.mjs +1 -1
  218. package/dist/server.d.mts +4 -4
  219. package/dist/server.d.ts +4 -4
  220. package/dist/server.js +12 -12
  221. package/dist/server.mjs +6 -6
  222. package/package.json +1 -1
  223. package/dist/cli/auth-UP2RGPI6.js +0 -43
  224. package/dist/cli/chunk-5LZ5VSOK.mjs +0 -405
  225. package/dist/cli/chunk-D3J2Y2BP.js +0 -405
  226. package/dist/cli/describe-CI4MREFF.mjs +0 -50
  227. package/dist/cli/describe-IVTSD7ST.js +0 -50
  228. package/dist/cli/git-R3W25XIF.js +0 -25
  229. package/dist/cli/pages-FUOSF6BE.mjs +0 -266
  230. package/dist/cli/pages-TLC2N6L7.js +0 -266
  231. package/dist/cli/search-NB5CBALV.js +0 -33
  232. package/dist/cli/sessions-SFCZSB77.js +0 -22
  233. package/dist/cli/skills-WIJEHVLA.js +0 -37
  234. package/dist/cli/tools-VMMERMLO.js +0 -57
  235. package/dist/cli/update-54WZQDTS.js +0 -35
@@ -1512,7 +1512,8 @@ export interface PlayRuntimeLimit {
1512
1512
  export type PrebuiltPlayObservedCost =
1513
1513
  | {
1514
1514
  status: 'available';
1515
- unit: 'row' | 'run';
1515
+ /** `result`: per row of the dataset the Play returns. */
1516
+ unit: 'result' | 'row' | 'run';
1516
1517
  avgCredits: number;
1517
1518
  maxCredits: number;
1518
1519
  /** Null until enough runs exist for a median to mean something. */
@@ -1685,17 +1686,6 @@ export type PlayCostEstimate =
1685
1686
  sampleRunCount: number;
1686
1687
  basedOnRunId: string | null;
1687
1688
  modelVersion: string;
1688
- compute?: {
1689
- scope: 'sandbox_session';
1690
- maximumCredits: number;
1691
- maximumBillingSeconds: number;
1692
- maximumBackend: 'daytona' | 'modal';
1693
- pricedBackends: Array<'daytona' | 'modal'>;
1694
- totalPlayCredits: null;
1695
- totalPlayCreditsSupported: false;
1696
- actualUsageBased: true;
1697
- totalSandboxSessions: 'unbounded';
1698
- };
1699
1689
  }
1700
1690
  | {
1701
1691
  status: 'unavailable';
@@ -1707,17 +1697,6 @@ export type PlayCostEstimate =
1707
1697
  | 'mixed_run_and_row_costs';
1708
1698
  message: string;
1709
1699
  modelVersion: string;
1710
- compute?: {
1711
- scope: 'sandbox_session';
1712
- maximumCredits: number;
1713
- maximumBillingSeconds: number;
1714
- maximumBackend: 'daytona' | 'modal';
1715
- pricedBackends: Array<'daytona' | 'modal'>;
1716
- totalPlayCredits: null;
1717
- totalPlayCreditsSupported: false;
1718
- actualUsageBased: true;
1719
- totalSandboxSessions: 'unbounded';
1720
- };
1721
1700
  };
1722
1701
 
1723
1702
  export interface PlayListItem {
@@ -8,9 +8,21 @@ import {
8
8
  * Monitor transaction admission reuses this ceiling; it must never drift
9
9
  * from the limit admitted when a customer authors a Fleet.
10
10
  */
11
- export const MONITOR_FLEET_MAX_MEMBERS = 1_000;
11
+ // 20,000 is the first step up from 1,000. The whole Fleet lifecycle is proven
12
+ // on the fake TamRadar at 5,000 and 10,000, and deploy, re-plan, the global
13
+ // audit and teardown at 100,000 (docs/plans/2026-10-22-monitor-load-testing.md,
14
+ // Stage 10); the full 100,000 run gates the next raise.
15
+ export const MONITOR_FLEET_MAX_MEMBERS = 20_000;
12
16
 
13
- export const MONITOR_FLEET_FRONTIER_MAX_ROWS = 10_000;
17
+ /**
18
+ * Source rows one plan may evaluate. Every row the planner reads is an
19
+ * eligible candidate (the source's `where` is applied in SQL), so a plan reads
20
+ * at most `selection.limit` rows; the frontier only has to admit the ceiling.
21
+ */
22
+ export const MONITOR_FLEET_FRONTIER_MAX_ROWS = Math.max(
23
+ 10_000,
24
+ MONITOR_FLEET_MAX_MEMBERS,
25
+ );
14
26
  /**
15
27
  * Fleet definitions are admitted once and executed many times. Keep the
16
28
  * edition beside the definition just as Plays keep their authoring-contract
@@ -29,7 +41,7 @@ export const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG = [
29
41
  {
30
42
  edition: 1,
31
43
  changed:
32
- 'Initial Fleet JSON contract: bounded sticky table membership, source refresh, and a seven-day removal grace.',
44
+ 'Initial Fleet JSON contract: bounded sticky table membership, source refresh, and a seven-day removal grace. The grace was retired for every edition on 2026-11-13: a member whose row is gone is removed by the next plan (see the fixed policy).',
33
45
  compatibilityOwner: 'Monitors Runtime',
34
46
  newWritesEnd: null,
35
47
  readerRemoval: null,
@@ -44,12 +56,13 @@ export const MONITOR_FLEET_AUTHORING_CONTRACT_CHANGELOG = [
44
56
  },
45
57
  ] as const;
46
58
  /**
47
- * Fleets are deliberately opinionated in beta: a member absent from the
48
- * source remains intact for seven days, then its ordinary monitor is
49
- * deactivated. This prevents transient source refreshes from deleting a
50
- * provider resource while keeping the customer contract small.
59
+ * A member whose row the source no longer returns is deactivated by the next
60
+ * plan; there is no removal grace. Fleets used to keep such a member for seven
61
+ * days. The export stays, at zero, so code that imports it keeps compiling.
62
+ *
63
+ * @deprecated There is no removal grace; this is always 0.
51
64
  */
52
- export const MONITOR_FLEET_REMOVAL_GRACE_MS = 7 * 24 * 60 * 60_000;
65
+ export const MONITOR_FLEET_REMOVAL_GRACE_MS = 0;
53
66
 
54
67
  /**
55
68
  * Public, machine-readable guidance for every Monitor Fleet authoring
@@ -65,13 +78,12 @@ export const MONITOR_FLEET_DOCUMENTATION = {
65
78
  'Customer DB table, unique row key, and optional equality filters that select candidate rows.',
66
79
  monitor:
67
80
  'One Batch-compatible MonitorSpec. Direct Handlebars source-row fields such as {{domain}} are rendered for each selected row.',
68
- selection:
69
- 'Deterministic ranking and an active-member limit between 1 and 1,000.',
81
+ selection: `Deterministic ranking and an active-member limit between 1 and ${MONITOR_FLEET_MAX_MEMBERS.toLocaleString('en-US')}.`,
70
82
  },
71
83
  fixedPolicy: {
72
- cadence: '60s fair bounded source refresh',
84
+ cadence: '15m fair bounded source refresh',
73
85
  membership: 'sticky',
74
- removalGrace: '7d',
86
+ removalGrace: 'none',
75
87
  onRemoved: 'deactivate',
76
88
  ownership:
77
89
  'A Fleet may adopt a same-tool ordinary monitor with its deterministic member key. The first Fleet claim wins; another Fleet or a different tool receives a conflict.',
@@ -445,7 +457,7 @@ function validateMonitorFleetDefinitionV1(value: unknown): {
445
457
  issues.push({
446
458
  path: 'selection.limit',
447
459
  code: 'MONITOR_FLEET_LIMIT_EXCEEDED',
448
- message: 'selection.limit must be between 1 and 1,000.',
460
+ message: `selection.limit must be between 1 and ${MONITOR_FLEET_MAX_MEMBERS.toLocaleString('en-US')}.`,
449
461
  });
450
462
  }
451
463
  if (selection?.membership !== 'sticky') {
@@ -507,7 +519,7 @@ function validateMonitorFleetDefinitionV1(value: unknown): {
507
519
  code: 'unsupported_fleet_option',
508
520
  message:
509
521
  `${removedOption} is fixed by Monitor Fleets and must be omitted. ` +
510
- `Fleets sync ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.cadence} and ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.onRemoved} members after ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.removalGrace} absent from the source.`,
522
+ `Fleets sync on a ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.cadence} and ${MONITOR_FLEET_DOCUMENTATION.fixedPolicy.onRemoved} a member as soon as the source no longer returns its row.`,
511
523
  });
512
524
  }
513
525
  }
@@ -101,8 +101,7 @@ function monitorSpec(
101
101
  code: 'PLAY_BINDING_NOT_IN_MONITOR_SPEC',
102
102
  path: authoredMonitorFieldPath(path, 'play'),
103
103
  message: 'A monitor does not own Play bindings.',
104
- suggestion:
105
- 'Declare sqlListeners in the Play.',
104
+ suggestion: 'Declare sqlListeners in the Play.',
106
105
  });
107
106
  continue;
108
107
  }
@@ -401,15 +400,38 @@ export function lintMonitorSpecTemplate(
401
400
  : { normalized: normalized!, issues: ordered };
402
401
  }
403
402
 
403
+ /**
404
+ * Compiled templates by source. A Fleet renders the same few templates once
405
+ * per row, and compiling each one again for every row was most of a
406
+ * 100,000-member sync's 34 s `desired` phase. Cleared, not evicted, past the
407
+ * bound: one process renders many Fleets' templates over its life.
408
+ */
409
+ const COMPILED_TEMPLATES = new Map<
410
+ string,
411
+ ReturnType<typeof Handlebars.compile>
412
+ >();
413
+ const COMPILED_TEMPLATES_MAX = 1_000;
414
+
415
+ function compiledTemplate(source: string) {
416
+ const cached = COMPILED_TEMPLATES.get(source);
417
+ if (cached) return cached;
418
+ if (COMPILED_TEMPLATES.size >= COMPILED_TEMPLATES_MAX) {
419
+ COMPILED_TEMPLATES.clear();
420
+ }
421
+ const compiled = Handlebars.compile(source, {
422
+ noEscape: true,
423
+ strict: true,
424
+ knownHelpersOnly: true,
425
+ preventIndent: true,
426
+ });
427
+ COMPILED_TEMPLATES.set(source, compiled);
428
+ return compiled;
429
+ }
430
+
404
431
  function renderValue(value: unknown, row: Record<string, unknown>): unknown {
405
432
  if (typeof value === 'string' && value.includes('{{')) {
406
433
  const context = Object.assign(Object.create(null), row);
407
- return Handlebars.compile(value, {
408
- noEscape: true,
409
- strict: true,
410
- knownHelpersOnly: true,
411
- preventIndent: true,
412
- })(context, {
434
+ return compiledTemplate(value)(context, {
413
435
  allowProtoMethodsByDefault: false,
414
436
  allowProtoPropertiesByDefault: false,
415
437
  helpers: Object.create(null),
@@ -428,6 +450,9 @@ export function renderMonitorSpecTemplate(
428
450
  template: MonitorSpec,
429
451
  row: Record<string, unknown>,
430
452
  ): { spec?: MonitorSpec; issues: MonitorInputIssue[] } {
453
+ // Linted on every call: the template is a caller's object, and a caller
454
+ // may change it between renders. Compiling is what cost, and that is kept
455
+ // by source text above.
431
456
  const lint = lintMonitorSpecTemplate(template);
432
457
  if (!lint.normalized) return { issues: lint.issues };
433
458
  try {
@@ -0,0 +1,121 @@
1
+ /**
2
+ * The Slack alert for a Monitor Fleet whose member counts drifted.
3
+ *
4
+ * A drift is a bug, never an expected state: every member movement is
5
+ * journalled by the one transition writer, so a counter that disagrees with
6
+ * the members means a movement was lost or applied twice. The alert says so
7
+ * loudly and carries everything an agent needs to start on it without asking.
8
+ */
9
+
10
+ export type FleetCountsByBucket = Record<string, number>;
11
+
12
+ export type FleetCountDriftAlertInput = {
13
+ stage: 'detected' | 'repaired';
14
+ environment: string;
15
+ convexDeployment: string | null;
16
+ orgId: string;
17
+ fleetId: string;
18
+ trigger: string;
19
+ startedAt: number;
20
+ fleetStatus: string;
21
+ generation: number;
22
+ observed: FleetCountsByBucket;
23
+ repaired?: FleetCountsByBucket;
24
+ detail?: Record<string, unknown>;
25
+ pages?: number;
26
+ durationMs?: number;
27
+ };
28
+
29
+ const FIRE = '🔥🔥🔥';
30
+
31
+ const TRIGGER_MEANING: Record<string, string> = {
32
+ underflow:
33
+ 'applying a page of journalled movements would have taken a bucket below zero (a movement was lost, or one was applied twice)',
34
+ bucket_mismatch:
35
+ 'with no journal rows left to fold, the counter said a bucket was occupied while no member sat in it, or the reverse (an over-count that never goes negative, or an under-count)',
36
+ };
37
+
38
+ function json(value: unknown): string {
39
+ return JSON.stringify(value ?? null);
40
+ }
41
+
42
+ function bucketDiff(
43
+ observed: FleetCountsByBucket,
44
+ repaired: FleetCountsByBucket,
45
+ ): string {
46
+ const buckets = [
47
+ ...new Set([...Object.keys(observed), ...Object.keys(repaired)]),
48
+ ];
49
+ const changed = buckets.filter(
50
+ (bucket) => (observed[bucket] ?? 0) !== (repaired[bucket] ?? 0),
51
+ );
52
+ if (changed.length === 0) return 'no bucket changed';
53
+ return changed
54
+ .map(
55
+ (bucket) =>
56
+ `${bucket} ${observed[bucket] ?? 0} -> ${repaired[bucket] ?? 0}`,
57
+ )
58
+ .join(', ');
59
+ }
60
+
61
+ /**
62
+ * The paragraph to paste into an agent: what happened, where the code is,
63
+ * and where the evidence is.
64
+ */
65
+ export function fleetCountDriftAgentBrief(
66
+ input: FleetCountDriftAlertInput,
67
+ ): string {
68
+ const at = new Date(input.startedAt).toISOString();
69
+ const windowStart = new Date(input.startedAt - 60 * 60_000).toISOString();
70
+ const lines = [
71
+ `Monitor Fleet count drift in ${input.environment}${input.convexDeployment ? ` (Convex ${input.convexDeployment})` : ''}: org ${input.orgId}, fleet ${input.fleetId}, generation ${input.generation}, status ${input.fleetStatus}, detected ${at}.`,
72
+ `Trigger "${input.trigger}": ${TRIGGER_MEANING[input.trigger] ?? 'see the trigger name'}.`,
73
+ `Counter when detected: ${json(input.observed)}.${input.detail ? ` Context: ${json(input.detail)}.` : ''}`,
74
+ ...(input.repaired
75
+ ? [
76
+ `Exact recount from the member rows: ${json(input.repaired)} (${bucketDiff(input.observed, input.repaired)}), ${input.pages ?? '?'} pages in ${Math.round((input.durationMs ?? 0) / 1000)} s. The counter is correct again; the bug that drifted it is not fixed.`,
77
+ ]
78
+ : [
79
+ 'The fleet is paused (monitorFleets.countsAudit): no claim, commit or repair moves its members until runFleetCountsAudit has recounted them and published the exact numbers. A second alert reports the repair.',
80
+ ]),
81
+ 'How the counter works: applyMonitorTransition in packages/convex/providerMonitorFleets.ts is the only writer of a member\'s convergence field and journals each bucket movement to providerMonitorCounterDeltas (family "fleet_counts", counterKey = fleet id); drainFleetCounts folds those rows into monitorFleetCounts. Find the transition or fold that lost or doubled a movement.',
82
+ `Evidence to pull: Convex logs for org ${input.orgId} from ${windowStart} to ${at} (Axiom dataset "convex", function paths providerMonitorFleets:*, console lines "[monitor-fleets]" and "[provider-monitor-counters]"), and the fleet row: npx convex run providerMonitorFleets:getFleetV2 '${json({ orgId: input.orgId, fleetId: input.fleetId })}'. Suspects: a fold racing the drain (the deployed-ABI foldFleetCounts from an older revision), a transition patched outside applyMonitorTransition, or rows crossing a rolling deploy.`,
83
+ ];
84
+ return lines.join('\n');
85
+ }
86
+
87
+ /** Fields for `buildSlackActivityPayload`; the brief rides as one field. */
88
+ export function fleetCountDriftAlert(input: FleetCountDriftAlertInput): {
89
+ activityTitle: string;
90
+ activityPrimary: string;
91
+ fallbackText: string;
92
+ fields: Array<{ label: string; value: string | number | null }>;
93
+ } {
94
+ const headline =
95
+ input.stage === 'detected'
96
+ ? `${FIRE} BUG CAUGHT: Monitor Fleet counts drifted ${FIRE}`
97
+ : `${FIRE} Fleet count drift repaired - the bug behind it still needs a fix ${FIRE}`;
98
+ const primary = `${input.fleetId} | ${input.trigger} | ${input.environment}`;
99
+ return {
100
+ activityTitle: headline,
101
+ activityPrimary: primary,
102
+ fallbackText: `${headline} ${primary} | org ${input.orgId}`,
103
+ fields: [
104
+ { label: 'Stage', value: input.stage },
105
+ { label: 'Environment', value: input.environment },
106
+ { label: 'Convex deployment', value: input.convexDeployment },
107
+ { label: 'Org ID', value: input.orgId },
108
+ { label: 'Fleet', value: input.fleetId },
109
+ { label: 'Trigger', value: input.trigger },
110
+ { label: 'Fleet status', value: input.fleetStatus },
111
+ { label: 'Generation', value: input.generation },
112
+ { label: 'Detected at', value: new Date(input.startedAt).toISOString() },
113
+ { label: 'Counter seen', value: json(input.observed) },
114
+ {
115
+ label: 'Exact recount',
116
+ value: input.repaired ? json(input.repaired) : 'pending (fleet paused)',
117
+ },
118
+ { label: 'Agent brief', value: fleetCountDriftAgentBrief(input) },
119
+ ],
120
+ };
121
+ }
@@ -24,6 +24,14 @@ export const FLEET_REFUSAL = {
24
24
  resourceBindingConflict: 'provider.resource_binding_conflict',
25
25
  } as const;
26
26
  export const MAX_MEMBER_DEFINITION_BYTES = 2_048;
27
+ /**
28
+ * The largest plan published in ONE Convex transaction (`commitPlan`). It is
29
+ * the size that transaction was built and ceiling-tested for; a larger plan is
30
+ * staged in chunks of STAGED_COMMIT_CHUNK_MEMBERS.
31
+ */
32
+ export const SINGLE_COMMIT_MAX_MEMBERS = 1_000;
33
+ /** Members one staged-commit chunk carries; see `commitStagedChunk`. */
34
+ export const STAGED_COMMIT_CHUNK_MEMBERS = 250;
27
35
  export const MAX_FLEET_SETTLE_ITEMS = 100;
28
36
  /**
29
37
  * How long a convergence claim leases its members. The create path posts
@@ -11,19 +11,13 @@
11
11
  * verbatim. Planning decides; the commit publishes.
12
12
  */
13
13
 
14
- import { MONITOR_FLEET_REMOVAL_GRACE_MS } from '../../integration-contracts/monitor-fleet-contract';
15
14
  import { FLEET_BLOCKED_BY } from './limits';
16
15
  export { FLEET_BLOCKED_BY } from './limits';
17
16
 
18
17
  // Rollout access is checked by convergence immediately before provider work,
19
18
  // not by this pure planner: an admitted plan can outlive rollout access.
20
19
 
21
- export type FleetMemberAction =
22
- | 'create'
23
- | 'update'
24
- | 'remove'
25
- | 'blocked'
26
- | 'grace';
20
+ export type FleetMemberAction = 'create' | 'update' | 'remove' | 'blocked';
27
21
 
28
22
  /** One monitor the fleet wants, fully resolved from its source row. */
29
23
  export type DesiredFleetMember = {
@@ -90,52 +84,21 @@ export type FleetPlan = {
90
84
 
91
85
  export type FleetMembershipMember = {
92
86
  sourceKey: string;
93
- firstMissingAt: number | null;
94
87
  };
95
88
 
96
89
  export type FleetMembershipDecision = {
97
90
  /** Source keys the fleet holds after this plan, in selection order. */
98
91
  selected: string[];
99
- /** Slots held by members whose grace has not expired. */
100
- reservedGraceSlots: number;
101
- /** Members whose row vanished on this plan. Grace starts now. */
102
- markMissing: string[];
103
- /** Members whose grace has expired and are now removed. */
92
+ /** Members whose row the source no longer returns; removed by this plan. */
104
93
  remove: string[];
105
94
  };
106
95
 
107
- /**
108
- * Slots held by members whose source row has vanished but whose removal grace
109
- * has not expired.
110
- *
111
- * Such a member is still a member: it keeps its monitor, and grace exists so a
112
- * row that comes back is restored rather than recreated. Handing its vacancy
113
- * to the next ranked candidate immediately would push the fleet past its own
114
- * limit, and then the reappearance grace is designed to absorb would force an
115
- * eviction to get back under it - exactly the churn stickiness promises not to
116
- * cause. Reserve the slot until grace actually expires.
117
- */
118
- export function countReservedRemovalGraceSlots(input: {
119
- members: readonly FleetMembershipMember[];
120
- selectedSourceKeys: ReadonlySet<string>;
121
- now: number;
122
- }): number {
123
- return input.members.filter((member) => {
124
- if (input.selectedSourceKeys.has(member.sourceKey)) return false;
125
- // Not yet marked missing means this plan is the one that starts grace.
126
- return (
127
- member.firstMissingAt === null ||
128
- input.now - member.firstMissingAt < MONITOR_FLEET_REMOVAL_GRACE_MS
129
- );
130
- }).length;
131
- }
132
-
133
96
  /**
134
97
  * Who the fleet holds after a plan, given what the source still returns.
135
98
  *
136
- * The whole sticky/grace/limit rule in one place: an active member keeps its
137
- * slot while its row exists, a vanished member keeps its slot until grace
138
- * expires, and ranking only ever fills what is genuinely free.
99
+ * An active member keeps its slot while its row exists, ranking only ever
100
+ * fills what is free, and a member whose row the source no longer returns is
101
+ * removed by this plan.
139
102
  */
140
103
  export function decideFleetMembership(input: {
141
104
  limit: number;
@@ -144,7 +107,6 @@ export function decideFleetMembership(input: {
144
107
  presentSourceKeys: ReadonlySet<string>;
145
108
  /** Ranked non-member candidates, best first. */
146
109
  candidates: readonly string[];
147
- now: number;
148
110
  }): FleetMembershipDecision {
149
111
  const selected: string[] = [];
150
112
  const selectedKeys = new Set<string>();
@@ -156,31 +118,16 @@ export function decideFleetMembership(input: {
156
118
  selected.push(member.sourceKey);
157
119
  selectedKeys.add(member.sourceKey);
158
120
  }
159
- const reservedGraceSlots = countReservedRemovalGraceSlots({
160
- members: input.members,
161
- selectedSourceKeys: selectedKeys,
162
- now: input.now,
163
- });
164
121
  for (const candidate of input.candidates) {
165
- if (selected.length + reservedGraceSlots >= input.limit) break;
122
+ if (selected.length >= input.limit) break;
166
123
  if (selectedKeys.has(candidate)) continue;
167
124
  selected.push(candidate);
168
125
  selectedKeys.add(candidate);
169
126
  }
170
- const markMissing: string[] = [];
171
- const remove: string[] = [];
172
- for (const member of input.members) {
173
- if (selectedKeys.has(member.sourceKey)) continue;
174
- if (member.firstMissingAt === null) {
175
- markMissing.push(member.sourceKey);
176
- continue;
177
- }
178
- if (input.now - member.firstMissingAt < MONITOR_FLEET_REMOVAL_GRACE_MS) {
179
- continue;
180
- }
181
- remove.push(member.sourceKey);
182
- }
183
- return { selected, reservedGraceSlots, markMissing, remove };
127
+ const remove = input.members
128
+ .filter((member) => !selectedKeys.has(member.sourceKey))
129
+ .map((member) => member.sourceKey);
130
+ return { selected, remove };
184
131
  }
185
132
 
186
133
  /** The account a monitor is counted against. Never null, so nothing is uncounted. */
@@ -210,10 +157,8 @@ export type FleetEntitlements = {
210
157
  export function planFleetMembers(input: {
211
158
  desired: readonly DesiredFleetMember[];
212
159
  owned: readonly OwnedFleetMonitor[];
213
- /** Source keys whose grace expired, from `decideFleetMembership`. */
160
+ /** Source keys no longer selected, from `decideFleetMembership`. */
214
161
  remove: readonly string[];
215
- /** Source keys whose row vanished on this plan. */
216
- markMissing: readonly string[];
217
162
  entitlements: FleetEntitlements;
218
163
  /**
219
164
  * Monitors already counted against an account, org-wide. An account absent
@@ -276,10 +221,9 @@ export function planFleetMembers(input: {
276
221
  owned?.convergence === 'settled' &&
277
222
  owned.firstMissingAt === null;
278
223
  if (settledOnDesired) continue;
279
- // A member whose row came back inside its grace window is restored by
280
- // re-publishing the state it already holds. That clears the removal
281
- // clock through the same guarded transition every other change uses,
282
- // rather than needing a second write path that could disagree with it.
224
+ // A member an older revision marked missing (the removal grace, since
225
+ // removed) is still re-published, which clears that mark through the
226
+ // same guarded transition every other change uses.
283
227
  members.push({ ...base, action: 'update', needsSeed: false });
284
228
  updates += 1;
285
229
  // A failed update keeps its applied hash, so it is retried as an update.
@@ -313,18 +257,6 @@ export function planFleetMembers(input: {
313
257
  }
314
258
 
315
259
  const plannedKeys = new Set(members.map((member) => member.monitorKey));
316
- for (const sourceKey of input.markMissing) {
317
- const owned = ownedBySource.get(sourceKey);
318
- if (!owned || plannedKeys.has(owned.monitorKey)) continue;
319
- members.push({
320
- monitorKey: owned.monitorKey,
321
- sourceKey,
322
- ...(owned.entityKey ? { entityKey: owned.entityKey } : {}),
323
- action: 'grace',
324
- needsSeed: false,
325
- });
326
- plannedKeys.add(owned.monitorKey);
327
- }
328
260
  for (const sourceKey of input.remove) {
329
261
  const owned = ownedBySource.get(sourceKey);
330
262
  if (!owned || plannedKeys.has(owned.monitorKey)) continue;
@@ -5,6 +5,7 @@
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./fleets/limits": "./fleets/limits.ts",
8
+ "./fleets/count-drift-alert": "./fleets/count-drift-alert.ts",
8
9
  "./analytics-install-guides": "./analytics-install-guides.ts",
9
10
  "./analytics-install-guides.js": "./analytics-install-guides.ts",
10
11
  "./analytics-public": "./analytics-public.ts",
@@ -259,7 +259,7 @@
259
259
  "id": "github.eval-agent-cli-matrix",
260
260
  "name": "Eval Agent CLI Matrix",
261
261
  "scheduler": "github_actions",
262
- "cadence": "0 7 * * *; 0 22 * * 4; 0 3 * * 1,3,5",
262
+ "cadence": "0 7 * * *; 0 3 * * 1,3,5",
263
263
  "timezone": "America/New_York",
264
264
  "source": ".github/workflows/eval-agent-cli-matrix.yml",
265
265
  "locator": "schedule:",
@@ -1442,9 +1442,9 @@
1442
1442
  "locator": "publish shadow tool rates",
1443
1443
  "owner": "integrations",
1444
1444
  "criticality": "operational",
1445
- "purpose": "Apply bounded workspace tool-rate ingress and due changes to the shadow snapshot for parity verification.",
1446
- "successDefinition": "The leased pass applies all currently due ingress and changes.",
1447
- "failureDefinition": "A publication batch fails or the bounded pass leaves due work for the next invocation.",
1445
+ "purpose": "Publish completed workspace/tool/day buckets into weighted 28-day shadow tool rates.",
1446
+ "successDefinition": "The leased run publishes completed buckets within its budget and saves its scan position. Incomplete workspaces are counted and revisited on the next scan.",
1447
+ "failureDefinition": "A publication read or write fails. A successful bounded run can leave work for the next invocation.",
1448
1448
  "startGraceMs": 120000,
1449
1449
  "runTimeoutMs": 180000,
1450
1450
  "failureAlert": "convex_action_wrapper",
@@ -4,7 +4,6 @@ import {
4
4
  GetObjectCommand,
5
5
  HeadObjectCommand,
6
6
  DeleteObjectCommand,
7
- ListObjectsV2Command,
8
7
  } from '@aws-sdk/client-s3';
9
8
  import { createHash } from 'node:crypto';
10
9
  import { NodeHttpHandler } from '@smithy/node-http-handler';
@@ -281,31 +280,6 @@ export async function getBufferFromR2(
281
280
  return Buffer.from(bytes);
282
281
  }
283
282
 
284
- /** Every key under a prefix, across as many listing pages as it takes. */
285
- export async function listR2Keys(
286
- prefix: string,
287
- kind: R2BucketKind = 'default',
288
- ): Promise<string[]> {
289
- const config = getR2Config(kind);
290
- const client = getR2Client(config);
291
- const keys: string[] = [];
292
- let continuationToken: string | undefined;
293
- do {
294
- const response = await client.send(
295
- new ListObjectsV2Command({
296
- Bucket: config.bucket,
297
- Prefix: prefix,
298
- ContinuationToken: continuationToken,
299
- }),
300
- );
301
- for (const object of response.Contents ?? []) {
302
- if (object.Key) keys.push(object.Key);
303
- }
304
- continuationToken = response.NextContinuationToken;
305
- } while (continuationToken);
306
- return keys;
307
- }
308
-
309
283
  /**
310
284
  * Delete one immutable runtime object. Callers must retain their own durable
311
285
  * deletion intent and confirm absence with HEAD before they acknowledge this
@@ -3,6 +3,11 @@ import { RUN_EVENT_KIND } from './run-event-catalog';
3
3
  /** One current activity across bounded platform-recovery attempts. */
4
4
  export const PLATFORM_RECOVERY_ACTIVITY_ID = 'run:platform-recovery';
5
5
  export const CANCELLATION_CLEANUP_ACTIVITY_ID = 'run:cancellation-cleanup';
6
+ /**
7
+ * One current activity while a run waits because its workspace already runs
8
+ * as many Plays at once as its plan allows (the live-sandbox cap).
9
+ */
10
+ export const SANDBOX_CAPACITY_ACTIVITY_ID = 'run:sandbox-capacity';
6
11
  /**
7
12
  * Canonical, producer-facing description of what a play is doing.
8
13
  *
@@ -42,6 +47,11 @@ export type PlayActivityTarget =
42
47
  kind: 'capacity';
43
48
  pool: 'worker' | 'provider' | 'dataset' | 'runner';
44
49
  label?: string;
50
+ /**
51
+ * The concurrent-run limit the workspace reached. Optional: absent on
52
+ * observations written before it existed and on other capacity pools.
53
+ */
54
+ limit?: number;
45
55
  };
46
56
 
47
57
  export type PlayActivityProgress = {
@@ -308,6 +318,27 @@ function publicProviderCapacityObservation(
308
318
  };
309
319
  }
310
320
 
321
+ /** The concurrent-run limit an observation carries, when it has one. */
322
+ export function sandboxCapacityLimit(
323
+ target: PlayActivityTarget,
324
+ ): number | null {
325
+ return target.kind === 'capacity' &&
326
+ typeof target.limit === 'number' &&
327
+ Number.isSafeInteger(target.limit) &&
328
+ target.limit > 0
329
+ ? target.limit
330
+ : null;
331
+ }
332
+
333
+ function sandboxCapacitySummary(target: PlayActivityTarget): string {
334
+ const limit = sandboxCapacityLimit(target);
335
+ const running =
336
+ limit === null
337
+ ? 'as many Play runs at once as its plan allows'
338
+ : `${limit.toLocaleString('en-US')} Play ${limit === 1 ? 'run' : 'runs'} at once, the most its plan allows`;
339
+ return `Queued: this workspace is running ${running}. This run starts when one finishes; upgrade the plan to run more at once.`;
340
+ }
341
+
311
342
  export function summarizePlayActivity(
312
343
  observation: PlayActivityObservation,
313
344
  ): string {
@@ -318,6 +349,11 @@ export function summarizePlayActivity(
318
349
  state.kind === 'active'
319
350
  )
320
351
  return 'Cancelling Play: waiting for cleanup to finish.';
352
+ if (
353
+ observation.activityId === SANDBOX_CAPACITY_ACTIVITY_ID &&
354
+ state.kind === 'queued'
355
+ )
356
+ return sandboxCapacitySummary(observation.target);
321
357
  switch (state.kind) {
322
358
  case 'active': {
323
359
  const progress = state.progress;