Skip to content

TS3: scaffold, then live — the build splits at a declared stage (saas-orun-work WA5) - #4

Merged
ruehowl merged 1 commit into
mainfrom
claude/festive-ritchie-o3kib6
Oct 31, 2026
Merged

ruehowl merged 1 commit into
mainfrom
claude/festive-ritchie-o3kib6

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

The baseline half of WA5 in Orunbase's saas-orun-work epic (orun.work, an app builder on Orunbase). The build now splits at a declared stage, so an account with no Cloudflare connection gets a code-only app and can go live later.

The phases

  • 01-scaffold, GitHub only. It places and rebrands the code, creates the repository and lands it.
    • tooling/bootstrap/deploys.mjs --defer parks the stage and prod github-push-main triggers. A scaffold merge therefore plans one verify-only job, web on dev with no secrets bound, so CI on main is green and deploys nothing.
    • Dev keeps its trigger, because orun refuses a plan whose push binding matches no environment.
  • 02-live, Cloudflare. Its first hook, subdomain.mjs --bind, replaces the late-bound placeholder your-workers-subdomain in every tracked file it reaches, writing .rebrand/values.json last so an interrupted run finishes on the next one. The hook is idempotent and refuses a bad value or a move between two real subdomains. The phase then:
    • reconciles the Cloudflare credentials;
    • restores the deploy lanes (deploys.mjs --restore);
    • lands, watches the deploy and probes stage and prod.
  • 03-docs, unchanged.

A full build (no stop) ends with the same tree as baseline-v1, apart from the framing files and the redeploy marker naming 02-live.

The card

  • spec.stages: {scaffold: 01-scaffold, live: 02-live} and lateBound: true on subdomain, in both the card and the build document. The build document keeps its default as the placeholder; orun v2.90.0 refuses to keep it in a run that doesn't stop.
  • The programme has three milestones; expectedMinutes goes from 4 to 5 (an estimate until a build is timed on stage).
  • The scaffold doesn't probe for a GitHub connection, because a managed repository is linked through a platform connection that probe can't see. The repo-link check is the GitHub gate instead.

Framing

The stage Worker sends Content-Security-Policy: frame-ancestors for 'self', the two orun.work origins (orun-agent-web-{stage,prod}.oruncloud.workers.dev) and http://localhost:*. Prod sends none.

  • The environment is baked in at build time (environmentBuildVar: DEPLOY_ENV).
  • The policy is applied in a new Worker entry, src/server.ts; the origins are one map in src/lib/framing.ts.

Verification

  • pnpm install --frozen-lockfile, typecheck, lint, test (19), build, and gen-component-docs.py --check.
  • The contract tests: manifest, phases, coverage, rebrand, retouch, bootstrap-defer, and the new subdomain test.
  • The leak, placement and e2e tiers pass on orun v2.88.0, v2.89.0 and v2.90.0. placement builds a code-only site with --until 01-scaffold, takes it live, finds no placeholder left, and matches the full build's tree.
  • Orunbase's own blueprint-manifest.ts parses the card with stages and lateBound. Its change check against baseline-v1 reports needs-review.
  • Not run: anything live (repository creation, credential minting, a deploy), since there's no workspace here.

After merge

  1. Cut baseline-v2, only once orun v2.90.0 is released: older runners ignore ORUN_BASELINE_UNTIL.
  2. Then move the tanstack-start row in sourceplane/orun-cloud's infra/baselines-registry/baselines.yaml to baseline-v2 with expectedMinutes: 5.

Generated by Claude Code

…-orun-work WA5)

orun.work builds an app from this baseline in two stages, and an account
with no Cloudflare connection stops after the first. The one landing that
built and deployed the site (01-product) splits where its needs change:

- 01-scaffold (GitHub only): the whole tree placed, branded and landed in a
  new, linked repository, stage's and prod's push-to-main activation parked
  (tooling/bootstrap/deploys.mjs). Dev keeps its own, because orun refuses
  a push plan no environment answers: a merge plans dev's verify lane, binds
  no credential and deploys nothing. No GitHub connection probe — the link
  check is the gate, and a managed-GitHub repository has no connection row.
- 02-live (Cloudflare): the late-bound subdomain bound wherever the scaffold
  wrote the placeholder (tooling/bootstrap/subdomain.mjs), the deploy lanes
  put back, the promotion gate and dev's lanes deferred, web retouched, the
  two keys minted, one landing watched to green and probed.
- 03-docs: unchanged — records it and restores the gate and dev's lanes.

The card declares spec.stages {scaffold: 01-scaffold, live: 02-live} and
lateBound: true on subdomain (so does the build document); programme and
expectedMinutes (1 + 3 + 1) follow. A full build ends on baseline-v1's tree;
a code-only build taken live later ends on the full build's, byte for byte.

The stage Worker lets orun.work frame it: src/server.ts wraps TanStack
Start's handler and adds Content-Security-Policy: frame-ancestors from a
per-environment map (src/lib/framing.ts), the environment written in at
build time from DEPLOY_ENV (the component's environmentBuildVar). Prod and
dev send none.

Tests: the card's stages and late-bound rules mirrored from Orunbase's
parser and held to the build document; the stage rules (scaffold needs
GitHub only, live binds every late input and restores the lanes; every
deferral restored); deploys.mjs and subdomain.mjs; the offline bootstrap
for a full build (each merge's plan) and a code-only build taken live; the
stage Worker's framing header end to end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNWBtvn3y8id6vTP3Yz
@ruehowl
ruehowl marked this pull request as ready for review October 31, 2026 12:46
@ruehowl
ruehowl merged commit 9a9a9bb into main Oct 31, 2026
5 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