Repository navigation
SP5: subscription-payments becomes an Orun baseline - #6
Merged
Merged
Conversation
The repository is an Orun baseline on the Cloudflare + Supabase (Lumen) conventions, built the way cirrus-baseline v22 builds a product: ONE landing, after the saas-starter reference without its Hyperdrive. 01-product places every module, brands it, links the repository, reconciles four brokered keys (workers-deploy, account-id, management-access, org-id) and lands it as one pull request, then awaits the convergence, Lumen's three database credentials and WIRING_SUPABASE on stage and prod, and / + /api/health; 02-docs restores the promotion gate and dev's lanes and renders the deployment record. The chain is supabase -> db-migrate -> web, enforced on main, advisory on pull requests. The baseline: - blueprint.yaml (card: requires github, cloudflare, supabase; the two Supabase projects the free plan allows stated as a prerequisite) and repo-blueprint.yaml (two phases, one landing) - .baseline/ (identity, task contracts, the product's README), the rename engine with the SITE_NAME seam (utils/site.ts) and the upstream's identity protected, the bootstrap helpers, the deployment-record hook, ai/context/, BOOTSTRAP.md, docs/phases/ - testing/: manifest, phases, coverage, rebrand, retouch, bootstrap-defer, leak, placement and e2e — the e2e over a local Supabase made of the real Auth (GoTrue 2.180.0) and Data API (PostgREST 12.2.12), pinned and checksummed, behind a gateway that checks the API key; the db-migrate and web lanes' own steps in the job trees orun stages; a sign-up, sign-out and sign-in through the app's own server actions; the anon key refused every row the policies do not give it - baseline.yml, tag.yml; checks.yml on pull requests only; ci.yml's linked gate and lanes on v2.78.4; stack-tectonic 0.19.0 The product: - WIRING_SUPABASE carries the project URL, the anon key and the service-role key; the supabase root publishes it beside Lumen's three database credentials and nothing else, waits for ACTIVE_HEALTHY, and points the project's Auth at the Worker (Site URL, redirect allow-list, autoconfirm until SMTP). Lumen's lock file committed - web reads only its own environment's WIRING_SUPABASE, re-renders the committed wrangler.jsonc in stage/prod (URL, anon key, site origin, which next build inlines from it), and pushes the service-role key to the Worker with `wrangler secret bulk` from the deploy lane (tooling/wire/secrets.mjs) — never a var or a bundle. NEXT_PUBLIC_SITE_URL no longer comes out empty - Stripe optional: pricing shows the DB's plans or the template's sample plans with checkout off and "Connect Stripe to enable checkout"; checkout and the portal answer "Stripe is not connected."; the webhook answers 503; the publishable key is read per request - migration 020_row_level_security re-enables RLS on the five tables (upstream's policies kept) and refuses if any table in public lacks it; tests/db checks it in PGlite after every migration - /api/health (the project reachable with the built keys, the schema migrated, the service-role secret valid); the smoke and probes read it Not verified: a Terraform apply (the brokered OAuth token's reach to the API-keys and Auth-config endpoints), the secret push and a deploy to a real account, a live bootstrap, a real Stripe round-trip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repository becomes an Orun baseline on the Cloudflare + Supabase (Lumen) conventions, built the way cirrus-baseline v22 builds a product: in one landing. It follows the saas-starter reference (sourceplane/saas-starter#6), minus Hyperdrive. Milestone SP5, task SP-6.
The baseline
blueprint.yamlis the card. It declaresrequires [github, cloudflare, supabase]and previews four brokered keys:CLOUDFLARE_API_TOKEN(workers-deploy),CLOUDFLARE_ACCOUNT_ID(account-id),SUPABASE_ACCESS_TOKEN(management-access) andSUPABASE_ORG_ID(org-id). It asks for no Stripe key. It says the product uses two Supabase projects, the most the free plan allows, and that prerequisite is in BOOTSTRAP too.repo-blueprint.yamlhas two phases:01-productplaces every module, then runs the full hook chain: retouch → git-init → stage → rebrand → orun-workspace → work-tree strip → promotion/dev-lanes defer → restage → rebrand-verify → lockfile → repo → link → 4× reconcile → land.orun.secrets/existsthatSUPABASE_PROJECT_REF,SUPABASE_DB_PASSWORD,SUPABASE_DB_URLandWIRING_SUPABASEexist on stage and prod, then probes/and/api/health.02-docsis hook-only: it restores the deferrals, renders the deployment record and lands it.supabase → db-migrate → web,mode: enforcedongithub-push-mainand advisory on PRs..baseline/(identity, task contracts, the product README), the rebrand engine and its seam (apps/web/utils/site.ts), the bootstrap helpers, the deployment-record hook,ai/context/,docs/phases/, BOOTSTRAP.md,baseline.yml,tag.yml,ci.yml'slinkedgate on v2.78.4, andchecks.ymlon PRs only.nextjs-subscription-payments,subscription-payments.vercel.app) and all migration files are protected from the rename.The product
WIRING_SUPABASE_<ENV>carries the URL, the anon key and the service-role key. The supabase root publishes it alongside Lumen's three database outputs and nothing else, with Lumen's lock file. The root also:ACTIVE_HEALTHY;authEmailConfirmation).wrangler.jsonc;next buildinlines the URL, anon key and site origin from that file. The service-role key reaches the Worker as a Worker secret: the deploy lane pushes it withwrangler secret bulk, the value going over stdin (tooling/wire/secrets.mjs). It is never a var and never in a bundle; the e2e greps the build output to prove it.NEXT_PUBLIC_SITE_URLused to build as…-web-stage..workers.dev, becauseWORKERS_DEV_SUBDOMAINonly exists in the smoke step.020_row_level_securityre-enables RLS on all five tables and fails if anypublictable lacks it.tests/db(PGlite) checks the catalog, the policies, and what anon, a user and the service role can read and write./api/healthanswers 200 only when the project is reachable with the built keys, the schema is migrated and the service-role key is valid. The smoke and the probes use it.Verified
pnpm install --frozen-lockfile,wire:fixture(no diff), typecheck, lint (0 errors), test (53: 42 intests/web, 11 intests/db), build. All green.manifest,phases,coverage,rebrand(acme fixture "Sam's Seats & Billing"),retouchandbootstrap-deferall pass.leakandplacementpass at orun v2.58.11 and 2.79.0. Placement covers the offline bootstrap of both phases, the product's push-to-main plan (supabase → db-migrate → web, enforced, per env), the PR plan with advisory edges (checked at ≥ the lane pin) and a--resumeno-op.e2epasses at orun v2.78.4. It runs a local Supabase built from the real GoTrue 2.180.0 and PostgREST 12.2.12 (pinned and sha256-checked) behind an apikey-checking gateway, and then:verify-app-structureincluded);wrangler devwith no Stripe key and runs the component's own smoke;orun new --statuspasses at v2.58.11, v2.78.4 and 2.79.0;orun validateandorun work checkare clean.fmtandvalidate(init -backend=false) pass on the supabase root.Only verified offline: the Terraform apply, including whether the brokered OAuth token can reach the API-keys and Auth-config endpoints (risk SP-M); the real
wrangler secret bulkpush and deploy; a live bootstrap; and a real Stripe round-trip.🤖 Generated with Claude Code
https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
Generated by Claude Code