Repository navigation
CM4: commerce becomes an Orun baseline - #5
Merged
Merged
Conversation
The repository is now a baseline: blueprint.yaml (the console card) and repo-blueprint.yaml (the build) take a new storefront from nothing to live on stage and prod in TWO phases, cirrus-baseline v22's one-landing shape, ported from kv-redis-starter's conversion: - 01-product places every module (root files, CI, tooling, the R2 root, the storefront, its tests), retouches, brands, re-tenants, strips the work tree, defers prod's promotion gate and dev's push lanes, confirms the lockfile, ensures and links the repository, reconciles three brokered keys - CLOUDFLARE_API_TOKEN (workers-deploy), CLOUDFLARE_R2_TOKEN (r2-data) and CLOUDFLARE_ACCOUNT_ID (account-id) - and lands it as one pull request; it then watches the merge's convergence, checks WIRING_CLOUDFLARE_R2 exists on stage and prod, and probes both URLs. - 02-docs is hook-only: restores the two deferrals, renders the deployment record from probed facts, lands it. INFRA BEFORE APP. apps/web depends on cloudflare-r2 with mode: enforced (advisory on github-pull-request), so the product's own push-to-main plan applies the bucket at lane level 0 and deploys each Worker at level 1, waiting on its own environment's apply alone. THE R2 KEY. workers-deploy grants Workers Scripts and KV and no R2, so the R2 root now binds its provider token to CLOUDFLARE_R2_TOKEN, minted from r2-data by its own reconcile hook; the card's spec.secrets mirrors it. NO THIRD-PARTY KEY ON A FRESH BUILD. Shopify is not a provider the platform brokers, so every function lib/shopify exports is now a switch: with SHOPIFY_STORE_DOMAIN set, upstream's cached Storefront API reader; unset, lib/demo - a bundled catalogue (six products with variants, collections, menus, pages, SVG images) and a cookie cart priced from it. The switch is outside "use cache", so no demo answer outlives a connected store. A /cart page renders the cart on the server; /checkout answers 200 with "Connect a payment provider to enable checkout" (or forwards to Shopify's checkout); a banner says the store is a demo. The product's README documents connecting Shopify (three Worker secrets, the webhooks). The port's latent faults, fixed: wrangler.jsonc committed as the fixture render (verify-app-structure checks it before the build); dev renders the fixture; packages/.gitkeep; Next 16's Promise params in the two image routes; the sitemap's 500 without a store. No SITE_URL: metadata, robots and the sitemap are built on the request's origin. The store's name and source link are apps/web/app/site.ts. The slug is an English word, so no shipped file spells it (or "Commerce") outside an identity form, and the leak gate holds that. Verified: the contract tests, the leak gate (v2.58.11, v2.79.0), placement with the product's own plan (v2.78.4, v2.79.0), the e2e (v2.78.4, v2.79.0: the stage lane in the staged tree, wrangler dev, the smoke, browse to a product, add it to the cart through the build's server action, check out to the payment-provider notice), orun new --status at three versions, orun validate, orun work check, terraform validate, and the repository's own Checks. Not verified: a live bootstrap, or a real Shopify store. 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 20:06
ruehowl
added a commit
that referenced
this pull request
Oct 21, 2026
…text pack (#6) * CM5: 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 every component from what it 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 CM4 (shipped in #5, tagged baseline-v1) and record CM5 (CM-6). - Make the docs say what CM4 built: risk CM-B and design §2/§7 no longer list wrangler vars or call CM-B open; the status file no longer cites a .dev.vars.example that CM4 folded into .env.example; the epic README's gate says offline is terraform validate only. 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
* CM5: 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 every component
from what it 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 CM4 (shipped in #5, tagged baseline-v1) and record CM5 (CM-6).
- Make the docs say what CM4 built: risk CM-B and design §2/§7 no longer
list wrangler vars or call CM-B open; the status file no longer cites a
.dev.vars.example that CM4 folded into .env.example; the epic README's
gate says offline is terraform validate only.
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
* CM5: 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: CM-7 under CM5, 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
* CM5: 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 every component
from what it 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 CM4 (shipped in #5, tagged baseline-v1) and record CM5 (CM-6).
- Make the docs say what CM4 built: risk CM-B and design §2/§7 no longer
list wrangler vars or call CM-B open; the status file no longer cites a
.dev.vars.example that CM4 folded into .env.example; the epic README's
gate says offline is terraform validate only.
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
* CM5: 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: CM-7 under CM5, status, plan, epic index, ai/context
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8AmgTwmnp4M8mgmnS9aha
* CM6: the console asks for no domain — the domain is set later
The store goes live on workers.dev from its first deploy and builds its
absolute links from the request it answers, so nothing in the build needs a
domain and 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 and ai/context/operations.md say how to set it
- testing/fixtures/acme.json carries no domain; rebrand.test.sh pins the
placeholder (absent, empty, and the fixture's acme-commerce.example.com,
which ends in the baseline's domain); baseline.yml's blueprint read sets
no domain
- records: CM6 / CM-8, 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.
CM4 (task CM-5): the repository becomes an Orun baseline in cirrus-baseline v22's one-landing shape, ported from kv-redis-starter's conversion (sourceplane/kv-redis-starter#5). Its infra is an R2 bucket (the storefront's Next.js data cache), and its third party, Shopify, is no longer a precondition of going live.
What was added
The baseline layer (copied from kv-redis-starter where the porting note calls it generic, adapted elsewhere)
blueprint.yaml(the card) andrepo-blueprint.yaml(the build): two phases.01-productplaces every module, then runs retouch → git-init → stage → rebrand → orun-workspace → work-tree strip → promotion/dev-lanes defer → restage → rebrand-verify → pnpm lockfile →orun.repo/ensure@v1→ link → threeorun.integrations/reconcile@v1hooks →orun.pr/land@v1. Its await runsorun.run/watch@v1on the merge sha, thenorun.secrets/exists@v1forWIRING_CLOUDFLARE_R2on stage and prod, thenorun.http/probe@v1on both URLs.02-docsis hook-only: it restores both deferrals, renders the deployment record, lands, and probes..baseline/(identity, task contracts, the product README),tooling/rebrand(only its header and defaults changed),tooling/bootstrap,tooling/wire(now with--fixture-envs),hooks/render-deployment-docs.sh,ai/context/,docs/phases/,BOOTSTRAP.md.testing/(the full suite) and.github/workflows/{baseline,tag}.yml.ci.ymlnow has thelinkedgate, andchecks.ymlruns on PRs only.Infra before app.
apps/webdeclaresdependsOn: cloudflare-r2withmode: enforcedand amodeRulesentry that makes it advisory ongithub-pull-request. The product's own push-to-main plan (placement tier) comes out as:cloudflare-r2.{stage,prod}.terraformterraform.applyCLOUDFLARE_R2_TOKENweb.{stage,prod}.verify-deploycloudflare-workers-assets-turbo.deployCLOUDFLARE_API_TOKENThe R2 key.
workers-deploycarries no R2. The R2 root now binds its providerCLOUDFLARE_API_TOKENtoCLOUDFLARE_R2_TOKEN, which a separater2-datareconcile hook mints. The card'sspec.secretsmirrors all three keys (workers-deploy,r2-data,account-id), andmanifest.test.shchecks them against the hooks.No third-party key on a fresh build. Rule 8 applies: Shopify is a third party.
lib/shopifyis now a switch. WithSHOPIFY_STORE_DOMAINset it calls upstream's cached Storefront API reader, unchanged. Unset, it answers fromlib/demo: six products with variants (one sold out), collections including the twohidden-homepage-*, menus, pages, and SVG images inpublic/demo. The cart is a cookie, priced from the catalogue on every read."use cache", so no cached demo answer survives connecting a store./cart(rendered on the server) and/checkout. Without a store,/checkoutanswers 200 with "Connect a payment provider to enable checkout"; with one, it forwards to Shopify's hosted checkout.Latent faults fixed
wrangler.jsoncis now committed as the fixture render.verify-app-structurechecks for it before the build, and Checks diffs it.packages/.gitkeep.tasks/CM-1..4gainedmetadata, soorun work checkpasses.Other changes
SITE_URL: metadata, robots and the sitemap are built on the request's origin.apps/web/app/site.ts./plus arobots.txtthat must name the origin it was asked on. It does not depend on the name or the store backend.commerceis an English word. No shipped file spells it, orCommerce, outside an identity form, and the leak gate enforces this. Upstream is credited by description instead.How it was verified
pnpm install --frozen-lockfile,wire:fixture+git diff --exit-code, typecheck, lint, test (6 files, 33 tests), build: green on Node 22.testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh: green.testing/leak.test.sh: green at v2.58.11 and v2.79.0. 140 files derived, 133 shipped sources scanned.testing/placement.test.sh: green at v2.78.4 and v2.79.0. At v2.58.11 the test refuses to run, by design. It covers the offline bootstrap of both phases, the product's own push-to-main plan above, the PR plan (nothing waits), the 02-docs merge (0 jobs), and--resume(a no-op).testing/e2e.test.sh: green at v2.78.4 and v2.79.0.verify-app-structure,build-app,verify-build-output,deploy-dry-run. The bucket name comes from the stage wiring document.wrangler dev, with no Shopify key, the component's smoke passes./product/cloud-tee?color=Black&size=S→ Add To Cart twice through the build's ownaddItemserver action →/cartshows 2 → Proceed to Checkout →/checkoutshows the payment-provider notice.orun new --statusat v2.58.11, v2.78.4 and 2.79.0:01-productplaces 140 files and02-docsis hook-only.orun validateandorun work checkare clean.terraform validatepasses oninfra/terraform/cloudflare-r2.adopt.tfneeds the Cloudflare API at plan time, so offline verification stops at validate.Not verified (offline only):
workers-deploytoken is enough to upload a Worker that binds an R2 bucket. This is risk CM-M; if a live deploy refuses it, the fix is to give the deploy ther2-datakey as well.🤖 Generated with Claude Code
https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
Generated by Claude Code