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: 5 additions & 0 deletions .baseline/product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,8 @@ environments:
env:
DEPLOYED_URL: https://hono-api.example.com
```

The repository names the domain in one place, `BASE_DOMAIN` in `intent.yaml`
(one line per environment), which the API was born with as the reserved
placeholder `hono-api.example.com` — the example above carries it too.
Replace it with your domain in the same change that attaches it.
1 change: 0 additions & 1 deletion .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ jobs:
--out "$(mktemp -d)" \
--set reponame=acme-api \
--set "productname=Acme API" \
--set productdomain=acme.dev \
--set githuborg=acme-inc
- name: the leak gate — what an API carries
run: bash testing/leak.test.sh
Expand Down
14 changes: 9 additions & 5 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ cd hono-api
orun new --blueprint repo-blueprint.yaml \
--out ~/apis/acme-api --run-hooks --resume \
--set reponame=acme-api --set productname="Acme API" \
--set productdomain=acme.dev --set githuborg=acme-inc \
--set githuborg=acme-inc \
--set orunWorkspace=ws_XXXXXXXX \
--set subdomain=<workers-dev-subdomain>
```
Expand Down Expand Up @@ -87,9 +87,13 @@ orun new --blueprint repo-blueprint.yaml --out ~/apis/acme-api --run-hooks \

`02-docs` reads the identity back from `.rebrand/values.json` in the placed
tree, but the blueprint's **required** inputs — `reponame`, `productname`,
`productdomain`, `githuborg` — are validated before anything runs, so pass
them every time (a `--values` file is easier). The full guide, one page per
phase: [docs/phases/README.md](docs/phases/README.md).
`githuborg` — are validated before anything runs, so pass them every time (a
`--values` file is easier). The domain is not one of them: the API goes live
on workers.dev, and `productdomain` defaults to empty, which brands the
reserved placeholder `<reponame>.example.com` into `BASE_DOMAIN` for an owner
to replace when they attach a domain (README, "Custom domain"). Pass
`--set productdomain=` only for an API that already has its domain.
The full guide, one page per phase: [docs/phases/README.md](docs/phases/README.md).

| flag | what it does |
|---|---|
Expand Down Expand Up @@ -192,7 +196,7 @@ at the tag and refuses the whole catalogue if it 404s.
| 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 <api>/intent.yaml` |
| `✕ input "productdomain" is required` | all four required inputs must be set on every invocation, single-phase ones included |
| `✕ 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 |
| 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 |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ milestones and the as-built status.
git clone --depth 1 --branch <baseline-tag> https://github.com/sourceplane/hono-api
cd hono-api
orun new --blueprint repo-blueprint.yaml --out ~/apis/acme-api --run-hooks --resume \
--set reponame=acme-api --set productname="Acme API" --set productdomain=acme.dev \
--set reponame=acme-api --set productname="Acme API" \
--set githuborg=acme-inc --set subdomain=<workers-dev-subdomain>
```

Expand Down
6 changes: 3 additions & 3 deletions ai/context/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ own repository and takes it to live on stage and prod in one landing

| | |
|---|---|
| Latest tag | `baseline-v2` (HA4 — the cirrus standard: no kiox, generated component docs, this context pack, and the workers.dev subdomain read from the Cloudflare connection instead of asked) |
| Before it | `baseline-v1` (HA3 — the baseline) |
| Latest tag | `baseline-v3` (HA5 — the domain is set later: the console asks for no domain, and an API is born with the placeholder `<reponame>.example.com` for an owner to replace) |
| Before it | `baseline-v2` (HA4 — the cirrus standard: no kiox, generated component docs, this context pack, and the workers.dev subdomain read from the Cloudflare connection instead of asked); `baseline-v1` (HA3 — the baseline) |
| Proven live | No. Everything short of the platform is proven offline in Baseline CI; a live bootstrap from a tag is still to come (risk HA-F) |

## Where to read
Expand All @@ -32,5 +32,5 @@ own repository and takes it to live on stage and prod in one landing

## Next

1. Bootstrap one API from `baseline-v2` against a workspace, and record its
1. Bootstrap one API from `baseline-v3` against a workspace, and record its
timings (closes HA-F).
1 change: 1 addition & 0 deletions ai/context/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ reads in order.
| 9 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox | `kiox.yaml` pinned a version nothing ran | IMPLEMENTATION-STATUS (HA4) |
| 10 | Component docs are generated from the manifests and checked in CI | A hand-written copy of the dependency graph and bindings drifts silently | `tooling/catalog/gen-component-docs.py` |
| 11 | `subdomain` is read from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`), never asked | It belongs to the account like its id and has one right answer; a typed one could only be wrong, and showed up after deploy in the smoke and the probes | `blueprint.yaml`, IMPLEMENTATION-STATUS (HA-6) |
| 12 | The console asks for no domain; an empty `productdomain` brands the placeholder `<reponame>.example.com` | The API goes live on workers.dev and nothing in the build needs a domain; attaching one is an owner's step, and the placeholder keeps every place the domain goes in the repository, ready to replace | `repo-blueprint.yaml`, `tooling/rebrand/rebrand.mjs`, IMPLEMENTATION-STATUS (HA-7) |
2 changes: 1 addition & 1 deletion ai/context/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ orun integrations list --org <ws> --json && orun cloud check --org <ws>
| deploy a change | merge to `main`; watch the run; failed lanes → `gh run rerun --failed` |
| redeploy without a change | edit the last line of `apps/api/component.yaml` (`# orun: redeploy <reason> <stamp>`) and merge — it is a deploy trigger, nothing reads it |
| rename the API | `API_NAME` in `apps/api/src/identity.ts` — what `/health` answers with |
| serve a custom domain | attach it to the Worker in Cloudflare (README, "Custom domain"); the workers.dev URL keeps answering for the smoke |
| serve a custom domain | attach it to the Worker in Cloudflare (README, "Custom domain"), then replace the placeholder `hono-api.example.com` in `intent.yaml`'s `BASE_DOMAIN` (every environment) with it; the workers.dev URL keeps answering for the smoke |
| add a runtime secret | `orun secrets set <KEY> --org <ws> --env <env>`, then declare it in the component's `optionalSecretEnv` and name it in `runtimeSecrets` |
| headless credentials | `ORUN_TOKEN` (workspace-scoped) + `GITHUB_TOKEN` |

Expand Down
11 changes: 6 additions & 5 deletions blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ spec:
# already holds says so with `from`. repo-blueprint.yaml declares the same
# names; `repoPrivate`, `orunWorkspace` and `epicSlug` are build inputs with
# defaults (or filled from the build's workspace) and are not asked.
#
# NOR IS THE DOMAIN. The API goes live on workers.dev, and a domain is an
# owner's step after the bootstrap: `productdomain` defaults to empty, the
# rebrand writes the reserved placeholder `<reponame>.example.com` where
# the domain goes, and the API's README ("Custom domain") says how to set
# it. Nothing that needs a domain is removed — it waits for one.
inputs:
- key: reponame
label: Repo name
Expand All @@ -70,11 +76,6 @@ spec:
pattern: "^[A-Za-z0-9][A-Za-z0-9 .,'&-]{1,48}$"
help: The name the API answers with — GET /health reports it beside the environment.
example: Acme API
- key: productdomain
label: API domain
pattern: "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
help: The domain the API will answer on. It does not need to exist — the API goes live on workers.dev first.
example: acme.dev
- key: githuborg
label: GitHub organisation
pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$"
Expand Down
12 changes: 9 additions & 3 deletions docs/phases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ domain", says how.
`01-product` takes the API's identity once and writes it into the repo
(`.rebrand/values.json`); `02-docs` reads it back from the placed tree. But
the blueprint's **required** inputs — `reponame`, `productname`,
`productdomain`, `githuborg` — are validated before any phase runs, so they
must be supplied on every invocation, single-phase ones included. A
`--values` file is easier than repeating `--set`.
`githuborg` — are validated before any phase runs, so they must be supplied
on every invocation, single-phase ones included. A `--values` file is easier
than repeating `--set`.

- `productdomain` — NOT ASKED, default empty. The API goes live on
workers.dev; empty brands the reserved placeholder `<reponame>.example.com`
into `BASE_DOMAIN`, for an owner to replace when they attach a domain (the
API's README, "Custom domain"). Pass it only for an API that already has
its domain.

- `subdomain` — the workers.dev subdomain of the Cloudflare account you
deploy into. It is in every URL the phases probe and in the URL the
Expand Down
13 changes: 9 additions & 4 deletions repo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ inputs:
description: The API's display name (e.g. "Acme API") — what GET /health answers with.
productdomain:
type: string
required: true
default: ""
description: >-
The domain the API will answer on (e.g. acme.dev) — BASE_DOMAIN and the
custom-domain guidance. It does not need to exist: the API answers on
workers.dev from its first deploy.
The API's own domain, once it has one (e.g. acme.dev). NOT ASKED: the
API answers on workers.dev from its first deploy, and a domain is an
owner's step after it. Empty, the rebrand writes the reserved
placeholder `<reponame>.example.com` where the domain goes (BASE_DOMAIN
in intent.yaml, for every environment, and the README's DEPLOYED_URL
example), so setting it later is replacing that one string — the API's
README, "Custom domain", says how. Pass it with --set only to brand a
hand-run build with a domain it already has.
githuborg:
type: string
pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$"
Expand Down
2 changes: 1 addition & 1 deletion specs/epics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace.

| Epic | Cluster | Status | What it is |
|------|---------|--------|------------|
| [`hono-api/`](./hono-api/) | **HA** | ✅ Shipped (`baseline-v2`); live bootstrap pending | Vercel's Hono boilerplate, equivalent in code and function, as a Cloudflare Worker — and an Orun baseline that instantiates it in one landing (HA3) |
| [`hono-api/`](./hono-api/) | **HA** | ✅ Shipped (`baseline-v3`); live bootstrap pending | Vercel's Hono boilerplate, equivalent in code and function, as a Cloudflare Worker — and an Orun baseline that instantiates it in one landing (HA3) |

As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`.
48 changes: 48 additions & 0 deletions specs/epics/hono-api/IMPLEMENTATION-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ the code departed from `design.md` or from the upstream template.
| HA2 — ready to instantiate | ✅ Shipped | [#3](https://github.com/sourceplane/hono-api/pull/3) |
| HA3 — a baseline | ✅ Shipped | [#4](https://github.com/sourceplane/hono-api/pull/4) (HA-4), tagged `baseline-v1` |
| HA4 — the cirrus standard | ✅ Shipped | [#5](https://github.com/sourceplane/hono-api/pull/5) (HA-5), [#6](https://github.com/sourceplane/hono-api/pull/6) (HA-6), tagged `baseline-v2` |
| HA5 — the domain is set later | ✅ Shipped | [#7](https://github.com/sourceplane/hono-api/pull/7) (HA-7), tagged `baseline-v3` |

## Departures from the upstream template

Expand Down Expand Up @@ -103,6 +104,53 @@ Verified:
landings, the API's own plan deploys `api` to stage and prod.
- `orun task check HA-6` complete.

## The domain is set later (HA5, HA-7)

The console asked for the API's domain, with help text that said it did not
need to exist — and nothing in the build needed one: the API answers on
workers.dev from its first deploy, the deploy's smoke and the phase probes
read the workers.dev URL, and the one place the repository names the domain
is `BASE_DOMAIN` in `intent.yaml` (one line per environment: dev, stage,
prod), plus the README's `DEPLOYED_URL` example. A domain is an owner's step
after the bootstrap (README, "Custom domain"), so the form no longer asks for
it.

- `blueprint.yaml` declares no `productdomain` input; the console asks for
the API's name alone.
- `repo-blueprint.yaml`'s `productdomain` is optional, default empty. Nothing
else in the build reads it — no hook, probe or `when:` — so an empty value
is harmless; `.rebrand/values.json` records `""`. A hand-run build may still
pass `--set productdomain=` for an API that already has its domain.
- `rebrand.mjs` no longer requires it. Empty, it brands the reserved
placeholder `<reponame>.example.com` (RFC 2606 — never someone else's
domain) where the domain goes, so setting it later is replacing one
string; the product README and `ai/context/operations.md` say so.
- `testing/fixtures/acme.json` carries no domain, so the leak gate and the
offline bootstrap exercise exactly what a console build supplies;
`testing/rebrand.test.sh` pins the placeholder for an absent and an empty
domain, and for the fixture's own slug, whose placeholder
`acme-hono-api.example.com` ends in the baseline's `hono-api.example.com`
(three passes, unchanged); `baseline.yml`'s blueprint read sets no domain.

Nothing that needs a domain was removed — it waits for one.

Verified:

- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh`
green (rebrand: the three new checks among them; with the previous
`rebrand.mjs` all three fail, restored they pass); `gen-component-docs.py
--check` green (2 components).
- At v2.58.11 (the blueprint job's pin): `orun new --status` with no
`productdomain` reads the document (`01-product` pending, 44 files);
`testing/leak.test.sh` 44 files derived, 44 read; `testing/placement.test.sh`
44 files placed, both landings, the API's own plan deploys `api` to stage
and prod.
- The offline bootstrap of the fixture leaves `.rebrand/values.json`
`productdomain` empty and `BASE_DOMAIN: acme-hono-api.example.com` in all
three environments of the API's `intent.yaml` (and the same string in its
README and `operations.md`); no line names `hono-api.example.com` on its own.
- `orun task check HA-7` complete.

## Verified (HA4)

- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh`
Expand Down
7 changes: 4 additions & 3 deletions specs/epics/hono-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ The upstream code stays the code. The port adds the Worker's config (`wrangler.j

| Field | Value |
|-------|-------|
| Status | ✅ HA0–HA3 shipped (#1–#4), tagged `baseline-v1`; HA4 (the cirrus standard, HA-5 #5 and HA-6 #6) tagged `baseline-v2`. Not yet proven by a live bootstrap (risk HA-F) |
| Cluster | **HA** (HA0–HA4) |
| Status | ✅ HA0–HA5 shipped (#1–#7): HA3 tagged `baseline-v1`; HA4 (the cirrus standard, HA-5 #5 and HA-6 #6) tagged `baseline-v2`; HA5 (the domain is set later, HA-7 #7) tagged `baseline-v3`. Not yet proven by a live bootstrap (risk HA-F) |
| Cluster | **HA** (HA0–HA5) |
| Owner(s) | `apps/api` (the Worker) · `tests/api` (the in-process request tests) |
| Builds on | `cirrus-baseline` conventions (intent, components, `checks.yml` gate, gated `ci.yml`) and the `cloudflare-worker-turbo` composition its workers deploy with — no bounded context of the fleet is needed |
| Upstream | [vercel/examples `framework-boilerplates/hono`](https://github.com/vercel/examples/tree/main/framework-boilerplates/hono) |
| Changes | Adds the Worker config, the monorepo wrapper, tests and the deploy contract; the template's app code is untouched but for the welcome line's link |
| Decisions locked | (1) A plain Worker (`cloudflare-worker-turbo`), not Pages Functions and not an adapter: Hono's default export is already a Workers module handler. (2) `wrangler.jsonc` is committed, not rendered: the Worker binds nothing, so there is nothing to wire. (3) Per-environment deploys through wrangler `env` sections (`--env stage` / `--env prod`), naming `hono-api-api-{stage,prod}`. (4) No infra root. |
| Gate | HA1 is the first user-visible rung (the API serves from a Worker). |
| Shipped as | `baseline-v1` ([#4](https://github.com/sourceplane/hono-api/pull/4)), then `baseline-v2` (HA4: [#5](https://github.com/sourceplane/hono-api/pull/5), [#6](https://github.com/sourceplane/hono-api/pull/6)); proven offline (Baseline CI), deploy gated until a workspace is linked |
| Shipped as | `baseline-v3` ([#7](https://github.com/sourceplane/hono-api/pull/7), HA5: no domain asked), `baseline-v2` (HA4: [#5](https://github.com/sourceplane/hono-api/pull/5), [#6](https://github.com/sourceplane/hono-api/pull/6)), `baseline-v1` ([#4](https://github.com/sourceplane/hono-api/pull/4)); proven offline (Baseline CI), deploy gated until a workspace is linked |

## Read order

Expand All @@ -34,3 +34,4 @@ The upstream code stays the code. The port adds the Worker's config (`wrangler.j
| HA2 — ready to instantiate | README, as-built status | a reader can run, test, preview and deploy it |
| HA3 — a baseline | card, build document, rename, bootstrap tooling, tests | a new API goes from nothing to live in one landing; Baseline CI green |
| HA4 — the cirrus standard | no kiox, generated component docs, the context pack, status that agrees with the tags; the subdomain read from the Cloudflare connection | Baseline CI green with the docs check; the card asks for no subdomain |
| HA5 — the domain is set later | the console asks for no domain; an empty `productdomain` brands the placeholder `<reponame>.example.com` for an owner to replace | Baseline CI green on a fixture with no domain |
6 changes: 6 additions & 0 deletions specs/epics/hono-api/epic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ spec:
- "every milestone's status row agrees with the tags"
- "the console card reads subdomain from the Cloudflare connection (from: connection.cloudflare.workersSubdomain), as cirrus-baseline since baseline-v23"
tasks: [HA-5, HA-6]
- name: "HA5 — the domain is set later"
exitCriteria:
- "the console card asks for no domain: an API goes live on workers.dev, and productdomain is an optional build input that defaults to empty"
- "an API built without a domain is branded with the reserved placeholder <reponame>.example.com wherever the domain goes (BASE_DOMAIN), and its README says how an owner sets the real one"
- "Baseline CI places, leak-checks and plans an API built with no domain"
tasks: [HA-7]
9 changes: 9 additions & 0 deletions specs/epics/hono-api/implementation-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ itself changing.
- the docs check is green in Baseline CI
- this file, the status file and `epic.yaml` agree

## HA5 — the domain is set later (HA-7) ✅

**Done when** the console card asks for no domain; `productdomain` is an
optional build input, empty by default; an API built without one is branded
with the reserved placeholder `<reponame>.example.com` where the domain goes
(`BASE_DOMAIN` in `intent.yaml`) and its README says how an owner sets the
real one; Baseline CI places, leak-checks and plans an API built with no
domain. Shipped in `baseline-v3`.

## After HA3 (outside this repository)

1. Cut `baseline-v1` with `tag.yml` from the merged `main`.
Expand Down
Loading
Loading