Public: anyone can read this; the crew can change it.

The spawned-forge front door runs unchanged on celld: wrangler.json, a pinned binary, and a test through it #493

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`infra/forge-cloudflare/worker.js` now runs unchanged on celld v0.6.1, driven by a new `wrangler.json`. A new test through celld passes (2 tests) when `esbuild` is on `PATH`. I couldn't run `bun run check` here: `bun x tsc --noEmit` stops with "Cannot find type definition file for 'bun'" because this clone has no `node_modules`. `test/forge-cloudflare.test.ts` still passes (3 tests), and I changed…

shipped production is serving it deploy f5d5671

opened this

infra/forge-cloudflare/worker.js now runs unchanged on celld v0.6.1, driven by a new wrangler.json. A new test through celld passes (2 tests) when esbuild is on PATH. I couldn't run bun run check here: bun x tsc --noEmit stops with "Cannot find type definition file for 'bun'" because this clone has no node_modules. test/forge-cloudflare.test.ts still passes (3 tests), and I changed neither it nor worker.js.

  • wrangler.json: declares worker.js, the FORGE Durable Object binding and BODY_URL, using only keys celld accepts, with no secret and no real hostname. BODY_URL is a loopback placeholder that a .dev.vars file overrides. The migration uses new_sqlite_classes, because celld rejects new_classes.
  • scripts/celld.ts:

- Fetch: celld() downloads the pinned v0.6.1 release for linux-x64, linux-arm64 or darwin-arm64 and checks the SHA-256 written in the script. It unpacks the binary into a cache under the temp dir and returns its path. - Errors: any other platform, a failed download or a digest mismatch throws a clear error. No user text is shelled.

  • test/forge-cloudflare-celld.test.ts:

- Setup: it starts a stub body and runs celld dev --clean on a free port, in a temp copy of the directory. - Assertions: a GET and a POST both reach the body with x-forwarded-proto: https. /healthz answers 503 {ok:false} once the stub stops. Both processes are killed in afterAll. - Skips: it skips, stating the reason, when esbuild is not on PATH or the binary can't be fetched. It is not in the forge.json gate.

  • README: a "Run it on celld" section gives the command and the pinned-upgrade rule: an upgrade is a deliberate pull. It also gives the measurements. On a 4-vCPU x86_64 VM, from spawning celld dev --clean to the first answer took about 2.0 s, and the next request about 150 ms. p50 over 100 requests was about 29 ms, and p99 about 126 ms.

Left out:

  • celld did not accept bun x esbuild, so the test needs a real esbuild on PATH and skips otherwise.
  • I didn't add the test to the gate, as the issue asked.
  • I checked only linux-x64 here. The other two digests come from the release's published asset digests.

To try it: put esbuild on PATH, then run bun test test/forge-cloudflare-celld.test.ts.

🤖 Generated with Claude Code

Closes #490

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs