Repository navigation
RG5: rag-chatbot becomes an Orun baseline - #6
Merged
Merged
Conversation
The repository becomes an Orun baseline on the Cloudflare + Supabase (Lumen) conventions, built the way cirrus-baseline v22 builds a product: ONE landing (01-product), then a hook-only deployment record (02-docs). Copied closely from saas-starter's SA5 (sourceplane/saas-starter#6). - blueprint.yaml (requires [github, cloudflare, supabase]; the five brokered keys; the two-Supabase-projects prerequisite) and repo-blueprint.yaml (every module in 01-product; the cirrus v22 hook chain; await: the convergence, SUPABASE_PROJECT_REF/_DB_PASSWORD/_DB_URL and WIRING_CLOUDFLARE_HYPERDRIVE on stage and prod, / and /api/health). - Infra before app on main: supabase -> cloudflare-hyperdrive -> db-migrate -> web, every edge enforced on github-push-main and advisory on pull requests. - Workers AI is the default model provider through an AI binding in the committed wrangler config: @cf/meta/llama-4-scout-17b-16e-instruct for the chat, @cf/baai/bge-base-en-v1.5 for the embeddings (workers-ai-provider 2.0.2, the AI SDK v5 release). AI_GATEWAY_API_KEY is optional and switches only the chat to upstream's gateway model. - Migration 020_workers_ai_embeddings resizes embeddings.embedding to vector(768) (with a guard against foreign vectors); 030 enables row-level security, no policy, on every table in public. Both have drizzle-kit twins; tests/db runs every migration on PGlite with pgvector. - The build needs no Cloudflare credential: the platform proxy starts only under next dev, and the static-assets cache is populated by a copy. - /api/health, the committed wrangler.jsonc, the rebrand engine and name seam, the bootstrap helpers, the deployment-record hook, ai/context, docs/phases, BOOTSTRAP.md, testing/ (with a deterministic Workers AI stand-in for the e2e), baseline.yml and tag.yml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
Upstream's layout hard-coded its demo's origin as metadataBase, which Next resolves the page's opengraph-image.png against: every product built from this baseline would have advertised upstream's vercel.app image URL as its og:image. - app/(preview)/layout.tsx reads NEXT_PUBLIC_SITE_URL (default http://localhost:3000). - apps/web/component.yaml's buildCommand sets it, as postgres-drizzle-starter and portfolio-starter-kit do: the environment's SITE_URL (intent.yaml env:, for a custom domain), else its workers.dev URL, the subdomain written out because the composition exports WORKERS_DEV_SUBDOMAIN to the smoke step only. The page is pre-rendered, so the build bakes it in. - .env.example documents NEXT_PUBLIC_SITE_URL; intent.yaml, the product README, operations.md and BOOTSTRAP.md say how a custom domain sets it. - rebrand.test.sh covers the line (worker name and subdomain rewritten); tests/web holds the layout and the build line; the e2e asserts the served page's og:image is on the product's own stage origin, not vercel.app, and that the image is served. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
ruehowl
marked this pull request as ready for review
October 15, 2026 21:32
ruehowl
added a commit
that referenced
this pull request
Oct 21, 2026
…text pack (#7) * RG6: the cirrus standard — no kiox, generated component docs, the context pack - Remove kiox.yaml/kiox.lock and their two blueprint modules: nothing ran the kiox pin (v2.15.0); every workflow pins orun through orun-action. - Generate docs/{overview,architecture,runbook}.md for all seven components from what each declares (tooling/catalog/gen-component-docs.py), and fail Baseline CI when they drift (--check). - Add ai/context/{current,decisions,open-risks}.md (this repository's own; nothing places them). - Close out RG5 (shipped in #6, tagged baseline-v1) and record RG6 (RG-7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha * Regenerate component docs: prettier-padded tables, accurate wording The generator now lays tables out the way prettier does (an app whose lint is `prettier --check` accepts the pages as written), lists the WIRING_* failure only for Workers that take wiring, and no longer claims a package holds no credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha * Component docs: list optional and per-environment secrets The generator now reads `optionalSecretEnv` (listed as "(optional)") and secrets declared per environment under `subscribe.environments[]`, so a page no longer leaves out a secret its component declares. Its tables are laid out as prettier lays them out, the WIRING_* failure is listed only for Workers that take wiring, and a package is no longer said to hold no credentials. Every starter now carries the identical generator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha --------- Co-authored-by: Claude <noreply@anthropic.com>
ruehowl
added a commit
that referenced
this pull request
Oct 21, 2026
* RG6: the cirrus standard — no kiox, generated component docs, the context pack
- Remove kiox.yaml/kiox.lock and their two blueprint modules: nothing ran
the kiox pin (v2.15.0); every workflow pins orun through orun-action.
- Generate docs/{overview,architecture,runbook}.md for all seven components
from what each declares (tooling/catalog/gen-component-docs.py), and fail
Baseline CI when they drift (--check).
- Add ai/context/{current,decisions,open-risks}.md (this repository's own;
nothing places them).
- Close out RG5 (shipped in #6, tagged baseline-v1) and record RG6 (RG-7).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Regenerate component docs: prettier-padded tables, accurate wording
The generator now lays tables out the way prettier does (an app whose lint
is `prettier --check` accepts the pages as written), lists the WIRING_*
failure only for Workers that take wiring, and no longer claims a package
holds no credentials.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Component docs: list optional and per-environment secrets
The generator now reads `optionalSecretEnv` (listed as "(optional)") and
secrets declared per environment under `subscribe.environments[]`, so a
page no longer leaves out a secret its component declares. Its tables are
laid out as prettier lays them out, the WIRING_* failure is listed only
for Workers that take wiring, and a package is no longer said to hold no
credentials. Every starter now carries the identical generator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* RG6: read the workers.dev subdomain from the Cloudflare connection
- blueprint.yaml: the subdomain input is `from:
connection.cloudflare.workersSubdomain`, as cirrus-baseline since
baseline-v23 (#30); the console renders no field for it
- testing/manifest.test.sh: cirrus's rule verbatim, accepting the source
only when spec.requires.integrations lists its provider (mutation-checked)
- repo-blueprint.yaml, BOOTSTRAP.md, docs/phases/README.md: only a hand-run
build passes --set subdomain
- records: RG-8 under RG6, status, plan, epic index, ai/context
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
---------
Co-authored-by: Claude <noreply@anthropic.com>
ruehowl
added a commit
that referenced
this pull request
Oct 22, 2026
* RG6: the cirrus standard — no kiox, generated component docs, the context pack
- Remove kiox.yaml/kiox.lock and their two blueprint modules: nothing ran
the kiox pin (v2.15.0); every workflow pins orun through orun-action.
- Generate docs/{overview,architecture,runbook}.md for all seven components
from what each declares (tooling/catalog/gen-component-docs.py), and fail
Baseline CI when they drift (--check).
- Add ai/context/{current,decisions,open-risks}.md (this repository's own;
nothing places them).
- Close out RG5 (shipped in #6, tagged baseline-v1) and record RG6 (RG-7).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Regenerate component docs: prettier-padded tables, accurate wording
The generator now lays tables out the way prettier does (an app whose lint
is `prettier --check` accepts the pages as written), lists the WIRING_*
failure only for Workers that take wiring, and no longer claims a package
holds no credentials.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* Component docs: list optional and per-environment secrets
The generator now reads `optionalSecretEnv` (listed as "(optional)") and
secrets declared per environment under `subscribe.environments[]`, so a
page no longer leaves out a secret its component declares. Its tables are
laid out as prettier lays them out, the WIRING_* failure is listed only
for Workers that take wiring, and a package is no longer said to hold no
credentials. Every starter now carries the identical generator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* RG6: read the workers.dev subdomain from the Cloudflare connection
- blueprint.yaml: the subdomain input is `from:
connection.cloudflare.workersSubdomain`, as cirrus-baseline since
baseline-v23 (#30); the console renders no field for it
- testing/manifest.test.sh: cirrus's rule verbatim, accepting the source
only when spec.requires.integrations lists its provider (mutation-checked)
- repo-blueprint.yaml, BOOTSTRAP.md, docs/phases/README.md: only a hand-run
build passes --set subdomain
- records: RG-8 under RG6, status, plan, epic index, ai/context
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* RG7: the console asks for no domain — the domain is set later
The app goes live on workers.dev from its first deploy and nothing in the
build needs a domain, so the console no longer asks for one. The logic that
uses a domain stays where it is, waiting for one.
- blueprint.yaml: no productdomain input
- repo-blueprint.yaml: productdomain is optional, default empty
- rebrand.mjs: productdomain no longer required; empty brands the reserved
placeholder <reponame>.example.com (RFC 2606) where the domain goes
(BASE_DOMAIN in intent.yaml, every environment), so setting it later is
replacing one string
- the product README ("Custom domain", beside SITE_URL) and
ai/context/operations.md say how to set it
- testing/fixtures/acme.json carries no domain; rebrand.test.sh pins the
placeholder; baseline.yml's blueprint read sets no domain
- records: RG7 / RG-9, tagged baseline-v3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
---------
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repository becomes an Orun baseline on the Cloudflare + Supabase (Lumen) conventions, built the way cirrus-baseline v22 builds a product: one landing. It is copied closely from saas-starter's conversion (sourceplane/saas-starter#6), the reference for the Supabase group. Milestone RG5, task RG-6.
What was added
The card (
blueprint.yaml)requires.integrations: [github, cloudflare, supabase].spec.secretspreviews the five brokered keys. Each one is transcribed from a reconcile hook and resolved by the product's plan:CLOUDFLARE_API_TOKEN(workers-deploy)CLOUDFLARE_HYPERDRIVE_TOKEN(hyperdrive-edit)CLOUDFLARE_ACCOUNT_ID(account-id)SUPABASE_ACCESS_TOKEN(management-access)SUPABASE_ORG_ID(org-id)01-product,02-docs;expectedMinutes: 20.The build document (
repo-blueprint.yaml): two phases01-productplaces all 25 modules.--strip, promotion--defer, dev-lanes--defer→ restage, rebrand-verify → pnpm lockfile →orun.repo/ensure@v1, then link → fiveorun.integrations/reconcile@v1hooks →orun.pr/land@v1.orun.run/watch@v1on the merge sha;orun.secrets/exists@v1forSUPABASE_PROJECT_REF,SUPABASE_DB_PASSWORD,SUPABASE_DB_URLandWIRING_CLOUDFLARE_HYPERDRIVE, on stage and prod;orun.http/probe@v1on/and/api/health, on stage and prod.02-docsis hook-only: it restores promotion and dev-lanes, renders the record (which now includes the chat's model), lands, and probes.Deploy order on
github-push-mainmode: enforced, withmodeRulesmaking it advisory on pull requests.Workers AI as the model provider (the RAG specifics)
AIbinding, andlib/ai/models.tsserves two models throughworkers-ai-provider2.0.2 (the AI SDK v5 release):@cf/meta/llama-4-scout-17b-16e-instructfor the chat and understandQuery'sgenerateObject(function calling, JSON mode);@cf/baai/bge-base-en-v1.5for the embeddings.simulateStreamingMiddleware, so each step is one wholeAI.run. The provider can't read a streamed tool call in Workers AI's OpenAI-style shape, and the route chains three tools.020_workers_ai_embeddingsresizesembeddings.embeddingtovector(768)and rebuilds the HNSW index. It refuses to run while any row holds another model's vector.010, which is unchanged).AI_GATEWAY_API_KEYis optional. When set, it switches the chat only to upstream'sopenai/gpt-4othrough the gateway. Embeddings stay on Workers AI, because the column is sized to that model.next.config.mjsstarts the proxy only undernext dev;scripts/populate-static-assets-cache.mjs, which does the same copy aspopulateCache local(using OpenNext's ownCACHE_DIR) but without the proxy.Other product changes
public(rule A): migration030_row_level_securityplus.enableRLS(), with no policies and saas-starter's guard.metadataBase, so every product would have advertised upstream'sog:imageon vercel.app. This follows the postgres-drizzle-starter and portfolio-starter-kit pattern:NEXT_PUBLIC_SITE_URL;component.yaml'sbuildCommandsets it to the environment'sSITE_URL(for a custom domain) or else its workers.dev URL. The subdomain is written out because the composition exportsWORKERS_DEV_SUBDOMAINto the smoke step only./api/healthchecks the database through Hyperdrive, both tables, and that the embeddings column is 768 wide. It reportschat: workers-ai | ai-gatewayand calls no model. The deploy's smoke and the probes use it.lib/site.ts, which sets the page title. The rebrand leaves the AI SDK guide link alone, because its path ends in this baseline's slug.wrangler.jsoncis committed as the fixture render;checks.ymlruns on pull requests only;ci.ymluses thelinkedgate on v2.78.4.Baseline machinery
baseline-v2lineage):.baseline/, the rebrand engine, the bootstrap helpers, the deployment-record hook,ai/context/,docs/phases/,BOOTSTRAP.md,baseline.ymlandtag.yml.baseline.ymlinstalls pgvector for the runner's PostgreSQL.How it was verified (locally)
Repository checks
pnpm install --frozen-lockfile,wire:fixture, typecheck, lint (0 errors, 1 upstream warning), test, build.@electric-sql/pglite-pgvector0.0.9 (the version that pairs with the pinned PGlite 0.5.8). It checksvector(768), cosine ranking, both guards, and RLS against a role with the Data API's grants.drizzle-kit checkpasses and finds no pending diff.testing/*.test.sh--resumeis a no-op.verify-app-structure, builds in the staged job tree.wrangler devruns with no.dev.varsand withAIbound to a deterministic Workers AI stand-in (testing/lib/fake-workers-ai.js). It passes:/, whoseog:imageis onhttps://acme-rag-web-stage.acme.workers.dev/(never vercel.app) and is served;/api/health;vector(768)rows;anonandauthenticatedread and write neither table.orun and Terraform
orun new --statusat v2.58.11, v2.78.4 and 2.79.0;orun validate;orun work check: all clean.terraform fmt,init -backend=falseandvalidatepass on both roots.Verified only offline:
workers-deploytoken can attach an AI binding has not been tried.postgres. The e2e stand-in's superuser pre-creates pgvector, because Supabase's supautils isn't there; tests/db runs theCREATE EXTENSIONfor real.🤖 Generated with Claude Code
https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk