Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

CodexInstallation.test.ts

532 lines22.4 KB

1import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
2import * as NodeServices from "@effect/platform-node/NodeServices";
3import * as Layer from "effect/Layer";
4import * as ModelManifest from "./ModelManifest.ts";
5import { expect, it } from "@effect/vitest";
6import * as HostProcess from "@t3tools/shared/HostProcess";
7import * as Digest from "effect/crypto/Digest";
8import * as Deferred from "effect/Deferred";
9import * as Effect from "effect/Effect";
10import * as Hex from "effect/encoding/Hex";
11import * as FileSystem from "effect/FileSystem";
12import * as Option from "effect/Option";
13import * as PlatformError from "effect/PlatformError";
14import * as Exit from "effect/Exit";
15import * as Queue from "effect/Queue";
16import * as Scope from "effect/Scope";
17import * as Stream from "effect/Stream";
18import { HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/http";
19import * as TestClock from "effect/testing/TestClock";
20import { ChildProcess, ChildProcessSpawner } from "effect/process";
21import * as CodexInstallation from "./CodexInstallation.ts";
22​
23const archive = Buffer.from(
24 "H4sIAAAAAAAC/+3W0W6DIBQGYB/FcD0sKNSkD7J7aom6tmAQtzXL3n3QZM3qdWVt+n8XoCckJp78wLY3q8bu9Ge2HBbUUp7nYD4H8s9zrNdSsCxnWQLT6JULn8ye09K9h/u2/c0/jSM9xqGzo0+bf3Gdf15WQiD/Kdy61/CA+z8dlO9Wrv2387+c5Z9VZY38p7BY0+Gh8t/sVauLt9Ga9Pnnop7ln1e4/6fxRQ7qZCf/qt3YW0M2OX/JyfvljbCCy3XBSaiGH9VqH4tKuaZbC6qG4aDpTrmP3sQV2nh3Gmxvzqsud0vyjaABAAAAAAAAAAAAAAAk8gOq19rvACgAAA==",
25 "base64",
26);
27const asset = {
28 version: "0.156.1",
29 target: "aarch64-apple-darwin",
30 url: "https://github.com/openai/codex/releases/download/test/package.tar.gz",
31 archiveBytes: archive.length,
32};
33const makeHarness = Effect.fn("test.makeCodexInstallation")(function* (
34 input: {
35 options?: Partial<CodexInstallation.CodexInstallationOptions>;
36 manifestCurrent?: Effect.Effect<ModelManifest.ModelManifestData>;
37 body?: Stream.Stream<Uint8Array, HttpClientError.HttpClientError>;
38 downloadStatus?: number;
39 baseDir?: string;
40 local?: { version: string; appServerFails?: boolean; versionFails?: boolean };
41 platform?: NodeJS.Platform;
42 spawner?: ChildProcessSpawner.ChildProcessSpawner["Service"];
43 runtimeRenameFailures?: number;
44 } = {},
45) {
46 const fs = yield* FileSystem.FileSystem;
47 const baseDir =
48 input.baseDir ?? (yield* fs.makeTempDirectoryScoped({ prefix: "t3-codex-install-test-" }));
49 const localDirectory = `${baseDir}/local`;
50 const localBinaryPath = `${localDirectory}/codex${input.platform === "win32" ? ".exe" : ""}`;
51 const probeLog = `${baseDir}/local-probes.txt`;
52 if (input.local) {
53 yield* fs.makeDirectory(localDirectory, { recursive: true });
54 yield* fs.writeFileString(
55 localBinaryPath,
56 `#!/bin/sh\nprintf '%s\\n' "$*" >> '${probeLog}'\ncase "$1" in\n--version) ${input.local.versionFails ? "exit 1" : `printf '%s\\n' 'codex-cli ${input.local.version}'`};;\napp-server) exit ${input.local.appServerFails ? "1" : "0"};;\nesac\n`,
57 { mode: 0o755 },
58 );
59 }
60 let downloads = 0;
61 const digest = yield* Digest.Digest;
62 const sha256 = Hex.encode(yield* digest.digest(Digest.sha256, archive).pipe(Effect.orDie));
63 let runtimeRenameFailures = input.runtimeRenameFailures ?? 0;
64 const failedRenames = yield* Queue.unbounded<void>();
65 const lockingFs: FileSystem.FileSystem = {
66 ...fs,
67 // Suspended so each retry of the same effect is a fresh attempt, like the real rename.
68 rename: (from, to) =>
69 Effect.suspend(() =>
70 /[/\\]runtime$/u.test(from) && runtimeRenameFailures-- > 0
71 ? Queue.offer(failedRenames, undefined).pipe(
72 Effect.andThen(
73 Effect.fail(
74 PlatformError.systemError({
75 _tag: "PermissionDenied",
76 module: "FileSystem",
77 method: "rename",
78 pathOrDescriptor: from,
79 }),
80 ),
81 ),
82 )
83 : fs.rename(from, to),
84 ),
85 };
86 const spawner = input.spawner ?? (yield* ChildProcessSpawner.ChildProcessSpawner);
87 const installation = yield* CodexInstallation.makeCodexInstallation({
88 baseDir,
89 releaseAsset: { ...asset, sha256 },
90 validate: () => Effect.void,
91 ...input.options,
92 }).pipe(
93 Effect.provideService(ModelManifest.ModelManifest, {
94 current: input.manifestCurrent ?? Effect.succeed(ModelManifest.BUNDLED_MODEL_MANIFEST),
95 refresh: Effect.succeed(ModelManifest.BUNDLED_MODEL_MANIFEST),
96 forceRefresh: Effect.succeed(ModelManifest.BUNDLED_MODEL_MANIFEST),
97 refreshOnDemand: Effect.succeed(ModelManifest.BUNDLED_MODEL_MANIFEST),
98 refreshInBackground: Effect.void,
99 }),
100 Effect.provideService(HostProcess.Platform, input.platform ?? "darwin"),
101 Effect.provideService(HostProcess.Architecture, "arm64"),
102 Effect.provideService(HostProcess.Environment, {
103 PATH: input.local ? localDirectory : "",
104 SystemRoot: "C:\\Windows",
105 }),
106 Effect.provideService(FileSystem.FileSystem, lockingFs),
107 Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
108 Effect.provideService(
109 HttpClient.HttpClient,
110 HttpClient.make((request) =>
111 Effect.sync(() => {
112 downloads++;
113 return Object.defineProperty(
114 HttpClientResponse.fromWeb(
115 request,
116 new Response(null, { status: input.downloadStatus ?? 200 }),
117 ),
118 "stream",
119 {
120 value: input.body ?? Stream.succeed(archive),
121 },
122 );
123 }),
124 ),
125 ),
126 );
127 return {
128 installation,
129 fs,
130 baseDir,
131 localBinaryPath,
132 probeLog,
133 failedRenames,
134 downloads: () => downloads,
135 };
136});
137const terminalState = (installation: CodexInstallation.CodexInstallation["Service"]) =>
138 installation.changes.pipe(
139 Stream.filter((state) => ["succeeded", "failed", "cancelled"].includes(state.phase)),
140 Stream.runHead,
141 Effect.map(Option.getOrThrow),
142 );
143​
144it.effect.each(["0.156.0", "0.156.1", "0.156.2", "0.157.0"])(
145 "reuses installed Codex %s without downloading or taking ownership of it",
146 (version) =>
147 Effect.gen(function* () {
148 const h = yield* makeHarness({ local: { version } });
149 expect(yield* h.installation.start).toMatchObject({
150 source: "local",
151 phase: "succeeded",
152 installedVersion: version,
153 executablePath: h.localBinaryPath,
154 canRemove: false,
155 });
156 expect(yield* h.installation.resolve()).toMatchObject({
157 source: "local",
158 executablePath: h.localBinaryPath,
159 managedVersionDirectory: null,
160 version,
161 });
162 yield* h.installation.acquire().pipe(Effect.scoped);
163 expect(h.downloads()).toBe(0);
164 expect(yield* h.fs.exists(h.installation.managedDirectory)).toBe(false);
165 expect((yield* h.fs.readFileString(h.probeLog)).trim().split("\n")).toEqual([
166 "--version",
167 "app-server --help",
168 ]);
169 yield* h.installation.remove();
170 expect(yield* h.fs.exists(h.localBinaryPath)).toBe(true);
171 expect((yield* h.installation.state).source).toBe("local");
172 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
173);
174it.effect.each([
175 { version: "0.128.9" },
176 { version: "0.145.0" },
177 { version: "0.155.1" },
178 { version: "0.155.9" },
179 { version: "0.156.1-alpha.1" },
180 { version: "unknown" },
181 { version: "0.156.1", appServerFails: true },
182 { version: "0.156.1", versionFails: true },
183])("downloads the pinned release when the local CLI is unsupported or broken: %j", (local) =>
184 Effect.gen(function* () {
185 const h = yield* makeHarness({ local });
186 expect((yield* h.installation.state).installedVersion).toBeNull();
187 yield* h.installation.start;
188 const installed = yield* terminalState(h.installation);
189 expect(installed.phase).toBe("succeeded");
190 const executable = yield* h.installation.resolve();
191 expect(executable.source).toBe("managed");
192 expect(installed.executablePath).toBe(executable.executablePath);
193 expect(h.downloads()).toBe(1);
194 expect(yield* h.fs.exists(h.localBinaryPath)).toBe(true);
195 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
196);
197​
198const compileNative = Effect.fn("test.compileNative")(function* (
199 executablePath: string,
200 source: string,
201) {
202 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
203 const compiler = yield* spawner.spawn(
204 ChildProcess.make("cc", ["-x", "c", "-", "-o", executablePath], {
205 stdin: Stream.make(new TextEncoder().encode(source)),
206 stdout: "inherit",
207 stderr: "inherit",
208 }),
209 );
210 expect(yield* compiler.exitCode).toBe(0);
211}, Effect.scoped);
212​
213it.effect("rechecks compatibility after the local executable is replaced", () =>
214 Effect.gen(function* () {
215 const h = yield* makeHarness({ local: { version: "0.156.1" } });
216 expect((yield* h.installation.resolve()).source).toBe("local");
217 yield* h.fs.remove(h.localBinaryPath);
218 yield* h.fs.writeFileString(h.localBinaryPath, "#!/bin/sh\nprintf 'codex-cli 0.128.9\\n'\n", {
219 mode: 0o755,
220 });
221 yield* h.installation.start;
222 expect((yield* terminalState(h.installation)).phase).toBe("succeeded");
223 expect((yield* h.installation.resolve()).source).toBe("managed");
224 expect(h.downloads()).toBe(1);
225 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
226);
227​
228it.effect("rechecks a cached local executable when the shared manifest policy changes", () =>
229 Effect.gen(function* () {
230 let manifest = ModelManifest.BUNDLED_MODEL_MANIFEST;
231 const h = yield* makeHarness({
232 local: { version: "0.156.0" },
233 manifestCurrent: Effect.sync(() => manifest),
234 });
235 expect((yield* h.installation.resolve()).source).toBe("local");
236 manifest = {
237 ...manifest,
238 compatibility: [
239 {
240 driver: "codex",
241 t3CodeRange: ">=0.0.42",
242 ranges: [
243 { range: ">=0.156.1", status: "supported" },
244 { range: "<0.156.1", status: "broken" },
245 ],
246 },
247 ],
248 };
249 yield* h.installation.start;
250 expect((yield* terminalState(h.installation)).phase).toBe("succeeded");
251 expect((yield* h.installation.resolve()).source).toBe("managed");
252 expect(h.downloads()).toBe(1);
253 expect((yield* h.fs.readFileString(h.probeLog)).trim().split("\n")).toEqual([
254 "--version",
255 "app-server --help",
256 ]);
257 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
258);
259​
260it.effect("uses bundled Codex compatibility when the remote manifest omits its policy", () =>
261 Effect.gen(function* () {
262 const h = yield* makeHarness({
263 local: { version: "0.156.0" },
264 manifestCurrent: Effect.succeed({
265 ...ModelManifest.BUNDLED_MODEL_MANIFEST,
266 compatibility: [],
267 }),
268 });
269 expect((yield* h.installation.start).source).toBe("local");
270 expect(h.downloads()).toBe(0);
271 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
272);
273​
274it.effect.each([
275 { kind: "script", name: "volta-shim" },
276 { kind: "native", name: "volta-shim" },
277 { kind: "native", name: "mise" },
278 { kind: "native", name: "aqua-proxy" },
279])("preserves the invoked name of $kind $name launcher symlinks", ({ kind, name }) =>
280 Effect.gen(function* () {
281 const h = yield* makeHarness({ local: { version: "0.156.1" } });
282 const launcher = `${h.baseDir}/${name}`;
283 if (kind === "native") {
284 const payload = `${h.baseDir}/codex.js`;
285 yield* h.fs.rename(h.localBinaryPath, payload);
286 yield* compileNative(
287 launcher,
288 `#include <string.h>
289#include <unistd.h>
290int main(int argc, char **argv) {
291 const char *name = strrchr(argv[0], '/');
292 if (strcmp(name ? name + 1 : argv[0], "codex") != 0) return 1;
293 execv(${JSON.stringify(payload)}, argv);
294 return 1;
296`,
297 );
298 } else {
299 yield* h.fs.writeFileString(
300 launcher,
301 '#!/bin/sh\ncase "$0" in */codex) ;; *) exit 1;; esac\ncase "$1" in --version) printf "codex-cli 0.156.1\\n";; app-server) exit 0;; esac\n',
302 { mode: 0o755 },
303 );
304 yield* h.fs.remove(h.localBinaryPath);
305 }
306 yield* h.fs.symlink(launcher, h.localBinaryPath);
307 expect(yield* h.installation.start).toMatchObject({ source: "local", phase: "succeeded" });
308 expect((yield* h.installation.resolve()).executablePath).toBe(h.localBinaryPath);
309 expect(h.downloads()).toBe(0);
310 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
311);
312​
313it.effect(
314 "installs the complete verified package in tools/codex/version and survives a restart",
315 () =>
316 Effect.gen(function* () {
317 const { installation, fs, baseDir } = yield* makeHarness();
318 yield* installation.start;
319 expect((yield* terminalState(installation)).phase).toBe("succeeded");
320 const executable = yield* installation.resolve();
321 expect(executable.executablePath).toBe(`${baseDir}/tools/codex/0.156.1/bin/codex`);
322 expect(
323 yield* fs.readFileString(`${executable.managedVersionDirectory}/bin/codex-code-mode-host`),
324 ).toBe("host");
325 expect(yield* fs.readFileString(`${executable.managedVersionDirectory}/codex-path/rg`)).toBe(
326 "rg",
327 );
328 const restarted = yield* makeHarness({ baseDir });
329 expect((yield* restarted.installation.resolve()).version).toBe("0.156.1");
330 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
331);
332​
333it.effect("requires an update before running an older activated managed installation", () =>
334 Effect.gen(function* () {
335 const first = yield* makeHarness();
336 yield* first.installation.start;
337 yield* terminalState(first.installation);
338 const executable = yield* first.installation.resolve();
339 const oldDirectory = `${first.installation.managedDirectory}/0.155.1`;
340 yield* first.fs.rename(executable.managedVersionDirectory!, oldDirectory);
341 for (const name of ["codex-package.json", ".install-complete.json"]) {
342 const file = `${oldDirectory}/${name}`;
343 yield* first.fs.writeFileString(
344 file,
345 (yield* first.fs.readFileString(file)).replaceAll("0.156.1", "0.155.1"),
346 );
347 }
348 yield* first.fs.writeFileString(
349 `${first.installation.managedDirectory}/active.json`,
350 '{"version":"0.155.1"}',
351 );
352 const restarted = yield* makeHarness({ baseDir: first.baseDir });
353 expect((yield* Effect.flip(restarted.installation.resolve())).detail).toContain(
354 "outside the supported range",
355 );
356 yield* restarted.installation.start;
357 expect((yield* terminalState(restarted.installation)).phase).toBe("succeeded");
358 expect((yield* restarted.installation.resolve()).version).toBe("0.156.1");
359 expect(restarted.downloads()).toBe(1);
360 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
361);
362​
363it.effect("updates an older supported managed installation to the pinned release on startup", () =>
364 Effect.gen(function* () {
365 const first = yield* makeHarness();
366 yield* first.installation.start;
367 yield* terminalState(first.installation);
368 const executable = yield* first.installation.resolve();
369 const oldDirectory = `${first.installation.managedDirectory}/0.156.0`;
370 yield* first.fs.rename(executable.managedVersionDirectory!, oldDirectory);
371 for (const name of ["codex-package.json", ".install-complete.json"]) {
372 const file = `${oldDirectory}/${name}`;
373 yield* first.fs.writeFileString(
374 file,
375 (yield* first.fs.readFileString(file)).replaceAll("0.156.1", "0.156.0"),
376 );
377 }
378 yield* first.fs.writeFileString(
379 `${first.installation.managedDirectory}/active.json`,
380 '{"version":"0.156.0"}',
381 );
382 const restarted = yield* makeHarness({ baseDir: first.baseDir });
383 expect((yield* restarted.installation.state).operationId).not.toBeNull();
384 expect((yield* terminalState(restarted.installation)).phase).toBe("succeeded");
385 expect((yield* restarted.installation.resolve()).version).toBe("0.156.1");
386 expect(restarted.downloads()).toBe(1);
387 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
388);
389​
390it.effect("rejects corrupted downloads without publishing a runtime", () =>
391 Effect.gen(function* () {
392 const { installation, fs } = yield* makeHarness({
393 options: { releaseAsset: { ...asset, sha256: "0".repeat(64) } },
394 });
395 yield* installation.start;
396 const state = yield* terminalState(installation);
397 expect(state.phase).toBe("failed");
398 expect(state.message).toContain("SHA-256");
399 expect(yield* fs.exists(`${installation.managedDirectory}/active.json`)).toBe(false);
400 expect(yield* fs.exists(`${installation.managedDirectory}/0.156.1`)).toBe(false);
401 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
402);
403​
404it.effect.each(["interrupted body", "HTTP 404"] as const)(
405 "reports a download failure for %s without blaming disk access",
406 (failure) =>
407 Effect.gen(function* () {
408 const request = HttpClientRequest.get(asset.url);
409 const response = HttpClientResponse.fromWeb(request, new Response(null));
410 const h = yield* makeHarness(
411 failure === "HTTP 404"
412 ? { downloadStatus: 404 }
413 : {
414 body: Stream.concat(
415 Stream.succeed(archive.subarray(0, 10)),
416 Stream.fail(
417 new HttpClientError.HttpClientError({
418 reason: new HttpClientError.DecodeError({
419 request,
420 response,
421 cause: new TypeError("terminated"),
422 }),
423 }),
424 ),
425 ),
426 },
427 );
428 yield* h.installation.start;
429 expect(yield* terminalState(h.installation)).toMatchObject({
430 phase: "failed",
431 message:
432 failure === "HTTP 404"
433 ? "The Codex download server returned HTTP 404. Try again later."
434 : "The Codex download was interrupted. Check your internet connection, then retry installation.",
435 });
436 expect(h.downloads()).toBe(1);
437 expect(yield* h.fs.readDirectory(h.installation.managedDirectory)).toEqual([]);
438 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
439);
440​
441it.effect(
442 "preserves the filesystem failure message when installation cannot create its directory",
443 () =>
444 Effect.gen(function* () {
445 const fs = yield* FileSystem.FileSystem;
446 const directory = yield* fs.makeTempDirectoryScoped({ prefix: "t3-codex-install-test-" });
447 const baseDir = `${directory}/not-a-directory`;
448 yield* fs.writeFileString(baseDir, "existing file");
449 const h = yield* makeHarness({ baseDir });
450 yield* h.installation.start;
451 expect(yield* terminalState(h.installation)).toMatchObject({
452 phase: "failed",
453 message: "Could not install Codex. Check disk space and directory access, then try again.",
454 });
455 expect(h.downloads()).toBe(0);
456 expect(yield* fs.readFileString(baseDir)).toBe("existing file");
457 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
458);
459​
460it.effect("reports a download timeout and cleans the staging directory", () =>
461 Effect.gen(function* () {
462 const started = yield* Deferred.make<void>();
463 const stall = Deferred.succeed(started, undefined).pipe(Effect.andThen(Effect.never));
464 const h = yield* makeHarness({
465 body: Stream.concat(Stream.succeed(archive.subarray(0, 10)), Stream.fromEffect(stall)),
466 });
467 yield* h.installation.start;
468 yield* Deferred.await(started);
469 yield* TestClock.adjust("45 minutes");
470 expect(yield* terminalState(h.installation)).toMatchObject({
471 phase: "failed",
472 message: "The Codex download timed out. Retry installation.",
473 });
474 expect(h.downloads()).toBe(1);
475 expect(yield* h.fs.readDirectory(h.installation.managedDirectory)).toEqual([]);
476 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
477);
478​
479it.effect("cancels an in-flight download and cleans the staging directory", () =>
480 Effect.gen(function* () {
481 const downloading = yield* Deferred.make<void>();
482 const body = Stream.fromEffect(
483 Deferred.succeed(downloading, undefined).pipe(Effect.andThen(Effect.never)),
484 );
485 const { installation, fs } = yield* makeHarness({ body });
486 const started = yield* installation.start;
487 yield* Deferred.await(downloading);
488 expect((yield* installation.cancel(started.operationId!)).phase).toBe("cancelled");
489 expect(
490 (yield* fs.readDirectory(installation.managedDirectory)).filter((name) =>
491 name.startsWith(".install-"),
492 ),
493 ).toEqual([]);
494 expect(yield* fs.exists(`${installation.managedDirectory}/active.json`)).toBe(false);
495 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
496);
497​
498it.effect("protects active process leases and removes the runtime after release", () =>
499 Effect.gen(function* () {
500 const { installation, fs } = yield* makeHarness();
501 yield* installation.start;
502 yield* terminalState(installation);
503 const leaseScope = yield* Scope.make();
504 yield* installation.acquire().pipe(Effect.provideService(Scope.Scope, leaseScope));
505 expect((yield* Effect.flip(installation.remove())).detail).toContain("Stop Codex sessions");
506 yield* Scope.close(leaseScope, Exit.void);
507 yield* installation.remove();
508 expect(yield* fs.exists(installation.managedDirectory)).toBe(false);
509 expect((yield* installation.state).installedVersion).toBeNull();
510 expect((yield* installation.state).executablePath).toBeNull();
511 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
512);
513​
514it.effect("keeps an activated runtime when a later update fails verification", () =>
515 Effect.gen(function* () {
516 const first = yield* makeHarness();
517 yield* first.installation.start;
518 yield* terminalState(first.installation);
519 const update = yield* makeHarness({
520 baseDir: first.baseDir,
521 options: { releaseAsset: { ...asset, version: "0.156.2", sha256: "0".repeat(64) } },
522 });
523 expect((yield* update.installation.state).executablePath).toBe(
524 (yield* first.installation.resolve()).executablePath,
525 );
526 yield* update.installation.start;
527 expect((yield* terminalState(update.installation)).phase).toBe("failed");
528 expect((yield* update.installation.resolve()).version).toBe("0.156.1");
529 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
530);
531​
532// Stands in for Windows' bsdtar: CRLF listings, and extraction writes the Windows layout.