From f14f8354f35770ec4257cf5d5a661b320d74a899 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 20:09:11 +0000 Subject: [PATCH] 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 /. - 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. - 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 site'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 | 18 +++++++++++------- apps/web/component.yaml | 16 ++++++++++++++++ apps/web/next.config.mjs | 5 +++++ intent.yaml | 7 +++++++ 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.github/workflows/baseline.yml b/.github/workflows/baseline.yml index 420017c..0c8e9df 100644 --- a/.github/workflows/baseline.yml +++ b/.github/workflows/baseline.yml @@ -58,8 +58,11 @@ jobs: # Tier 1. THE BLUEPRINT, READ AND PLACED BY THE BINARY A BOOTSTRAP RUNS. # - # Pinned at the bootstrap floor (BOOTSTRAP.md), not the site's lane pin: - # every test here reads YAML with PyYAML, which parses anything well-formed; + # Pinned at v2.96.0, not the site'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 + # site'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 @@ -73,7 +76,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 @@ -109,10 +112,11 @@ jobs: # Tier 2. THE SITE IT PRODUCES WORKS: the finished site installed, its # fixtures rendered, type-checked, linted, tested and built, the stage # lane's own build, output check and dry deploy, and the built Worker served - # and smoke-tested with the component's own smoke command. Pinned at the - # bootstrap floor (v2.88.0): the offline bootstrap reads the blueprint (its + # and smoke-tested with the component's own smoke command. 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 (its # one `secrets` reconcile, its background task set-up, its landings checked - # in the box), and the floor is newer than the site's lane pin (v2.78.4), + # in the box), and the pin is newer than the site's lane pin (v2.78.4), # which is all the lane steps need. site: runs-on: ubuntu-latest @@ -120,7 +124,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 dcd75a6..537281b 100644 --- a/apps/web/component.yaml +++ b/apps/web/component.yaml @@ -38,6 +38,22 @@ 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 the site + # change as it is built. It installs only this app's packages, then runs + # `next dev` alone on the box's loopback, on a fixed port, with its heap + # capped: the box is shared with the agent. + 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 0725c23..f241179 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -10,6 +10,11 @@ const nextConfig = { // resolve from the root node_modules. 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"], }; export default nextConfig; diff --git a/intent.yaml b/intent.yaml index e56e396..deba555 100644 --- a/intent.yaml +++ b/intent.yaml @@ -61,6 +61,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/