Skip to content

Declare the API's live preview (saas-parallel-baselining PB4) - #4

Merged
ruehowl merged 1 commit into
mainfrom
claude/declare-preview
Nov 4, 2026
Merged

ruehowl merged 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/api/component.yaml: spec.preview:
    preview:
      run:
      - sh
      - -c
      - pnpm install --frozen-lockfile --prefer-offline --filter "@app/api..." && exec node_modules/.bin/wrangler dev --local --ip 127.0.0.1 --port 8787 --show-interactive-dev-session=false
      port: 8787
      path: /
      env:
        WRANGLER_SEND_METRICS: 'false'
  • intent.yaml: preview: {component: api}.
  • .github/workflows/baseline.yml: orun v2.88.0 → v2.96.0, the first release that reads spec.preview, so the placement test's orun validate checks the declaration. ci.yml (the API's own lane pin, v2.78.4) 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 12.1 s (warm pnpm store)
GET / 200, 0.1 KB
foreign Host + Origin straight to the dev server 200
through the gateway stand-in, framed frame 200, no failed assets, hot-reload socket not opened
an edit reaches the frame no live reload; the server reloaded the edit, shown on a refresh (20.7s)
memory dev server 1002 MB at its peak (page compiled, after an edit); the install peaks at 1465 MB
orun preview stop stops it; port freed
contract tests (manifest, phases, coverage, rebrand, retouch, bootstrap-defer), gen-component-docs.py --check pass

Notes

  • wrangler dev --local ("run locally with remote bindings disabled"). Without it, wrangler starts a remote proxy session for the AI binding (Workers AI has no local mode); with no Cloudflare credential in the box it fails (In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN) and the dev server exits, so the tab would show nothing. With --local the Worker starts and serves every route; only a call to the model fails.
  • A Slack bot has no page of its own: it answers Slack-signed POST /api/events, and the Slack secrets are never in a preview, so that route answers 503 (not connected). The tab opens /, the JSON index (the bot's name, its endpoints, slack: not connected); /health answers JSON too. wrangler reloads the Worker on each edit; a JSON answer has no live reload, so the tab shows an edit on its next refresh.
  • wrangler refuses a port that is already taken (Address already in use), so the preview fails rather than moving.

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/api/component.yaml: spec.preview. It installs this app's packages
  only (--filter "@app/api..."), then runs `wrangler dev --local` on
  127.0.0.1:8787; the tab opens /, the bot's index. `--local` keeps
  remote bindings off: Workers AI has no local mode, and wrangler would
  otherwise open a remote session that needs a Cloudflare credential and
  stop without one. wrangler refuses a port that is taken rather than
  moving.
- intent.yaml: preview: {component: api}.
- 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
  API's own lane pin) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNV6SjymJBPv3nNkC4z
@ruehowl
ruehowl marked this pull request as ready for review November 4, 2026 20:41
@ruehowl
ruehowl merged commit 91cec04 into main Nov 4, 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