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
5 changes: 2 additions & 3 deletions .baseline/product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ environment and Orun's `db-migrate` applies the schema, all on every merge to

<!-- 02-docs:begin -->
Not recorded yet. The bootstrap's last phase writes the live URLs, the
workspace, which model provider serves and the secrets inventory into
workspace, which model provider serves and the secrets the product uses into
[ai/context/deployment.md](ai/context/deployment.md); how the product deploys
and how to operate it is in
[ai/context/operations.md](ai/context/operations.md).
Expand Down Expand Up @@ -166,5 +166,4 @@ domain in the same change.

| Workflow | What it runs |
|---|---|
| `checks.yml` | install, wire fixture (which must change nothing), typecheck, lint, test, build — every pull request (not pushes: on `main`, `ci.yml` must be the only run a commit has) |
| `ci.yml` | the Orun pipeline: `orun plan --changed`, then one job per lane; applies, migrates and deploys stage → prod on merge |
| `ci.yml` | the Orun pipeline, and the only workflow: `orun plan --changed`, then one job per lane. A pull request runs the verify lanes — the app built and dry-deployed for each environment, the three Terraform roots checked and planned, the migrations planned and their checksums verified — with nothing applied or deployed (typecheck, lint and the tests are `pnpm` scripts you run before you push, above); a merge applies, migrates and deploys stage → prod |
49 changes: 32 additions & 17 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Baseline CI
# builds, migrates, deploys (dry), serves, signs a guest in and streams a chat
# answer through its AI binding with no model key and no AUTH_SECRET.
#
# ─── 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 product built from this repository. These jobs run
Expand Down Expand Up @@ -71,21 +71,30 @@ jobs:
# placed and finished by the blueprint's own hooks, then the product's own
# `orun plan` for the 01-product merge — supabase, then
# cloudflare-hyperdrive, then db-migrate, then web, with cloudflare-r2
# before web, enforced — under the product's lane pin, below, and a
# --resume that changes nothing).
# before web, enforced — and a --resume that changes nothing). The floor
# is v2.88.0 (the task set-up in the background, the landings checked in
# the box, the deploy credentials minted in one `secrets` reconcile per
# provider), newer than the product's lane pin (v2.78.4, ci.yml), so the
# product's own plans here read the per-edge `modeRules` as its CI does.
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 @@ -101,40 +110,46 @@ 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 every infra
# edge enforced: it does not apply a dependsOn edge's `modeRules`. The
# lane pin does (advisory on a PR, enforced on main), and the test
# checks the PR's advisory edges only under an orun at least that pin.
# 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 every infra
# edge enforced, because it does not apply a dependsOn edge's
# `modeRules` (advisory on a PR, enforced on main), and the test checks
# the PR's advisory edges only under an orun at least that pin. The
# offline bootstrap before it reads the blueprint, which takes the
# bootstrap floor (v2.88.0: 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: the 01-product landing under the
# checks its pull request waits on; the migrations applied by the product's
# Tier 2. THE PRODUCT IT PRODUCES WORKS: the 01-product landing installed,
# its fixture rendered, type-checked, linted, tested and built (its own pull
# request runs `plan` alone, and the landing is checked in the box with
# `orun validate` and `orun plan`); the migrations applied by the product's
# own runner to a local Postgres (through a stand-in for the one Supabase
# Management API endpoint it calls); the stage lane's own structure check,
# build, output check and dry deploy in the job tree orun stages; and the
# built Worker served over that database and a local R2 with no model key
# and no AUTH_SECRET — its smoke, every route, a guest sign-in, a chat
# streamed through the AI binding (a deterministic stand-in: Workers AI
# cannot be called offline), the history, an attachment, a registration.
# Pinned at the product's lane version, because that is the orun its CI
# runs. The runner image carries PostgreSQL 16 (not started); the test
# starts its own on a random port.
# 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. The runner image carries PostgreSQL 16
# (not started); the test starts its own on a random port.
product:
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
52 changes: 0 additions & 52 deletions .github/workflows/checks.yml

This file was deleted.

42 changes: 25 additions & 17 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,27 @@ 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 twenty minutes** — an estimate summed from the
phases until a bootstrap measures it: one landing, then one convergence per
environment (stage and prod side by side until `02-docs` restores the
Target wall-clock: **about eighteen minutes** — an estimate summed from the
phases (17 + 1) until a bootstrap 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), then one convergence
per environment (stage and prod side by side until `02-docs` restores the
promotion gate) that creates the Supabase project (five to seven minutes),
the Hyperdrive config and the R2 bucket, applies the migrations and builds
and deploys the app, infra before app.
and deploys the app, infra before app, then a short docs landing.

## 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 wait on the PR's whole CI run, `githubOwner` on the doctor
probe, `environments` on the secrets probe, `from: workspace`). The
product's own `ci.yml` pins its lanes separately (v2.78.4), and that pin is
what reads the per-edge `mode` rules the convergence order relies on.
CLI **≥ v2.88.0** — the floor for RUNNING the bootstrap (the phase overlay,
`githubOwner` on the doctor probe, `from: workspace`, the deploy
credentials minted in one `secrets` reconcile per provider, 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), and that pin — or anything newer, as the floor
is — is what reads the per-edge `mode` rules the convergence order relies
on.
- A **Cloudflare** account (the free plan is enough for one Worker with
static assets, Hyperdrive, an R2 bucket and Workers AI's free daily
allocation) and its Account API token with the permission groups the
Expand Down Expand Up @@ -95,8 +100,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 six brokered credentials; then the whole product in one PR — intent, CI, tooling, identity, the Supabase, Hyperdrive and R2 Terraform roots, the migrations, the app and its tests | the convergence green (supabase → cloudflare-hyperdrive → db-migrate → web, and cloudflare-r2 → web, per environment), the five published secrets on stage and prod, `/ping` and `/api/health` answering on both workers.dev URLs |
| `02-docs` | `ai/context/deployment.md` from probed facts (which model provider serves included); prod's promotion gate and dev's push lanes restored | the final probe |
| `01-product` | the repository, created and linked; the six brokered credentials; then the whole product in one PR — intent, CI, tooling, identity, the Supabase, Hyperdrive and R2 Terraform roots, the migrations, the app and its tests | its commit validated and planned in the box (as the PR and as the merge), then merged; the convergence green (supabase → cloudflare-hyperdrive → db-migrate → web, and cloudflare-r2 → web, per environment — each resolving what the apply before it published); `/ping` and `/api/health` answering on both workers.dev URLs |
| `02-docs` | `ai/context/deployment.md` from probed facts (which model provider serves included); 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 ~/products/acme-chat --run-hooks \
Expand Down Expand Up @@ -193,10 +198,10 @@ bash testing/e2e.test.sh # + network for pnpm, psql and a PostgreSQL ser
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, reconcile, land, watch, secrets,
probe) and the `link` step are stood in for, a landing becoming a commit.
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, reconcile, land, watch, probe) and the `link` step are
stood in for, a landing becoming a commit.

What no test here can do is the clouds' half: create a Supabase project,
apply the Hyperdrive config and the bucket, mint a token, deploy for real —
Expand Down Expand Up @@ -243,13 +248,16 @@ at the tag and refuses the whole catalogue if it 404s.
| web deploy fails naming R2 or the bucket | the open risk in §0: the `workers-deploy` token could not attach the `BLOB` binding. A platform fix (the template's scopes), not a change to the product |
| the chat answers "Workers AI could not answer with …" | Workers AI refused the request: a model it no longer serves (pick another in `apps/web/lib/ai/models.ts`), or the account's Workers AI allocation spent |
| hyperdrive or db-migrate: `secret resolution failed … SUPABASE_*` | the supabase apply for that environment did not publish; its lane's log says why. Both wait on it, enforced |
| web: `secret resolution failed … WIRING_CLOUDFLARE_HYPERDRIVE_*` or `… WIRING_CLOUDFLARE_R2_*` | a Hyperdrive or R2 apply published no wiring: the root lost its `secretOutputs`, or its lane was not in the plan. Re-run the phase; its retouch marker re-plans both roots |
| `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 |
| db-migrate: `row-level security would lock the app out of …` | migration 030 refused: `postgres` (Hyperdrive's role) neither owns the tables in `public` nor bypasses RLS. Nothing was enabled; give `postgres` the tables or BYPASSRLS and re-run `01-product` |
| web smoke: `/api/health` 503 | `database: unreachable` — the Hyperdrive config is wrong or the project is paused; `schema: missing` — db-migrate did not run for that environment |
| `build-app` fails: `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) |
| `verify-app-structure` fails: `test -f "wrangler.jsonc"` | the product's `apps/web/wrangler.jsonc` is not committed. It must be — the check runs before the build in a fresh checkout (`pnpm run wire:fixture` renders it) |
| 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 components re-plan; the project and the config are adopted, not recreated |
| 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` runs on pull requests 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 |
| 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 |
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ carries.

| Workflow | What it runs | Ships to a product |
|---|---|---|
| `checks.yml` | install, wire fixture (which must change nothing), 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; applies, migrates and 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 product carries: `orun plan --changed`, then one job per lane. A pull request runs the verify lanes (the app built and dry-deployed per environment, the three Terraform roots checked and planned, the migrations planned), except the bootstrap's own landings (`orun/BASE-*`), where `plan` alone runs and nothing waits for it — the landing was checked in the build box; a merge applies, migrates and deploys stage → prod. It plans nothing while `intent.yaml` names the placeholder workspace `ws_CHANGE_ME`, as this repository does. Typecheck, lint and the tests run in `baseline.yml`'s product tier on every change here, and are `pnpm` scripts a product's developers run before they push | yes |
| `baseline.yml` | the baseline's own tiers: contract tests; the blueprint read by the pinned orun, the leak gate, the offline bootstrap and the product's own plans; the product built, migrated into a local Postgres, dry-deployed, served, and chatted with through a stand-in AI binding | no |
| `tag.yml` | cuts a `baseline-vN` tag (manual) | no |
Loading
Loading