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 @@ -157,6 +157,11 @@ own domain, attach the domain to the Worker in Cloudflare (Workers & Pages →
under that environment's `env:` in `intent.yaml` — the Open Graph images are
absolute links, built from it — and merge: the next deploy uses it.

The repository names the domain in one more place, `BASE_DOMAIN` in
`intent.yaml` (one line per environment), which the product was born with as
the reserved placeholder `ai-chatbot.example.com`. Replace it with your
domain in the same change.

## CI

| Workflow | What it runs |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ jobs:
--out "$(mktemp -d)" \
--set reponame=acme-chat \
--set "productname=Acme Chat" \
--set productdomain=acme.dev \
--set githuborg=acme-inc
- name: the leak gate — what a product 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 @@ -69,7 +69,7 @@ cd ai-chatbot
orun new --blueprint repo-blueprint.yaml \
--out ~/products/acme-chat --run-hooks --resume \
--set reponame=acme-chat --set productname="Acme Chat" \
--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 @@ -106,9 +106,13 @@ orun new --blueprint repo-blueprint.yaml --out ~/products/acme-chat --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 product 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 a product 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 @@ -247,5 +251,5 @@ at the tag and refuses the whole catalogue if it 404s.
| The convergence reported green, then `verify` got 404 | a second workflow ran on the push to main and the watch took its run. Only `ci.yml` may run on a push to main; `checks.yml` runs on pull requests only |
| The product's `intent.yaml` says `workspace: ws_SET_ME` | `orunWorkspace` was empty and the build ran outside a workspace; set it and re-run `01-product` |
| A bootstrap stopped before `02-docs`; prod no longer waits on stage | the gate is deferred, not dropped: run `02-docs`, or `node tooling/bootstrap/promotion.mjs --restore --file <product>/intent.yaml` |
| `✕ input "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 |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ the milestones and the as-built status, including every departure.
git clone --depth 1 --branch <baseline-tag> https://github.com/sourceplane/ai-chatbot
cd ai-chatbot
orun new --blueprint repo-blueprint.yaml --out ~/products/acme-chat --run-hooks --resume \
--set reponame=acme-chat --set productname="Acme Chat" --set productdomain=acme.dev \
--set reponame=acme-chat --set productname="Acme Chat" \
--set githuborg=acme-inc --set subdomain=<workers-dev-subdomain>
```

Expand Down
7 changes: 4 additions & 3 deletions ai/context/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ went live (`02-docs`).

| | |
|---|---|
| Latest tag | `baseline-v2` (AC6 — the cirrus standard, [#7](https://github.com/sourceplane/ai-chatbot/pull/7) and [#8](https://github.com/sourceplane/ai-chatbot/pull/8): 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` (AC5, [#6](https://github.com/sourceplane/ai-chatbot/pull/6)) |
| Latest tag | `baseline-v3` (AC7 — the domain is set later, [#9](https://github.com/sourceplane/ai-chatbot/pull/9): the console asks for no domain, and a product is born with the placeholder `<reponame>.example.com` for an owner to replace) |
| Before it | `baseline-v2` (AC6 — the cirrus standard, [#7](https://github.com/sourceplane/ai-chatbot/pull/7) and [#8](https://github.com/sourceplane/ai-chatbot/pull/8): no kiox, generated component docs, this context pack, and the workers.dev subdomain read from the Cloudflare connection instead of asked) |
| Before that | `baseline-v1` (AC5, [#6](https://github.com/sourceplane/ai-chatbot/pull/6)) |
| Proven live | No. Everything short of the platform is proven offline in Baseline CI: the e2e tier builds the product in orun's staged job tree, migrates a local Postgres with its own runner and serves the Worker over local R2 with a stand-in AI binding. No bootstrap from a tag has run against a workspace yet: the three applies, db-migrate against a real project, a real deploy, Workers AI itself (AC-K) and the `BLOB` binding under the deploy token (AC-L) are unproven |

## Where to read
Expand All @@ -36,7 +37,7 @@ went live (`02-docs`).

## Next

1. Bootstrap one chatbot from `baseline-v2` against a workspace with
1. Bootstrap one chatbot from `baseline-v3` against a workspace with
Cloudflare and Supabase connected, and record its timings: the first
proof of the applies, the deploy, Workers AI's models and tools (AC-K)
and the R2 binding under the deploy token (AC-L).
1 change: 1 addition & 0 deletions ai/context/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ reads in order.
| 11 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox | `kiox.yaml` pinned a version (v2.15.0) nothing ran | IMPLEMENTATION-STATUS (AC6) |
| 12 | 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` |
| 13 | `subdomain` is read from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`), never asked | It belongs to the account like its id and has one right answer; a typed one could only be wrong, and showed up after deploy in the public origin, the smoke and the probes | `blueprint.yaml`, IMPLEMENTATION-STATUS (AC-8) |
| 14 | The console asks for no domain; an empty `productdomain` brands the placeholder `<reponame>.example.com` | The product goes live on workers.dev and nothing in the build needs a domain; attaching one is an owner's step, and the placeholder keeps every place the domain goes in the repository, ready to replace | `repo-blueprint.yaml`, `tooling/rebrand/rebrand.mjs`, IMPLEMENTATION-STATUS (AC-9) |
2 changes: 1 addition & 1 deletion ai/context/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ orun integrations list --org <ws> --json && orun cloud check --org <ws>
| turn the AI Gateway on | `wrangler secret put AI_GATEWAY_API_KEY --name ai-chatbot-web-<env>` |
| redeploy without a change | edit the last line of the component's `component.yaml` (`# orun: redeploy <reason> <stamp>`) and merge — it is a deploy trigger, nothing reads it |
| rotate the session key | `wrangler secret put AUTH_SECRET --name ai-chatbot-web-<env>` (32+ random bytes); every session ends |
| serve a custom domain | attach it to the Worker in Cloudflare (Workers & Pages → the Worker → Settings → Domains & Routes), then set `SITE_URL` under the environment's `env:` in `intent.yaml` (the Open Graph images' origin) and merge |
| serve a custom domain | attach it to the Worker in Cloudflare (Workers & Pages → the Worker → Settings → Domains & Routes), then set `SITE_URL` under the environment's `env:` in `intent.yaml` (the Open Graph images' origin), replace the placeholder `ai-chatbot.example.com` in its `BASE_DOMAIN` with the domain, and merge |
| headless credentials | `ORUN_TOKEN` (workspace-scoped) + `GITHUB_TOKEN` |

The deployment record is the bootstrap's `02-docs` phase. Re-running it (the
Expand Down
11 changes: 6 additions & 5 deletions blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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 product 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 product'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 @@ -83,11 +89,6 @@ spec:
pattern: "^[A-Za-z0-9][A-Za-z0-9 .,'&-]{1,48}$"
help: The name people see — in every page title and the sidebar.
example: Acme Chat
- key: productdomain
label: Product domain
pattern: "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
help: The domain the product will answer on. It does not need to exist — the app 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 @@ -56,9 +56,15 @@ carry, so it is an owner's step after the bootstrap (the product's README,
`01-product` takes the product'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 product 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
product's README, "Custom domain"). Pass it only for a product 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. A console or
Expand Down
13 changes: 9 additions & 4 deletions repo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ inputs:
description: The product's display name (e.g. "Acme Chat") — in every page title and the sidebar.
productdomain:
type: string
required: true
default: ""
description: >-
The domain the product will answer on (e.g. acme.dev) — BASE_DOMAIN and
the custom-domain guidance. It does not need to exist: the app answers
on workers.dev from its first deploy.
The product's own domain, once it has one (e.g. acme.dev). NOT ASKED:
the app 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), so setting it later is
replacing that one string — the product'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 |
|------|---------|--------|------------|
| [`ai-chatbot/`](./ai-chatbot/) | **AC** | ✅ Shipped (`baseline-v2`); live bootstrap pending | Vercel's Next.js AI Chatbot, equivalent in code and function, on Cloudflare Workers with Supabase Postgres, Hyperdrive and R2 — and an Orun baseline that instantiates it in one landing, chatting on Workers AI (AC5) |
| [`ai-chatbot/`](./ai-chatbot/) | **AC** | ✅ Shipped (`baseline-v3`); live bootstrap pending | Vercel's Next.js AI Chatbot, equivalent in code and function, on Cloudflare Workers with Supabase Postgres, Hyperdrive and R2 — and an Orun baseline that instantiates it in one landing, chatting on Workers AI (AC5) |

As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`.
47 changes: 47 additions & 0 deletions specs/epics/ai-chatbot/IMPLEMENTATION-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ the code departed from `design.md` or from the upstream template.
| AC4 — ready to instantiate | ✅ Shipped | [#5](https://github.com/sourceplane/ai-chatbot/pull/5) |
| AC5 — a baseline | ✅ Shipped | [#6](https://github.com/sourceplane/ai-chatbot/pull/6) (AC-6), tagged `baseline-v1` |
| AC6 — the cirrus standard | ✅ Shipped | [#7](https://github.com/sourceplane/ai-chatbot/pull/7) (AC-7), [#8](https://github.com/sourceplane/ai-chatbot/pull/8) (AC-8), tagged `baseline-v2` |
| AC7 — the domain is set later | ✅ Shipped | [#9](https://github.com/sourceplane/ai-chatbot/pull/9) (AC-9), tagged `baseline-v3` |

## Departures from the upstream template (AC1–AC4)

Expand Down Expand Up @@ -188,6 +189,52 @@ Verified:
web and cloudflare-r2 → web; `--resume` changes nothing.
- `orun task check AC-8` complete.

## The domain is set later (AC7, AC-9)

The console asked for the product's domain, with help text that said it did
not need to exist — and nothing in the build needed one: the app answers on
workers.dev from its first deploy, its public origin (`SITE_URL`, the Open
Graph images' base) falls back to the environment's workers.dev URL until an
owner sets it, the smoke and the phase probes read workers.dev, and the one
place the repository names the domain is `BASE_DOMAIN` in `intent.yaml` (one
line per environment: dev, stage, prod). 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 product'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 a product 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 ("Custom domain", beside `SITE_URL`) and
`ai/context/operations.md` say so.
- `testing/fixtures/acme.json` carries no domain, so the leak gate, the
offline bootstrap and the e2e tier exercise exactly what a console build
supplies; `testing/rebrand.test.sh` pins the placeholder for an absent and
an empty domain; `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,wire}.test.sh`
green; `gen-component-docs.py --check` green (8 components).
- At v2.58.11 (the blueprint job's pin): `orun new --status` with no
`productdomain` reads the document (`01-product` pending, 294 files);
`testing/leak.test.sh` 294 files derived, 287 text files read.
- At v2.78.4 (the placement pin): `testing/placement.test.sh` 294 files
placed, both landings; the product's own plan orders supabase →
cloudflare-hyperdrive → db-migrate → web and cloudflare-r2 → web;
`--resume` changes nothing.
- The offline bootstrap of the fixture leaves `.rebrand/values.json`
`productdomain` empty and `BASE_DOMAIN: acme-chatbot-hq.example.com` in all
three environments of the product's `intent.yaml` (and the same string in
its README and `operations.md`); no line names `ai-chatbot.example.com`.
- `orun task check AC-9` complete.

## Verified (AC6)

- `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh`
Expand Down
Loading
Loading