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 @@ -62,6 +62,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
6 changes: 2 additions & 4 deletions ai/context/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ went live (`02-docs`).

| | |
|---|---|
| Latest tag | `baseline-v1` (CR4, [#5](https://github.com/sourceplane/cron-starter/pull/5)) |
| On `main` since | CR5 — the cirrus standard (no kiox, generated component docs, this context pack) |
| Latest tag | `baseline-v2` (CR5 — the cirrus standard, [#6](https://github.com/sourceplane/cron-starter/pull/6) and [#7](https://github.com/sourceplane/cron-starter/pull/7): no kiox, generated component docs, this context pack, and the console card reading `subdomain` from the Cloudflare connection); `baseline-v1` is CR4 ([#5](https://github.com/sourceplane/cron-starter/pull/5)) |
| Proven live | No. Everything short of the platform is proven offline in Baseline CI, the trigger fired by hand at crafted times; the token minted, a real KV apply, a real deploy registering its trigger and the trigger firing on Cloudflare's clock are still to come (risk CR-K) |

## Where to read
Expand All @@ -37,7 +36,6 @@ went live (`02-docs`).

## 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, including how long the first trigger took to fire (closes
CR-K).
2. Cut the next `baseline-vN` with `tag.yml` so the registry can pin CR5.
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 | `ci.yml` plans nothing while `intent.yaml` names `ws_CHANGE_ME`; `checks.yml` runs on pull requests only | A bootstrap cannot set a repository variable (replaced the `ORUN_CI` gate); the convergence watch takes the newest run on the merge sha from any workflow | IMPLEMENTATION-STATUS (CR4) |
| 11 | 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 (CR4), `intent.yaml` |
| 12 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox. Component docs are generated from the manifests and checked in CI | `kiox.yaml` pinned a version nothing ran; a hand-written copy of the dependency graph and bindings drifts silently | IMPLEMENTATION-STATUS (CR5), `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 (CR-7) |
12 changes: 12 additions & 0 deletions blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,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 smoke checks 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, 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. ─────────────────────────
Expand Down
6 changes: 4 additions & 2 deletions docs/phases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,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
8 changes: 7 additions & 1 deletion repo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ 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 |
|------|---------|--------|------------|
| [`cron-starter/`](./cron-starter/) | **CR** | ✅ Shipped (`baseline-v1`); live bootstrap pending | Vercel's Cron Jobs example, equivalent in code and function, on Cloudflare Workers with Cron Triggers driving the same API routes and Workers KV holding the timestamps — and an Orun baseline that instantiates it in one landing (CR4) |
| [`cron-starter/`](./cron-starter/) | **CR** | ✅ Shipped (`baseline-v2`); live bootstrap pending | Vercel's Cron Jobs example, equivalent in code and function, on Cloudflare Workers with Cron Triggers driving the same API routes and Workers KV holding the timestamps — and an Orun baseline that instantiates it in one landing (CR4) |

As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`.
36 changes: 35 additions & 1 deletion specs/epics/cron-starter/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.
| CR2 — the KV namespace from Terraform | ✅ Shipped (validated; apply gated on a linked workspace) | [#3](https://github.com/sourceplane/cron-starter/pull/3) |
| CR3 — ready to instantiate | ✅ Shipped | [#4](https://github.com/sourceplane/cron-starter/pull/4) |
| CR4 — a baseline, in one landing | ✅ Shipped (offline-proven; no live bootstrap yet, risk CR-K) | [#5](https://github.com/sourceplane/cron-starter/pull/5) (CR-5), tagged `baseline-v1` |
| CR5 — the cirrus standard | ✅ Shipped | CR-6 — on `main` after `baseline-v1`, not yet tagged |
| CR5 — the cirrus standard | ✅ Shipped | [#6](https://github.com/sourceplane/cron-starter/pull/6) (CR-6), [#7](https://github.com/sourceplane/cron-starter/pull/7) (CR-7), tagged `baseline-v2` |

## Departures from the upstream template

Expand Down Expand Up @@ -172,6 +172,40 @@ Nothing about the app 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 | CR4 "this PR, to be tagged"; the epic README's summary and "Vercel Cron → Cron Triggers" above still describing seven triggers and `intervalFor`; "Versions" calling `apps/web/README.md` upstream's | CR4 shipped ([#5](https://github.com/sourceplane/cron-starter/pull/5)) and tagged `baseline-v1`; one `* * * * *` trigger dispatching the seven schedules, as built; the README the app's | the documents had not caught up with the tag and with CR4 |

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

The console 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 smoke checks and the
verify URLs. `blueprint.yaml` now declares
`from: connection.cloudflare.workersSubdomain`, as cirrus-baseline does since
`baseline-v23`: the Cloudflare integration reads the subdomain from the
account 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, naming the fix.

- `testing/manifest.test.sh` takes cirrus-baseline's check: a
`connection.<provider>.<fact>` source is accepted, and only when the card's
`spec.requires.integrations` lists the provider (this card lists
`[github, cloudflare]`).
- `repo-blueprint.yaml` keeps the input and its default; its description,
`BOOTSTRAP.md` and `docs/phases/README.md` say a hand-run `orun new` still
passes `--set subdomain`.
- Nothing a product runs changed: no app, Terraform, test or tooling file.

Verified: `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh`
green; `gen-component-docs.py --check` green (3 components); at v2.58.11,
`orun new --status` on `repo-blueprint.yaml` (`01-product` 79 files) and
`testing/leak.test.sh` (79 files derived; 72 shipped sources name no factory
path); at v2.78.4, `testing/placement.test.sh` (79 tracked files;
cloudflare-kv → web; `--resume` changes nothing); `orun task check CR-7`
complete. Mutation check: with `cloudflare` removed from
`spec.requires.integrations`, `manifest.test.sh` fails with the one finding
`inputs[subdomain].from is 'connection.cloudflare.workersSubdomain' but
spec.requires.integrations does not list cloudflare`; restored, it passes.

## Verified (CR5)

- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh`
Expand Down
6 changes: 3 additions & 3 deletions specs/epics/cron-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ The port keeps the template's pages, API routes, component, styles and `@vercel/

| Field | Value |
|-------|-------|
| Status | ✅ Shipped — CR0–CR4 landed (#1–#5), tagged `baseline-v1`; CR5 (the cirrus standard, CR-6) on `main`, not yet tagged. KV apply, live deploy and the trigger on Cloudflare's clock proven only by a live bootstrap (risk CR-K) |
| Status | ✅ Shipped — CR0–CR5 landed (#1–#7; CR4 tagged `baseline-v1`, CR5 — the cirrus standard, CR-6 and CR-7 — tagged `baseline-v2`). KV apply, live deploy and the trigger on Cloudflare's clock proven only by a live bootstrap (risk CR-K) |
| Cluster | **CR** (CR0–CR5) |
| Owner(s) | `apps/web` (the page, the routes, the worker entry) · `tests/web` · `infra/terraform/cloudflare-kv` |
| Builds on | `cirrus-baseline` conventions: the `cloudflare-kv` root and the `@@wiring(...)@@` deploy-time render; `kv-redis-starter`'s shape for a KV-bound Next app |
| Upstream | [vercel/examples `solutions/cron`](https://github.com/vercel/examples/tree/main/solutions/cron) |
| Changes | What runs the routes on schedule (Vercel Cron → Cron Triggers through a custom worker entry), where they write (Vercel KV → Workers KV behind `lib/kv.ts`), analytics (beacon), the Workers build, tests, the KV root and the deploy contract; page copy says Cron Triggers and Workers KV |
| Decisions locked | (1) One Worker: the triggers sit on the Next Worker and the scheduled handler calls the OpenNext fetch handler in-process with a synthetic request — not a second Worker calling the routes over HTTP. (2) The routes stay as written: `lib/kv.ts` mirrors `kv.set`/`kv.get` (JSON values, `"OK"` from `set`). (3) `wrangler.jsonc` is rendered per environment from the wiring document — and, since CR4, committed as the fixture render, because the deploy lane checks it exists before the build (risk CR-H). (4) The seven schedules are the template's, verbatim, in `lib/crons.ts` (and, until CR4, in `triggers.crons`); a test holds the trigger and the template together. (5) CR4: one landing — the plan, not a landing boundary, orders the namespace before the Worker; the deploy's smoke reads a run the trigger recorded. (6) CR4: one Cron Trigger per Worker (`* * * * *`), the seven schedules dispatched from its scheduled time — two triggers per product, inside Workers Free's five per account. |
| Gate | CR1 is the first user-visible rung. CR2 applies only with a linked workspace; it is verified by `terraform validate`. |
| Shipped as | `baseline-v1` ([#5](https://github.com/sourceplane/cron-starter/pull/5)), then CR5 on `main`; proven offline (Baseline CI), deploy gated until a workspace is linked |
| Shipped as | `baseline-v1` ([#5](https://github.com/sourceplane/cron-starter/pull/5)), `baseline-v2` ([#6](https://github.com/sourceplane/cron-starter/pull/6), [#7](https://github.com/sourceplane/cron-starter/pull/7)); proven offline (Baseline CI), deploy gated until a workspace is linked |

## Read order

Expand All @@ -34,4 +34,4 @@ The port keeps the template's pages, API routes, component, styles and `@vercel/
| CR2 — the KV namespace from Terraform | `infra/terraform/cloudflare-kv` | the root validates; the wiring keys match the template |
| CR3 — ready to instantiate | README, as-built status | a reader can run, test, preview, fire a trigger and deploy it |
| CR4 — a baseline, in one landing | card, build document, rename, bootstrap tooling, tests | a new product goes from nothing to live in one landing, the KV namespace applied before the Worker, its smoke on a recorded run; Baseline CI green |
| CR5 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags | Baseline CI green with the docs check |
| CR5 — 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 |
3 changes: 2 additions & 1 deletion specs/epics/cron-starter/epic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,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: [CR-6]
- "the console card reads subdomain from the Cloudflare connection (from: connection.cloudflare.workersSubdomain), as cirrus-baseline since baseline-v23"
tasks: [CR-6, CR-7]
6 changes: 6 additions & 0 deletions specs/epics/cron-starter/implementation-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ itself changing.
repository's own, so no module places them.
- **Status that agrees with the tags.** CR4 is shipped and tagged; the epic
README and the status file describe the one trigger CR4 built.
- **The subdomain from the Cloudflare connection (CR-7).** The card's
`subdomain` input declares `from: connection.cloudflare.workersSubdomain`,
as cirrus-baseline since `baseline-v23`: the console fills it from the
connection the build is bound to and renders no field; `manifest.test.sh`
accepts the source only while the card requires `cloudflare`. A hand-run
build still passes `--set subdomain`.

**Done when**
- `git grep -i kiox` finds nothing outside this milestone's own record
Expand Down
24 changes: 24 additions & 0 deletions tasks/CR-7.TaskContract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: orun.io/v1
kind: TaskContract
metadata:
name: CR-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), as cirrus-baseline does since baseline-v23, so a console or `--from bst_…` build never asks for it and it always names the account the deploy tokens mint from; a hand-run build still passes it with --set
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/**
- tasks/**
doneWhen:
- "blueprint.yaml's subdomain input declares `from: connection.cloudflare.workersSubdomain`, and spec.requires.integrations lists cloudflare"
- testing/manifest.test.sh accepts that source only when the card requires the provider's integration, and fails naming the input when it does not (mutation-checked)
- BOOTSTRAP.md, docs/phases/README.md and repo-blueprint.yaml say a hand-run build still 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