SHIP-GATE-REPORT.mdThis is a full sample from a buyer-style gate run — stable IDs, file:line evidence, GO/NO-GO. Not a synthetic demo table.
# Ship Gate Report
| Field | Value |
|-------|-------|
| App / path | vercel/nextjs-subscription-payments → `/workspace/asg-test/nextjs-subscription-payments` |
| Date (Asia/Shanghai) | 2026-10-31 18:36 Asia/Shanghai |
| Git SHA | `bdd0813206e47e6b218d42f15a7976c8a0d3c3eb` (shallow clone, depth 1; upstream tip 2025-01-23) |
| Runner | Cursor agent (buyer-style Agent Ship Gate v0.1) |
| Pack version | Agent Ship Gate v0.1 |
| Repo URL | https://github.com/vercel/nextjs-subscription-payments |
| Demo URL | https://subscription-payments.vercel.app/ |
## Overall verdict
```text
NO-GO · DON'T LAUNCH · see SHIP-GATE-REPORT.md
```
Blocking FAIL IDs (if any):
```text
AG-PAY-02, AG-PAY-04, AG-PAY-06, AG-PAY-07, AG-AUTH-05, AG-OPS-05
```
## Lane summary
| Lane | PASS | FAIL | WARN | N/A |
|------|-----:|-----:|-----:|----:|
| Security | 3 | 0 | 3 | 2 |
| Billing & Stripe | 2 | 4 | 1 | 0 |
| Auth | 2 | 1 | 3 | 1 |
| SEO & AEO | 2 | 0 | 5 | 0 |
| Launch ops | 1 | 1 | 3 | 1 |
## Blocking failures (detail)
### `AG-PAY-02`
- **Verdict:** FAIL
- **Evidence:** `components/ui/Pricing/Pricing.tsx:57-60` client calls `checkoutWithStripe(price, currentPath)` with the full `Price` object from the browser. `utils/stripe/server.ts:57-61` uses `price.id` from that argument in `line_items` with **no** server-side re-fetch/`from('prices').eq('id').eq('active', true)` validation. A modified client can submit an arbitrary Stripe price ID.
- **Fix:** Accept only `priceId: string` from the client; look up active price in DB (or Stripe) on the server before `checkout.sessions.create`.
- **Owner / ETA:** seller/demo maintainer · before any paid launch
### `AG-PAY-04`
- **Verdict:** FAIL
- **Evidence:** `app/api/webhooks/route.ts` verifies the signature then switches on `event.type` with no `event.id` store / dedupe table. `schema.sql` has no `stripe_events` (or equivalent) table. Subscription upserts by `subscription.id` reduce some double-writes but do not implement webhook idempotency by `event.id`.
- **Fix:** Persist processed `event.id` (unique constraint) and short-circuit duplicates before side effects.
- **Owner / ETA:** before paid launch
### `AG-PAY-06`
- **Verdict:** FAIL
- **Evidence:** `app/api/webhooks/route.ts:11-22` `relevantEvents` includes `customer.subscription.deleted` / updated (status sync via `manageSubscriptionStatusChange` in `utils/supabase/admin.ts:211-283`) but **not** `charge.refunded`, `charge.dispute.created`, or invoice payment-failed → revoke paths beyond subscription status sync. No app code maps refund/dispute → entitlement revoke.
- **Fix:** Handle refund/dispute (and unpaid) events; set subscription/entitlement inactive in DB.
- **Owner / ETA:** before paid launch
### `AG-PAY-07`
- **Verdict:** FAIL
- **Evidence:** No live/test Stripe keys in this clone; `$1` purchase → entitlement → refund → revoke drill **not performed**. Default pack policy for paid products = FAIL when drill missing.
- **Fix:** Run labeled staging or live minimal charge drill; attach Stripe Dashboard event IDs + DB rows as evidence.
- **Owner / ETA:** before announcing paid launch
### `AG-AUTH-05`
- **Verdict:** FAIL
- **Evidence:** `utils/auth-helpers/server.ts:225-265` `updatePassword` calls `supabase.auth.updateUser({ password })` only — no `signOut({ scope: 'others' | 'global' })`. No account-delete flow found in `app/` or `utils/auth-helpers/`. Cannot show that password change or account delete invalidates existing sessions.
- **Fix:** After password change, revoke other sessions; add delete-account path that signs out globally and purges user data.
- **Owner / ETA:** before public launch
### `AG-OPS-05`
- **Verdict:** FAIL
- **Evidence:** `components/ui/Footer/Footer.tsx:64-78` “Privacy Policy” and “Terms of Use” both `href="/"` (placeholders). No `/privacy` or `/refund` routes under `app/`. Product charges via Stripe Checkout → legal pages missing pre-pay ⇒ blocking.
- **Fix:** Ship real Privacy + Refund/Cancellation pages and link them near Checkout / Pricing.
- **Owner / ETA:** before charging money
## Warnings
### `AG-SEC-01`
- **Verdict:** WARN
- **Evidence:** Working tree: no `sk_live_` / `whsec_` live secrets (`rg` clean). `.env.local.example:4` contains well-known Supabase **demo** anon JWT (public fixture, not a production secret). Clone is `--depth 1` so full `git log -p` history not scanned.
- **Fix:** Re-scan full history before launch; keep `.env*.local` gitignored (already in `.gitignore:28-42`).
### `AG-SEC-06`
- **Verdict:** WARN
- **Evidence:** `npm`/`pnpm audit` not run (deps not installed in this gate run). `package.json` pins `next@14.2.3` (older than current Next 14/15 lines) — treat as unverified high/critical until audit.
- **Fix:** `pnpm install && pnpm audit`; patch high/critical runtime deps.
### `AG-SEC-08`
- **Verdict:** WARN
- **Evidence:** `app/api/webhooks/route.ts:34-36,82` and multiple `console.error`/`console.log` in `utils/stripe/server.ts` / `utils/supabase/admin.ts` log errors/objects without an explicit PII/secret scrubber.
- **Fix:** Redact tokens/PII in logs; avoid dumping full Stripe/Supabase error objects in production.
### `AG-PAY-01`
- **Verdict:** WARN
- **Evidence:** `utils/stripe/config.ts:3-4` prefers `STRIPE_SECRET_KEY_LIVE` then `STRIPE_SECRET_KEY`. Client uses `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY_LIVE` fallback (`utils/stripe/client.ts:7-10`). Production env mix cannot be verified from the repo alone.
- **Fix:** Confirm Vercel production has only live keys; preview uses test keys only.
### `AG-AUTH-01`
- **Verdict:** WARN
- **Evidence:** Callbacks built via `getURL()` (`utils/helpers.ts:5-27`); defaults to `http://localhost:3000/` if env unset. `.env.example:1` GitHub redirect is `http://127.0.0.1:54321/...`. Production correctness depends on `NEXT_PUBLIC_SITE_URL` — not proven for a custom domain beyond the Vercel demo host.
- **Fix:** Set production site URL + Supabase Auth redirect allowlist to the announced domain only.
### `AG-AUTH-04`
- **Verdict:** WARN
- **Evidence:** No app-level rate limit on `signInWithPassword` / `signUp` / `requestPasswordUpdate` (`utils/auth-helpers/server.ts`). Relies on Supabase Auth defaults; no Upstash/middleware limiter in repo.
- **Fix:** Add edge rate limits on auth Server Actions / routes.
### `AG-AUTH-06`
- **Verdict:** WARN
- **Evidence:** Session cookies set through `@supabase/ssr` helpers (`utils/supabase/server.ts`, `utils/supabase/middleware.ts`) without an explicit app-level `Secure`/`SameSite` policy document. Preferential trust of library defaults — not verified against a production Set-Cookie capture in this run.
- **Fix:** Confirm production Set-Cookie includes `Secure` and intentional `SameSite`; document refresh lifetime.
### `AG-SEO-02`
- **Verdict:** WARN
- **Evidence:** No `public/robots.txt` or `sitemap.xml`; no `app/robots.ts` / `app/sitemap.ts`.
- **Fix:** Add robots + sitemap matching public routes.
### `AG-SEO-03`
- **Verdict:** WARN
- **Evidence:** `app/layout.tsx:16-19` Open Graph title/description only — no `og:image` field. `app/opengraph-image.png` exists (Next may auto-serve) but Twitter card tags not explicit.
- **Fix:** Set `openGraph.images` + `twitter` card metadata explicitly.
### `AG-SEO-04`
- **Verdict:** WARN
- **Evidence:** Homepage/pricing copy is generic starter (“Start building for free…”, ACME branding in Footer) — weak product-for-whom-outcome sentence for a real SaaS.
- **Fix:** Replace with plain-language positioning for the real product.
### `AG-SEO-06`
- **Verdict:** WARN
- **Evidence:** No FAQ section in `app/` or `components/`.
- **Fix:** Add 3–5 buyer FAQ items as text.
### `AG-SEO-07`
- **Verdict:** WARN
- **Evidence:** No `robots.txt` / `llms.txt` — crawler policy unintentional by omission.
- **Fix:** Publish intentional robots / optional llms.txt.
### `AG-OPS-02`
- **Verdict:** WARN
- **Evidence:** Live-key env naming exists (`STRIPE_SECRET_KEY_LIVE`) but no checked-in preview-vs-prod isolation policy or Vercel env screenshots.
- **Fix:** Document and enforce: preview ≠ production secrets.
### `AG-OPS-03`
- **Verdict:** WARN
- **Evidence:** No Sentry/Datadog/other error monitoring dependency or init in `package.json` / `app/`.
- **Fix:** Hook error aggregation before launch.
### `AG-OPS-04`
- **Verdict:** WARN
- **Evidence:** No backup/rollback RTO doc in repo README beyond generic Supabase usage.
- **Fix:** Write DB backup owner + rollback steps.
## Full checklist log
| ID | Verdict | Evidence (short) | Fix |
|----|---------|------------------|-----|
| AG-SEC-01 | WARN | No live secrets in tree; shallow history; demo anon JWT in `.env.local.example:4` | Full-history scan; keep env gitignored |
| AG-SEC-02 | PASS | `SUPABASE_SERVICE_ROLE_KEY` / `STRIPE_SECRET_KEY` server-only (`utils/supabase/admin.ts:15-17`, `utils/stripe/config.ts:3-4`); only publishable keys are `NEXT_PUBLIC_` | Rescan prod JS bundle at deploy |
| AG-SEC-03 | PASS | RLS on users/customers/products/prices/subscriptions + owner policies (`schema.sql:15-17,44-45,65-66,98-99,137-138`). Live anon probe N/A (no project keys) | Confirm policies applied on hosted Supabase |
| AG-SEC-04 | N/A | No user-upload storage buckets in app code | — |
| AG-SEC-05 | N/A | No custom CORS / no `Access-Control-Allow-Origin: *` in repo | Add explicit allowlist if exposing cross-origin APIs |
| AG-SEC-06 | WARN | Audit not run; `next@14.2.3` | `pnpm audit` + patch |
| AG-SEC-07 | N/A | No AI/costly model routes | — |
| AG-SEC-08 | WARN | Raw `console.log`/`console.error` in webhook/stripe paths | Scrub PII/secrets |
| AG-PAY-01 | WARN | Live-key preference in code; prod env unverified | Lock live keys to production only |
| AG-PAY-02 | FAIL | Client-supplied `price` → `price.id` in Checkout (`Pricing.tsx:57`, `server.ts:59`) | Server-side price lookup |
| AG-PAY-03 | PASS | Raw body + `stripe.webhooks.constructEvent` (`app/api/webhooks/route.ts:25-33`); rejects missing sig/secret | Keep raw-body path on platform changes |
| AG-PAY-04 | FAIL | No `event.id` dedupe table/handler | Persist event IDs |
| AG-PAY-05 | PASS | `success_url` is `getURL(redirectPath)` only (`server.ts:64`); entitlements via webhook/`manageSubscriptionStatusChange`, not `?paid=` | Keep grant-on-webhook only |
| AG-PAY-06 | FAIL | Sub delete/update handled; refund/dispute events absent | Handle refund/dispute |
| AG-PAY-07 | FAIL | $1 drill not run (no keys) | Run drill + attach evidence |
| AG-AUTH-01 | WARN | `getURL` localhost default; prod URL env-dependent | Set prod redirects |
| AG-AUTH-02 | PASS | `app/account/page.tsx:20-22` redirects if `!user`; checkout uses `supabase.auth.getUser()` server-side | Keep server checks on all protected actions |
| AG-AUTH-03 | PASS | Subs select `auth.uid() = user_id` (`schema.sql:138`); name update only `full_name` metadata; customers table has RLS and no user policies | Continue rejecting client role/plan fields |
| AG-AUTH-04 | WARN | No app rate limit on auth actions | Edge rate limit |
| AG-AUTH-05 | FAIL | Password update without session revoke; no account delete | Global sign-out + delete flow |
| AG-AUTH-06 | WARN | Cookie flags not explicitly set/documented in app | Verify Secure/SameSite in prod |
| AG-AUTH-07 | N/A | No workspace/invite feature | — |
| AG-SEO-01 | PASS | `app/layout.tsx:9-15` unique title + description present | Replace ACME starter copy for real product |
| AG-SEO-02 | WARN | No robots/sitemap | Add them |
| AG-SEO-03 | WARN | OG text only; `app/opengraph-image.png` present but cards not explicit | Explicit OG/Twitter images |
| AG-SEO-04 | WARN | Generic starter positioning | Real product sentence |
| AG-SEO-05 | PASS | Pricing UI renders amounts as text from Stripe-synced prices (`Pricing.tsx`) when products exist | Keep text prices |
| AG-SEO-06 | WARN | No FAQ | Add FAQ |
| AG-SEO-07 | WARN | No crawler policy file | Add robots/llms.txt |
| AG-OPS-01 | PASS | `curl -sI https://subscription-payments.vercel.app/` → HTTP/2 200 + `strict-transport-security` (2026-10-31) | Use announced custom domain before marketing |
| AG-OPS-02 | WARN | Live/test key naming only; isolation undocumented | Enforce preview ≠ prod secrets |
| AG-OPS-03 | WARN | No error monitoring hooked | Add Sentry (or equiv.) |
| AG-OPS-04 | WARN | No backup/rollback write-up | Document RTO/owner |
| AG-OPS-05 | FAIL | Privacy/Terms `href="/"` placeholders (`Footer.tsx:64-78`) | Real legal pages pre-checkout |
| AG-OPS-06 | FAIL | Blocking FAILs above ⇒ must not announce paid launch | Clear FAILs then re-gate |
## Notes / out of scope
- Gate was **read-only** against a public archived starter used as a stand-in “vibe-coded SaaS” buyer target — not a claim about Vercel’s hosted demo quality of service.
- No Supabase project keys / Stripe keys available ⇒ live RLS anon probe, live webhook delivery, and $1 drill could not be executed; missing drills follow pack defaults (FAIL where blocking).
- Skill pack installed buyer-style: `.cursor/rules/agent-ship-gate.mdc` + `.agent-ship-gate/{SKILL,CHECKS,REPORT-TEMPLATE}.md`.
- This is a launch gate, not a pentest or compliance certification.
## Re-run
After fixes, re-run failed IDs only, update this file, and refresh the overall verdict.