* raea goal check reads an export's captions and hears its voice: captions and voice packs, and the farm reads text
Shane 11-30: "running a transcription and ocr pass on the final output ... catch if audio captions pick up something
else that's not supposed to be there or if we cut off words. as well we should be checking audio if it's too quiet
for dialogue". Elfster's cut 1 shipped hand-typed captions that dropped "when they get", "okay, this is" and
"organize your"; Body Shop's reaction cut buried the host 7 dB over its music. No check saw either.
captions (sdk/goal/src/packs/captions.ts): the farm's /v1/scene now reads each line of text (texts, RapidOCR
PP-OCRv4, Apache-2.0, about 0.13 s a 540-wide frame on CPU). A line is a caption when it fits what's said while
it's up with few edits (capitals, a badge's style, held stricter), lasts under 4.5 s, sits in a row with other
captions, in a frame with 3 lines or fewer, and the cut has a track of them (8 showings, 40% of the speech).
Shown-not-said: letters no word near it holds. Said-not-shown: words between captioned words that no caption has,
an error for 3 or more in a row where the captions are phrases; a line at a caption run's edge is a warning.
Calibrated on our 8 Elfster/Body Shop cuts and 4 shipped client refs: the refs' phrase captions pass clean but
one (Body Shop Video6's opening line under its hook card), and ours find what was found by hand.
voice (packs/voice.ts): on the export, the speech's level (80th percentile inside words) over the bed between
words: under 6 dB an error, under 10 a warning; each line against the typical line: 6 dB quieter an error, 4 a
warning. The 4 refs are clean; Elfster 2am (4.5 dB) and Body Shop edible (4.4) fail.
Both are in the cut and floor sets. The Scene type carries texts; media.ts passes them through. The farm needs a
deploy (rapidocr in the image) before captions reads anything; until then it notes the reader has no texts.
* raea goal check times on-screen text against its words: the reading pack
Shane 11-30: "the words on screen relative to duration ... if a wordy CTA or component or scene is meant to be fully
read or if it just adds glossable content or context, and if it's on screen long enough to be read."
From the farm's texts, every line that isn't a caption (nor words shown as they're said) is followed frame to frame;
lines that come up together are one block. A block needs 0.5 s plus 3 words a second: under that a warning, under 60%
of it an error. A block of 25 words or more, small text (under 54 px of 1080x1920) or a phone's screen (a status-bar
clock) is texture: a warning that asks whether it's meant to be read. Frames with more than 6 lines (a shelf of
labels, an app shot whole) and blocks of 3 words or fewer are left out. Every finding gives words, seconds and words
a second.
Calibrated on the 8 Elfster/Body Shop cuts and 4 shipped refs: it finds Elfster cut 2's 15-word hook card up 1 s and
Body Shop's reaction CTA card (11 words, 2 s); the refs give one error (an Elfster app screen up 1 s). In cut and floor.
* raea goal check holds every size the brief asks for at done (sizes-all)
Shane 11-30: "it will show completed but what about doing all the resizes". Dutch finished on its 9:16 masters alone:
the brief's 4:5, 1:1 and 16:9 were never made, because one-size-first was a rule against resizing early and nothing
asked for the other sizes at the end. At done, every ad's newest version (adOf, _v#) must be in every format its
brief names (cut `formats`, the brief's and each cut's), unless a person's answer to the open item about "sizes"
names fewer. The finding says which sizes are missing and the file name each takes. test/sizes.test.ts.
* raea ducks music under the talking by default, and goal check holds the hook and the air between words
Shane 11-30: the StreetTalk cuts' music was "about 4 or 5 decibels too loud ... make sure standards and measurements
correctly mix by default to move audio down in the mix, especially while talking, but a CTA with no audio is fine";
Elfster's Voted cut opened on 1.5 s of a silent whiteboard ("a hook really should have audio and video stimulation");
and "measuring and cutting air gaps safely ... it CANNOT destroy words".
- systems/mix: an edit with no Tone graph gets DEFAULT_GRAPH: footage and voice files on a `talk` bus, effects on the
master, any other audio file on a `bed` bus ducked DEFAULT_DUCK_DB (-6) under the talking, released where nobody
talks. The names aren't raea/tone's, so an edit's own buses never change; `bus="master"` opts a sound out. Offline
bounce and live play pick it the same way (score.rs routes a bus-less sound by default_bus). Test: the music sits
6 dB down under the talk and comes back after it.
- @raea/video airgaps: airGaps(words) and tighten(words, { levels }): the spans of a take to keep, gaps cut to 0.15 s
in the hook and 0.25 s after, only between words, 80 ms kept either side, each cut pulled back while the take is
still loud (a transcript's early word end).
- goal packs hook and airgaps (cut and floor): a first word over 1 s in with a quiet opening is an error (Voted:
1.5 s, -15 dB); gaps over 0.5 s in the first 3 s are errors, over 0.3 s warnings, over 0.8 s after warnings.
- sound pack: bus-less files classed as the mixer routes them (a music file with any name is music, not a voice
line), the default duck counted, and music within 10 dB of the voice warns (was 6), as the voice pack does.
* The voice check judges the bed only on enough gaps between words
Body Shop's host-hook cut read "1.5 dB above what's under it" off a single 0.34 s gap between two "Mmm"s, where the
speaker was still humming; the agent's own measure (pauses of 0.8 s and more) read 11.7 dB. A tightly cut take has few
gaps, so the bed is judged only on 3 or more gaps and 1 s of them in all.
* The default mix's graph moves to raea-sys-tone, and its test to its own file, so raea-sys-mix is under 2000 lines
CI's size gate: raea-sys-mix was 2048 lines and offline.rs 530. DEFAULT_GRAPH, DEFAULT_DUCK_DB and default_bus are
the default Tone graph, so they live with the graph format in raea-sys-tone (defaults.rs) and raea-sys-mix re-exports
them; the duck test is duck_test.rs.
---------
Co-authored-by: shinyobjectz <[email protected]>
raea cloud
raea and an ACP agent on a server of your own. One image holds raea's Linux release, the agents you choose and a small server. You deploy it wherever you run containers, and talk to it over HTTP and ACP. raea doesn't host it: the server, the GPU and the agent's subscription are yours. Spec: docs/cloud.feature.
your code ── RaeaCloud (src/) ──▶ :8080 raea-cloud server ──▶ raea (render, play, check, ...) on a GPU or the CPU
HTTPS + one token /v1/acp (WebSocket) ──▶ the agent, over ACP, in ~/work
/v1/files, /v1/run, /v1/jobs, /v1/login, /v1/health
One image runs on a CPU or an NVIDIA GPU and says which (/v1/health's device). Two shapes:
A. one server agent + raea ── on a GPU host, or a CPU host
B. a box and a worker agent + raea (CPU, always on, cheap) ── raea render ──▶ GPU worker (asleep when idle)
RAEA_CLOUD_GPU_URL /v1/jobs: the project in, what it made back
Run it
cd sdk/cloud
docker build --platform linux/amd64 -f image/Dockerfile \
--build-arg RAEA_VERSION=0.1.1 --build-arg AGENTS="kimi-code" -t raea-cloud .
export RAEA_CLOUD_TOKEN=$(openssl rand -hex 32)
docker run -d -p 127.0.0.1:8080:8080 -e RAEA_CLOUD_TOKEN -v raea-home:/home/raea raea-cloud
curl -H "authorization: Bearer $RAEA_CLOUD_TOKEN" localhost:8080/v1/health
AGENTS takes any ids the ACP registry
lists, several at once: kimi-code, claude-acp, codex-acp, gemini, opencode, goose, ... Each is installed
from its registry entry (npm at the registry's version, or its Linux archive checked by sha256), and raea's skill is
installed for it on every start. A socket names its agent (?agent=); RAEA_AGENT names one for sockets that don't. With neither, there is no agent: the box never picks one itself.
RAEA_AGENT_CMD runs an agent the registry doesn't list, by its command line.
Signing the agent in:
- Kimi Code signs in by a device code:
POST /v1/login?agent=kimi-code(orcloud.login()) returns a link and a code to approve once. The sign-in is kept in the home folder. - Claude, Codex, Gemini take their key from the container's environment:
ANTHROPIC_API_KEY(orCLAUDE_CODE_OAUTH_TOKEN),OPENAI_API_KEY,GEMINI_API_KEY.
Use it
import { RaeaCloud } from "@raea/cloud" // sdk/cloud/src
const cloud = new RaeaCloud({ url: "https://raea.example.com", token: process.env.RAEA_CLOUD_TOKEN! })
// raea on its own
await cloud.run(["init"], { cwd: "card" })
await cloud.run(["render", "edit.tsx", "-o", "card.mp4"], { cwd: "card", onOutput: (t) => process.stdout.write(t) })
const mp4 = await cloud.read("card/card.mp4")
// or an agent that uses raea, over ACP
const s = await cloud.session()
const stop = await s.prompt("Make card/edit.tsx a 3 s title card that says hello, and render it", (u) => {
if (u.sessionUpdate === "agent_message_chunk") process.stdout.write(u.content?.text ?? "")
})
s.close()
The client needs only fetch and WebSocket: Node 22+, Bun, Deno or a browser. Permission requests are allowed
once by default (the container is the sandbox); pass onPermission to decide them yourself.
| Route | |
|---|---|
GET /healthz |
ok, without the token, for health checks |
GET /v1/health |
raea's version, the agents, the workspace, the device raea renders on, the GPU worker it hands renders to |
GET /v1/files?path=P |
a file in the workspace, or a folder's entries as JSON |
PUT /v1/files?path=P |
writes the body there, making its folders |
POST /v1/run {args, cwd} |
raea ARGS in the workspace; NDJSON {out}, {err}, then {exit} |
POST /v1/jobs?args=JSON |
a render job: the body is a project as a tar (zstd, gzip or none), raea ARGS runs on it; {id} |
GET /v1/jobs/ID?from=N |
the job's output since line N (held up to 20 s for more), and exit once it's done |
GET /v1/jobs/ID/out?as=zst |
the files the job made or changed, as a tar (zst, gz or tar); the job is dropped |
POST /v1/login?agent=ID |
an agent's terminal sign-in: {url, code, state}; GET says where it is |
WS /v1/acp?agent=ID |
one agent per socket; each text frame is one ACP JSON-RPC message |
Every route but /healthz needs Authorization: Bearer TOKEN (or ?token=, for a browser's WebSocket). Paths
outside the workspace are refused, symlinks out of it too. The agent and raea never see the token.
Deploy it
| Where | File | The home folder lives on | Checked |
|---|---|---|---|
| Docker, Compose | deploy/compose.yaml |
a named volume | end to end (test/smoke.sh) |
| Compose with an NVIDIA GPU | + deploy/compose.gpu.yaml |
a named volume | not yet on a GPU host |
| Fly Machines | deploy/fly.toml |
a Fly volume; the Machine stops when idle | config only |
| Kubernetes | deploy/k8s.yaml |
a PersistentVolumeClaim | config only |
| Any Linux VM | docker run, as above |
a named volume | as Docker |
Where the disk doesn't outlive the container (Cloudflare Containers, Cloud Run), set RAEA_CLOUD_STATE to an
S3-compatible object (R2, S3) with
RAEA_CLOUD_STATE_KEY and RAEA_CLOUD_STATE_SECRET: the home folder is restored from it on start and saved to it
when the container stops (image/state.sh).
Each file says how to deploy with it at its top.
Renders: CPU or GPU
raea renders through Vulkan. On start the entrypoint opens NVIDIA's Vulkan driver when the host passed a GPU in, and
raea renders on it; with no GPU it renders on Mesa's llvmpipe, on the CPU (an AMD card in /dev/dri gets Mesa's
radv). GET /v1/health says which:
"device": { "renders": "gpu", "name": "NVIDIA L4", "nvidia": ["NVIDIA L4, 23034 MiB, 610.57.04"], "gpus": [...] }
RAEA_CLOUD_DEVICE=gpu makes a GPU that doesn't open an error at start, so a worker meant for a GPU never renders on
its CPU unnoticed; RAEA_CLOUD_DEVICE=cpu keeps raea on llvmpipe.
What one render costs where (test/gpu/edit.tsx: 576 lit blocks with shadows, 1920x1080, 90 frames, on Modal 11-10):
| Device | 90 frames | a frame |
|---|---|---|
| NVIDIA A10 | 115 s | 1229 ms |
| NVIDIA A10G | 133 s | 1392 ms |
| NVIDIA T4 | 156 s | 1652 ms |
| llvmpipe, 8 CPU cores of the T4's host | 203 s | 2005 ms |
That scene spends most of its time outside the GPU, so a GPU buys about 1.2-1.6x on it; heavier lighting (Solari, path tracing) needs one.
Building your own image instead: NVIDIA's Vulkan driver, mounted by the container runtime, loads only with glvnd and
X11's libraries beside it (libxext6 libx11-6 libgl1 libegl1 on Debian). With libEGL in the image, wgpu would pick
NVIDIA's OpenGL over llvmpipe for a CPU render and fail, so the image sets WGPU_BACKEND=vulkan and the entrypoint
hides EGL's vendors when it renders on the CPU.
A. One server on a GPU. Give the container an NVIDIA GPU: compose.gpu.yaml, nvidia.com/gpu: 1 on Kubernetes,
or deploy/modal/raea_cloud.py. The image asks for the graphics capability, so the NVIDIA runtime mounts the Vulkan
driver.
B. A CPU box that hands its renders to a GPU worker. The agent lives on a small always-on CPU server; renders go
to a GPU that sleeps when idle. Deploy a worker (Modal below, or deploy/k8s.gpu.yaml), then set on the box:
RAEA_CLOUD_GPU_URL=https://you--raea-cloud-server.modal.run
RAEA_CLOUD_GPU_TOKEN=<the worker's token>
From then on, raea render on the box (from the agent, its shell or /v1/run) sends the render's project (its
folder, or the nearest one above with package.json, raea.lock or brief.ts; without .git or out/) to the
worker as a job, prints its output as it comes and lands the files it made back in the project. Every other raea
command runs on the box. An input outside the project renders on the box, with a line saying why;
RAEA_CLOUD_GPU_ROOT sends a wider folder. A worker that doesn't answer fails the render, unless
RAEA_CLOUD_GPU_FALLBACK=cpu. The project's out/ goes to the worker empty, and raea renders only into a folder
that exists, so render into out/ or another folder the project has.
The same jobs work from your own code: cloud.job(["render", "edit.tsx", "-o", "out/a.mp4"], projectTar).
A GPU on Modal
cd sdk/cloud
modal secret create raea-cloud RAEA_CLOUD_TOKEN=$(openssl rand -hex 32)
modal deploy deploy/modal/raea_cloud.py # an L4, else A10G, else T4; RAEA_CLOUD_GPU=L40S (or a list) for others
Modal builds the image from image/Dockerfile. One container takes every request (a job is followed on the
container that runs it); it starts on a request and stops after five idle minutes (RAEA_CLOUD_IDLE), so you pay
for the minutes it renders.
Known limits
- raea ships for Linux on x86_64 only, so the image is linux/amd64; an arm64 machine (Graviton, Ampere, Apple Silicon's Docker) runs it emulated and slowly.
- One server is one workspace, for one person or one team that trusts each other: everyone with the token has the agent's whole sandbox.
- Agents installed with uvx (Python) aren't supported by the image; add Python in your own image or run them by
RAEA_AGENT_CMD.
Test it
test/smoke.sh 0.1.1 builds the image, starts it with a stand-in agent (test/echo-agent.mjs) and checks the token,
the path rules, a render through /v1/run and an ACP turn.