@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.
- package/dist/bin/storm.js +1 -1
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-4XT5RC5T.js → chunk-2NZXL6OH.js} +6 -42
- package/dist/chunks/{chunk-ISGQJIQM.js → chunk-5UMJNVKT.js} +1 -1
- package/dist/chunks/{chunk-FSP3SJ35.js → chunk-6EQKA7LI.js} +16 -46
- package/dist/chunks/{chunk-Y3BUNNRG.js → chunk-AX4EQZUS.js} +4 -4
- package/dist/chunks/{chunk-RYRJNHL7.js → chunk-DOFB2ACU.js} +3 -9
- package/dist/chunks/{chunk-SXW6XN4R.js → chunk-EGNP3S6C.js} +3 -3
- package/dist/chunks/{chunk-FK4RLDEK.js → chunk-N7E6DAUE.js} +1 -1
- package/dist/chunks/{chunk-U7M3ZB3Z.js → chunk-Q4TKRILH.js} +33 -167
- package/dist/chunks/{chunk-TMQQYHUX.js → chunk-RTILVSYQ.js} +1 -1
- package/dist/chunks/{chunk-7D6LC5JY.js → chunk-X4WBJIOF.js} +7 -39
- package/dist/chunks/{chunk-TEEZL3GA.js → chunk-YGS5VRQT.js} +11 -68
- package/dist/chunks/{chunk-ODQHQJLE.js → chunk-ZDJLKF2G.js} +742 -1117
- package/dist/chunks/{live-app-AZ5N5HBD.js → live-app-QFHS54SX.js} +4 -4
- package/dist/commands/exec/command.d.ts +2 -90
- package/dist/commands/exec/command.js +10 -10
- package/dist/commands/exec/define-run-command.d.ts +2 -90
- package/dist/commands/exec/live-view.js +18 -22
- package/dist/commands/exec/outcomes.d.ts +2 -106
- package/dist/commands/exec/outcomes.js +4 -35
- package/dist/commands/exec/progress.d.ts +3 -19
- package/dist/commands/exec/progress.js +16 -60
- package/dist/commands/exec/run-command.d.ts +4 -23
- package/dist/commands/exec/run-command.js +5 -79
- package/dist/commands/exec/run-metadata.d.ts +0 -6
- package/dist/commands/exec/run-metadata.js +2 -8
- package/dist/commands/exec/snapshot-text.d.ts +7 -16
- package/dist/commands/exec/snapshot-text.js +9 -49
- package/dist/commands/exec/view.js +2 -12
- package/dist/commands/playwright/command.d.ts +2 -90
- package/dist/commands/playwright/command.js +11 -11
- package/dist/commands/runs/facts.d.ts +1 -37
- package/dist/commands/runs/facts.js +4 -36
- package/dist/commands/runs/list/command.d.ts +0 -72
- package/dist/commands/runs/list/command.js +5 -5
- package/dist/commands/runs/list/outcomes.d.ts +0 -36
- package/dist/commands/runs/logs/command.js +5 -5
- package/dist/commands/runs/show/command.d.ts +0 -72
- package/dist/commands/runs/show/command.js +13 -40
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +0 -36
- package/dist/commands/runs/show/outcomes.js +8 -42
- package/dist/commands/snapshots/build/command.d.ts +14 -411
- package/dist/commands/snapshots/build/command.js +56 -231
- package/dist/commands/snapshots/build/metadata.js +10 -7
- package/dist/commands/snapshots/build/outcomes.d.ts +11 -241
- package/dist/commands/snapshots/build/outcomes.js +29 -196
- package/dist/commands/snapshots/list/command.d.ts +2 -36
- package/dist/commands/snapshots/list/command.js +17 -53
- package/dist/commands/snapshots/list/metadata.js +1 -1
- package/dist/commands/snapshots/list/outcomes.d.ts +2 -37
- package/dist/commands/snapshots/list/outcomes.js +13 -53
- package/dist/commands/vitest/command.d.ts +2 -90
- package/dist/commands/vitest/command.js +11 -11
- package/dist/core/events.d.ts +5 -6
- package/dist/core/run-state.d.ts +7 -29
- package/dist/core/run-state.js +3 -26
- package/dist/core/run.d.ts +6 -14
- package/dist/core/run.js +17 -28
- package/dist/extensions/testserver/commands/pool/create/command.js +1 -1
- package/dist/run-directory/index.d.ts +1 -1
- package/dist/run-directory/index.js +0 -1
- package/dist/run-directory/recording.js +2 -2
- package/dist/run-directory/run-record.d.ts +14 -132
- package/dist/run-directory/run-record.js +8 -68
- package/dist/runner/build-snapshots.d.ts +50 -114
- package/dist/runner/build-snapshots.js +70 -159
- package/dist/runner/events.d.ts +4 -88
- package/dist/runner/gateways.d.ts +5 -23
- package/dist/runner/index.d.ts +5 -6
- package/dist/runner/index.js +1 -1
- package/dist/runner/live/snapshot-records.js +7 -18
- package/dist/runner/prepare.d.ts +11 -22
- package/dist/runner/prepare.js +6 -17
- package/dist/runner/ready.d.ts +16 -45
- package/dist/runner/ready.js +34 -59
- package/dist/runner/recipe.d.ts +0 -44
- package/dist/runner/recipe.js +0 -41
- package/dist/runner/scope.d.ts +8 -25
- package/dist/runner/scope.js +4 -8
- package/dist/runner/session.d.ts +18 -65
- package/dist/runner/session.js +15 -83
- package/dist/runner/snapshot-build.d.ts +2 -2
- package/dist/runner/snapshot-cache.d.ts +22 -74
- package/dist/runner/snapshot-cache.js +15 -107
- package/dist/runner/snapshot-inspect.d.ts +9 -13
- package/dist/runner/snapshot-inspect.js +48 -57
- package/dist/runner/snapshot-key.d.ts +9 -14
- package/dist/runner/snapshot-key.js +15 -22
- package/package.json +1 -1
- package/skills/read-run-output.md +8 -9
- package/dist/runner/snapshot-save.d.ts +0 -70
- package/dist/runner/snapshot-save.js +0 -160
- package/dist/runner/snapshot-start.d.ts +0 -25
- package/dist/runner/snapshot-start.js +0 -16
|
@@ -12,8 +12,6 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<import("zod")
|
|
|
12
12
|
mint: "mint";
|
|
13
13
|
}>>;
|
|
14
14
|
unsandboxed: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
15
|
-
saveDevSnapshot: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
16
|
-
noReuseDevSnapshot: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
17
15
|
showOutput: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
18
16
|
keepSandbox: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
17
|
verbose: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
@@ -32,48 +30,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<import("zod")
|
|
|
32
30
|
runner: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
33
31
|
snapshotId: import("zod").ZodString;
|
|
34
32
|
base: import("zod").ZodString;
|
|
35
|
-
|
|
36
|
-
snapshotHead: import("zod").ZodNullable<import("zod").ZodString>;
|
|
37
|
-
snapshotKind: import("zod").ZodEnum<{
|
|
38
|
-
base: "base";
|
|
39
|
-
dev: "dev";
|
|
40
|
-
}>;
|
|
41
|
-
snapshotBuiltAt: import("zod").ZodString;
|
|
42
|
-
builtBehind: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
33
|
+
builtBehind: import("zod").ZodNumber;
|
|
43
34
|
uploadBytes: import("zod").ZodNumber;
|
|
44
35
|
built: import("zod").ZodBoolean;
|
|
45
36
|
vcpus: import("zod").ZodNumber;
|
|
46
37
|
region: import("zod").ZodString;
|
|
47
38
|
runtime: import("zod").ZodString;
|
|
48
39
|
buildMs: import("zod").ZodNumber;
|
|
49
|
-
save: import("zod").ZodNullable<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
50
|
-
kind: import("zod").ZodLiteral<"saved">;
|
|
51
|
-
snapshotId: import("zod").ZodString;
|
|
52
|
-
base: import("zod").ZodString;
|
|
53
|
-
branch: import("zod").ZodNullable<import("zod").ZodString>;
|
|
54
|
-
head: import("zod").ZodString;
|
|
55
|
-
ms: import("zod").ZodNumber;
|
|
56
|
-
sizeBytes: import("zod").ZodNumber;
|
|
57
|
-
entryWritten: import("zod").ZodBoolean;
|
|
58
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
59
|
-
kind: import("zod").ZodLiteral<"failed">;
|
|
60
|
-
step: import("zod").ZodEnum<{
|
|
61
|
-
"save-snapshot": "save-snapshot";
|
|
62
|
-
scrub: "scrub";
|
|
63
|
-
}>;
|
|
64
|
-
message: import("zod").ZodString;
|
|
65
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
66
|
-
kind: import("zod").ZodLiteral<"stopped">;
|
|
67
|
-
}, import("zod/v4/core").$strip>], "kind">>;
|
|
68
|
-
noSaveReason: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
69
|
-
"already-saved": "already-saved";
|
|
70
|
-
ci: "ci";
|
|
71
|
-
"command-failed": "command-failed";
|
|
72
|
-
"keep-sandbox": "keep-sandbox";
|
|
73
|
-
"no-save-flag": "no-save-flag";
|
|
74
|
-
"not-trusted": "not-trusted";
|
|
75
|
-
recipe: "recipe";
|
|
76
|
-
}>>;
|
|
77
40
|
}, import("zod/v4/core").$strip>>;
|
|
78
41
|
timeline: import("zod").ZodObject<{
|
|
79
42
|
startedAt: import("zod").ZodString;
|
|
@@ -139,10 +102,6 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<import("zod")
|
|
|
139
102
|
flags: string[];
|
|
140
103
|
configFile: string | null;
|
|
141
104
|
}]>;
|
|
142
|
-
devSnapshotsNotTrusted: import("@vercel/clinkr").SharedError<"dev_snapshots_not_trusted", [data: {
|
|
143
|
-
flag: string;
|
|
144
|
-
configFile: string | null;
|
|
145
|
-
}]>;
|
|
146
105
|
driverPlanFailed: import("@vercel/clinkr").SharedError<"driver_plan_failed", [data: {
|
|
147
106
|
driver: string;
|
|
148
107
|
kind: "exited" | "start-failed" | "timed-out" | "unreadable-output";
|
|
@@ -262,10 +221,6 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<import("zod")
|
|
|
262
221
|
flags: string[];
|
|
263
222
|
configFile: string | null;
|
|
264
223
|
}]>;
|
|
265
|
-
readonly devSnapshotsNotTrusted: import("@vercel/clinkr").SharedError<"dev_snapshots_not_trusted", [data: {
|
|
266
|
-
flag: string;
|
|
267
|
-
configFile: string | null;
|
|
268
|
-
}]>;
|
|
269
224
|
readonly driverPlanFailed: import("@vercel/clinkr").SharedError<"driver_plan_failed", [data: {
|
|
270
225
|
driver: string;
|
|
271
226
|
kind: "exited" | "start-failed" | "timed-out" | "unreadable-output";
|
|
@@ -394,48 +349,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<import("zod")
|
|
|
394
349
|
runner: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
395
350
|
snapshotId: import("zod").ZodString;
|
|
396
351
|
base: import("zod").ZodString;
|
|
397
|
-
|
|
398
|
-
snapshotHead: import("zod").ZodNullable<import("zod").ZodString>;
|
|
399
|
-
snapshotKind: import("zod").ZodEnum<{
|
|
400
|
-
base: "base";
|
|
401
|
-
dev: "dev";
|
|
402
|
-
}>;
|
|
403
|
-
snapshotBuiltAt: import("zod").ZodString;
|
|
404
|
-
builtBehind: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
352
|
+
builtBehind: import("zod").ZodNumber;
|
|
405
353
|
uploadBytes: import("zod").ZodNumber;
|
|
406
354
|
built: import("zod").ZodBoolean;
|
|
407
355
|
vcpus: import("zod").ZodNumber;
|
|
408
356
|
region: import("zod").ZodString;
|
|
409
357
|
runtime: import("zod").ZodString;
|
|
410
358
|
buildMs: import("zod").ZodNumber;
|
|
411
|
-
save: import("zod").ZodNullable<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
412
|
-
kind: import("zod").ZodLiteral<"saved">;
|
|
413
|
-
snapshotId: import("zod").ZodString;
|
|
414
|
-
base: import("zod").ZodString;
|
|
415
|
-
branch: import("zod").ZodNullable<import("zod").ZodString>;
|
|
416
|
-
head: import("zod").ZodString;
|
|
417
|
-
ms: import("zod").ZodNumber;
|
|
418
|
-
sizeBytes: import("zod").ZodNumber;
|
|
419
|
-
entryWritten: import("zod").ZodBoolean;
|
|
420
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
421
|
-
kind: import("zod").ZodLiteral<"failed">;
|
|
422
|
-
step: import("zod").ZodEnum<{
|
|
423
|
-
"save-snapshot": "save-snapshot";
|
|
424
|
-
scrub: "scrub";
|
|
425
|
-
}>;
|
|
426
|
-
message: import("zod").ZodString;
|
|
427
|
-
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
428
|
-
kind: import("zod").ZodLiteral<"stopped">;
|
|
429
|
-
}, import("zod/v4/core").$strip>], "kind">>;
|
|
430
|
-
noSaveReason: import("zod").ZodNullable<import("zod").ZodEnum<{
|
|
431
|
-
"already-saved": "already-saved";
|
|
432
|
-
ci: "ci";
|
|
433
|
-
"command-failed": "command-failed";
|
|
434
|
-
"keep-sandbox": "keep-sandbox";
|
|
435
|
-
"no-save-flag": "no-save-flag";
|
|
436
|
-
"not-trusted": "not-trusted";
|
|
437
|
-
recipe: "recipe";
|
|
438
|
-
}>>;
|
|
439
359
|
}, import("zod/v4/core").$strip>>;
|
|
440
360
|
timeline: import("zod").ZodObject<{
|
|
441
361
|
startedAt: import("zod").ZodString;
|
|
@@ -501,10 +421,6 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<import("zod")
|
|
|
501
421
|
flags: string[];
|
|
502
422
|
configFile: string | null;
|
|
503
423
|
}]>;
|
|
504
|
-
devSnapshotsNotTrusted: import("@vercel/clinkr").SharedError<"dev_snapshots_not_trusted", [data: {
|
|
505
|
-
flag: string;
|
|
506
|
-
configFile: string | null;
|
|
507
|
-
}]>;
|
|
508
424
|
driverPlanFailed: import("@vercel/clinkr").SharedError<"driver_plan_failed", [data: {
|
|
509
425
|
driver: string;
|
|
510
426
|
kind: "exited" | "start-failed" | "timed-out" | "unreadable-output";
|
|
@@ -624,10 +540,6 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<import("zod")
|
|
|
624
540
|
flags: string[];
|
|
625
541
|
configFile: string | null;
|
|
626
542
|
}]>;
|
|
627
|
-
readonly devSnapshotsNotTrusted: import("@vercel/clinkr").SharedError<"dev_snapshots_not_trusted", [data: {
|
|
628
|
-
flag: string;
|
|
629
|
-
configFile: string | null;
|
|
630
|
-
}]>;
|
|
631
543
|
readonly driverPlanFailed: import("@vercel/clinkr").SharedError<"driver_plan_failed", [data: {
|
|
632
544
|
driver: string;
|
|
633
545
|
kind: "exited" | "start-failed" | "timed-out" | "unreadable-output";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineRunCommand
|
|
3
|
-
} from "../../chunks/chunk-
|
|
4
|
-
import "../../chunks/chunk-
|
|
5
|
-
import "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-EGNP3S6C.js";
|
|
4
|
+
import "../../chunks/chunk-DOFB2ACU.js";
|
|
5
|
+
import "../../chunks/chunk-Q4TKRILH.js";
|
|
6
6
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
7
|
-
import "../../chunks/chunk-
|
|
8
|
-
import "../../chunks/chunk-
|
|
9
|
-
import "../../chunks/chunk-
|
|
7
|
+
import "../../chunks/chunk-N7E6DAUE.js";
|
|
8
|
+
import "../../chunks/chunk-AX4EQZUS.js";
|
|
9
|
+
import "../../chunks/chunk-2NZXL6OH.js";
|
|
10
10
|
import {
|
|
11
11
|
driverNamed
|
|
12
|
-
} from "../../chunks/chunk-
|
|
12
|
+
} from "../../chunks/chunk-5UMJNVKT.js";
|
|
13
13
|
import "../../chunks/chunk-IYM44FUX.js";
|
|
14
14
|
import "../../chunks/chunk-LQKNI3EG.js";
|
|
15
15
|
import "../../chunks/chunk-NMVODY3P.js";
|
|
16
|
-
import "../../chunks/chunk-
|
|
17
|
-
import "../../chunks/chunk-
|
|
18
|
-
import "../../chunks/chunk-
|
|
19
|
-
import "../../chunks/chunk-
|
|
16
|
+
import "../../chunks/chunk-YGS5VRQT.js";
|
|
17
|
+
import "../../chunks/chunk-RTILVSYQ.js";
|
|
18
|
+
import "../../chunks/chunk-6EQKA7LI.js";
|
|
19
|
+
import "../../chunks/chunk-ZDJLKF2G.js";
|
|
20
20
|
import "../../chunks/chunk-YT5OROR7.js";
|
|
21
21
|
import "../../chunks/chunk-BW2ADH7U.js";
|
|
22
22
|
import "../../chunks/chunk-GQIL3AHY.js";
|
package/dist/core/events.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CredentialEvent } from "../credential/index.ts";
|
|
2
2
|
import type { LaneOutcome } from "../sdk/extension/index.ts";
|
|
3
|
-
import type { RunnerEvent,
|
|
3
|
+
import type { RunnerEvent, SnapshotCacheNote } from "../runner/index.ts";
|
|
4
4
|
import type { Clock } from "../time/index.ts";
|
|
5
5
|
import type { TestEvent } from "../sdk/run/launcher.ts";
|
|
6
6
|
import type { RunInstance, ResourceAcquired, ResourceEvent, ResourceNoticeEvent, ResourceSkip, ResourceWarningEvent, RunLane } from "./resource.ts";
|
|
@@ -34,10 +34,9 @@ import type { RanCommand } from "./timing.ts";
|
|
|
34
34
|
* - `command-started`: the command started, or is about to start in the runner sandbox.
|
|
35
35
|
* - `command-ended`: the command ended as `outcome` after `ms`; `command` is its executable's name. A command the
|
|
36
36
|
* run killed reports the runner's `command-stopped` instead.
|
|
37
|
-
* - `cleanup-started`: the run is cleaning up: with a runner sandbox
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* runs); and releasing its resource instances whose acquires took anything (`resources`, their resource keys, in
|
|
37
|
+
* - `cleanup-started`: the run is cleaning up: with a runner sandbox stopping and deleting the runner's sandboxes, but
|
|
38
|
+
* for the runner sandbox, which it keeps running `keepMs` when that is above 0 (`keepMs` is null without a runner
|
|
39
|
+
* sandbox); and releasing its resource instances whose acquires took anything (`resources`, their resource keys, in
|
|
41
40
|
* order).
|
|
42
41
|
* - `cleanup-finished`: it is done; `resourceWarnings` counts the warnings releasing the run's resource instances
|
|
43
42
|
* reported, summed over them, and it counts how many of the runner's sandboxes couldn't be stopped (`notStopped`) or
|
|
@@ -83,7 +82,7 @@ export type RunEvent = {
|
|
|
83
82
|
readonly ms: number;
|
|
84
83
|
} | {
|
|
85
84
|
readonly kind: "cleanup-started";
|
|
86
|
-
readonly
|
|
85
|
+
readonly keepMs: number | null;
|
|
87
86
|
readonly resources: readonly string[];
|
|
88
87
|
} | {
|
|
89
88
|
readonly kind: "cleanup-finished";
|
package/dist/core/run-state.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MintTarget } from "../credential/index.ts";
|
|
2
2
|
import type { LaneStates, ResourceDefinition, Span, SpanStatus } from "../sdk/extension/index.ts";
|
|
3
|
-
import type { KeptSandbox
|
|
3
|
+
import type { KeptSandbox } from "../runner/index.ts";
|
|
4
4
|
import type { TimedRunEvent } from "./events.ts";
|
|
5
5
|
import type { RunInstance } from "./resource.ts";
|
|
6
6
|
import { type SetupPhaseName } from "./setup-phases.ts";
|
|
@@ -24,36 +24,18 @@ export interface RunnerStepState {
|
|
|
24
24
|
readonly latest: string | undefined;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* What the runner did with its runner snapshot: reused or built one, of the base it holds, or is building one.
|
|
28
|
-
*
|
|
29
|
-
* says its kind, its built-at commit and how far it is behind the run.
|
|
27
|
+
* What the runner did with its runner snapshot: reused or built one, of the base it holds, or is building one.
|
|
28
|
+
* `builtBehind` is how many commits HEAD has that the base lacks, null when the base isn't in HEAD's history.
|
|
30
29
|
*/
|
|
31
30
|
export type RunnerSnapshotState = {
|
|
32
31
|
readonly kind: "reused" | "built";
|
|
33
32
|
readonly id: string;
|
|
34
33
|
readonly base: string;
|
|
35
|
-
readonly
|
|
36
|
-
readonly head: string | null;
|
|
37
|
-
readonly snapshot: StartedFromSnapshot;
|
|
34
|
+
readonly builtBehind: number | null;
|
|
38
35
|
} | {
|
|
39
36
|
readonly kind: "building";
|
|
40
37
|
readonly summary: string;
|
|
41
38
|
};
|
|
42
|
-
/**
|
|
43
|
-
* Saving the runner sandbox as a dev snapshot: under way, saved as runner snapshot `id` at HEAD commit `head`, or
|
|
44
|
-
* not saved. `branch` is HEAD's branch, null when detached.
|
|
45
|
-
*/
|
|
46
|
-
export type DevSnapshotSaveState = {
|
|
47
|
-
readonly kind: "saving";
|
|
48
|
-
readonly branch: string | null;
|
|
49
|
-
} | {
|
|
50
|
-
readonly kind: "saved";
|
|
51
|
-
readonly id: string;
|
|
52
|
-
readonly branch: string | null;
|
|
53
|
-
readonly head: string;
|
|
54
|
-
} | {
|
|
55
|
-
readonly kind: "not-saved";
|
|
56
|
-
};
|
|
57
39
|
/** One test worker, as its test events show it. */
|
|
58
40
|
export interface TestWorkerState {
|
|
59
41
|
/** Its worker index, from 0. */
|
|
@@ -93,10 +75,6 @@ export interface RunnerState extends Span {
|
|
|
93
75
|
readonly activity: "saving-snapshot" | "waiting-for-snapshot" | undefined;
|
|
94
76
|
/** The runner sandbox the run kept running once it ended, once closing kept it. */
|
|
95
77
|
readonly kept: KeptSandbox | undefined;
|
|
96
|
-
/** Saving the runner sandbox as a dev snapshot, once it began. */
|
|
97
|
-
readonly save: DevSnapshotSaveState | undefined;
|
|
98
|
-
/** Why the run, whose command ended on its own, started no save, once it said so. */
|
|
99
|
-
readonly noSave: RunnerNoSaveReason | undefined;
|
|
100
78
|
}
|
|
101
79
|
/** The command: its argument list and how it ended; `stopped` when the run killed it. */
|
|
102
80
|
export interface CommandState extends Span {
|
|
@@ -106,10 +84,10 @@ export interface CommandState extends Span {
|
|
|
106
84
|
/** The cleanup: what it stops and releases, and what it couldn't. */
|
|
107
85
|
export interface CleanupState extends Span {
|
|
108
86
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
87
|
+
* How long it keeps the runner sandbox running while it stops and deletes the runner's other sandboxes, stopping and
|
|
88
|
+
* deleting it at 0; null without a runner sandbox.
|
|
111
89
|
*/
|
|
112
|
-
readonly
|
|
90
|
+
readonly keepMs: number | null;
|
|
113
91
|
/** The resource keys of the resource instances it releases: each whose acquire took anything, in order. */
|
|
114
92
|
readonly resources: readonly string[];
|
|
115
93
|
/** How many warnings releasing the run's resource instances reported, summed over them. */
|
package/dist/core/run-state.js
CHANGED
|
@@ -74,8 +74,6 @@ function applyEvent(resources, state, event, at) {
|
|
|
74
74
|
uploadBytes: undefined,
|
|
75
75
|
activity: undefined,
|
|
76
76
|
kept: undefined,
|
|
77
|
-
save: undefined,
|
|
78
|
-
noSave: undefined,
|
|
79
77
|
},
|
|
80
78
|
};
|
|
81
79
|
case "minting":
|
|
@@ -137,7 +135,7 @@ function applyEvent(resources, state, event, at) {
|
|
|
137
135
|
status: "running",
|
|
138
136
|
startedAt: at,
|
|
139
137
|
endedAt: undefined,
|
|
140
|
-
|
|
138
|
+
keepMs: event.keepMs,
|
|
141
139
|
resources: event.resources,
|
|
142
140
|
resourceWarnings: 0,
|
|
143
141
|
notStopped: 0,
|
|
@@ -215,9 +213,7 @@ function applyRunnerEvent(state, event, at) {
|
|
|
215
213
|
kind: "reused",
|
|
216
214
|
id: event.snapshotId,
|
|
217
215
|
base: event.base,
|
|
218
|
-
|
|
219
|
-
head: event.head,
|
|
220
|
-
snapshot: event.snapshot,
|
|
216
|
+
builtBehind: event.builtBehind,
|
|
221
217
|
},
|
|
222
218
|
}));
|
|
223
219
|
case "snapshot-build-started":
|
|
@@ -228,14 +224,7 @@ function applyRunnerEvent(state, event, at) {
|
|
|
228
224
|
kind: "built",
|
|
229
225
|
id: event.snapshotId,
|
|
230
226
|
base: event.base,
|
|
231
|
-
|
|
232
|
-
head: null,
|
|
233
|
-
// A run builds its base snapshot at its own base.
|
|
234
|
-
snapshot: {
|
|
235
|
-
kind: "base",
|
|
236
|
-
builtAt: event.base,
|
|
237
|
-
builtBehind: event.builtBehind,
|
|
238
|
-
},
|
|
227
|
+
builtBehind: event.builtBehind,
|
|
239
228
|
},
|
|
240
229
|
activity: undefined,
|
|
241
230
|
}));
|
|
@@ -272,23 +261,11 @@ function applyRunnerEvent(state, event, at) {
|
|
|
272
261
|
return withRunner(state.cleanup === undefined ? state : { ...state, cleanup: { ...state.cleanup, waiting: true } }, () => ({ activity: "waiting-for-snapshot" }));
|
|
273
262
|
case "sandbox-kept":
|
|
274
263
|
return withRunner(state, () => ({ kept: { name: event.name, stopsAt: event.stopsAt } }));
|
|
275
|
-
case "dev-snapshot-saving":
|
|
276
|
-
return withRunner(state, () => ({ save: { kind: "saving", branch: event.branch } }));
|
|
277
|
-
case "dev-snapshot-saved":
|
|
278
|
-
return withRunner(state, () => ({
|
|
279
|
-
save: { kind: "saved", id: event.snapshotId, branch: event.branch, head: event.head },
|
|
280
|
-
}));
|
|
281
|
-
case "dev-snapshot-not-saved":
|
|
282
|
-
return withRunner(state, () => ({ save: { kind: "not-saved" } }));
|
|
283
|
-
case "dev-snapshot-skipped":
|
|
284
|
-
return withRunner(state, () => ({ noSave: event.reason }));
|
|
285
264
|
// A step's outcome comes from its lane's end, not from the end of its output.
|
|
286
265
|
case "output-started":
|
|
287
266
|
case "output-ended":
|
|
288
267
|
case "snapshot-entry-not-written":
|
|
289
268
|
case "command-output-started":
|
|
290
|
-
case "dev-snapshots-dropped":
|
|
291
|
-
case "dev-snapshots-not-dropped":
|
|
292
269
|
return state;
|
|
293
270
|
}
|
|
294
271
|
}
|
package/dist/core/run.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CredentialGateway, type CredentialSourceChoice, type GitHubActionsTokenGateway, type MintFailure, type MintTarget } from "../credential/index.ts";
|
|
2
|
-
import { type RunnerCleanupFacts, type RunnerContext, type RunnerFailure, type
|
|
2
|
+
import { type RunnerCleanupFacts, type RunnerContext, type RunnerFailure, type RunnerSessionRequest, type RunnerSnapshotCacheFailure, type RunnerSnapshotEntry } from "../runner/index.ts";
|
|
3
3
|
import type { Clock } from "../time/index.ts";
|
|
4
4
|
import type { RunProgress } from "./events.ts";
|
|
5
5
|
import type { CommandGateway } from "./gateways.ts";
|
|
@@ -22,7 +22,7 @@ export interface RunContext extends RunnerContext {
|
|
|
22
22
|
/**
|
|
23
23
|
* What a sandboxed run needs beyond an unsandboxed run: what its runner session runs (`RunnerSessionRequest`), the
|
|
24
24
|
* runner checked on this machine, the team and project the run's credential is minted for, the local user, the runner
|
|
25
|
-
* secrets,
|
|
25
|
+
* secrets, and how long it keeps the runner sandbox.
|
|
26
26
|
*/
|
|
27
27
|
export type RunRunnerRequest = RunnerSessionRequest;
|
|
28
28
|
/** What every run was asked to do, unsandboxed or sandboxed. */
|
|
@@ -96,13 +96,10 @@ export interface RanRunner {
|
|
|
96
96
|
/** The runner snapshot it started from, and its base. */
|
|
97
97
|
readonly snapshotId: string;
|
|
98
98
|
readonly base: string;
|
|
99
|
-
/** For a dev snapshot it started from, the branch and HEAD commit of the run that saved it; null otherwise. */
|
|
100
|
-
readonly snapshotBranch: string | null;
|
|
101
|
-
readonly snapshotHead: string | null;
|
|
102
99
|
/** Whether this run built the runner snapshot. */
|
|
103
100
|
readonly built: boolean;
|
|
104
|
-
/**
|
|
105
|
-
readonly
|
|
101
|
+
/** How many commits HEAD has that the snapshot's base lacks. */
|
|
102
|
+
readonly builtBehind: number;
|
|
106
103
|
/** How many bytes of changes the run uploaded on top of the snapshot's base. */
|
|
107
104
|
readonly uploadBytes: number;
|
|
108
105
|
readonly vcpus: number;
|
|
@@ -110,10 +107,6 @@ export interface RanRunner {
|
|
|
110
107
|
readonly runtime: string;
|
|
111
108
|
/** How long the build step took, in milliseconds. */
|
|
112
109
|
readonly buildMs: number;
|
|
113
|
-
/** How saving the runner sandbox as a dev snapshot ended; null when the run started no save. */
|
|
114
|
-
readonly save: RunnerSave | null;
|
|
115
|
-
/** Why the run, whose command ended on its own, started no save; null when it started one. */
|
|
116
|
-
readonly noSave: RunnerNoSaveReason | null;
|
|
117
110
|
}
|
|
118
111
|
/**
|
|
119
112
|
* How a run ended.
|
|
@@ -197,8 +190,7 @@ export type RunStopped = ResourceRefusal | {
|
|
|
197
190
|
*
|
|
198
191
|
* Release happens however the run ended, a throw included: once the command has stopped and, in a sandboxed run, the
|
|
199
192
|
* runner session has closed its sandbox scope, each resource instance is released in reverse order, even when the
|
|
200
|
-
* `cleanup-started` event can't be reported.
|
|
201
|
-
*
|
|
202
|
-
* `finally`; a sandboxed run's runner session does, as it finishes or closes.
|
|
193
|
+
* `cleanup-started` event can't be reported. An unsandboxed run releases them in `finally`; a sandboxed run's runner
|
|
194
|
+
* session does, as it finishes or closes.
|
|
203
195
|
*/
|
|
204
196
|
export declare function executeRun(definitionSet: ResourceDefinitionSet, context: RunContext, resourceContexts: ResourceContextMap, request: RunRequest, control: RunControl, progress: RunProgress): Promise<RunOutcome>;
|
package/dist/core/run.js
CHANGED
|
@@ -28,9 +28,8 @@ import { acquireResources, announceAcquired, canceledStop, runInstances, release
|
|
|
28
28
|
*
|
|
29
29
|
* Release happens however the run ended, a throw included: once the command has stopped and, in a sandboxed run, the
|
|
30
30
|
* runner session has closed its sandbox scope, each resource instance is released in reverse order, even when the
|
|
31
|
-
* `cleanup-started` event can't be reported.
|
|
32
|
-
*
|
|
33
|
-
* `finally`; a sandboxed run's runner session does, as it finishes or closes.
|
|
31
|
+
* `cleanup-started` event can't be reported. An unsandboxed run releases them in `finally`; a sandboxed run's runner
|
|
32
|
+
* session does, as it finishes or closes.
|
|
34
33
|
*/
|
|
35
34
|
export async function executeRun(definitionSet, context, resourceContexts, request, control, progress) {
|
|
36
35
|
const instances = resourceInstances(definitionSet[LOOKUP], resourceContexts, request.resources);
|
|
@@ -57,20 +56,20 @@ export async function executeRun(definitionSet, context, resourceContexts, reque
|
|
|
57
56
|
// it ends.
|
|
58
57
|
let cleanupStarted = false;
|
|
59
58
|
// Said once, before the runner's sandboxes are stopped in a sandboxed run, else before the resources are released,
|
|
60
|
-
// with
|
|
61
|
-
|
|
62
|
-
const startCleanup = async (
|
|
59
|
+
// with how long cleanup keeps the runner sandbox running, if the run has one.
|
|
60
|
+
const keepMs = request.runner === undefined ? null : request.runner.keepMs;
|
|
61
|
+
const startCleanup = async () => {
|
|
63
62
|
if (cleanupStarted)
|
|
64
63
|
return;
|
|
65
64
|
cleanupStarted = true;
|
|
66
|
-
await progress.emit({ kind: "cleanup-started",
|
|
65
|
+
await progress.emit({ kind: "cleanup-started", keepMs, resources: releasedResources(instances) });
|
|
67
66
|
};
|
|
68
67
|
let resourceCleanup = {};
|
|
69
68
|
let releasing;
|
|
70
69
|
// Once: reporting cleanup's start can fail, and releasing what the acquires took must not depend on it.
|
|
71
|
-
const release = (
|
|
70
|
+
const release = () => (releasing ??= (async () => {
|
|
72
71
|
try {
|
|
73
|
-
await startCleanup(
|
|
72
|
+
await startCleanup();
|
|
74
73
|
}
|
|
75
74
|
finally {
|
|
76
75
|
resourceCleanup = await releaseResources(instances, progress);
|
|
@@ -86,7 +85,7 @@ export async function executeRun(definitionSet, context, resourceContexts, reque
|
|
|
86
85
|
}
|
|
87
86
|
finally {
|
|
88
87
|
// A no-op in a sandboxed run: its runner session released the resources once it closed its scope.
|
|
89
|
-
await release(
|
|
88
|
+
await release();
|
|
90
89
|
}
|
|
91
90
|
await progress.emit({
|
|
92
91
|
kind: "cleanup-finished",
|
|
@@ -180,23 +179,17 @@ function runnerStopped(outcome) {
|
|
|
180
179
|
/**
|
|
181
180
|
* In a sandboxed run, everything between the run's start and releasing its resources. It opens the run's runner session
|
|
182
181
|
* (`openRunnerSession`) before the mint, which owns the runner's sandbox scope and the order its stages run in, runs
|
|
183
|
-
* `runInSandbox` in it, and finishes the session, which closes the scope and releases the resources
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
182
|
+
* `runInSandbox` in it, and finishes the session, which closes the scope and releases the resources. A run that throws
|
|
183
|
+
* closes the session in `finally`, which closes the scope, then releases the resources. A sandboxed run always mints,
|
|
184
|
+
* whatever its resources are, so its request names no credential source: the command layer refuses
|
|
185
|
+
* `--credential github-actions` with it.
|
|
187
186
|
*/
|
|
188
187
|
async function runSandboxed(context, request, instances, control, progress, cleanup) {
|
|
189
188
|
const runnerProgress = { emit: (event) => progress.emit({ kind: "runner", event }) };
|
|
190
189
|
const session = openRunnerSession(context, request.runner, { signal: control.signal, cleanup }, runnerProgress);
|
|
191
190
|
try {
|
|
192
191
|
const ended = await runInSandbox(context, request, instances, session, control, progress);
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
ended: ended.kind === "command-ended"
|
|
196
|
-
? { ...ended, runner: { ...ended.runner, save: finished.save, noSave: finished.noSave } }
|
|
197
|
-
: ended,
|
|
198
|
-
runnerCleanup: finished.cleanup,
|
|
199
|
-
};
|
|
192
|
+
return { ended, runnerCleanup: await session.finish() };
|
|
200
193
|
}
|
|
201
194
|
finally {
|
|
202
195
|
// Memoized: a no-op once the session finished, and the cleanup when the run threw.
|
|
@@ -279,19 +272,15 @@ async function runInSandbox(context, request, instances, session, control, progr
|
|
|
279
272
|
resources: resourcesRan(instances),
|
|
280
273
|
command,
|
|
281
274
|
runner: {
|
|
282
|
-
snapshotId: ready.
|
|
283
|
-
base: ready.
|
|
284
|
-
snapshotBranch: ready.startedFrom.branch ?? null,
|
|
285
|
-
snapshotHead: ready.startedFrom.head ?? null,
|
|
275
|
+
snapshotId: ready.snapshotId,
|
|
276
|
+
base: ready.base,
|
|
286
277
|
built: ready.built,
|
|
287
|
-
|
|
278
|
+
builtBehind: ready.builtBehind,
|
|
288
279
|
uploadBytes: ready.uploadBytes,
|
|
289
280
|
vcpus: ready.vcpus,
|
|
290
281
|
region: ready.region,
|
|
291
282
|
runtime: ready.runtime,
|
|
292
283
|
buildMs: ready.buildMs,
|
|
293
|
-
save: null,
|
|
294
|
-
noSave: null,
|
|
295
284
|
},
|
|
296
285
|
};
|
|
297
286
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
configErrors,
|
|
25
25
|
credentialErrors,
|
|
26
26
|
credentialSourceErrors
|
|
27
|
-
} from "../../../../../chunks/chunk-
|
|
27
|
+
} from "../../../../../chunks/chunk-ZDJLKF2G.js";
|
|
28
28
|
import "../../../../../chunks/chunk-YT5OROR7.js";
|
|
29
29
|
import {
|
|
30
30
|
testserverCommands
|
|
@@ -4,5 +4,5 @@ export { RUNS_SUBPATH } from "./run-directory.ts";
|
|
|
4
4
|
export { recordRun, type RunRecorded, type RunRecording } from "./recording.ts";
|
|
5
5
|
export { type ListedRun, pastRuns } from "./reader.ts";
|
|
6
6
|
export { type PlanOption, planSchema, type TestPlanFacts } from "./plan.ts";
|
|
7
|
-
export {
|
|
7
|
+
export type { RunRecordGit, RunRecordWhere } from "./run-record.ts";
|
|
8
8
|
export { type TimelineFacts, type TimelineFactsRow, timelineSchema } from "./timeline-facts.ts";
|
|
@@ -9,5 +9,4 @@ export { RUNS_SUBPATH } from "./run-directory.js";
|
|
|
9
9
|
export { recordRun } from "./recording.js";
|
|
10
10
|
export { pastRuns } from "./reader.js";
|
|
11
11
|
export { planSchema } from "./plan.js";
|
|
12
|
-
export { noSaveReasonSchema, saveSchema } from "./run-record.js";
|
|
13
12
|
export { timelineSchema } from "./timeline-facts.js";
|
|
@@ -24,7 +24,7 @@ import { timelineFacts } from "./timeline-facts.js";
|
|
|
24
24
|
export async function recordRun(gateway, start) {
|
|
25
25
|
const { definitionSet } = start;
|
|
26
26
|
const record = start.redact({
|
|
27
|
-
version:
|
|
27
|
+
version: 5,
|
|
28
28
|
startedAt: start.startedAt.toISOString(),
|
|
29
29
|
cwd: start.cwd,
|
|
30
30
|
configFile: start.configFile,
|
|
@@ -72,7 +72,7 @@ export async function recordRun(gateway, start) {
|
|
|
72
72
|
directory?.writeTimeline(JSON.stringify(timeline, null, 2));
|
|
73
73
|
directory?.writeRun(runRecordText({
|
|
74
74
|
...record,
|
|
75
|
-
where: endedWhere(record.where, state.runner
|
|
75
|
+
where: endedWhere(record.where, state.runner),
|
|
76
76
|
ended: runEnd(outcome, state.command, tests, definitionSet.reports),
|
|
77
77
|
}));
|
|
78
78
|
const writeFailure = await directory?.close();
|