From 544d910c38289096adbb829614750e45fa0e2a13 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Oct 2026 09:31:16 +0000 Subject: [PATCH] =?UTF-8?q?HA6:=20the=20turso=20v8=20shape=20=E2=80=94=20o?= =?UTF-8?q?ne=20secrets=20hook,=20no=20Checks,=20docs=20in=20the=20catalog?= =?UTF-8?q?,=20tasks=20in=20the=20background,=20landings=20checked=20here?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What sourceplane/turso-starter became across baseline-v6, v7 and v8, brought to the Hono API (one Worker and its tests, no infra). A. One secrets hook. The two single-template reconciles (secret-workers-deploy, secret-account-id) are one `secrets` reconcile (orun >= v2.87.0): one connections read, one secrets read, the missing keys created side by side. Same provider, no other parameters, so they merge; keys, templates and order are the card's. manifest.test.sh reads the `secrets` form beside `keys`; docs/phases/01-product.md, BOOTSTRAP.md and the card's comment name the one hook. B. No Checks workflow; docs in the catalog; the API found. - checks.yml is gone. An API's pull requests verify through ci.yml's lanes (the Worker built, type-checked and dry-deployed per environment), a bootstrap's landings through `plan`; the e2e tier runs the steps checks.yml ran (install, the fixture render, typecheck, lint, test, build) from its own LANDING_CHECKS list, at both landings as before, and the leak gate no longer requires it. tests/api's lane is `quick-check` (install, then `test -f package.json`), so a pull request does not lint or run the tests: the API's README and operations.md say to run them before a push. - apps/api and tests/api attach overview, architecture and runbook in spec.docs; api-tests gets a description (its overview regenerated by tooling/catalog/gen-component-docs.py). - apps/api's domain is `app`, not `api`: the catalog keys a domain and a component by name, so the `api` domain would take the `api` component's place, as `web` did on turso-starter. `app` is no component's name here, and is the word turso, portfolio and astro use. - coverage.test.sh holds both rules (the three pages attached and present, a description, no domain in spec.domain or labels.domain named like a component). C. The fast shape on orun v2.88.0. - The run-level task set-up runs in the background (`background: true` on all five hooks); each phase's `task` moves from `pre` to `post`, just before `land`, so neither phase has a `pre` hook. - Both landings are `checks: local` (orun validate, then orun plan as the PR and as the merge, in the box) and merge without waiting for CI. - The convergence watch reads every 5 s. - No `pnpm-lockfile` hook: the shipped lockfile is installed frozen by the lanes and by the e2e tier. - 02-docs: no final probe and no narrate.await (its render probes as it writes, and the landing redeploys nothing). The render asks the platform nothing: no `orun workspace`, `orun secrets list` (x3) or `orun integrations list`; the record names CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID (workspace scope) and points to the console's Secrets and Integrations pages. The "secrets inventory" wording in ai/context and the API's README follows. - No orun.secrets/exists await existed (no infra, nothing publishes wiring), so none is removed or kept. - expectedMinutes 6 + 3 -> 5 + 1, the card 9 -> 6, "about six minutes" (the card said "under ten"); estimates, not measured on this shape. - Floor v2.88.0 (from v2.58.11): BOOTSTRAP.md (with the `has no parameter "checks"`/"secrets" rows and the landing's local check) and baseline.yml's blueprint tier and its api tier — the e2e's offline bootstrap reads the blueprint, so that tier leaves the lane pin as turso's did in TU9. ci.yml's lane pin (v2.78.4) is unchanged. The blueprint job's setup-node gets `package-manager-cache: false`: with the lockfile hook gone nothing in it runs pnpm, and setup-node v5's own pnpm cache fails the job's post step when there is no store. - phases.test.sh keeps its cirrus-style 01-product chain, now ending `repo, link, secrets, task, land`, with one `secrets` reconcile per provider in place of one hook per key; no `pre` hooks; 01-product awaits converge then verify, 02-docs nothing; the fast-shape rules (every preInstantiate hook background, no task-plane `pre` hook, every landing checks: local, the watch at most 10 s); narrate.await required where a phase awaits and refused where it awaits nothing. Its old "await the wiring when there is infra" rule becomes a stop: an infra component fails the test until turso's reader rule is ported (or its wiring awaited). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CJuLwDKfEaQGAEuBpJvN5Q --- .baseline/product/README.md | 10 +- .github/workflows/baseline.yml | 29 +++-- .github/workflows/checks.yml | 46 -------- BOOTSTRAP.md | 43 ++++--- README.md | 3 +- ai/context/deployment.md | 2 +- ai/context/operations.md | 13 ++- apps/api/component.yaml | 13 ++- blueprint.yaml | 19 +-- docs/phases/01-product.md | 26 +++-- docs/phases/02-docs.md | 7 +- docs/phases/README.md | 31 +++-- hooks/render-deployment-docs.sh | 60 ++++------ repo-blueprint.yaml | 159 +++++++++++++++----------- testing/coverage.test.sh | 46 ++++++++ testing/e2e.test.sh | 46 +++++--- testing/leak.test.sh | 2 +- testing/lib/bootstrap.sh | 4 +- testing/manifest.test.sh | 9 +- testing/phases.test.sh | 135 +++++++++++++++++----- testing/placement.test.sh | 9 +- tests/api/component.yaml | 9 ++ tests/api/docs/overview.md | 2 + tooling/catalog/gen-component-docs.py | 7 +- 24 files changed, 446 insertions(+), 284 deletions(-) delete mode 100644 .github/workflows/checks.yml diff --git a/.baseline/product/README.md b/.baseline/product/README.md index 736f069..0f1db25 100644 --- a/.baseline/product/README.md +++ b/.baseline/product/README.md @@ -9,7 +9,7 @@ it to stage, then prod. Not recorded yet. The bootstrap's last phase writes the live URLs, the -workspace and the secrets inventory into +workspace and the secrets the API uses into [ai/context/deployment.md](ai/context/deployment.md); how the API deploys and how to operate it is in [ai/context/operations.md](ai/context/operations.md). @@ -63,9 +63,11 @@ against the workspace in `intent.yaml`. The API deploys to `stage`, then to `prod` once stage has converged on the same commit; `dev` only verifies. The Worker is `hono-api-api-` on your account's workers.dev subdomain, and every deploy is smoke-tested over HTTP: `/health` must answer `"status":"ok"` -for that environment. `checks.yml` runs install, typecheck, lint, test and -build on every pull request. (A push to `main` runs `ci.yml` alone, which -builds, tests and deploys.) +for that environment. A pull request runs the same pipeline's verify lanes: +the Worker built, type-checked and dry-deployed for each environment, with +nothing deployed. They do not lint or run the tests, so run `pnpm typecheck`, +`pnpm lint` and `pnpm test` before you push. (A push to `main` builds, +deploys and smoke-tests.) The pipeline holds one credential, GitHub's own `GITHUB_TOKEN`. The Cloudflare token and account id are brokered per run from the workspace's diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index 3c81548..44be01c 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -6,7 +6,7 @@ name: Baseline CI # placed tree comes up branded and carrying nothing of the factory, and that # the API 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 API built from this repository. These jobs run @@ -73,13 +73,19 @@ jobs: - 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 + # Nothing in this job installs (the offline bootstrap runs no pnpm + # since the lockfile hook went), so there is no pnpm store to + # cache — and setup-node v5's own pnpm cache, on by itself because + # package.json names a packageManager, fails the job in its post + # step when it finds none. + package-manager-cache: false - name: repo-blueprint.yaml, read by the pinned CLI run: | set -euo pipefail @@ -100,20 +106,23 @@ jobs: git config --global user.name "baseline ci" bash testing/placement.test.sh - # Tier 2. THE API IT PRODUCES WORKS: both landings under the checks their - # pull requests wait on, every run step of the stage lane's pull-request - # plan (the structure check before any build, the build, the typecheck, the - # dry deploy) in the job tree orun stages, and the Worker served by - # `wrangler dev --env stage` and smoke-tested with the component's own smoke - # command. Pinned at the API's lane version, because that is the orun the - # API's CI runs. + # Tier 2. THE API IT PRODUCES WORKS: both landings installed, their + # fixtures rendered, type-checked, linted, tested and built, every run step + # of the stage lane's pull-request plan (the structure check before any + # build, the build, the typecheck, the dry deploy) in the job tree orun + # stages, and the Worker served by `wrangler dev --env stage` and + # smoke-tested with the component's own smoke command. Pinned at the + # bootstrap floor (v2.88.0): the offline bootstrap reads the blueprint (its + # one `secrets` reconcile, its background task set-up, its landings checked + # in the box), and the floor is newer than the API's lane pin (v2.78.4), + # which is all the lane steps need. api: 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 diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 40982e5..0000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Checks - -# Credential-free verification: install, render the offline wrangler fixtures, -# typecheck, lint, test and build, on every pull request, linked or not. -# `ci.yml` is the Orun pipeline beside it (plan/run with brokered Cloudflare -# credentials, deploys on merge); it plans nothing until intent.yaml names a -# workspace. -# -# PULL REQUESTS ONLY — not pushes to main. A push to main must start exactly -# one workflow, `ci.yml`, because the bootstrap's convergence watch -# (`orun.run/watch@v1` with `sha:`) takes the newest run for the merge commit -# from ANY workflow. With this one on push too, the first live bootstrap -# watched this run go green while ci.yml's deploy lanes had failed, and called -# the product converged. On main the convergence builds and tests the API -# anyway. The baseline's coverage gate holds the rule. -on: - pull_request: - workflow_dispatch: - -concurrency: - group: checks-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -permissions: - contents: read - -jobs: - checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: pnpm/action-setup@v4 - with: - version: 10.12.1 - - uses: actions/setup-node@v5 - with: - node-version: 22 - cache: pnpm - - run: pnpm install --frozen-lockfile - # Templated deployables render their wrangler config from the committed - # fixture; an unresolved wiring token fails here, not at deploy time. - - run: pnpm run wire:fixture - - run: pnpm typecheck - - run: pnpm lint - - run: pnpm test - - run: pnpm build diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index eede899..b9f3443 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -11,20 +11,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 nine minutes** — an estimate summed from the -phases until a bootstrap measures it: ONE landing that places the whole API -and one convergence that deploys it to stage and prod side by side, then the -record. It is cirrus-baseline's one-landing shape (baseline-v22): no -scaffold landing of its own, no second landing for the app. +Target wall-clock: **about six minutes** — an estimate summed from the +phases (5 + 1) until a bootstrap of this shape measures it. The shape: the +task set-up in the background while ONE landing places the whole API, +brands it and is checked in the box (`orun validate` and `orun plan`, no +runner waited for), then one convergence that deploys it to stage and prod +side by side, then a short record landing, checked the same way. It is +cirrus-baseline's one-landing shape (baseline-v22): no scaffold landing of +its own, no second landing for the app. orun v2.88.0's fast shape took about +a minute out of turso-starter's measured build; the same minute is assumed +here. ## 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, a probe deferred for a project not yet - created, and `from: workspace`). The API's own `ci.yml` pins its lanes + 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 API's own `ci.yml` pins its lanes separately (v2.78.4). - A Cloudflare account (the free plan is enough for one Worker) and its **Account API token** with Workers Scripts Write (the console's Connect @@ -76,8 +83,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 API in one PR — intent, CI, tooling, identity, `apps/api` + `tests/api`; the brokered Cloudflare secrets | its PR's checks, then the convergence green (build, deploy, smoke) and `/health` answering on both workers.dev URLs | -| `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 API in one PR — intent, CI, tooling, identity, `apps/api` + `tests/api`; the brokered Cloudflare secrets | its commit validated and planned in the box (as the PR and as the merge), then merged; the convergence green (build, deploy, smoke) and `/health` answering on both workers.dev URLs | +| `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 ~/apis/acme-api --run-hooks \ @@ -162,11 +169,11 @@ bash testing/e2e.test.sh # + network for pnpm: the API built, dry-deploy 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 work-tree strip, 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, probe) are stood in for, a landing becoming a commit on top of -orun's `Initial commit`. +the re-tenant, the work-tree strip, 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 on top of orun's `Initial +commit`. ## 5. Cutting a baseline tag (maintainers) @@ -193,10 +200,12 @@ at the tag and refuses the whole catalogue if it 404s. | `01-product` stops at `link` | the repository is not linked to the workspace and the credential cannot link it. Allow-list it (console → Settings → Git repos) and re-run the phase | | Secret WRITE fails `not_found` while listings work | the API key's role is below admin; re-mint it with the admin role | | Deploy lane: Authentication error (10000) | the connection's token lacks Workers Scripts Write; re-issue it, re-connect, re-run `01-product` | +| `land` stops: `the landing's own check failed — orun plan for …` | the API'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 API'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 API redeploys | | The API'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 /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 | | the convergence reported green, then `verify` got 404 from both URLs | a second workflow ran on the push to main and the watch took its run. Only `ci.yml` runs on a push to main (`testing/coverage.test.sh` holds it); read the CI run on main for the real result | | the convergence planned no lanes at all | the merge's push had no `before` to diff against (a first push straight onto an unborn `main`). The landing merges a pull request into orun's `Initial commit`, so its push has one; re-run the phase and its retouch marker re-plans the API | diff --git a/README.md b/README.md index 380e071..6302eb0 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,6 @@ Add a route with `app.get(...)` (or `post`, `route`, middleware) in | Workflow | What it runs | Ships to an API | |---|---|---| -| `checks.yml` | install, wire fixtures, 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; 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 an API carries: `orun plan --changed`, then one job per lane. A pull request runs the verify lanes (the Worker built, type-checked and dry-deployed per environment; the tests' `quick-check` lane installs and checks the package, it does not run them), except the bootstrap's own landings (`orun/BASE-*`), where `plan` alone is the check; a merge 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, the API built, dry-deployed and served | no | | `tag.yml` | cuts a `baseline-vN` tag (manual) | no | diff --git a/ai/context/deployment.md b/ai/context/deployment.md index 51176eb..0693b23 100644 --- a/ai/context/deployment.md +++ b/ai/context/deployment.md @@ -2,6 +2,6 @@ > Not rendered yet. The bootstrap's `02-docs` phase probes every live URL and > regenerates this file from what answered — the workspace, the URLs and -> their status, and the secrets inventory by name. Until then, nothing here +> their status, and the secrets the API uses, by name. Until then, nothing here > claims the API is live. The operating contract is > [operations.md](operations.md). diff --git a/ai/context/operations.md b/ai/context/operations.md index 94619a3..03f326c 100644 --- a/ai/context/operations.md +++ b/ai/context/operations.md @@ -1,7 +1,7 @@ # hono-api — operating contract (for humans and agents) This is the standing guide to how this API is deployed and operated. -Instance facts (live URLs, workspace, secrets inventory) live in +Instance facts (live URLs, workspace, the secrets it uses) live in [deployment.md](deployment.md), rendered from probed reality by the bootstrap's `02-docs` phase; this file is the contract that stays true between deployments. It is written to give an agent with repository read @@ -18,14 +18,17 @@ desired-state repo. text, `GET /health` answers `{"status":"ok","name":…,"environment":…}`, anything else is a 404. It binds nothing — no KV, D1, R2 or service binding — and holds no runtime secret. -- **`tests/api`** — vitest driving the app in-process with `app.request()`, - verified on the `dev` rung. +- **`tests/api`** — vitest driving the app in-process with `app.request()`. + A pull request's lanes do not run it (its `quick-check` lane on `dev` + installs and checks the package; the Worker's lanes build, type-check and + dry-deploy it): run `pnpm typecheck`, `pnpm lint` and `pnpm test` before + you push. - **`tooling/*`** — shared TypeScript and ESLint configuration, and the deploy-time wrangler renderer for workers that take wiring. Environments: **`stage`** and **`prod`** are deployed; **`dev` is -verify-only by design** — lanes build, test and dry-run the deploy, nothing -deploys. +verify-only by design** — lanes build, type-check and dry-run the deploy, +nothing deploys. ## Identity and tenancy diff --git a/apps/api/component.yaml b/apps/api/component.yaml index 86310e7..3a05170 100644 --- a/apps/api/component.yaml +++ b/apps/api/component.yaml @@ -7,7 +7,18 @@ spec: type: cloudflare-worker-turbo lifecycle: production owner: platform - domain: api + # Its pages, attached to it in the workspace's catalog: what the Docs + # library shows for it, and what the catalog's docs and runbook checks read. + # Generated from what this manifest and its sources declare. + docs: + overview: docs/overview.md + pages: + - { path: docs/architecture.md, role: architecture, title: Architecture } + - { path: docs/runbook.md, role: runbook, title: Runbook } + # `app`, not `api`: a domain and a component share one name space in the + # catalog, and a domain called `api` would take this component's place in + # it — the API missing from its own catalog. + domain: app path: apps/api # No dependsOn: the API reads no wiring and binds nothing, so there is no # infra component to deploy before it. A component under infra/ that this diff --git a/blueprint.yaml b/blueprint.yaml index 838ad1c..5f78e3f 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -22,7 +22,7 @@ metadata: welcome route and a JSON health check — bundled by wrangler into one Cloudflare Worker with no adapter, vitest tests that drive it in-process, and CI that deploys it to stage and prod on merge, smoke-tested over HTTP. - One provider, one consent, one landing. Live in under ten minutes. + One provider, one consent, one landing. Live in about six minutes. tags: [api, hono, workers, cloudflare, typescript] spec: source: @@ -103,11 +103,12 @@ spec: from: connection.cloudflare.workersSubdomain # ── PREVIEW ONLY. repo-blueprint.yaml's `orun.integrations/reconcile@v1` - # hooks mint these, brokered, during 01-product. ────────────────────────── - # Transcribed from those hooks' own `keys:` and `template:` values, so - # testing/manifest.test.sh compares this list to the document that mints - # them. The console renders them read-only: no credential is ever typed, - # shown or stored. Keys that already exist are kept. + # hook mints these, brokered, during 01-product. ────────────────────────── + # Transcribed from that hook's own `secrets:` list (each key and its + # `template:`), so testing/manifest.test.sh compares this list to the + # document that mints them. The console renders them read-only: no + # credential is ever typed, shown or stored. Keys that already exist are + # kept. secrets: - key: CLOUDFLARE_API_TOKEN provider: cloudflare @@ -134,9 +135,9 @@ spec: # THE BUILD DOCUMENT. There is no umbrella workflow and no agent brief: # every phase is declared in it and orun runs it. blueprint: repo-blueprint.yaml - # Summed from the phases' expectedMinutes (01-product 6, 02-docs 3). An - # estimate until a bootstrap measures it. - expectedMinutes: 9 + # Summed from the phases' expectedMinutes (01-product 5, 02-docs 1). An + # estimate until a bootstrap of this shape measures it. + expectedMinutes: 6 tokenChannel: ORUN_TOKEN_FILE # how a runner hands over its refreshed token # The API's URL per environment, as the console links it: the welcome route. # The phases' own probes read /health on the same Worker. diff --git a/docs/phases/01-product.md b/docs/phases/01-product.md index 7472544..7ed74fb 100644 --- a/docs/phases/01-product.md +++ b/docs/phases/01-product.md @@ -3,7 +3,7 @@ **Places** everything an API built from this baseline is made of, as ONE pull request: the root manifests (`intent.yaml`, `package.json`, the pnpm workspace and lockfile, `turbo.json`), `.github/workflows` -(`ci.yml` and `checks.yml` — the baseline's own `baseline.yml` and +(`ci.yml` — the baseline's own `baseline.yml` and `tag.yml` are ignored), the shared TypeScript/ESLint config and the wrangler renderer, the API's README and its two context pages, the identity file `.rebrand/values.json`, `.gitkeep` files for the four discovery roots, and @@ -17,9 +17,12 @@ connection. ## What runs +The run's task set-up — the epic, both milestones, both tasks — runs in the +background from the start (`background: true`), so every hook up to `task` +runs beside it; `task` is the first that waits for it. + | hook | what it does | |---|---| -| `task` (pre) | finds the phase's task (opened by the run-level list) and yields its key | | `retouch` | the redeploy marker on `apps/api/component.yaml` and `tests/api/component.yaml` (`.baseline/tasks/01-product.TaskContract.yaml`'s `affects`) | | `git-init`, `git-stage` | the rebrand enumerates with `git ls-files`, so the tree is a staged repo first | | `rebrand` | renames the baseline's identity to the API's (`tooling/rebrand/rebrand.mjs`): the repo slug, the Worker name, the `API_NAME` seam, the domain, the subdomain | @@ -28,19 +31,19 @@ connection. | `promotion` | defers prod's wait on stage until `02-docs` (both environments deploy side by side) | | `dev-lanes` | keeps dev's verify lanes off main's convergences until `02-docs` | | `git-restage`, `rebrand-verify` | refuses the landing if any baseline identity is left | -| `pnpm-lockfile` | confirms the placed lockfile (`--lockfile-only`) | | `repo` | `orun.repo/ensure@v1` — creates `githuborg/reponame` (private unless `repoPrivate=false`) | | `link` | `orun cloud link` (best effort) then `orun cloud check` — an unlinked repo stops here | -| `secret-workers-deploy` | `orun.integrations/reconcile@v1` — ensures `CLOUDFLARE_API_TOKEN`, brokered from the Cloudflare connection with the `workers-deploy` scope | -| `secret-account-id` | ensures `CLOUDFLARE_ACCOUNT_ID`, the connection fact | -| `land` | one PR, waited for (Checks + `plan`) and merged | -| `converge` (await) | `orun.run/watch@v1` on the merge commit's run; resumes it up to three times | +| `secrets` | `orun.integrations/reconcile@v1`, both keys in one hook, created side by side: `CLOUDFLARE_API_TOKEN`, brokered from the Cloudflare connection with the `workers-deploy` scope; `CLOUDFLARE_ACCOUNT_ID`, the connection fact | +| `task` | finds the phase's task (opened by the run-level list) and yields its key — waiting, if it must, for the background set-up | +| `land` | one PR bound to the task, its commit checked in the box first (`checks: local`: `orun validate`, then `orun plan` as the PR and as the merge would plan it, under a second); merged without waiting for the PR's CI | +| `converge` (await) | `orun.run/watch@v1` on the merge commit's run, read every 5 s; resumes it up to three times | | `verify` (await) | `orun.http/probe@v1` on `/health` at both workers.dev URLs | There is no `orun.secrets/exists@v1` await: the API has no infra component, so nothing lease-publishes a `WIRING_*` secret. A product that adds one (a KV namespace, a D1 database) gives `apps/api/component.yaml` an enforced -`dependsOn` on it, and the bootstrap that builds it would await its wiring. +`dependsOn` on it and resolves its wiring from its secret refs, so a green +convergence already says the document is where every later run reads it. ## What the convergence does @@ -62,6 +65,12 @@ and — dev's push activation being deferred — nothing on dev. Each lane: Stage and prod deploy side by side (the promotion gate is deferred). +`api-tests` verifies on dev only, on a pull request, and its `quick-check` +lane installs and checks the package; it does not run the tests. The +landing's own pull request runs `plan` alone, and nothing waits for it — the +same plan ran in the box before the push: the baseline's own CI installs, +type-checks, lints, tests and builds this exact tree before a tag is cut. + ## Verified The convergence run for the merge commit is green, and @@ -74,6 +83,7 @@ The convergence run for the merge commit is green, and | parks on `waiting for github for ` | the workspace's GitHub connection is to another account. Connect the App installation on `` (console → Integrations → GitHub), then `--resume` | | parks on the `providers` probe for cloudflare | Cloudflare is not connected to the workspace. Connect it (console → Integrations → Cloudflare, paste the Account API token) | | `link` fails: `… is not linked to workspace` | the credential cannot write links and the platform has not linked the repo. Allow-list it (console → Settings → Git repos) and re-run the phase | +| `land`: `the landing's own check failed — orun plan for …` | the placed tree does not plan; the next line is orun's error. Nothing was pushed. Fix it and re-run the phase | | `rebrand-verify` lists leftovers | a file carries an identity form no rule renames. Add a rule to `tooling/rebrand/rebrand.mjs` (and a case to `testing/rebrand.test.sh`) | | `intent.yaml` says `workspace: ws_SET_ME` | `orunWorkspace` was empty and the build ran outside a workspace. Set it and re-run | | deploy lane: `secret resolution failed … CLOUDFLARE_API_TOKEN` | the reconcile did not run or minted against a revoked connection. Re-connect and re-run the phase; the reconcile re-mints only what is missing | diff --git a/docs/phases/02-docs.md b/docs/phases/02-docs.md index f2232f8..5815948 100644 --- a/docs/phases/02-docs.md +++ b/docs/phases/02-docs.md @@ -11,12 +11,11 @@ no phase may require this one.) | hook | what it does | |---|---| -| `task` (pre) | finds the phase's task and yields its key | | `promotion` | restores `environments.prod.promotion` — from now on prod deploys only after stage | | `dev-lanes` | restores dev's activation on pushes to main | -| `render` | `hooks/render-deployment-docs.sh`: probes `/health` and `/` on both environments (and reads back the environment `/health` reports), lists the secrets by name and the workspace's integrations, and regenerates `ai/context/deployment.md` and the README's live-deployment section | -| `land` | one PR, waited for and merged. It touches no component, so it deploys nothing | -| `verify` (await) | the same `/health` probe `01-product` ended on | +| `render` | `hooks/render-deployment-docs.sh`: probes `/health` and `/` on both environments (and reads back the environment `/health` reports) and regenerates `ai/context/deployment.md` — the identity, the probed URLs, the secrets the deployment uses by name — and the README's live-deployment section. It asks the platform nothing: what the workspace holds right now is on the console's Secrets and Integrations pages, which the record points to | +| `task` | finds the phase's task and yields its key | +| `land` | one PR, its commit checked in the box (`checks: local`) and merged. It touches no component, so it deploys nothing — and there is nothing after it to wait for: the render's probes are the phase's check | ## Re-running it diff --git a/docs/phases/README.md b/docs/phases/README.md index 46ece6a..771456a 100644 --- a/docs/phases/README.md +++ b/docs/phases/README.md @@ -9,9 +9,13 @@ container the same operation as running them all. Each phase follows the same contract: -> **place its modules → brand them → land them as one pull request → watch -> the convergence that merge triggers (auto-resumed) → verify the outcome -> over HTTP.** +> **place its modules → brand them → check them in the box and land them as +> one pull request → watch the convergence that merge triggers +> (auto-resumed) → verify the outcome over HTTP.** + +The run's task set-up — the epic, a milestone per phase, a task per landing +— runs in the background from the start; the first hook that needs it, the +phase's `task`, waits for it. Run from the baseline checkout (the blueprint's source is `path: .`); the API's repository is wherever `--out` points. @@ -38,12 +42,16 @@ states it in the document: the engine refuses a phase whose predecessor is not placed, and names it. Every landing is a pull request on a branch named for its task -(`orun/BASE--`). On those branches `ci.yml` runs `plan` only — the -intent, every component and every composition resolve — and skips the lanes, +(`orun/BASE--`), checked before it is pushed: `orun validate`, then +`orun plan` as the pull request and as the merge would plan it, in the box, +in under a second (`checks: local`). Then it merges; nothing waits for the +PR's CI. On those branches `ci.yml` runs `plan` only and skips the lanes, because the merge runs them on main a minute later, for real, and that -convergence is what the phase watches. `checks.yml` (install, typecheck, lint, -test, build) runs on every pull request regardless, and the landing waits for -it. +convergence is what the phase watches. The API carries no other workflow: +the baseline's own CI (Tier 2) installs, renders the fixtures, type-checks, +lints, tests and builds each landing before a tag is cut, and every later +pull request in the API runs `ci.yml`'s verify lanes (the Worker built, +type-checked and dry-deployed; they do not lint or run the tests). | phase | lands | verified by | |---|---|---| @@ -108,9 +116,10 @@ lands, its `post` hooks make them the API's: deferrals → `git add` → `rebrand --verify` — the identity rename over the whole tree, the re-tenant, and a sweep that fails on any of this baseline's identity left behind. -4. `pnpm install --lockfile-only` — the baseline's complete lockfile is - already placed, so this confirms it. -5. `repo`, `link`, the two brokered credentials, `land`. +4. `repo`, `link`, the brokered credentials (one `secrets` hook), the + phase's `task` (waiting, if it must, for the background set-up), `land` + (checked in the box, then merged). The baseline's complete lockfile is + placed as it is; the lanes install it with `--frozen-lockfile`. ## When a phase fails diff --git a/hooks/render-deployment-docs.sh b/hooks/render-deployment-docs.sh index 3917273..d187006 100755 --- a/hooks/render-deployment-docs.sh +++ b/hooks/render-deployment-docs.sh @@ -9,15 +9,22 @@ # # What it writes (in ): # ai/context/deployment.md — REGENERATED: URLs with live probe results, -# identity, secrets inventory BY NAME, -# integrations +# identity, and the secrets the deployment +# uses BY NAME # ai/context/operations.md — healed from the baseline's copy if absent # (the static operating contract; never rewritten) # README.md — the section between # is replaced (appended after the title if the # README predates the markers) # -# No secret VALUE is ever read or written here — inventories are names only. +# No secret VALUE is ever read or written here — secrets are named, not read. +# +# IT ASKS THE PLATFORM NOTHING. The record used to carry the workspace's slug, +# its secrets listed per rung and its integrations — five CLI calls, one after +# another, from the build box — and all of it is what the console shows live +# and this file could only show as it was the day it was written. The record +# keeps what the repository is the right place for: the identity the code +# names, what answered at the URLs, and where to look for the rest. set -euo pipefail out="${1:?usage: render-deployment-docs.sh }" @@ -35,10 +42,6 @@ sub="$(val subdomain)"; [ -n "$sub" ] || sub="your-workers-subdomain" [ -n "$ws" ] || ws="$(sed -n 's/^[[:space:]]*workspace:[[:space:]]*\([^[:space:]#]*\).*/\1/p' intent.yaml | head -1)" [ -n "$ws" ] || ws="?" -# Workspace slug via the direct backend read; tolerate failure. -slug="$( { orun workspace "$ws" 2>/dev/null || true; } | sed -n 's/^ *slug: *//p' | head -1)" -[ -n "$slug" ] || slug="?" - # CI lane pin (what version the deploy lanes run). lanepin="$(sed -n 's/^ *version: *\(v[0-9.]*\) *$/\1/p' .github/workflows/ci.yml 2>/dev/null | head -1)" [ -n "$lanepin" ] || lanepin="?" @@ -65,17 +68,6 @@ for pair in "stage|$stage_url" "prod|$prod_url"; do rows+="| root (${env}) | ${url}/ | $(badge "$(probe "$url/")") |"$'\n' done -secrets_list() { { orun secrets list --org "$ws" "$@" 2>/dev/null || true; } | awk 'NR>1 && NF {print " - "$1}'; } -secrets_proj="$(secrets_list --project)"; [ -n "$secrets_proj" ] || secrets_proj=" - (listing unavailable to this credential)" -secrets_stage="$(secrets_list --env stage)"; [ -n "$secrets_stage" ] || secrets_stage=" - (listing unavailable to this credential)" -secrets_prod="$(secrets_list --env prod)"; [ -n "$secrets_prod" ] || secrets_prod=" - (listing unavailable to this credential)" -integrations="$( { orun integrations list --org "$ws" --json 2>/dev/null || true; } | python3 -c " -import json,sys -try: rows=json.load(sys.stdin) -except Exception: rows=[] -out=[f\" - {r.get('provider','?')}: {r.get('status','?')}\" for r in rows] -print('\n'.join(out) if out else ' - (listing unavailable to this credential)')" )" - now="$(date -u +%Y-%m-%dT%H:%M:%SZ)" # Heal the static operating contract when the API predates it. @@ -92,15 +84,14 @@ cat > ai/context/deployment.md < GENERATED by the \`02-docs\` phase on ${now}; re-run it to refresh > (idempotent; see [operations.md](operations.md)). Hand-edits here are -> overwritten. No secret values appear in this file — inventories are names -> only. +> overwritten. No secret values appear in this file — secrets are named only. ## Identity | | | |---|---| | repository / project slug | \`${repo}\` | -| Orun workspace | \`${ws}\` (slug \`${slug}\`) | +| Orun workspace | \`${ws}\` | | declared in | \`intent.yaml\` → \`execution.state.workspace\` | | Workers | \`${brand}-api-stage\`, \`${brand}-api-prod\` on \`${sub}.workers.dev\` | | CI lane CLI pin | orun \`${lanepin}\` (\`.github/workflows/ci.yml\`) | @@ -112,23 +103,18 @@ cat > ai/context/deployment.md <" body = f"""{begin} -This API is **live**. Verified URLs, identity and the secrets inventory are +This API is **live**. Verified URLs, identity and the secrets it uses are recorded in [ai/context/deployment.md](ai/context/deployment.md) (re-rendered by the `02-docs` phase); how it deploys and how to operate it: [ai/context/operations.md](ai/context/operations.md). diff --git a/repo-blueprint.yaml b/repo-blueprint.yaml index 0753f75..dba487e 100644 --- a/repo-blueprint.yaml +++ b/repo-blueprint.yaml @@ -175,6 +175,10 @@ modules: source: baseline from: pnpm-workspace.yaml to: pnpm-workspace.yaml + # The baseline's complete lockfile, as it is: the whole tree lands at once + # and the lockfile carries no identity, so there is nothing to re-resolve — + # the lanes install it with --frozen-lockfile, and the baseline's own CI + # (testing/e2e.test.sh) does the same on this exact tree before a tag. - name: root-pnpm-lock mode: copy source: baseline @@ -284,16 +288,25 @@ modules: # new milestone after the last, and a task naming a milestone the epic does # not have yet would create it out of order. # -# Each phase's own `pre` hook runs `orun.task/ensure@v1` on its task again. -# Same identity, so it finds rather than creates, and it is how the phase gets -# the task's KEY for its landing. The MILESTONE keeps the phase's name: it is -# the identity the engine's phase events, the plane's evidence and the -# console's rows all meet on, and the card's `programme.milestones` names the -# same list. +# IN THE BACKGROUND (orun >= v2.88.0, `background: true` on every hook here). +# Nothing a phase does before its landing reads the task plane — the provider +# check, the placement, the rebrand, the repository, the secrets — so the +# whole list runs beside 01-product instead of before it, in order. A hook +# that works on the plane (`orun.task/ensure@v1`, `orun.pr/land@v1`) waits +# for it to finish; a failure here stops the build at the next hook. +# +# Each phase's own `task` hook runs `orun.task/ensure@v1` on its task again, +# just before its landing. Same identity, so it finds rather than creates, +# and it is how the phase gets the task's KEY for its landing; it sits in +# `post` rather than `pre` so that everything before it overlaps with this +# list. The MILESTONE keeps the phase's name: it is the identity the engine's +# phase events, the plane's evidence and the console's rows all meet on, and +# the card's `programme.milestones` names the same list. hooks: preInstantiate: - id: epic uses: orun.task/ensure@v1 + background: true with: kind: epic slug: "{{ .inputs.epicSlug }}" @@ -308,6 +321,7 @@ hooks: owner: me - id: m01 uses: orun.task/ensure@v1 + background: true with: kind: milestone epic: "{{ .inputs.epicSlug }}" @@ -318,6 +332,7 @@ hooks: - /health answers on both workers.dev URLs - id: m02 uses: orun.task/ensure@v1 + background: true with: kind: milestone epic: "{{ .inputs.epicSlug }}" @@ -327,6 +342,7 @@ hooks: - prod waits on stage again - id: t01 uses: orun.task/ensure@v1 + background: true with: kind: task epic: "{{ .inputs.epicSlug }}" @@ -342,6 +358,7 @@ hooks: contract: .baseline/tasks/01-product.TaskContract.yaml - id: t02 uses: orun.task/ensure@v1 + background: true with: kind: task epic: "{{ .inputs.epicSlug }}" @@ -375,7 +392,14 @@ phases: - name: 01-product title: The API, built in one landing description: The whole tree — manifests, CI, tooling, identity, the Worker and its tests — branded, landed as one pull request, and deployed by one convergence. - expectedMinutes: 6 + # An estimate until a bootstrap of this shape measures it: a minute under + # the one-landing estimate, for what orun v2.88.0 takes out of a build + # (turso-starter measured about that much) — the task set-up in the + # background, the landing checked here instead of by a runner, the watch + # reading every 5 s instead of 40. The rest is the merge's convergence: + # the Worker's install, build, deploy and smoke, stage and prod side by + # side. + expectedMinutes: 5 narrate: start: "Creating the repository and landing the whole API in one pull request — intent, CI, tooling, the Worker and its tests. Then one convergence deploys it to stage and prod side by side. Usually about {{ .meta.expectedMinutes }} minutes." await: "One convergence is deploying the API to stage and prod: install, build, deploy and a smoke against /health in each. Nothing is stuck." @@ -399,21 +423,10 @@ phases: waitSeconds: 600 pollSeconds: 20 hooks: - pre: - # The epic, the milestones and the tasks already exist (the run-level - # list above). This finds the task and yields its key, which the - # landing binds the pull request to. - - id: task - uses: orun.task/ensure@v1 - with: - kind: task - epic: "{{ .inputs.epicSlug }}" - milestone: "{{ .phase.name }}" - name: "Build the API in one landing" - prefix: BASE - contract: .baseline/tasks/01-product.TaskContract.yaml - # The identity chain, then the repository, its link, its credentials and - # the landing — cirrus-baseline's 01-product, hook for hook. + # The identity chain, then the repository, its link, its credentials, + # the task and the landing — cirrus-baseline's 01-product, hook for + # hook. No `pre` hook: the task is found just before the landing, so + # everything before it runs beside the background task set-up. # # rebrand.mjs enumerates the tree with `git ls-files`, so the output has # to be a git repository with a populated index BEFORE it runs. `git add @@ -486,11 +499,6 @@ phases: run: ["git", "add", "-A"] - id: rebrand-verify run: ["node", "{{ .baseline.dir }}/tooling/rebrand/rebrand.mjs", "--verify", "--values", ".rebrand/values.json"] - # root-pnpm-lock placed the baseline's complete lockfile and the whole - # tree is here, so this only confirms it — the lanes and Checks - # install with --frozen-lockfile. The lockfile carries no identity. - - id: pnpm-lockfile - run: ["pnpm", "install", "--lockfile-only"] # The repo has to exist before there is anywhere to land. - id: repo uses: orun.repo/ensure@v1 @@ -519,30 +527,45 @@ phases: - link - "{{ .inputs.orunWorkspace }}" - "{{ .inputs.githuborg }}/{{ .inputs.reponame }}" - # The deploy credentials, brokered, one hook per template: - # `integrations/reconcile` mints from ONE connection with ONE scope - # template. The deploy lane binds both keys (the Worker composition's + # The deploy credentials, brokered, in ONE hook (orun >= v2.87.0): + # `secrets` mints each key under its own scope template from the one + # connection the build is bound to, reading the connections and the + # existing secrets once and creating the missing keys side by side. + # The deploy lane binds both keys (the Worker composition's # `secretBindings`); the API reads no D1, R2, Hyperdrive or DNS, so no # other scope is asked for. Keys that already exist are kept. After the # link, before the landing whose convergence uses them. - - id: secret-workers-deploy + - id: secrets uses: orun.integrations/reconcile@v1 with: provider: cloudflare - keys: [CLOUDFLARE_API_TOKEN] - template: workers-deploy - - id: secret-account-id - uses: orun.integrations/reconcile@v1 + secrets: + - { key: CLOUDFLARE_API_TOKEN, template: workers-deploy } + - { key: CLOUDFLARE_ACCOUNT_ID, template: account-id } + # The task this landing closes, and its key. The run-level list above + # opens it in the background; this is the first hook that needs it, + # so it is the one that waits for that list (orun >= v2.88.0) — every + # hook before it ran while the task plane was still being set up. + - id: task + uses: orun.task/ensure@v1 with: - provider: cloudflare - keys: [CLOUDFLARE_ACCOUNT_ID] - template: account-id - # THE API IS A PULL REQUEST THAT IS CHECKED, THEN MERGED. This landing - # waits for its PR's whole CI run (orun >= v2.58.6): Checks over the - # whole tree, and `plan` — on a bootstrap branch (`orun/BASE-…`) the - # lanes are skipped (ci.yml), because the merge runs every one of them - # on main a minute later, for real, and the convergence after the - # merge is what this phase watches to green. + kind: task + epic: "{{ .inputs.epicSlug }}" + milestone: "{{ .phase.name }}" + name: "Build the API in one landing" + prefix: BASE + contract: .baseline/tasks/01-product.TaskContract.yaml + # THE API IS A PULL REQUEST THAT IS CHECKED, THEN MERGED — checked + # HERE (`checks: local`, orun >= v2.88.0): `orun validate`, then + # `orun plan` as the pull request and as the merge to main plan it, + # on the commit, before it is pushed. That is what the PR's `plan` + # job checks (the intent, every component and every composition + # resolve), plus the merge's own plan, in under a second instead of a + # runner's ~25 s. A tree that fails is never pushed. The PR's CI still + # runs (`plan` alone on a bootstrap branch, `orun/BASE-…`, ci.yml); + # nothing waits for it. The merge runs every lane on main a minute + # later, for real, and the convergence after the merge is what this + # phase watches to green. - id: land uses: orun.pr/land@v1 narrate: "The API is merged into main." @@ -551,8 +574,13 @@ phases: epic: "{{ .inputs.epicSlug }}" branchSlug: "{{ .phase.name }}" title: "feat: {{ .inputs.productname }}, a Hono API on Workers, live on stage and prod" + checks: local # No wiring await: the API has no infra component, so nothing - # lease-publishes a WIRING_* secret for `orun.secrets/exists@v1` to find. + # lease-publishes a WIRING_* secret. (With one, none would be needed + # either while the Worker resolves the document in this convergence + # from its component.yaml secret refs, where every later run reads it: + # a missing one fails its lane, so a green run already says it is + # there.) await: - id: converge uses: orun.run/watch@v1 @@ -565,6 +593,9 @@ phases: repo: "{{ .inputs.githuborg }}/{{ .inputs.reponame }}" resumeBudget: 3 waitSeconds: 1800 + # Read every 5 s, not the action's 40: the build goes on the + # moment the run is green instead of up to 40 s after it. + pollSeconds: 5 - id: verify uses: orun.http/probe@v1 narrate: "The API's /health answered on stage and prod." @@ -574,31 +605,22 @@ phases: - "https://{{ .inputs.reponame }}-api-prod.{{ .inputs.subdomain }}.workers.dev/health" # Places nothing. It records what 01-product built, from PROBED facts rather - # than from what the blueprint intended — which is why it runs last and why - # its verify is the probe 01-product ends on. + # than from what the blueprint intended — which is why it runs last. Its + # render probes every URL as it writes the record, and this landing + # redeploys nothing, so there is no probe after it to wait for. - name: 02-docs title: The deployment, recorded description: The live-deployment manifest, rendered from probed reality, and the promotion gate and dev's lanes put back. - expectedMinutes: 3 + # An estimate: the render's probes, a landing checked here, the merge. + expectedMinutes: 1 narrate: start: "Now recording what was actually built — probing every URL and writing the deployment manifest into the repository." - await: "Probing the live endpoints one last time." done: "ai/context/deployment.md now records the live deployment, written from probed facts, and prod waits on stage again. {{ .meta.elapsed }}." failed: "The deployment record did not land. The API is still live; only the write-up is missing." modules: [] requires: phases: [01-product] hooks: - pre: - - id: task - uses: orun.task/ensure@v1 - with: - kind: task - epic: "{{ .inputs.epicSlug }}" - milestone: "{{ .phase.name }}" - name: "Record the live deployment" - prefix: BASE - contract: .baseline/tasks/02-docs.TaskContract.yaml post: # THE API GOES LIVE WITH ITS PROMOTION GATE. 01-product deferred # `prod.promotion.dependsOn: [stage]`; this, the last landing, puts it @@ -613,6 +635,16 @@ phases: run: ["node", "{{ .baseline.dir }}/tooling/bootstrap/dev-lanes.mjs", "--restore"] - id: render run: ["bash", "{{ .baseline.dir }}/hooks/render-deployment-docs.sh", ".", "{{ .inputs.orunWorkspace }}", "{{ .baseline.dir }}"] + - id: task + uses: orun.task/ensure@v1 + with: + kind: task + epic: "{{ .inputs.epicSlug }}" + milestone: "{{ .phase.name }}" + name: "Record the live deployment" + prefix: BASE + contract: .baseline/tasks/02-docs.TaskContract.yaml + # Checked here and merged, as 01-product's landing is. - id: land uses: orun.pr/land@v1 narrate: "The deployment record is merged into main." @@ -621,11 +653,4 @@ phases: epic: "{{ .inputs.epicSlug }}" branchSlug: "{{ .phase.name }}" title: "docs(deployment): record the live deployment state" - await: - - id: verify - uses: orun.http/probe@v1 - narrate: "Every live URL answered on the final probe." - with: - urls: - - "https://{{ .inputs.reponame }}-api-stage.{{ .inputs.subdomain }}.workers.dev/health" - - "https://{{ .inputs.reponame }}-api-prod.{{ .inputs.subdomain }}.workers.dev/health" + checks: local diff --git a/testing/coverage.test.sh b/testing/coverage.test.sh index ee53f36..85e717c 100755 --- a/testing/coverage.test.sh +++ b/testing/coverage.test.sh @@ -95,6 +95,52 @@ for comp in BASELINE_ONLY: if not (root / comp).exists(): bad(f"{comp} is declared baseline-only and does not exist — drop the entry") +# ── WHAT THE CATALOG SEES OF EACH COMPONENT ─────────────────────────────── +# +# Every component ships its generated pages (overview, architecture, runbook — +# tooling/catalog/gen-component-docs.py) and must ATTACH them in `spec.docs`: +# a `docs/` folder no manifest declares is never attached, so a fresh API's +# Docs library showed nothing for either component and the catalog failed +# both on docs and on runbook (found on turso-starter, whose components +# shipped the same generated pages undeclared, as these did). A component +# also needs a description: it is the catalog's one-line answer to "what is +# this", and the test suite had none. +# +# And a domain may not share a component's name. The catalog keys entities by +# name, so a domain called `web` took the `web` component's place on +# turso-starter, and the product's one deployable was missing from its own +# catalog; `apps/api` declared the domain `api`. A domain is read where a +# manifest can declare one: `spec.domain` and `labels.domain`. +WANT_DOCS = {"overview": "docs/overview.md", "architecture": "docs/architecture.md", "runbook": "docs/runbook.md"} +names, domains = {}, {} +for comp in components: + if comp in BASELINE_ONLY: + continue + doc = yaml.safe_load((root / comp / "component.yaml").read_text()) or {} + meta, spec = doc.get("metadata") or {}, doc.get("spec") or {} + names[meta.get("name")] = comp + for dom in (spec.get("domain"), (meta.get("labels") or {}).get("domain"), + (spec.get("labels") or {}).get("domain")): + if dom: + domains.setdefault(dom, comp) + if not (meta.get("description") or "").strip(): + bad(f"{comp}/component.yaml has no metadata.description — the catalog shows the component with nothing to say") + docs = spec.get("docs") or {} + got = {"overview": docs.get("overview")} + for page in docs.get("pages") or []: + got[page.get("role")] = page.get("path") + for role, path in WANT_DOCS.items(): + if got.get(role) != path: + bad(f"{comp}/component.yaml does not attach {path} as its {role} " + f"(spec.docs) — the page ships and the catalog never sees it") + elif not (root / comp / path).is_file(): + bad(f"{comp}/component.yaml attaches {path}, which does not exist — " + f"generate it: python3 tooling/catalog/gen-component-docs.py") +for domain, comp in sorted(domains.items()): + if domain in names: + bad(f"{comp} declares domain `{domain}`, which is also the name of the " + f"component in {names[domain]} — the catalog keeps one of the two") + # ── WHAT `ignore` ACTUALLY EXCLUDES (BE6) ────────────────────────────────── # # orun matches an ignore entry two ways, and WHICH ONE depends on the entry: diff --git a/testing/e2e.test.sh b/testing/e2e.test.sh index fb7bf0f..3e19492 100755 --- a/testing/e2e.test.sh +++ b/testing/e2e.test.sh @@ -4,11 +4,17 @@ # placement.test.sh proves the tree a bootstrap ends with is the right tree. # This proves it WORKS, by doing to it what its own pipelines will: # -# 1. at the 01-product landing (the commit its one pull request merges), run -# what `checks.yml` runs on that PR — install with the placed lockfile, -# render fixtures, typecheck, lint, test, build. That landing WAITS on its -# checks, so a product they refuse is a bootstrap that never lands; then -# the same at the 02-docs landing, which waits on them too; +# 1. at the 01-product landing (the commit its one pull request merges), +# the landing's own checks — install with the lockfile the API ships, +# render fixtures, typecheck, lint, test, build; then the same at the +# 02-docs landing. Both landings are checked in the box with +# `orun validate` and `orun plan` alone (`checks: local`; their PR's CI +# on an `orun/BASE-…` branch is `plan` alone, and the convergence on +# main builds, deploys and smoke-tests the API), and a later pull +# request of the API runs ci.yml's verify lanes, which build, type-check +# and dry-deploy the Worker — so THIS is where the lint and the tests run +# over a bootstrapped API: before the tag, not after a build has merged +# it; # 2. the stage lane's own steps, read out of `orun plan` in the product for a # pull request — EVERY `run:` step of the job, in order, exactly as # planned: the install, `verify-worker-structure` (the committed @@ -65,24 +71,26 @@ sub="$(python3 -c "import json,sys;print(json.load(open(sys.argv[1]))['subdomain export CI=1 WRANGLER_SEND_METRICS=false TURBO_TELEMETRY_DISABLED=1 free_port() { python3 -c "import socket;s=socket.socket();s.bind(('127.0.0.1',0));print(s.getsockname()[1]);s.close()"; } -# What checks.yml runs, step for step, read out of the workflow the product -# carries so the two cannot drift: every `run:` of its one job, in order. +# The landing's own checks, step for step, run here at once on the whole +# tree. A pull request in the API builds, type-checks and dry-deploys the +# Worker through ci.yml's lanes; the lint and the tests run here, and by hand +# before a push. +LANDING_CHECKS=( + "pnpm install --frozen-lockfile" + "pnpm run wire:fixture" + "pnpm typecheck" + "pnpm lint" + "pnpm test" + "pnpm build" +) checks() { # DIR LOG local dir="$1" log="$2" cmd - while IFS= read -r cmd; do + for cmd in "${LANDING_CHECKS[@]}"; do echo " \$ $cmd" | tee -a "$log" if ! (cd "$dir" && bash -c "$cmd") >> "$log" 2>&1; then echo "FAIL: \`$cmd\` failed in $dir" >&2; tail -40 "$log" >&2; return 1 fi - done < <(python3 - "$dir/.github/workflows/checks.yml" <<'PY' -import sys, yaml -wf = yaml.safe_load(open(sys.argv[1])) -for job in wf["jobs"].values(): - for step in job["steps"]: - if "run" in step: - print(step["run"].strip()) -PY -) + done } echo "── the offline bootstrap (testing/lib/bootstrap.sh)" @@ -92,8 +100,8 @@ bootstrap_offline "$root" "$tree" "$values" "$scratch/logs" > "$scratch/bootstra s00="$(git -C "$tree" rev-parse HEAD~2)"; s01="$(git -C "$tree" rev-parse HEAD~1)" echo " 2 phases placed and landed on orun's Initial commit" -# ── 1. the checks each landing waits on ──────────────────────────────────── -echo "── 01-product's landing, under the checks its PR waits on" +# ── 1. each landing's own checks ─────────────────────────────────────────── +echo "── 01-product's landing: install, the fixture render, typecheck, lint, test, build" git -C "$tree" worktree add -q "$scratch/at-01" "$s01" checks "$scratch/at-01" "$scratch/checks-01.log" git -C "$tree" worktree remove --force "$scratch/at-01" diff --git a/testing/leak.test.sh b/testing/leak.test.sh index 66bfc11..ee57502 100755 --- a/testing/leak.test.sh +++ b/testing/leak.test.sh @@ -90,7 +90,7 @@ for p in placed: # ── the API's README, not this repository's ─────────────────────────────── if "README.md" not in placed: bad("README.md would not ship") -for must in (".github/workflows/ci.yml", ".github/workflows/checks.yml", +for must in (".github/workflows/ci.yml", "apps/api/component.yaml", "apps/api/wrangler.jsonc", "apps/api/src/index.ts", "apps/api/src/identity.ts", "tests/api/component.yaml", "tests/api/src/app.test.ts", "tooling/wire/render.mjs", ".rebrand/values.json", "pnpm-lock.yaml"): diff --git a/testing/lib/bootstrap.sh b/testing/lib/bootstrap.sh index aa5774a..522ee5e 100755 --- a/testing/lib/bootstrap.sh +++ b/testing/lib/bootstrap.sh @@ -18,8 +18,8 @@ # workspace; # - `{{ .inputs.* }}` render from the fixture. # Everything else — the rebrand, the re-tenant, the work-tree strip, the -# deferrals and their restore, the retouch marker, the lockfile seed and -# prune, the deployment-docs render — runs exactly as declared. +# deferrals and their restore, the retouch marker, the deployment-docs +# render — runs exactly as declared. # # Needs: orun, node, pnpm, python3 (+PyYAML), git. diff --git a/testing/manifest.test.sh b/testing/manifest.test.sh index 5374cb5..a834d4d 100755 --- a/testing/manifest.test.sh +++ b/testing/manifest.test.sh @@ -83,13 +83,16 @@ def uses(phase, action): yield hook # THE SECRETS THE BOOTSTRAP MINTS. `orun.integrations/reconcile@v1` is what -# `create-secrets.sh` was written out longhand as: one connection, one scope -# template, the keys it ensures. Read per key so a hook minting two keys under -# one template is three facts rather than one. +# `create-secrets.sh` was written out longhand as: one connection, and per key +# the scope template it is minted under — `secrets: [{key, template}]`, or +# `keys` sharing one `template`. Read per key so a hook minting two keys is +# two facts rather than one. blueprint_secrets = {} for phase in bp_phases: for hook in uses(phase, "orun.integrations/reconcile@v1"): w = hook.get("with") or {} + for item in (w.get("secrets") or []): + blueprint_secrets[item.get("key")] = (w.get("provider"), item.get("template")) for key in (w.get("keys") or []): blueprint_secrets[key] = (w.get("provider"), w.get("template")) diff --git a/testing/phases.test.sh b/testing/phases.test.sh index 6b80430..18f90f2 100755 --- a/testing/phases.test.sh +++ b/testing/phases.test.sh @@ -16,6 +16,12 @@ # what `01-product` deferred. The hook chain of `01-product` is cirrus's, # hook for hook, and is pinned below. # +# And the shape that keeps a bootstrap fast (orun >= v2.88.0, ported from +# sourceplane/turso-starter's copy of this file): the run-level task set-up +# runs in the background, each phase finds its task just before its landing, +# each landing checks its commit here (`checks: local`), and the convergence +# watch reads every few seconds. +# # Adapted from sourceplane/cirrus-baseline's testing/phases.test.sh: the # narration rules and the hook-only rule are Cirrus's, unchanged. # @@ -224,8 +230,15 @@ def check_line(where, line, slot, hook_ids): for p in phases: n = p.get("narrate") or {} ids = {h.get("id") for h in hooks_of(p)} + awaits = bool((p.get("hooks") or {}).get("await")) for slot in ("start", "await", "done", "failed"): line = n.get(slot) + if slot == "await" and not awaits: + # A phase that waits on nothing never says its await line. + if line: + bad(f"phase {p['name']} declares narrate.await and has no await hooks — " + f"nobody would ever read it") + continue if not line: bad(f"phase {p['name']} declares no narrate.{slot}") continue @@ -262,34 +275,49 @@ if watching != DEPLOYS: # ── 01-product's hook chain is cirrus-baseline's ───────────────────────────── # The identity chain (retouch before git exists, then git, rebrand, re-tenant, -# the work-tree strip, the two deferrals, restage, verify), the lockfile, the -# repository and its link, the brokered credentials — one reconcile per key, -# after the link and before the landing whose convergence uses them — and the -# landing. +# the work-tree strip, the two deferrals, restage, verify), the repository and +# its link, the brokered credentials — ONE `secrets` reconcile (orun >= +# v2.87.0), after the link and before the landing whose convergence uses +# them — then the task, found just before the landing so that everything +# before it runs beside the background task set-up, and the landing. No +# lockfile hook: the shipped lockfile is installed frozen by the lanes and by +# testing/e2e.test.sh. No phase has a `pre` hook. +PRE = {"01-product": [], "02-docs": []} CHAIN = ["retouch", "git-init", "git-stage", "rebrand", "orun-workspace", "work-tree", "promotion", "dev-lanes", "git-restage", "rebrand-verify", - "pnpm-lockfile", "repo", "link", "land"] -TYPED = {"repo": "orun.repo/ensure@v1", "land": "orun.pr/land@v1"} + "repo", "link", "secrets", "task", "land"] +TYPED = {"repo": "orun.repo/ensure@v1", "secrets": "orun.integrations/reconcile@v1", + "task": "orun.task/ensure@v1", "land": "orun.pr/land@v1"} RUN_HAS = {"retouch": "retouch.mjs", "work-tree": "work-tree.mjs --strip", "promotion": "promotion.mjs --defer", "dev-lanes": "dev-lanes.mjs --defer", - "rebrand": "rebrand.mjs --values", "rebrand-verify": "rebrand.mjs --verify", - "pnpm-lockfile": "pnpm install --lockfile-only"} + "rebrand": "rebrand.mjs --values", "rebrand-verify": "rebrand.mjs --verify"} +for name, want in PRE.items(): + got = [h.get("id") for h in ((by_name.get(name, {}).get("hooks") or {}).get("pre") or [])] + if got != want: + bad(f"phase {name}'s pre hooks are {got}; want {want} — a task found in `pre` waits " + f"for the background task set-up before the phase has done anything") product = by_name.get("01-product") or {} post = (product.get("hooks") or {}).get("post") or [] -reconciles = [h for h in post if (h.get("uses") or "") == "orun.integrations/reconcile@v1"] -chain = [h.get("id") for h in post if h not in reconciles] +chain = [h.get("id") for h in post] if chain != CHAIN: - bad(f"01-product's post hooks are {chain} (reconciles aside); cirrus-baseline's are {CHAIN}") -ids = [h.get("id") for h in post] -if reconciles and "link" in ids and "land" in ids: - at = [ids.index(h.get("id")) for h in reconciles] - if at != list(range(ids.index("link") + 1, ids.index("land"))): - bad("01-product's reconcile hooks must sit together between `link` and `land`") + bad(f"01-product's post hooks are {chain}; cirrus-baseline's are {CHAIN}") +# One reconcile per provider, every key it mints listed in `secrets:` with its +# own template: one connections read and one secrets read for all of them, +# the missing keys created side by side — not one hook (and two round trips) +# per key. +reconciles = [h for h in post if (h.get("uses") or "") == "orun.integrations/reconcile@v1"] if not reconciles: bad("01-product mints no credential — its convergence deploys, and binds CLOUDFLARE_API_TOKEN") +providers = [(h.get("with") or {}).get("provider") for h in reconciles] +if len(set(providers)) != len(providers): + bad(f"01-product reconciles {providers} — one hook per provider, its keys in `secrets:`") for h in reconciles: - if len((h.get("with") or {}).get("keys") or []) != 1: - bad(f"reconcile hook {h.get('id')} mints {(h.get('with') or {}).get('keys')} — one key per hook, one scope per key") + w = h.get("with") or {} + items = w.get("secrets") or [] + if w.get("keys") or w.get("template") or not items or \ + any(not (i or {}).get("key") or not (i or {}).get("template") for i in items): + bad(f"reconcile hook {h.get('id')} does not mint its keys as `secrets: [{{key, template}}]` — " + f"one hook per provider, each key under its own scope template") for h in post: want = TYPED.get(h.get("id")) if want and h.get("uses") != want: @@ -298,14 +326,27 @@ for h in post: if need and need not in " ".join(h.get("run") or []): bad(f"01-product hook {h.get('id')} does not run `{need}`") -# The await: the convergence of the merge commit, then the wiring the infra -# lease-publishes (only when there IS infra), then the URLs. +# The await: the convergence of the merge commit, then the URLs. There is no +# wiring await (orun.secrets/exists@v1): this API has no infra component, so +# nothing lease-publishes a WIRING_* document. Were one added, its readers +# would prove it instead — the Worker resolving the document in the same +# convergence from its component.yaml secret refs, where every later run +# reads it, fail-closed — which is the rule sourceplane/turso-starter's copy +# of this file holds. It is not ported here because there is nothing for it +# to read, so an infra component stops this test until it is (or until its +# wiring is awaited again). infra = sorted(c for c in components if c.startswith("infra/")) +if infra: + bad(f"{infra} would publish wiring this file does not check — port turso-starter's reader " + f"rule (each WIRING_* resolved in the convergence on stage and prod, the reader waiting " + f"for its publisher on main), or await it with orun.secrets/exists@v1") awaits = (product.get("hooks") or {}).get("await") or [] +if [h.get("id") for h in awaits] != ["converge", "verify"]: + bad(f"01-product's await hooks are {[h.get('id') for h in awaits]}; want ['converge', 'verify']") kinds = [(h.get("uses") or "").split("@")[0] for h in awaits] -want_kinds = ["orun.run/watch"] + (["orun.secrets/exists"] if infra else []) + ["orun.http/probe"] +want_kinds = ["orun.run/watch", "orun.http/probe"] if kinds != want_kinds: - bad(f"01-product awaits {kinds}; with {len(infra)} infra component(s) it must await {want_kinds}") + bad(f"01-product awaits {kinds}; it must await {want_kinds}") probe_urls = [] for h in awaits: if (h.get("uses") or "").startswith("orun.http/probe@"): @@ -314,21 +355,54 @@ for env in ("stage", "prod"): if not any(f"-{env}." in u for u in probe_urls): bad(f"01-product's probe names no {env} URL: {probe_urls}") -# 02-docs: puts back what 01-product deferred, renders the record, lands, and -# re-probes exactly what 01-product probed. +# 02-docs: puts back what 01-product deferred, renders the record, finds its +# task, lands — and awaits nothing: its render probes every URL as it writes +# the record, and its landing redeploys nothing, so there is no probe after +# it to wait for. docs = by_name.get("02-docs") or {} dpost = (docs.get("hooks") or {}).get("post") or [] -if [h.get("id") for h in dpost] != ["promotion", "dev-lanes", "render", "land"]: - bad(f"02-docs's post hooks are {[h.get('id') for h in dpost]}; want promotion, dev-lanes, render, land") +if [h.get("id") for h in dpost] != ["promotion", "dev-lanes", "render", "task", "land"]: + bad(f"02-docs's post hooks are {[h.get('id') for h in dpost]}; want promotion, dev-lanes, render, task, land") for h in dpost: argv = " ".join(h.get("run") or []) if h.get("id") in ("promotion", "dev-lanes") and "--restore" not in argv: bad(f"02-docs hook {h.get('id')} does not --restore") dawait = (docs.get("hooks") or {}).get("await") or [] -if [(h.get("uses") or "") for h in dawait] != ["orun.http/probe@v1"]: - bad("02-docs's await must be one orun.http/probe@v1 — it deploys nothing to watch") -elif ((dawait[0].get("with") or {}).get("urls") or []) != probe_urls: - bad("02-docs's final probe is not the URLs 01-product ends on") +if dawait: + bad(f"02-docs awaits {[h.get('id') for h in dawait]} — its render probes as it writes and its " + f"landing redeploys nothing, so there is nothing after it to wait for") + +# ── THE FAST SHAPE (orun >= v2.88.0) ────────────────────────────────────── +# The run-level list is the task set-up, all of it in the background: the +# first phase's provider check, placement, rebrand, repository, link and +# secrets run while it opens the epic, the milestones and the tasks. +for h in run_hooks: + if not h.get("background"): + bad(f"hooks.preInstantiate {h.get('id')} is not `background: true` — the first phase " + f"waits for it before doing anything, though nothing before its landing reads it") +# No phase keeps a `pre` hook on the task plane: it would wait for the whole +# background before the phase has placed a file. +TASK_PLANE = ("orun.task/", "orun.pr/land@") +for p in phases: + for h in ((p.get("hooks") or {}).get("pre") or []): + if (h.get("uses") or "").startswith(TASK_PLANE): + bad(f"phase {p['name']} pre hook {h.get('id')} uses {h['uses']} — it waits for " + f"the background task set-up; find the task in `post`, just before the landing") +# Every landing checks its commit here and merges, instead of waiting ~25 s +# for a runner to plan the tree this box just wrote. +for p in phases: + for h in hooks_of(p): + if (h.get("uses") or "").startswith("orun.pr/land@") and (h.get("with") or {}).get("checks") != "local": + bad(f"phase {p['name']} lands with checks {(h.get('with') or {}).get('checks', 'ci')!r}, " + f"not 'local' — it waits for a runner to plan a tree that is here") +# The convergence watch reads every few seconds, not the action's default 40. +for p in phases: + for h in ((p.get("hooks") or {}).get("await") or []): + if (h.get("uses") or "").startswith("orun.run/watch@"): + every = (h.get("with") or {}).get("pollSeconds") + if not isinstance(every, int) or every > 10: + bad(f"phase {p['name']} watches its convergence every {every or 40} s; at most 10 — " + f"the build goes on that much after the run is green") # ── what a baseline of this shape never grows back ──────────────────────── if (root / "flows").exists(): @@ -344,6 +418,7 @@ placed_n = sum(len(p.get("modules") or []) for p in phases) narrated = sum(len(p.get("narrate") or {}) for p in phases) narrated += sum(1 for p in phases for h in hooks_of(p) if h.get("narrate")) print(f" {len(phases)} phases, {placed_n} modules, {len(HOOK_ONLY)} hook-only — in execution order") +print(f" hooks in the one-landing order; task set-up in the background, every landing checked here") print(f" {narrated} authored narration lines, every reference resolving") PY diff --git a/testing/placement.test.sh b/testing/placement.test.sh index ce14a08..fd356e9 100755 --- a/testing/placement.test.sh +++ b/testing/placement.test.sh @@ -12,8 +12,8 @@ # 2. THE OFFLINE BOOTSTRAP (testing/lib/bootstrap.sh) — both phases placed in # order, finished by the blueprint's OWN `run:` hooks (retouch, rebrand, # re-tenant, work-tree strip, the deferrals and their restore, the -# lockfile, the deployment record), each landing a commit on top of -# orun's `Initial commit`; +# deployment record), each landing a commit on top of orun's +# `Initial commit`; # 3. the product it ends with: branded with no residue, carrying nothing of # the factory and naming none of its paths, re-tenanted, its gates # restored, its record rendered; @@ -28,9 +28,8 @@ # testing/e2e.test.sh goes on from here: it installs, builds and serves the # product and runs its smoke against it. # -# Needs: orun, node, pnpm, python3 (+PyYAML), git. No credential. The pnpm -# lockfile check and the deployment-record probes reach the network if they -# can, and pass without it. +# Needs: orun, node, pnpm, python3 (+PyYAML), git. No credential. The +# deployment-record probes reach the network if they can, and pass without it. set -euo pipefail here="$(cd "$(dirname "$0")" && pwd)" root="$(cd "$here/.." && pwd)" diff --git a/tests/api/component.yaml b/tests/api/component.yaml index 5c7cb95..e3b4fc8 100644 --- a/tests/api/component.yaml +++ b/tests/api/component.yaml @@ -2,10 +2,19 @@ apiVersion: sourceplane.io/v1 kind: Component metadata: name: api-tests + description: The API's vitest suite (the welcome route, /health and its environment, a 404, the API's name), driven in-process with app.request() and run with pnpm test spec: type: turbo-package lifecycle: production owner: platform + # Its pages, attached to it in the workspace's catalog: what the Docs + # library shows for it, and what the catalog's docs and runbook checks read. + # Generated from what this manifest and its sources declare. + docs: + overview: docs/overview.md + pages: + - { path: docs/architecture.md, role: architecture, title: Architecture } + - { path: docs/runbook.md, role: runbook, title: Runbook } domain: tests subscribe: environments: diff --git a/tests/api/docs/overview.md b/tests/api/docs/overview.md index 6cfa4ac..bf8f705 100644 --- a/tests/api/docs/overview.md +++ b/tests/api/docs/overview.md @@ -1,5 +1,7 @@ # api-tests +The API's vitest suite (the welcome route, /health and its environment, a 404, the API's name), driven in-process with app.request() and run with pnpm test + The test suite for **api**. It deploys nothing: its lane installs, builds and runs the tests. | | | diff --git a/tooling/catalog/gen-component-docs.py b/tooling/catalog/gen-component-docs.py index 9a39931..743782b 100644 --- a/tooling/catalog/gen-component-docs.py +++ b/tooling/catalog/gen-component-docs.py @@ -4,8 +4,11 @@ python3 tooling/catalog/gen-component-docs.py # write python3 tooling/catalog/gen-component-docs.py --check # fail on drift (CI) -The Orun workspace's Docs library renders the `docs/` folder next to every -`component.yaml`. These pages are generated, not hand-written, because almost +Every `component.yaml` attaches its `docs/` folder in `spec.docs` (overview, +architecture, runbook), which is what the Orun workspace's Docs library shows +and what the catalog's docs and runbook checks read; a folder nothing declares +is never attached (testing/coverage.test.sh holds the rule). These pages are +generated, not hand-written, because almost everything in them is already declared somewhere CI validates: the component's manifest (type, description, dependencies, environments, the secrets a lane resolves, the smoke), its Worker config (bindings, triggers, the wiring the