Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ orun new --blueprint repo-blueprint.yaml \
--set subdomain=<workers-dev-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 tokens
mint from. Only a hand-run build like this one passes it.

**`--run-hooks` is the difference between placing files and bootstrapping a
product.** Without it `orun new` writes the tree and stops: no repository, no
landing, no convergence watch, no probe. That is deliberate — it is what
Expand Down
7 changes: 3 additions & 4 deletions ai/context/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ a fresh product is whole on workers.dev before any custom domain.

| | |
|---|---|
| Latest tag | `baseline-v1` (PS4) |
| On `main` since | PS5 — the cirrus standard (no kiox, generated component docs, this context pack) |
| Latest tag | `baseline-v2` (PS5 — the cirrus standard, [#6](https://github.com/sourceplane/platforms-starter-kit/pull/6) and [#7](https://github.com/sourceplane/platforms-starter-kit/pull/7): 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` (PS4) |
| Proven live | No. Everything short of the platform is proven offline in Baseline CI; a live bootstrap from a tag, and tenant subdomains on a real zone, are still to come (risk PS-K) |

## Where to read
Expand All @@ -37,6 +37,5 @@ a fresh product is whole on workers.dev before any custom domain.

## Next

1. Bootstrap one product from the next tag against a workspace, and record
1. Bootstrap one product from `baseline-v2` against a workspace, and record
its timings (closes PS-K); then the registry row can leave `unlisted`.
2. Cut the next `baseline-vN` with `tag.yml` so the registry can pin PS5.
1 change: 1 addition & 0 deletions ai/context/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ reads in order.
| 10 | stack-tectonic 0.19.0, not 0.20.0 | 0.20.0's lane-scoped install is refused by Next 16's Turbopack | IMPLEMENTATION-STATUS (PS4) |
| 11 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox | `kiox.yaml` pinned a version nothing ran | IMPLEMENTATION-STATUS (PS5) |
| 12 | Component docs are generated from the manifests and checked in CI | A hand-written copy of the dependency graph, bindings and published outputs drifts silently | `tooling/catalog/gen-component-docs.py` |
| 13 | The workers.dev `subdomain` is read from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`), never asked | It belongs to the account like its id and has one right answer; a typed one could only be wrong, and showed up after deploy in the smoke and the probes | `blueprint.yaml`, IMPLEMENTATION-STATUS (PS-7) |
13 changes: 13 additions & 0 deletions blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,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 account's
# subdomain, not a tenant's: tenants are `<tenant>.<root>` on the
# product domain, the owner's step.) It 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 deploy's
# smoke, the phase probes and the verify URLs 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 tokens
# mint from, so all three name one account. The console renders no
# field for it. 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. ─────────────────────────
Expand Down
6 changes: 4 additions & 2 deletions docs/phases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ 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.
- `subdomain` — the workers.dev subdomain of the Cloudflare account you
deploy into. It is in every URL the phases probe. 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.
Expand Down
7 changes: 6 additions & 1 deletion repo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ inputs:
subdomain:
type: string
default: "your-workers-subdomain"
description: The workers.dev subdomain of the Cloudflare account the site deploys into — its URLs and the probes.
description: >-
The workers.dev subdomain of the Cloudflare account the site deploys
into — its URLs and 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
Expand Down
2 changes: 1 addition & 1 deletion specs/epics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace.

| Epic | Cluster | Status | What it is |
|------|---------|--------|------------|
| [`platforms-starter-kit/`](./platforms-starter-kit/) | **PS** | ✅ Shipped (`baseline-v1`); live bootstrap pending | Vercel's Platforms Starter Kit, equivalent in code and function, on Cloudflare Workers with tenants in Workers KV — and an Orun baseline that instantiates it in one landing, live on workers.dev before any custom domain (PS4) |
| [`platforms-starter-kit/`](./platforms-starter-kit/) | **PS** | ✅ Shipped (`baseline-v2`); live bootstrap pending | Vercel's Platforms Starter Kit, equivalent in code and function, on Cloudflare Workers with tenants in Workers KV — and an Orun baseline that instantiates it in one landing, live on workers.dev before any custom domain (PS4) |

As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`.
41 changes: 40 additions & 1 deletion specs/epics/platforms-starter-kit/IMPLEMENTATION-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ the code departed from `design.md` or from the upstream template.
| PS2 — the KV namespace from Terraform | ✅ Shipped | [#3](https://github.com/sourceplane/platforms-starter-kit/pull/3) |
| PS3 — ready to instantiate | ✅ Shipped | [#4](https://github.com/sourceplane/platforms-starter-kit/pull/4) |
| PS4 — a baseline, in one landing | ✅ Shipped (offline-proven; no live bootstrap yet, risk PS-K) | [#5](https://github.com/sourceplane/platforms-starter-kit/pull/5) (PS-5), tagged `baseline-v1` |
| PS5 — the cirrus standard | ✅ Shipped | PS-6 — on `main` after `baseline-v1`, not yet tagged |
| PS5 — the cirrus standard | ✅ Shipped | [#6](https://github.com/sourceplane/platforms-starter-kit/pull/6) (PS-6), [#7](https://github.com/sourceplane/platforms-starter-kit/pull/7) (PS-7), tagged `baseline-v2` |

## Departures from the upstream template

Expand Down Expand Up @@ -152,6 +152,45 @@ Nothing about the product 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 | PS4 "this PR (PS-5), to be tagged `baseline-v1`"; the epic README's "Shipped as" at #4 | PS4 shipped and tagged `baseline-v1` | the tag existed; the documents had not caught up |

### The subdomain from the Cloudflare connection (PS-7)

`subdomain` — the account's workers.dev subdomain, not a tenant's — was the
one input an operator typed that the platform could answer itself: it belongs
to the Cloudflare account the same way its id does, and it has exactly one
right answer. A typed one could only be wrong, and wrong showed up after
deploy — in the deploy's smoke (its `DEPLOYED_URL`), the phase probes and the
console's verify URLs. `blueprint.yaml` now declares
`from: connection.cloudflare.workersSubdomain`, as cirrus-baseline does since
baseline-v23: the Cloudflare integration reads the subdomain at connect and on
its hourly health check, and the bootstrap door fills the input from the
connection the build is bound to — the same one `CLOUDFLARE_ACCOUNT_ID` and the
deploy tokens mint from. The console renders no field for it, and an account
with no workers.dev subdomain is refused at the door with the fix named.

- `testing/manifest.test.sh` takes cirrus-baseline's rule verbatim: the source
is accepted, and only when `spec.requires.integrations` lists its provider.
- `repo-blueprint.yaml` keeps the input and its default; it, `BOOTSTRAP.md`
and `docs/phases/README.md` say only a hand-run build passes
`--set subdomain`.
- Nothing a product carries changes: the rename writes the value where it
always did (`workersDevSubdomain`, the URLs), and the probes read it as
before.

Verified:

- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh`
green; `gen-component-docs.py --check` green (3 components).
- Mutation: with `cloudflare` dropped from `spec.requires.integrations`,
`manifest.test.sh` fails with exactly one finding, naming
`inputs[subdomain]`; restored, it passes.
- `orun new --status` (v2.58.11): `01-product` pending, 91 files.
`testing/leak.test.sh` (v2.58.11): 91 files derived; 85 shipped sources name
no factory path. `testing/placement.test.sh` (v2.78.4, as `baseline.yml`
runs it): 91 tracked files, both landings; the product's own plan applies
`cloudflare-kv` (level 0) before it deploys `web` (level 1) on stage and
prod; the 02-docs merge plans 0 jobs; `--resume` changes nothing.
- `orun task check PS-7` complete.

## Verified (PS5)

- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh`
Expand Down
6 changes: 3 additions & 3 deletions specs/epics/platforms-starter-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ The upstream code stays the code: the proxy, the pages, the server actions, `lib

| Field | Value |
|-------|-------|
| Status | ✅ PS0–PS4 shipped (#1–#5), PS4 tagged `baseline-v1`; PS5 (the cirrus standard, PS-6) on `main`, not yet tagged. The KV apply and a live deploy are not yet proven by a live bootstrap (risk PS-K) |
| Status | ✅ PS0–PS4 shipped (#1–#5), PS4 tagged `baseline-v1`; PS5 (the cirrus standard, PS-6 #6 and PS-7 #7) tagged `baseline-v2`. The KV apply and a live deploy are not yet proven by a live bootstrap (risk PS-K) |
| Cluster | **PS** (PS0–PS5) |
| Owner(s) | `apps/web` (the app) · `tests/web` (adapter and proxy tests) · `infra/terraform/cloudflare-kv` (the namespace) |
| Builds on | `cirrus-baseline` conventions — the `cloudflare-kv` Terraform root and the `@@wiring(...)@@` per-environment render; intent, components, `checks.yml` gate, gated `ci.yml` |
| Upstream | [vercel/platforms](https://github.com/vercel/platforms) |
| Changes | Adds the Workers build, the monorepo wrapper, `lib/redis.ts` over KV, tests, the KV root and the deploy contract; swaps Vercel Speed Insights for the Cloudflare Web Analytics beacon; makes `/admin` explicitly dynamic |
| Decisions locked | (1) OpenNext on Workers + Static Assets. (2) Workers KV, not a Durable Object per tenant: the template's store is a key-value map with a prefix scan, and that is what KV is. (3) The adapter keeps the Upstash surface; the app's data access is untouched. (4) `wrangler.jsonc` is rendered per environment from the wiring document — and, since PS4, committed as the fixture render, because the deploy lane checks it exists before the build (risk PS-I). (5) The root domain is one knob — the environment's `BASE_DOMAIN` in `intent.yaml`, inlined by `next build`. (6) PS4: one landing — the plan, not a landing boundary, orders the namespace before the Worker. (7) PS4: off the root domain a tenant is a path on the request's host (`/s/<tenant>`), so a fresh deploy works on workers.dev; subdomains are the owner's custom-domain step. |
| Gate | PS1 is the first user-visible rung. PS2 needs a workspace with a Cloudflare connection to apply; it is verified by `terraform validate` and `plan`. |
| Shipped as | `baseline-v1` ([#5](https://github.com/sourceplane/platforms-starter-kit/pull/5)), then PS5 on `main`; proven offline (Baseline CI: the produced product built, served by `wrangler dev` with a local KV, and used), `terraform validate` on the root, deploy gated until a workspace is linked |
| Shipped as | `baseline-v1` ([#5](https://github.com/sourceplane/platforms-starter-kit/pull/5)), then `baseline-v2` (PS5: [#6](https://github.com/sourceplane/platforms-starter-kit/pull/6), [#7](https://github.com/sourceplane/platforms-starter-kit/pull/7)); proven offline (Baseline CI: the produced product built, served by `wrangler dev` with a local KV, and used), `terraform validate` on the root, deploy gated until a workspace is linked |

## Read order

Expand All @@ -34,4 +34,4 @@ The upstream code stays the code: the proxy, the pages, the server actions, `lib
| PS2 — the KV namespace from Terraform | `infra/terraform/cloudflare-kv`, the app's `dependsOn` and `secretEnv` | the root validates; the wiring keys match the template's tokens |
| PS3 — ready to instantiate | README, as-built status | a reader can run, test, preview and deploy it, and knows what the wildcard domain needs |
| PS4 — a baseline, in one landing | card, build document, rename, bootstrap tooling, the workers.dev path fallback, tests | a new product goes from nothing to live in one landing, the KV namespace applied before the Worker, tenants created and served on workers.dev; Baseline CI green |
| PS5 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags | Baseline CI green with the docs check |
| PS5 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags; the workers.dev subdomain read from the Cloudflare connection | Baseline CI green with the docs check; the card asks for no workers.dev subdomain |
3 changes: 2 additions & 1 deletion specs/epics/platforms-starter-kit/epic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,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 product"
- "every milestone's status row agrees with the tags"
tasks: [PS-6]
- "the console card reads subdomain from the Cloudflare connection (from: connection.cloudflare.workersSubdomain), as cirrus-baseline since baseline-v23"
tasks: [PS-6, PS-7]
5 changes: 5 additions & 0 deletions specs/epics/platforms-starter-kit/implementation-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ product itself changing.
repository's own, so no module places them.
- **Status that agrees with the tags.** PS4 is shipped and tagged
`baseline-v1`.
- **The subdomain from the Cloudflare connection (PS-7).** The card declares
the workers.dev `subdomain` as `from: connection.cloudflare.workersSubdomain`,
as cirrus-baseline does since baseline-v23, so the console asks for nothing
the connection already knows; `testing/manifest.test.sh` requires the
source's provider in `spec.requires.integrations`.

**Done when**
- nothing outside this milestone's own record names kiox (`git grep -i
Expand Down
25 changes: 25 additions & 0 deletions tasks/PS-7.TaskContract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: orun.io/v1
kind: TaskContract
metadata:
name: PS-7
title: "The subdomain from the Cloudflare connection"
spec:
goal: "The console card reads the workers.dev subdomain from the workspace's Cloudflare connection (`from: connection.cloudflare.workersSubdomain`) instead of asking for it, as cirrus-baseline does since baseline-v23, and the manifest gate holds that source to a connection the card requires"
affects:
- blueprint.yaml
- repo-blueprint.yaml
- testing/manifest.test.sh
- BOOTSTRAP.md
- docs/phases/README.md
- ai/context/current.md
- ai/context/decisions.md
- specs/epics/README.md
- specs/epics/platforms-starter-kit/**
- tasks/PS-7.TaskContract.yaml
doneWhen:
- "blueprint.yaml declares `from: connection.cloudflare.workersSubdomain` on `subdomain`, so the console renders no field for it"
- testing/manifest.test.sh accepts that source only when spec.requires.integrations lists its provider, and fails naming the input when it does not (mutation-checked)
- BOOTSTRAP.md, docs/phases and repo-blueprint.yaml say only a hand-run build passes `--set subdomain`
- the contract tests, the docs check, the leak gate and the offline bootstrap are green
gates:
- checks
15 changes: 13 additions & 2 deletions testing/manifest.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.<provider>.<fact>` 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 [])}
Expand Down
Loading