diff --git a/.baseline/product/README.md b/.baseline/product/README.md index ff247b5..f8ddc48 100644 --- a/.baseline/product/README.md +++ b/.baseline/product/README.md @@ -111,6 +111,13 @@ own domain, attach the domain to the Worker in Cloudflare (Workers & Pages → `SITE_URL` under that environment's `env:` in `intent.yaml` — the page's Open Graph image link is absolute — and merge. +The repository also names the domain in one place, `BASE_DOMAIN` under each +environment's `env:` in `intent.yaml`, which the product was born with as the +reserved placeholder `postgres-drizzle-starter.example.com`. Nothing builds a +URL from it — the origin is `SITE_URL` — so replacing it moves nothing by +itself; it records the domain. Replace it with yours in the same pull request +as `SITE_URL`. + ## CI | Workflow | What it runs | diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index e376228..fcd1e15 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -94,7 +94,6 @@ jobs: --out "$(mktemp -d)" \ --set reponame=acme-postgres \ --set "productname=Acme Cloud" \ - --set productdomain=acme.dev \ --set githuborg=acme-inc - name: the leak gate — what a product carries run: bash testing/leak.test.sh diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index 0fd82c7..8596b87 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -62,7 +62,7 @@ cd postgres-drizzle-starter orun new --blueprint repo-blueprint.yaml \ --out ~/products/acme-postgres --run-hooks --resume \ --set reponame=acme-postgres --set productname="Acme Cloud" \ - --set productdomain=acme.dev --set githuborg=acme-inc \ + --set githuborg=acme-inc \ --set orunWorkspace=ws_XXXXXXXX \ --set subdomain= ``` @@ -99,9 +99,13 @@ orun new --blueprint repo-blueprint.yaml --out ~/products/acme-postgres --run-ho `02-docs` reads the identity back from `.rebrand/values.json` in the placed tree, but the blueprint's **required** inputs — `reponame`, `productname`, -`productdomain`, `githuborg` — are validated before anything runs, so pass -them every time (a `--values` file is easier). The full guide, one page per -phase: [docs/phases/README.md](docs/phases/README.md). +`githuborg` — are validated before anything runs, so pass them every time (a +`--values` file is easier). The domain is not one of them: the app goes live +on workers.dev, and `productdomain` defaults to empty, which brands the +reserved placeholder `.example.com` into `BASE_DOMAIN` for an owner +to replace when they attach a domain (README, "Custom domain"). Pass +`--set productdomain=` only for a product that already has its domain. +The full guide, one page per phase: [docs/phases/README.md](docs/phases/README.md). | flag | what it does | |---|---| @@ -224,5 +228,5 @@ at the tag and refuses the whole catalogue if it 404s. | The convergence reported green, then `verify` got 404 | a second workflow ran on the push to main and the watch took its run. Only `ci.yml` may run on a push to main; `checks.yml` runs on pull requests only | | The product's `intent.yaml` says `workspace: ws_SET_ME` | `orunWorkspace` was empty and the build ran outside a workspace; set it and re-run `01-product` | | A bootstrap stopped before `02-docs`; prod no longer waits on stage | the gate is deferred, not dropped: run `02-docs`, or `node tooling/bootstrap/promotion.mjs --restore --file /intent.yaml` | -| `✕ input "productdomain" is required` | all four required inputs must be set on every invocation, single-phase ones included | +| `✕ input "productname" is required` | all three required inputs (`reponame`, `productname`, `githuborg`) must be set on every invocation, single-phase ones included | | `unknown flag: --phase` or a parse error in the blueprint | the CLI is below the v2.58.11 floor | diff --git a/README.md b/README.md index 76c643d..6dfcbb0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ departure. git clone --depth 1 --branch https://github.com/sourceplane/postgres-drizzle-starter cd postgres-drizzle-starter orun new --blueprint repo-blueprint.yaml --out ~/products/acme-postgres --run-hooks --resume \ - --set reponame=acme-postgres --set productname="Acme Cloud" --set productdomain=acme.dev \ + --set reponame=acme-postgres --set productname="Acme Cloud" \ --set githuborg=acme-inc --set subdomain= ``` diff --git a/ai/context/current.md b/ai/context/current.md index 03f6d27..9b5f049 100644 --- a/ai/context/current.md +++ b/ai/context/current.md @@ -19,7 +19,7 @@ per environment), then records what went live (`02-docs`). | | | |---|---| -| Latest tag | `baseline-v2` (PD5 — the cirrus standard: no kiox, generated component docs, this context pack, and the console card reading `subdomain` from the Cloudflare connection); `baseline-v1` is PD4 | +| Latest tag | `baseline-v3` (PD6 — the domain is set later: the console asks for no domain, and a product is born with the placeholder `.example.com` in `BASE_DOMAIN` for an owner to replace); `baseline-v2` is PD5 (the cirrus standard), `baseline-v1` PD4 | | Proven live | No. Everything short of the platform is proven offline in Baseline CI, a migrated local Postgres served through the built Worker included; a live bootstrap from a tag is still to come (risk PD-J) | ## Where to read @@ -34,6 +34,6 @@ per environment), then records what went live (`02-docs`). ## Next -1. Bootstrap one product from `baseline-v2` against a workspace with +1. Bootstrap one product from `baseline-v3` against a workspace with Cloudflare and Supabase connections and room for two Supabase projects (PD-F), and record its timings (closes PD-J). diff --git a/ai/context/decisions.md b/ai/context/decisions.md index 8d33827..50f7bde 100644 --- a/ai/context/decisions.md +++ b/ai/context/decisions.md @@ -19,3 +19,4 @@ reads in order. | 11 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox | `kiox.yaml` pinned a version (v2.15.0) nothing ran | IMPLEMENTATION-STATUS (PD5) | | 12 | Component docs are generated from the manifests and checked in CI | A hand-written copy of the dependency graph, bindings and migrations drifts silently | `tooling/catalog/gen-component-docs.py` | | 13 | The console card reads `subdomain` from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`); only a hand-run build passes it | It belongs to the account like its id and has one right answer; a typed one could only be wrong, and wrong showed up after deploy (cirrus-baseline since baseline-v23) | `blueprint.yaml`, IMPLEMENTATION-STATUS (PD-7) | +| 14 | The console asks for no domain; an empty `productdomain` brands the placeholder `.example.com` | The app goes live on workers.dev and nothing in the build needs a domain (the origin is `SITE_URL`, else workers.dev); attaching one is an owner's step, and the placeholder keeps the place the domain goes in the repository, ready to replace | `repo-blueprint.yaml`, `tooling/rebrand/rebrand.mjs`, IMPLEMENTATION-STATUS (PD-8) | diff --git a/ai/context/operations.md b/ai/context/operations.md index 1b19761..f9c5bef 100644 --- a/ai/context/operations.md +++ b/ai/context/operations.md @@ -136,7 +136,7 @@ orun integrations list --org --json && orun cloud check --org | change the schema | edit the table in `apps/web/lib/drizzle.ts` (a new table with `.enableRLS()`), `pnpm --filter @app/web db:generate`, copy the SQL into a new `packages/db/src/migrations/_/up.sql` and the manifest (`pnpm --filter @saas/db run manifest:fix` for its checksum), merge — db-migrate applies it before the app deploys. `pnpm test` fails on a table in `public` without row-level security, and on a migration whose drizzle-kit twin says something else | | reset the demo rows | delete them (`DELETE FROM profiles` in the Supabase SQL editor); once Hyperdrive's cached read expires (about a minute), the next page view seeds the three again | | redeploy without a change | edit the last line of the component's `component.yaml` (`# orun: redeploy `) and merge — it is a deploy trigger, nothing reads it | -| serve a custom domain | attach it to the Worker in Cloudflare, then set `SITE_URL` under that environment's `env:` in `intent.yaml` (the page's Open Graph link is absolute) and merge | +| serve a custom domain | attach it to the Worker in Cloudflare (README, "Custom domain"), then set `SITE_URL` under that environment's `env:` in `intent.yaml` (the page's Open Graph link is absolute), replace the placeholder `postgres-drizzle-starter.example.com` in `intent.yaml`'s `BASE_DOMAIN` with it (a record; nothing builds a URL from it), and merge | | headless credentials | `ORUN_TOKEN` (workspace-scoped) + `GITHUB_TOKEN` | The deployment record is the bootstrap's `02-docs` phase. Re-running it (the diff --git a/blueprint.yaml b/blueprint.yaml index 95027d3..d938479 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -67,6 +67,12 @@ spec: # already holds says so with `from`. repo-blueprint.yaml declares the same # names; `repoPrivate`, `orunWorkspace` and `epicSlug` are build inputs with # defaults (or filled from the build's workspace) and are not asked. + # + # NOR IS THE DOMAIN. The app goes live on workers.dev, and a domain is an + # owner's step after the bootstrap: `productdomain` defaults to empty, the + # rebrand writes the reserved placeholder `.example.com` where + # the domain goes, and the product's README ("Custom domain") says how to + # set it. Nothing that needs a domain is removed — it waits for one. inputs: - key: reponame label: Repo name @@ -78,11 +84,6 @@ spec: pattern: "^[A-Za-z0-9][A-Za-z0-9 .,'&-]{1,48}$" help: The name people see — the page's heading and its title. example: Acme Cloud - - key: productdomain - label: Product domain - pattern: "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$" - help: The domain the product will answer on. It does not need to exist — the app goes live on workers.dev first. - example: acme.dev - key: githuborg label: GitHub organisation pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$" diff --git a/docs/phases/README.md b/docs/phases/README.md index 1e5bebd..559a218 100644 --- a/docs/phases/README.md +++ b/docs/phases/README.md @@ -55,9 +55,16 @@ carry, so it is an owner's step after the bootstrap (the product's README, `01-product` takes the product's identity once and writes it into the repo (`.rebrand/values.json`); `02-docs` reads it back from the placed tree. But the blueprint's **required** inputs — `reponame`, `productname`, -`productdomain`, `githuborg` — are validated before any phase runs, so they -must be supplied on every invocation, single-phase ones included. A -`--values` file is easier than repeating `--set`. +`githuborg` — are validated before any phase runs, so they must be supplied +on every invocation, single-phase ones included. A `--values` file is easier +than repeating `--set`. + +- `productdomain` — NOT ASKED, default empty. The app goes live on + workers.dev; empty brands the reserved placeholder `.example.com` + into `BASE_DOMAIN`, for an owner to replace when they attach a domain (the + product's README, "Custom domain", which also sets `SITE_URL` so the page's + absolute links follow it). Pass it only for a product that already has its + domain. - `subdomain` — the workers.dev subdomain of the Cloudflare account you deploy into. It is in every URL the phases probe and in the site origin diff --git a/repo-blueprint.yaml b/repo-blueprint.yaml index 9a6b7f8..a3dac71 100644 --- a/repo-blueprint.yaml +++ b/repo-blueprint.yaml @@ -37,11 +37,17 @@ inputs: description: The product's display name (e.g. "Acme Cloud") — the page's heading and its title. productdomain: type: string - required: true + default: "" description: >- - The domain the product will answer on (e.g. acme.dev) — BASE_DOMAIN and - the custom-domain guidance. It does not need to exist: the app answers - on workers.dev from its first deploy. + The product's own domain, once it has one (e.g. acme.dev). NOT ASKED: + the app answers on workers.dev from its first deploy, and a domain is + an owner's step after it. Empty, the rebrand writes the reserved + placeholder `.example.com` where the domain goes (BASE_DOMAIN + under each environment's `env:` in intent.yaml), so setting it later is + replacing that one string — the product's README, "Custom domain", says + how, together with the SITE_URL that moves the page's absolute links + onto it. Pass it with --set only to brand a hand-run build with a domain + it already has. githuborg: type: string pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$" diff --git a/specs/epics/README.md b/specs/epics/README.md index 247ab62..30001be 100644 --- a/specs/epics/README.md +++ b/specs/epics/README.md @@ -7,6 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace. | Epic | Cluster | Status | What it is | |------|---------|--------|------------| -| [`postgres-drizzle-starter/`](./postgres-drizzle-starter/) | **PD** | ✅ Shipped (`baseline-v2`); live bootstrap pending | Vercel's Postgres + Drizzle Next.js Starter, equivalent in code and function, on Cloudflare Workers with Supabase Postgres through Hyperdrive — and an Orun baseline that instantiates it in one landing (PD4) | +| [`postgres-drizzle-starter/`](./postgres-drizzle-starter/) | **PD** | ✅ Shipped (`baseline-v3`); live bootstrap pending | Vercel's Postgres + Drizzle Next.js Starter, equivalent in code and function, on Cloudflare Workers with Supabase Postgres through Hyperdrive — and an Orun baseline that instantiates it in one landing (PD4) | As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`. diff --git a/specs/epics/postgres-drizzle-starter/IMPLEMENTATION-STATUS.md b/specs/epics/postgres-drizzle-starter/IMPLEMENTATION-STATUS.md index f91a159..e08b588 100644 --- a/specs/epics/postgres-drizzle-starter/IMPLEMENTATION-STATUS.md +++ b/specs/epics/postgres-drizzle-starter/IMPLEMENTATION-STATUS.md @@ -11,6 +11,7 @@ the code departed from `design.md` or from the upstream template. | PD3 — ready to instantiate | ✅ Shipped | [#4](https://github.com/sourceplane/postgres-drizzle-starter/pull/4) | | PD4 — a baseline | ✅ Shipped (offline-proven; no live bootstrap yet, risk PD-J) | [#5](https://github.com/sourceplane/postgres-drizzle-starter/pull/5) (PD-5), tagged `baseline-v1` | | PD5 — the cirrus standard | ✅ Shipped | [#6](https://github.com/sourceplane/postgres-drizzle-starter/pull/6) (PD-6), [#7](https://github.com/sourceplane/postgres-drizzle-starter/pull/7) (PD-7), tagged `baseline-v2` | +| PD6 — the domain is set later | ✅ Shipped | [#8](https://github.com/sourceplane/postgres-drizzle-starter/pull/8) (PD-8), tagged `baseline-v3` | ## Departures from the upstream template @@ -251,3 +252,46 @@ passes. `anon` and `authenticated` read none of the rows and write none. - `orun task check PD-6` complete. +## The domain is set later (PD6, PD-8) + +The console asked for the product's domain, with help text that said it did +not need to exist — and nothing in the build needed one: the app answers on +workers.dev from its first deploy, its origin (the page's absolute Open Graph +link) is `SITE_URL` when an environment sets it and the environment's +workers.dev URL when it does not, and the one place the repository names the +domain is `BASE_DOMAIN` under each environment's `env:` in `intent.yaml`, +which nothing builds a URL from. The Supabase project here is a database +only: no Auth URL is built from anything. A domain is an owner's step after +the bootstrap (README, "Custom domain"), so the form no longer asks for it. + +- `blueprint.yaml` declares no `productdomain` input; the console's Product + step asks for the product's name alone. +- `repo-blueprint.yaml`'s `productdomain` is optional, default empty. No hook, + probe or `when:` reads it — the only use is the `.rebrand/values.json` + template, which writes `""`. A hand-run build may still pass + `--set productdomain=` for a product that already has its domain. +- `rebrand.mjs` no longer requires it. Empty, it brands the reserved + placeholder `.example.com` (RFC 2606 — never someone else's + domain) where the domain goes — `BASE_DOMAIN` in dev, stage and prod — so + setting it later is replacing one string; the product README and + `ai/context/operations.md` say so, beside the `SITE_URL` that actually + moves the page's links onto the domain. +- `testing/fixtures/acme.json` carries no domain, so the leak gate, the + offline bootstrap and the e2e tier exercise exactly what a console build + supplies; `testing/rebrand.test.sh` pins the placeholder for an absent and + an empty domain; `baseline.yml`'s blueprint read sets no domain. + +Nothing that needs a domain was removed — it waits for one. + +Verified: `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh` +green (rebrand: 32 checks, the two new ones included); `gen-component-docs.py +--check` green (7 components); `orun new --status` on `repo-blueprint.yaml` +with no domain (01-product pending, 126 files), `testing/leak.test.sh` (126 +files derived, 123 text files read) and `testing/placement.test.sh` (126 +tracked files; supabase → cloudflare-hyperdrive → db-migrate → web enforced +on stage and prod; `--resume` changes nothing) at v2.58.11. The offline +bootstrap of the fixture, which names no domain, writes +`"productdomain": ""` and brands `acme-postgres.example.com` into the +product's three `BASE_DOMAIN` lines, its README and its `operations.md` (5 +lines, 3 files), with no `postgres-drizzle-starter.example.com` left. +`orun task check PD-8` complete. diff --git a/specs/epics/postgres-drizzle-starter/README.md b/specs/epics/postgres-drizzle-starter/README.md index 6c892c3..382842b 100644 --- a/specs/epics/postgres-drizzle-starter/README.md +++ b/specs/epics/postgres-drizzle-starter/README.md @@ -8,15 +8,15 @@ The port keeps the page, the table component, the refresh button, the schema and | Field | Value | |-------|-------| -| Status | ✅ PD0–PD5 shipped (#1–#7; PD4 tagged `baseline-v1`, PD5 — the cirrus standard, PD-6 and PD-7 — tagged `baseline-v2`). Terraform applies, a live db-migrate apply and a live deploy are proven only by a live bootstrap (risk PD-J) | -| Cluster | **PD** (PD0–PD5) | +| Status | ✅ PD0–PD6 shipped (#1–#8; PD4 tagged `baseline-v1`, PD5 — the cirrus standard, PD-6 and PD-7 — tagged `baseline-v2`, PD6 — the domain is set later, PD-8 — tagged `baseline-v3`). Terraform applies, a live db-migrate apply and a live deploy are proven only by a live bootstrap (risk PD-J) | +| Cluster | **PD** (PD0–PD6) | | Owner(s) | `apps/web` (the page, `lib/db.ts`, `lib/drizzle.ts`, `lib/seed.ts`) · `packages/db` (the migrations and their runner) · `tests/web`, `tests/db` · `infra/terraform/{supabase,cloudflare-hyperdrive}`, `infra/db-migrate` | | Builds on | `lumen`: the `supabase` and `cloudflare-hyperdrive` roots and the per-request `postgres` client; the `saas-starter` port's `getDb()` pattern | | Upstream | [vercel/examples `storage/postgres-drizzle`](https://github.com/vercel/examples/tree/main/storage/postgres-drizzle) | | Changes | The client resolution (module-level `POSTGRES_URL` → per-request Hyperdrive), the Workers build, tests, two Terraform roots, the deploy contract; page copy says Cloudflare | | Decisions locked | (1) Per-request client, Hyperdrive first, `POSTGRES_URL` fallback. (2) ~~Seed-on-first-use kept as upstream; no `db-migrate` for one table~~ → PD4: the table is `db-migrate`'s, applied before the app serves, with row-level security; the page seeds only the rows, on an empty table. (3) `wrangler.jsonc` rendered from the template: committed as the fixture render (the composition checks it exists before the build), re-rendered per environment by the deploy lanes (PD4; it was git-ignored before). (4) Drizzle moves from 0.28 to the current line with the schema as written. (5) Infra before app on main: supabase → cloudflare-hyperdrive → db-migrate → web, enforced; advisory on pull requests (PD4). | | Gate | PD1 is the first user-visible rung. PD2 applies only with a linked workspace (Supabase + Cloudflare connections); verified by `terraform validate`. | -| Shipped as | `baseline-v1` ([#5](https://github.com/sourceplane/postgres-drizzle-starter/pull/5)), `baseline-v2` ([#6](https://github.com/sourceplane/postgres-drizzle-starter/pull/6), [#7](https://github.com/sourceplane/postgres-drizzle-starter/pull/7)); proven offline (Baseline CI: migrated into a local Postgres and served through the built Worker under `wrangler dev`), deploy gated until a workspace is linked | +| Shipped as | `baseline-v3` ([#8](https://github.com/sourceplane/postgres-drizzle-starter/pull/8), PD6: no domain asked), `baseline-v1` ([#5](https://github.com/sourceplane/postgres-drizzle-starter/pull/5)), `baseline-v2` ([#6](https://github.com/sourceplane/postgres-drizzle-starter/pull/6), [#7](https://github.com/sourceplane/postgres-drizzle-starter/pull/7)); proven offline (Baseline CI: migrated into a local Postgres and served through the built Worker under `wrangler dev`), deploy gated until a workspace is linked | ## Read order @@ -35,3 +35,4 @@ The port keeps the page, the table component, the refresh button, the schema and | PD3 — ready to instantiate | README, as-built status | a reader can run, test, preview and deploy it | | PD4 — a baseline | card, build document, rename, bootstrap tooling, the migrations and `db-migrate`, row-level security, the product's README and context pack, tests | a new product goes from nothing to live on stage and prod in one landing; Baseline CI green | | PD5 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags; the console card reads `subdomain` from the Cloudflare connection | Baseline CI green with the docs check | +| PD6 — the domain is set later | the console asks for no domain; an empty `productdomain` brands the placeholder `.example.com` for an owner to replace | Baseline CI green on a fixture with no domain | diff --git a/specs/epics/postgres-drizzle-starter/epic.yaml b/specs/epics/postgres-drizzle-starter/epic.yaml index 970e425..2517611 100644 --- a/specs/epics/postgres-drizzle-starter/epic.yaml +++ b/specs/epics/postgres-drizzle-starter/epic.yaml @@ -46,3 +46,9 @@ spec: - "every milestone's status row agrees with the tags" - "the console card reads subdomain from the Cloudflare connection (from: connection.cloudflare.workersSubdomain), as cirrus-baseline since baseline-v23" tasks: [PD-6, PD-7] + - name: "PD6 — the domain is set later" + exitCriteria: + - "the console card asks for no domain: a product goes live on workers.dev, and productdomain is an optional build input that defaults to empty" + - "a product built without a domain is branded with the reserved placeholder .example.com wherever the domain goes (BASE_DOMAIN), and its README says how an owner sets the real one beside SITE_URL" + - "Baseline CI places, leak-checks and plans a product built with no domain" + tasks: [PD-8] diff --git a/specs/epics/postgres-drizzle-starter/implementation-plan.md b/specs/epics/postgres-drizzle-starter/implementation-plan.md index de55ec6..7f532a9 100644 --- a/specs/epics/postgres-drizzle-starter/implementation-plan.md +++ b/specs/epics/postgres-drizzle-starter/implementation-plan.md @@ -86,6 +86,16 @@ product itself changing. - the docs check is green in Baseline CI - this file, the status file and `epic.yaml` agree +## PD6 — the domain is set later (PD-8) ✅ + +**Done when** the console card asks for no domain; `productdomain` is an +optional build input, empty by default; a product built without one is +branded with the reserved placeholder `.example.com` where the +domain goes (`BASE_DOMAIN` in `intent.yaml`) and its README says how an +owner sets the real one, beside the `SITE_URL` that moves the page's links; +Baseline CI places, leak-checks and plans a product built with no domain. +Shipped in `baseline-v3`. + ## Sequencing note PD1's component already names the Hyperdrive root's wiring secret; PD2 diff --git a/tasks/PD-8.TaskContract.yaml b/tasks/PD-8.TaskContract.yaml new file mode 100644 index 0000000..481cdae --- /dev/null +++ b/tasks/PD-8.TaskContract.yaml @@ -0,0 +1,30 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: PD-8 + title: "The domain is set later" +spec: + goal: "The console no longer asks for the product's domain. A product goes live on workers.dev; productdomain is an optional build input (default empty), the rebrand writes the reserved placeholder .example.com where the domain goes (BASE_DOMAIN in intent.yaml), and the product's README says how an owner replaces it, beside the SITE_URL that moves the page's absolute links, once a domain is attached" + affects: + - blueprint.yaml + - repo-blueprint.yaml + - tooling/rebrand/rebrand.mjs + - testing/rebrand.test.sh + - testing/fixtures/acme.json + - .github/workflows/baseline.yml + - .baseline/product/README.md + - BOOTSTRAP.md + - README.md + - docs/phases/README.md + - ai/context/operations.md + - ai/context/current.md + - ai/context/decisions.md + - specs/** + - tasks/** + doneWhen: + - blueprint.yaml declares no productdomain input, and repo-blueprint.yaml's productdomain is optional with an empty default + - "rebrand.mjs no longer requires productdomain and brands .example.com when it is empty (testing/rebrand.test.sh)" + - testing/fixtures/acme.json carries no domain, so the leak gate and the offline bootstrap exercise what a console build supplies + - the contract tests, the docs check, the leak gate and the offline bootstrap are green + gates: + - checks diff --git a/testing/fixtures/acme.json b/testing/fixtures/acme.json index 37f6474..10051d9 100644 --- a/testing/fixtures/acme.json +++ b/testing/fixtures/acme.json @@ -6,16 +6,16 @@ "AWKWARD rather than tidy — a product name with an apostrophe and an", "ampersand (both legal in the card's pattern, both special in TypeScript", "strings, HTML and a PR title), a hyphenated repo slug that CONTAINS the", - "word `postgres`, an owner other than the baseline's, and a multi-label", - "domain — because a fixture that only uses values the templates were", - "written against proves the templates work on the values they were", - "written against.", + "word `postgres`, an owner other than the baseline's, and NO domain — a", + "console build asks for none, so the placeholder .example.com", + "is what a product is born with — because a fixture that only uses", + "values the templates were written against proves the templates work on", + "the values they were written against.", "Every key here is an input repo-blueprint.yaml declares. A key it does not", "declare is a fixture that has drifted, and orun refuses it." ], "reponame": "acme-postgres", "productname": "Sam's Profiles & Co", - "productdomain": "profiles.acme.dev", "githuborg": "acme-inc", "subdomain": "acme", "orunWorkspace": "ws_0000000000000000000000000000000f", diff --git a/testing/rebrand.test.sh b/testing/rebrand.test.sh index 09e6e41..dca5c42 100755 --- a/testing/rebrand.test.sh +++ b/testing/rebrand.test.sh @@ -77,6 +77,14 @@ check "the Worker's own origin (the site URL the build bakes in): worker name an check "the placeholder domain is the product's domain, not a renamed slug" \ "$acme" intent.yaml ' BASE_DOMAIN: postgres-drizzle-starter.example.com' \ ' BASE_DOMAIN: acme.dev' +check "no domain given: the reserved placeholder, for an owner to replace later" \ + '{"reponame":"acme-postgres","productname":"Acme Cloud","githuborg":"acme-inc","subdomain":"acme"}' \ + intent.yaml ' BASE_DOMAIN: postgres-drizzle-starter.example.com' \ + ' BASE_DOMAIN: acme-postgres.example.com' +check "an empty domain is no domain" \ + '{"reponame":"acme-postgres","productname":"Acme Cloud","productdomain":""}' \ + intent.yaml ' BASE_DOMAIN: postgres-drizzle-starter.example.com' \ + ' BASE_DOMAIN: acme-postgres.example.com' check "the repo slug" \ "$acme" package.json ' "name": "postgres-drizzle-starter",' \ ' "name": "acme-postgres",' diff --git a/tooling/rebrand/rebrand.mjs b/tooling/rebrand/rebrand.mjs index 36bc9ab..6d83b00 100644 --- a/tooling/rebrand/rebrand.mjs +++ b/tooling/rebrand/rebrand.mjs @@ -27,7 +27,7 @@ // { // "reponame": "acme-postgres", // required — repo slug // "productname": "Acme Cloud", // required — the product's display name -// "productdomain": "acme.dev", // required — the product domain +// "productdomain": "acme.dev", // optional — default .example.com (set later) // "githuborg": "acme-inc", // owner of the product repo (source link in docs) // "brandSlug": "acme", // default: reponame — worker name prefix // "subdomain": "acme", // default: your-workers-subdomain @@ -68,7 +68,7 @@ if (!verifyOnly && !valuesPath) { } if (valuesPath) { values = JSON.parse(fs.readFileSync(valuesPath, "utf8")); - for (const required of ["reponame", "productname", "productdomain"]) { + for (const required of ["reponame", "productname"]) { if (typeof values[required] !== "string" || values[required].length === 0) { console.error(`rebrand: values file is missing required field "${required}"`); process.exit(2); @@ -132,7 +132,11 @@ const rx = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // All fields are unused under --verify; the fallbacks keep derivation total. const reponame = values.reponame ?? ""; const productname = values.productname ?? ""; -const productdomain = values.productdomain ?? ""; +// The domain is NOT ASKED at bootstrap: a product goes live on workers.dev and +// an owner sets a domain later. Until then the reserved placeholder +// `.example.com` (RFC 2606 — it can never be someone else's) stands +// wherever the domain goes, so setting it is replacing one string. +const productdomain = (values.productdomain ?? "").trim() || (reponame ? `${reponame}.example.com` : ""); const githuborg = (values.githuborg ?? "").trim() || baseline.githubOwner; const brandSlug = (values.brandSlug ?? "").trim() || reponame; const subdomain = (values.subdomain ?? "").trim() || "your-workers-subdomain";