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: 7 additions & 6 deletions .baseline/product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ environment.

<!-- 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 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 @@ -66,8 +66,7 @@ There is no storage key to configure. The Worker binds the bucket as
(placeholder names) for local work and verification, and on every deploy
from the document the `cloudflare-r2` Terraform root publishes after its
apply (`WIRING_CLOUDFLARE_R2`, per environment). Edit the template, then
`pnpm run wire:fixture`; Checks fails if the committed `wrangler.jsonc` is
not the fixture render.
`pnpm run wire:fixture` and commit the render with the template.

**Anyone can upload.** Both routes carry an "add your own authentication"
note where a check belongs (`app/api/upload/route.ts`,
Expand All @@ -84,9 +83,11 @@ the uploader builds with that environment's bucket name and deploys — to
only verifies. The Worker is `blob-starter-web-<env>` on your account's
workers.dev subdomain, and every deploy is smoke-tested over HTTP: the
delivery route must answer from the bucket and the page must render its
uploader. `checks.yml` runs install, the fixture render, typecheck, lint,
test and build on every pull request. (A push to `main` runs `ci.yml`
alone, which applies, builds and deploys.)
uploader. A pull request runs the same pipeline's verify lanes, with nothing
applied or deployed: the R2 bucket planned for stage and prod, and the
uploader built and dry-deployed for each environment. They do not run the
tests or the linter — run those before you push (Getting started, above).
(A push to `main` applies, builds and deploys.)

The pipeline holds one credential, GitHub's own `GITHUB_TOKEN`. Two
Cloudflare tokens — one that deploys Workers, one that manages R2 — and the
Expand Down
44 changes: 27 additions & 17 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Baseline CI
# bucket before the Worker on a merge — and that the product 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 @@ -69,20 +69,25 @@ jobs:
# 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 — the R2 apply before the Worker's
# deploy — under the product's lane pin, below).
# deploy — by an orun at or above the product's lane pin, 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 the lockfile hook gone the
# offline bootstrap never runs pnpm, so there is no store, and the
# cache setup-node v5 turns on by itself (package.json names a
# packageManager) fails the job on saving a path that does not exist.
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. v2.58.11 plans a pull request with apps/web
# waiting on the R2 plan: it does not apply a dependsOn edge's
# `modeRules`. The lane pin does (advisory on a PR, enforced on main),
# 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
# or newer: one older than v2.78.4 plans a pull request with apps/web
# waiting on the R2 plan, because it does not apply a dependsOn edge's
# `modeRules` (advisory on a PR, enforced on main). 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 PRODUCT IT PRODUCES WORKS: its one landing under the checks
# its pull request waits on, the stage lane's own structure check, build
# (the live wiring render included), 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. Pinned at the product's lane version,
# because that is the orun the product's CI runs.
# Tier 2. THE PRODUCT IT PRODUCES WORKS: its one landing installed, its
# fixture rendered, type-checked, linted, tested and built, the stage lane's
# own structure check, build (the live wiring render included), 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. 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.
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
51 changes: 0 additions & 51 deletions .github/workflows/checks.yml

This file was deleted.

51 changes: 28 additions & 23 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@ 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 whose pull request waits on
Checks (a full Next.js build), then one convergence — the R2 bucket
applied on stage and prod, then the uploader built with its name and deployed,
stage and prod side by side — then a short docs landing that restores the
promotion gate.
Target wall-clock: **about twelve minutes** — an estimate summed from the
phases (11 + 1) until a bootstrap measures it; no build of this baseline has
been timed. 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), then one convergence — the R2 bucket applied on stage
and prod, then the uploader built with its name and deployed, stage and prod
side by side — then a short docs landing that restores the promotion gate.

## 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
product's own `ci.yml` pins its lanes separately (v2.78.4), and its plans
need that pin: the floor does not apply a `dependsOn` edge's `modeRules`.
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 product'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 an R2 bucket per environment) with **R2 enabled** — once per
account, dashboard → R2; Cloudflare asks for it to be switched on even on
Expand Down Expand Up @@ -85,8 +87,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 product in one PR — intent, CI, tooling, identity, the R2 root, the uploader and its tests; the brokered Cloudflare secrets | its PR's checks green and merged; the convergence green (R2 applied, then the uploader built, deployed, smoke-tested); `WIRING_CLOUDFLARE_R2` on stage and prod; both workers.dev URLs answering |
| `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 product in one PR — intent, CI, tooling, identity, the R2 root, the uploader and its tests; the brokered Cloudflare secrets (the deploy token, the R2 token, the account id) | its commit validated and planned in the box (as the PR and as the merge), then merged; the convergence green (R2 applied, then the uploader — which resolves `WIRING_CLOUDFLARE_R2` — built, deployed, smoke-tested); both workers.dev URLs answering |
| `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 ~/sites/acme-uploads --run-hooks \
Expand Down Expand Up @@ -132,8 +134,9 @@ need landings of its own. It does not, because the product's plan holds it:
environment's apply; on a pull request nothing deploys, so nothing waits.
- A job resolves its secrets when it STARTS, so `WIRING_CLOUDFLARE_R2_<ENV>`
is there when the deploy begins.
- The landing's `await` then asks the platform that the wiring exists on
stage and prod (`orun.secrets/exists@v1`) — every later deploy reads it.
- The deploy resolves the document from the place every later run looks
(its `component.yaml` secret refs), so a green convergence already says it
is there: a missing one fails its lane. There is no separate check.

`testing/phases.test.sh` fails if a component that reads a wiring document
does not wait for its publisher this way; `testing/placement.test.sh` plans
Expand Down Expand Up @@ -196,10 +199,10 @@ bash testing/e2e.test.sh # + network for pnpm: the product built in the
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 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, secrets,
probe) are stood in for, a landing becoming a commit. What no offline test
the re-tenant, 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. What no offline test
can do is the platform's half: the bucket applied for real (the R2 root
is held to `terraform validate`), the token minted, the deploy, the probes.

Expand Down Expand Up @@ -232,12 +235,14 @@ at the tag and refuses the whole catalogue if it 404s.
| deploy lane: Authentication error (10000) | the connection's token lacks Workers Scripts write; same fix |
| R2 lane: the bucket name is taken | `adopt.tf` imports a bucket of the same name the account owns; restore it if removed. Two products with one `reponame` in one account share names — pick another `reponame` |
| web lane fails resolving `WIRING_CLOUDFLARE_R2_<ENV>` | that environment's R2 apply failed — read its lane; the web lane waits on it |
| `wiring` await stops: `WIRING_CLOUDFLARE_R2` missing on stage or prod | the convergence was green but the apply published nothing: the R2 component lost its `secretOutputs`, or its lane was not in the plan. Re-run the phase; its retouch marker re-plans the R2 root |
| web lane: `WIRING_CLOUDFLARE_R2` not found | that environment's R2 apply published nothing: the R2 component lost its `secretOutputs`, or its lane was not in the plan. Re-run the phase; its retouch marker re-plans the R2 root |
| `land` stops: `the landing's own check failed — orun plan for …` | the product'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 product'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 R2 root and the uploader re-plan |
| The product'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 <product>/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 |
| web lane `verify-app-structure` fails on `wrangler.jsonc` | the config is not committed. It is the fixture render of `wrangler.template.jsonc`: `pnpm run wire:fixture` and commit it |
| web lane `build-app`: `Symlink apps/web/node_modules/next is invalid, it points out of the filesystem root` | the product'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 (`intent.yaml` says why) |
| the convergence reported green, then `verify` got 404 | a second workflow ran on the push to main and the watch took its run. Only `ci.yml` may run on a push to main (`checks.yml` is pull-request only) |
| the convergence reported green, then `verify` got 404 | a second workflow ran on the push to main and the watch took its run. Only `ci.yml` may run on a push to main |
Loading
Loading