Skip to content

Declare the site's live preview (saas-parallel-baselining PB4) - #3

Draft
ruehowl wants to merge 1 commit into
mainfrom
claude/declare-preview
Draft

ruehowl wants to merge 1 commit into
mainfrom
claude/declare-preview

Conversation

@ruehowl

@ruehowl ruehowl commented Nov 4, 2026

Copy link
Copy Markdown

What

The baseline declares its live preview, so orun.work's Preview tab can show a coding session's dev server (saas-parallel-baselining PB4).

  • apps/web-site/component.yaml: spec.preview:
    preview:
      run:
      - sh
      - -c
      - pnpm install --frozen-lockfile --prefer-offline --filter "@site/web-site..." && exec node_modules/.bin/next dev -H 127.0.0.1 -p 3000
      port: 3000
      path: /
      env:
        NODE_OPTIONS: --max-old-space-size=1024
        NEXT_TELEMETRY_DISABLED: '1'
  • intent.yaml: preview: {component: web-site}.
  • apps/web-site/next.config.mjs: experimental.serverActions.allowedOrigins: ["*.orun-preview.app", "preview-gateway-stage.oruncloud.workers.dev"], in development only (process.env.NODE_ENV === "development"). Behind the gateway the Origin is the preview's host while next dev sees Host: 127.0.0.1:3000, and Next refuses a Server Action from an origin it is not told about. The site has none today; this keeps one a session adds working in the preview. next build runs with NODE_ENV=production, so production keeps its same-origin check. No allowedDevOrigins: the key arrived in Next 15.2, and 15.0.3 does not check the hot reload's origin (its webpack HMR socket connected through the gateway stand-in).
  • .github/workflows/baseline.yml: the blueprint-runs pin, orun v2.76.0 → v2.96.0, the first release that reads spec.preview, so the placement's orun validate checks the declaration; its comment says so. ci.yml (the product's own lane pin, v2.78.0) is unchanged.

Nothing about how the baseline builds or deploys changes.

Checked

From a clean clone, with orun v2.96.0, and through a local stand-in of the preview gateway (the dev server sees a local Host and the browser's own Origin; the page is framed from a foreign origin):

Check Result
orun validate passes
orun preview start --json ready in 6.0 s (warm pnpm store)
GET / 200, 45.9 KB, "Virga"
foreign Host + Origin straight to the dev server 200
through the gateway stand-in, framed frame 200, no failed assets, hot-reload socket connected
an edit reaches the frame hot update in 1.0s
memory dev server 820 MB at its peak (page compiled, after an edit); the install peaks at 861 MB
orun preview stop stops it; port freed

Console errors in the frame: Failed to load resource: net::ERR_CONNECTION_REFUSED

Notes

  • Not landed: the blueprint is phased, and orun v2.96.0 refuses its first phase with this declaration. repo-blueprint.yaml places intent.yaml in 01-scaffold (module root-intent) and apps/web-site in 06-site (module web-site). With preview: {component: web-site} in the intent, the repo-scale gate that closes 01-scaffold runs orun validate on a tree that has no web-site component yet: orun new --blueprint repo-blueprint.yaml --phase 01-scaffold on v2.96.0 fails with ✕ repo-scale gate failed: validate: preview validation failed: preview.component "web-site" names no component. A real bootstrap, which runs the latest orun phase by phase, would stop there. This repository's own placement.test.sh places the whole tree at once, so it passes and does not catch it. The pin bump, the intent block and the test are kept as they are; the fix (orun tolerating a preview component a later phase places, or blueprint hooks that add the block with the UI's phase) is the owner's decision. Everything else here was checked and works.
  • The site alone: site-api and mail-worker do not run. The site learns site-api's origin only from NEXT_PUBLIC_SITE_API_URL, which its build composes from the product's own workers.dev subdomain (a per-product value, not set here), so the islands that call it from the browser (views, upvotes, the subscribe and contact forms) fall back to http://localhost:8787, fail (ERR_CONNECTION_REFUSED, the frame's one console error) and render their static messages, as they do whenever site-api is unreachable. Everything else (launches, writing, projects, pages from content/) renders.
  • Contract tests (coverage, phases, manifest, leak, retouch, tenancy, rebrand) and placement.test.sh pass locally on orun v2.96.0. Memory: the dev server is ~0.82 GB (next-server 15.0.3 with webpack ~0.73 GB).

Generated by Claude Code

orun.work's Preview tab shows a coding session's dev server, live from its
box: `orun preview` (orun v2.96.0) runs what a repository declares, and the
session keeps it running while it works.

- apps/web-site/component.yaml: spec.preview. It installs this app's packages
  only (--filter "@site/web-site..."), then runs `next dev` alone on
  127.0.0.1:3000, with a 1 GiB heap cap; the tab opens /. site-api and
  mail-worker do not run; the islands that call site-api degrade to their
  static messages. Next 15.0.3 has no allowedDevOrigins (15.2+) and does not
  check the hot reload's origin.
- intent.yaml: preview: {component: web-site}.
- apps/web-site/next.config.mjs: experimental.serverActions.allowedOrigins for
  the same hosts, in development only (NODE_ENV=development), so a Server
  Action is not refused behind the preview; `next build` keeps Next's
  same-origin check.
- baseline.yml: orun v2.76.0 -> v2.96.0, the first release that reads
  spec.preview, so the placement's `orun validate` checks it. ci.yml (the
  product's own lane pin) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNV6SjymJBPv3nNkC4z
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