deepline 0.3.574 → 0.3.575
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.
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +0 -18
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/builtin-pacing.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/roll-receipt-gateway.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-fly-rollback-alignment.ts +0 -14
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +45 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +6 -66
- package/dist/cli/{agents-7ZZSF4FS.js → agents-BCLO3KQJ.js} +204 -41
- package/dist/cli/{agents-6WN5LYUP.mjs → agents-ULGDKUTM.mjs} +182 -19
- package/dist/cli/{auth-I2QVO677.mjs → auth-4WCL7A6W.mjs} +5 -5
- package/dist/cli/auth-DXUHEL5I.js +44 -0
- package/dist/cli/{billing-YPH4GEWU.mjs → billing-7JQ6EUQU.mjs} +9 -9
- package/dist/cli/{billing-44QFBUWA.js → billing-BF5LVXOM.js} +102 -102
- package/dist/cli/{chunk-MGF3MK27.mjs → chunk-2T7XOKVL.mjs} +5 -5
- package/dist/cli/{chunk-7UR57HPJ.js → chunk-2UM3I2MY.js} +1 -1
- package/dist/cli/{chunk-SRUNYWQ2.mjs → chunk-3PVKXUSJ.mjs} +1 -1
- package/dist/cli/{chunk-W6UCS3O6.mjs → chunk-56N3XAT6.mjs} +5 -5
- package/dist/cli/{chunk-LLSCFLFU.mjs → chunk-5D7OJY4W.mjs} +1 -1
- package/dist/cli/{chunk-5E2PAGF5.js → chunk-5H6254MJ.js} +21 -21
- package/dist/cli/{chunk-VYSUJMB5.js → chunk-5VSHQG5E.js} +8 -8
- package/dist/cli/{chunk-SLXCVPN7.js → chunk-636GD4IR.js} +2 -2
- package/dist/cli/{chunk-LJLM4BUL.js → chunk-6IKLITVH.js} +6 -6
- package/dist/cli/{chunk-D6ZVRKJ2.js → chunk-737Y7QGT.js} +41 -41
- package/dist/cli/{chunk-UXIUAIL2.js → chunk-7DLAJ6JJ.js} +53 -53
- package/dist/cli/{chunk-2QYU57RG.js → chunk-AO56MZ7D.js} +3 -3
- package/dist/cli/{chunk-BUBOZKH2.js → chunk-AS5XGOZY.js} +2 -2
- package/dist/cli/{chunk-XVBEEGI4.mjs → chunk-BM536WWR.mjs} +1 -1
- package/dist/cli/{chunk-DX646HO7.mjs → chunk-BONMEBWZ.mjs} +4 -4
- package/dist/cli/{chunk-S22FSNNC.mjs → chunk-BQUAE6LQ.mjs} +1 -1
- package/dist/cli/{chunk-G7OR3GVD.mjs → chunk-CVY4MBXH.mjs} +5 -5
- package/dist/cli/{chunk-KSHZY52O.js → chunk-DMPGJCNZ.js} +72 -10
- package/dist/cli/{chunk-Q3A53SWK.mjs → chunk-DWUESXDD.mjs} +1 -1
- package/dist/cli/{chunk-IA2LTIWO.mjs → chunk-E4RYSSXX.mjs} +2 -2
- package/dist/cli/{chunk-VLUBEMWM.js → chunk-EV3OPDHF.js} +20 -20
- package/dist/cli/{chunk-ECLCRE5P.js → chunk-EZIXKNKM.js} +3 -3
- package/dist/cli/{chunk-JCO226JM.mjs → chunk-FDCU3VAJ.mjs} +72 -10
- package/dist/cli/{chunk-6B5EZOI3.js → chunk-FXXERR52.js} +10 -10
- package/dist/cli/{chunk-L2NXB4WG.mjs → chunk-FYKHAT2F.mjs} +64 -3
- package/dist/cli/{chunk-NDDGFX4X.js → chunk-G2H6SQQY.js} +11 -11
- package/dist/cli/{chunk-I62ZBEKH.js → chunk-G4WPDCXA.js} +48 -48
- package/dist/cli/{chunk-G2HW2SAP.js → chunk-GB4IZ5TV.js} +13 -13
- package/dist/cli/{chunk-7334X74C.mjs → chunk-GQZFZG6R.mjs} +2 -2
- package/dist/cli/{chunk-JY7RKJ65.mjs → chunk-H3CG72RZ.mjs} +13 -13
- package/dist/cli/{chunk-N6I3BB2O.js → chunk-H6JMRLAZ.js} +274 -274
- package/dist/cli/{chunk-6GZIT3TH.js → chunk-HEOM3FAC.js} +20 -20
- package/dist/cli/{chunk-DG56RWI2.js → chunk-HO76C7AE.js} +2 -2
- package/dist/cli/{chunk-X7RKCAMX.mjs → chunk-IAJ65IDZ.mjs} +4 -4
- package/dist/cli/{chunk-ZFXDD7VM.mjs → chunk-IBYMGR5Y.mjs} +1 -1
- package/dist/cli/{chunk-LCAXLGAY.mjs → chunk-IOWLFWWG.mjs} +2 -2
- package/dist/cli/{chunk-NRVEVKXR.mjs → chunk-JGLCK2XF.mjs} +2 -2
- package/dist/cli/{chunk-IB225ZK4.js → chunk-KNCNFL76.js} +4 -4
- package/dist/cli/{chunk-QPSBV4FD.mjs → chunk-MN7JLH2T.mjs} +2 -2
- package/dist/cli/{chunk-OH6WOID2.mjs → chunk-MWLOBURN.mjs} +2 -2
- package/dist/cli/{chunk-AFPGYZBH.js → chunk-MXK4M7HP.js} +17 -17
- package/dist/cli/{chunk-MAMGREBW.mjs → chunk-NF722E6C.mjs} +1 -1
- package/dist/cli/{chunk-7GQU46SZ.js → chunk-PQYDO72W.js} +26 -26
- package/dist/cli/{chunk-4T2U72SP.mjs → chunk-QEDRUURT.mjs} +1 -1
- package/dist/cli/{chunk-B2XLIQPH.mjs → chunk-QKP3WYSZ.mjs} +2 -2
- package/dist/cli/{chunk-VGIDPJXM.mjs → chunk-RHRRY2BX.mjs} +3 -3
- package/dist/cli/{chunk-ZTCP5BHH.mjs → chunk-RW3URFZK.mjs} +2 -2
- package/dist/cli/{chunk-XMBTAPHR.js → chunk-SKHUWQZE.js} +7 -7
- package/dist/cli/{chunk-OIZUFRTE.mjs → chunk-SYQTBHRX.mjs} +3 -3
- package/dist/cli/{chunk-PW6NKI2A.mjs → chunk-TMFR2B45.mjs} +3 -3
- package/dist/cli/{chunk-YR4REP4D.mjs → chunk-TTBZ7QXX.mjs} +1 -1
- package/dist/cli/{chunk-GMQZFWQU.mjs → chunk-UQZP7XBQ.mjs} +7 -7
- package/dist/cli/{chunk-DOZIWA66.js → chunk-V5XLENWK.js} +5 -5
- package/dist/cli/{chunk-2TMAKJBT.mjs → chunk-X47J55ZJ.mjs} +2 -2
- package/dist/cli/{chunk-ID3LGPOE.js → chunk-XFV353R2.js} +23 -23
- package/dist/cli/{chunk-2RPRSTHD.js → chunk-YNAXKA23.js} +5 -5
- package/dist/cli/{chunk-IXYVHTRZ.js → chunk-ZO65VJRJ.js} +70 -9
- package/dist/cli/{chunk-PP5RMEQQ.js → chunk-ZQXJYO5P.js} +5 -5
- package/dist/cli/{chunk-H7PVSG3L.js → chunk-ZS6DT4LD.js} +15 -15
- package/dist/cli/{chunk-Z3XFXFRT.js → chunk-ZYSJND73.js} +9 -9
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{concurrent-runs-help-ROQM6UB3.mjs → concurrent-runs-help-HITK6EOO.mjs} +6 -6
- package/dist/cli/concurrent-runs-help-JLWY54WL.js +22 -0
- package/dist/cli/{csv-FWGSY4GE.js → csv-RS7XHQ4P.js} +13 -13
- package/dist/cli/{csv-R7GV33BC.mjs → csv-V2T23MXT.mjs} +4 -4
- package/dist/cli/{db-UWXA4RRV.mjs → db-OQ4RNTGE.mjs} +6 -6
- package/dist/cli/{db-OCH35YJG.js → db-WFIVRPKY.js} +27 -27
- package/dist/cli/describe-33PBWO5O.js +50 -0
- package/dist/cli/{describe-QI4HMUGE.mjs → describe-AXV2EEX3.mjs} +21 -21
- package/dist/cli/describe-core.d.mts +10 -1
- package/dist/cli/describe-core.d.ts +10 -1
- package/dist/cli/describe-core.js +4 -4
- package/dist/cli/describe-core.mjs +3 -3
- package/dist/cli/{executions-7CFGC24E.js → executions-5H2RIWZ3.js} +8 -8
- package/dist/cli/{executions-YF3KMZZN.mjs → executions-THP5ZDBQ.mjs} +6 -6
- package/dist/cli/{feedback-DWIWBS7O.mjs → feedback-2EJPILGE.mjs} +6 -6
- package/dist/cli/{feedback-YCZHHSBS.js → feedback-UOI6UEGA.js} +14 -14
- package/dist/cli/git-2OPYEPYW.js +26 -0
- package/dist/cli/{git-XCGMQQOD.mjs → git-DI3LJIAT.mjs} +5 -5
- package/dist/cli/index.js +148 -148
- package/dist/cli/index.mjs +47 -47
- package/dist/cli/{integrations-5ABAJBSW.mjs → integrations-DJYS5VRK.mjs} +7 -7
- package/dist/cli/{integrations-IEZA3TGK.js → integrations-TYN2BSQ6.js} +29 -29
- package/dist/cli/{legacy-noops-KNFLJ5P2.js → legacy-noops-GXQHNLGJ.js} +9 -9
- package/dist/cli/{legacy-noops-OZMY73Y3.mjs → legacy-noops-Z457BB6O.mjs} +6 -6
- package/dist/cli/{mcp-WSPFKQPZ.mjs → mcp-NAW3GFNN.mjs} +4 -4
- package/dist/cli/{mcp-NLQAO7KP.js → mcp-WMBOOTQL.js} +24 -24
- package/dist/cli/{monitors-LPKFFTOX.mjs → monitors-A7NYAXSJ.mjs} +7 -7
- package/dist/cli/{monitors-BJYOB4S3.js → monitors-OOQVE7XR.js} +100 -100
- package/dist/cli/{org-RYPMUYUW.mjs → org-7YCDUSZE.mjs} +6 -6
- package/dist/cli/{org-WIVHI4WT.js → org-D2AMIVBS.js} +121 -121
- package/dist/cli/{outcomes-QKX7IE3O.js → outcomes-2FKZDJSQ.js} +14 -14
- package/dist/cli/{outcomes-FADJYC4I.mjs → outcomes-TNTKCUEO.mjs} +6 -6
- package/dist/cli/{play-4ZKK5Q7U.mjs → play-L6CVHSN4.mjs} +20 -20
- package/dist/cli/{play-ID73J3NP.js → play-NWKHCHVZ.js} +349 -349
- package/dist/cli/{providers-LURYBSNO.mjs → providers-22LO747B.mjs} +6 -6
- package/dist/cli/{providers-WCCGYGW6.js → providers-PZGOI5CN.js} +9 -9
- package/dist/cli/{quickstart-KCCSEE5J.mjs → quickstart-3ZRVKGMH.mjs} +4 -4
- package/dist/cli/{quickstart-LVPOU25V.js → quickstart-LLWOC2GR.js} +6 -6
- package/dist/cli/{run-XXK7DDUF.mjs → run-D46W2GUA.mjs} +48 -27
- package/dist/cli/{run-2QMJRCVA.js → run-SNF23STR.js} +70 -49
- package/dist/cli/search-H57MZPLF.js +32 -0
- package/dist/cli/{search-ZYAWW3CK.mjs → search-XWVCICIX.mjs} +7 -7
- package/dist/cli/{search-output-YNXAZSKT.js → search-output-36GHD67U.js} +8 -8
- package/dist/cli/{search-output-N45AIOB4.mjs → search-output-YM5QXFQQ.mjs} +5 -5
- package/dist/cli/{secrets-7Q3AOUAS.mjs → secrets-7PTZEFRC.mjs} +6 -6
- package/dist/cli/{secrets-MHT27L2M.js → secrets-UXCIHG5I.js} +15 -15
- package/dist/cli/{sessions-6QKOM7M3.mjs → sessions-DTXJKRP4.mjs} +6 -6
- package/dist/cli/sessions-JJZMQSH4.js +23 -0
- package/dist/cli/{settings-NPVIDENI.mjs → settings-74B6UOS4.mjs} +12 -12
- package/dist/cli/{settings-OP7Q6YX6.js → settings-EYSDZE37.js} +85 -85
- package/dist/cli/{setup-OOT3EIMF.mjs → setup-2QRZ36CH.mjs} +9 -9
- package/dist/cli/{setup-RT6GHL3W.js → setup-E7PVXBPL.js} +49 -49
- package/dist/cli/{skills-TEXI4CLZ.mjs → skills-2WZ7N3UW.mjs} +7 -7
- package/dist/cli/skills-RIF2DCZI.js +37 -0
- package/dist/cli/tools-7VRQ4GSI.js +57 -0
- package/dist/cli/{tools-G5L36M3X.mjs → tools-YK5SCUZD.mjs} +19 -19
- package/dist/cli/{update-YNKQTE4D.mjs → update-563YQK53.mjs} +9 -9
- package/dist/cli/update-CMZAIAES.js +37 -0
- package/dist/cli/{views-IQFMUMLU.mjs → views-ISNCRZUP.mjs} +6 -6
- package/dist/cli/{views-OVQ5AQAU.js → views-OLPS6TPG.js} +21 -21
- package/dist/cli/{workflow-Y5IFMI7N.mjs → workflow-B3ZKU3OR.mjs} +7 -7
- package/dist/cli/{workflow-RCBYXIFZ.js → workflow-CUSCTYMW.js} +17 -17
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +122 -122
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-UKPV5U2B.js +0 -44
- package/dist/cli/concurrent-runs-help-BFVCUJF4.js +0 -22
- package/dist/cli/describe-6OI5K2SH.js +0 -50
- package/dist/cli/git-TGLNZRS3.js +0 -26
- package/dist/cli/search-AQSAXA6D.js +0 -32
- package/dist/cli/sessions-RGD7L4LC.js +0 -23
- package/dist/cli/skills-ERAA734H.js +0 -37
- package/dist/cli/tools-D5SZSIIH.js +0 -57
- package/dist/cli/update-WZ6527EF.js +0 -37
|
@@ -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.
|
|
208
|
+
version: '0.3.575',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -545,24 +545,6 @@
|
|
|
545
545
|
"failureAlert": "github_workflow_run",
|
|
546
546
|
"domainReportRequired": true
|
|
547
547
|
},
|
|
548
|
-
{
|
|
549
|
-
"id": "github.release-train",
|
|
550
|
-
"name": "Release train",
|
|
551
|
-
"scheduler": "github_actions",
|
|
552
|
-
"cadence": "*/5 * * * *",
|
|
553
|
-
"timezone": "UTC",
|
|
554
|
-
"source": ".github/workflows/release-train.yml",
|
|
555
|
-
"locator": "schedule:",
|
|
556
|
-
"owner": "platform",
|
|
557
|
-
"criticality": "operational",
|
|
558
|
-
"purpose": "Recheck whether the latest main commit can start a release train after a cadence or capacity deferral.",
|
|
559
|
-
"successDefinition": "The starter is disabled, or it records a dispatch or deferral decision and GitHub accepts any selected train dispatch.",
|
|
560
|
-
"failureDefinition": "Git ref or train history lookup fails, the configured cadence is invalid, or GitHub rejects the selected dispatch.",
|
|
561
|
-
"startGraceMs": 600000,
|
|
562
|
-
"runTimeoutMs": 300000,
|
|
563
|
-
"failureAlert": "github_workflow_run",
|
|
564
|
-
"domainReportRequired": true
|
|
565
|
-
},
|
|
566
548
|
{
|
|
567
549
|
"id": "github.runtime-lifecycle",
|
|
568
550
|
"name": "On-Demand Runtime Lifecycle Load Check",
|
|
@@ -256,6 +256,13 @@ type RuntimeApiRequest =
|
|
|
256
256
|
inputSha256?: string;
|
|
257
257
|
replayedFromRunId?: string | null;
|
|
258
258
|
firstClaimLatencyMs?: number;
|
|
259
|
+
/**
|
|
260
|
+
* Epoch ms the scheduler committed the run's start (its outbox row).
|
|
261
|
+
* The app records run.started at this time instead of when the
|
|
262
|
+
* delivery arrives, so a late delivery cannot put startedAt after
|
|
263
|
+
* finishedAt. Optional: older workers omit it.
|
|
264
|
+
*/
|
|
265
|
+
startedAt?: number;
|
|
259
266
|
}
|
|
260
267
|
| {
|
|
261
268
|
action: 'record_first_claim_latency';
|
|
@@ -3143,6 +3150,7 @@ export async function startRunViaAppRuntime(
|
|
|
3143
3150
|
replayedFromRunId?: string | null;
|
|
3144
3151
|
firstClaimLatencyMs?: number;
|
|
3145
3152
|
idempotencyKey?: string;
|
|
3153
|
+
startedAt?: number;
|
|
3146
3154
|
},
|
|
3147
3155
|
): Promise<void> {
|
|
3148
3156
|
await postAppRuntimeApi<{ ok: true }>(context, {
|
|
@@ -37,6 +37,24 @@ export const CTX_FETCH_EGRESS_PACING = {
|
|
|
37
37
|
rules: [CTX_FETCH_EGRESS_PACING_RULE],
|
|
38
38
|
} satisfies BuiltinPacingPolicy;
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Whether a 429 from the called service may cool the tool's shared rate
|
|
42
|
+
* bucket. A provider's 429 normally speaks for its whole quota, so it does.
|
|
43
|
+
* `generic_http` is every public host behind one workspace bucket: one site's
|
|
44
|
+
* `Retry-After` says nothing about another, and recording it would hold every
|
|
45
|
+
* other HTTP call in the workspace for as long as that site asked. The call
|
|
46
|
+
* that received the 429 still honors it on its own retry.
|
|
47
|
+
*/
|
|
48
|
+
export function destinationBackpressureCoolsSharedBucket(input: {
|
|
49
|
+
toolId?: string;
|
|
50
|
+
provider: string;
|
|
51
|
+
}): boolean {
|
|
52
|
+
return (
|
|
53
|
+
input.toolId !== CTX_FETCH_EGRESS_TOOL_ID &&
|
|
54
|
+
input.provider !== CTX_FETCH_EGRESS_PROVIDER
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
40
58
|
export function resolveBuiltinPacing(
|
|
41
59
|
toolId: string,
|
|
42
60
|
): { provider: string; rules: PacingRule[] } | null {
|
|
@@ -176,6 +176,7 @@ import {
|
|
|
176
176
|
import {
|
|
177
177
|
CTX_FETCH_EGRESS_PROVIDER,
|
|
178
178
|
CTX_FETCH_EGRESS_TOOL_ID,
|
|
179
|
+
destinationBackpressureCoolsSharedBucket,
|
|
179
180
|
} from './builtin-pacing';
|
|
180
181
|
import {
|
|
181
182
|
legacyRawFromToolResponseRawV2,
|
|
@@ -25579,7 +25580,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
25579
25580
|
provider,
|
|
25580
25581
|
retryAfterMs,
|
|
25581
25582
|
retryAtMs,
|
|
25582
|
-
outcome:
|
|
25583
|
+
outcome: destinationBackpressureCoolsSharedBucket({ toolId, provider })
|
|
25584
|
+
? 'recorded'
|
|
25585
|
+
: 'not_recorded_destination_scoped',
|
|
25583
25586
|
})}`,
|
|
25584
25587
|
{ level: 'warn' },
|
|
25585
25588
|
);
|
package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/roll-receipt-gateway.ts
CHANGED
|
@@ -1734,7 +1734,7 @@ async function activate(operationId: string): Promise<void> {
|
|
|
1734
1734
|
}
|
|
1735
1735
|
|
|
1736
1736
|
// There is deliberately no release-SHA fence here. The workflow's
|
|
1737
|
-
// release
|
|
1737
|
+
// Production release concurrency group runs one release at a time and
|
|
1738
1738
|
// debounces queued pushes to the newest main commit, so a cutover that has
|
|
1739
1739
|
// started finishes even when main moves; the newer commit releases next.
|
|
1740
1740
|
// Aborting here used to strand every release once merges landed faster than
|
package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-fly-rollback-alignment.ts
CHANGED
|
@@ -56,7 +56,6 @@ export interface VercelDeploymentEventSummary {
|
|
|
56
56
|
export type VercelPromotionTiming = {
|
|
57
57
|
requestedAt: number;
|
|
58
58
|
previousReleaseAt?: number;
|
|
59
|
-
train?: { runId: string; attempt: string; durationMs: number };
|
|
60
59
|
};
|
|
61
60
|
|
|
62
61
|
export function vercelPromotionTimingKey(deploymentId: string): string {
|
|
@@ -311,19 +310,6 @@ export function buildVercelDeploymentSlackText(
|
|
|
311
310
|
`${formatDuration(sinceRelease)} since last Production release`,
|
|
312
311
|
);
|
|
313
312
|
}
|
|
314
|
-
const train = timing.train;
|
|
315
|
-
if (
|
|
316
|
-
train &&
|
|
317
|
-
/^[1-9]\d*$/.test(train.runId) &&
|
|
318
|
-
/^[1-9]\d*$/.test(train.attempt) &&
|
|
319
|
-
Number.isFinite(train.durationMs) &&
|
|
320
|
-
train.durationMs >= 0
|
|
321
|
-
) {
|
|
322
|
-
const url = `https://github.com/getaero-io/deepline-api/actions/runs/${train.runId}/attempts/${train.attempt}`;
|
|
323
|
-
timingParts.push(
|
|
324
|
-
`CI train <${url}|${formatDuration(train.durationMs)}>`,
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
313
|
}
|
|
328
314
|
}
|
|
329
315
|
return [
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
InMemoryBudgetStateBackend,
|
|
39
39
|
type BudgetStateBackend,
|
|
40
40
|
} from './budget-state-backend';
|
|
41
|
+
import { destinationBackpressureCoolsSharedBucket } from '../builtin-pacing';
|
|
41
42
|
import { PROVIDER_CONCURRENCY_SAFETY_LIMIT } from '../provider-capacity/provider-concurrency-policy';
|
|
42
43
|
|
|
43
44
|
export interface WorkLease {
|
|
@@ -1012,6 +1013,9 @@ export function createPlayExecutionGovernor(
|
|
|
1012
1013
|
resolveRowConcurrency(policy, requested, input.maxConcurrentRows),
|
|
1013
1014
|
|
|
1014
1015
|
async reportProviderBackpressure(bp) {
|
|
1016
|
+
// Arbitrary-host egress: the 429 belongs to one destination, not to
|
|
1017
|
+
// the workspace's shared generic_http bucket.
|
|
1018
|
+
if (!destinationBackpressureCoolsSharedBucket(bp)) return;
|
|
1015
1019
|
// DB-authoritative pacer: route backpressure ONLY to the row via
|
|
1016
1020
|
// penalize. The in-memory adaptive admission must not also halve, or the
|
|
1017
1021
|
// provider would be throttled twice (once in the row, once in memory).
|
|
@@ -922,9 +922,7 @@ function emitModalStage(
|
|
|
922
922
|
stage,
|
|
923
923
|
// Early-start stages name their org so per-org monitoring reads it
|
|
924
924
|
// directly; other stages are unchanged.
|
|
925
|
-
...(stage.startsWith('early:')
|
|
926
|
-
? { orgId: context.orgId ?? null }
|
|
927
|
-
: {}),
|
|
925
|
+
...(stage.startsWith('early:') ? { orgId: context.orgId ?? null } : {}),
|
|
928
926
|
...extra,
|
|
929
927
|
atMs: Date.now(),
|
|
930
928
|
}),
|
|
@@ -1671,7 +1669,9 @@ export async function startEarlyModalPreboot(input: {
|
|
|
1671
1669
|
? {}
|
|
1672
1670
|
: { memoryLimitMiB: runner.memoryLimitMiB }),
|
|
1673
1671
|
bakedRunnerHash: bakedRunner.hash,
|
|
1674
|
-
runnerCommandSha256: earlyPrebootRunnerCommandSha256(
|
|
1672
|
+
runnerCommandSha256: earlyPrebootRunnerCommandSha256(
|
|
1673
|
+
runner.command,
|
|
1674
|
+
),
|
|
1675
1675
|
}),
|
|
1676
1676
|
};
|
|
1677
1677
|
const bytes = modalSandboxTagsBytes(published);
|
|
@@ -2273,6 +2273,23 @@ export function earlyModalNarrowedAllowlist(input: {
|
|
|
2273
2273
|
});
|
|
2274
2274
|
}
|
|
2275
2275
|
|
|
2276
|
+
/**
|
|
2277
|
+
* The runner config a launch sends. A runner in an adopted EN sandbox has
|
|
2278
|
+
* outbound network only to the gateways, so its ctx.fetch goes through the
|
|
2279
|
+
* gateway egress broker, as under the supervisor sidecar. Every other launch
|
|
2280
|
+
* sends its config unchanged.
|
|
2281
|
+
*/
|
|
2282
|
+
export function launchRunnerConfig<
|
|
2283
|
+
T extends { context: { egressViaRuntimeBroker?: boolean } },
|
|
2284
|
+
>(config: T, adoptedNarrowedEgress: boolean): T {
|
|
2285
|
+
return adoptedNarrowedEgress
|
|
2286
|
+
? {
|
|
2287
|
+
...config,
|
|
2288
|
+
context: { ...config.context, egressViaRuntimeBroker: true },
|
|
2289
|
+
}
|
|
2290
|
+
: config;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2276
2293
|
/**
|
|
2277
2294
|
* The egress parameters a launch adopts an early sandbox under. Without EN,
|
|
2278
2295
|
* the launch's own create parameters (today). With EN, the list this launch
|
|
@@ -2928,6 +2945,10 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
2928
2945
|
PREBOOT_RUNNER_IN_EARLY_SANDBOX,
|
|
2929
2946
|
);
|
|
2930
2947
|
let sandbox: ModalSandbox;
|
|
2948
|
+
// An adopted EN sandbox reaches only the two gateways, so the runner
|
|
2949
|
+
// must send ctx.fetch through the gateway's egress broker; a direct
|
|
2950
|
+
// fetch to any other host cannot connect.
|
|
2951
|
+
let adoptedNarrowedEgress = false;
|
|
2931
2952
|
let createSent = false;
|
|
2932
2953
|
try {
|
|
2933
2954
|
// This is deliberately adjacent to the real provider boundary. The
|
|
@@ -3029,7 +3050,13 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
3029
3050
|
: { memoryLimitMiB: runMemoryLimitMiB }),
|
|
3030
3051
|
workDir: modalConfig.workdir,
|
|
3031
3052
|
},
|
|
3032
|
-
}).then((adopted) =>
|
|
3053
|
+
}).then((adopted) => {
|
|
3054
|
+
if (adopted) {
|
|
3055
|
+
adoptedNarrowedEgress = adoptionEgress?.narrowed === true;
|
|
3056
|
+
return adopted;
|
|
3057
|
+
}
|
|
3058
|
+
return createSandbox();
|
|
3059
|
+
})
|
|
3033
3060
|
: createSandbox(),
|
|
3034
3061
|
onLateSuccess: async (lateSandbox) => {
|
|
3035
3062
|
logSandboxCreateOutcome({
|
|
@@ -3101,6 +3128,11 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
3101
3128
|
sandboxId: sandbox.sandboxId,
|
|
3102
3129
|
elapsedMs: Date.now() - startedAt,
|
|
3103
3130
|
});
|
|
3131
|
+
if (adoptedNarrowedEgress) {
|
|
3132
|
+
emitModalStage(config.context, 'early:egress_broker', {
|
|
3133
|
+
sandboxId: sandbox.sandboxId,
|
|
3134
|
+
});
|
|
3135
|
+
}
|
|
3104
3136
|
logSandboxCreateOutcome({
|
|
3105
3137
|
provider: 'modal',
|
|
3106
3138
|
outcome: 'succeeded',
|
|
@@ -3376,7 +3408,10 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
3376
3408
|
envelopeDelivery: 'stdin' as const,
|
|
3377
3409
|
}
|
|
3378
3410
|
: {}),
|
|
3379
|
-
config: withRunnerSandboxProvider(
|
|
3411
|
+
config: withRunnerSandboxProvider(
|
|
3412
|
+
launchRunnerConfig(runnerConfig, adoptedNarrowedEgress),
|
|
3413
|
+
'modal',
|
|
3414
|
+
),
|
|
3380
3415
|
...(memoryPolicy.memoryLimitMiB > memoryPolicy.reservationMemoryMiB
|
|
3381
3416
|
? { memoryLimitMiB: memoryPolicy.memoryLimitMiB }
|
|
3382
3417
|
: {}),
|
|
@@ -3464,7 +3499,10 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
3464
3499
|
}),
|
|
3465
3500
|
},
|
|
3466
3501
|
bundlePromise,
|
|
3467
|
-
config: withRunnerSandboxProvider(
|
|
3502
|
+
config: withRunnerSandboxProvider(
|
|
3503
|
+
launchRunnerConfig(runnerConfig, adoptedNarrowedEgress),
|
|
3504
|
+
'modal',
|
|
3505
|
+
),
|
|
3468
3506
|
...(memoryPolicy.memoryLimitMiB >
|
|
3469
3507
|
memoryPolicy.reservationMemoryMiB
|
|
3470
3508
|
? { memoryLimitMiB: memoryPolicy.memoryLimitMiB }
|
|
@@ -15363,72 +15363,6 @@ export async function readPostgresSchedulerComputeBillingRecovery(
|
|
|
15363
15363
|
: null;
|
|
15364
15364
|
}
|
|
15365
15365
|
|
|
15366
|
-
/** A finalized Preview charge can outlive its test workspace and job ACK. */
|
|
15367
|
-
export async function acknowledgeFinalizedTrainComputeBillingJob(
|
|
15368
|
-
client: PostgresSchedulerQueryClient,
|
|
15369
|
-
input: {
|
|
15370
|
-
schema: string;
|
|
15371
|
-
runId: string;
|
|
15372
|
-
orgId: string;
|
|
15373
|
-
attemptCount: number;
|
|
15374
|
-
resumeEpoch: string | null;
|
|
15375
|
-
resourceSnapshot: ReadonlyArray<readonly [number, unknown]>;
|
|
15376
|
-
},
|
|
15377
|
-
): Promise<boolean> {
|
|
15378
|
-
const { schema, runId, orgId, attemptCount, resumeEpoch, resourceSnapshot } =
|
|
15379
|
-
input;
|
|
15380
|
-
if (!/^runtime_scheduler_preview_release_train(?:_[b-d])?$/u.test(schema)) {
|
|
15381
|
-
throw new Error(
|
|
15382
|
-
'Finalized train billing recovery requires a named Preview lane.',
|
|
15383
|
-
);
|
|
15384
|
-
}
|
|
15385
|
-
const result = await client.query(
|
|
15386
|
-
`WITH matching_run AS MATERIALIZED (
|
|
15387
|
-
SELECT run.run_id
|
|
15388
|
-
FROM ${tableName('runs', { schema })} AS run
|
|
15389
|
-
WHERE run.run_id = $1 AND run.org_id = $2
|
|
15390
|
-
AND run.status IN ('completed', 'failed', 'cancelled')
|
|
15391
|
-
AND run.launch_json->>'schedulerSchema' = $3
|
|
15392
|
-
AND (run.launch_json->>'resumeEpoch') IS NOT DISTINCT FROM $4
|
|
15393
|
-
AND coalesce(run.admission_json, run.launch_json)->>'schedulerSchema' = $3
|
|
15394
|
-
AND (coalesce(run.admission_json, run.launch_json)->>'resumeEpoch')
|
|
15395
|
-
IS NOT DISTINCT FROM $4
|
|
15396
|
-
FOR UPDATE OF run
|
|
15397
|
-
), matching_attempts AS MATERIALIZED (
|
|
15398
|
-
SELECT attempt.attempt, attempt.resource_json
|
|
15399
|
-
FROM ${tableName('attempts', { schema })} AS attempt
|
|
15400
|
-
JOIN matching_run ON matching_run.run_id = attempt.run_id
|
|
15401
|
-
ORDER BY attempt.attempt
|
|
15402
|
-
FOR UPDATE OF attempt
|
|
15403
|
-
)
|
|
15404
|
-
UPDATE ${tableName('compute_billing_jobs_v2', { schema })} AS job
|
|
15405
|
-
SET status = 'settled', blocked_at = NULL, block_reason = NULL,
|
|
15406
|
-
last_error = NULL, settled_at = now(), updated_at = now()
|
|
15407
|
-
FROM matching_run
|
|
15408
|
-
WHERE job.run_id = matching_run.run_id
|
|
15409
|
-
AND job.status = 'pending' AND job.blocked_at IS NOT NULL
|
|
15410
|
-
AND job.lease_owner IS NULL AND job.lease_expires_at IS NULL
|
|
15411
|
-
AND job.attempt_count = $5
|
|
15412
|
-
AND $6::jsonb = (
|
|
15413
|
-
SELECT coalesce(
|
|
15414
|
-
jsonb_agg(jsonb_build_array(attempt, resource_json) ORDER BY attempt),
|
|
15415
|
-
'[]'::jsonb
|
|
15416
|
-
)
|
|
15417
|
-
FROM matching_attempts
|
|
15418
|
-
)
|
|
15419
|
-
RETURNING job.run_id`,
|
|
15420
|
-
[
|
|
15421
|
-
runId,
|
|
15422
|
-
orgId,
|
|
15423
|
-
schema,
|
|
15424
|
-
resumeEpoch,
|
|
15425
|
-
attemptCount,
|
|
15426
|
-
JSON.stringify(resourceSnapshot),
|
|
15427
|
-
],
|
|
15428
|
-
);
|
|
15429
|
-
return result.rows.length === 1;
|
|
15430
|
-
}
|
|
15431
|
-
|
|
15432
15366
|
/**
|
|
15433
15367
|
* Explicit operator reconciliation takes its own settlement lease atomically.
|
|
15434
15368
|
* A retained worker must not win a pending-row race and use the old issuer.
|
|
@@ -29630,12 +29564,18 @@ async function projectPostgresSchedulerStartEvent(
|
|
|
29630
29564
|
// own envelope. Both reuse the immutable launch for omitted start metadata.
|
|
29631
29565
|
const start = { ...launch, ...(event.payload as Record<string, unknown>) };
|
|
29632
29566
|
const payload = hydrateRetainedPlayPipelines(start);
|
|
29567
|
+
const startCommittedAtMs = event.createdAt.getTime();
|
|
29633
29568
|
await startRunViaAppRuntime(runtimeApi, {
|
|
29634
29569
|
deliveryLeaseOwner: event.leaseOwner ?? undefined,
|
|
29635
29570
|
idempotencyKey: buildRunLedgerStartIdempotencyKey({
|
|
29636
29571
|
runId: event.runId,
|
|
29637
29572
|
deliveryKey: event.deliveryKey,
|
|
29638
29573
|
}),
|
|
29574
|
+
// The start's own commit time, so the app's run.started is not stamped
|
|
29575
|
+
// with this (possibly late) delivery's arrival time.
|
|
29576
|
+
...(Number.isFinite(startCommittedAtMs) && startCommittedAtMs > 0
|
|
29577
|
+
? { startedAt: startCommittedAtMs }
|
|
29578
|
+
: {}),
|
|
29639
29579
|
playName: stringPayloadField(start, 'playName') ?? event.runId,
|
|
29640
29580
|
playReference: stringPayloadField(start, 'playReference'),
|
|
29641
29581
|
definitionScope: launch?.definitionScope ?? undefined,
|