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
13 changes: 8 additions & 5 deletions .baseline/product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ template, ported to Workers.

<!-- 02-docs:begin -->
Not recorded yet. The bootstrap's last phase writes the live URLs, the
workspace and the secrets inventory into
workspace and the secrets the blog uses into
[ai/context/deployment.md](ai/context/deployment.md); how the blog deploys
and how to operate it is in
[ai/context/operations.md](ai/context/operations.md).
Expand Down Expand Up @@ -90,7 +90,8 @@ pnpm test
pnpm build # typegen + next build + opennextjs-cloudflare build → apps/web/.open-next
```

That needs no Sanity project (Checks runs exactly this). With one:
That needs no Sanity project, and is what to run before you push: a pull
request builds the blog but does not lint or run its tests. With a project:

```bash
cd apps/web
Expand Down Expand Up @@ -126,9 +127,11 @@ environment, with that environment's Sanity project, and deploys — to
only verifies. The Worker is `cms-sanity-web-<env>` on your account's
workers.dev subdomain, and every deploy is smoke-tested over HTTP: the home
page must render and the draft-mode route must refuse a request without a
preview secret. `checks.yml` runs install, typecheck, lint, test and build
on every pull request. (A push to `main` runs `ci.yml` alone, which builds
and deploys.)
preview secret. A pull request runs the same pipeline's verify lanes: the
blog built and dry-deployed for each environment, with nothing deployed.
They do not lint or run the tests, so run `pnpm typecheck`, `pnpm lint` and
`pnpm test` before you push. (A push to `main` builds, deploys and
smoke-tests.)

The pipeline holds one credential, GitHub's own `GITHUB_TOKEN`. The
Cloudflare token and account id are brokered per run from the workspace's
Expand Down
46 changes: 28 additions & 18 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Baseline CI
# produces installs, builds, deploys (dry) and serves with no Sanity project
# behind it.
#
# ─── WHY THIS IS NOT IN ci.yml OR checks.yml ──────────────────────────────
# ─── WHY THIS IS NOT IN ci.yml ────────────────────────────────────────────
#
# `repo-blueprint.yaml`'s `github-workflows` module copies the WHOLE `.github`
# directory into every blog built from this repository. These jobs run
Expand Down Expand Up @@ -68,21 +68,26 @@ jobs:
# nothing. Then the leak gate (what a product would carry, derived by the
# floor too), and the placement tier (the offline bootstrap: both phases
# placed and finished by the blueprint's own hooks, then the product's own
# `orun plan` for the 01-product merge, under the product's lane pin,
# below).
# `orun plan` for the 01-product merge, below).
blueprint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.58.11
version: v2.88.0
- uses: pnpm/action-setup@v4
with:
version: 10.12.1
- uses: actions/setup-node@v5
with:
node-version: 22
# This job installs nothing either: with no lockfile hook the offline
# bootstrap never runs pnpm, so there is no store, and the pnpm cache
# setup-node v5 turns on by itself (package.json names a packageManager)
# fails the job saving a path that does not exist whenever no earlier
# cache exists for the lockfile.
package-manager-cache: false
- name: repo-blueprint.yaml, read by the pinned CLI
run: |
set -euo pipefail
Expand All @@ -98,34 +103,39 @@ jobs:
- name: the leak gate — what a product carries
run: bash testing/leak.test.sh
# The placement tier ENDS with the product's own `orun plan` — what the
# product's ci.yml runs — so it runs under the product's lane pin, not
# the bootstrap floor: the plan a convergence waits on is the lane
# pin's (its optional secret refs included), and the test refuses an
# orun older than the pin rather than assert the wrong CLI's plan. Its
# placements are valid under either.
# product's ci.yml runs — so it needs an orun at the product's lane pin
# (v2.78.4) or newer: the plan a convergence waits on is the lane pin's
# (its optional secret refs included), and the test refuses an orun
# older than the pin rather than assert the wrong CLI's plan. The
# offline bootstrap before it reads the blueprint, which takes the
# bootstrap floor (v2.88.0: the one `secrets` reconcile, the task set-up
# in the background, the landings checked in the box), so this tier
# runs the floor, which is newer than the lane pin.
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.78.4
version: v2.88.0
- name: placement — the offline bootstrap, and the product's own plan
run: |
git config --global user.email ci@example.invalid
git config --global user.name "baseline ci"
bash testing/placement.test.sh

# Tier 2. THE BLOG IT PRODUCES WORKS, WITH NO SANITY PROJECT: its one
# landing under the checks its pull request waits on, the stage lane's own
# structure check, build, output check and dry deploy in the tree orun
# stages, and the built Worker served and smoke-tested with the component's
# own smoke command — the sample posts, the "connect your Sanity project"
# notice, the Studio's connect page and draft mode's refusal. Pinned at the
# product's lane version, because that is the orun the product's CI runs.
# Tier 2. THE BLOG IT PRODUCES WORKS, WITH NO SANITY PROJECT: each landing
# installed, its fixture rendered, type-checked, linted, tested and built,
# the stage lane's own structure check, build, output check and dry deploy
# in the tree orun stages, and the built Worker served and smoke-tested with
# the component's own smoke command — the sample posts, the "connect your
# Sanity project" notice, the Studio's connect page and draft mode's
# refusal. Pinned at the bootstrap floor (v2.88.0): the offline bootstrap
# reads the blueprint, and the floor is newer than the product's lane pin
# (v2.78.4), which is all the lane steps need.
blog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.78.4
version: v2.88.0
- uses: pnpm/action-setup@v4
with:
version: 10.12.1
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/checks.yml

This file was deleted.

52 changes: 32 additions & 20 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,26 @@ not separate workflows. The console card the platform renders is
brokered secrets and the programme, and `testing/manifest.test.sh` holds it
to what the build document does.

Target wall-clock: **about fourteen minutes** — an estimate summed from the
phases until a bootstrap measures it: ONE landing that places the whole blog
(its pull request waits on a full Next.js build in Checks) and one
convergence that builds and deploys it to stage and prod side by side, then
the record. It is cirrus-baseline's one-landing shape (baseline-v22): no
scaffold landing of its own, no second landing for the app.
Target wall-clock: **about twelve minutes** — an estimate summed from the
phases (11 + 1) until a bootstrap on this shape measures it. The shape: the
task set-up in the background while ONE landing places the whole blog,
brands it and checks it in the box (`orun validate` and `orun plan`, no
runner waited for — its pull request no longer waits on a full Next.js build
in Checks), then one convergence that builds and deploys it to stage and
prod side by side, then a short docs landing that records it. It is
cirrus-baseline's one-landing shape (baseline-v22): no scaffold landing of
its own, no second landing for the app.

## 0. What you need

- GitHub org access (repository creation) and a machine with `git`, `node`
(≥ 22), `pnpm` (10.12.1), `python3` with PyYAML, `curl`, and the `orun`
CLI **≥ v2.58.11** — the floor for RUNNING the bootstrap (the phase overlay,
landings that commit per phase and wait on the PR's whole CI run,
`githubOwner` on the doctor probe, a probe deferred for a project not yet
created, and `from: workspace`). The blog's own `ci.yml` pins its lanes
CLI **≥ v2.88.0** — the floor for RUNNING the bootstrap (the phase overlay,
landings that commit per phase, `githubOwner` on the doctor probe, a probe
deferred for a project not yet created, `from: workspace`, the deploy
credentials minted in one `secrets` reconcile, the task set-up run in the
background (`background: true`), and landings checked in the box before
they merge (`checks: local`)). The blog's own `ci.yml` pins its lanes
separately (v2.78.4).
- A Cloudflare account (the free plan is enough for one Worker with Static
Assets) and its **Account API token** with Workers Scripts Write (the
Expand Down Expand Up @@ -83,8 +88,8 @@ phase whose files are present but branded derives as `drifted`, and

| phase | what it lands | verified by |
|---|---|---|
| `01-product` | the repository, created and linked; the WHOLE blog in one PR — intent, CI, tooling, identity, `apps/web` + `tests/web`; the brokered Cloudflare secrets | its PR's checks, then the convergence green (build, deploy, smoke) and the blog answering on both workers.dev URLs |
| `02-docs` | `ai/context/deployment.md` from probed facts; prod's promotion gate and dev's push lanes restored | the final probe |
| `01-product` | the repository, created and linked; the WHOLE blog in one PR — intent, CI, tooling, identity, `apps/web` + `tests/web`; the brokered Cloudflare secrets | its commit validated and planned in the box (as the PR and as the merge), then merged; the convergence green (build, deploy, smoke) and the blog answering on both workers.dev URLs |
| `02-docs` | `ai/context/deployment.md` from probed facts; prod's promotion gate and dev's push lanes restored | the render's own probes, recorded; the commit checked in the box and merged |

```bash
orun new --blueprint repo-blueprint.yaml --out ~/blogs/acme-notes --run-hooks \
Expand Down Expand Up @@ -181,18 +186,23 @@ each runs locally the same way:
```bash
for t in manifest phases coverage rebrand retouch bootstrap-defer; do bash testing/$t.test.sh; done
bash testing/leak.test.sh # needs orun
bash testing/placement.test.sh # needs orun ≥ ci.yml's pin, node, pnpm: the offline bootstrap
bash testing/e2e.test.sh # + network for pnpm: the blog built, dry-deployed and served, no Sanity project
bash testing/placement.test.sh # needs orun ≥ the floor (and so ≥ ci.yml's pin), node, pnpm: the offline bootstrap
bash testing/e2e.test.sh # + network for pnpm: each landing type-checked, linted, tested and built; the blog dry-deployed and served, no Sanity project
```

The offline bootstrap (`testing/lib/bootstrap.sh`) places both phases in
order and finishes each with the blueprint's OWN `run:` hooks — read out of
`repo-blueprint.yaml`, not transcribed — so the retouch marker, the rebrand,
the re-tenant, the work-tree strip, the deferrals and their restore, the
lockfile and the deployment record all run exactly as a real bootstrap runs
them. Only the platform's typed actions (task, repo, link, reconcile, land,
watch, probe) are stood in for, a landing becoming a commit on top of
orun's `Initial commit`.
the re-tenant, the work-tree strip, the deferrals and their restore and the
deployment record all run exactly as a real bootstrap runs them. Only the
platform's typed actions (task, repo, link, reconcile, land, watch, probe)
are stood in for, a landing becoming a commit on top of orun's `Initial
commit`.

The bootstrap's landings check their commit in the box (`orun validate` and
`orun plan`) and the blog's pull requests build and dry-deploy it; neither
lints or runs the tests. The e2e tier is where those run, on each landing,
before a tag is cut.

## 5. Cutting a baseline tag (maintainers)

Expand Down Expand Up @@ -223,10 +233,12 @@ at the tag and refuses the whole catalogue if it 404s.
| The live blog says "Sample content" | expected until a Sanity project is connected (§3). Not a failure |
| Connected, but `/` answers 500 | the project id or dataset is wrong, or the dataset is private without a token. Check `orun secrets list --env <env>` and the project in Sanity's console; fix the secret and redeploy |
| The Studio says it cannot sign in / CORS | the Worker URL is not in the Sanity project's CORS origins with credentials allowed |
| `land` stops: `the landing's own check failed — orun plan for …` | the blog's tree does not plan — the line after it is orun's own error (an unknown component type, a composition that does not resolve). Nothing was pushed. Fix the tree (or the baseline) and re-run the phase |
| `land` waits on CI after all | the blog's repository requires a status check on `main` (branch protection or a ruleset), so GitHub refused the early merge; the landing waits for the check as a `checks: ci` landing would, then merges |
| Convergence failed AFTER the PR merged; re-running lands nothing | expected on its own — the files are on main. Re-run the phase (`--phase 01-product`, `--redo 01-product`, or the console's Retry): its `retouch` hook gives the landing a diff and the blog redeploys |
| The blog'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 <blog>/intent.yaml` |
| `✕ 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 |
| `unknown flag: --phase`, `has no parameter "checks"`, `has no parameter "secrets"` or another parse error in the blueprint | the CLI is below the v2.88.0 floor |
| the convergence reported green, then `verify` got 404 from both URLs | a second workflow ran on the push to main and the watch took its run. Only `ci.yml` runs on a push to main (`testing/coverage.test.sh` holds it); read the CI run on main for the real result |
| the convergence planned no lanes at all | the merge's push had no `before` to diff against (a first push straight onto an unborn `main`). The landing merges a pull request into orun's `Initial commit`, so its push has one; re-run the phase and its retouch marker re-plans the blog |
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ pnpm build # typegen + next build + opennextjs-cloudflare build → a
pnpm --filter @app/web preview # wrangler dev over the built Worker: the sample posts, unconnected
```

That much needs no Sanity project (`Checks` runs exactly this). To see your
own content:
That much needs no Sanity project: the baseline's own e2e tier
(`testing/e2e.test.sh`) runs exactly this on each landing before a tag, and
a blog's developers run it before a push — a blog's pull request builds and
dry-deploys it, and does not lint or run the tests. To see your own content:

```bash
cd apps/web
Expand Down Expand Up @@ -141,7 +143,6 @@ pnpm preview # wrangler dev over the built Worker

| Workflow | What it runs | Ships to a blog |
|---|---|---|
| `checks.yml` | install, wire fixtures (and that the committed config is their render), typecheck, lint, test, build — every PR (not pushes: on main, `ci.yml` must be the only run a commit has, because the bootstrap's convergence watch takes the newest one) | yes |
| `ci.yml` | the Orun pipeline: `orun plan --changed`, then one job per lane; deploys stage → prod on merge. It plans nothing while `intent.yaml` names the placeholder workspace `ws_CHANGE_ME`, as this repository does | yes |
| `baseline.yml` | the baseline's own tiers: contract tests, the blueprint read by the pinned orun, the leak gate, the offline bootstrap, the blog built, dry-deployed and served with no Sanity project | no |
| `ci.yml` | the Orun pipeline, and the only workflow a blog carries: `orun plan --changed`, then one job per lane. A pull request runs the verify lanes (the blog built and dry-deployed per environment; they do not lint or run the tests), except the bootstrap's own landings (`orun/BASE-*`), where `plan` alone is the check; a merge deploys stage → prod. It plans nothing while `intent.yaml` names the placeholder workspace `ws_CHANGE_ME`, as this repository does | yes |
| `baseline.yml` | the baseline's own tiers: contract tests and the component docs' drift check, the blueprint read by the pinned orun, the leak gate, the offline bootstrap, each landing installed, its fixture rendered, type-checked, linted, tested and built, then the blog built in a staged job tree, dry-deployed and served with no Sanity project | no |
| `tag.yml` | cuts a `baseline-vN` tag (manual) | no |
4 changes: 2 additions & 2 deletions ai/context/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
> Not rendered yet. The bootstrap's `02-docs` phase probes every live URL and
> regenerates this file from what answered — the workspace, the URLs and
> their status, whether each blog reads a Sanity project yet, and the
> secrets inventory by name. Until then, nothing here claims the blog is
> live. The operating contract is [operations.md](operations.md).
> secrets the blog uses, by name. Until then, nothing here claims the blog
> is live. The operating contract is [operations.md](operations.md).
Loading
Loading