deepline 0.3.538 → 0.3.539

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 (128) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +8 -1
  3. package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +66 -4
  4. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +2 -0
  5. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +0 -4
  6. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +14 -5
  7. package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +136 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  9. package/dist/cli/auth-O5Y2VYXK.js +43 -0
  10. package/dist/cli/{auth-KYH7N7RQ.mjs → auth-QD7QGD3B.mjs} +5 -5
  11. package/dist/cli/{billing-WK346KAI.mjs → billing-FIZXMHBW.mjs} +6 -6
  12. package/dist/cli/{billing-4KTUVZ4S.js → billing-KOQAF6WS.js} +89 -89
  13. package/dist/cli/{chunk-FWE37N2P.mjs → chunk-2XMFT44N.mjs} +1 -1
  14. package/dist/cli/{chunk-MNBIGX6O.js → chunk-3YDI2PTN.js} +10 -10
  15. package/dist/cli/{chunk-M3NCXGNN.mjs → chunk-55ITVU2V.mjs} +2 -2
  16. package/dist/cli/{chunk-O765M4LT.js → chunk-5QL4GJB2.js} +2 -2
  17. package/dist/cli/{chunk-6SLQLWWL.js → chunk-5RUB53KG.js} +26 -26
  18. package/dist/cli/{chunk-ADLDU2QG.js → chunk-5YF35HAV.js} +6 -6
  19. package/dist/cli/{chunk-A6E7TCK2.mjs → chunk-6KG4KVTH.mjs} +5 -5
  20. package/dist/cli/{chunk-VCHV4LS3.mjs → chunk-6NZBLFL4.mjs} +1 -1
  21. package/dist/cli/{chunk-KNIYEZVV.mjs → chunk-6V3LNYK5.mjs} +2 -2
  22. package/dist/cli/{chunk-TWWYCJJW.mjs → chunk-ADV2IB2C.mjs} +5 -5
  23. package/dist/cli/{chunk-7XDJKIM2.mjs → chunk-APKZGUTU.mjs} +4 -4
  24. package/dist/cli/{chunk-P3DP56HB.js → chunk-CQJCLHBE.js} +41 -41
  25. package/dist/cli/{chunk-N2BCPZVR.mjs → chunk-DZFVVP3S.mjs} +5 -5
  26. package/dist/cli/{chunk-T6GPTJ5F.mjs → chunk-E4QHTDPF.mjs} +1 -1
  27. package/dist/cli/{chunk-25RGHJQL.js → chunk-EAZS52DL.js} +15 -15
  28. package/dist/cli/{chunk-JPEBKN3K.mjs → chunk-F43MXIN3.mjs} +2 -2
  29. package/dist/cli/{chunk-KCUQNH4K.js → chunk-FH3P3E4S.js} +2 -2
  30. package/dist/cli/{chunk-ICTA5ICE.mjs → chunk-FIRV7BXJ.mjs} +1 -1
  31. package/dist/cli/{chunk-VIFLWQXS.js → chunk-FSQCB5SJ.js} +2 -2
  32. package/dist/cli/{chunk-5VSPRRTI.js → chunk-FTBWFDF3.js} +7 -7
  33. package/dist/cli/{chunk-CLO562KG.mjs → chunk-G3UFDUYU.mjs} +1 -1
  34. package/dist/cli/{chunk-UE7JHAZ2.mjs → chunk-GEO2EMM7.mjs} +1 -1
  35. package/dist/cli/{chunk-ZDLDCXY3.mjs → chunk-GLEGINSP.mjs} +2 -2
  36. package/dist/cli/{chunk-6JG3MRTM.mjs → chunk-GLKUC5PO.mjs} +2 -2
  37. package/dist/cli/{chunk-FJ5KPGCS.mjs → chunk-GNCIMHO2.mjs} +10 -10
  38. package/dist/cli/{chunk-IMLFB66A.js → chunk-ISXX5DUD.js} +3 -3
  39. package/dist/cli/{chunk-4KZF6OYY.mjs → chunk-JBCQFG7G.mjs} +3 -3
  40. package/dist/cli/{chunk-JTOV5RUA.mjs → chunk-JHEZQMOM.mjs} +1 -1
  41. package/dist/cli/{chunk-JCLRSMUP.js → chunk-K22EKW6L.js} +5 -5
  42. package/dist/cli/{chunk-B2BTBHX2.js → chunk-K5MZHTK7.js} +3 -3
  43. package/dist/cli/{chunk-MYSPQUAO.js → chunk-KAEVL62Q.js} +44 -44
  44. package/dist/cli/{chunk-34PLG5OE.js → chunk-KQTX545E.js} +13 -13
  45. package/dist/cli/{chunk-ALARRSMZ.mjs → chunk-LE5KN7CZ.mjs} +3 -3
  46. package/dist/cli/{chunk-PQKD5DMT.js → chunk-LEREPTAE.js} +19 -19
  47. package/dist/cli/{chunk-OOLBE6FR.js → chunk-MI53W4DN.js} +53 -53
  48. package/dist/cli/{chunk-ZU6JBRV5.mjs → chunk-MKESK3SW.mjs} +4 -4
  49. package/dist/cli/{chunk-4WQR4DG4.mjs → chunk-N3LPGGWD.mjs} +1 -1
  50. package/dist/cli/{chunk-UEZNIPFO.js → chunk-NR5PLMNG.js} +107 -107
  51. package/dist/cli/{chunk-3I5TU5XE.js → chunk-Q4HNK7JX.js} +8 -8
  52. package/dist/cli/{chunk-35OCRH5C.mjs → chunk-RULRGMMM.mjs} +5 -5
  53. package/dist/cli/{chunk-IP3XJTWA.mjs → chunk-SDAP5MCO.mjs} +2 -2
  54. package/dist/cli/{chunk-YQURGSRB.js → chunk-TZBCJHV6.js} +1 -1
  55. package/dist/cli/{chunk-LPTBHNGB.js → chunk-V7DEGIYO.js} +4 -4
  56. package/dist/cli/{chunk-YZ2ZPHWR.js → chunk-VK5UTS5B.js} +9 -9
  57. package/dist/cli/{chunk-N5HSG4OV.js → chunk-W32KT6LM.js} +5 -5
  58. package/dist/cli/{chunk-ESX3H7Q7.js → chunk-XZBXQCRJ.js} +22 -22
  59. package/dist/cli/{chunk-4NEOGPKD.mjs → chunk-Y66ZMOJI.mjs} +1 -1
  60. package/dist/cli/{chunk-BBS2BLPV.js → chunk-YMQFQO3K.js} +16 -16
  61. package/dist/cli/{csv-LM7FBECI.js → csv-BWWJYV2C.js} +13 -13
  62. package/dist/cli/{csv-2YKLUKDR.mjs → csv-G5RQQ74W.mjs} +4 -4
  63. package/dist/cli/{db-5PMA4IVW.js → db-5KNDLADE.js} +27 -27
  64. package/dist/cli/{db-234UBWJH.mjs → db-AJZHWB3V.mjs} +6 -6
  65. package/dist/cli/describe-B6CN6CFJ.js +49 -0
  66. package/dist/cli/{describe-W26LW5O7.mjs → describe-QY5TKWVD.mjs} +17 -17
  67. package/dist/cli/{executions-3S736GXX.js → executions-BCCW76BI.js} +8 -8
  68. package/dist/cli/{executions-GD7GXTJM.mjs → executions-SJPH3MZT.mjs} +6 -6
  69. package/dist/cli/{feedback-BUWTDY4R.js → feedback-GF65JKK6.js} +14 -14
  70. package/dist/cli/{feedback-GBV5HJJZ.mjs → feedback-S6SZOFGK.mjs} +6 -6
  71. package/dist/cli/git-DX6NB7VF.js +25 -0
  72. package/dist/cli/{git-YXJGTDQL.mjs → git-F5FT5YVB.mjs} +5 -5
  73. package/dist/cli/index.js +139 -139
  74. package/dist/cli/index.mjs +41 -41
  75. package/dist/cli/{legacy-noops-ZSF64V2U.js → legacy-noops-ECR6FS6U.js} +9 -9
  76. package/dist/cli/{legacy-noops-UJM6GBNP.mjs → legacy-noops-NOA4P5NE.mjs} +6 -6
  77. package/dist/cli/{monitors-UERUQ6CT.mjs → monitors-CTYSAGP4.mjs} +7 -7
  78. package/dist/cli/{monitors-XQ2GNH6D.js → monitors-DEWBSURN.js} +100 -100
  79. package/dist/cli/{org-CP4VLH6M.mjs → org-EKSKKT7H.mjs} +6 -6
  80. package/dist/cli/{org-IF6MPVNR.js → org-ZM2UUMZZ.js} +86 -86
  81. package/dist/cli/{play-2NHQO5MO.js → play-6JQOM6DE.js} +317 -317
  82. package/dist/cli/{play-ZWDYYVPI.mjs → play-R2BH374J.mjs} +17 -17
  83. package/dist/cli/{providers-LOPXQN56.js → providers-CMIYHEMN.js} +9 -9
  84. package/dist/cli/{providers-2CVIATU4.mjs → providers-X7WMIWO4.mjs} +6 -6
  85. package/dist/cli/{quickstart-N4WDEQZY.js → quickstart-6HVPAMSW.js} +6 -6
  86. package/dist/cli/{quickstart-KVCFXLID.mjs → quickstart-ZZ7L6VZJ.mjs} +4 -4
  87. package/dist/cli/{run-RUXHYWLF.mjs → run-FP32RKBU.mjs} +22 -22
  88. package/dist/cli/{run-BDT5LK3I.js → run-OOHYH3GI.js} +42 -42
  89. package/dist/cli/search-34C6LFOJ.js +32 -0
  90. package/dist/cli/{search-BFUTNPA5.mjs → search-BDDNC23Z.mjs} +7 -7
  91. package/dist/cli/{search-output-CTXI2QZU.js → search-output-5VZIQQAM.js} +6 -6
  92. package/dist/cli/{search-output-WUGH4PZA.mjs → search-output-QXJ6CV5G.mjs} +4 -4
  93. package/dist/cli/{secrets-BZJZYFOU.js → secrets-EN2HQCO3.js} +15 -15
  94. package/dist/cli/{secrets-Z4XQVTC6.mjs → secrets-Z7CQSQGC.mjs} +6 -6
  95. package/dist/cli/{sessions-VZXR3MQZ.mjs → sessions-I2H37OTJ.mjs} +6 -6
  96. package/dist/cli/sessions-RYQX3NDD.js +22 -0
  97. package/dist/cli/{settings-WBYA4JMM.js → settings-CTRAPFNZ.js} +85 -85
  98. package/dist/cli/{settings-VYEZFR4L.mjs → settings-IYSC5PPQ.mjs} +12 -12
  99. package/dist/cli/{setup-H7KCI4SO.mjs → setup-PU3HOVI3.mjs} +9 -9
  100. package/dist/cli/{setup-FS2RMSS2.js → setup-XIN53GEW.js} +49 -49
  101. package/dist/cli/skills-576CX7DK.js +36 -0
  102. package/dist/cli/{skills-YQNSJUUG.mjs → skills-TYBML2ZO.mjs} +7 -7
  103. package/dist/cli/tools-EXMUWA3Z.js +56 -0
  104. package/dist/cli/{tools-ZF6SVEGW.mjs → tools-ZVNE6M6J.mjs} +16 -16
  105. package/dist/cli/{update-RKQNNJM4.mjs → update-54WENBNT.mjs} +9 -9
  106. package/dist/cli/update-RAHETNL2.js +34 -0
  107. package/dist/cli/{views-KN7FEDGT.js → views-7L75EZOJ.js} +21 -21
  108. package/dist/cli/{views-JHHOTWDU.mjs → views-EUBB4ONT.mjs} +6 -6
  109. package/dist/cli/{workflow-2WHSKTTV.js → workflow-EZVYCR6Y.js} +17 -17
  110. package/dist/cli/{workflow-AAYLCLWA.mjs → workflow-GUKGFJ72.mjs} +7 -7
  111. package/dist/index.js +9 -9
  112. package/dist/index.mjs +6 -6
  113. package/dist/install-integrity.json +101 -100
  114. package/dist/release.d.mts +1 -1
  115. package/dist/release.d.ts +1 -1
  116. package/dist/release.js +2 -2
  117. package/dist/release.mjs +1 -1
  118. package/dist/server.js +5 -5
  119. package/dist/server.mjs +3 -3
  120. package/package.json +1 -1
  121. package/dist/cli/auth-4WEVLYK4.js +0 -43
  122. package/dist/cli/describe-C7GOSGYB.js +0 -49
  123. package/dist/cli/git-YG36MROC.js +0 -25
  124. package/dist/cli/search-ATDDVADT.js +0 -32
  125. package/dist/cli/sessions-HNU35AFM.js +0 -22
  126. package/dist/cli/skills-VPIURCAZ.js +0 -36
  127. package/dist/cli/tools-273GS5HU.js +0 -56
  128. package/dist/cli/update-TOD3XY55.js +0 -34
@@ -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.538',
208
+ version: '0.3.539',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -3116,10 +3116,17 @@ export async function applyRowUpdatesViaAppRuntime(
3116
3116
  ? Omit<T & { action: 'apply_row_updates' }, 'action'>
3117
3117
  : never,
3118
3118
  ): Promise<void> {
3119
+ // The receiver reads `contractSnapshot` only to derive a sheet contract when
3120
+ // none is sent. With `sheetContract` present it is dead weight, and a
3121
+ // hydrated pipeline that inlines prebuilt Plays can alone exceed the ingress
3122
+ // budget, failing every checkpoint whatever the row size.
3123
+ const envelope = input.sheetContract
3124
+ ? { ...input, contractSnapshot: undefined }
3125
+ : input;
3119
3126
  const requestForUpdates = (updates: typeof input.updates) =>
3120
3127
  ({
3121
3128
  action: 'apply_row_updates',
3122
- ...input,
3129
+ ...envelope,
3123
3130
  updates,
3124
3131
  }) as Extract<RuntimeApiRequest, { action: 'apply_row_updates' }>;
3125
3132
  if (input.updates.length === 0) {
@@ -7,8 +7,9 @@
7
7
  * the launcher upload only the per-run config and Play artifact.
8
8
  *
9
9
  * Trust model: nothing here is assumed. The launcher only plans a baked run
10
- * when an operator configured the expected hash AND that hash equals the hash
11
- * of the bundle this very launcher would otherwise upload. It then verifies,
10
+ * when the expected hash (an operator pin, or in self mode the hash of this
11
+ * worker's own bundle) equals the hash of the bundle this very launcher would
12
+ * otherwise upload, and Modal resolved the image named after it. It verifies,
12
13
  * inside the acquired sandbox and before any command that could start the
13
14
  * runner, that the file exists and hashes to that value. Any other outcome
14
15
  * (unset, stale, absent file, mismatched bytes, probe failure) keeps the
@@ -18,8 +19,27 @@
18
19
  import { createHash } from 'node:crypto';
19
20
  import { gzipSync } from 'node:zlib';
20
21
 
21
- /** Operator opt-in. Unset (the default) keeps today's full upload. */
22
+ /**
23
+ * Worker setting. Values:
24
+ * - a 64-hex SHA-256: exact pin (the original operator opt-in, unchanged);
25
+ * - `self`: look up the image named after this worker's own bundle hash;
26
+ * - `off`: disabled, whatever the default below says (the kill switch);
27
+ * - unset: `self` when `BAKED_RUNNER_SELF_VERSIONED` is true, else disabled.
28
+ * Anything else enables nothing.
29
+ */
22
30
  export const BAKED_RUNNER_HASH_ENV = 'DEEPLINE_BAKED_RUNNER_HASH';
31
+ export const BAKED_RUNNER_SELF_MODE = 'self';
32
+ export const BAKED_RUNNER_OFF_MODE = 'off';
33
+
34
+ /**
35
+ * Release-owned enable for self-versioned baked runner images. While false, an
36
+ * unset worker setting keeps today's full upload, and the Production release
37
+ * and Preview `runtime up` do not publish. Flipping it to true makes, in the
38
+ * same release, the release publish `deepline-play-runner:<own bundle hash>`
39
+ * before its workers roll and those workers look that image up. Read by
40
+ * `.github/workflows/production-release.yml` and `scripts/runtime-target.ts`.
41
+ */
42
+ export const BAKED_RUNNER_SELF_VERSIONED: boolean = false;
23
43
  export const BAKED_RUNNER_ROOT = '/opt/deepline/runner';
24
44
  export const BAKED_RUNNER_FILE_NAME = 'play-runner.cjs';
25
45
 
@@ -85,6 +105,48 @@ export function configuredBakedRunnerHash(
85
105
  return SHA256_HEX.test(configured) ? configured : null;
86
106
  }
87
107
 
108
+ export type BakedRunnerMode =
109
+ | { kind: 'disabled' }
110
+ | { kind: 'pin'; hash: string }
111
+ | { kind: 'self' };
112
+
113
+ /** How this worker chooses its baked runner image (see BAKED_RUNNER_HASH_ENV). */
114
+ export function bakedRunnerMode(
115
+ env: NodeJS.ProcessEnv = process.env,
116
+ selfVersionedByDefault: boolean = BAKED_RUNNER_SELF_VERSIONED,
117
+ ): BakedRunnerMode {
118
+ const configured = env[BAKED_RUNNER_HASH_ENV]?.trim().toLowerCase() ?? '';
119
+ if (configured === BAKED_RUNNER_OFF_MODE) return { kind: 'disabled' };
120
+ if (configured === BAKED_RUNNER_SELF_MODE) return { kind: 'self' };
121
+ if (SHA256_HEX.test(configured)) return { kind: 'pin', hash: configured };
122
+ if (!configured && selfVersionedByDefault) return { kind: 'self' };
123
+ return { kind: 'disabled' };
124
+ }
125
+
126
+ /**
127
+ * The hash whose published image this launch should look up, or null for
128
+ * today's path. Disabled and pinned modes never wait on the bundle; self mode
129
+ * hashes this worker's own bundle, so its image can never be stale. A bundle
130
+ * that cannot be read yields null here: the launch then takes today's path and
131
+ * the build failure still surfaces where the payload is staged.
132
+ */
133
+ export async function bakedRunnerLookupHash(input: {
134
+ /** Called only in self mode, so a disabled or pinned launch reads nothing. */
135
+ bundle: () => Promise<string>;
136
+ mode?: BakedRunnerMode;
137
+ }): Promise<string | null> {
138
+ const mode = input.mode ?? bakedRunnerMode();
139
+ if (mode.kind === 'disabled') return null;
140
+ if (mode.kind === 'pin') return mode.hash;
141
+ let bundle: string;
142
+ try {
143
+ bundle = await input.bundle();
144
+ } catch {
145
+ return null;
146
+ }
147
+ return bundle.length > 0 ? runnerBundleSha256Memoized(bundle) : null;
148
+ }
149
+
88
150
  const MODAL_IMAGE_PRESENT_TTL_MS = 10 * 60_000;
89
151
  const MODAL_IMAGE_ABSENT_TTL_MS = 30_000;
90
152
 
@@ -316,7 +378,7 @@ export async function bakedRunnerPlanForLaunch(input: {
316
378
  }): Promise<{ hash: string; path: string } | undefined> {
317
379
  const configuredHash =
318
380
  input.configuredHash === undefined
319
- ? configuredBakedRunnerHash()
381
+ ? await bakedRunnerLookupHash({ bundle: () => input.bundlePromise })
320
382
  : input.configuredHash;
321
383
  if (!configuredHash) return undefined;
322
384
  const plan = planBakedRunner({
@@ -97,6 +97,8 @@ export const PLAY_LAUNCH_ENVELOPE_FIELD_ROLES: {
97
97
  runtimeTestFaultHeader: 'detail',
98
98
  testPolicyOverrides: 'detail',
99
99
  experimentSwitchOverrides: 'detail',
100
+ // Attribution only; the profile's switch map is experimentSwitchOverrides.
101
+ runtimeSpeedProfile: 'detail',
100
102
  earlySandboxClaimOwner: 'detail',
101
103
  submittedAtMs: 'detail',
102
104
  concurrentRunsLimit: 'detail',
@@ -3171,10 +3171,6 @@ async function run(
3171
3171
  playName,
3172
3172
  tableNamespace,
3173
3173
  sheetContract,
3174
- contractSnapshot: {
3175
- staticPipeline:
3176
- input.staticPipeline ?? config.context.staticPipeline ?? null,
3177
- },
3178
3174
  runId,
3179
3175
  userEmail,
3180
3176
  updates: checkpointUpdates,
@@ -28,8 +28,9 @@ import {
28
28
  } from '../../modal-runtime-config';
29
29
  import type { PlaySandboxRuntimeLimits } from '../../../plays/sandbox-runtime-limits';
30
30
  import {
31
+ bakedRunnerLookupHash,
32
+ bakedRunnerMode,
31
33
  bakedRunnerPlanForLaunch,
32
- configuredBakedRunnerHash,
33
34
  bakedVerdictRequiresFallback,
34
35
  parseBakedRunnerVerdict,
35
36
  type BakedRunnerVerdict,
@@ -1886,7 +1887,9 @@ export function startEarlyModalSandbox(input: {
1886
1887
  });
1887
1888
  const runnerImage = await resolveModalRunnerImage({
1888
1889
  client: modalConfig.client,
1889
- configuredHash: configuredBakedRunnerHash(),
1890
+ configuredHash: await bakedRunnerLookupHash({
1891
+ bundle: buildPlayRunnerBundle,
1892
+ }),
1890
1893
  explicitImage: modalConfig.imageExplicit === true,
1891
1894
  defaultImage: () =>
1892
1895
  modalConfig.client.images.fromRegistry(modalConfig.image),
@@ -2420,12 +2423,17 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
2420
2423
  modalAppId: app.appId,
2421
2424
  elapsedMs: Date.now() - startedAt,
2422
2425
  });
2423
- // Unchanged (no lookup, no await) unless an operator configured the
2424
- // baked runner hash; then the published baked image is used only when
2426
+ // Unchanged (no lookup, no bundle wait) unless the baked runner is
2427
+ // enabled: an operator pin, or self mode, which names the image after
2428
+ // this worker's own bundle hash. The published image is used only when
2425
2429
  // Modal resolves it, and its runner file is still verified before use.
2430
+ const bakedMode = bakedRunnerMode();
2426
2431
  const runnerImage = await resolveModalRunnerImage({
2427
2432
  client: modalConfig.client,
2428
- configuredHash: configuredBakedRunnerHash(),
2433
+ configuredHash: await bakedRunnerLookupHash({
2434
+ bundle: () => bundlePromise,
2435
+ mode: bakedMode,
2436
+ }),
2429
2437
  explicitImage: modalConfig.imageExplicit === true,
2430
2438
  defaultImage: () =>
2431
2439
  modalConfig.client.images.fromRegistry(modalConfig.image),
@@ -2440,6 +2448,7 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
2440
2448
  emitModalStage(config.context, 'create:image', {
2441
2449
  baked: runnerImage.baked,
2442
2450
  bakedImageRef: runnerImage.ref,
2451
+ bakedMode: bakedMode.kind,
2443
2452
  });
2444
2453
  }
2445
2454
  const baseImage = runnerImage.image;
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Runtime speed profiles: a named, frozen set of per-run experiment switch
3
+ * values that admission stamps on a run.
4
+ *
5
+ * A profile is decided once, at admission, from the `runtime-fast-launch`
6
+ * feature rollout (an organization override beats the percentage) or, outside
7
+ * Production, from the `x-deepline-runtime-speed-profile` header authorized by
8
+ * the `play_run.runtime_speed_profile` internal capability. Admission writes
9
+ * the profile's switch map into the launch's existing optional
10
+ * `experimentSwitchOverrides` field, which Production workers, the
11
+ * executor-token route and the Modal backend already read. The profile id is
12
+ * also stamped as `runtimeSpeedProfile`, for attribution only: no reader
13
+ * branches on it.
14
+ *
15
+ * Every claim, resume and recovery re-reads the durable launch, never the
16
+ * rollout, so a run keeps the switch values it was admitted with. A worker
17
+ * that does not know a switch id drops it (`readCarriedExperimentSwitchOverrides`)
18
+ * and keeps that switch's static default.
19
+ *
20
+ * Rules for this registry:
21
+ * - An id's content is frozen once it has shipped. New content gets a new id
22
+ * (`fast_launch@2`), the same way placement policy ids work.
23
+ * - Each map is explicit: `true` turns a switch on, `false` pins it off, so a
24
+ * later change to a static default cannot change an admitted run.
25
+ * - Promoting a switch's static default to `true` while a profile pins it off
26
+ * would leave that profile's cohort slower than everyone else. Do it with a
27
+ * new profile id that turns it on; the registry test fails otherwise.
28
+ * - Only `perRun: true` switches can appear (the type enforces it), so E4/F1
29
+ * and every worker-process switch are impossible here.
30
+ * - S1 (the supervisor sidecar) is pinned off, and no profile may exist while
31
+ * `modalSupervisorSidecar` is on. `tests/lib/plays/runtime-speed-profile.test.ts`
32
+ * enforces both.
33
+ * - Placement and CPU are not part of any profile yet. A profile changes switch
34
+ * values only; the run's sandbox placement policy is chosen exactly as it is
35
+ * without one.
36
+ */
37
+
38
+ import type {
39
+ ExperimentSwitchOverrides,
40
+ PerRunExperimentSwitchId,
41
+ } from './experiment-switches';
42
+
43
+ /** Requests a profile for one run: `fast_launch@1`, or `off` for none. */
44
+ export const RUNTIME_SPEED_PROFILE_HEADER = 'x-deepline-runtime-speed-profile';
45
+
46
+ /** The header value that asks for no profile, even when the rollout grants one. */
47
+ export const RUNTIME_SPEED_PROFILE_OFF = 'off';
48
+
49
+ type RuntimeSpeedProfileDefinition = {
50
+ readonly summary: string;
51
+ readonly switches: Readonly<Partial<Record<PerRunExperimentSwitchId, boolean>>>;
52
+ };
53
+
54
+ export const RUNTIME_SPEED_PROFILES = {
55
+ 'fast_launch@1': {
56
+ summary:
57
+ 'The per-run admission and launch switches certified for fast launch: B, H1, P1, P2 and V3. Early start (E2 and everything built on it) and the sidecar stay off.',
58
+ switches: {
59
+ B: true,
60
+ H1: true,
61
+ P1: true,
62
+ P2: true,
63
+ V3: true,
64
+ // Early start and its dependants: not in @1.
65
+ E2: false,
66
+ PB: false,
67
+ CA: false,
68
+ A1: false,
69
+ // The supervisor sidecar: blocked for security.
70
+ S1: false,
71
+ // Never screened, or Preview-only.
72
+ PWM: false,
73
+ PWT: false,
74
+ PWV: false,
75
+ PI: false,
76
+ F3: false,
77
+ },
78
+ },
79
+ } as const satisfies Record<string, RuntimeSpeedProfileDefinition>;
80
+
81
+ export type RuntimeSpeedProfileId = keyof typeof RUNTIME_SPEED_PROFILES;
82
+
83
+ /** The profile the `runtime-fast-launch` rollout grants. */
84
+ export const RUNTIME_FAST_LAUNCH_PROFILE: RuntimeSpeedProfileId =
85
+ 'fast_launch@1';
86
+
87
+ export function isRuntimeSpeedProfileId(
88
+ value: unknown,
89
+ ): value is RuntimeSpeedProfileId {
90
+ return (
91
+ typeof value === 'string' &&
92
+ Object.prototype.hasOwnProperty.call(RUNTIME_SPEED_PROFILES, value)
93
+ );
94
+ }
95
+
96
+ export class RuntimeSpeedProfileHeaderError extends Error {
97
+ constructor(message: string) {
98
+ super(message);
99
+ this.name = 'RuntimeSpeedProfileHeaderError';
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Strict parser for the request header. Returns the profile id, or null for
105
+ * `off`. Anything else throws, so a request is never silently run without the
106
+ * profile it asked for.
107
+ */
108
+ export function parseRuntimeSpeedProfileHeader(
109
+ value: string,
110
+ ): RuntimeSpeedProfileId | null {
111
+ const trimmed = value.trim();
112
+ if (trimmed === RUNTIME_SPEED_PROFILE_OFF) return null;
113
+ if (isRuntimeSpeedProfileId(trimmed)) return trimmed;
114
+ throw new RuntimeSpeedProfileHeaderError(
115
+ `Unknown runtime speed profile "${trimmed}" in ${RUNTIME_SPEED_PROFILE_HEADER}. Known: ${[
116
+ ...Object.keys(RUNTIME_SPEED_PROFILES),
117
+ RUNTIME_SPEED_PROFILE_OFF,
118
+ ].join(', ')}.`,
119
+ );
120
+ }
121
+
122
+ /**
123
+ * The switch overrides a run is admitted with: the profile's frozen map, with
124
+ * any explicitly requested per-run override winning for its own id. With no
125
+ * profile, the explicit overrides are returned unchanged.
126
+ */
127
+ export function applyRuntimeSpeedProfile(
128
+ profileId: RuntimeSpeedProfileId | null,
129
+ explicitOverrides: ExperimentSwitchOverrides | null,
130
+ ): ExperimentSwitchOverrides | null {
131
+ if (!profileId) return explicitOverrides;
132
+ return {
133
+ ...RUNTIME_SPEED_PROFILES[profileId].switches,
134
+ ...(explicitOverrides ?? {}),
135
+ };
136
+ }
@@ -266,6 +266,13 @@ export type PlaySchedulerSubmitInput = RetainedPipelineCarrier & {
266
266
  * its static default, so old launches and old workers are unaffected.
267
267
  */
268
268
  experimentSwitchOverrides?: ExperimentSwitchOverrides | null;
269
+ /**
270
+ * The runtime speed profile (`runtime-speed-profile.ts`) the run was
271
+ * admitted with, such as `fast_launch@1`. Attribution only: its switch map
272
+ * is already in `experimentSwitchOverrides`, and no reader branches on this
273
+ * id. Absent on every run admitted without a profile.
274
+ */
275
+ runtimeSpeedProfile?: string | null;
269
276
  /**
270
277
  * EXPERIMENT CA: the worker that started this run's early sandbox, as named
271
278
  * in its hint reply. Copied onto the run's task params, where other workers'
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkMI53W4DNjs = require('./chunk-MI53W4DN.js');
18
+ require('./chunk-LEREPTAE.js');
19
+ require('./chunk-ISXX5DUD.js');
20
+ require('./chunk-V7DEGIYO.js');
21
+ require('./chunk-2GJZLIKW.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-BBTKAASQ.js');
24
+ require('./chunk-TZBCJHV6.js');
25
+ require('./chunk-OG64RBAC.js');
26
+ require('./chunk-COGTRVWW.js');
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkMI53W4DNjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkMI53W4DNjs.authStatusLine; exports.clearPendingClaim = _chunkMI53W4DNjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkMI53W4DNjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkMI53W4DNjs.handleRegister; exports.handleStatus = _chunkMI53W4DNjs.handleStatus; exports.handleWait = _chunkMI53W4DNjs.handleWait; exports.httpJson = _chunkMI53W4DNjs.httpJson; exports.readPendingAuthClaim = _chunkMI53W4DNjs.readPendingAuthClaim; exports.readStatusBanner = _chunkMI53W4DNjs.readStatusBanner; exports.registerAuthCommands = _chunkMI53W4DNjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkMI53W4DNjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkMI53W4DNjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkMI53W4DNjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkMI53W4DNjs.statusBannerLine;
@@ -14,14 +14,14 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-ALARRSMZ.mjs";
18
- import "./chunk-6JG3MRTM.mjs";
19
- import "./chunk-ICTA5ICE.mjs";
20
- import "./chunk-CLO562KG.mjs";
17
+ } from "./chunk-LE5KN7CZ.mjs";
18
+ import "./chunk-GLKUC5PO.mjs";
19
+ import "./chunk-FIRV7BXJ.mjs";
20
+ import "./chunk-G3UFDUYU.mjs";
21
21
  import "./chunk-CQBIO6HW.mjs";
22
22
  import "./chunk-DLIRSHV6.mjs";
23
23
  import "./chunk-JL2OTMSG.mjs";
24
- import "./chunk-T6GPTJ5F.mjs";
24
+ import "./chunk-E4QHTDPF.mjs";
25
25
  import "./chunk-WZYKRD7T.mjs";
26
26
  import "./chunk-KRD6H754.mjs";
27
27
  export {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-M3NCXGNN.mjs";
3
+ } from "./chunk-55ITVU2V.mjs";
4
4
  import {
5
5
  iterateCursorPages,
6
6
  requireBillingIdempotencyKey
7
- } from "./chunk-UE7JHAZ2.mjs";
7
+ } from "./chunk-GEO2EMM7.mjs";
8
8
  import "./chunk-L2VKAASU.mjs";
9
9
  import "./chunk-Z2XA6YU4.mjs";
10
10
  import "./chunk-PSX3WHIH.mjs";
@@ -22,9 +22,9 @@ import {
22
22
  openInBrowser,
23
23
  printCommandEnvelope,
24
24
  shouldEmitJson
25
- } from "./chunk-6JG3MRTM.mjs";
26
- import "./chunk-ICTA5ICE.mjs";
27
- import "./chunk-CLO562KG.mjs";
25
+ } from "./chunk-GLKUC5PO.mjs";
26
+ import "./chunk-FIRV7BXJ.mjs";
27
+ import "./chunk-G3UFDUYU.mjs";
28
28
  import {
29
29
  AuthError,
30
30
  ConfigError
@@ -33,7 +33,7 @@ import "./chunk-DLIRSHV6.mjs";
33
33
  import {
34
34
  DeeplineError
35
35
  } from "./chunk-JL2OTMSG.mjs";
36
- import "./chunk-T6GPTJ5F.mjs";
36
+ import "./chunk-E4QHTDPF.mjs";
37
37
  import "./chunk-WZYKRD7T.mjs";
38
38
  import "./chunk-KRD6H754.mjs";
39
39