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 @@ -14,7 +14,7 @@ included, all on every merge to `main`.

<!-- 02-docs:begin -->
Not recorded yet. The bootstrap's last phase writes the live URLs, the
workspace, whether Stripe is connected and the secrets inventory into
workspace, whether Stripe is connected 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 @@ -171,5 +171,4 @@ repository names the domain itself.

| 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, the Terraform root checked and planned, the migrations planned and their checksums verified — with nothing applied or deployed. It does not typecheck, lint or run the tests: those are the `pnpm` scripts above (Getting started), run them before you push. A merge applies, migrates 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 @@ -9,7 +9,7 @@ name: Baseline CI
# up, in and out with no Stripe key — through Supabase Auth and the Data API,
# with every table in `public` behind row-level security.
#
# ─── 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 @@ -70,20 +70,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 db-migrate, then web, enforced — and a
# --resume that changes nothing).
# --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 @@ -104,8 +114,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; a Supabase project's API on the runner —
# 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 Supabase project's API on the runner —
# its own Postgres, Supabase Auth and the Data API (the pinned GoTrue and
# PostgREST releases, checksummed) behind one gateway that checks the API
# key; the migrations applied by the product's own runner (through a
Expand All @@ -115,16 +127,17 @@ jobs:
# over that project with no Stripe key — its smoke, every route, a sign-up,
# sign-out, sign-in and the account page through its own server actions, and
# the anon key refused every row the policies do not give it. 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.
# 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
46 changes: 0 additions & 46 deletions .github/workflows/checks.yml

This file was deleted.

43 changes: 26 additions & 17 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +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 sixteen minutes** — an estimate summed from the
phases (15 + 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),
applies the migrations and builds and deploys the app, in that order.
applies the migrations 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, `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) and its Account API token with the permission groups the
console's Connect recipe lists — Workers Scripts Write among them: the
Expand Down Expand Up @@ -88,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 migrations, the app and its tests | the convergence green (supabase → 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 (Stripe's state 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 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 → 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 (Stripe's state 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-pay --run-hooks \
Expand Down Expand Up @@ -201,10 +207,10 @@ bash testing/e2e.test.sh # + network for pnpm and two pinned releases, p
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,
read its keys and write its Auth settings, mint a token, push the Worker
Expand Down Expand Up @@ -248,14 +254,17 @@ at the tag and refuses the whole catalogue if it 404s.
| supabase apply: project limit reached | the Supabase organization has no room for stage + prod (the free plan allows two active projects); pause or delete one, or upgrade, then re-run `01-product` |
| supabase apply: forbidden reading the API keys or writing the Auth config | the brokered token's scopes do not reach those endpoints (untested before a live run — the epic's SP-M). Connect Supabase with a personal access token, or set the Auth values by hand and drop `supabase_settings` from the product's root |
| db-migrate: `secret resolution failed … SUPABASE_*` | the supabase apply for that environment did not publish; its lane's log says why. db-migrate waits on it, enforced |
| web: `secret resolution failed … WIRING_SUPABASE` | that environment's supabase 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 Supabase 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: `tables in public without row-level security …` | migration 020 refused: a table in `public` has no RLS, so the anon key could read it. Nothing deployed; enable RLS (and the policies the app needs) in a new migration, then re-run `01-product` |
| web `build-app`: `wrangler secret bulk failed` | the deploy token cannot write the Worker's secrets; reconnect Cloudflare with the recipe's permission groups (Workers Scripts Write) and re-run the phase |
| web smoke: `/api/health` 503 | `supabase: unreachable` — the project is paused or the URL wrong; `schema: missing` — db-migrate did not run for that environment; `serviceRole: missing`/`invalid` — the secret push did not happen or the key is not the project's |
| `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 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 |
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ 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, the Terraform root checked and planned, the migrations planned; the packages and the two test suites only installed and their structure checked), 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. Typecheck, lint and the tests run in `baseline.yml`'s e2e tier on the landing before every tag, and in a product as the `pnpm` scripts its developers run before they push. 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 Supabase (its real Auth and Data API), dry-deployed, served and signed up, out and in on | no |
| `tag.yml` | cuts a `baseline-vN` tag (manual) | no |
2 changes: 1 addition & 1 deletion ai/context/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ afterwards; the app deploys and serves without it.
| Latest tag | `baseline-v3` (SP7 — the domain is set later, [#9](https://github.com/sourceplane/subscription-payments/pull/9): the console asks for no domain, and a product is born with the placeholder `<reponame>.example.com` for an owner to replace) |
| Before it | `baseline-v2` (SP6 — the cirrus standard, [#7](https://github.com/sourceplane/subscription-payments/pull/7) and [#8](https://github.com/sourceplane/subscription-payments/pull/8): no kiox, generated component docs, this context pack, and the workers.dev subdomain read from the Cloudflare connection instead of asked) |
| Before that | `baseline-v1` (SP5, [#6](https://github.com/sourceplane/subscription-payments/pull/6)) |
| Proven live | No. Everything short of the platform is proven offline in Baseline CI: the e2e tier migrates a local Postgres under the real Supabase Auth and Data API with the product's own runner, builds in orun's staged job tree, and signs a user up and in with no Stripe key. No bootstrap from a tag has run against a workspace: the Supabase root's apply through the brokered token (SP-M), db-migrate against a real project, the service-role push, a real deploy and the card's twenty minutes (SP-N) are unproven |
| Proven live | No. Everything short of the platform is proven offline in Baseline CI: the e2e tier migrates a local Postgres under the real Supabase Auth and Data API with the product's own runner, builds in orun's staged job tree, and signs a user up and in with no Stripe key. No bootstrap from a tag has run against a workspace: the Supabase root's apply through the brokered token (SP-M), db-migrate against a real project, the service-role push, a real deploy and the card's sixteen minutes (SP-N) are unproven |

## Where to read

Expand Down
Loading
Loading