Goal
Stand up a complete staging environment that mirrors production infra (Supabase, Vapi, Telnyx, Stripe, Cloudflare Workers) so all changes hit staging before customer-facing prod. Pairs with #31 (prod branch as deploy gate).
Motivation
The May 4–5 2026 voice-path incident chain (PRs #28→#30) shipped speculative changes straight to the only cloud project we have. With staging, those changes break the test environment and never reach a real restaurant. This is the single highest-ROI mitigation against future regressions.
Topology after this lands
| Branch |
Cloud target |
Domain |
Used for |
| feature branches (`feat/`, `fix/`, `chore/*`) |
none |
none |
local dev |
| `main` |
staging cloud |
`admin-staging.dialtone.menu` etc. |
live testing against real Vapi/Stripe/Telnyx in test mode |
| `prod` |
production cloud (current `klzznfagrtormretqsgb`) |
`admin.dialtone.menu` etc. |
real customer traffic |
Sub-tasks (each can be its own commit; one PR for whole thing or split as makes sense)
A. Staging Supabase project
B. Telnyx staging number
C. Vapi staging assistant + phone number
D. Stripe webhook (test mode) for staging
E. Cloudflare Workers staging targets
F. GitHub Actions secrets
G. Restructure `.github/workflows/deploy.yml`
Two design options — pick one:
Option 1 — single deploy.yml, branch-aware:
on:
push:
branches: [main, prod]
jobs:
deploy:
runs-on: ubuntu-latest
env:
ENV: \${{ github.ref == 'refs/heads/prod' && 'prod' || 'staging' }}
steps:
- …read STAGING_* or PROD_* secrets based on \$ENV
- wrangler deploy --env \$ENV
- supabase functions deploy --project-ref \$PROJECT_REF
Option 2 — two workflow files: `deploy-staging.yml` (on main) + `deploy-prod.yml` (on prod). Cleaner separation, more duplication. I'd lean Option 1.
H. Migration deploy workflow (folds in open follow-up #5)
I. Environment-aware app config
J. Documentation
Cost summary
- Supabase staging project: free tier sufficient for dev volume; $25/mo if Pro tier needed for advanced features
- Telnyx staging number: ~$1/mo + per-message SMS costs
- Stripe test mode: free
- Vapi: same per-call rate, just routed to staging — call volume during testing is low
- Cloudflare Workers: free tier covers both envs
- Total ongoing: ~$1/mo + Vapi minutes during testing
Risks + things to think through
- Stripe test mode customers — staging restaurants need test payment methods (card 4242…). Document this.
- Telnyx 10DLC registration — staging messaging profile might need its own brand/campaign registration if testing real SMS deliverability. For dev, mock mode is fine (`TELNYX_MOCK_MODE` not set).
- Vapi assistant cross-pollination — make sure the staging Vapi phone number's serverUrl doesn't accidentally point at prod (and vice-versa). Easy to mis-set during a copy-paste.
- Greptile/CodeRabbit cost — extra reviews on staging PRs. Should be fine on PR-only basis.
- Schema drift — staging and prod can drift if a migration isn't pushed to both. The migrate.yml in sub-task H prevents this.
- Seed data parity — staging starts with seed.sql; prod starts with whatever real data accumulated. Don't test seed-resets in prod.
Suggested branch + commit chain
This is large enough that it could be split into 2-3 PRs:
```
git checkout -b chore/staging-supabase
Sub-tasks A + D (Supabase + Stripe webhook config — mostly external, doc the URLs)
git commit -am "chore: provision staging Supabase project + Stripe webhook"
git checkout -b chore/staging-vapi-telnyx
Sub-tasks B + C (Telnyx + Vapi staging numbers/config — external)
git commit -am "chore: provision staging Telnyx number + Vapi assistant"
git checkout -b chore/staging-deploy-workflow
Sub-tasks E + F + G + H (wrangler, GH Actions, deploy.yml, migrate.yml)
git commit -am "chore: split deploy workflow for staging vs prod with migration gate"
git checkout -b chore/staging-app-banner-and-docs
Sub-tasks I + J (banner + docs)
git commit -am "chore: env-aware staging banner + AGENTS.md release flow"
```
When this is done
- Push to `main` deploys to staging cloud only.
- Place a test call against the staging Telnyx number, verify happy path.
- Open `main → prod` PR, merge → deploys to prod cloud.
- Verified happy path on real Sui's number (`+16296001047`).
Related
Goal
Stand up a complete staging environment that mirrors production infra (Supabase, Vapi, Telnyx, Stripe, Cloudflare Workers) so all changes hit staging before customer-facing prod. Pairs with #31 (prod branch as deploy gate).
Motivation
The May 4–5 2026 voice-path incident chain (PRs #28→#30) shipped speculative changes straight to the only cloud project we have. With staging, those changes break the test environment and never reach a real restaurant. This is the single highest-ROI mitigation against future regressions.
Topology after this lands
Sub-tasks (each can be its own commit; one PR for whole thing or split as makes sense)
A. Staging Supabase project
B. Telnyx staging number
C. Vapi staging assistant + phone number
D. Stripe webhook (test mode) for staging
E. Cloudflare Workers staging targets
F. GitHub Actions secrets
G. Restructure `.github/workflows/deploy.yml`
Two design options — pick one:
Option 1 — single deploy.yml, branch-aware:
Option 2 — two workflow files: `deploy-staging.yml` (on main) + `deploy-prod.yml` (on prod). Cleaner separation, more duplication. I'd lean Option 1.
H. Migration deploy workflow (folds in open follow-up #5)
I. Environment-aware app config
J. Documentation
Cost summary
Risks + things to think through
Suggested branch + commit chain
This is large enough that it could be split into 2-3 PRs:
```
git checkout -b chore/staging-supabase
Sub-tasks A + D (Supabase + Stripe webhook config — mostly external, doc the URLs)
git commit -am "chore: provision staging Supabase project + Stripe webhook"
git checkout -b chore/staging-vapi-telnyx
Sub-tasks B + C (Telnyx + Vapi staging numbers/config — external)
git commit -am "chore: provision staging Telnyx number + Vapi assistant"
git checkout -b chore/staging-deploy-workflow
Sub-tasks E + F + G + H (wrangler, GH Actions, deploy.yml, migrate.yml)
git commit -am "chore: split deploy workflow for staging vs prod with migration gate"
git checkout -b chore/staging-app-banner-and-docs
Sub-tasks I + J (banner + docs)
git commit -am "chore: env-aware staging banner + AGENTS.md release flow"
```
When this is done
Related