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 @@ -16,7 +16,7 @@ Orun's `db-migrate` applies the schema, all on every merge to `main`.

<!-- 02-docs:begin -->
Not recorded yet. The bootstrap's last phase writes the live URLs, the
workspace, the model the chat runs on and the secrets inventory into
workspace, the model the chat runs on 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 @@ -170,5 +170,4 @@ domain in the same change.

| Workflow | What it runs |
|---|---|
| `checks.yml` | install, wire fixture, 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, both Terraform roots checked and planned, the migrations planned — with nothing applied or deployed. No lane runs the `typecheck`, `lint` or `test` scripts: run them yourself (above) before you push. A merge applies, migrates and deploys stage → prod |
32 changes: 23 additions & 9 deletions .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Baseline CI
# product installs, builds, migrates, deploys (dry), serves, and adds a
# document to its knowledge base and answers from it with no AI vendor key.
#
# ─── 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 @@ -69,20 +69,30 @@ jobs:
# 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 — supabase, then cloudflare-hyperdrive, then db-migrate,
# then web, enforced — and a --resume that changes nothing).
# then 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 @@ -103,8 +113,10 @@ jobs:
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
Expand All @@ -113,16 +125,18 @@ jobs:
# similarity and answered from. Workers AI is not reachable from a runner
# with no Cloudflare account, so `wrangler dev` binds AI to a deterministic
# stand-in (testing/lib/fake-workers-ai.js); the real models are not called
# here. Pinned at the product's lane version, because that is the orun its
# CI runs. The runner image carries PostgreSQL (not started); the test
# starts its own on a random port, with pgvector, installed below.
# here. 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 (not started); the test starts its own on a random port, with
# pgvector, installed below.
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
46 changes: 0 additions & 46 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, applies the migrations and builds and deploys the app,
in that order.
in that order, 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 and Workers AI) and its Account API token with
the permission groups the console's Connect recipe lists — Workers Scripts
Expand Down Expand Up @@ -94,8 +99,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 five brokered credentials; then the whole product in one PR — intent, CI, tooling, identity, the Supabase and Hyperdrive Terraform roots, the pgvector migrations, the app and its tests | the convergence green (supabase → cloudflare-hyperdrive → db-migrate → web, per environment), the four published secrets on stage and prod, `/` and `/api/health` answering on both workers.dev URLs |
| `02-docs` | `ai/context/deployment.md` from probed facts (the chat's model included); prod's promotion gate and dev's push lanes restored | the final probe |
| `01-product` | the repository, created and linked; the five brokered credentials; then the whole product in one PR — intent, CI, tooling, identity, the Supabase and Hyperdrive Terraform roots, the pgvector 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, per environment — each resolving what the apply before it published); `/` and `/api/health` answering on both workers.dev URLs |
| `02-docs` | `ai/context/deployment.md` from probed facts (the chat's model 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-rag --run-hooks \
Expand Down Expand Up @@ -189,10 +194,10 @@ bash testing/e2e.test.sh # + network for pnpm, psql, a PostgreSQL server
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, mint a token, deploy for real, call a real
Expand Down Expand Up @@ -237,6 +242,9 @@ at the tag and refuses the whole catalogue if it 404s.
| supabase apply: project limit reached | the Supabase org's plan allows fewer projects than stage + prod need; free one or upgrade, then re-run `01-product` |
| hyperdrive apply: Authentication error (10000) | the Hyperdrive token lacks the permission; reconnect Cloudflare with the recipe's permission groups and re-run the phase — the reconcile re-mints only what is missing |
| 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_*` | a Hyperdrive 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 the Hyperdrive 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 |
| 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` |
| db-migrate: `embeddings holds N vector(s) from another embedding model` | migration 020 refused to resize a column holding another model's vectors (only a database that ran upstream's schema with OpenAI's embeddings has any). Nothing changed; delete them as the message says, re-run, and add those resources again |
| 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, or the embeddings column is not the model's 768 dimensions |
Expand All @@ -246,8 +254,8 @@ at the tag and refuses the whole catalogue if it 404s.
| `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 @@ -128,7 +128,6 @@ which is what a product built from here carries.

| Workflow | What it runs | Ships to a product |
|---|---|---|
| `checks.yml` | install, wire fixture, 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, both Terraform roots checked and planned, the migrations planned); no lane runs the `typecheck`, `lint` or `test` scripts — `baseline.yml`'s e2e tier runs them on the bootstrapped product before every tag, and a product's developers run them before they push. The bootstrap's own landings (`orun/BASE-*`) run `plan` alone 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 | 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 with pgvector, dry-deployed, served with Workers AI stood in for, told a document and asked about it | no |
| `tag.yml` | cuts a `baseline-vN` tag (manual) | no |
1 change: 1 addition & 0 deletions ai/context/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ reads in order.
| 12 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox. Component docs are generated from the manifests and checked in CI | `kiox.yaml` pinned a version nothing ran; a hand-written copy of the dependency graph and bindings drifts silently | IMPLEMENTATION-STATUS (RG6), `tooling/catalog/gen-component-docs.py` |
| 13 | `subdomain` is read from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`), never asked | It belongs to the account like its id and has one right answer; a typed one could only be wrong, and showed up after deploy in the Open Graph origin, the smoke and the probes | `blueprint.yaml`, IMPLEMENTATION-STATUS (RG-8) |
| 14 | The console asks for no domain; an empty `productdomain` brands the placeholder `<reponame>.example.com` | The product goes live on workers.dev and nothing in the build needs a domain; attaching one is an owner's step, and the placeholder keeps every place the domain goes in the repository, ready to replace | `repo-blueprint.yaml`, `tooling/rebrand/rebrand.mjs`, IMPLEMENTATION-STATUS (RG-9) |
| 15 | The turso-starter v8 shape on orun v2.88.0: no `checks.yml` (a product carries `ci.yml` alone); the brokered keys in one `secrets` reconcile per provider; every component's generated pages attached in `spec.docs`, and the app's domain `app`, not `web`; the task set-up in the background, each landing checked in the box (`checks: local`), the watch at 5 s, and no await of what the convergence already resolves | A bootstrap waited on things that did not need waiting for (a runner's plan of a tree in the box, the task plane, one platform round trip per key); the catalog attached no docs and the `web` domain hid the `web` component; a green convergence already proves every published key, because each is resolved fail-closed by a job that waits for its publisher | `repo-blueprint.yaml`, `testing/phases.test.sh`, `testing/coverage.test.sh` (RG8) |
Loading
Loading