Showrunner
Showrunner is the control surface for demo processing.
Environment isolation
Section titled “Environment isolation”Production Showrunner is the Vercel production deployment from demo-pipeline master and uses the production Cloud Run workers:
demo-downloaderanalyst
The dev branch uses a Vercel preview deployment with staging resources:
- Cloud Run:
demo-downloader-dev,analyst-dev - R2 bucket:
flashback-demo-json-files-dev - Supabase: dev/staging project credentials
NEXT_PUBLIC_APP_ENV=staging
Showrunner contains server-side runtime safety guards in showrunner/lib/runtime-safety.ts:
- non-production deployments refuse to call production worker URLs
- production deployments refuse to call
*-devworker URLs - non-production deployments refuse
R2_BUCKET=flashback-demo-json-files - production deployments refuse
R2_BUCKET=flashback-demo-json-files-dev - optional exact Supabase URL guardrails can be enabled with
PRODUCTION_SUPABASE_URLandSTAGING_SUPABASE_URL - staging cron is disabled unless
ENABLE_STAGING_CRON=true
A visible STAGING badge is rendered in Showrunner previews so operators can tell they are not in production.
Vercel env targeting
Section titled “Vercel env targeting”The showrunner Vercel project is connected to grindhub/demo-pipeline with production branch master.
Current staging values are branch-scoped to the dev preview branch. Generic PR previews remain fail-closed unless they receive staging-safe env values.
Important env vars for staging previews:
NEXT_PUBLIC_APP_ENV=stagingNEXT_PUBLIC_SUPABASE_URL/NEXT_PUBLIC_SUPABASE_ANON_KEYfor dev SupabaseSUPABASE_SERVICE_ROLE_KEYfor dev SupabaseDATABASE_URLfor dev SupabaseR2_BUCKET=flashback-demo-json-files-devR2_ENDPOINT_URL,R2_ACCESS_KEY_ID,R2_SECRET_ACCESS_KEYfor staging R2 credentialsDEMO_DOWNLOADER_URL=https://demo-downloader-dev-mgrcncsvrq-ew.a.run.appANALYST_URL=https://analyst-dev-mgrcncsvrq-ew.a.run.app- staging-only
WEBHOOK_SECRET,SHOWRUNNER_API_SECRET, andCRON_SECRET
Cloud Run staging services
Section titled “Cloud Run staging services”The staging services are in GCP project povlib, region europe-west1:
demo-downloader-dev— lower max instances than productionanalyst-dev— lower max instances than production
They use GCP Secret Manager *_DEV secrets and APP_ENV=staging. Public invocation is enabled to match production, but mutation endpoints must be protected by the staging webhook secret.
Operating guidance
Section titled “Operating guidance”- Do not use a UI environment switch as the primary isolation boundary.
- Do not assign production Supabase/R2/worker credentials to preview deployments.
- Keep Vercel cron production-only by default.
- If a preview deployment shows a runtime-safety error, fix the env targeting instead of bypassing the guard.