diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index ffa2fe9..ebe52ff 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -57,6 +57,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/ai/context/current.md b/ai/context/current.md index 83d95c6..6a69cd9 100644 --- a/ai/context/current.md +++ b/ai/context/current.md @@ -18,9 +18,9 @@ what went live (`03-docs`). | | | |---|---| -| Latest tag | `baseline-v1` (ND3: three phases, `01-scaffold`, `02-site`, `03-docs`) | -| On `main` since | ND4 — one landing ([#5](https://github.com/sourceplane/nextra-docs/pull/5), ND-5); ND5 — the cirrus standard (no kiox, generated component docs, this context pack) | -| Proven live | `baseline-v1`: yes — a console bootstrap went live on stage and prod on 2026-10-15 (`nextra-live`, `bst_PW76WBTK`, 8m15s). `main`'s one-landing shape: no — proven offline in Baseline CI only, and no tag carries it yet (risk ND-I) | +| Latest tag | `baseline-v2` — ND4, one landing ([#5](https://github.com/sourceplane/nextra-docs/pull/5), ND-5; the first tag of that shape), and ND5, the cirrus standard (no kiox, generated component docs, this context pack, and the workers.dev subdomain read from the Cloudflare connection instead of asked) | +| Before it | `baseline-v1` (ND3: three phases, `01-scaffold`, `02-site`, `03-docs`) | +| Proven live | `baseline-v1`: yes — a console bootstrap went live on stage and prod on 2026-10-15 (`nextra-live`, `bst_PW76WBTK`, 8m15s). `baseline-v2`'s one-landing shape: no — proven offline in Baseline CI only (risk ND-I) | ## Where to read @@ -34,7 +34,6 @@ what went live (`03-docs`). ## Next -1. Cut the next `baseline-vN` with `tag.yml`, so a tag carries ND4 and ND5. -2. Bootstrap one site from it from the console, and record its timings - against the 6-minute estimate and baseline-v1's 8m15s (closes ND-I and - ND4's last exit criterion). +1. Bootstrap one site from `baseline-v2` from the console, and record its + timings against the 6-minute estimate and baseline-v1's 8m15s (closes + ND-I and ND4's last exit criterion). diff --git a/ai/context/decisions.md b/ai/context/decisions.md index d2387d4..cd400d2 100644 --- a/ai/context/decisions.md +++ b/ai/context/decisions.md @@ -18,3 +18,4 @@ reads in order. | 10 | stack-tectonic 0.19.0, not 0.20.0 | 0.20.0's lane-shared install is refused by Turbopack | risk ND-K | | 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 (ND5) | | 12 | Component docs are generated from the manifests and checked in CI | A hand-written copy of the component's facts drifts silently | `tooling/catalog/gen-component-docs.py` | +| 13 | The workers.dev subdomain is read from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`), not asked; only a hand-run build passes `--set subdomain` | 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 in the build origin and the probes (cirrus-baseline since baseline-v23) | IMPLEMENTATION-STATUS (ND-7) | diff --git a/ai/context/open-risks.md b/ai/context/open-risks.md index 0dc53d6..bc0d101 100644 --- a/ai/context/open-risks.md +++ b/ai/context/open-risks.md @@ -7,7 +7,7 @@ what is still live, so it should be short. | ID | Risk | State | What closes it | |---|---|---|---| -| ND-I | The one-landing shape on `main` (ND4) is not yet proven live; `baseline-v1`'s three phases were (2026-10-15, 8m15s) | OPEN | One console bootstrap from the next tag | +| ND-I | The one-landing shape (ND4, first tagged `baseline-v2`) is not yet proven live; `baseline-v1`'s three phases were (2026-10-15, 8m15s) | OPEN | One console bootstrap from `baseline-v2` | | ND-B | OpenNext and Next.js version drift: Next is pinned at 16.3.8 because 16.4.x fails at worker boot on `@opennextjs/cloudflare` 1.20.11 | Mitigated (watch) | An adapter release that admits the next Next, taken in a deliberate PR that re-runs the build and the preview | Accepted, and worth knowing before you change them: ND-G (no "Last updated" diff --git a/blueprint.yaml b/blueprint.yaml index cb4dd4a..2ff4cee 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -89,6 +89,18 @@ 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, in the site's build origin, 01-product's probes and the + # verify URL below. 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` # hooks mint these, brokered, during 01-product. ────────────────────────── diff --git a/docs/phases/README.md b/docs/phases/README.md index 724b6c0..cf09b1d 100644 --- a/docs/phases/README.md +++ b/docs/phases/README.md @@ -54,9 +54,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 site's `intent.yaml` environment - URLs. +- `subdomain` — the workers.dev subdomain of the Cloudflare account you + deploy into. It is in every URL the phases probe and in the site's + `intent.yaml` environment URLs. 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 da67858..0c45ab0 100644 --- a/repo-blueprint.yaml +++ b/repo-blueprint.yaml @@ -51,7 +51,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/README.md b/specs/epics/README.md index 0eab7f7..495c6c3 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 | |------|---------|--------|------------| -| [`nextra-docs/`](./nextra-docs/) | **ND** | ✅ Shipped (`baseline-v1`, live 2026-10-15); ND4–ND5 on `main`, untagged | Vercel's Nextra Docs Starter Kit, equivalent in content and function, running on Cloudflare Workers + Static Assets via OpenNext — and an Orun baseline that instantiates it (ND3) | +| [`nextra-docs/`](./nextra-docs/) | **ND** | ✅ Shipped (`baseline-v1`, live 2026-10-15); ND4–ND5 tagged `baseline-v2`, the one-landing shape, not yet proven live | Vercel's Nextra Docs Starter Kit, equivalent in content and function, running on Cloudflare Workers + Static Assets via OpenNext — and an Orun baseline that instantiates it (ND3) | As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`. diff --git a/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md b/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md index 8157a27..66bdcb8 100644 --- a/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md +++ b/specs/epics/nextra-docs/IMPLEMENTATION-STATUS.md @@ -9,8 +9,8 @@ the code departed from `design.md` or from the upstream template. | ND1 — the docs on Workers | ✅ Shipped | [#2](https://github.com/sourceplane/nextra-docs/pull/2) | | ND2 — ready to instantiate | ✅ Shipped | [#3](https://github.com/sourceplane/nextra-docs/pull/3) | | ND3 — a baseline | ✅ Shipped | [#4](https://github.com/sourceplane/nextra-docs/pull/4) (ND-4), tagged `baseline-v1`; a console bootstrap of it went live on 2026-10-15 (below) | -| ND4 — one landing | ✅ Shipped | [#5](https://github.com/sourceplane/nextra-docs/pull/5) (ND-5) — on `main`, not yet tagged; not yet proven live (risk ND-I) | -| ND5 — the cirrus standard | ✅ Shipped | ND-6 — on `main` after ND4, not yet tagged | +| ND4 — one landing | ✅ Shipped | [#5](https://github.com/sourceplane/nextra-docs/pull/5) (ND-5), tagged `baseline-v2` — the first tag of the one-landing shape; not yet proven live (risk ND-I) | +| ND5 — the cirrus standard | ✅ Shipped | [#6](https://github.com/sourceplane/nextra-docs/pull/6) (ND-6), [#7](https://github.com/sourceplane/nextra-docs/pull/7) (ND-7), tagged `baseline-v2` | ## Departures from the upstream template @@ -138,6 +138,49 @@ Nothing about the site changed. What changed is the baseline around it: | context pack | `operations.md`, `deployment.md` | plus `current.md`, `decisions.md`, `open-risks.md` | cirrus-baseline's shape; the three new pages are this repository's own and no module places them (the leak gate still allows exactly two) | | status | ND4 "in progress / this PR"; ND-I "no live bootstrap yet", citing the removed `02-site` | ND4 shipped, untagged; ND-I: `baseline-v1` went live (2026-10-15), the one-landing shape is not yet proven live — still OPEN | the merge and the live run had happened; the documents had not caught up | +### The subdomain from the Cloudflare connection (ND-7) + +The card's `subdomain` input was typed by hand, though it belongs to the +Cloudflare account the same way its id does and has exactly one right +answer; a wrong value surfaced only after deploy, in the site's build origin +and `01-product`'s probes. It now declares `from: +connection.cloudflare.workersSubdomain`, as cirrus-baseline's card does since +baseline-v23: the Cloudflare integration reads the subdomain at connect and on +its hourly health check, the bootstrap door fills the input from the +connection the build is bound to (the one `CLOUDFLARE_ACCOUNT_ID` and the +deploy token come from), the console renders no field for it, and an account +with no workers.dev subdomain is refused at the door. Nothing a site runs +changes. + +- `blueprint.yaml`: the `from:` source and the reason, at the input; key, + label, pattern, help and example unchanged. +- `testing/manifest.test.sh`: cirrus-baseline's rule, byte for byte — the + source is accepted, and a `connection..…` source whose provider + `spec.requires.integrations` does not list fails (the card lists + `cloudflare`). +- `repo-blueprint.yaml`, `BOOTSTRAP.md`, `docs/phases/README.md`: a console or + `--from bst_…` build reads it from the connection; only a hand-run build + passes `--set subdomain`. The default is unchanged. + +`baseline-v2` carries this, ND5 and ND4: it is the first tag of the +one-landing shape, so the first console bootstrap from it is also the one +that closes ND-I. + +Verified: + +- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh` + green; `gen-component-docs.py --check` green (2 components). +- Mutation: `cloudflare` removed from `spec.requires.integrations` → + `manifest.test.sh` fails with exactly one finding, `inputs[subdomain].from + is 'connection.cloudflare.workersSubdomain' but spec.requires.integrations + does not list cloudflare`; restored, green. +- `orun new --status` (v2.58.11): `01-product` pending (61 files), `03-docs` + hook-only. `testing/leak.test.sh` (v2.58.11): 61 files derived; ai/context + still exactly the two declared pages. +- `testing/placement.test.sh` (v2.58.11, as Baseline CI runs it): 61 files + placed, both landings, `--resume` changes nothing. +- `orun task check ND-7` complete. + ## Verified (ND5) - `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh` diff --git a/specs/epics/nextra-docs/README.md b/specs/epics/nextra-docs/README.md index 6f86035..aebcc3e 100644 --- a/specs/epics/nextra-docs/README.md +++ b/specs/epics/nextra-docs/README.md @@ -8,7 +8,7 @@ The upstream content stays the content. What changes is the framework underneath | Field | Value | |-------|-------| -| Status | ✅ ND0–ND3 shipped (#1–#4), tagged `baseline-v1`, which went live from the console on 2026-10-15 (8m15s); ND4 — one landing (#5, ND-5) — and ND5 — the cirrus standard (ND-6) — on `main`, not yet tagged, the one-landing shape not yet proven live (risk ND-I) | +| Status | ✅ ND0–ND3 shipped (#1–#4), tagged `baseline-v1`, which went live from the console on 2026-10-15 (8m15s); ND4 — one landing (#5, ND-5) — and ND5 — the cirrus standard (#6, ND-6; the subdomain read from the Cloudflare connection, #7, ND-7) — tagged `baseline-v2`, the first tag of the one-landing shape, not yet proven live (risk ND-I) | | Cluster | **ND** (ND0–ND5) | | Owner(s) | `apps/web` (the site) · `tests/web` (the content-layout and site-identity tests) | | Builds on | `cirrus-baseline` conventions (intent, components, `checks.yml` gate, gated `ci.yml`) — no bounded context of the fleet is needed | @@ -16,7 +16,7 @@ The upstream content stays the content. What changes is the framework underneath | Changes | Nextra 2 → Nextra 4 (file by file in `design.md`), plus the Workers build, the monorepo wrapper, tests and the deploy contract; the page text, the sidebar order, the theme settings and the counter component are preserved | | Decisions locked | (1) OpenNext on Workers + Static Assets, not Pages. (2) Nextra 4 on Next 16.3.8, not Nextra 2 on an old Next without OpenNext. (3) Every page is pre-rendered; `dynamicParams = false`. (4) Search is Pagefind, indexed between `next build` and the OpenNext bundle so it ships as static assets. (5) No infra root: the site binds nothing. | | Gate | ND1 is the first user-visible rung (the site serves from a Worker). | -| Shipped as | `baseline-v1` ([#4](https://github.com/sourceplane/nextra-docs/pull/4), three phases; live 2026-10-15), then ND4 ([#5](https://github.com/sourceplane/nextra-docs/pull/5)) and ND5 on `main`; the one-landing shape proven offline (Baseline CI), not yet live | +| Shipped as | `baseline-v1` ([#4](https://github.com/sourceplane/nextra-docs/pull/4), three phases; live 2026-10-15), then `baseline-v2` (ND4: [#5](https://github.com/sourceplane/nextra-docs/pull/5); ND5: [#6](https://github.com/sourceplane/nextra-docs/pull/6), [#7](https://github.com/sourceplane/nextra-docs/pull/7)); the one-landing shape proven offline (Baseline CI), not yet live | ## Read order @@ -34,4 +34,4 @@ The upstream content stays the content. What changes is the framework underneath | ND2 — ready to instantiate | README, as-built status | a reader can run, test, preview and deploy it | | ND3 — a baseline | card, build document, rename, bootstrap tooling, tests | a new docs site goes from nothing to live in three phases; Baseline CI green | | ND4 — one landing | the site in one landing, each bootstrap landing checked by `plan` alone (cirrus-baseline baseline-v22's shape) | a site bootstrapped from the next tag is live faster than baseline-v1's 8m15s | -| ND5 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags and the live record | Baseline CI green with the docs check | +| ND5 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags and the live record; the subdomain read from the Cloudflare connection | Baseline CI green with the docs check; the card asks for no subdomain | diff --git a/specs/epics/nextra-docs/epic.yaml b/specs/epics/nextra-docs/epic.yaml index 9266646..11219b3 100644 --- a/specs/epics/nextra-docs/epic.yaml +++ b/specs/epics/nextra-docs/epic.yaml @@ -44,4 +44,5 @@ spec: - "every component carries generated docs/{overview,architecture,runbook}.md, and Baseline CI fails a pull request whose manifests and pages disagree" - "ai/context carries this repository's current.md, decisions.md and open-risks.md, and none of them ships to a site" - "every milestone's status row agrees with the tags" - tasks: [ND-6] + - "the console card reads subdomain from the Cloudflare connection (from: connection.cloudflare.workersSubdomain), as cirrus-baseline since baseline-v23" + tasks: [ND-6, ND-7] diff --git a/specs/epics/nextra-docs/implementation-plan.md b/specs/epics/nextra-docs/implementation-plan.md index 7827fab..0cf5494 100644 --- a/specs/epics/nextra-docs/implementation-plan.md +++ b/specs/epics/nextra-docs/implementation-plan.md @@ -67,7 +67,8 @@ job on `orun/BASE-…` branches); the brokered secrets are minted in offline bootstrap and the e2e tier pass over one landing - Baseline CI is green - a site bootstrapped from the next tag is live faster than baseline-v1's - measured 8m15s — not yet: no tag carries ND4 (risk ND-I) + measured 8m15s — not yet: `baseline-v2` is the first tag that carries ND4, + and no site has been bootstrapped from it (risk ND-I) ## ND5 — the cirrus standard (ND-6) ✅ @@ -85,9 +86,15 @@ site itself changing. - **The context pack.** `ai/context/current.md`, `decisions.md` and `open-risks.md` beside the two pages a site ships with — this repository's own, so no module places them. -- **Status that agrees with the tags and the live record.** ND4 is shipped, - untagged; `baseline-v1` went live on 2026-10-15, so risk ND-I is now about - the one-landing shape. +- **Status that agrees with the tags and the live record.** ND4 is shipped + (untagged until `baseline-v2`); `baseline-v1` went live on 2026-10-15, so + risk ND-I is now about the one-landing shape. +- **The subdomain from the Cloudflare connection (ND-7).** The card's + `subdomain` input declares `from: connection.cloudflare.workersSubdomain`, + as cirrus-baseline's does since baseline-v23: the bootstrap door fills it + from the connection the build is bound to, so the console asks for nothing + a typo could get wrong. `testing/manifest.test.sh` takes cirrus-baseline's + rule, which requires the provider in `spec.requires.integrations`. **Done when** - nothing outside this milestone's own record (its specs, task and context diff --git a/specs/epics/nextra-docs/risks-and-open-questions.md b/specs/epics/nextra-docs/risks-and-open-questions.md index 0464f82..cfc0bec 100644 --- a/specs/epics/nextra-docs/risks-and-open-questions.md +++ b/specs/epics/nextra-docs/risks-and-open-questions.md @@ -80,12 +80,13 @@ is proven offline on every pull request: the card against the build, the blueprint read by the pinned orun, the leak gate, the offline bootstrap with the blueprint's own hooks, the site's own plan for the 01-product merge, and the produced site built in a staged job tree, dry-deployed, served and -smoke-tested. It has not been bootstrapped live, and no tag carries it yet. -Closes with one bootstrap from the next tag, whose timing replaces the -6-minute estimate. +smoke-tested. It has not been bootstrapped live; `baseline-v2` is the first +tag that carries it. Closes with one bootstrap from `baseline-v2`, whose +timing replaces the 6-minute estimate. (Updated in ND5. Until then this entry read "No live bootstrap yet" and -cited the 02-site merge, a phase ND4 removed.) +cited the 02-site merge, a phase ND4 removed. Updated again in ND-7, which +ships in `baseline-v2`: until then it said no tag carried the shape.) ## ND-J — A custom domain is the owner's step (ACCEPTED) diff --git a/tasks/ND-7.TaskContract.yaml b/tasks/ND-7.TaskContract.yaml new file mode 100644 index 0000000..8b1fffb --- /dev/null +++ b/tasks/ND-7.TaskContract.yaml @@ -0,0 +1,25 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: ND-7 + title: "The subdomain from the Cloudflare connection" +spec: + goal: "The console card stops asking for the workers.dev subdomain and reads it from the Cloudflare connection the build is bound to (`from: connection.cloudflare.workersSubdomain`), as cirrus-baseline does since baseline-v23 — the same account CLOUDFLARE_ACCOUNT_ID and the deploy token come from, so a wrong typed value can no longer surface after deploy in the site's build origin and the probes" + affects: + - blueprint.yaml + - repo-blueprint.yaml + - testing/manifest.test.sh + - BOOTSTRAP.md + - docs/phases/README.md + - ai/context/current.md + - ai/context/decisions.md + - ai/context/open-risks.md + - specs/** + - tasks/** + doneWhen: + - "blueprint.yaml's `subdomain` input declares `from: connection.cloudflare.workersSubdomain`, and its comment says why" + - testing/manifest.test.sh accepts that source and fails a card whose `spec.requires.integrations` does not list the provider (mutation-checked) + - repo-blueprint.yaml, BOOTSTRAP.md and docs/phases/README.md say a console or `--from bst_…` build reads it from the connection and only a hand-run build passes `--set subdomain` + - every milestone's status row agrees with the tags, ND4's and ND5's included + gates: + - checks diff --git a/testing/manifest.test.sh b/testing/manifest.test.sh index 3fd6af8..5374cb5 100755 --- a/testing/manifest.test.sh +++ b/testing/manifest.test.sh @@ -217,9 +217,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 [])}