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
24 changes: 24 additions & 0 deletions .baseline/tasks/01-product.TaskContract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Task contract template for the 01-product landing.
# Unbound to a key on purpose: `orun.task/ensure@v1` seals and attaches it to
# the key the allocator issues. It lives under `.baseline/`, not `tasks/`,
# because `tasks/` is this repository's own work tree (`intent.yaml` `work:`),
# where an unkeyed contract is an error. gates: [] is a DECLARATION — merge
# alone finishes this task; the main convergence is the gate the bootstrap
# watches, not one the plane observes as a PR check.
#
# The whole site in one landing. `affects` names COMPONENTS, by
# metadata.name: the phase's retouch hook reads this list to decide which
# component.yaml files get the redeploy marker, so the deploy set and the task
# plane's statement of the work are one list.
apiVersion: orun.io/v1
kind: TaskContract
spec:
goal: The site's repository is born and linked, the whole site lands in one pull request, and one convergence builds it with OpenNext and deploys it to stage and prod
affects:
- web
- web-tests
doneWhen:
- repo pushed, main pinned as default, workspace linked (orun cloud link)
- main convergence green (build, deploy and smoke on stage and prod)
- the home page answers on both workers.dev URLs
gates: []
20 changes: 0 additions & 20 deletions .baseline/tasks/01-scaffold.TaskContract.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions .baseline/tasks/02-site.TaskContract.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .baseline/tasks/03-docs.TaskContract.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Task contract template for the 03-docs landing. See 01-scaffold's header.
# Task contract template for the 03-docs landing. See 01-product's header.
apiVersion: orun.io/v1
kind: TaskContract
spec:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# registry, compiles every `when` and narration template, and writes
# nothing. Then the leak gate (what a site would carry) and the placement
# tier (the offline bootstrap: every phase placed and finished by the
# blueprint's own hooks, then the site's own `orun plan` for the 02-site
# blueprint's own hooks, then the site's own `orun plan` for the 01-product
# merge).
blueprint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -95,11 +95,11 @@ jobs:
git config --global user.name "baseline ci"
bash testing/placement.test.sh

# Tier 2. THE SITE IT PRODUCES WORKS: the scaffold's landing and the
# finished site under the checks their pull requests wait on, the stage
# lane's own build, output check and dry deploy, and the built Worker served
# and smoke-tested with the component's own smoke command. Pinned at the
# site's lane version, because that is the orun the site's CI runs.
# Tier 2. THE SITE IT PRODUCES WORKS: the finished site under the checks
# every later pull request of it runs, the stage lane's own build, output
# check and dry deploy, and the built Worker served and smoke-tested with
# the component's own smoke command. Pinned at the site's lane version,
# because that is the orun the site's CI runs.
site:
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ permissions:

jobs:
checks:
# A BOOTSTRAP LANDING IS CHECKED BY `plan` ALONE. The baseline bootstrap
# lands on branches named for its tasks (`orun/BASE-…`) and merges each
# one as soon as its pull request's CI is green; the convergence that the
# merge starts on main installs, builds, deploys and smoke-tests the site
# for real, and the bootstrap watches it to green. Running this job there
# too was the same build twice, and most of each landing's wait — the
# same reason ci.yml skips its lanes on those branches. Its typecheck,
# lint and unit tests are not lost: the baseline's own CI runs them over a
# bootstrapped tree of the very commit being built (its e2e tier), and
# every other pull request of the site runs this job.
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'orun/BASE-')) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down
38 changes: 20 additions & 18 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ 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 fifteen minutes** — an estimate summed from the
phases until a bootstrap measures it: three landings, one Next.js build (and
its Pagefind index) per environment, stage and prod deployed side by side
until `03-docs` restores the promotion gate.
Target wall-clock: **about six minutes** — an estimate summed from the
phases until a bootstrap measures it: two landings, each checked by `plan`
alone, one Next.js build (and its Pagefind index) per environment, stage and
prod deployed side by side until `03-docs` restores the promotion gate.
baseline-v1 measured 8m15s from the console's Build (2026-10-15) over three
landings, about 1m41s of it the build sandbox starting; `01-product` drops
one landing and the Checks waits, cirrus-baseline baseline-v22's shape.

## 0. What you need

Expand All @@ -34,7 +37,7 @@ until `03-docs` restores the promotion gate.
**admin-role API key** for headless runs (secret writes below admin are
masked as `not_found`).
- **The repository allow-listed in the workspace** (console → Settings → Git
repos), unless the credential can write links. `01-scaffold`'s `link` step
repos), unless the credential can write links. `01-product`'s `link` step
stops and names the fix if it is not.

## 1. One command: `--resume`
Expand Down Expand Up @@ -69,14 +72,13 @@ phase whose files are present but branded derives as `drifted`, and

| phase | what it lands | verified by |
|---|---|---|
| `01-scaffold` | the repository, created and linked; intent, CI, tooling, identity | its PR's checks green, merged |
| `02-site` | `apps/web` + `tests/web`; the brokered Cloudflare secrets | the convergence green (build, deploy, smoke) and both workers.dev URLs answering |
| `01-product` | the repository, created and linked; the brokered Cloudflare secrets; then the whole site in one PR — intent, CI, tooling, identity, `apps/web` + `tests/web` | its PR's `plan` green, merged; the convergence green (build, deploy, smoke) and both workers.dev URLs answering |
| `03-docs` | `ai/context/deployment.md` from probed facts; prod's promotion gate and dev's push lanes restored | the final probe |

```bash
orun new --blueprint repo-blueprint.yaml --out ~/sites/acme-docs --run-hooks \
--phase 01-scaffold --values ~/acme-docs.values.yaml
# … then 02-site, then 03-docs
--phase 01-product --values ~/acme-docs.values.yaml
# … then 03-docs
```

Every later phase reads the identity back from `.rebrand/values.json` in the
Expand Down Expand Up @@ -118,7 +120,7 @@ orun new --blueprint repo-blueprint.yaml \

| requirement | detail |
|---|---|
| `GITHUB_TOKEN` | fine-grained PAT: **read** on this repository; on the SITE's repository **contents write**, **pull-requests write**, **actions read+write** (`orun.run/watch@v1` resumes runs with `gh run rerun`), **checks read**; **repository create** on the owner if `01-scaffold` creates it (or pre-create it — supported) |
| `GITHUB_TOKEN` | fine-grained PAT: **read** on this repository; on the SITE's repository **contents write**, **pull-requests write**, **actions read+write** (`orun.run/watch@v1` resumes runs with `gh run rerun`), **checks read**; **repository create** on the owner if `01-product` creates it (or pre-create it — supported) |
| classic token caveat | a classic PAT or gh OAuth token also needs the `workflow` scope to push `.github/workflows/` |
| pinning | the clone's `--branch <tag>` pins everything: the blueprint, its modules and its hooks' scripts all come from that one commit |

Expand Down Expand Up @@ -174,15 +176,15 @@ at the tag and refuses the whole catalogue if it 404s.

| Symptom | Cause → fix |
|---|---|
| `01-scaffold` parks: `waiting for github for <org>` | the workspace's GitHub connection is to another account. Connect the App installation on `<org>` (console → Integrations → GitHub), then `--resume` |
| `01-scaffold` stops at `link` | the repository is not linked to the workspace and the credential cannot link it. Allow-list it (console → Settings → Git repos) and re-run the phase |
| `02-site` waits on the `providers` probe, then stops | Cloudflare is not connected. Connect it (console → Integrations), then re-run the phase — the probe is a wait, not a failure |
| `01-product` parks: `waiting for github for <org>` | the workspace's GitHub connection is to another account. Connect the App installation on `<org>` (console → Integrations → GitHub), then `--resume` |
| `01-product` stops at `link` | the repository is not linked to the workspace and the credential cannot link it. Allow-list it (console → Settings → Git repos) and re-run the phase |
| `01-product` waits on the `providers` probe, then stops | Cloudflare is not connected. Connect it (console → Integrations), then re-run the phase — the probe is a wait, not a failure |
| Secret WRITE fails `not_found` while listings work | the API key's role is below admin; re-mint it with the admin role |
| Deploy lane: Authentication error (10000) | the connection's token lacks Workers Scripts Write; re-issue it, re-connect, re-run `02-site` |
| Convergence failed AFTER the PR merged; re-running lands nothing | expected on its own — the files are on main. Re-run the phase (`--phase 02-site`, `--redo 02-site`, or the console's Retry): its `retouch` hook gives the landing a diff and the site redeploys |
| The site's `intent.yaml` says `workspace: ws_SET_ME` | `orunWorkspace` was empty and the build ran outside a workspace; set it and re-run `01-scaffold` |
| Deploy lane: Authentication error (10000) | the connection's token lacks Workers Scripts Write; re-issue it, re-connect, re-run `01-product` |
| 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 site redeploys |
| The site'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 `03-docs`; prod no longer waits on stage | the gate is deferred, not dropped: run `03-docs`, or `node tooling/bootstrap/promotion.mjs --restore --file <site>/intent.yaml` |
| `✕ input "productdomain" is required` | all four required inputs 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 |
| `02-site` lanes fail in `build-app`: `Symlink apps/web/node_modules/next is invalid, it points out of the filesystem root` | the site's intent pins stack-tectonic ≥ 0.20.0, whose lane-scoped install links each job's node_modules out of its tree, which Next 16's Turbopack refuses. Pin 0.19.0 (this baseline does; `intent.yaml` says why) |
| `02-site`'s 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 (a `checks.yml` that also runs on push). This baseline runs `checks.yml` on pull requests only, and its coverage gate holds the rule; read the CI run on main for the real result |
| `01-product` lanes fail in `build-app`: `Symlink apps/web/node_modules/next is invalid, it points out of the filesystem root` | the site's intent pins stack-tectonic ≥ 0.20.0, whose lane-scoped install links each job's node_modules out of its tree, which Next 16's Turbopack refuses. Pin 0.19.0 (this baseline does; `intent.yaml` says why) |
| `01-product`'s 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 (a `checks.yml` that also runs on push). This baseline runs `checks.yml` on pull requests only, and its coverage gate holds the rule; read the CI run on main for the real result |
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ orun new --blueprint repo-blueprint.yaml --out ~/sites/acme-docs --run-hooks --r
```

Or, once the platform's registry lists it, from the Orun console (Baselines →
`nextra-docs` → Build). Three phases — `01-scaffold` (the repository, its CI
and identity), `02-site` (the site deployed to stage and prod,
smoke-tested), `03-docs` (the live deployment recorded) — each landing one
`nextra-docs` → Build). Two phases — `01-product` (the repository created,
then the whole site in one pull request, deployed to stage and prod and
smoke-tested) and `03-docs` (the live deployment recorded) — each landing one
pull request in the new repository. **[BOOTSTRAP.md](BOOTSTRAP.md)** is the
operator guide; [docs/phases/](docs/phases/README.md) has a page per phase.

Expand Down
9 changes: 4 additions & 5 deletions blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ metadata:
dark mode and full-text search through a Pagefind index, on Nextra 4 and
Next.js, built by OpenNext into one Cloudflare Worker with Static Assets,
and CI that deploys it to stage and prod on merge. One provider, one
consent, one token. Live in about fifteen minutes.
consent, one token, one landing. Live in about six minutes.
tags: [docs, nextra, mdx, cloudflare, nextjs]
spec:
source:
Expand Down Expand Up @@ -91,7 +91,7 @@ spec:
example: acme

# ── PREVIEW ONLY. repo-blueprint.yaml's `orun.integrations/reconcile@v1`
# hooks mint these, brokered, during 02-site. ─────────────────────────────
# hooks mint these, brokered, during 01-product. ──────────────────────────
# Transcribed from those hooks' own `keys:` and `template:` values, so
# testing/manifest.test.sh compares this list to the document that mints
# them. The console renders them read-only: no credential is ever typed,
Expand All @@ -115,8 +115,7 @@ spec:
epicSlug: nextra-docs-baselining # = repo-blueprint.yaml's `epicSlug` default
epicName: "Nextra docs baselining — {productname}"
milestones:
- name: 01-scaffold
- name: 02-site
- name: 01-product
- name: 03-docs

bootstrap:
Expand All @@ -125,7 +124,7 @@ spec:
blueprint: repo-blueprint.yaml
# Summed from the phases' expectedMinutes. An estimate until a bootstrap
# measures it.
expectedMinutes: 15
expectedMinutes: 6
tokenChannel: ORUN_TOKEN_FILE # how a runner hands over its refreshed token
verify:
urls:
Expand Down
Loading
Loading