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
11 changes: 7 additions & 4 deletions .baseline/product/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ stage before prod. `dev` only verifies.
one branch, one pull request against `main` — `orun pr open` names the
branch after the task and records it in the pull request.
- Before you push: `pnpm install`, `pnpm run wire:fixture`, `pnpm typecheck`,
`pnpm lint`, `pnpm test`, `pnpm build`. `checks.yml` runs the same on the
pull request; `orun validate` and `orun plan` show what `ci.yml` will plan.
`pnpm lint`, `pnpm test`, `pnpm build`. Nothing runs them for you: the pull
request's `ci.yml` lanes build and dry-deploy the app and plan the Supabase
root, and type-check, lint and test nothing. `orun validate` and
`orun plan` show what `ci.yml` will plan.
- Merging is deploying. Watch the run on `main`, then probe the URLs in
`ai/context/deployment.md`: a run that planned nothing deployed nothing.
- A table in `public` gets row-level security and `auth.uid()` policies in the
Expand All @@ -62,7 +64,8 @@ stage before prod. `dev` only verifies.
redirect allow-list and `mailer_autoconfirm`, and undoes a dashboard edit.
- Secret values, anywhere — the repository, `ai/context/`, a log, GitHub.
Provider credentials are brokered per run; secrets are inspected by name.
- `checks.yml` on pull requests only: on `main`, `ci.yml` is the one run a
commit has.
- `ci.yml` as the only workflow on a push to `main`: whatever watches a
merge reads the newest run for its commit, and a second workflow there
could be the run it reads.
- The last line of a `component.yaml` (`# orun: redeploy …`) is a deploy
trigger; change it only to redeploy that component.
12 changes: 7 additions & 5 deletions .baseline/product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ pointed at the app, on every merge to `main`.

<!-- 02-docs:begin -->
Not recorded yet. The bootstrap's last phase writes the live URLs, the
workspace, how sign-up behaves on each environment and the secrets inventory
into [ai/context/deployment.md](ai/context/deployment.md); how the product
deploys and how to operate it is in
workspace, how sign-up behaves on each environment 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).
<!-- 02-docs:end -->

Expand Down Expand Up @@ -43,6 +43,9 @@ pnpm test
pnpm build # next build + opennextjs-cloudflare build → apps/web/.open-next
```

Run them before you push: a pull request's CI builds and dry-deploys the
app, but type-checks, lints and tests nothing.

The build needs no Supabase project: without one it inlines the committed
`wrangler.jsonc`'s placeholder values, and nothing calls them.

Expand Down Expand Up @@ -143,5 +146,4 @@ records the domain. Replace it with yours in the same pull request as

| 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 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 Supabase root checked and planned — with nothing applied or deployed (typecheck, lint and the tests are `pnpm` scripts you run before you push, above); a merge applies and deploys stage → prod |
31 changes: 22 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
# and that the product installs, builds, deploys (dry), serves and signs a
# user up and in through Supabase Auth (a local stand-in).
#
# ─── 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 web, enforced — and a --resume that
# changes nothing).
# 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,25 +113,28 @@ 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; a local Postgres with Supabase's roles
# 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`); a local Postgres with Supabase's roles
# and a stand-in for the Supabase endpoints the app and the SQL editor call
# (Auth, and the Management API's query endpoint); the stage lane's own
# structure check, build — inlining the stage wiring it is handed — output
# check and dry deploy in the job tree orun stages; and the built Worker
# served against that stand-in — its smoke, every route, a sign-up, a
# sign-in, the protected page, the email-confirmation route, and the
# tutorial's table closed to the Data API's roles by row-level security.
# 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
47 changes: 0 additions & 47 deletions .github/workflows/checks.yml

This file was deleted.

41 changes: 25 additions & 16 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,28 @@ 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: one landing, then one convergence per
environment (stage and prod side by side until `02-docs` restores the
Target wall-clock: **about thirteen minutes** — an estimate summed from the
phases (12 + 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),
sets its Auth, and builds and deploys the app, in that order.
sets its Auth, and builds and deploys the app, 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, `environments` on the secrets probe,
`from: workspace`, a landing's `label`, 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) and its Account API token with the permission groups the
console's Connect recipe lists — Workers Scripts among them.
Expand Down Expand Up @@ -87,8 +94,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 four brokered credentials; then the whole product in one PR — intent, CI, tooling, identity, the Supabase Terraform root, the app and its tests | the convergence green (supabase → 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 (how sign-up behaves included); prod's promotion gate and dev's push lanes restored | the final probe |
| `01-product` | the repository, created and linked; the four brokered credentials; then the whole product in one PR — intent, CI, tooling, identity, the Supabase Terraform root, 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 → web, per environment — the app's deploy resolving the `WIRING_SUPABASE` the apply before it published); the project's three database credentials, which nothing in the convergence reads, on stage and prod; `/` and `/api/health` answering on both workers.dev URLs |
| `02-docs` | `ai/context/deployment.md` from probed facts (how sign-up behaves 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-notes --run-hooks \
Expand Down Expand Up @@ -183,8 +190,8 @@ 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
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, secrets,
probe) and the `link` step are stood in for, a landing becoming a commit.

Expand Down Expand Up @@ -226,14 +233,16 @@ at the tag and refuses the whole catalogue if it 404s.
| supabase apply: project limit reached | the organization has no room for the two projects stage and prod need (the free plan allows two active projects per organization). Pause or delete one, or upgrade, then re-run `01-product` |
| supabase apply: `does not support oauth access` | a supabase provider ≥ 1.6 reads billing endpoints the brokered OAuth token cannot; the root pins `~> 1.5.1` — keep it |
| supabase apply: `Unable to read API keys` / `Unable to update auth settings` | the Supabase connection's grant does not cover the project's API keys or its Auth configuration (not yet exercised live with the platform's OAuth app). Reconnect Supabase with a personal access token and re-run `01-product`; the reconcile re-mints only what is missing |
| web: `wire: missing wiring documents … WIRING_SUPABASE_<ENV>` | the supabase apply for that environment did not publish; its lane's log says why. web waits on it, enforced |
| web: `wire: missing wiring documents … WIRING_SUPABASE_<ENV>` | the supabase apply for that environment did not publish; its lane's log says why. web waits on it, enforced — and this is the check that the wiring is there: nothing awaits it separately |
| `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 |
| web smoke: `/api/health` 503 | `auth: key refused` — the inlined key is not the project's; `auth: unreachable` — the project is paused or still coming up |
| `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) |
| Sign-up says the address cannot be mailed | confirmation was turned on without SMTP: Supabase's own email reaches only the organization's members. Add SMTP, or set `authEmailConfirmation` back to `"false"` |
| 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 is 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 |
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ every browser by design, and Row Level Security is the boundary.

| 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 and deploys stage → prod on merge. 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 in the job tree orun stages, dry-deployed, and served against a local Supabase stand-in — a sign-up, a sign-in, the protected page, the confirm route, the tutorial's table under RLS | no |
| `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 Supabase root planned; no typecheck, lint or tests), 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 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 01-product landing installed, its fixture rendered, type-checked, linted, tested and built, then built in the job tree orun stages, dry-deployed, and served against a local Supabase stand-in — a sign-up, a sign-in, the protected page, the confirm route, the tutorial's table under RLS | no |
| `tag.yml` | cuts a `baseline-vN` tag (manual) | no |
Loading
Loading