Trusted TS v0.25.0: Running TypeScript Nobody Has Read at 4.78 KiB per Actor
Inside Engine Contract v20 and Box Contract v24: preemptible Z3-verified TypeScript actors, PikeVM ReDoS immunity, Caps.kv/Caps.crypto, WHATWG SSE, and Linux Landlock/seccomp sandboxes.
Modern server-side TypeScript applications routinely execute two categories of code nobody on your team has read line by line: deeply nested npm dependency trees and AI-authored handler logic. In conventional Node, Deno, or Bun runtimes, a compromised helper or catastrophic regular expression shares ambient access to your process heap, event loop, environment variables, local filesystem, and outbound sockets.
Trusted TS (v0.25.0) splits execution across an explicit, Rust-enforced capability boundary in a 4-crate workspace (tts-kernel → tts-engine → tts-prove → tts) — documented at trusted-ts.robertguss.com.
1. tts (Engine Contract v20): Tiny, Preemptible, Verifiable Actors
Rather than embedding V8 per tenant or trusting arbitrary JS prototypes, tts compiles a strict, prototype-free TypeScript subset into a 41-opcode bytecode VM (held under a strict 45-opcode verification ceiling) with zero runtime syscalls or I/O:
- Memory density & spin immunity (
v0.23.0):1,000live stateful actors on a single OS thread consume8,444 KiBtotalVmRSS(4.78 KiB / actormarginal overhead over3,664 KiBbaseline). Running under--fuel=2000, an honest actor executing beside concurrent infinite spin and allocation-churn loops maintains0.049 msp50(0.159 msp99) latency. - Linear-time
RegExpimmunity: Regex literals compile to bounded<= 256-state Thompson NFAs inside a fuel-metered PikeVM (O(|pattern| * |input|)). OnEVIL_RE = /^(a+)+$/with"a".repeat(28) + "!",tts runfinishes in0.157 mscompared to11,911.430 msin Node V8 (75,945×faster). - Nominal taint & transactional invariants: Branded
Secretvalues (__label) enforce non-interference before public replies leave the actor (tts proveverifiesinit_invariant,handle_no_panic,inductive_invariant, andallowLabelsflow rules in Z3), while failinginvariant(state)checks roll back state cleanly at runtime. - Typed
Caps.kv&Caps.crypto(Engine Contract v20): Actors interact with persistent KV stores and HMAC-SHA256 verification solely through typed capability continuations (from: "kv",from: "crypto"), preserving the 41-opcode VM ceiling.
2. tts-box (Box Contract v24): Durable Host & Linux Sandboxes
tts-box wraps strict tts gatekeeper actors around durable HTTPS/mTLS/MCP endpoints and unmodified npm packages:
- Linux Landlock v6 + seccomp-BPF + cgroup v2 boxes: Enforces a default 7-day npm cooldown (
tts-box add), OSV advisory checks (tts-box audit),--ignore-scriptsinstalls bound by SHA-256.stampmanifests, read/TCP isolation (net: falseor allowlisted), and systemd memory/task quotas. - Framework templates & checked watch-reload (
v0.25.0):tts-box init <dir> --template=hono|expressscaffolds 6 verified policy, manifest, adapter, and route files (policy.ts,policy.test.ts,manifest.json,box/adapter.mjs,box/app/{routes,server}.ts,README.md). During development,tts-box devrunstts checkbefore every live swap (683.1 msp50 actor reload /402.1 msp50 Linux boxapp/*.tsfast-sync without re-runningnpm ci). - WHATWG HTTP SSE Streaming & Durable WAL:
v0.25.0ships declarative actor SSE (0.849 msfirst-bytep50,54,167 events/s) and sandboxed boxstreamBoxSSE (0.969 msfirst-bytep50,55,750 events/s), backed by synchronous=FULL SQLitewal_kv, dual-secretprevEnvHMAC rotation, and 28 Prometheus/metricsfamilies.
3. Continuous Verification Scorecard (v0.25.0)
Every release enforces hard formal and empirical gates:
- External Conformance (
trusted-ts-checks):48 / 48 PASS - Workspace Line Coverage:
91.83%(gate>= 90%) - Core Architecture Budget (
cargo atlas):49,002 / 50,500token-lines (0violations) - Kernel & Protocol Proofs: 143 Verus verified, Lean 4 (
0 sorryAx), 18 / 18 Kani harnesses, and6 / 6@tsmodelspecs
Explore the full Verified Escrow CLI Walkthrough (captured directly against v0.23.0 verified_escrow.ts using tts check --json, tts sim --seeds=1..100, and interactive tts run NDJSON turns), read the Benchmarks & Scorecard, inspect Release v0.25.0, or sponsor ongoing work.