Repository navigation
PS4: platforms-starter-kit becomes an Orun baseline - #5
Merged
Merged
Conversation
The repository is now a baseline: blueprint.yaml (the console card) and
repo-blueprint.yaml (the build) take a new multi-tenant product from
nothing to live on stage and prod in TWO phases, cirrus-baseline v22's
one-landing shape, ported from kv-redis-starter's baseline-v1:
- 01-product places every module (root files, CI, tooling, the KV root,
the app, its tests), retouches, brands, re-tenants, strips the work
tree, defers prod's promotion gate and dev's push lanes, lands it as one
pull request after reconciling CLOUDFLARE_API_TOKEN (workers-deploy:
Workers Scripts and KV Storage) and CLOUDFLARE_ACCOUNT_ID, then watches
the convergence, checks WIRING_CLOUDFLARE_KV exists on stage and prod,
and probes both workers.dev URLs.
- 02-docs is hook-only: restores the two deferrals, renders the
deployment record, lands it.
Infra before app: apps/web depends on cloudflare-kv with mode: enforced
on github-push-main and advisory on pull requests. The product's own
push-to-main plan puts cloudflare-kv.{stage,prod}.terraform at lane level
0 and web.{stage,prod}.verify-deploy at level 1, each waiting on its own
environment's apply.
workers.dev, end to end, with no custom domain: tenant subdomains need a
zone and a wildcard route a fresh build does not have, so off the root
domain a tenant is a path on the request's host, /s/<tenant>
(apps/web/lib/addresses.ts). The landing form offers it, creating a
tenant redirects to it, /admin and the tenant page link to it; on the
root domain the links are upstream's subdomains. The root domain stays
BASE_DOMAIN (productdomain on prod, stage.<productdomain> on stage); the
zone, wildcard DNS record and Worker route are the owner's follow-up,
documented in the product README. /admin keeps upstream's no-auth TODO
(no third-party provider to degrade); the README says to gate it with
Cloudflare Access.
Fixed on the way, latent since PS1 because no Orun lane had run:
- wrangler.jsonc is committed as the fixture render; the composition's
verify-app-structure checks it exists BEFORE the build.
- dev, which no root applies to, renders the fixture
(live.mjs --fixture --fixture-envs dev).
Also: packages/ (a required discovery root), stack-tectonic 0.19.0, the
orun lane pin v2.78.4, checks.yml on pull requests only, the ci.yml
ws_CHANGE_ME gate, the site.ts identity seam, a smoke that proves the
Worker renders per request and reads KV, keyed task contracts.
Tests (testing/, baseline.yml): manifest, phases, coverage, rebrand,
retouch, bootstrap-defer, wire, leak, placement (both phases offline, the
product's own plans) and e2e (the stage lane's steps incl.
verify-app-structure in the staged job tree, wrangler dev, the
component's smoke, a tenant created through the landing form and read
back through the Worker by path, on /admin and as a subdomain).
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.
PS4 (task PS-5). The repository is now an Orun baseline.
blueprint.yamlis the console card andrepo-blueprint.yamlis the build. Together they take a new multi-tenant product from nothing to live on stage and prod in one landing. This is cirrus-baseline v22's two-phase shape, ported from kv-redis-starter'sbaseline-v1. The generic parts are copied verbatim, as the porting note says.What was added
01-productplaces every module (21) and brands it. It re-tenants the workspace, strips the work tree, and defers prod's promotion gate and dev's push lanes. It then reconcilesCLOUDFLARE_API_TOKEN(workers-deploy) andCLOUDFLARE_ACCOUNT_ID(account-id) and lands everything as one PR. Its await watches the convergence on the merge sha, checksWIRING_CLOUDFLARE_KVexists on stage and prod (orun.secrets/exists@v1), and probes both workers.dev URLs.02-docsplaces nothing: it restores the two deferrals, renders the deployment record and lands it. Epic slugplatforms-baselining, task prefixBASE, contracts in.baseline/tasks/.apps/webdeclaresdependsOn: cloudflare-kvwithmode: enforced, plus amodeRulesentry that makes it advisory ongithub-pull-request. The product's own push-to-main plan:/s/<tenant>(apps/web/lib/addresses.ts). The landing form offers that path, creating a tenant redirects to it, and/adminand the tenant page link to it. On the root domain, links stay upstream's subdomains, and the proxy is unchanged.BASE_DOMAIN. It is still the build input: the product domain on prod and dev,stage.<domain>on stage. The zone, the wildcard DNS record and the Worker route are the owner's follow-up. The product README covers it under "Tenant subdomains"./admin. It keeps upstream's no-auth TODO. There is no third-party provider for rule 8 to degrade. The docs say to put Cloudflare Access in front of it.apps/web/wrangler.jsoncis now committed as the fixture render.verify-app-structurechecks that it exists before the build, and Checks diffs it.live.mjs --fixture … --fixture-envs dev).checks.ymlruns on pull requests only, andci.ymlskips while the workspace isws_CHANGE_ME.packages/.gitkeep, and theapp/site.tsname seam./must name<host>/s/, which only the Worker rendering per request can do./adminmust answer, which needs the KV read..baseline/,tooling/{rebrand,bootstrap},hooks/render-deployment-docs.sh,ai/context/,docs/phases/,BOOTSTRAP.md,testing/,baseline.ymlandtag.yml. The specs are updated with design §8b and §9 and risks PS-I to PS-L.How it was verified
pnpm install --frozen-lockfile,wire:fixture(the committed config matches the render), typecheck, lint (upstream's twoanywarnings), test (28 tests), build (ƒ /,○ /_not-found,ƒ /admin,ƒ /s/[subdomain]).testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.share green.acme-inc/acme-platforms, roottenants.acme.dev) has no residue.--resumechanges nothing.verify-app-structure,build-app,verify-build-outputanddeploy-dry-runpass in the job tree staged the way orun stages it.KVis bound to the stage document's id, and the build includesstage.tenants.acme.dev.wrangler dev, the component's own smoke passes./s/acme-e2e). It is read back through the Worker on its page, on/admin, and by the action refusing a duplicate. It is also served asacme-e2e.stage.tenants.acme.devvia a Host header./adminredirects away on tenant hosts, unknown tenants and paths return 404, assets are served, and the tenant is gone after deletion.orun new --statussucceeds at v2.58.11, v2.78.4 and 2.79.0 (01-product84 files,02-docshook-only).orun validateandorun work checkare clean.terraform validatepasses oninfra/terraform/cloudflare-kv. That is the offline limit: a plan needs the account.🤖 Generated with Claude Code
https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
Generated by Claude Code