Sprint 10 in progress: Rust sidecar supervise (A3)

Sprint 10 is still open. This is a mid-sprint build-in-public checkpoint, not a closure post.

A2 shipped a pinned Node binary and esbuild runtime JS. A3 makes the Tauri host actually start and supervise that process: free port, health wait, clean shutdown, and a native HTTP path that survives WebView2 Local Network Access.

Context: ADR-0010 Option A · Sprint 10 worklog · commit 62a6fd8.


What A3 delivered

  • Rust spawn — on app setup, std::process::Command launches bundled meronq-node + resources/runtime/sidecar.mjs (with MERONQ_MCP_SERVER_ENTRY), or falls back to system Node + tsx for tauri:dev.
  • Lifecycle — pick a free loopback port, poll GET /health (up to 20s), expose URL via get_sidecar_info, kill the process tree on exit (taskkill /T on Windows).
  • Dev splitbeforeDevCommand runs Vite only (dev:ui); browser dogfood still uses pnpm dev (Node script spawns sidecar + Vite).
  • Native API path — UI calls go through Rust sidecar_http (decodes Node’s default Transfer-Encoding: chunked). Sidecar CORS also allows http://tauri.localhost and Access-Control-Allow-Private-Network for WebView2 LNA.

Dogfood on Windows: badge Sidecar online, Connect/handshake against a real project root — no more Failed to fetch / non-JSON (200) from the native shell.


Why this matters

A packaged or tauri:dev window cannot rely on WebView fetch to 127.0.0.1 the way a browser tab on localhost:1420 can. Supervising Node from Rust closes the A2 → runnable app gap; the invoke proxy makes the UI trustworthy under WebView2.

tauri:dev / packaged
  Rust setup
    → meronq-node sidecar.mjs   (or node --import tsx …)
    → wait /health
  UI
    → invoke sidecar_http
    → loopback GET/POST (chunked OK)

Next in Sprint 10

Task Focus
A4 Restart-on-hang watchdog (known write/sync wedge)
A5 tauri build verify on Windows and macOS
A6 Docs + optional CI matrix

Full recap when Sprint 10 closes.


Follow along

← Back to blog