@cnc-tools/storm 0.12.0 → 0.13.0

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 (96) hide show
  1. package/dist/bin/storm.js +1 -1
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-4XT5RC5T.js → chunk-2NZXL6OH.js} +6 -42
  4. package/dist/chunks/{chunk-ISGQJIQM.js → chunk-5UMJNVKT.js} +1 -1
  5. package/dist/chunks/{chunk-FSP3SJ35.js → chunk-6EQKA7LI.js} +16 -46
  6. package/dist/chunks/{chunk-Y3BUNNRG.js → chunk-AX4EQZUS.js} +4 -4
  7. package/dist/chunks/{chunk-RYRJNHL7.js → chunk-DOFB2ACU.js} +3 -9
  8. package/dist/chunks/{chunk-SXW6XN4R.js → chunk-EGNP3S6C.js} +3 -3
  9. package/dist/chunks/{chunk-FK4RLDEK.js → chunk-N7E6DAUE.js} +1 -1
  10. package/dist/chunks/{chunk-U7M3ZB3Z.js → chunk-Q4TKRILH.js} +33 -167
  11. package/dist/chunks/{chunk-TMQQYHUX.js → chunk-RTILVSYQ.js} +1 -1
  12. package/dist/chunks/{chunk-7D6LC5JY.js → chunk-X4WBJIOF.js} +7 -39
  13. package/dist/chunks/{chunk-TEEZL3GA.js → chunk-YGS5VRQT.js} +11 -68
  14. package/dist/chunks/{chunk-ODQHQJLE.js → chunk-ZDJLKF2G.js} +742 -1117
  15. package/dist/chunks/{live-app-AZ5N5HBD.js → live-app-QFHS54SX.js} +4 -4
  16. package/dist/commands/exec/command.d.ts +2 -90
  17. package/dist/commands/exec/command.js +10 -10
  18. package/dist/commands/exec/define-run-command.d.ts +2 -90
  19. package/dist/commands/exec/live-view.js +18 -22
  20. package/dist/commands/exec/outcomes.d.ts +2 -106
  21. package/dist/commands/exec/outcomes.js +4 -35
  22. package/dist/commands/exec/progress.d.ts +3 -19
  23. package/dist/commands/exec/progress.js +16 -60
  24. package/dist/commands/exec/run-command.d.ts +4 -23
  25. package/dist/commands/exec/run-command.js +5 -79
  26. package/dist/commands/exec/run-metadata.d.ts +0 -6
  27. package/dist/commands/exec/run-metadata.js +2 -8
  28. package/dist/commands/exec/snapshot-text.d.ts +7 -16
  29. package/dist/commands/exec/snapshot-text.js +9 -49
  30. package/dist/commands/exec/view.js +2 -12
  31. package/dist/commands/playwright/command.d.ts +2 -90
  32. package/dist/commands/playwright/command.js +11 -11
  33. package/dist/commands/runs/facts.d.ts +1 -37
  34. package/dist/commands/runs/facts.js +4 -36
  35. package/dist/commands/runs/list/command.d.ts +0 -72
  36. package/dist/commands/runs/list/command.js +5 -5
  37. package/dist/commands/runs/list/outcomes.d.ts +0 -36
  38. package/dist/commands/runs/logs/command.js +5 -5
  39. package/dist/commands/runs/show/command.d.ts +0 -72
  40. package/dist/commands/runs/show/command.js +13 -40
  41. package/dist/commands/runs/show/metadata.js +1 -1
  42. package/dist/commands/runs/show/outcomes.d.ts +0 -36
  43. package/dist/commands/runs/show/outcomes.js +8 -42
  44. package/dist/commands/snapshots/build/command.d.ts +14 -411
  45. package/dist/commands/snapshots/build/command.js +56 -231
  46. package/dist/commands/snapshots/build/metadata.js +10 -7
  47. package/dist/commands/snapshots/build/outcomes.d.ts +11 -241
  48. package/dist/commands/snapshots/build/outcomes.js +29 -196
  49. package/dist/commands/snapshots/list/command.d.ts +2 -36
  50. package/dist/commands/snapshots/list/command.js +17 -53
  51. package/dist/commands/snapshots/list/metadata.js +1 -1
  52. package/dist/commands/snapshots/list/outcomes.d.ts +2 -37
  53. package/dist/commands/snapshots/list/outcomes.js +13 -53
  54. package/dist/commands/vitest/command.d.ts +2 -90
  55. package/dist/commands/vitest/command.js +11 -11
  56. package/dist/core/events.d.ts +5 -6
  57. package/dist/core/run-state.d.ts +7 -29
  58. package/dist/core/run-state.js +3 -26
  59. package/dist/core/run.d.ts +6 -14
  60. package/dist/core/run.js +17 -28
  61. package/dist/extensions/testserver/commands/pool/create/command.js +1 -1
  62. package/dist/run-directory/index.d.ts +1 -1
  63. package/dist/run-directory/index.js +0 -1
  64. package/dist/run-directory/recording.js +2 -2
  65. package/dist/run-directory/run-record.d.ts +14 -132
  66. package/dist/run-directory/run-record.js +8 -68
  67. package/dist/runner/build-snapshots.d.ts +50 -114
  68. package/dist/runner/build-snapshots.js +70 -159
  69. package/dist/runner/events.d.ts +4 -88
  70. package/dist/runner/gateways.d.ts +5 -23
  71. package/dist/runner/index.d.ts +5 -6
  72. package/dist/runner/index.js +1 -1
  73. package/dist/runner/live/snapshot-records.js +7 -18
  74. package/dist/runner/prepare.d.ts +11 -22
  75. package/dist/runner/prepare.js +6 -17
  76. package/dist/runner/ready.d.ts +16 -45
  77. package/dist/runner/ready.js +34 -59
  78. package/dist/runner/recipe.d.ts +0 -44
  79. package/dist/runner/recipe.js +0 -41
  80. package/dist/runner/scope.d.ts +8 -25
  81. package/dist/runner/scope.js +4 -8
  82. package/dist/runner/session.d.ts +18 -65
  83. package/dist/runner/session.js +15 -83
  84. package/dist/runner/snapshot-build.d.ts +2 -2
  85. package/dist/runner/snapshot-cache.d.ts +22 -74
  86. package/dist/runner/snapshot-cache.js +15 -107
  87. package/dist/runner/snapshot-inspect.d.ts +9 -13
  88. package/dist/runner/snapshot-inspect.js +48 -57
  89. package/dist/runner/snapshot-key.d.ts +9 -14
  90. package/dist/runner/snapshot-key.js +15 -22
  91. package/package.json +1 -1
  92. package/skills/read-run-output.md +8 -9
  93. package/dist/runner/snapshot-save.d.ts +0 -70
  94. package/dist/runner/snapshot-save.js +0 -160
  95. package/dist/runner/snapshot-start.d.ts +0 -25
  96. package/dist/runner/snapshot-start.js +0 -16
@@ -6,7 +6,7 @@ import {
6
6
  redactingObserver,
7
7
  redactingTerminal,
8
8
  redactor
9
- } from "./chunk-FK4RLDEK.js";
9
+ } from "./chunk-N7E6DAUE.js";
10
10
  import {
11
11
  criticalPathStep,
12
12
  recordedPlan,
@@ -17,26 +17,23 @@ import {
17
17
  testsChart,
18
18
  testsSummaryLines,
19
19
  waterfallLines
20
- } from "./chunk-Y3BUNNRG.js";
20
+ } from "./chunk-AX4EQZUS.js";
21
21
  import {
22
22
  builtAtText,
23
- noSaveText,
24
23
  rejectionLines,
25
24
  snapshotCacheNoteText
26
- } from "./chunk-4XT5RC5T.js";
25
+ } from "./chunk-2NZXL6OH.js";
27
26
  import {
28
27
  DEFINITION_SET,
29
28
  RESOURCES
30
- } from "./chunk-ISGQJIQM.js";
29
+ } from "./chunk-5UMJNVKT.js";
31
30
  import {
32
31
  sandboxConnectPage
33
32
  } from "./chunk-NMVODY3P.js";
34
33
  import {
35
- noSaveReasonSchema,
36
34
  recordRun,
37
- saveSchema,
38
35
  timelineSchema
39
- } from "./chunk-TEEZL3GA.js";
36
+ } from "./chunk-YGS5VRQT.js";
40
37
  import {
41
38
  isoSecondsText,
42
39
  keepTimeText,
@@ -49,7 +46,7 @@ import {
49
46
  truncate,
50
47
  visibleLength,
51
48
  withArticle
52
- } from "./chunk-TMQQYHUX.js";
49
+ } from "./chunk-RTILVSYQ.js";
53
50
  import {
54
51
  EMPTY_RUN_STATE,
55
52
  cleanupProblems,
@@ -62,12 +59,11 @@ import {
62
59
  setupPhaseWords,
63
60
  timedProgress,
64
61
  warningTally
65
- } from "./chunk-FSP3SJ35.js";
62
+ } from "./chunk-6EQKA7LI.js";
66
63
  import {
67
64
  RUNNER_SECRET_MIN_LENGTH,
68
65
  configErrors,
69
66
  credentialErrors,
70
- devSnapshotsTrusted,
71
67
  fileSettings,
72
68
  invalidConfig,
73
69
  loadSettingsFile,
@@ -79,7 +75,7 @@ import {
79
75
  requireTarget,
80
76
  settleCredential,
81
77
  settleRunResources
82
- } from "./chunk-ODQHQJLE.js";
78
+ } from "./chunk-ZDJLKF2G.js";
83
79
  import {
84
80
  describeMintFailure,
85
81
  isCi
@@ -376,18 +372,10 @@ var ranSchema = z4.object({
376
372
  runner: z4.object({
377
373
  /** The runner snapshot it started from. */
378
374
  snapshotId: z4.string(),
379
- /** The runner snapshot's base, a full SHA. */
375
+ /** The runner snapshot's base, a full SHA: the commit it was built at. */
380
376
  base: z4.string(),
381
- /** For a dev snapshot, the local branch of the run that saved it; null for a base snapshot. */
382
- snapshotBranch: z4.string().nullable(),
383
- /** For a dev snapshot, the HEAD commit of the run that saved it, a full SHA; null for a base snapshot. */
384
- snapshotHead: z4.string().nullable(),
385
- /** The runner snapshot's kind: a base snapshot, built from its base, or a dev snapshot, saved from a run. */
386
- snapshotKind: z4.enum(["base", "dev"]),
387
- /** The commit the runner snapshot was built at, a full SHA: a base snapshot's base, or the commit that saved a dev snapshot. */
388
- snapshotBuiltAt: z4.string(),
389
- /** How many commits HEAD has that the snapshot's built-at commit lacks, 0 for a snapshot built at HEAD's commit; null when storm couldn't count them. */
390
- builtBehind: z4.number().nullable(),
377
+ /** How many commits HEAD has that the snapshot's base lacks, 0 for a snapshot built at HEAD's commit. */
378
+ builtBehind: z4.number(),
391
379
  /** How many bytes of changes the run uploaded on top of the snapshot's base. */
392
380
  uploadBytes: z4.number(),
393
381
  /** Whether this run built the runner snapshot. */
@@ -396,11 +384,7 @@ var ranSchema = z4.object({
396
384
  region: z4.string(),
397
385
  runtime: z4.string(),
398
386
  /** How long the build step took, in milliseconds. */
399
- buildMs: z4.number(),
400
- /** How saving the runner sandbox as a dev snapshot ended; null when the run started no save. */
401
- save: saveSchema.nullable(),
402
- /** Why the run, whose command ended on its own, started no save of a dev snapshot; null when it started one. */
403
- noSaveReason: noSaveReasonSchema.nullable()
387
+ buildMs: z4.number()
404
388
  }).nullable(),
405
389
  /** The run's waterfall, as the run directory's timeline.json holds it: each lane's label, span and steps in milliseconds since the run started, how they ended, idle time, and the critical path. */
406
390
  timeline: timelineSchema,
@@ -446,25 +430,6 @@ var runErrors = defineErrors({
446
430
  ]
447
431
  })
448
432
  },
449
- devSnapshotsNotTrusted: {
450
- exitCode: 2,
451
- description: "--save-dev-snapshot was given to a sandboxed run whose runner recipe's install or build step names a runner secret, and the recipe doesn't set trustDevSnapshots: true. A dev snapshot holds what a command wrote, and those steps run on top of it in later runs with their secrets, so only the recipe grants that trust. Nothing was minted, acquired or created.",
452
- schema: z4.object({
453
- /** The flag given, as typed. */
454
- flag: z4.string(),
455
- /** The config file that gave the runner recipe; null when none did. */
456
- configFile: z4.string().nullable()
457
- }),
458
- render: ({ flag, configFile }) => ({
459
- message: `${flag} saves a dev snapshot, and the runner recipe${configFile === null ? "" : ` in ${configFile}`} doesn't trust dev snapshots: its install or build step names a runner secret.`,
460
- next: [
461
- {
462
- type: "text",
463
- text: `Drop ${flag}, or set trustDevSnapshots: true under the runner key of storm.config.ts, which trusts every command run from a checkout with those secrets.`
464
- }
465
- ]
466
- })
467
- },
468
433
  missingRunner: {
469
434
  exitCode: 2,
470
435
  description: "A sandboxed run (no --unsandboxed) needs a runner recipe, and no storm.config.ts gives a runner key.",
@@ -665,6 +630,7 @@ function plainRenderer(options) {
665
630
  lanesStartedAt: void 0,
666
631
  readyAt: { runner: void 0, resources: {} },
667
632
  cleanupStartedAt: void 0,
633
+ mergeBase: void 0,
668
634
  folded: false
669
635
  };
670
636
  const resources = DEFINITION_SET.presentations.plain({ verbose: options.verbose === true });
@@ -751,7 +717,7 @@ function eventLines(event, now, state, line, options) {
751
717
  return [line("command", `${event.command} ${commandEnd(event.outcome)} after ${seconds(event.ms)}`)];
752
718
  case "cleanup-started":
753
719
  state.cleanupStartedAt = now;
754
- return [line("cleanup", cleanupText(event.runnerSandbox, releaseText(event.resources, false)))];
720
+ return [line("cleanup", cleanupText(event.keepMs, releaseText(event.resources, false)))];
755
721
  case "cleanup-finished": {
756
722
  const problems = [
757
723
  ...event.notStopped === 0 ? [] : [`${event.notStopped} not stopped`],
@@ -766,6 +732,7 @@ function eventLines(event, now, state, line, options) {
766
732
  ];
767
733
  }
768
734
  case "runner-prepared":
735
+ state.mergeBase = event.base;
769
736
  return [
770
737
  line("runner", `merge-base ${short(event.base)}, of HEAD and ${event.baseRef}`),
771
738
  ...preparedNoteTexts(event).map((text) => line("runner", text))
@@ -783,7 +750,7 @@ function eventLines(event, now, state, line, options) {
783
750
  function runnerLines(event, state, line, options) {
784
751
  switch (event.kind) {
785
752
  case "snapshot-reused":
786
- return [line("runner", snapshotReusedText(event))];
753
+ return [line("runner", snapshotReusedText(event, state.mergeBase))];
787
754
  case "snapshot-build-started":
788
755
  return snapshotBuildTexts(event).map((text) => line("runner", text));
789
756
  case "runner-sandbox-starting":
@@ -844,21 +811,10 @@ function runnerLines(event, state, line, options) {
844
811
  ];
845
812
  case "sandbox-kept":
846
813
  return [line("cleanup", `kept the runner sandbox ${event.name} running until ${isoSecondsText(event.stopsAt)}`)];
847
- // The cleanup line says the run saves a dev snapshot.
848
- case "dev-snapshot-saving":
849
- return [];
850
- case "dev-snapshot-saved":
851
- case "dev-snapshot-not-saved":
852
- return [line("cleanup", devSnapshotSaveText(event))];
853
- case "dev-snapshot-skipped":
854
- return [line("cleanup", devSnapshotSkippedText(event))];
855
- case "dev-snapshots-dropped":
856
- case "dev-snapshots-not-dropped":
857
- return [line("runner", devSnapshotsDropText(event))];
858
814
  }
859
815
  }
860
- function snapshotReusedText(event) {
861
- return `snapshot ${event.snapshotId}, ${builtAtText({ ...event.snapshot, atMergeBase: event.snapshot.builtAt === event.base })}`;
816
+ function snapshotReusedText(event, mergeBase) {
817
+ return `snapshot ${event.snapshotId}, ${builtAtText({ base: event.base, builtBehind: event.builtBehind, mergeBase })}`;
862
818
  }
863
819
  function snapshotBuildTexts(event) {
864
820
  const building = `building a base snapshot at ${short(event.base)}`;
@@ -872,37 +828,11 @@ function snapshotBuildTexts(event) {
872
828
  return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`];
873
829
  }
874
830
  }
875
- function devSnapshotSkippedText(event) {
876
- return `no new dev snapshot: ${noSaveText(event.reason)}`;
877
- }
878
- function devSnapshotSaveText(event) {
879
- if (event.kind === "dev-snapshot-saved") {
880
- return `saved dev snapshot ${event.snapshotId} for ${headText(event.branch)} at ${short(event.head)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`;
881
- }
882
- return `not saving a dev snapshot: ${notSavedReason(event.save)}`;
883
- }
884
- function headText(branch) {
885
- return branch ?? "a detached HEAD";
886
- }
887
- function notSavedReason(save) {
888
- switch (save.kind) {
889
- case "failed":
890
- return `the ${save.step === "scrub" ? "scrub" : "save"} failed: ${save.message}`;
891
- case "stopped":
892
- return "the run is stopping";
893
- }
894
- }
895
831
  var SNAPSHOT_BUILD_REASON_TEXT = {
896
832
  "no-snapshot": "no cached snapshot fits",
897
833
  full: "--full",
898
834
  base: "the cache has no base snapshot at that commit"
899
835
  };
900
- function devSnapshotsDropText(event) {
901
- if (event.kind === "dev-snapshots-not-dropped")
902
- return `couldn't drop a dev snapshot built on the replaced base snapshot from the cache: ${event.message}; a later run may start from it`;
903
- const count = event.snapshotIds.length;
904
- return `dropped ${count} dev ${count === 1 ? "snapshot" : "snapshots"} built on the replaced base snapshot from the cache: ${event.snapshotIds.join(", ")}`;
905
- }
906
836
  function releasingText(instances) {
907
837
  const release = releaseText(
908
838
  instances.map(({ resource }) => resource),
@@ -915,11 +845,9 @@ function closeFold(state) {
915
845
  state.folded = false;
916
846
  return ["::endgroup::"];
917
847
  }
918
- function cleanupText(sandbox, release) {
919
- if (sandbox === null) return release === void 0 ? "nothing to release" : `${release}\u2026`;
920
- if (sandbox.kind === "save")
921
- return `saving a dev snapshot of ${headText(sandbox.branch)}${release === void 0 ? "" : ` while ${release}`}\u2026`;
922
- const sandboxes = sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : "stopping and deleting the runner's sandboxes";
848
+ function cleanupText(keepMs, release) {
849
+ if (keepMs === null) return release === void 0 ? "nothing to release" : `${release}\u2026`;
850
+ const sandboxes = keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(keepMs)}` : "stopping and deleting the runner's sandboxes";
923
851
  return `${sandboxes}${release === void 0 ? "" : `, then ${release}`}\u2026`;
924
852
  }
925
853
  function commandEnd(outcome) {
@@ -1141,7 +1069,7 @@ function lanesRecord(state, view) {
1141
1069
  const snapshot = runner.steps.find(({ name }) => name === "snapshot");
1142
1070
  const parts = [
1143
1071
  ...runner.sandbox === void 0 ? [] : [`${runner.sandbox.name} \xB7 ${runner.sandbox.region} \xB7 ${runner.sandbox.vcpus} vCPU`],
1144
- ...snapshot === void 0 || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner)],
1072
+ ...snapshot === void 0 || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner, state.base?.sha)],
1145
1073
  ...runner.status === "failed" || runner.status === "stopped" ? [runner.status] : []
1146
1074
  ];
1147
1075
  lines.push(
@@ -1158,11 +1086,11 @@ function lanesRecord(state, view) {
1158
1086
  function runnerGlyph(runner, view) {
1159
1087
  return view.glyph(runner.steps.some(({ status }) => status === "failed") ? "failed" : runner.status);
1160
1088
  }
1161
- function snapshotText(step, runner) {
1089
+ function snapshotText(step, runner, mergeBase) {
1162
1090
  if (runner.snapshot?.kind === "built") return "snapshot built";
1163
1091
  if (runner.snapshot?.kind === "reused") {
1164
- const { snapshot, base } = runner.snapshot;
1165
- return `snapshot ${builtAtText({ ...snapshot, atMergeBase: snapshot.builtAt === base })}`;
1092
+ const { base, builtBehind } = runner.snapshot;
1093
+ return `snapshot ${builtAtText({ base, builtBehind, mergeBase })}`;
1166
1094
  }
1167
1095
  return `snapshot build ${step.status === "running" ? "stopped" : step.status}`;
1168
1096
  }
@@ -1283,8 +1211,8 @@ function waitingText(waiting) {
1283
1211
  function cleanupLine(cleanup, runner, view, record) {
1284
1212
  const done = record || cleanup.status !== "running";
1285
1213
  const release = releaseText(cleanup.resources, done);
1286
- const { runnerSandbox } = cleanup;
1287
- const text = !done && cleanup.waiting ? `${WAITING_FOR_SNAPSHOT}\u2026` : runnerSandbox === null ? release ?? "nothing to release" : `${runnerSandboxText(runnerSandbox, runner, done)}${release === void 0 ? "" : `, ${release}`}`;
1214
+ const { keepMs } = cleanup;
1215
+ const text = !done && cleanup.waiting ? `${WAITING_FOR_SNAPSHOT}\u2026` : keepMs === null ? release ?? "nothing to release" : `${runnerSandboxText(keepMs, runner, done)}${release === void 0 ? "" : `, ${release}`}`;
1288
1216
  const leftBehind = cleanupProblems(cleanup);
1289
1217
  const ending = done ? leftBehind === 0 ? "" : `: ${leftBehind} left behind` : "\u2026";
1290
1218
  return view.row(
@@ -1292,19 +1220,11 @@ function cleanupLine(cleanup, runner, view, record) {
1292
1220
  elapsed(view, cleanup.startedAt, cleanup.endedAt)
1293
1221
  );
1294
1222
  }
1295
- function runnerSandboxText(sandbox, runner, done) {
1223
+ function runnerSandboxText(keepMs, runner, done) {
1296
1224
  const kept = runner?.kept;
1297
1225
  if (kept !== void 0) return `kept the runner sandbox until ${isoSecondsText(kept.stopsAt)}`;
1298
1226
  const removed = `${done ? "stopped and deleted" : "stopping and deleting"} the runner sandbox`;
1299
- switch (sandbox.kind) {
1300
- case "keep":
1301
- return !done && sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : removed;
1302
- case "save": {
1303
- const save = runner?.save;
1304
- if (save?.kind === "saved") return `saved dev snapshot ${save.id} of ${headText(save.branch)}`;
1305
- return !done && save?.kind !== "not-saved" ? `saving a dev snapshot of ${headText(sandbox.branch)}` : removed;
1306
- }
1307
- }
1227
+ return !done && keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(keepMs)}` : removed;
1308
1228
  }
1309
1229
  function statusGlyph(status, now, paint2) {
1310
1230
  switch (status) {
@@ -1465,14 +1385,6 @@ function runnerNoticeLines(event, line) {
1465
1385
  switch (event.kind) {
1466
1386
  case "snapshot-entry-not-written":
1467
1387
  return [line("runner", cacheWriteFailureText(event.failure))];
1468
- case "dev-snapshots-dropped":
1469
- case "dev-snapshots-not-dropped":
1470
- return [line("runner", devSnapshotsDropText(event))];
1471
- case "dev-snapshot-saved":
1472
- case "dev-snapshot-not-saved":
1473
- return [line("cleanup", devSnapshotSaveText(event))];
1474
- case "dev-snapshot-skipped":
1475
- return [line("cleanup", devSnapshotSkippedText(event))];
1476
1388
  // The runner row shows the build; its reasons, when a cached snapshot didn't fit, are lines of their own.
1477
1389
  case "snapshot-build-started":
1478
1390
  return event.why.kind === "no-snapshot" && event.why.rejected.length > 0 ? snapshotBuildTexts(event).map((text) => line("runner", text)) : [];
@@ -1494,7 +1406,6 @@ function runnerNoticeLines(event, line) {
1494
1406
  case "stopping":
1495
1407
  case "waiting-for-snapshot":
1496
1408
  case "sandbox-kept":
1497
- case "dev-snapshot-saving":
1498
1409
  return [];
1499
1410
  }
1500
1411
  }
@@ -1576,8 +1487,6 @@ var OWN_RUN_FIELDS = {
1576
1487
  project: z5.string().min(1).optional(),
1577
1488
  credential: z5.enum(["mint", "github-actions"]).optional(),
1578
1489
  unsandboxed: z5.boolean().default(false),
1579
- saveDevSnapshot: z5.boolean().optional(),
1580
- noReuseDevSnapshot: z5.boolean().default(false),
1581
1490
  showOutput: z5.boolean().default(false),
1582
1491
  keepSandbox: z5.string().optional(),
1583
1492
  verbose: z5.boolean().default(false)
@@ -1672,19 +1581,13 @@ async function runCommand({ app, ui, signal }, request, spec) {
1672
1581
  runner: outcome.runner === void 0 ? null : {
1673
1582
  snapshotId: outcome.runner.snapshotId,
1674
1583
  base: outcome.runner.base,
1675
- snapshotBranch: outcome.runner.snapshotBranch,
1676
- snapshotHead: outcome.runner.snapshotHead,
1677
- snapshotKind: outcome.runner.snapshot.kind,
1678
- snapshotBuiltAt: outcome.runner.snapshot.builtAt,
1679
- builtBehind: outcome.runner.snapshot.builtBehind,
1584
+ builtBehind: outcome.runner.builtBehind,
1680
1585
  uploadBytes: outcome.runner.uploadBytes,
1681
1586
  built: outcome.runner.built,
1682
1587
  vcpus: outcome.runner.vcpus,
1683
1588
  region: outcome.runner.region,
1684
1589
  runtime: outcome.runner.runtime,
1685
- buildMs: outcome.runner.buildMs,
1686
- save: outcome.runner.save,
1687
- noSaveReason: outcome.runner.noSave
1590
+ buildMs: outcome.runner.buildMs
1688
1591
  },
1689
1592
  timeline: ran,
1690
1593
  runId: recording.opened.ok ? recording.opened.id : null
@@ -1727,7 +1630,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
1727
1630
  }
1728
1631
  }
1729
1632
  function runProblems(request) {
1730
- const { credential, unsandboxed, saveDevSnapshot, showOutput, keepSandbox } = request;
1633
+ const { credential, unsandboxed, showOutput, keepSandbox } = request;
1731
1634
  return [
1732
1635
  ...resourceFlagProblems(request),
1733
1636
  ...!unsandboxed && credential === "github-actions" ? [
@@ -1753,18 +1656,6 @@ function runProblems(request) {
1753
1656
  field: "keepSandbox",
1754
1657
  message: "--keep-sandbox keeps a sandboxed run's runner sandbox; drop it or --unsandboxed."
1755
1658
  }
1756
- ] : [],
1757
- ...saveDevSnapshot === true && unsandboxed ? [
1758
- {
1759
- field: "saveDevSnapshot",
1760
- message: "--save-dev-snapshot saves a sandboxed run's runner sandbox; drop it or --unsandboxed."
1761
- }
1762
- ] : [],
1763
- ...saveDevSnapshot === true && keepsSandbox(keepSandbox) ? [
1764
- {
1765
- field: "saveDevSnapshot",
1766
- message: "--save-dev-snapshot saves the runner sandbox instead of keeping it; drop --keep-sandbox or set it to 0."
1767
- }
1768
1659
  ] : []
1769
1660
  ];
1770
1661
  }
@@ -1779,17 +1670,11 @@ async function runRequestFor(app, options) {
1779
1670
  };
1780
1671
  return { ok: true, run: run2 };
1781
1672
  }
1782
- if (request.saveDevSnapshot && !devSnapshotsTrusted(where.recipe))
1783
- return {
1784
- ok: false,
1785
- refusal: runErrors.devSnapshotsNotTrusted({ flag: "--save-dev-snapshot", configFile })
1786
- };
1787
1673
  const prepared = await prepareRunner(app.context, {
1788
1674
  cwd: app.cwd,
1789
1675
  recipe: where.recipe,
1790
1676
  // The recipe's `vcpus` reads each of the run's resources by its definition: one its `beforeRun` skipped isn't.
1791
- vcpusRun: recipeRun(recipeResources(used.requests)),
1792
- reuseDevSnapshots: !request.noReuseDevSnapshot && where.recipe.reuseDevSnapshot
1677
+ vcpusRun: recipeRun(recipeResources(used.requests))
1793
1678
  });
1794
1679
  if (prepared.kind !== "ok") {
1795
1680
  const refusal = prepareRefusal(prepared, configFile);
@@ -1809,7 +1694,6 @@ async function runRequestFor(app, options) {
1809
1694
  target: where.target,
1810
1695
  user: app.user,
1811
1696
  secrets: where.secrets,
1812
- save: saveMode(request, where.recipe, app.env),
1813
1697
  keepMs
1814
1698
  }
1815
1699
  };
@@ -1901,21 +1785,6 @@ function recipeResources(requests) {
1901
1785
  })
1902
1786
  );
1903
1787
  }
1904
- function keepsSandbox(flag) {
1905
- return flag !== void 0 && (parseKeepTime(flag) ?? 0) > 0;
1906
- }
1907
- function saveMode(request, recipe, env) {
1908
- const flag = request.saveDevSnapshot;
1909
- if (flag !== void 0) return flag ? { kind: "always" } : { kind: "never", reason: "no-save-flag" };
1910
- if (keepsSandbox(request.keepSandbox)) return { kind: "never", reason: "keep-sandbox" };
1911
- if (recipe.saveDevSnapshot !== void 0)
1912
- return recipe.saveDevSnapshot ? { kind: "always" } : { kind: "never", reason: "recipe" };
1913
- if (isCi(env)) return { kind: "never", reason: "ci" };
1914
- return devSnapshotsTrusted(recipe) ? { kind: "new-head" } : { kind: "never", reason: "not-trusted" };
1915
- }
1916
- function runSaveDefault(recipe, env) {
1917
- return saveMode({}, recipe, env);
1918
- }
1919
1788
  var DEFAULT_KEEP_SANDBOX_MINUTES = 30;
1920
1789
  function keepSandboxMinutes(flag, recipe, env) {
1921
1790
  const fromFlag = flag === void 0 ? void 0 : parseKeepTime(flag);
@@ -1979,8 +1848,6 @@ export {
1979
1848
  RUN_ERRORS,
1980
1849
  outcomes,
1981
1850
  lineProgress,
1982
- progressLine,
1983
- headText,
1984
1851
  canceledBeforeStart,
1985
1852
  RUN_REQUEST_FIELDS,
1986
1853
  RUN_CLI_OPTIONS,
@@ -1988,6 +1855,5 @@ export {
1988
1855
  runProblems,
1989
1856
  prepareRefusal,
1990
1857
  checkoutFailedRefusal,
1991
- runSaveDefault,
1992
1858
  runnerFailureFacts
1993
1859
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  secondsOf,
3
3
  secondsText
4
- } from "./chunk-FSP3SJ35.js";
4
+ } from "./chunk-6EQKA7LI.js";
5
5
 
6
6
  // src/commands/exec/text.ts
7
7
  function seconds(ms) {
@@ -5,14 +5,11 @@ import {
5
5
  sandboxPage,
6
6
  snapshotPage
7
7
  } from "./chunk-NMVODY3P.js";
8
- import {
9
- noSaveReasonSchema
10
- } from "./chunk-TEEZL3GA.js";
11
8
  import {
12
9
  isoSecondsText,
13
10
  seconds,
14
11
  short
15
- } from "./chunk-TMQQYHUX.js";
12
+ } from "./chunk-RTILVSYQ.js";
16
13
 
17
14
  // src/commands/runs/facts.ts
18
15
  import { z } from "zod";
@@ -73,45 +70,17 @@ var runFactsSchema = z.object({
73
70
  keptUntil: z.string().nullable(),
74
71
  /** How many whole minutes are left until keptUntil, as of reading the run, 0 once it has passed; null when keptUntil is. */
75
72
  keptMinutesLeft: z.number().nullable(),
76
- /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, for a dev snapshot the HEAD commit of the run that saved it and its branch (the commit is null for a base snapshot, the branch for a base snapshot and for a run on a detached HEAD), and its page in the Vercel dashboard. Null until known. */
73
+ /** The runner snapshot it started from: its id, the base it is of, which the run's changes went on top of, whether this run built it or reused it, and its page in the Vercel dashboard. Null until known. */
77
74
  snapshot: z.object({
78
75
  id: z.string(),
79
76
  base: z.string(),
80
77
  built: z.boolean(),
81
- branch: z.string().nullable(),
82
- head: z.string().nullable(),
83
- /** Its kind, a base snapshot or a dev snapshot; null in a record written before storm recorded it. */
84
- kind: z.enum(["base", "dev"]).nullable(),
85
- /** The commit it was built at, a full SHA: a base snapshot's base, or the commit that saved a dev snapshot; null when unknown. */
86
- builtAt: z.string().nullable(),
87
- /** How many commits the run's HEAD had that its built-at commit lacks; null when unknown. */
78
+ /** How many commits the run's HEAD had that its base, the commit it was built at, lacks; null when the run state had no count. */
88
79
  builtBehind: z.number().nullable(),
89
80
  url: z.string()
90
81
  }).nullable(),
91
- /** How many bytes of changes the run uploaded to the runner sandbox; null when unknown. */
92
- uploadBytes: z.number().nullable(),
93
- /** Why the run, whose command ended on its own, started no save of a dev snapshot; null when it started one, or when unknown. */
94
- noSaveReason: noSaveReasonSchema.nullable(),
95
- /** How saving the runner sandbox as a dev snapshot ended, as the run's ran result's runner.save says, with the saved snapshot's page in the Vercel dashboard (`url`, null unless saved); null when the run started no save. */
96
- save: z.discriminatedUnion("kind", [
97
- z.object({
98
- kind: z.literal("saved"),
99
- snapshotId: z.string(),
100
- base: z.string(),
101
- branch: z.string().nullable(),
102
- head: z.string(),
103
- ms: z.number(),
104
- sizeBytes: z.number(),
105
- entryWritten: z.boolean(),
106
- url: z.string()
107
- }),
108
- z.object({
109
- kind: z.literal("failed"),
110
- step: z.enum(["scrub", "save-snapshot"]),
111
- message: z.string()
112
- }),
113
- z.object({ kind: z.literal("stopped") })
114
- ]).nullable()
82
+ /** How many bytes of changes the run uploaded to the runner sandbox; null when the run stopped before the upload. */
83
+ uploadBytes: z.number().nullable()
115
84
  })
116
85
  ]).nullable(),
117
86
  /** The Git checkout it started from: HEAD's branch (null when detached), its commit, and whether the working tree had uncommitted changes or untracked files. Null outside a Git checkout, or when unknown. */
@@ -167,13 +136,12 @@ function runFacts(run, now) {
167
136
  }
168
137
  function whereFacts(where, now) {
169
138
  if (where.kind === "unsandboxed") return { kind: "unsandboxed" };
170
- const { sandbox, snapshot, keptUntil, save } = where;
139
+ const { sandbox, snapshot, keptUntil } = where;
171
140
  return {
172
141
  ...where,
173
142
  keptMinutesLeft: keptUntil === null ? null : Math.max(0, Math.floor((Date.parse(keptUntil) - now.getTime()) / 6e4)),
174
143
  sandboxUrl: sandbox === null ? null : sandboxPage(where, sandbox),
175
- snapshot: snapshot === null ? null : { ...snapshot, url: snapshotPage(where, snapshot.id) },
176
- save: save?.kind === "saved" ? { ...save, url: snapshotPage(where, save.snapshotId) } : save
144
+ snapshot: snapshot === null ? null : { ...snapshot, url: snapshotPage(where, snapshot.id) }
177
145
  };
178
146
  }
179
147
  function scopeFacts(scope) {
@@ -2,11 +2,11 @@ import {
2
2
  EMPTY_RUN_STATE,
3
3
  commandExitStatus,
4
4
  observeAll
5
- } from "./chunk-FSP3SJ35.js";
5
+ } from "./chunk-6EQKA7LI.js";
6
6
  import {
7
7
  parseTestEvent,
8
8
  testEventLine
9
- } from "./chunk-ODQHQJLE.js";
9
+ } from "./chunk-ZDJLKF2G.js";
10
10
 
11
11
  // src/run-directory/run-directory.ts
12
12
  import { join } from "node:path";
@@ -94,52 +94,8 @@ var snapshotSchema = z2.object({
94
94
  id: z2.string(),
95
95
  base: z2.string(),
96
96
  built: z2.boolean(),
97
- branch: z2.string().nullable(),
98
- head: z2.string().nullable(),
99
- // A record written before these existed lacks them, and reads each as null.
100
- kind: z2.enum(["base", "dev"]).nullable().default(null),
101
- builtAt: z2.string().nullable().default(null),
102
- builtBehind: z2.number().nullable().default(null)
97
+ builtBehind: z2.number().nullable()
103
98
  });
104
- var noSaveReasonSchema = z2.enum([
105
- "no-save-flag",
106
- "recipe",
107
- "keep-sandbox",
108
- "ci",
109
- "not-trusted",
110
- "command-failed",
111
- "already-saved"
112
- ]);
113
- var saveSchema = z2.discriminatedUnion("kind", [
114
- z2.object({
115
- /** It saved the runner sandbox as a dev snapshot. */
116
- kind: z2.literal("saved"),
117
- /** The runner snapshot it saved. */
118
- snapshotId: z2.string(),
119
- /** The base it is of: the base of the runner snapshot the run started from, a full SHA. */
120
- base: z2.string(),
121
- /** HEAD's local branch as the run started; null when HEAD was detached. */
122
- branch: z2.string().nullable(),
123
- /** HEAD's commit as the run started, a full SHA, which the dev snapshot was built at. */
124
- head: z2.string(),
125
- /** How long the save took, in milliseconds, from the scrub's start until the snapshot was saved. */
126
- ms: z2.number(),
127
- /** The snapshot's size in bytes. */
128
- sizeBytes: z2.number(),
129
- /** Whether the runner snapshot cache recorded it; a later run starts from it only when it did. */
130
- entryWritten: z2.boolean()
131
- }),
132
- z2.object({
133
- /** It didn't save: the scrub or the save failed. */
134
- kind: z2.literal("failed"),
135
- step: z2.enum(["scrub", "save-snapshot"]),
136
- message: z2.string()
137
- }),
138
- z2.object({
139
- /** It didn't save, or recorded nothing: a signal stopped it. */
140
- kind: z2.literal("stopped")
141
- })
142
- ]);
143
99
  var whereSchema = z2.discriminatedUnion("kind", [
144
100
  z2.object({ kind: z2.literal("unsandboxed") }),
145
101
  z2.object({
@@ -154,15 +110,12 @@ var whereSchema = z2.discriminatedUnion("kind", [
154
110
  sandbox: z2.string().nullable(),
155
111
  snapshot: snapshotSchema.nullable(),
156
112
  keptUntil: z2.string().nullable(),
157
- save: saveSchema.nullable(),
158
- // A record written before these existed lacks them, and reads each as null.
159
- uploadBytes: z2.number().nullable().default(null),
160
- noSaveReason: noSaveReasonSchema.nullable().default(null)
113
+ uploadBytes: z2.number().nullable()
161
114
  })
162
115
  ]);
163
116
  var gitSchema = z2.object({ branch: z2.string().nullable(), commit: z2.string(), dirty: z2.boolean() });
164
117
  var runRecordSchema = z2.object({
165
- version: z2.literal(4),
118
+ version: z2.literal(5),
166
119
  startedAt: z2.string(),
167
120
  cwd: z2.string(),
168
121
  configFile: z2.string().nullable(),
@@ -231,12 +184,10 @@ function startedWhere(run) {
231
184
  sandbox: null,
232
185
  snapshot: null,
233
186
  keptUntil: null,
234
- save: null,
235
- uploadBytes: null,
236
- noSaveReason: null
187
+ uploadBytes: null
237
188
  };
238
189
  }
239
- function endedWhere(where, runner, save) {
190
+ function endedWhere(where, runner) {
240
191
  if (where.kind === "unsandboxed") return where;
241
192
  const snapshot = runner?.snapshot;
242
193
  return {
@@ -246,16 +197,10 @@ function endedWhere(where, runner, save) {
246
197
  id: snapshot.id,
247
198
  base: snapshot.base,
248
199
  built: snapshot.kind === "built",
249
- branch: snapshot.branch,
250
- head: snapshot.head,
251
- kind: snapshot.snapshot.kind,
252
- builtAt: snapshot.snapshot.builtAt,
253
- builtBehind: snapshot.snapshot.builtBehind
200
+ builtBehind: snapshot.builtBehind
254
201
  },
255
202
  keptUntil: runner?.kept?.stopsAt ?? null,
256
- save,
257
- uploadBytes: runner?.uploadBytes ?? null,
258
- noSaveReason: runner?.noSave ?? null
203
+ uploadBytes: runner?.uploadBytes ?? null
259
204
  };
260
205
  }
261
206
 
@@ -783,7 +728,7 @@ function summaryEvent(event) {
783
728
  async function recordRun(gateway, start) {
784
729
  const { definitionSet } = start;
785
730
  const record = start.redact({
786
- version: 4,
731
+ version: 5,
787
732
  startedAt: start.startedAt.toISOString(),
788
733
  cwd: start.cwd,
789
734
  configFile: start.configFile,
@@ -825,7 +770,7 @@ async function recordRun(gateway, start) {
825
770
  directory?.writeRun(
826
771
  runRecordText({
827
772
  ...record,
828
- where: endedWhere(record.where, state.runner, outcome.kind === "ran" ? outcome.runner?.save ?? null : null),
773
+ where: endedWhere(record.where, state.runner),
829
774
  ended: runEnd(outcome, state.command, tests, definitionSet.reports)
830
775
  })
831
776
  );
@@ -843,8 +788,6 @@ export {
843
788
  liveRunDirectoryGateway,
844
789
  unavailableRunDirectoryGateway,
845
790
  planSchema,
846
- noSaveReasonSchema,
847
- saveSchema,
848
791
  timelineSchema,
849
792
  recordRun,
850
793
  pastRuns