From 69a2d7a458ef46acf94d66c84cbc5c0fa0e93831 Mon Sep 17 00:00:00 2001 From: Brad Harris Date: Fri, 26 Jun 2026 14:52:28 -0600 Subject: [PATCH] Fix expected_runtime_artifact check for binary-only installs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check required apps/web/dist/index.html on the host filesystem, but binary installs embed web assets into the Bun binary at build time — that path never exists. Now only validates the platform Bun binary in dist/bun/. Co-Authored-By: Claude Opus 4.6 --- apps/server/src/release-checks.ts | 14 ++++---------- apps/server/test/release-checks.test.ts | 20 +++----------------- docs/10-operations-runbook.md | 2 +- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/apps/server/src/release-checks.ts b/apps/server/src/release-checks.ts index d495f7e3..7b645d78 100644 --- a/apps/server/src/release-checks.ts +++ b/apps/server/src/release-checks.ts @@ -57,19 +57,13 @@ async function runCheck( } async function checkRuntimeArtifact(ctx: CheckContext): Promise { - const webDist = path.join(ctx.serverDir, "apps/web/dist/index.html"); const platformBinary = selectPlatformBinary(ctx.serverDir); - const missing = [ - ...(existsSync(webDist) ? [] : [webDist]), - ...(platformBinary.ok ? [] : [platformBinary.message]), - ]; return { name: "expected_runtime_artifact", - ok: missing.length === 0, - message: - missing.length === 0 - ? `Runtime assets present: ${webDist}, ${platformBinary.message}` - : `Missing: ${missing.join(", ")}`, + ok: platformBinary.ok, + message: platformBinary.ok + ? `Platform binary present: ${platformBinary.message}` + : platformBinary.message, }; } diff --git a/apps/server/test/release-checks.test.ts b/apps/server/test/release-checks.test.ts index 08bd6dfd..4c61e1e0 100644 --- a/apps/server/test/release-checks.test.ts +++ b/apps/server/test/release-checks.test.ts @@ -46,19 +46,13 @@ function setReleaseRecord(record: StoreRecord) { } describe("expected_runtime_artifact", () => { - it("passes when the web build and host Bun binary exist", async () => { + it("passes when the host Bun binary exists", async () => { const bunDist = path.join(tmpServerDir, "dist/bun"); - const webDist = path.join(tmpServerDir, "apps/web/dist"); await mkdir(bunDist, { recursive: true }); - await mkdir(webDist, { recursive: true }); await writeFile( path.join(bunDist, `dispatch-0.19.0-bun-${hostPlatform()}-${hostArch()}`), "binary" ); - await writeFile( - path.join(webDist, "index.html"), - "" - ); const [result] = await runRequiredChecks(["expected_runtime_artifact"], { serverDir: tmpServerDir, @@ -66,24 +60,16 @@ describe("expected_runtime_artifact", () => { }); expect(result.ok).toBe(true); - expect(result.message).toMatch(/Runtime assets present/); + expect(result.message).toMatch(/Platform binary present/); }); - it("fails when an artifact is missing", async () => { - const bunDist = path.join(tmpServerDir, "dist/bun"); - await mkdir(bunDist, { recursive: true }); - await writeFile( - path.join(bunDist, `dispatch-0.19.0-bun-${hostPlatform()}-${hostArch()}`), - "binary" - ); - + it("fails when no platform binary exists", async () => { const [result] = await runRequiredChecks(["expected_runtime_artifact"], { serverDir: tmpServerDir, targetTag: "v0.19.0", }); expect(result.ok).toBe(false); - expect(result.message).toMatch(/Missing:.*apps\/web\/dist\/index\.html/); }); }); diff --git a/docs/10-operations-runbook.md b/docs/10-operations-runbook.md index 744adb07..e4e5cf3a 100644 --- a/docs/10-operations-runbook.md +++ b/docs/10-operations-runbook.md @@ -175,7 +175,7 @@ inspect → prepare → apply → restarting → validate → done When the agent moves to `validate`, the server runs `runAndRecordChecks`, which evaluates the required checks listed in the manifests/metadata. The known check names (defined in `apps/server/src/release-metadata.ts`): -- `expected_runtime_artifact` — the platform-matching `dist/bun/dispatch-*` binary and `apps/web/dist/index.html` both exist after deploy +- `expected_runtime_artifact` — the platform-matching `dist/bun/dispatch-*` binary exists after deploy - `service_entrypoint` — `apps/server/package.json` has a `scripts.start` entry - `service_restarted` — `~/.dispatch/release.json` is present (lenient proxy for restart; the deeper check is `health_endpoint`) - `version_converged` — `~/.dispatch/release.json` tag matches the target tag