From 2de598bcfd2790bb6fb50a224869ab1175859373 Mon Sep 17 00:00:00 2001 From: vijayakrishnans Date: Thu, 5 Nov 2026 18:30:49 +0000 Subject: [PATCH] Read the workers.dev subdomain from the Cloudflare connection The card asked for it in a form, where there is one right answer and a wrong one only shows when the smoke check fails after deploy. Two console builds carried `b` and `v`. It now declares `from: connection.cloudflare.workersSubdomain`, as portfolio-starter-kit's does, so the console renders no field and an account with no subdomain is refused before anything is created. A hand-run build still passes --set subdomain. testing/manifest.test.sh takes the same rule as portfolio-starter-kit's. Records risk BS-G and closes BS-F, which the first live build proved. Co-Authored-By: Claude Opus 5.5 --- BOOTSTRAP.md | 6 ++++++ blueprint.yaml | 13 +++++++++++++ docs/phases/README.md | 6 ++++-- repo-blueprint.yaml | 7 ++++++- .../blog-starter/IMPLEMENTATION-STATUS.md | 1 + .../blog-starter/risks-and-open-questions.md | 19 ++++++++++++++++++- testing/manifest.test.sh | 15 +++++++++++++-- 7 files changed, 61 insertions(+), 6 deletions(-) diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index 40b8a3d..bb033eb 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -61,6 +61,12 @@ orun new --blueprint repo-blueprint.yaml \ --set subdomain= ``` +`subdomain` is the workers.dev subdomain of the Cloudflare account you deploy +into (Workers & Pages → your subdomain). A build started from the console, or +with `orun baseline new --from bst_…`, never asks for it: the platform reads +it from the workspace's Cloudflare connection, the same one the deploy token +is minted from. Only a hand-run build like this one passes it. + **`--run-hooks` is the difference between placing files and bootstrapping a site.** Without it `orun new` writes the tree and stops: no repository, no landing, no convergence watch, no probe. That is deliberate — it is what diff --git a/blueprint.yaml b/blueprint.yaml index af45acc..d685916 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -88,6 +88,19 @@ spec: pattern: "^[a-z0-9][a-z0-9-]{0,62}$" help: The workers.dev subdomain of the Cloudflare account the site deploys into. example: acme + # READ FROM THE CLOUDFLARE CONNECTION, not asked. The subdomain belongs + # to the account the same way its id does, and there is exactly one + # right answer — a typed one could only be wrong, and wrong showed up + # after deploy: two console builds carried `b` and `v`, and their smoke + # checks tested addresses nothing answers on, while the site was live. + # The integration reads it from Cloudflare at connect and on its hourly + # health check; the bootstrap door fills this input from the connection + # the build is BOUND to, the same one CLOUDFLARE_ACCOUNT_ID and the + # deploy token mint from, so all three name one account. The console + # renders no field for it, and an account with no workers.dev subdomain + # refuses the build at the door, naming the fix, before anything is + # created. + from: connection.cloudflare.workersSubdomain # ── PREVIEW ONLY. repo-blueprint.yaml's `orun.integrations/reconcile@v1` # hook mints these, brokered, during 02-site. ────────────────────────────── diff --git a/docs/phases/README.md b/docs/phases/README.md index e17753c..ee36036 100644 --- a/docs/phases/README.md +++ b/docs/phases/README.md @@ -59,8 +59,10 @@ tree. But the blueprint's **required** inputs — `reponame`, `productname`, must be supplied on every invocation, single-phase ones included. A `--values` file is easier than repeating `--set`. -- `subdomain` — the workers.dev subdomain of the Cloudflare account. It is - in every URL the phases probe and in the origin the site is built with. +- `subdomain` — the workers.dev subdomain of the Cloudflare account you + deploy into. It is in every URL the phases probe and in the origin the + site is built with. A console or `--from bst_…` build reads it from the + Cloudflare connection; pass it only for a hand-run build. - `orunWorkspace` — workspace id (`ws_…`). Unset, it is the workspace the build runs in (`from: workspace`); with none anywhere, a placeholder that fails loudly rather than silently claiming another tenant's workspace. diff --git a/repo-blueprint.yaml b/repo-blueprint.yaml index c43eff4..fd531a8 100644 --- a/repo-blueprint.yaml +++ b/repo-blueprint.yaml @@ -50,7 +50,12 @@ inputs: subdomain: type: string default: "your-workers-subdomain" - description: The workers.dev subdomain of the Cloudflare account the site deploys into — its URLs, its build origin, the probes. + description: >- + The workers.dev subdomain of the Cloudflare account the site deploys + into — its URLs, its build origin, the probes. A console or + `--from bst_…` build gets it from the workspace's Cloudflare connection + (blueprint.yaml declares `from: connection.cloudflare.workersSubdomain`); + pass it with --set only for a hand-run build. repoPrivate: type: boolean default: true diff --git a/specs/epics/blog-starter/IMPLEMENTATION-STATUS.md b/specs/epics/blog-starter/IMPLEMENTATION-STATUS.md index 7d2e64c..2b04ec6 100644 --- a/specs/epics/blog-starter/IMPLEMENTATION-STATUS.md +++ b/specs/epics/blog-starter/IMPLEMENTATION-STATUS.md @@ -9,6 +9,7 @@ the code departed from `design.md` or from the upstream template. | BS1 — the blog on Workers | ✅ Shipped | [#2](https://github.com/sourceplane/blog-starter/pull/2) | | BS2 — ready to instantiate | ✅ Shipped | [#3](https://github.com/sourceplane/blog-starter/pull/3) | | BS3 — a baseline | 🟡 In review | this PR | +| The subdomain from the connection (risk BS-G) | 🟡 In review | this PR | ## Departures from the upstream template diff --git a/specs/epics/blog-starter/risks-and-open-questions.md b/specs/epics/blog-starter/risks-and-open-questions.md index 246edec..928813a 100644 --- a/specs/epics/blog-starter/risks-and-open-questions.md +++ b/specs/epics/blog-starter/risks-and-open-questions.md @@ -35,7 +35,7 @@ prerender. The theme switcher now also checks `typeof localStorage.getItem === "function"`. CI builds on Node 22, where the global is absent; the extra check keeps a local build on a newer Node green. -## BS-F — Not yet proven live (OPEN) +## BS-F — Not yet proven live (RESOLVED 2026-11-05) BS3 is proven offline: the contract tests, the leak gate, the offline bootstrap and the end-to-end tier (built, dry-deployed, served under @@ -46,3 +46,20 @@ row stays `unlisted` until one has run end to end, and `expectedMinutes` is the card's estimate until then. portfolio-starter-kit's first live bootstrap found two failures its offline tiers missed (its risks PK-J and PK-K); both fixes are carried here, and the tests that now reproduce them came with them. + +Proven 2026-11-05: `vijayakrishnans/hired-in-the-ai-era` was built from +`baseline-v3` with the CLI and went live on stage and prod, and the registry +row went public on that evidence. The first builds from the console then found +BS-G. + +## BS-G — A typed workers.dev subdomain fails after deploy (RESOLVED) + +The card asked for the subdomain in a form. There is one right answer, the +account's own, and a wrong one is only found when the smoke check tests an +address nothing answers on: two console builds on 2026-11-05 carried `b` and +`v` while their sites were live at the real address. Those values were first +keystrokes, because the hand-off's auto-start fired as soon as the box matched +its pattern (fixed in the console, sourceplane/orun-cloud). The card now reads +the value from the Cloudflare connection, as portfolio-starter-kit's does, so +there is no box to get wrong. The CLI build that proved BS-F passed the right +value by hand, which is why it did not find this. diff --git a/testing/manifest.test.sh b/testing/manifest.test.sh index 1982abe..a834d4d 100755 --- a/testing/manifest.test.sh +++ b/testing/manifest.test.sh @@ -220,9 +220,20 @@ for path in manifests: # field for it (saas-bootstrap-console BC-K5). Two ways to get it # wrong, and the platform refuses both — check them here too, so the # mistake is caught in this repo rather than at a live bootstrap. + # + # A `connection..` source is read from the connection + # the build is bound to, so the provider must be one the manifest + # requires — the platform's parser refuses it otherwise. + sources_known = ("repo.name", "repo.owner", "repo.fullName", + "connection.cloudflare.workersSubdomain") src = field.get("from") - if src is not None and src not in ("repo.name", "repo.owner", "repo.fullName"): - B(f"inputs[{key}].from is {src!r} — must be repo.name, repo.owner or repo.fullName") + if src is not None and src not in sources_known: + B(f"inputs[{key}].from is {src!r} — must be one of {', '.join(sources_known)}") + if isinstance(src, str) and src.startswith("connection."): + provider = src.split(".")[1] + if provider not in ((spec.get("requires") or {}).get("integrations") or []): + B(f"inputs[{key}].from is {src!r} but spec.requires.integrations " + f"does not list {provider} — there is no connection to read it from") # ── secrets: BOTH or NEITHER, checked both ways ─────────────────────── declared = {s.get("key"): (s.get("provider"), s.get("template")) for s in (spec.get("secrets") or [])}