Linora

0902. Production servers run compiled JS

Status: Accepted (2026-11-28, O1). Amends 0001 (“there is no library build step”): it still holds for dev, tests and the web app.

Context

Packages export TypeScript source, and Node 26 strips types at load time (ADR 0001). The stripper is a WebAssembly module instantiated per isolate on the first .ts file. That costs ~28 MiB RSS per isolate: an empty script measured 49 MiB as .js and 77 MiB as .ts. The realtime process runs one isolate per gateway thread and per owner thread (ADR 0020), so it pays this cost 8 times on Linux. Memory efficiency is a top priority (overview.md).

Decision

Measured

Linux, idle RSS from src to dist, medians of 3 ABBA runs (deploy/measure-rss.mjs; full tables in docs/ops/build.md):

Tier src dist
api 107 MiB 68 MiB
realtime (5 gateways + 2 owners) 330 MiB 196 MiB
docworker 107 MiB 69 MiB
compactor 108 MiB 70 MiB
mcp 119 MiB 88 MiB

Alternatives

Consequences