0.1.0-beta.1 on npm · beta dist-tag MIT Linux x86_64 glibc quickjs-ng 0.15.1 pinned · rquickjs 0.12.2

A TypeScript framework
that compiles to a binary and boots in milliseconds.

Velqu discovers routes at build time — no dry-run, no side effects — and emits app.qpack: a deterministic binary containing QuickJS bytecode, a serialized numeric router, schema IR, and integrity hashes. Production startup does zero compilation, zero transpilation, zero route discovery. The Rust host routes by method and path before JavaScript ever runs.

6.6 ms
cold start p50, exec → first byte (C0 static health, 60 fresh processes, 0 failures)
run cold-1789054622405
82,106 rps
warm throughput, static health at concurrency 50 — median of 5 randomized repetitions, 0 errors
run warm-1789054920075
8.2 MiB
RSS after ready, p50 for C0. Warm-load memory comparisons appear below at a separate measurement boundary.
run cold-1789054622405
22,127,650
warm gate requests served by Velqu in this evidence set — 0 errors across every candidate and cell
5 reps × 10 s × c=1/10/50 × 4 classes

01 — Overview

Compile once. Start without compilation. Stay bounded.

Velqu is a TypeScript web framework whose production execution is a Rust host with a pinned QuickJS engine. Bun is dev, package, and test tooling only — it never runs your app in production.

01 Route discovery at build time

The compiler statically analyzes your TypeScript — the application is never dry-run, no service factories fire, no side effects occur during discovery. Handler references resolve once after load and stay cached.

02 Zero startup work

Production startup performs no route, schema, OpenAPI, or plugin compilation and no TypeScript transpilation. The runtime maps the QPack binary and serves: 4.21 ms pack load and 1.29 ms bundle load for a 25-route app (p50, route-count-1789054694139).

03 Bounded by construction

Queues, bodies, jobs, heap, stack, and deadlines are all bounded. Native handles are opaque, generation-checked, and expire at settlement. Expected failures are typed values with declared statuses (RFC 9457 problems); unexpected errors are redacted before leaving the host.

04 One schema contract

A single schema definition drives TypeScript types, runtime validation, the typed Treaty test client, OpenAPI, and the contract lock. Request data crossing into JS is lazy — unread fields are never materialized.

02 — How it works

From TypeScript to a serving process

The compiler never executes your app; the runtime never compiles anything. Everything crossing that boundary lives in one verifiable binary.

app.ts

Typed routes, schemas, policies — plain TypeScript.

  • defineApp / defineModule
  • s.object schemas
  • policies & capabilities declared
→

velqu build

Static analysis + bundling. No dry-run.

  • route & schema manifests
  • handler table verified
  • deterministic output — identical source + toolchain ⇒ byte-identical pack
→

app.qpack → velqu-runtime

Binary artifact (QPack v2) loaded by the Rust host.

  • raw QuickJS bytecode (no base64)
  • serialized numeric router automaton
  • schema IR + capability set
  • contract & execution-graph hashes (SHA-256, verified at load)

Request lifecycle

Hyper ingress → Rust routes by method/path before JavaScript handler execution → worker-local, generation-checked request slab → lazy headers/query/cookies/body (unread fields never materialized) → numeric RoutePlan dispatch → typed settlement.

Trust model, stated honestly

Same-process QuickJS runs trusted application code only — it is not a hostile-code sandbox. Outbound fetch, SSRF policy, and capability gating are native and explicit (ADR-0033/0035).

03 — Code

Typed routes, typed clients

Real code from the repository's proof service — these files exist and their responses were executed end-to-end. Two full external-consumer journeys (webhook relay, Postgres CRUD) install from npm and serve on the runtime; their recorded transcripts live in scripts/beta-external.

// examples/proof/src/modules/hello/routes.ts
import { route } from "@velqu/core";
import { s } from "@velqu/schema";

export const hello = route({
  id: "hello.get",
  method: "GET",
  path: "/hello/:name",
  params: s.object({
    name: s.string({ minLength: 1, maxLength: 60 }),
  }),
  response: { 200: s.object({ message: s.string() }) },
  handle: ({ params }) => ({ message: `Hello ${params.name}` }),
});
// examples/proof/src/modules/users/routes.ts — validated body, declared
// failures as typed problems, policy-gated reads
export const create = route({
  id: "users.create", method: "POST", path: "/users",
  body: s.object({
    name:  s.string({ minLength: 1, maxLength: 60 }),
    email: s.string({ format: "email" }),
  }),
  response: { 201: s.object({ id: s.string(), name: s.string(), email: s.string() }) },
  handle: async ({ body }) => {
    const svc = resolve();          // lazy factory, first use
    const u = svc.create(body.name, body.email);
    return status(201).value(u);
  },
});

export const get = route({
  id: "users.get", method: "GET", path: "/users/:id",
  policy: sessionPolicy,                    // native-checked policy
  params: s.object({ id: s.string({ pattern: "^usr_[0-9]+$" }) }),
  response: { 200: s.object({ /* … */ }) },
  handle: async ({ params }) => {
    const u = resolve().get(params.id);
    if (!u) return status(404).problem("not-found", { detail: "user not found" });
    return u;                              // typed 200 | 404 union
  },
});
// Treaty — the typed client generated from the same contract
import { treaty } from "@velqu/treaty";
import type { Api } from "./dist/contract";
import contract from "./dist/contract.json";

const api = treaty<Api>({ baseUrl: "http://127.0.0.1:3000", contract });

const health = await api.health.live.get();
// navigation follows route ids; params come before the method,
// and query/headers/body are checked against the route's schema
const created = await api.users.create({}).post({
  name: "Ada", email: "ada@example.org",
});
// the response union distinguishes declared failures from success
# scaffold from the published CLI (npm registry)
bun add -g @velqu/cli@beta
velqu create hello-velqu && cd hello-velqu
bun install                                # @velqu/* from npm — no checkout needed
bun run check && bun run build          # → dist/app.qpack (+ route plan,
                                          #   OpenAPI, contract lock, build report)
velqu inspect --project . --json            # inspect without executing handlers

# production: the Rust runtime only ever loads the compiled pack
# (built once from source: cargo build --release -p velqu-runtime)
./target/release/velqu-runtime --pack dist/app.qpack --port 8080

04 — Benchmarks

Measured, scoped, reproducible

No universal speed claims — Velqu does not claim universal superiority over any runtime; performance is workload-, fixture-, and hardware-dependent. What you see here is the archived September 10 gate runs for this host and these fixtures, with losses shown next to wins.

Protocol

Release builds (--release only) · loopback HTTP/1.1 · frozen proof fixtures · randomized candidate order · Linux x86_64 glibc · 13th-gen Intel Core i5-13420H · Bun 1.4.0 toolchain · Elysia dependency pin: 2.0.0-beta.4. The baseline README records older tooling versions; the displayed cold-run environment records Bun 1.4.0. Full matched executable/version fingerprints are not present in the warm summary, so these are archived fixture observations, not a latest-version ranking. Route-count runtime SHA-256: c52385af2d56. raw-rust is a transport lower bound, not a feature-equivalent framework. All runs are local-process, single-host, trusted-code-only, and non-SLA — no cloud or scale-to-zero inference. Raw samples are retained in the repository.

Cold start — process exec to first byte

Every class boots a fresh Velqu process; 60 samples per class, zero failures. C0 (violet) is answered by the Rust host before JavaScript runs; every other class executes a JavaScript handler.

0510152025C0: p50 6.609 ms / p95 9.329 ms6.61C0C1: p50 6.855 ms / p95 11.512 ms6.86C1C2: p50 6.681 ms / p95 9.938 ms6.68C2C3: p50 6.664 ms / p95 11.863 ms6.66C3C3b: p50 6.441 ms / p95 13.604 ms6.44C3bC4: p50 7.522 ms / p95 11.685 ms7.52C4C5: p50 18.121 ms / p95 21.205 ms18.12C5p50 ms (bar) · p95 ms (whisker) — fresh process per sample, exec-to-first-byte
classwhat it measuresp50 msp95 msp99 msRSS p50 MiB
C0health.live — static response served by the Rust host before JavaScript6.619.3310.878.2
C1js.text — JS handler returning text6.8611.5114.678.2
C2js.json — JS handler returning JSON6.689.9411.198.2
C3hello.get — JS handler with a validated path parameter6.6611.8612.748.2
C3busers.create — JS handler with a validated request body (POST)6.4413.6014.748.2
C4users.get — JS handler behind a session policy7.5211.6914.788.8
C5async.timer — async JS handler resolved by a timer18.1221.2021.888.2

run cold-1789054622405 · 60 samples/class · 0 failures across all classes · raw benchmarks/raw/cold-start/cold-1789054622405.jsonl · summary JSON

Warm throughput — frozen fixture candidates

Honest reading: on JavaScript-handler classes (C1) raw Bun and raw Rust are faster than Velqu — the table shows measured results, not a causal attribution of the difference. At C0 concurrency 10, Velqu leads this fixture; at concurrency 50, raw Rust leads. These are medians of individual runs, not pooled request percentiles. Memory is where Velqu separates clearly: ~8.4 MiB vs 32.8 MiB (raw-bun) and 59.0 MiB (elysia2) at C1 c=10.

velquraw-rustraw-bunelysia2018k35k53k70kvelqu C0 c=10: 60,959 rps, p50 130µs61kraw-rust C0 c=10: 48,183 rps, p50 158µs48kraw-bun C0 c=10: 43,963 rps, p50 179µs44kelysia2 C0 c=10: 45,589 rps, p50 175µs46kC0 · static healthvelqu C1 c=10: 38,556 rps, p50 181µs39kraw-rust C1 c=10: 56,394 rps, p50 137µs56kraw-bun C1 c=10: 47,444 rps, p50 158µs47kelysia2 C1 c=10: 42,008 rps, p50 184µs42kC1 · JS text handlermedian rps across 5 randomized repetitions · concurrency 10 · 10 s per repetition · 0 errors
candidatec=1 · rps · p50µsc=10 · rps · p50µsc=50 · rps · p50µsRSS MiB @c=10
C0 — static health (served by the Rust host)
velqu15,19548.360,95913082,1064918.1
raw-rust14,94847.548,18315883,7394914.0
raw-bun9,82967.643,96317958,35480136.1
elysia210,44063.845,58917550,45490957.3
C1 — JS text handler
velqu6,99610438,55618152,6147928.4
raw-rust11,50356.056,39413770,2745954.0
raw-bun13,40545.647,44415846,93994632.8
elysia29,73461.842,00818460,61366759.0

run warm-1789054920075 · seed 2763789528 · 5 randomized repetitions × 10s per cell · 0 errors across all candidates · raw benchmarks/raw/warm/warm-1789054920075.jsonl · summary JSON

Startup vs route count — the eager-start trade-off

In this run, Velqu cold-start cost grows with route count: p50 113.8 ms at 1,000 routes and 1282 ms at 10,000. The chart is categorical on the x-axis and logarithmic on the y-axis. It measures startup only; it does not establish where other frameworks spend their time or their per-request cost.

velqu (bytecode)velqu (source)raw-bunelysia210 ms100 ms1000 ms7.8712829.47402251001,0005,00010,000routes in the app (log-scale y) · p50 cold start, ms · 40 fresh processes per cell
candidate251001,0005,00010,000RSS MiB @10k
velqu (bytecode)7.8715.351145841282306.1
velqu (source)9.0616.511225911307306.5
raw-bun9.989.048.609.089.4719.5
elysia215217519228440295.9

run route-count-1789054694139 · 40 fresh processes per cell, randomized order · p50 cold start, ms · raw benchmarks/raw/route-count/route-count-1789054919962.jsonl · summary JSON

What we disclose alongside the wins

  • The 1,000-route scaling budget was missed — p50 113.8 ms (recorded honestly, not re-worded as a pass).
  • Async completion costs extra — an immediately-resolved async invocation performs 3.3–6.0 µs of additional work vs its sync counterpart, across local/Halotec/Oracle diagnostic runs (120 batches, p50; full decomposition report).
  • Raw baselines are faster on JS-handler classes — visible in the warm table above; Velqu's value is the compiled, bounded, typed host, not bare-handler latency.
  • ADR-0045's specialized context path shipped with its success metric NOT met — kept in the tree for its other wins, disclosed in the ADR.
  • Historical checker finding: the first multihost packet reported Velqu 29/31 with a disclosed byte-order mismatch. A subsequent schema serializer fix and rerun landed; the earlier count is not a claim about the current runtime.
  • Hardware counters were unavailable on the benchmark host — startup profiling uses wall-clock plus an allocation interposer, stated in the artifacts.

05 — Status

Public beta shipped. GA hardening underway.

Progress is determined by evidence, not calendar pressure. The production-readiness track (ADR-0019) stands at 94 of 120 tracked tasks PASS.

2026-08
Numeric runtime closure (G0)

Exact numeric IR, compiled terminal router, integrity-bound execution graph, self-verifying evidence indexes.

M2.4 – M2.8
Zero-copy ingress · schema codecs · QPack v2 · capabilities · native fetch

Worker-local request slab, schema-specialized JSON pipelines, reproducible binary artifacts, capability ABI (URL, timers, TextEncoder, AbortController, crypto random), bounded outbound fetch with SSRF policy.

M3 – M4
Multi-worker service runtime · private alpha

Bounded worker dispatcher, runtime profiles (serverless / service:N), quarantine and readiness aggregation; dev loop, CLI surface, Treaty modes, proof service.

2026-09-09
0.1.0-beta.1 published to npm

Seven @velqu/* packages under the beta dist-tag (latest intentionally unset), verified post-publish from the registry.

now
GA hardening (M6–M8 lanes)

72-hour soak r4 PASS (2026-09-23) with merge-enforced perf gates; fuzz and sanitizer campaigns; reproducible builds; native Prometheus /metrics exporter; release signing and disaster-recovery drills in progress. RC selection and publisher-key provisioning await owner decisions.

06 — Packages

What's on npm, what's in the repo

Seven packages are live at 0.1.0-beta.1 under the beta dist-tag. Reference capabilities and internal tooling stay in the repository until their GA gates close.

nameroleavailability
@velqu/coreapp, module, route, policy primitivesnpm · 0.1.0-beta.1
@velqu/schemaschema builders (s.*) and IRnpm · 0.1.0-beta.1
@velqu/contractcompiled contract metadata + locknpm · 0.1.0-beta.1
@velqu/treatytyped end-to-end test clientnpm · 0.1.0-beta.1
@velqu/compilerbuild-time route discovery and packingnpm · 0.1.0-beta.1
@velqu/clivelqu create / build / inspect / devnpm · 0.1.0-beta.1
@velqu/browser-runtimeWASM browser kernel (ADR-0037)npm · 0.1.0-beta.1
velqu-runtimeproduction Rust host binaryrepo release builds · Linux x86_64
capability-postgres / capability-auth-jwtreference capabilities (M5)repo
testing / publishingruntime-local Treaty harness, packaging invariantsrepo