Skip to content

docs(agents): three deploy gaps observed during M10/M11 ramp#16

Closed
ByteStreams-AI wants to merge 1 commit intomainfrom
docs/deploy-gaps
Closed

docs(agents): three deploy gaps observed during M10/M11 ramp#16
ByteStreams-AI wants to merge 1 commit intomainfrom
docs/deploy-gaps

Conversation

@ByteStreams-AI
Copy link
Copy Markdown
Owner

@ByteStreams-AI ByteStreams-AI commented May 4, 2026

Summary

Closes the loop on the operational incident from this afternoon: bringing M10's Knowledge Base online in cloud surfaced three distinct CLI-vs-CI deployment behaviors that silently break production. Each one has a one-line manual workaround today; M12/M13 should consolidate the fix.

Expands AGENTS.md "Open follow-up #5" from a single bullet (just the db push gap) to a structured entry covering all three:

  • 5a. db push not in deploy workflow → M10's migration 0012 never landed in cloud after PR PR - M10 — Knowledge Base (RAG) #14 merged
  • 5b. supabase functions deploy <name> defaults to verify_jwt=true → broke Vapi after the OpenAI-key-rotation re-deploy
  • 5c. pnpm deploy:admin falls back to Vite dev defaults when VITE_SUPABASE_URL / VITE_SUPABASE_ANON_KEY aren't exported → bundle pointed at http://127.0.0.1:54321, unreachable from real browsers

Each entry lists the symptom, root cause, and today's manual fix.

Why this matters now

M11's E2E testing (the next milestone) will hit this surface repeatedly — every test session needs cloud functions / migrations / app builds to stay in sync. The CI workflow is the only path that's correct today, but it's only triggered automatically on merge. Manual deploys from a maintainer's shell are the most likely operational pattern during M11 voice-testing rehearsals, and each pattern has a foot-gun.

Recommended fixes (M12 or M13)

A single workflow refactor addresses all three:

  1. New migrate.yml workflow, gated on a migrate-on-merge PR label or a workflow_dispatch with confirm_migrations: yes. Don't auto-push migrations on every commit — destructive migrations need a human gate.
  2. Either: a pnpm cloud:deploy wrapper that fails loudly when required env vars / flags are missing, or remove pnpm deploy:* from the package scripts entirely and force operators through CI.

Test plan

  • Reviewer reads the three entries and confirms each accurately describes a real footgun.
  • No code changes — pure docs.

🤖 Generated with Claude Code

Greptile Summary

Pure documentation update expanding "Open follow-up #5" in AGENTS.md into three structured sub-entries (5a: missing db push in CI, 5b: missing --no-verify-jwt on manual deploys, 5c: Vite env-var fallback to localhost). Each entry accurately describes a real production foot-gun observed during M10/M11 ramp-up, includes a manual workaround, and defers the proper fix to M12/M13. No code changes.

Confidence Score: 4/5

Safe to merge — docs only, no code changes, two minor P2 style nits.

All findings are P2 style issues (stale section header date, inconsistent placeholder vs. real URL). No logic or security concerns in a pure documentation PR.

AGENTS.md — minor date and placeholder inconsistencies noted above.

Important Files Changed

Filename Overview
AGENTS.md Documentation-only change expanding follow-up #5 from a single bullet to three structured sub-entries (5a db push, 5b jwt flag, 5c Vite env vars); two minor style issues (section header date, hardcoded project URL).

Comments Outside Diff (1)

  1. AGENTS.md, line 116 (link)

    P2 Section header date is stale after this PR

    The section heading reads ## Open follow-ups (May 3, 2026) but item 5 explicitly documents events from May 4, 2026 and is the most recent entry. Readers scanning the header for "last updated" context will get a date that's one day off.

Reviews (1): Last reviewed commit: "docs(agents): expand follow-up #5 with t..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

… ramp

Three CLI-vs-CI deployment behaviors silently break production. All
three observed in a single afternoon while bringing M10's Knowledge
Base into cloud (May 4, 2026):

5a. `db push` not part of deploy.yml — M10's migration 0012 didn't
    land in cloud after PR #14 merged. Discovered when
    knowledge_reindex returned 500 (OpenAI embed succeeded; the
    knowledge_replace_chunks RPC didn't exist). Already documented;
    keeping the entry intact.

5b. `supabase functions deploy <name>` defaults to verify_jwt=true.
    CI passes --no-verify-jwt; local CLI does not. Re-deploying any
    Vapi-reachable function from a local shell with default flags
    breaks Vapi (no apikey or Authorization header on
    assistant-request POST → Kong rejects). Discovered when an
    OpenAI key rotation re-deploy broke vapi_call_start.

5c. `pnpm deploy:admin` (and `:kitchen`) silently fall back to
    Vite dev defaults when VITE_SUPABASE_URL / VITE_SUPABASE_ANON_KEY
    aren't in the shell. Build succeeds, deploy succeeds, the
    bundle points at http://127.0.0.1:54321 → unreachable from real
    browsers. Discovered after deploying admin from a shell that
    didn't have the cloud env vars exported.

The CI workflow is the only deploy path that's correct today —
operators running pnpm deploy:* / supabase CLI commands against
cloud need to remember to set the right flags + env vars every
time. M12/M13 should fix this with either:
- A `migrate.yml` workflow gated on a label or workflow_dispatch
  confirmation flag (don't auto-push migrations on every commit;
  destructive migrations need a human gate)
- A `pnpm cloud:deploy` wrapper that fails loudly when required env
  vars are missing, OR remove `pnpm deploy:*` entirely and force
  operators through CI

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread AGENTS.md
**5c. `pnpm deploy:admin` (and `:kitchen`) silently fall back to Vite dev defaults when `VITE_SUPABASE_URL` and `VITE_SUPABASE_ANON_KEY` aren't in the shell.** Vite embeds those values into the browser bundle at build time. CI injects them from GitHub Actions secrets pointing at cloud; a local `pnpm deploy:admin` without them produces a bundle pointing at `http://127.0.0.1:54321` (Vite dev fallback). The build succeeds, deploy succeeds, the deployed app is unreachable from real browsers. **Today's manual fix:** prepend the cloud env vars when running locally:

```bash
VITE_SUPABASE_URL=https://klzznfagrtormretqsgb.supabase.co \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Hardcoded production project URL

The actual Supabase project URL https://klzznfagrtormretqsgb.supabase.co is embedded in the docs while the anon key is wisely left as '<cloud anon key>'. Although VITE_SUPABASE_URL ends up in the browser bundle and is not a secret, using a concrete value here while sibling fields use placeholders is inconsistent and means any future project ref rotation requires a docs update. Consider replacing with https://<project-ref>.supabase.co to match the placeholder style used for the key.

Suggested change
VITE_SUPABASE_URL=https://klzznfagrtormretqsgb.supabase.co \
VITE_SUPABASE_URL=https://<project-ref>.supabase.co \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant