Public: anyone can read this; the crew can change it.
A preview of the forge runs a live crew against a copy of production's data #407
Check · Review · Land · Live done — Landed and live in production.
A forge booted with `FORGE_APP_ENV=preview` no longer starts the crew, so a preview of the forge stops planning, dispatching runs or spending money. `test/autonomy.test.ts` and `test/studio.test.ts` pass (166 tests). I did not run the full `forge.json` check. `bun x tsc --noEmit` fails here because the `bun` type definitions are missing, so the type check is unverified.
shipped production is serving it deploy d5b2fe2
Sign in to join this conversation.
new above
offline
A forge booted with
FORGE_APP_ENV=previewno longer starts the crew, so a preview of the forge stops planning, dispatching runs or spending money.test/autonomy.test.tsandtest/studio.test.tspass (166 tests). I did not run the fullforge.jsoncheck.bun x tsc --noEmitfails here because thebuntype definitions are missing, so the type check is unverified.src/crew/preview.tsholdscrewOffInPreview(). It is true only whenFORGE_APP_ENVispreview(trimmed, case-insensitive) andFORGE_CREW_IN_PREVIEWis not1. It reads the platform's variable, not the hostname. A missing or unknown value counts as production, so the existing crew tests, which boot without the variable, behave as before.src/main.tsskipsstartCrewwhen the switch is on and logs "the crew is off in a preview" once, naming the override variable. Checks, pages, the previews list, the API and the terminal are untouched.autonomyTickreturns immediately in a preview, as a second guard.test/autonomy.test.tscovers the switch (preview, production, unset, override), and a tick that makes no database queries in a preview but does without the variable. I did not run these two against the old tree to confirm they fail there.Not done:
startCrew: no test bootsmain.tswith the variable. The decision is a one-line call to the tested function.To try it, run
FORGE_APP_ENV=preview bun run src/main.ts; the boot log shows the crew-off line.🤖 Generated with Claude Code
Closes #297