Skip to content

BL4: blob-starter becomes an Orun baseline - #5

Merged
ruehowl merged 1 commit into
mainfrom
claude/blissful-ptolemy-c5ajf8
Oct 15, 2026
Merged

ruehowl merged 1 commit into
mainfrom
claude/blissful-ptolemy-c5ajf8

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

BL4 (task BL-5): blob-starter becomes an Orun baseline, built in ONE landing. It follows cirrus-baseline v22's single landing and portfolio-starter-kit baseline-v2's small-site layout, ported from kv-redis-starter's KR4 (sourceplane/kv-redis-starter#5). The infra is R2 instead of KV.

What was added

  • blueprint.yaml, the console card: its inputs, three brokered secrets (preview only), the programme (01-product, 02-docs), requires: [github, cloudflare] and expectedMinutes: 14.
  • repo-blueprint.yaml, the build document. It has two phases:
    • 01-product places every module. Its post hooks, in order: retouch, git-init, stage, rebrand, orun-workspace, work-tree strip, promotion and dev-lanes deferral, restage, rebrand-verify, pnpm lockfile, orun.repo/ensure, link, three orun.integrations/reconcile@v1 hooks, then orun.pr/land. Its await hooks are orun.run/watch on the merge sha, orun.secrets/exists for WIRING_CLOUDFLARE_R2 on stage and prod, and a probe of the two URLs.
    • 02-docs is hook-only. It restores the two deferrals, renders the deployment record and lands it.
  • The R2 credential fix. The R2 Terraform root used to bind CLOUDFLARE_API_TOKEN, which is the workers-deploy key and does not grant R2.
    • 01-product now also mints CLOUDFLARE_R2_TOKEN from the r2-data template, and the root binds it as its provider token. This is the same pattern cirrus uses with CLOUDFLARE_D1_TOKEN.
    • The card's spec.secrets lists the new key. The manifest test holds the card and the hooks to each other.
    • The Worker still deploys with workers-deploy.
  • Uploads on a fresh build. BL1 had already replaced Vercel Blob's BLOB_READ_WRITE_TOKEN with the Worker's BLOB R2 binding. A product built with only the Cloudflare connection can store and serve files from its first deploy. Nothing third-party is left.
  • Infra before app. apps/web declares dependsOn: cloudflare-r2 with mode: enforced, plus a modeRules entry that makes it advisory on github-pull-request.
  • The smoke check no longer depends on the site name, and it is read-only. It requests /api/blob for a name nobody stored, with a new name on each attempt. The response must be the route's own Not found 404, which only the Worker can produce, and only after reading the bucket. Then / must render the uploader.
  • Both latent bugs from the porting note are fixed:
    • apps/web/wrangler.jsonc is now committed as the fixture render, with a GENERATED banner. Checks runs git diff --exit-code to confirm it.
    • The dev lane renders the fixture (--fixture-envs dev), and the fixture has a dev entry.
    • packages/.gitkeep was added.
  • The identity seam is apps/web/app/site.ts. It holds SITE_NAME and SOURCE_URL.
    • The footer link used to point at the upstream template directory, whose URL contains the slug. A rebrand would have broken it, so it now links the product's repository.
    • The Open Graph metadataBase comes from the request's origin, so there is no SITE_URL.
  • The rest of the baseline machinery:
    • .baseline/: identity, the task contracts and the product README.
    • tooling/rebrand, tooling/bootstrap and the newer tooling/wire.
    • hooks/render-deployment-docs.sh. Its probe uses the same read-only bucket check.
    • ai/context/, docs/phases/ and BOOTSTRAP.md.
    • testing/ with the full suite.
    • The baseline.yml and tag.yml workflows.
    • ci.yml with the linked gate, and checks.yml limited to pull requests.
    • stack-tectonic pinned to 0.19.0 and orun to v2.78.4.
  • Specs: the BL4 milestone and tasks/BL-5. tasks/BL-1..4 gained metadata, without which orun work check refused them. The as-built status and risks BL-E to BL-K are recorded.

How it was verified (all offline)

Check Result
pnpm install --frozen-lockfile, wire:fixture, typecheck, lint, test (11), build green (lint shows 1 warning that came from upstream)
orun new --status at v2.58.11, v2.78.4 and 2.79.0 green: 01-product places 73 files, 02-docs is hook-only
orun validate, orun work check clean
testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer,wire}.test.sh green
testing/leak.test.sh (v2.58.11, 2.79.0) green: 73 files derived, 66 shipped sources clean
testing/placement.test.sh (v2.78.4, 2.79.0) green (details below). It refuses to run under v2.58.11, by design
testing/e2e.test.sh (v2.78.4, 2.79.0) green (details below)
Smoke against the same build with its BLOB binding removed the route returns 500 and the smoke fails, so the smoke can tell a bound bucket from a missing one
Record hook's probe against the local Worker LIVE (200) — the Worker reads its R2 bucket
terraform validate and fmt -check on infra/terraform/cloudflare-r2 (1.15.3) green

Placement details. The test runs the offline bootstrap of both phases, then the product's own orun plan --trigger github-push-main for the 01-product merge:

  • cloudflare-r2 applies on stage and prod at lane level 0, resolving CLOUDFLARE_API_TOKEN from the product's CLOUDFLARE_R2_TOKEN.
  • web deploys at level 1 with the workers-deploy key. Each deploy waits only on its own environment's apply.
  • On a pull request, nothing waits.
  • The 02-docs merge plans 0 jobs.
  • A --resume run is a no-op.

E2e details.

  • The 01-product landing passes the Checks steps.
  • The stage lane's verify-app-structure, build-app (rendering from a stage wiring document), verify-build-output and deploy-dry-run all pass in the staged job tree, with BLOB bound to the document's bucket.
  • The test serves the build with wrangler dev and runs the component's own smoke check.
  • / shows the product's name, links, origin and uploader.
  • An image uploaded twice is stored under two suffixed names and streamed back byte for byte.
  • A PDF, a missing name and an unknown object are each refused.
  • The Open Graph image, the static assets and a 404 are all served.

Not verified: a live bootstrap (risk BL-G). That covers minting the two tokens, the real terraform apply (which also needs R2 enabled on the account, BL-J), the real deploy and the probes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk


Generated by Claude Code

The repository is an Orun baseline (task BL-5): a console card
(blueprint.yaml) and a build document (repo-blueprint.yaml) that take a new
product from nothing to live on stage and prod in ONE landing — 01-product
places, brands and lands every module, one convergence applies the R2 bucket
before the Worker that binds it — then a hook-only 02-docs that records the
deployment. Ported from kv-redis-starter's KR4 (cirrus-baseline v22's one
landing, portfolio-starter-kit baseline-v2's small-site shape).

- The R2 root applied with CLOUDFLARE_API_TOKEN, the workers-deploy key,
  which cannot touch R2. 01-product now mints CLOUDFLARE_R2_TOKEN from the
  r2-data template (orun.integrations/reconcile@v1); the root binds it as its
  provider token; the card's spec.secrets previews it.
- apps/web depends on cloudflare-r2, enforced on main, advisory on pull
  requests; the landing awaits WIRING_CLOUDFLARE_R2 on stage and prod.
- wrangler.jsonc committed as the fixture render (verify-app-structure checks
  it before the build); dev renders the fixture; packages/.gitkeep.
- The smoke reads the bucket without writing to it: the delivery route's own
  404 for a never-stored name, then the uploader on /.
- app/site.ts is the rename seam (SITE_NAME, SOURCE_URL); the Open Graph
  origin is the request's.
- .baseline/, tooling/rebrand, tooling/bootstrap, hooks/, ai/context,
  docs/phases, BOOTSTRAP.md, testing/ (contract, wire, leak, placement, e2e),
  baseline.yml and tag.yml; checks.yml pull-request only; ci.yml linked gate;
  stack-tectonic 0.19.0; orun v2.78.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuyckrXahuAVgdmxamUUtk
@ruehowl
ruehowl marked this pull request as ready for review October 15, 2026 19:50
@ruehowl
ruehowl merged commit bb8afee into main Oct 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants