diff --git a/src/mount-script.test.ts b/src/mount-script.test.ts index 3ba0385..a32a90a 100644 --- a/src/mount-script.test.ts +++ b/src/mount-script.test.ts @@ -7,6 +7,7 @@ import { mkdtempSync, readFileSync, rmSync, + statSync, writeFileSync, } from "node:fs"; import { tmpdir } from "node:os"; @@ -17,8 +18,17 @@ import { buildRelayfileMountStartShell, buildRelayfileMountFlushShell, buildRelayfileMountInitialSyncShell, + buildRelayfileMountInitialSyncBackgroundShell, + buildRelayfileMountInitialSyncStatusShell, buildRelayfileMountPathArgsShell, buildRelayfileMountShellTemplate, + parseRelayfileMountInitialSyncStatus, + type RelayfileMountInitialSyncStatus, + RELAYFILE_INITIAL_SYNC_EXIT_PATH, + RELAYFILE_INITIAL_SYNC_LOG_PATH, + RELAYFILE_INITIAL_SYNC_PID_PATH, + RELAYFILE_INITIAL_SYNC_REAPED_PATH, + RELAYFILE_INITIAL_SYNC_SCRIPT_PATH, } from "./mount-script.js"; const TOKEN = "relay_pa_thisisasecrettoken_do_not_leak"; @@ -712,3 +722,615 @@ describe("initial-sync idle watchdog progress files", () => { ); }); }); + +/** + * Regression guard for AgentWorkforce/sandbox#30. + * + * The detached initial-sync launcher generates a shell script under /tmp and + * hands it to a background process. Two things went wrong at once: + * + * - `cat >