From 83de6600a7020749897bd34cf689a0a99e92a041 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 21:04:55 +0000 Subject: [PATCH 1/2] Declare the site's live preview (saas-parallel-baselining PB4) 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/component.yaml: spec.preview. It installs this app's packages only (--filter "@app/web..."), then runs `next dev` alone on 127.0.0.1:3000, with a 1 GiB heap cap; the tab opens /. No database runs in the box: the Recent Users table shows the error it gets. - intent.yaml: preview: {component: web}. - apps/web/next.config.mjs: allowedDevOrigins for the preview's hosts (*.orun-preview.app, preview-gateway-stage.oruncloud.workers.dev). The gateway passes the browser's Origin through, and Next 16 refuses the hot reload's WebSocket from an origin it is not told about. The setting is read by `next dev` only. - apps/web/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.88.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 Claude-Session: https://claude.ai/code/session_019PcpNV6SjymJBPv3nNkC4z --- .github/workflows/baseline.yml | 29 +++++++++++++++++------------ apps/web/component.yaml | 20 ++++++++++++++++++++ apps/web/next.config.mjs | 15 +++++++++++++++ intent.yaml | 7 +++++++ 4 files changed, 59 insertions(+), 12 deletions(-) diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index ab21ea4..3d53a57 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -60,8 +60,11 @@ jobs: # Tier 1. THE BLUEPRINT, READ AND PLACED BY THE BINARY A BOOTSTRAP RUNS. # - # Pinned at the bootstrap floor (BOOTSTRAP.md), not the product's lane pin: - # every test here reads YAML with PyYAML, which parses anything well-formed; + # Pinned at v2.96.0, not the product's lane pin: at or above the bootstrap + # floor (v2.88.0, BOOTSTRAP.md), and the first orun that reads a + # component's `spec.preview`, so the placement's `orun validate` checks the + # product's live preview too. Every test here reads YAML with PyYAML, which + # parses anything well-formed; # only the pinned orun can say whether the document is one a bootstrap can # run. `--status` parses it, validates every hook against the action # registry, compiles every `when` and narration template, and writes @@ -69,18 +72,19 @@ jobs: # placement tier (the offline bootstrap: both phases placed and finished by # the blueprint's own hooks, then the product's own `orun plan` for the # 01-product merge — supabase, then cloudflare-hyperdrive, then db-migrate, - # then web, enforced — and a --resume that changes nothing). The floor is - # v2.88.0 (the task set-up in the background, the landings checked in the - # box, the deploy credentials minted in one `secrets` reconcile per - # provider), newer than the product's lane pin (v2.78.4, ci.yml), so the - # product's own plans here read the per-edge `modeRules` as its CI does. + # then web, enforced — and a --resume that changes nothing). The pin is + # above the floor, v2.88.0 (the task set-up in the background, the landings + # checked in the box, the deploy credentials minted in one `secrets` + # reconcile per provider), and newer than the product's lane pin (v2.78.4, + # ci.yml), so the product's own plans here read the per-edge `modeRules` as + # its CI does. blueprint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: sourceplane/orun-action@v1.2.0 with: - version: v2.88.0 + version: v2.96.0 - uses: pnpm/action-setup@v4 with: version: 10.12.1 @@ -123,9 +127,10 @@ jobs: # built Worker served over that database — its smoke, every route, the # page's first-request seed raced by concurrent requests, and the Data API's # roles shut out by row-level security. - # Pinned at the bootstrap floor (v2.88.0): the offline bootstrap reads the - # blueprint, and the floor is newer than the product's lane pin (v2.78.4), - # which is all the lane steps need. The runner image carries PostgreSQL 16 + # Pinned at v2.96.0, above the bootstrap floor (v2.88.0), the first orun + # that reads `spec.preview`: the offline bootstrap reads the blueprint, and + # the pin is newer than the product's lane pin (v2.78.4), which is all the + # lane steps need. The runner image carries PostgreSQL 16 # (not started); the test starts its own on a random port. product: runs-on: ubuntu-latest @@ -133,7 +138,7 @@ jobs: - uses: actions/checkout@v6 - uses: sourceplane/orun-action@v1.2.0 with: - version: v2.88.0 + version: v2.96.0 - uses: pnpm/action-setup@v4 with: version: 10.12.1 diff --git a/apps/web/component.yaml b/apps/web/component.yaml index bdb9989..7e08487 100644 --- a/apps/web/component.yaml +++ b/apps/web/component.yaml @@ -65,6 +65,26 @@ spec: - profile: deploy when: triggerRef: github-push-main + # How the site runs itself for orun.work's live Preview tab + # (saas-parallel-baselining PB4): `orun preview` starts this, and a coding + # session keeps it running while it works, so the person watches it change + # as it is built. The dev server binds the box's loopback only, on a fixed + # port, and installs first, so a checkout the session has not installed yet + # still comes up. + # It installs only this app's packages and caps the heap: the box is shared + # with the agent. No database runs in the box: the page renders, and its + # Recent Users table, which reads the Postgres the HYPERDRIVE binding points + # at, shows the error it gets. + preview: + run: + - sh + - -c + - pnpm install --frozen-lockfile --prefer-offline --filter "@app/web..." && 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" parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 7e99a58..13b2e4c 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -15,6 +15,21 @@ const nextConfig = { }, output: 'standalone', outputFileTracingRoot: path.join(__dirname, '../..'), + // Dev server only (`next build` ignores it): orun.work's live Preview tab + // loads `next dev` from the preview's own host, and Next.js refuses the + // hot reload and other /_next/* dev requests from an origin it is not told + // about. These are the preview's hosts, prod's and stage's. + allowedDevOrigins: ['*.orun-preview.app', 'preview-gateway-stage.oruncloud.workers.dev'], + experimental: { + // Dev server only: behind orun.work's live Preview the browser's Origin + // is the preview's host while `next dev` sees a local Host, and Next.js + // refuses a Server Action from an origin it is not told about. `next + // build` runs with NODE_ENV=production, so production keeps its + // same-origin check. + ...(process.env.NODE_ENV === 'development' + ? { serverActions: { allowedOrigins: ['*.orun-preview.app', 'preview-gateway-stage.oruncloud.workers.dev'] } } + : {}), + }, } export default nextConfig diff --git a/intent.yaml b/intent.yaml index 5b93774..03f1982 100644 --- a/intent.yaml +++ b/intent.yaml @@ -57,6 +57,13 @@ compositions: cloudflare-domain: stack-tectonic db-migrate: stack-tectonic +# The live preview (saas-parallel-baselining PB4): the component orun.work's +# Preview tab shows while a coding session works on the site. Its own +# `spec.preview` (apps/web/component.yaml) says how it runs; `orun preview` +# runs it. +preview: + component: web + discovery: roots: - apps/ From 680feb4d1d5527a2999c6f96d3e2244b6da28c8c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 21:05:12 +0000 Subject: [PATCH 2/2] Say what the preview shows without a database The page reads Postgres on every request and has no error boundary, so with no database in the box the whole page gives way to Next's runtime-error screen, not just its table. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_019PcpNV6SjymJBPv3nNkC4z --- apps/web/component.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/component.yaml b/apps/web/component.yaml index 7e08487..359f76b 100644 --- a/apps/web/component.yaml +++ b/apps/web/component.yaml @@ -72,9 +72,9 @@ spec: # port, and installs first, so a checkout the session has not installed yet # still comes up. # It installs only this app's packages and caps the heap: the box is shared - # with the agent. No database runs in the box: the page renders, and its - # Recent Users table, which reads the Postgres the HYPERDRIVE binding points - # at, shows the error it gets. + # with the agent. No database runs in the box, and the page reads the + # Postgres the HYPERDRIVE binding points at on every request, so until one + # is reachable it shows Next's runtime-error screen. preview: run: - sh