Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ADR-0004: Unified Cargo Workspace (alolite-core, alolite-cli, apps/desktop)

  • Status: Accepted (Branch ui/tauri)
  • Date: 2026-11-08
  • Author: ngxc
  • Deciders: Alolite Core Engineering

1. Context

During initial Tauri integration, the repository carried two separate Rust graphs (Cargo.toml at root bundling eframe/egui together with core protocol/storage, plus an isolated ui/tauri/src-tauri/Cargo.toml depending back up on root). That caused:

  • Duplicate Cargo.lock and duplicate multi-gigabyte target/ directories.
  • alolite-tauri transitively compiling eframe, egui, glutin, and winit despite running WebKitGTK (~442 MB debug binary).
  • Three competing src/ trees (src/, ui/tauri/src/, ui/tauri/src-tauri/src/), leftover src/bin/ probe binaries, and root-level documentation clutter.

2. Decision

  1. Single Root Cargo Workspace (Cargo.toml):
    • members = ["crates/alolite-core", "crates/alolite-cli", "crates/alolite-desktop"] so all three Rust crates share a single Cargo.lock and target/ directory.
  2. UI-Free Core (crates/alolite-core/):
    • Owns core/, protocol/, storage/, mcp/, services/, common/, and assets/ with zero eframe/egui or WebKit dependencies.
  3. Dual Focused Binaries & Pure TypeScript App:
    • crates/alolite-cli/ (alolite): lightweight headless CLI, --mcp stdio server, --api-only REST server, --qr terminal login, and desktop launcher.
    • crates/alolite-desktop/ (alolite-desktop): Tauri v2 Rust host embedding ../../apps/desktop/dist.
    • apps/desktop/: 100% pure feature-based TypeScript (src/{app,shared,features}/) with zero Rust files inside apps/.
  4. Root Hygiene:
    • Remove legacy src/gui/ (egui, preserved on main at ce798e6), legacy src/bin/ probes, and egui-only fonts (BeVietnamPro, lucide.ttf).
    • Move book.toml, DESIGN.md, ROADMAP.md, and LEGAL.md under docs/.

3. Measured Release Binary & RAM Benchmark (Arch Linux x86_64, 32 Threads / 961 Messages)

Mode / ArchitectureRelease BinaryProcesses / Threads (t=10s)Total PSS (t=10s)Total Private_Dirty (t=10s)Total VmRSS (t=10s)
Headless MCP (alolite --mcp)8.9 MiB1 proc / 13 threads7.87 MiB1.90 MiB10.36 MiB
Legacy egui (main @ ce798e6)16.1 MiB1 proc / 43 threads85.20 MiB47.00 MiB118.40 MiB
Tauri Desktop (alolite-desktop, total 3 procs)17.0 MiB3 procs / 113 threads373.96 MiB228.15 MiB571.51 MiB
↳ alolite-desktop (Rust CoreEngine + GTK3 host)—44 threads107.99 MiB66.30 MiB189.70 MiB
↳ WebKitNetworkProcess (HTTP/TLS cache)—18 threads48.73 MiB33.56 MiB84.90 MiB
↳ WebKitWebProcess (DOM/CSS/JS + GPU tiles)—51 threads217.24 MiB128.30 MiB296.91 MiB