Skip to content

Declare the console's live preview (saas-parallel-baselining PB4) - #366

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
Contributor

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-console-next/component.yaml: spec.preview:
    preview:
      run:
      - sh
      - -c
      - pnpm install --frozen-lockfile --prefer-offline --filter "@saas/web-console-next..." && exec node_modules/.bin/next dev -H 127.0.0.1 -p 3001
      port: 3001
      path: /
      env:
        NEXT_PUBLIC_DEPLOY_ENV: stage
        NODE_OPTIONS: --max-old-space-size=1024
        NEXT_TELEMETRY_DISABLED: '1'
  • intent.yaml: preview: {component: web-console-next}.
  • apps/web-console-next/next.config.mjs: a dev-only Server Actions allow-list (experimental.serverActions.allowedOrigins, only when NODE_ENV === "development") for the preview's hosts. next build runs with NODE_ENV=production, so production keeps its same-origin check (experimental is {} there). Next 15.0.3 needs no allowedDevOrigins: its hot-reload socket connects from the preview origin.
  • .github/workflows/tag.yml (new): this repository had no Baseline tag workflow, and its baseline-v1…v3 were cut by hand. A baseline tag should be cut by a workflow, which refuses a malformed version and never moves an existing tag. So this adds sourceplane/lumen's (same family) cut job verbatim, but not lumen's publish-console job or the two inputs that only serve it: that job packs the console with apps/web-console-next/scripts/console-artifact.mjs, which this tree does not have, so it would fail every run. repo-blueprint.yaml gains lumen's ignore line for it (**/.github/workflows/tag.yml), because github-workflows copies all of .github into every product.
  • .github/workflows/baseline.yml: orun v2.58.11 → v2.96.0, the first release that reads spec.preview, so the placement test's orun validate checks the declaration. ci.yml (the product's own lane pin, v2.56.2) is unchanged. testing/placement.test.sh now accepts the newer CLI's wording of the same repo-scale gate (✓ Verified intent valid …), ported from lumen's copy. Without that, main itself is red on any orun after v2.58.x.

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 5.5 s (warm pnpm store)
GET / 200, 32.1 KB, "Sourceplane Console"
foreign Host + Origin straight to the dev server 200
through the gateway stand-in, framed frame 200, failed: FAILED net::ERR_ABORTED /login?_rsc=v3pub, hot-reload socket connected
an edit reaches the frame hot update in 0.5s
memory dev server 872 MB at its peak (page compiled, after an edit); the install peaks at 872 MB
orun preview stop stops it; port freed

Console errors in the frame: Access to fetch at 'https://api-edge-stage.rahulvarghesepullely.workers.dev/v1/auth/oauth/providers' from origin 'http://abc123def456.orun-preview.app:13001' has been blocked by CORS policy: Response to preflight request doesn't pass access; Failed to load resource: net::ERR_FAILED

Notes

  • Draft, not for merging yet: the pin bump surfaces a real problem. With orun v2.96.0, testing/placement.test.sh fails at 01-scaffold. The blueprint places intent.yaml (and so its preview: block) in 01-scaffold, but web-console-next only in 06-console. orun validate therefore refuses preview.component "web-console-next" names no component ("the scaffolded intent does not plan"). Bootstraps run the latest orun, so a product built from this tree as it stands would stop at phase 01. There are two fixes. One is in orun: validate could treat a preview component that is not placed yet as "(yet)", as orun preview already does. The other is here: strip the block in 01 and add it back in 06-console. That is a change to how products are bootstrapped, and this PR does not make it on its own. lumen has the same problem (Declare the console's live preview (saas-parallel-baselining PB4) lumen#125).
  • Merging runs the real pipeline (workspace ws_NDEXCDQS): it redeploys the stage and prod console.
  • Server Actions, probed by POSTing a Next-Action request with Host: 127.0.0.1:3001. With the allow-list, https://<token>.orun-preview.app and https://preview-gateway-stage.oruncloud.workers.dev pass the origin check: the probe's made-up action id then reads "Failed to find Server Action". A foreign Origin still gets 500 "Invalid Server Actions request".
  • What it shows: / (Loading…) forwards to /login, which renders in full, "locked to stage". Pages behind sign-in show the sign-in prompt. The stage API refuses the preview origin by CORS: this is the sign-in page's OAuth-providers fetch. The aborted /login?_rsc request is a router prefetch, cancelled by the client-side redirect.

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. The box is small and shared with
the agent, so the preview is the console alone, as on cirrus and lumen:

- apps/web-console-next/component.yaml: spec.preview. It installs the
  console's own packages only (--filter "@saas/web-console-next..."), then
  runs `next dev` directly on 127.0.0.1:3001, with a 1 GiB heap cap; its API
  is the deployed stage (NEXT_PUBLIC_DEPLOY_ENV=stage, the variable a stage
  build is given). No `needs`, so no Worker, Supabase or wrangler starts.
- intent.yaml: preview: {component: web-console-next}.
- apps/web-console-next/next.config.mjs: a dev-only Server Actions
  allow-list for the preview's hosts. `next build` runs with
  NODE_ENV=production, so production keeps its same-origin check.
- .github/workflows/tag.yml: the Baseline tag workflow, lumen's `cut` job
  as it is, so a baseline tag is cut by a workflow here too. lumen's
  `publish-console` job is left out: this console has no prebuilt-artifact
  packer to publish with. repo-blueprint.yaml ignores tag.yml, as lumen's
  does, so it does not travel into products.
- baseline.yml: orun v2.58.11 -> 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, v2.56.2) is unchanged. placement.test.sh accepts
  the newer CLI's wording of the repo-scale gate, as lumen's does.

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