deepline 0.3.475 → 0.3.476

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 (154) hide show
  1. package/dist/bundling-sources/sdk/src/play.ts +2 -2
  2. package/dist/bundling-sources/sdk/src/release.ts +3 -3
  3. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +19 -6
  4. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +4 -4
  5. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +24 -1
  6. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +21 -4
  7. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +12 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +8 -6
  9. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +104 -6
  10. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +1 -1
  11. package/dist/cli/auth-2ZY57Q7W.js +41 -0
  12. package/dist/cli/{auth-CFDYJ7FZ.mjs → auth-A22724UX.mjs} +5 -5
  13. package/dist/cli/{billing-PEXWWLRT.mjs → billing-IIBEZ6J7.mjs} +6 -6
  14. package/dist/cli/{billing-XLIL3FLK.js → billing-T5Q6OO6M.js} +79 -79
  15. package/dist/cli/{chunk-NHQP4UPJ.mjs → chunk-2WEPQSA2.mjs} +5 -5
  16. package/dist/cli/{chunk-D6SXN34W.mjs → chunk-2YHDNHRR.mjs} +4 -4
  17. package/dist/cli/{chunk-V4ILQ2DS.mjs → chunk-3A7TDUZV.mjs} +1 -1
  18. package/dist/cli/{chunk-4QHAP3MR.mjs → chunk-4WMIMSSI.mjs} +5 -5
  19. package/dist/cli/{chunk-HALAYT3Y.mjs → chunk-4YWYLHED.mjs} +3 -3
  20. package/dist/cli/{chunk-B7NJ5JQ2.js → chunk-5AEEINTU.js} +4 -4
  21. package/dist/cli/{chunk-TLPW2SHS.js → chunk-5FBCMLJW.js} +6 -6
  22. package/dist/cli/{chunk-TZRTT7EI.js → chunk-5PYSYW63.js} +26 -26
  23. package/dist/cli/{chunk-3MQJJ6YX.js → chunk-6YZYCKWD.js} +51 -51
  24. package/dist/cli/{chunk-BLW2K6YH.js → chunk-7HAUVMRF.js} +3 -3
  25. package/dist/cli/{chunk-CKSRTD45.js → chunk-A6BETJ2A.js} +3 -3
  26. package/dist/cli/{chunk-U3F63UWD.js → chunk-AS3VECCY.js} +7 -7
  27. package/dist/cli/{chunk-F4FNMXI3.js → chunk-B7PEXXRW.js} +53 -53
  28. package/dist/cli/{chunk-4QHQ3WYW.js → chunk-CBVCCXIY.js} +21 -21
  29. package/dist/cli/{chunk-42F6LTBJ.mjs → chunk-CFSCHLNQ.mjs} +3 -3
  30. package/dist/cli/{chunk-M27SSAQ7.mjs → chunk-D7EQ4PI5.mjs} +1 -1
  31. package/dist/cli/{chunk-KTWXY73Q.js → chunk-EBWYNNTJ.js} +5 -5
  32. package/dist/cli/{chunk-VFP3MFLD.mjs → chunk-F5PYBZ2H.mjs} +1 -1
  33. package/dist/cli/{chunk-QKMWQTMI.js → chunk-FK7SBMSZ.js} +3 -3
  34. package/dist/cli/{chunk-3QSFSHCJ.mjs → chunk-FVPT44IJ.mjs} +1 -1
  35. package/dist/cli/{chunk-MUDOASYL.mjs → chunk-H3GOAZHV.mjs} +2 -2
  36. package/dist/cli/{chunk-VBGPRRJ6.js → chunk-HSANVBVL.js} +2 -2
  37. package/dist/cli/{chunk-BSK2TGB4.js → chunk-IC3BZJR7.js} +8 -8
  38. package/dist/cli/{chunk-7U3L2S7X.mjs → chunk-J4FCTFQS.mjs} +10 -10
  39. package/dist/cli/{chunk-AD7KL6AI.mjs → chunk-JU2KBLOR.mjs} +97 -12
  40. package/dist/cli/{chunk-VD3E3QMI.mjs → chunk-KCP6XNRR.mjs} +1 -1
  41. package/dist/cli/{chunk-ZANUM4XV.js → chunk-KGLIDLJ2.js} +5 -5
  42. package/dist/cli/{chunk-G4SGYWKV.js → chunk-L45IECBZ.js} +6 -6
  43. package/dist/cli/{chunk-HMHH7JQD.mjs → chunk-LJFIUT5R.mjs} +2 -2
  44. package/dist/cli/{chunk-VTCXSICG.mjs → chunk-LZCYDU6Q.mjs} +2 -2
  45. package/dist/cli/{chunk-7SWRXZ4A.js → chunk-MYYOCJZ2.js} +93 -93
  46. package/dist/cli/{chunk-DKR7QPEO.js → chunk-MZSLFWOT.js} +1 -1
  47. package/dist/cli/{chunk-DIMKSDF6.mjs → chunk-NPNQCPFP.mjs} +2 -2
  48. package/dist/cli/{chunk-3WVA7E7O.mjs → chunk-NREO7TT4.mjs} +2 -2
  49. package/dist/cli/{chunk-BVAYLXMH.mjs → chunk-NTJDZURV.mjs} +2 -2
  50. package/dist/cli/{chunk-M7K5BCWP.js → chunk-PGNLD6L6.js} +10 -10
  51. package/dist/cli/{chunk-D3Q4FUFS.js → chunk-TEJSRJNH.js} +8 -8
  52. package/dist/cli/{chunk-YAAQNDP6.mjs → chunk-UHTJWDYB.mjs} +3 -3
  53. package/dist/cli/{chunk-ZQYBKDPA.js → chunk-ULKGYVYP.js} +2 -2
  54. package/dist/cli/{chunk-DUGZKPRK.mjs → chunk-UYA7LJGC.mjs} +2 -2
  55. package/dist/cli/{chunk-6PRYHABU.mjs → chunk-VKBZLV2K.mjs} +1 -1
  56. package/dist/cli/{chunk-NBVYS6VG.js → chunk-VLYUFZUT.js} +9 -9
  57. package/dist/cli/{chunk-FC4C7MZM.mjs → chunk-VPAVNEDQ.mjs} +4 -4
  58. package/dist/cli/{chunk-M4QO3GRD.js → chunk-W3BHZUPL.js} +3 -3
  59. package/dist/cli/{chunk-5QS4T4KR.js → chunk-WFVEMDQL.js} +2 -2
  60. package/dist/cli/{chunk-7XTBEYLS.js → chunk-WTPRRKZA.js} +131 -46
  61. package/dist/cli/{chunk-Z5VSBCFV.js → chunk-YEJDFZJP.js} +16 -16
  62. package/dist/cli/{chunk-YMS7VYFA.mjs → chunk-YQOWMQEW.mjs} +1 -1
  63. package/dist/cli/{chunk-NGOKBSBH.mjs → chunk-ZOXV6WFI.mjs} +1 -1
  64. package/dist/cli/{chunk-EA45HSEC.mjs → chunk-ZV4OWYLZ.mjs} +2 -2
  65. package/dist/cli/command-docs.js +2 -2
  66. package/dist/cli/command-docs.mjs +1 -1
  67. package/dist/cli/{csv-4YHSYV2C.js → csv-FXOQ2PBE.js} +13 -13
  68. package/dist/cli/{csv-WC7ILC7P.mjs → csv-GPVCETS2.mjs} +4 -4
  69. package/dist/cli/{db-I5PV6NTC.mjs → db-F5UJTBGP.mjs} +6 -6
  70. package/dist/cli/{db-APZNM2GI.js → db-LXYV4GPZ.js} +27 -27
  71. package/dist/cli/{describe-XH5F3X5W.mjs → describe-GYWCI7I6.mjs} +17 -17
  72. package/dist/cli/describe-IB7SUIUT.js +48 -0
  73. package/dist/cli/describe-core.d.mts +3 -3
  74. package/dist/cli/describe-core.d.ts +3 -3
  75. package/dist/cli/{executions-PIY4XM7T.mjs → executions-6NL2YW76.mjs} +6 -6
  76. package/dist/cli/{executions-VIXFKZYU.js → executions-6SJKTY2L.js} +8 -8
  77. package/dist/cli/{feedback-IGDHBWGT.mjs → feedback-7AMQCNTB.mjs} +4 -4
  78. package/dist/cli/{feedback-WCLIFQTR.js → feedback-E3HULSQD.js} +8 -8
  79. package/dist/cli/{git-FRICPPTA.mjs → git-74IS2EFH.mjs} +5 -5
  80. package/dist/cli/git-A2QIIMW5.js +25 -0
  81. package/dist/cli/index.js +139 -139
  82. package/dist/cli/index.mjs +41 -41
  83. package/dist/cli/{legacy-noops-ROAXEG6D.mjs → legacy-noops-52FFRTRZ.mjs} +5 -5
  84. package/dist/cli/{legacy-noops-DSFOPYDY.js → legacy-noops-ALWUQPKS.js} +8 -8
  85. package/dist/cli/{monitors-FZ5PRLW6.mjs → monitors-VTJIWWW2.mjs} +7 -7
  86. package/dist/cli/{monitors-KUCYQLU5.js → monitors-Z4ADOGTY.js} +91 -91
  87. package/dist/cli/{org-SRHMWKQR.js → org-2BTEKDF5.js} +72 -72
  88. package/dist/cli/{org-DRNND5XU.mjs → org-7GU6H7JL.mjs} +6 -6
  89. package/dist/cli/{pages-XNGA356T.mjs → pages-I6PFQGEU.mjs} +6 -6
  90. package/dist/cli/{pages-TEJQIHTU.js → pages-MG36E7RY.js} +17 -17
  91. package/dist/cli/{play-NE45ROIZ.mjs → play-7KFSLJX2.mjs} +18 -18
  92. package/dist/cli/{play-GCGFQSFP.js → play-VN52S3RV.js} +321 -321
  93. package/dist/cli/{providers-57TJOSMV.mjs → providers-D46JDEL2.mjs} +6 -6
  94. package/dist/cli/{providers-VHMUR63R.js → providers-W5XLII66.js} +9 -9
  95. package/dist/cli/{quickstart-K3SH4NXP.mjs → quickstart-4GTXBZHY.mjs} +4 -4
  96. package/dist/cli/{quickstart-BPXWO4UD.js → quickstart-TIZAC63S.js} +6 -6
  97. package/dist/cli/{run-553AAXDU.js → run-FOVEMYYX.js} +36 -36
  98. package/dist/cli/{run-ZRWJUEN2.mjs → run-LE3D4LVU.mjs} +22 -22
  99. package/dist/cli/{search-BW6XRS4I.mjs → search-6YL6WJMQ.mjs} +7 -7
  100. package/dist/cli/search-HN6SVDQU.js +32 -0
  101. package/dist/cli/{secrets-AMYQYUL5.js → secrets-CSTTTMZH.js} +15 -15
  102. package/dist/cli/{secrets-OYYCFGZE.mjs → secrets-D66U6RTT.mjs} +6 -6
  103. package/dist/cli/{sessions-RYCJUMJ2.js → sessions-45M2NRAA.js} +6 -6
  104. package/dist/cli/{sessions-O4SVVOMO.mjs → sessions-XIO3OUER.mjs} +5 -5
  105. package/dist/cli/{settings-7R5FQKII.js → settings-N42CVKSK.js} +78 -78
  106. package/dist/cli/{settings-QK7DHDU7.mjs → settings-R33X2D5T.mjs} +11 -11
  107. package/dist/cli/{setup-VDAAVCKK.mjs → setup-CBBC4FQP.mjs} +9 -9
  108. package/dist/cli/{setup-OTQDQHDN.js → setup-HREDVNF2.js} +44 -44
  109. package/dist/cli/{skills-HRK5O5JO.mjs → skills-4X6WS2PT.mjs} +9 -7
  110. package/dist/cli/skills-QZ6HZX2T.js +33 -0
  111. package/dist/cli/tools-KFIH7UWB.js +55 -0
  112. package/dist/cli/{tools-O7BM62QV.mjs → tools-YR46YFR2.mjs} +16 -16
  113. package/dist/cli/{update-UHKHCSTY.mjs → update-5CYAZX5X.mjs} +9 -9
  114. package/dist/cli/update-VZLEJLWJ.js +33 -0
  115. package/dist/cli/{workflow-7Z5NCTGG.js → workflow-M7AA722W.js} +17 -17
  116. package/dist/cli/{workflow-T2EDR7L4.mjs → workflow-NKQ3CWPK.mjs} +7 -7
  117. package/dist/{client-Bgl0_zXi.d.mts → client-AjmfA5nR.d.mts} +1 -1
  118. package/dist/{client-_ah6IuhK.d.ts → client-DMyY-QL8.d.ts} +1 -1
  119. package/dist/{client-core-C-ZF5vh9.d.ts → client-core-C705vFyV.d.ts} +1 -1
  120. package/dist/{client-core-Bfsedm0_.d.mts → client-core-CpBbvLEX.d.mts} +1 -1
  121. package/dist/{compiler-manifest-CCOqDGjU.d.mts → compiler-manifest-hqIAukR0.d.mts} +1 -1
  122. package/dist/{compiler-manifest-CCOqDGjU.d.ts → compiler-manifest-hqIAukR0.d.ts} +1 -1
  123. package/dist/{errors-Cy3kPnsi.d.ts → errors-CRO2qQ6k.d.ts} +1 -1
  124. package/dist/{errors-BLccD7tG.d.mts → errors-DIHVetNY.d.mts} +1 -1
  125. package/dist/{index-D5e4h1-H.d.ts → index-B8DVoeYt.d.ts} +1 -1
  126. package/dist/{index-4-j44HuT.d.mts → index-DVZ_X4Gb.d.mts} +1 -1
  127. package/dist/index.d.mts +9 -9
  128. package/dist/index.d.ts +9 -9
  129. package/dist/index.js +9 -9
  130. package/dist/index.mjs +6 -6
  131. package/dist/install-integrity.json +110 -110
  132. package/dist/plays/bundle-play-file.d.mts +3 -3
  133. package/dist/plays/bundle-play-file.d.ts +3 -3
  134. package/dist/plays/bundle-play-file.mjs +1 -1
  135. package/dist/plays/play-description.d.mts +2 -2
  136. package/dist/plays/play-description.d.ts +2 -2
  137. package/dist/plays/run-request.d.mts +2 -2
  138. package/dist/plays/run-request.d.ts +2 -2
  139. package/dist/release.d.mts +3 -3
  140. package/dist/release.d.ts +3 -3
  141. package/dist/release.js +2 -2
  142. package/dist/release.mjs +1 -1
  143. package/dist/server.d.mts +4 -4
  144. package/dist/server.d.ts +4 -4
  145. package/dist/server.js +5 -5
  146. package/dist/server.mjs +3 -3
  147. package/package.json +1 -1
  148. package/dist/cli/auth-7GVCW24N.js +0 -41
  149. package/dist/cli/describe-OR7FZBCD.js +0 -48
  150. package/dist/cli/git-CKN2F32Y.js +0 -25
  151. package/dist/cli/search-WF26AUDJ.js +0 -32
  152. package/dist/cli/skills-VNLMEOXW.js +0 -31
  153. package/dist/cli/tools-C3MUHL7G.js +0 -55
  154. package/dist/cli/update-TCKTU6QJ.js +0 -33
@@ -185,8 +185,8 @@ export type PlayFetchResponse = PlayAuthoringFetchResponse;
185
185
  * The changed row is delivered as the listener event's `after` in the play function's input.
186
186
  *
187
187
  * The default Play runtime is 30 minutes with the `standard` 1 GiB / 1 CPU
188
- * profile. Preview deployments also support `large` (4 GiB / 2 CPU) and
189
- * `xlarge` (8 GiB / 4 CPU) through `runtime.size`. Production uses `standard`.
188
+ * profile. Select `large` (4 GiB / 2 CPU) or `xlarge` (8 GiB / 4 CPU)
189
+ * through `runtime.size` when a step needs more memory.
190
190
  * Compute pricing follows the workspace plan; use `deepline billing quote`
191
191
  * for the session ceiling.
192
192
  * Set `runtime.timeout` for longer bounded runs; duration values are whole
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
205
205
  // getters keep their established compatibility behavior.
206
206
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
207
207
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
208
- version: '0.3.475',
208
+ version: '0.3.476',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -252,9 +252,9 @@ export const SDK_RELEASE = {
252
252
  },
253
253
  {
254
254
  command: 'search',
255
- introducedIn: '0.3.91',
255
+ introducedIn: '0.3.287',
256
256
  reason:
257
- 'deepline search was added in SDK CLI 0.3.91 as the one search across tools, monitors, and plays. On an older version run deepline tools search or deepline plays search, or update.',
257
+ 'deepline search was added in SDK CLI 0.3.287 as the one search across tools, monitors, and plays. On an older version run deepline tools search or deepline plays search, or update.',
258
258
  },
259
259
  {
260
260
  command: 'notifications',
@@ -46,8 +46,9 @@ type ProviderMonitorUpstreamIdentityDefinition = {
46
46
  * Payload fields that never change which findings the provider resource
47
47
  * delivers. `updates_since` only sets how far back the first delivery
48
48
  * replays, so two monitors that differ only there watch the same feed.
49
- * Claim keys written before this list existed still carry these fields;
50
- * readers resolve them through `canonicalProviderMonitorIdentityClaimKey`.
49
+ * New claim keys omit them. Keys stored before that still carry them until
50
+ * the `normalizeProviderMonitorIdentityClaimKeys` migration rewrites them;
51
+ * readers resolve both through `canonicalProviderMonitorIdentityClaimKey`.
51
52
  */
52
53
  nonConfigurationFields?: readonly string[];
53
54
  };
@@ -171,9 +172,11 @@ export function providerMonitorUpstreamIdentitySignature(
171
172
  /**
172
173
  * Exact claim identity used by the Convex conflict index. The provider's
173
174
  * declared scope remains visible in `scopeKey`; providers that allow
174
- * configuration variants add every non-scope payload field to the claim key.
175
- * Keeping the old scope JSON as the prefix lets readers recognize claims
176
- * created before this distinction was introduced.
175
+ * configuration variants add every non-scope payload field to the claim key,
176
+ * except `nonConfigurationFields`. Keeping the old scope JSON as the prefix
177
+ * lets readers recognize claims created before this distinction was
178
+ * introduced. The result is always canonical
179
+ * (`canonicalProviderMonitorIdentityClaimKey` returns it unchanged).
177
180
  */
178
181
  export function providerMonitorUpstreamIdentityClaimKey(
179
182
  tool: string,
@@ -206,9 +209,10 @@ export function providerMonitorUpstreamIdentityClaimKey(
206
209
  : []),
207
210
  ]),
208
211
  );
212
+ const ignored = new Set(definition.nonConfigurationFields ?? []);
209
213
  const configuration = Object.fromEntries(
210
214
  Object.entries(payload ?? {}).filter(
211
- ([field]) => !scopeAndAliases.has(field),
215
+ ([field]) => !scopeAndAliases.has(field) && !ignored.has(field),
212
216
  ),
213
217
  );
214
218
  if (Object.keys(configuration).length === 0) return scopeKey;
@@ -275,6 +279,15 @@ export function canonicalProviderMonitorIdentityClaimKey(
275
279
  return `${parts.scopeKey}${CONFIGURATION_SEPARATOR}${stableJson(configuration)}`;
276
280
  }
277
281
 
282
+ /**
283
+ * The scope part of a stored claim key: the whole key when it is scope-only.
284
+ * Every key for one provider scope starts with this exact JSON object, so it
285
+ * bounds an index range over that scope's claims.
286
+ */
287
+ export function providerMonitorIdentityClaimScopeKey(identityKey: string) {
288
+ return splitClaimKey(identityKey)?.scopeKey ?? identityKey;
289
+ }
290
+
278
291
  /** Whether a claim key carries configuration beyond its scope. */
279
292
  export function providerMonitorIdentityClaimKeyHasConfiguration(
280
293
  identityKey: string,
@@ -241,7 +241,7 @@
241
241
  "id": "github.eval-agent-cli-matrix",
242
242
  "name": "Eval Agent CLI Matrix",
243
243
  "scheduler": "github_actions",
244
- "cadence": "0 7 * * *",
244
+ "cadence": "0 7 * * *; 0 22 * * 4; 0 3 * * 1,3,5",
245
245
  "timezone": "America/New_York",
246
246
  "source": ".github/workflows/eval-agent-cli-matrix.yml",
247
247
  "locator": "schedule:",
@@ -265,9 +265,9 @@
265
265
  "locator": "schedule:",
266
266
  "owner": "platform",
267
267
  "criticality": "maintenance",
268
- "purpose": "Reconcile completed PR Preview Machines and release capacity only after the per-app lease fence allows it. Its named-estate lane plans every named Preview estate (eval reuse keys, runtime up preview branch lanes, one-off namespaces) with `bun scripts/fly-preview-estate-lifecycle.ts --report --named-reclaim-plan` and, only on a workflow_dispatch with reclaim_named_estates=true, scales at most 8 planned estates per pass (interrupted reclaims first, then reclaimable estates idle 24 h by lease, release or reclaim evidence) to zero through the claimed runtime-preview-namespace.yml scale-to-zero, recording the start and lane app before the seam, retiring the release lane and recording reclaimed history; scheduled passes only report it.",
269
- "successDefinition": "Fly inventory is reconciled and eligible terminal/closed PR capacity is released; every named estate is classified without a read failure, and a dispatched named reclaim leaves each target at zero Machines with its release lane retired and reclaimed history written. No eligible app or estate is a valid no-op.",
270
- "failureDefinition": "Inventory, lease resolution, scale-down, or empty-app cleanup fails or is ambiguous; a named-estate Fly or authority read fails; a named reclaim is refused inside its claim (active owner, used since discovery, ownership or lane-app refusal) or any role keeps a Machine; or any named reclaim is incomplete (started but its release lane was never retired), which fails every pass until a dispatch finishes it.",
268
+ "purpose": "Reconcile completed PR Preview Machines and release capacity only after the per-app lease fence allows it. Its named-estate lane plans every named Preview estate (eval reuse keys, runtime up preview branch lanes, one-off namespaces) with `bun scripts/fly-preview-estate-lifecycle.ts --report --named-reclaim-plan` and, only on a workflow_dispatch with reclaim_named_estates=true, scales at most 8 planned estates per pass (interrupted reclaims first, then reclaimable estates idle 24 h by lease, release or reclaim evidence) to zero through the claimed runtime-preview-namespace.yml scale-to-zero, recording the start and lane app before the seam, retiring the release lane and recording reclaimed history; scheduled passes only report it. Each pass also returns the deeplinev1/load PlanetScale branch to its parked size when no Customer Workload Suite run is active on load-tests/framework, in case a load test's own teardown never ran.",
269
+ "successDefinition": "Fly inventory is reconciled and eligible terminal/closed PR capacity is released; every named estate is classified without a read failure, and a dispatched named reclaim leaves each target at zero Machines with its release lane retired and reclaimed history written. No eligible app or estate is a valid no-op. The load database is parked, a change toward that size is in flight, or an active Customer Workload Suite run on load-tests/framework may be holding it.",
270
+ "failureDefinition": "Inventory, lease resolution, scale-down, or empty-app cleanup fails or is ambiguous; a named-estate Fly or authority read fails; a named reclaim is refused inside its claim (active owner, used since discovery, ownership or lane-app refusal) or any role keeps a Machine; or any named reclaim is incomplete (started but its release lane was never retired), which fails every pass until a dispatch finishes it; or reading or parking the load database fails.",
271
271
  "startGraceMs": 600000,
272
272
  "runTimeoutMs": 3600000,
273
273
  "failureAlert": "github_workflow_run",
@@ -790,6 +790,13 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
790
790
  ): void {
791
791
  if (retryAtMs <= (this.localProviderRetryAtMs.get(bucketId) ?? 0)) return;
792
792
  this.localProviderRetryAtMs.set(bucketId, retryAtMs);
793
+ const cadence = this.validatedDispatchCadences.get(bucketId);
794
+ const serverOffsetMs = this.serverClockOffsetsMs.get(bucketId) ?? 0;
795
+ // A new hold fences old tickets and their dispatch debt. Keep debt from
796
+ // sends after an expired hold; their physical spacing is still current.
797
+ if (cadence && cadence.lastAtMs + serverOffsetMs <= retryAtMs) {
798
+ this.validatedDispatchCadences.delete(bucketId);
799
+ }
793
800
  for (const waiting of this.scheduledPermitWaits.get(bucketId) ?? []) {
794
801
  if (waiting.retryAtMsAtGrant < retryAtMs) waiting.invalidate();
795
802
  }
@@ -1626,6 +1633,14 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
1626
1633
  scopeRetryAtMsAtGrant,
1627
1634
  dispatchValidationSupported,
1628
1635
  ] = scheduled;
1636
+ // Legacy grants have no shared hold snapshot. Capture their local fence
1637
+ // when assigned, while keeping the signed gateway proof unchanged.
1638
+ const localRetryAtMsAtGrant = this.validationScopes.has(bucketId)
1639
+ ? scopeRetryAtMsAtGrant
1640
+ : Math.max(
1641
+ scopeRetryAtMsAtGrant,
1642
+ this.localProviderRetryAtMs.get(bucketId) ?? 0,
1643
+ );
1629
1644
  let settled = false;
1630
1645
  const refund = async (): Promise<void> => {
1631
1646
  if (!reservationId) {
@@ -1732,7 +1747,15 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
1732
1747
  });
1733
1748
  }
1734
1749
  if (waitMs > 0) {
1735
- await this.sleep(waitMs, signal);
1750
+ if (
1751
+ !(await this.waitForScheduledPermit(
1752
+ bucketId,
1753
+ localRetryAtMsAtGrant,
1754
+ waitMs,
1755
+ signal,
1756
+ ))
1757
+ )
1758
+ return false;
1736
1759
  continue;
1737
1760
  }
1738
1761
  this.validatedDispatchCadences.set(bucketId, {
@@ -72,11 +72,14 @@ export type PlayRunRecoveryDecision = Readonly<{
72
72
  export class PlayRunRecoveryError extends Error {
73
73
  readonly decision: PlayRunRecoveryDecision;
74
74
  readonly cause?: unknown;
75
+ /** Log-only provider facts; see `playRunRecoveryLogDetail`. */
76
+ readonly recoveryLogDetail?: unknown;
75
77
 
76
78
  constructor(input: {
77
79
  decision: PlayRunRecoveryDecision;
78
80
  message: string;
79
81
  cause?: unknown;
82
+ recoveryLogDetail?: unknown;
80
83
  }) {
81
84
  super(input.message);
82
85
  this.name = PLAY_RUN_RECOVERY_ERROR_NAME;
@@ -84,6 +87,9 @@ export class PlayRunRecoveryError extends Error {
84
87
  if (input.cause !== undefined) {
85
88
  this.cause = input.cause;
86
89
  }
90
+ if (input.recoveryLogDetail !== undefined) {
91
+ this.recoveryLogDetail = input.recoveryLogDetail;
92
+ }
87
93
  }
88
94
  }
89
95
 
@@ -106,7 +112,7 @@ export type PlayRunRecoveryLogDetail = Readonly<
106
112
  >;
107
113
 
108
114
  /**
109
- * Provider facts an adapter attached to the cause of a recovery error, for the
115
+ * Provider facts an adapter attached to a recovery error or its cause, for the
110
116
  * scheduler's defer log only. The decision's `reason` stays the single durable
111
117
  * recovery fact: this detail is never persisted, never returned to a caller,
112
118
  * and never read to choose a recovery action. It is bounded here, at the edge
@@ -119,9 +125,11 @@ export function playRunRecoveryLogDetail(
119
125
  try {
120
126
  if (!isPlayRunRecoveryError(error)) return null;
121
127
  const cause: unknown = error.cause;
122
- if (!cause || typeof cause !== 'object') return null;
123
- const supplied = (cause as { recoveryLogDetail?: unknown })
124
- .recoveryLogDetail;
128
+ const supplied =
129
+ error.recoveryLogDetail ??
130
+ (cause && typeof cause === 'object'
131
+ ? (cause as { recoveryLogDetail?: unknown }).recoveryLogDetail
132
+ : undefined);
125
133
  if (!supplied || typeof supplied !== 'object' || Array.isArray(supplied)) {
126
134
  return null;
127
135
  }
@@ -203,6 +211,14 @@ export function recoveryForModalSandboxCreateFailure(
203
211
  const code = errorCode(error);
204
212
  const status = errorStatus(error);
205
213
  const message = messageOf(error);
214
+ // Only this rejection carries Modal's own words. Once it opens the circuit,
215
+ // later runs defer without calling Modal, and every reason here groups
216
+ // several provider conditions.
217
+ const recoveryLogDetail = {
218
+ providerCode: code,
219
+ providerStatus: status,
220
+ providerMessage: message,
221
+ };
206
222
  const resourceExhausted =
207
223
  code === 8 ||
208
224
  (typeof code === 'string' && /RESOURCE_EXHAUSTED/i.test(code)) ||
@@ -218,6 +234,7 @@ export function recoveryForModalSandboxCreateFailure(
218
234
  message:
219
235
  'Modal sandbox capacity is unavailable before customer execution began.',
220
236
  cause: error,
237
+ recoveryLogDetail,
221
238
  });
222
239
  }
223
240
 
@@ -56,8 +56,20 @@ export const RUNTIME_CAPACITY_POLICY = {
56
56
  maxScaleDownMachinesPerReconcile: 2,
57
57
  /** Empty relay capacity must be quiet before it is reclaimed. */
58
58
  scaleDownQuietMs: 120_000,
59
+ /**
60
+ * Pooled Postgres clients per relay Machine when
61
+ * DEEPLINE_RUNTIME_GATEWAY_POOL_MAX_CLIENTS sets none, as in production.
62
+ * packages/runtime-gateway/server.ts explains the budget.
63
+ */
64
+ poolMaxClients: 6,
59
65
  },
60
66
  receiptGateway: {
67
+ /**
68
+ * Pooled Postgres clients per receipt-gateway Machine when
69
+ * DEEPLINE_RUNTIME_GATEWAY_POOL_MAX_CLIENTS sets none, as in production.
70
+ * packages/runtime-gateway/server.ts explains the budget.
71
+ */
72
+ poolMaxClients: 8,
61
73
  admissionTimeoutMs: 10_000,
62
74
  /** End identical receipt-row work before the caller can overlap a retry. */
63
75
  claimOperationTimeoutMs: 20_000,
@@ -72,7 +72,7 @@ export function acquireRateScopeSql(
72
72
  THEN CASE WHEN ${productiveRecovery} THEN ${AIMD_RECOVERY_STEP_MS}
73
73
  ELSE ${sparseRecoveryInterval} END
74
74
  ELSE LEAST(${floorRecoveryInterval}, CEIL(1000.0 / ${refillRate})) END`
75
- : `LEAST(h.rate_recovery_interval_ms, ${AIMD_RECOVERY_STEP_MS})`;
75
+ : `${AIMD_RECOVERY_STEP_MS}`;
76
76
  // A local no-progress pause remains active after the provider's shorter
77
77
  // Retry-After. Only time beyond every outstanding dispatch/hold is idle.
78
78
  const observationWasIdle = `${successesParameter}::int = 0
@@ -202,13 +202,15 @@ export function updateRateScopeSql(
202
202
  ELSE ph.rate_probe_started_at_ms END,`
203
203
  : ''
204
204
  }
205
- -- At the floor, a new successful epoch must not inherit failed-probe
206
- -- backoff. Above the floor, retain its useful measurement duration for
207
- -- sparse upward probes; that rate already proves successful recovery.
205
+ -- A productive known-provider epoch uses the one-second recovery window,
206
+ -- so its old measurement must not become a failed-probe streak when the
207
+ -- success counter resets. Unknown providers above the floor retain that
208
+ -- measurement for their separate sparse upward-probe policy.
208
209
  rate_recovery_interval_ms = CASE
209
- WHEN ${unknownProvider} AND (SELECT granted FROM grant_calc) > 0
210
+ WHEN (SELECT granted FROM grant_calc) > 0
210
211
  AND ph.rate_successes > 0
211
- AND ph.next_refill_per_sec <= ${DEFAULT_UNKNOWN_PROVIDER_MIN_RPS}
212
+ AND (${!unknownProvider}
213
+ OR ph.next_refill_per_sec <= ${DEFAULT_UNKNOWN_PROVIDER_MIN_RPS})
212
214
  AND (ph.observation_was_idle
213
215
  OR ph.rate_observation_started_at_ms IS NULL)
214
216
  -- Zero is an unmeasured new episode, not a failed-probe interval.
@@ -12736,9 +12736,17 @@ export async function claimPostgresSchedulerSandboxCleanupJobs(
12736
12736
  if (providers?.length === 0) return [];
12737
12737
  // The v12 table retains deleted history. Avoid planning the lineage repair
12738
12738
  // when neither a legacy row nor a v2 NULL-domain duplicate needs adoption.
12739
- // A row arriving after this read is picked up by the next claim poll; the
12740
- // provider-qualified v2 claim below still runs on every call.
12741
- const adoptionWork = await client.query<{ pending: boolean }>(`
12739
+ // The same read proves whether any v2 row could be claimed: the claim below
12740
+ // is ~15 KB of SQL whose planning costs milliseconds while every idle
12741
+ // worker polls it each second, so it is skipped when nothing is claimable.
12742
+ // `claimable` repeats the claim's own row predicates without the detached
12743
+ // sandbox fence, so it is a superset of what the claim could select. A row
12744
+ // arriving after this read is picked up by the next claim poll.
12745
+ const adoptionWork = await client.query<{
12746
+ pending: boolean;
12747
+ claimable: boolean;
12748
+ }>(
12749
+ `
12742
12750
  SELECT EXISTS (
12743
12751
  SELECT 1 FROM ${tableName('sandbox_cleanup_jobs_v2', options)}
12744
12752
  WHERE provider = 'daytona' AND routing_domain IS NULL
@@ -12746,9 +12754,29 @@ export async function claimPostgresSchedulerSandboxCleanupJobs(
12746
12754
  ) OR EXISTS (
12747
12755
  SELECT 1 FROM ${tableName('sandbox_cleanup_jobs', options)}
12748
12756
  WHERE status <> 'deleted'
12749
- ) AS pending
12750
- `);
12751
- if (typeof adoptionWork.rows[0]?.pending !== 'boolean') {
12757
+ ) AS pending,
12758
+ EXISTS (
12759
+ SELECT 1 FROM ${tableName('sandbox_cleanup_jobs_v2', options)} AS cleanup
12760
+ WHERE cleanup.status <> 'deleted' AND cleanup.blocked_at IS NULL
12761
+ AND (cleanup.available_at <= now() OR cleanup.diagnostic_json IS NOT NULL)
12762
+ AND (cleanup.lease_expires_at IS NULL OR cleanup.lease_expires_at <= now())
12763
+ AND ($1::text IS NULL OR cleanup.environment = $1)
12764
+ AND ($2::text[] IS NULL OR cleanup.provider = ANY($2::text[]))
12765
+ AND ($3::text IS NULL OR cleanup.run_id = $3)
12766
+ AND ($4::integer IS NULL OR cleanup.attempt <= $4)
12767
+ ) AS claimable
12768
+ `,
12769
+ [
12770
+ input.environment?.trim() || null,
12771
+ providers,
12772
+ input.runId ?? null,
12773
+ input.throughAttempt ?? null,
12774
+ ],
12775
+ );
12776
+ if (
12777
+ typeof adoptionWork.rows[0]?.pending !== 'boolean' ||
12778
+ typeof adoptionWork.rows[0]?.claimable !== 'boolean'
12779
+ ) {
12752
12780
  throw new Error(
12753
12781
  'Sandbox cleanup adoption preflight returned no pending proof.',
12754
12782
  );
@@ -12944,6 +12972,10 @@ export async function claimPostgresSchedulerSandboxCleanupJobs(
12944
12972
  ON CONFLICT (provider, sandbox_id, routing_domain_key) DO NOTHING
12945
12973
  `,
12946
12974
  );
12975
+ // Adoption may have just created claimable v2 rows, so only an idle read
12976
+ // that proved neither kind of work skips the claim.
12977
+ if (!adoptionWork.rows[0].pending && !adoptionWork.rows[0].claimable)
12978
+ return [];
12947
12979
  const claimed = await client.query<{
12948
12980
  provider: 'daytona' | 'modal';
12949
12981
  sandbox_id: string;
@@ -19774,6 +19806,40 @@ function runLedgerOrderSql(alias: string): string {
19774
19806
  return `CASE ${alias}.event_type WHEN ${RUN_EVENT_KIND_SQL_LITERAL.runCreated} THEN 0 WHEN ${RUN_EVENT_KIND_SQL_LITERAL.runStarted} THEN 1 ELSE 2 END, ${alias}.created_at, ${alias}.event_id`;
19775
19807
  }
19776
19808
 
19809
+ /**
19810
+ * Whether a lane (or, without `searchOnly`, either lane) holds any
19811
+ * undelivered fact. Global discovery and due-clock statements are kilobytes
19812
+ * of SQL planned on every call, and an idle Preview projector issues them
19813
+ * twice a second. Every such statement starts from these same undelivered
19814
+ * rows, so an empty probe proves it would return nothing. The probe is the
19815
+ * first seek of `runLedgerPendingRunsSql`: an ordered LIMIT keeps the lane's
19816
+ * pending partial index even when statistics expect the other lane's backlog
19817
+ * to match, where EXISTS (which discards ORDER BY and LIMIT) would scan the
19818
+ * retained outbox instead.
19819
+ */
19820
+ async function runLedgerOutboxLaneHasPending(
19821
+ client: PostgresSchedulerQueryClient,
19822
+ options: Pick<PostgresSchedulerOptions, 'schema'> | undefined,
19823
+ searchOnly?: boolean,
19824
+ ): Promise<boolean> {
19825
+ const lane =
19826
+ searchOnly === undefined
19827
+ ? ''
19828
+ : `AND ${searchLaneSql('pending')} = ${String(searchOnly)}`;
19829
+ const result = await client.query<{ pending: boolean }>(
19830
+ `SELECT (
19831
+ SELECT pending.run_id FROM ${tableName('outbox', options)} AS pending
19832
+ WHERE pending.delivered_at IS NULL ${lane}
19833
+ ORDER BY pending.run_id LIMIT 1
19834
+ ) IS NOT NULL AS pending`,
19835
+ );
19836
+ const pending = result.rows[0]?.pending;
19837
+ if (typeof pending !== 'boolean') {
19838
+ throw new Error('Run Ledger outbox pending probe returned no proof.');
19839
+ }
19840
+ return pending;
19841
+ }
19842
+
19777
19843
  /** Enumerate pending runs by index seeks, skipping each run's entire fact tail. */
19778
19844
  function runLedgerPendingRunsSql(
19779
19845
  options?: Pick<PostgresSchedulerOptions, 'schema'>,
@@ -21106,6 +21172,16 @@ export async function readPostgresSchedulerOutboxNextDueAt(
21106
21172
  ? [true]
21107
21173
  : [false, true];
21108
21174
  const runId = options?.runId?.trim() || null;
21175
+ // Every due time below belongs to an undelivered fact.
21176
+ if (
21177
+ !runId &&
21178
+ !(await runLedgerOutboxLaneHasPending(
21179
+ client,
21180
+ options,
21181
+ options?.lane === undefined ? undefined : lanes[0],
21182
+ ))
21183
+ )
21184
+ return null;
21109
21185
  const result = await client.query<{ due_at: Date | string | null }>(
21110
21186
  `
21111
21187
  -- Seek distinct run identities without reading their pending fact tails.
@@ -23132,6 +23208,28 @@ async function dispatchRunLedgerOutboxBatchWithScope(
23132
23208
  arrayInputStarted: scope?.nextArrayInputStarted,
23133
23209
  }
23134
23210
  : await withClient(async (client) => {
23211
+ // Global discovery of an empty lane would plan its multi-kilobyte
23212
+ // claim statements only to select nothing.
23213
+ if (
23214
+ !scope &&
23215
+ !input.runId?.trim() &&
23216
+ !input.headEventId?.trim() &&
23217
+ !(await runLedgerOutboxLaneHasPending(
23218
+ client,
23219
+ options,
23220
+ input.searchOnly === true,
23221
+ ))
23222
+ ) {
23223
+ return {
23224
+ events: [] as PostgresSchedulerOutboxEvent[],
23225
+ launchJson: null,
23226
+ ingressPrefixClaimed: false,
23227
+ freshClaimLease: undefined,
23228
+ transportDelivered: undefined,
23229
+ transportOwnershipUnconfirmed: undefined,
23230
+ arrayInputStarted: undefined,
23231
+ };
23232
+ }
23135
23233
  const fast = await claimFastEvents(client);
23136
23234
  let result: Awaited<ReturnType<typeof claimEvents>>;
23137
23235
  if (fast !== null) {
@@ -2988,7 +2988,7 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
2988
2988
  resolution: 'static-required',
2989
2989
  issueCode: 'play_authoring_binding_invalid',
2990
2990
  description:
2991
- 'Deepline-managed sandbox size. Standard is 1 GiB memory. Large (4 GiB) and xlarge (8 GiB) are available only on branch Preview deployments. Production supports standard.',
2991
+ 'Deepline-managed sandbox size: standard (1 GiB memory, 1 CPU), large (4 GiB, 2 CPU), or xlarge (8 GiB, 4 CPU). Standard is the default. Compute pricing follows the workspace plan and selected size.',
2992
2992
  errorMessage:
2993
2993
  'runtime.size must be the static literal "standard", "large", or "xlarge".',
2994
2994
  },
@@ -0,0 +1,41 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _chunk6YZYCKWDjs = require('./chunk-6YZYCKWD.js');
17
+ require('./chunk-AS3VECCY.js');
18
+ require('./chunk-7HAUVMRF.js');
19
+ require('./chunk-5AEEINTU.js');
20
+ require('./chunk-ALJJRZNJ.js');
21
+ require('./chunk-XNYIZMNQ.js');
22
+ require('./chunk-DIAWYWT5.js');
23
+ require('./chunk-A6BETJ2A.js');
24
+ require('./chunk-OG64RBAC.js');
25
+ require('./chunk-COGTRVWW.js');
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+ exports.EXIT_WORKSPACE_MISMATCH = _chunk6YZYCKWDjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunk6YZYCKWDjs.authStatusLine; exports.clearPendingClaim = _chunk6YZYCKWDjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunk6YZYCKWDjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunk6YZYCKWDjs.handleRegister; exports.handleStatus = _chunk6YZYCKWDjs.handleStatus; exports.handleWait = _chunk6YZYCKWDjs.handleWait; exports.httpJson = _chunk6YZYCKWDjs.httpJson; exports.readPendingAuthClaim = _chunk6YZYCKWDjs.readPendingAuthClaim; exports.readStatusBanner = _chunk6YZYCKWDjs.readStatusBanner; exports.registerAuthCommands = _chunk6YZYCKWDjs.registerAuthCommands; exports.reportSetupCompleted = _chunk6YZYCKWDjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunk6YZYCKWDjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunk6YZYCKWDjs.statusBannerLine;
@@ -13,14 +13,14 @@ import {
13
13
  reportSetupCompleted,
14
14
  resolvePendingAuthClaimForResume,
15
15
  statusBannerLine
16
- } from "./chunk-42F6LTBJ.mjs";
17
- import "./chunk-BVAYLXMH.mjs";
18
- import "./chunk-NGOKBSBH.mjs";
19
- import "./chunk-3QSFSHCJ.mjs";
16
+ } from "./chunk-CFSCHLNQ.mjs";
17
+ import "./chunk-NTJDZURV.mjs";
18
+ import "./chunk-ZOXV6WFI.mjs";
19
+ import "./chunk-FVPT44IJ.mjs";
20
20
  import "./chunk-4QF2K7TM.mjs";
21
21
  import "./chunk-DLIRSHV6.mjs";
22
22
  import "./chunk-HBL4PM5Q.mjs";
23
- import "./chunk-YAAQNDP6.mjs";
23
+ import "./chunk-UHTJWDYB.mjs";
24
24
  import "./chunk-WZYKRD7T.mjs";
25
25
  import "./chunk-KRD6H754.mjs";
26
26
  export {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-DIMKSDF6.mjs";
3
+ } from "./chunk-NPNQCPFP.mjs";
4
4
  import {
5
5
  iterateCursorPages,
6
6
  requireBillingIdempotencyKey
7
- } from "./chunk-VFP3MFLD.mjs";
7
+ } from "./chunk-F5PYBZ2H.mjs";
8
8
  import "./chunk-L2VKAASU.mjs";
9
9
  import "./chunk-NELMCOWK.mjs";
10
10
  import "./chunk-S3A4IXBQ.mjs";
@@ -15,9 +15,9 @@ import {
15
15
  openInBrowser,
16
16
  printCommandEnvelope,
17
17
  shouldEmitJson
18
- } from "./chunk-BVAYLXMH.mjs";
19
- import "./chunk-NGOKBSBH.mjs";
20
- import "./chunk-3QSFSHCJ.mjs";
18
+ } from "./chunk-NTJDZURV.mjs";
19
+ import "./chunk-ZOXV6WFI.mjs";
20
+ import "./chunk-FVPT44IJ.mjs";
21
21
  import {
22
22
  AuthError,
23
23
  ConfigError
@@ -26,7 +26,7 @@ import "./chunk-DLIRSHV6.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-HBL4PM5Q.mjs";
29
- import "./chunk-YAAQNDP6.mjs";
29
+ import "./chunk-UHTJWDYB.mjs";
30
30
  import "./chunk-WZYKRD7T.mjs";
31
31
  import "./chunk-KRD6H754.mjs";
32
32