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
10 changes: 6 additions & 4 deletions .baseline/product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from the [Nextra Docs Template](https://github.com/shuding/nextra-docs-template)

<!-- 03-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 site uses into
[ai/context/deployment.md](ai/context/deployment.md); how the site deploys
and how to operate it is in
[ai/context/operations.md](ai/context/operations.md).
Expand Down Expand Up @@ -61,9 +61,11 @@ against the workspace in `intent.yaml`. The site deploys to `stage`, then to
`prod` once stage has converged on the same commit; `dev` only verifies. The
Worker is `nextra-docs-web-<env>` on your account's workers.dev subdomain,
and every deploy is smoke-tested over HTTP: the home page must render and the
search index must be served. `checks.yml` runs install, typecheck, lint,
test and build on every pull request. (A push to `main` runs `ci.yml` alone,
which builds, tests and deploys.)
search index must be served. A pull request runs the same pipeline's verify
lanes: the site 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
19 changes: 11 additions & 8 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Baseline CI
# placed tree comes up branded and carrying nothing of the factory, and that
# the site it produces installs, builds, deploys (dry) and serves.
#
# ─── 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 site built from this repository. These jobs run
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- 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
Expand All @@ -100,18 +100,21 @@ jobs:
git config --global user.name "baseline ci"
bash testing/placement.test.sh

# 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.
# Tier 2. THE SITE IT PRODUCES WORKS: the finished site installed, its
# fixtures rendered, type-checked, linted, tested and built, 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
# bootstrap floor (v2.88.0): the offline bootstrap reads the blueprint (its
# one `secrets` reconcile, its background task set-up, its landings checked
# in the box), and the floor is newer than the site's lane pin (v2.78.4),
# which is all the lane steps need.
site:
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
57 changes: 0 additions & 57 deletions .github/workflows/checks.yml

This file was deleted.

45 changes: 27 additions & 18 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,30 @@ 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 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.
Target wall-clock: **about five minutes** — an estimate summed from the
phases (4 + 1) until a bootstrap of this shape measures it. The shape: the
task set-up in the background while ONE landing is placed, branded and
checked in the box (`orun validate` and `orun plan`, no runner waited for),
one Next.js build (and its Pagefind index) per environment, stage and prod
deployed side by side, then a short docs landing, checked the same way, that
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` dropped one landing and the Checks waits
(cirrus-baseline baseline-v22's shape), and orun v2.88.0's fast shape took
about a minute out of turso-starter's measured build — the same minute is
assumed here.

## 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, `environments` on the secrets probe, a
probe deferred for a project not yet created, and `from: workspace`). The
site's own `ci.yml` pins its lanes separately (v2.78.4).
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 site'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
console's Connect recipe lists the exact permission groups). It is the ONLY
Expand Down Expand Up @@ -78,8 +85,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 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 |
| `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 commit validated and planned in the box (as the PR and as the merge), then 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 render's own probes, recorded; the commit checked in the box and merged |

```bash
orun new --blueprint repo-blueprint.yaml --out ~/sites/acme-docs --run-hooks \
Expand Down Expand Up @@ -163,8 +170,8 @@ bash testing/e2e.test.sh # + network for pnpm: the site built, dry-deplo
The offline bootstrap (`testing/lib/bootstrap.sh`) places every phase in
order and finishes each with the blueprint's OWN `run:` hooks — read out of
`repo-blueprint.yaml`, not transcribed — so the rebrand, the re-tenant, the
deferrals and their restore, the retouch marker, the lockfile and the
deployment record all run exactly as a real bootstrap runs them. Only the
deferrals and their restore, the retouch marker and the deployment record
all run exactly as a real bootstrap runs them. Only the
platform's typed actions (task, repo, link, land, watch, probe, reconcile)
are stood in for, a landing becoming a commit.

Expand Down Expand Up @@ -193,10 +200,12 @@ at the tag and refuses the whole catalogue if it 404s.
| `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 `01-product` |
| `land` stops: `the landing's own check failed — orun plan for …` | the site'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 site'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 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 "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 |
| `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 |
| `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 (an early `checks.yml` that also ran on push did this). Only `ci.yml` may run on a push to main, a site carries no other workflow, and the coverage gate holds the rule; read the CI run on main for the real result |
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ ones); it is pre-rendered and indexed at build time.

| Workflow | What it runs | Ships to a site |
|---|---|---|
| `checks.yml` | install, wire fixtures, 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 |
| `ci.yml` | the Orun pipeline, and the only workflow a site carries: `orun plan --changed`, then one job per lane. A pull request runs the verify lanes (the site built and dry-deployed per environment; the tests' `quick-check` lane installs and checks the package, it does not run them), 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, the blueprint read by the pinned orun, the leak gate, the offline bootstrap, the site built in a staged job tree, dry-deployed and served | no |
| `tag.yml` | cuts a `baseline-vN` tag (manual) | no |
2 changes: 1 addition & 1 deletion ai/context/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

> Not rendered yet. The bootstrap's `03-docs` phase probes every live URL and
> regenerates this file from what answered — the workspace, the URLs and
> their status, and the secrets inventory by name. Until then, nothing here
> their status, and the secrets the site uses, by name. Until then, nothing here
> claims the site is live. The operating contract is
> [operations.md](operations.md).
2 changes: 1 addition & 1 deletion ai/context/operations.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# nextra-docs — operating contract (for humans and agents)

This is the standing guide to how this site is deployed and operated.
Instance facts (live URLs, workspace, secrets inventory) live in
Instance facts (live URLs, workspace, the secrets it uses) live in
[deployment.md](deployment.md), rendered from probed reality by the
bootstrap's `03-docs` phase; this file is the contract that stays true
between deployments. It is written to give an agent with repository read
Expand Down
12 changes: 11 additions & 1 deletion apps/web/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ spec:
type: cloudflare-workers-assets-turbo
lifecycle: production
owner: platform
domain: web
# Its pages, attached to it in the workspace's catalog: what the Docs
# library shows for it, and what the catalog's docs and runbook checks read.
# Generated from what this manifest and its sources declare.
docs:
overview: docs/overview.md
pages:
- { path: docs/architecture.md, role: architecture, title: Architecture }
- { path: docs/runbook.md, role: runbook, title: Runbook }
# `app`, not `web`: a domain and a component share one name space in the
# catalog, and a domain called `web` hid this component from it.
domain: app
path: apps/web
# Its own lane per environment: the Next.js build is the longest job in the
# plan, and a shared lane would wait on it.
Expand Down
19 changes: 10 additions & 9 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, one landing. Live in about six minutes.
consent, one token, one landing. Live in about five minutes.
tags: [docs, nextra, mdx, cloudflare, nextjs]
spec:
source:
Expand Down Expand Up @@ -104,11 +104,12 @@ spec:
from: connection.cloudflare.workersSubdomain

# ── PREVIEW ONLY. repo-blueprint.yaml's `orun.integrations/reconcile@v1`
# 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,
# shown or stored. Keys that already exist are kept.
# hook mints these, brokered, during 01-product. ──────────────────────────
# Transcribed from that hook's own `secrets:` list (each key and its
# `template:`), 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, shown or stored. Keys that already exist are
# kept.
secrets:
- key: CLOUDFLARE_API_TOKEN
provider: cloudflare
Expand All @@ -135,9 +136,9 @@ spec:
# THE BUILD DOCUMENT. There is no umbrella workflow and no agent brief:
# every phase is declared in it and orun runs it.
blueprint: repo-blueprint.yaml
# Summed from the phases' expectedMinutes. An estimate until a bootstrap
# measures it.
expectedMinutes: 6
# Summed from the phases' expectedMinutes (4 + 1). An estimate until a
# bootstrap of this shape measures it.
expectedMinutes: 5
tokenChannel: ORUN_TOKEN_FILE # how a runner hands over its refreshed token
verify:
urls:
Expand Down
Loading
Loading