Skip to main content

v2.96.0

Binaries and the merged-pull-request list are on the GitHub releases page.

This release is orun's half of orun-cloud's saas-parallel-baselining PB3: a person watches their app being built, live, in a Preview tab. The coding session's box runs the repository's dev server, and the platform serves that one port of the box as the session's preview. The platform half (the box, the preview gateway, the event's place in the vocabulary) shipped first; nothing emitted the event until now.

A repository declares its preview​

A component says how it runs itself, in its component.yaml:

spec:
preview:
run: ["pnpm", "--filter", "web", "dev", "--host", "0.0.0.0", "--port", "4173"]
port: 4173
needs: [api-edge] # components whose own previews start first
path: / # the page the preview opens; default /
env: {} # optional: plain, non-secret env

and intent.yaml names the one to show:

preview:
component: web

The loader keeps both, the component-tree cache included: it used to drop every field it did not list, and it now also carries a format number, so a cache an older orun wrote is read again from the manifests rather than trusted without the preview. The catalog's schema knows the block, so it raises no component.field.unknown warning; a bad port or path is a component.spec.preview.invalid warning. orun validate checks every declaration: run a non-empty argv, port from 1024 to 65535, path starting with /, each of needs a component that declares a preview, no cycle, and a preview.component that declares one.

orun preview​

orun preview [start] # start it and wait until it answers
orun preview status [--json] # re-checked against its processes and port
orun preview stop
orun preview logs [component] [-f]

start runs the shown component's needs first, in dependency order, each from its component's directory, detached in a session of its own, with the checkout's environment without its secrets (ORUN_SESSION_TOKEN, the model and forge tokens, anything named like a secret), PORT set to its port, and its env. It waits for each port to accept connections on 127.0.0.1 (--timeout, default two minutes) and keeps .orun/preview/state.json (component, port, path, state, the processes, startedAt, and a one-line detail when it failed) beside one log per component. A preview already running healthy is left alone. See orun preview.

The session keeps it running​

orun agent serve runs the preview for a grounded coding session (never for a baseline build). The session can start before the baseline has landed, so serve re-reads the checkout's declaration every 30 seconds and after each turn, and starts the preview once the code is there. It restarts a server that exits, with backoff, and after three failed starts in a row reports failed until the declaration changes or the next turn ends. Each change is one new session event, preview_changed:

{ "kind": "preview_changed",
"payload": { "state": "ready", "port": 4173, "component": "web", "path": "/" } }

starting when it launches, ready once the port answers, failed with a detail, and stopped when the session ends, logged before the session's own terminal state. The dev server's own reload sees the agent's edits; there is nothing else to do per turn. ORUN_PREVIEW=off turns it off.

preview_changed joins the closed session-event vocabulary (internal/nodes). The attach heads show it as a note; it never reads as the session's own state.