t3-rust.omaralex.dev Unofficial

In progressF1 Core/RPC/SQLite · Wave 1Bbranch feat/rust-migrationcommit 6fdd934a75updated

Migrating T3 Code to Rust

An unofficial, in-the-open port of the T3 Code server and client runtime from TypeScript to Rust. A unit counts as ported only once the Rust code reproduces the TypeScript server’s golden fixtures.

Rust tests passing
126
of 126 · 100% passing
Golden parity vectors
9,179
of 9,179 · 100% passing
Qwen4 share of Rust lines
95.2%
16,170 of 16,979 attributed lines
Review findings closed
10
2 P0 + 8 P1 in review 1A · review 1B pending

t3code's full surface, 6,208 units in 9 kinds. Each segment is sized by its unit count; oxide is ported and verified.

  • Ported
  • Not ported
  • Total

Surface ledger

The total divides what Rust reproduces today by everything t3code exposes, counted unit by unit from everdoc’s inventory. Types and codecs that nothing serves yet count as zero.

  • SQLite migrations 131 / 131 100% statev2 migrations 1..=131 run by t3-sqlite, and the resulting schema matches the TypeScript reference.
  • Schemas 75 / 4,202 1.8% everdoc schema entities, matched by name and source file, whose golden samples Rust re-encodes byte for byte.11 of the 75 keep a few fields as opaque JSON. The three OrchestrationV2 unions are left out: 19 of their 136 variants are typed. The 29 entity IDs are not everdoc entities.
  • RPC methods 0 / 299 0% Method is served live over WebSocket by the Rust server.The Effect RPC v4.2 wire codec passes 509 of 509 vectors. No method is served until Wave 1C.
  • HTTP routes 0 / 117 0% Route is served by the Rust server with the same responses.t3-rpc has the environment HTTP route types. No route is served yet.
  • MCP tools 0 / 99 0% Tool is exposed by the Rust MCP server with the same schema.
  • CLI commands 0 / 151 0% Command runs from the Rust t3 binary with the same flags.
  • Traced flows 0 / 767 0% End-to-end flow from everdoc passes against the Rust server.
  • External processes 0 / 72 0% Spawned by Rust with the same arguments and environment.
  • Environment variables 0 / 370 0% Read and honored by the Rust server.
  • Total 206 / 6,208 3.3% Every unit weighs the same: one migration counts like one RPC or one schema.

Total = (131 + 75 + 0 + 0 + 0 + 0 + 0 + 0 + 0) ÷ (131 + 4,202 + 299 + 117 + 99 + 151 + 767 + 72 + 370) = 206 ÷ 6,208 = 3.3%

Not counted yet. 163 desktop IPC channels, 47 web routes and 7 events. everdoc lists them, but the synced baseline does not track them. Counting them would give 206 ÷ 6,425 = 3.2%.

Baseline. v0.1.14 (stable) at c0eed7328d, synced 6 Dec 2026, 02:50 UTC. Until Wave 1B this page showed the average of phase weights (25%), which measured the roadmap rather than the port.

Big blocks still ahead

Not weighted separately. Their work lands in the ledger as RPCs, flows and processes once Rust serves it.

F2Pending

Orchestration V2

The event-sourced Orchestrator, EventSink and EffectWorker. It ships when Rust replays the TypeScript testkit's provider transcripts to the same events.

0 / 161 NDJSON transcripts replayed

98 scenarios in apps/server/src/orchestration-v2/testkit/fixtures

F3Pending

Pure providers

Provider adapters as pure Rust over the same CLIs and agents, plus the t3 binary as a drop-in for the Node server.

0 / 10 provider adapters ported

Codex, Claude Code, Cursor, Grok, OpenCode, Antigravity, Kiro, Pi, Muse Code and fx (AGENTS.md)

F4Pending

Native Rune UI

The client UI on anomalyco/rune, checked screen by screen against apps/web with headless PNG renders.

0 / 47 web routes rendered natively

everdoc route entities in @t3tools/web

Plan and checklist

Roadmap milestones, F0 to F5. A phase’s steps are its waves and the adversarial review that closes each wave; they track the roadmap, not parity with t3code.

Roadmap milestones

Checklist

F0InfraDone4 of 4 closed · 5% planning estimate · 67dbd4629f

  • Cargo workspace at rust/
  • Builds with or without sccache
  • Golden fixtures captured from the TypeScript server
  • statev2.sqlite migrated

F1Core/RPC/SQLiteIn progress2 of 5 closed · 1 open · 30% planning estimate

  • Wave 1A Foundation: contracts, shared utilities, SQLite4 tickets
  • F1-01 Branded IDs and base schemast3-contracts pi-1 3,338/3,338 29/29
  • F1-02 Relay JWT, desktop tokens, DPoPt3-shared::crypto pi-2 177/177 22/22
  • F1-03 Deduped bodies, ID table, socket frames, changed files, endpoints, atomic writet3-shared::pure pi-3 679/679 14/14
  • F1-04 SQLite worker, PRAGMAs, migrator, schema inspectiont3-sqlite pi-4 379/379 18/18
  • Review 1A Adversarial review 1ASealed2 P0 + 8 P1 found and closed in 5 commitsDateTimeUtc parity checked by a 161k-input differential fuzz against V8 (R1A-A)
  • R1A-A Review 1A fixes: DateTimeUtc V8 parity, newtype ergonomicst3-contracts pi-1 — —
  • R1A-B Review 1A fixes: relay JWT typ (P0), DPoP max age, id table -0, atomic write, changed files, endpointst3-shared pi-2 — —
  • R1A-C Review 1A fixes: SQLite lookup errors (P0), V2 preview migration reconcilet3-sqlite pi-3 — —
  • Wave 1B Contracts, Effect RPC v4.2 wire, 131 SQLite migrationsTickets merged · awaiting review 1B
  • F1-05 Auth, desktop bootstrap, environment, server config and RPC permission contractst3-contracts pi-1 1,723/1,723 9/9
  • F1-06 Core OrchestrationV2 snapshots, projections, commands and eventst3-contracts pi-2 1,999/1,999 1/1
  • F1-07 Effect RPC v4.2 JSON wire codec and core environment HTTP typest3-rpc pi-3 509/509 7/7
  • F1-08 statev2 migrations 1..=131, WAL reader/writer pool, first projection queriest3-sqlite pi-4 375/375 12/12
  • Review 1B Adversarial review 1BPendingRuns against Wave 1B before it closes
  • Wave 1C Live WebSocket vertical slice1 ticket
  • F1-09 Server shell (Wave 1C)t3-server — Not run —

F2Orchestrator + NDJSON replayPendingNot cut into steps yet · 20% planning estimate

Event-sourced orchestration (Orchestrator, EventSink, EffectWorker), accepted when it replays the TypeScript testkit's NDJSON provider transcripts.

F3Pure providers + CLI drop-inPendingNot cut into steps yet · 20% planning estimate

Provider adapters in pure Rust and the t3 binary, launched by apps/desktop in place of the Node server.

F4Native UI on RunePendingNot cut into steps yet · 20% planning estimate

Client UI on anomalyco/rune over t3-client-runtime, checked against apps/web with headless PNG renders.

F5Nightly 3h + upstream trackerPendingNot cut into steps yet · 5% planning estimate

Builds, Rust tests and golden vectors every 3 hours, plus drift against everdoc's stable and nightly snapshots.

Crate map

Nine crates take over the TypeScript code one layer at a time. Each block sits on the crates it depends on and names the code it replaces. Select one to open its phase in the plan.

InterfaceRuntimesDomain + transportStorageFoundation t3-ui (Rune) F4 · apps/web t3-server/cli F3 · apps/server t3-client-runtime F4 · packages/client-runtime t3-orchestrator F2 · orchestration-v2 t3-providers F3 · packages/provider-* t3-rpc F1 · server/ws.ts t3-sqlite F1 · server/persistence t3-contracts F1 · packages/contracts t3-shared F1 · packages/shared
t3-ui (Rune) F4 t3-server/cli F3 t3-client-runtime F4 t3-orchestrator F2 t3-providers F3 t3-rpc F1 t3-sqlite F1 t3-contracts F1 t3-shared F1

Three models, one pipeline

Gemini plans and attacks, Opus integrates, and local Qwen4 writes the Rust at no cost per token. Only Qwen4’s tokens are metered in this repo, so the other two say so instead of showing an estimate.

Rust lines attributed in the crates 16,979

  • Qwen4-35B-A3B 16,170
  • Claude Opus 5.5 809
  • Gemini 4 Neon none attributed

Not in the bar: 6,088 lines a Qwen4 lane produced with a generator script (the SQLite migrations). The crates hold 22,849 lines today.

  1. Architect + adversarial review

    Gemini 4 Neon

    Plans phases, cuts waves into tickets, then attacks each wave from another provider before it closes.

    Rust lines
    None attributed
    Tokens
    Not metered in repo
    Prompt cache
    Not metered in repo
    Cost
    Not metered in repo
    Run
    6 phases · 3 waves · 12 tickets cut
    Record
    Review 1A sealed: 2 P0 + 8 P1 closed in 5 commits. DateTimeUtc parity checked by a 161k-input differential fuzz against V8 (R1A-A). Review 1B pending.
  2. Foreman + UI

    Claude Opus 5.5

    Writes lane skeletons, integrates and escalates worker output, designs this site and owns the Rune UI.

    Rust lines
    809 lines · 4.8% skeletons and integration
    Tokens
    Not metered in repo
    Prompt cache
    Not metered in repo
    Cost
    Not metered in repo
    Run
    Last integration 6fdd934a75
    Record
    4 escalations took over 85 lines. Designed this site; owns the F4 Rune UI.
  3. Local workers

    4×Qwen4-35B-A3Bpi · Splash DFlash2 · 4 lanes

    Write the Rust for each ticket until it matches the golden fixtures.

    Rust lines
    16,170 lines · 95.2% + 6,088 generated
    Tokens
    1,609,997 in · 693,267 out · 366,415 reasoning
    Prompt cache
    54,547,648 read · 97.1% hit
    Cost
    $0 per token · local
    Run
    982 turns · 1,056 tool calls · 5 h 54 min lane time (2 h 14 min wall)
    Record
    11 of 11 tickets passed on the first attempt · 0 circuit-breaker trips
Qwen4 tokens by pass, from telemetry.passes
PassTicketsTurnsInputOutputReasoningCache readHitWall
Wave 1A4245395,315215,163107,72513,577,50497.2%33 min
Review 1A3139132,79163,89122,9824,609,02497.2%12 min
Wave 1B45981,081,891414,213235,70836,361,12097.1%1 h 29 min
Total119821,609,997693,267366,41554,547,64897.1%2 h 14 min

Architecture decisions

Three choices shape every phase: what draws the UI, how Rust gets in front of users, and how the port keeps up with upstream.

Native UI · F4 · pending

Why anomalyco/rune

The client UI moves to anomalyco/rune, an MIT-licensed Rust UI framework with its own GPU renderer on wgpu, Taffy layout for Flexbox and Grid, and the rune-kit components. One codebase reaches macOS, Windows, Linux, iOS, Android and the web.

What decided it is the headless mode. Any Rune app can render a frame to PNG, dump its element tree and take scripted input without a display, so Opus can compare each screen against apps/web image to image and tree to tree before calling it done.

The UI mounts on t3-client-runtime, the Rust port of packages/client-runtime, so connection and domain state stay shared and the UI stays thin. If Rune blocks on terminal (PTY) rendering or IME input, GPUI is the fallback.

License
MIT
Renderer
wgpu, GPU
Layout
Taffy (Flexbox, Grid)
Components
rune-kit
Targets
Desktop, mobile, web
Parity check
Headless PNG + element tree
Mounted on
t3-client-runtime
Fallback
GPUI

Strangler fig · drop-in

The Rust server ships before the UI

apps/desktop already launches its backend either as a Node entry or as a native executable (runtime: { kind: "executable" }). The bootstrap token arrives on fd3 or stdin and readiness is proven with an HMAC-SHA256 challenge. A Rust t3 binary that keeps that contract runs behind the real apps/web, desktop and mobile clients long before any screen is ported.

Runner
kind: "executable"
Bootstrap
fd3 or stdin
Readiness
HMAC-SHA256 proof
First live slice
Wave 1C

Nightly · upstream drift

Every 3 hours, without LLM tokens

A scheduled run builds the workspace, runs the Rust tests and golden vectors, and re-reads everdoc's stable and nightly snapshot.json for t3code. Upstream drift shows up as changed denominators in the ledger, counted by a script, not a model.

Baseline
v0.1.14 · c0eed7328d
Synced
6 Dec 2026, 02:50 UTC
Last nightly
Not run yet
Upstream drift
Not measured yet