Environments
What exists in staging, what exists in production, and which resources are shared between them.
Two environments, one wrangler.jsonc per Worker, switched with CLOUDFLARE_ENV=production.
| Resource | Staging | Production |
|---|---|---|
| App Worker | adstack-staging |
adstack |
| Domain | staging.tryadstack.com |
app.tryadstack.com |
| Database | Railway hopper.proxy.rlwy.net |
Railway crossover.proxy.rlwy.net |
| Hyperdrive | c5f83a9c... |
1f7b962e... |
| Pipeline Worker | adstack-pipeline |
adstack-pipeline-prod |
| Queues | adstack-* |
adstack-prod-* |
| Agents Worker | adstack-agents (shared) |
adstack-agents (shared) |
| R2 bucket | adstack-media (shared) |
adstack-media (shared) |
| Media domain | media.tryadstack.com (shared) |
media.tryadstack.com (shared) |
Local development shares the staging database. There is no local database.
The agents Worker and the media bucket are shared across environments. Everything else is duplicated, because a Cloudflare queue allows only one consumer, so each environment needs its own full set.
Production is dormant
Production is deployed and healthy but not in use. All development happens on staging and releases move forward to production, never backward. Production gaps are launch-day checklist items, not blockers.
Known launch-day items:
Disable Hyperdrive query caching on production
wrangler hyperdrive update 1f7b962eed2c4100b3bb9dd1a434af19 --caching-disabledIt was created with defaults and has the same stale-read bug staging had.
Create production-owned API keys
No copying from staging. KIE_API_KEY goes on adstack-pipeline-prod; until then production generation is bring-your-own-key only.
Google, Polar, and email
Add the production origin and redirect URI in Google Console, point the Polar webhook at the production domain, and confirm the product ids baked into the build.
Align main
Merge staging into main on explicit order, which re-aligns the auto-migration workflow.
Re-verify against production
Run check:truth and smoke with the production DATABASE_URL, then click through.
Infrastructure snapshot
Never guess a Cloudflare resource name. .claude/project/infra.md is generated from the live account:
bun run infra:snapshot
Regenerate it after any infrastructure change. The API token in .claude/settings.local.json cannot manage Hyperdrive or Workers Builds; those need the machine’s wrangler OAuth session or the dashboard.