👀 Platform Previews
Live captures from https://sharedots.vercel.app/, the Ink v5 Terminal UI (apps/tui), and compiled RemoteDots AI Android builds.
Compute Mesh Landing (/)
Global mesh landing page with live task counter, cluster entrypoints, and GitHub integration
|
Control Plane Platform Showcase (/#platform)
Unified CLI, Ink TUI, Python @remote SDK, and live node telemetry orchestration
|
Live Mesh Dashboard (/dashboard)
CPU/RAM/iGPU/dGPU/Wi-Fi telemetry, cluster capacity, job shards, and Judge Bypass isolation
|
Orbital 3D Mesh Topology Explorer
Interactive multi-cluster task partition topology and aggregate GFLOPS throughput explorer
|
Dual-Edition Download Matrix (/#download)
Staged Windows (.exe) & Android (.apk) builds for Standard Remote-Dots and Pro RemoteDots AI
|
RemoteDots AI Interactive Walkthrough (/how-it-works)
Step-by-step interactive explainer covering 33 agent tools, CLI proxy, vision, and security
|
Ink v5 Terminal UI & Multi-Stream Log Bridge
5-tab terminal console with local daemon supervisor, Tailscale diagnostics, and unified logs
|
RemoteDots AI Android Virtual Joystick
Landscape WebRTC + Tailscale mobile overlay with 30fps cursor joystick, L/R drag, and hotkeys
|
Auth, OAuth & Judge Bypass (/login)
JWT + TOTP 2FA sign-in with Google/Apple OAuth and instant single-click Judge Bypass sandbox
|
RemoteDots AI Split-View (Desktop + Agent)
Simultaneous live Windows desktop stream over LAN/Tailscale paired with multi-model AI chat
|
Dynamic Per-Section Social OG Cards (/api/og)
Auto-generated 1200x630 OpenGraph preview cards tailored to each shared Help & ML Guide section
|
Autonomous AI Session History & Tool Audit
Per-session timeline with tool-call breakdown (GUI, CLI, screen, file edits) and search filters
|
📋 Table of Contents
| # |
Section |
Scope |
| 1 |
👀 Platform Previews |
Live captures across web, 3D mesh, TUI, downloads, and Android |
| 2 |
🌍 Why Sharedots — Open-Source Vision & Thesis |
Problem statement, open-source principles, and unified compute+control goal |
| 3 |
📊 Feasibility, Economic & Technical Viability |
Cost comparison, fault tolerance, sandbox safety, and production viability |
| 4 |
🚀 Step-by-Step Installation & Usage Playbook |
Zero-to-cluster guide for prebuilt APK/EXE, CLI/TUI, and multi-device ML |
| 5 |
🏛️ Core Compute Mesh Architecture |
Control plane, data plane, scheduling, work-stealing, and lifecycle |
| 6 |
🧠 Distributed ML & Execution Engines |
Pooled multi-machine ML training, Python @remote, WASI WASM, OCI |
| 7 |
🔐 Wire Protocol & Cryptographic Security |
Zod schemas, 256 KB MsgPack frames, HMAC-SHA256, chunked HTTP artifacts |
| 8 |
🖥️ Web Control Plane, Telemetry & Auth/2FA |
Next.js :3000, Express/MongoDB :8000, TOTP 2FA, Judge & Demo modes |
| 9 |
🤖 Remote-Dots & RemoteDots AI Subsystems |
Standard 60fps P2P streaming vs. Pro autonomous AI desktop/mobile control |
| 10 |
📦 Compiled Releases & Binary Matrix (APK & EXE) |
Exact APK/EXE versions, ABIs, SHA-256 checksums, GitHub Release links |
| 11 |
🔍 SEO & Search Console Architecture |
Next.js sitemap.xml, robots.txt, OpenGraph, Google verification |
| 12 |
🗄️ Database Schemas (SQLite & MongoDB) |
ER diagram and full specification across 7 SQLite + 5 MongoDB models |
| 13 |
📡 Complete API Reference |
Coordinator :4000, Auth :8000, and Next.js :3000 BFF endpoints |
| 14 |
💻 Developer SDKs, CLI & Ink TUI |
TypeScript SDK, Python @remote, sharedots CLI flags, TUI keybindings |
| 15 |
⚡ Tech Stack & Monorepo Layout |
Full dependency matrix and directory map |
| 16 |
🧬 Benchmarks, Testing & CI/CD |
Measured 2048² matmul, 6-suite verification scorecard, 3-job GitHub Actions |
| 17 |
🔧 Configuration, Deployment & Quick Start |
Environment variables, Docker Compose, 3-terminal launch, Tailscale mesh |
| 18 |
🕸️ Distributed ML Topologies & Workload Catalog |
Data/Model/Pipeline parallelism, .npy aggregation, and 8 runnable examples |
| 19 |
⚙️ Rust Daemon Internals & Sandbox Isolation |
22-module Rust worker crate, Wasmtime WASI bounds, and OCI isolation |
| 20 |
🧭 Coordinator & Auth Backend Internals |
Coordinator subsystems, Express middleware stack, and security controls |
| 21 |
🛠️ Operational Runbooks & Troubleshooting |
Multi-device Tailscale mesh, Render vs. local, and daemon diagnostics |
| 22 |
📜 Protocol JSON Schemas & Golden Fixtures |
All 22 Zod-generated schemas and TypeScript/Rust MsgPack parity fixtures |
| 23 |
📱 RemoteDots AI Agent Tools & Mobile Specs |
33 automation tools, 5 screen layouts, vision/STT backends, and safety rules |
| 24 |
📁 Workspace Packages, Scripts & Port Matrix |
Full pnpm/Cargo workspace inventory, npm scripts, and port allocation |
| 25 |
🌐 Cross-Machine Tailscale Mesh Architecture |
Zero-port-forward multi-laptop networking and peer latency diagnostics |
| 26 |
🧩 Web Frontend App Router & Component Tree |
Complete Next.js 14 page map, auth routes, and dashboard modules |
| 27 |
✅ End-to-End 8-Step Acceptance Pipeline |
Exact automated verification sequence in scripts/e2e.sh |
| 28 |
💾 Artifact Store, LRU Cache & Range Resume |
Chunked SHA-256 data plane, TTL eviction, and worker disk cache |
| 29 |
🎛️ Mobile AI Settings & Subscription Routing |
Dual-model SUB routing, vision backends, and mobile UI previews |
| 30 |
🛡️ Audit Scorecard & Production Hardening |
Security checklist, SSRF/secret hygiene, and deployment gates |
| 31 |
📄 Declarative JobSpec v1 Contract |
Exact runtime enums, execution strategies, resource bounds, and retry limits |
| 32 |
🧪 Verified Host & Toolchain Matrix |
Tested OS, compiler, runtime, and Android/Windows build toolchains |
| 33 |
🗺️ Roadmap, Governance & Contributors |
Milestones M0–M14, security/privacy policies, and core engineering team |
🌍 Why Sharedots — Open-Source Vision & Thesis
1. The Idle Compute Paradox
Every engineering team, university lab, and hackathon squad sits on tens of CPU cores, dozens of gigabytes of RAM, and discrete GPUs spread across personal laptops, spare desktops, and phones — yet almost all of that hardware sits at <10% utilization while developers still pay recurring cloud bills for burst compute, matrix sweeps, and ML training jobs. Existing cluster tools fail everyday builders for three reasons:
| Pain Point in Legacy Clusters |
Why Teams Abandon Them |
How Sharedots Solves It |
| Complex Setup (Kubernetes / Ray / Slurm) |
Requires homogeneous Linux VMs, root privileges, YAML manifests, and static IPs |
Single sharedots up / sharedots join sd_join_... command works natively across Windows, macOS, and Linux in under 30 seconds |
| Untrusted Execution Risk |
Sharing a friend's or lab's machine normally exposes full filesystem & env secrets |
HMAC-signed task manifests + Wasmtime WASI fuel/memory sandboxes + OCI --network=none + scrubbed Python subprocesses |
| Disconnected Control & Access |
Running jobs on remote workstations forces SSH tunneling or separate remote desktop tools |
Unifies distributed compute orchestration with 60fps P2P Remote-Dots desktop streaming and RemoteDots AI voice/mobile control |
2. Why Apache-2.0 Open Source
Sharedots is released under the Apache License 2.0 (LICENSE) with zero proprietary lock-in so students, researchers, and organizations can audit every byte crossing the wire:
| Open-Source Pillar |
Implementation Proof in This Repository |
| Auditable Cryptography |
Every HMAC-SHA256 signing vector and Zod-generated JSON Schema is published in packages/protocol/ and verified in CI |
| Self-Hostable Control Plane |
Coordinator (:4000), Web UI (:3000), and Auth Server (:8000) run identically on localhost, LAN, Tailscale, or Render/Vercel |
| Contributor Resource Sovereignty |
Workers strictly enforce --cpu-limit, --memory-limit, and --cache-max-mb so contributors never sacrifice host responsiveness |
| Zero-Key AI Accessibility |
RemoteDots AI's remotedots-ai-cli-proxy lets developers reuse existing Claude, Gemini, or ChatGPT Plus logins from mobile |
📊 Feasibility, Economic & Technical Viability
1. Four-Pillar Feasibility Analysis
flowchart LR
TECH["Technical Feasibility\nRust + MsgPack + SQLite WAL\nVerified 8-Step E2E & SIGKILL"] --> VIABLE["Production-Capable\nUnified Fabric"]
ECON["Economic Feasibility\n$0 Idle Peer Hardware vs.\nHourly Cloud GPU/CPU Bills"] --> VIABLE
SEC["Security Feasibility\nHMAC-SHA256 + WASI Fuel\n+ TOTP 2FA + Away Mode"] --> VIABLE
UX["Adoption Feasibility\n1-Line CLI · QR Pair · APK/EXE\n+ Tailscale Zero-Config NAT"] --> VIABLE
| Dimension |
Feasibility Evidence & Constraints |
Risk Mitigation Built Into Sharedots |
| Technical & Fault-Tolerance |
Verified 2048 × 2048 float32 distributed matmul (np.allclose max error 1.07 × 10⁻⁴) and live SIGKILL mid-job recovery in scripts/e2e.sh |
Work-stealing micro-chunking + maxExpiresAt anti-hoarding leases + atomic reservation release prevent slow or crashed nodes from stalling clusters |
| Network & Transfer Overhead |
Loopback/WAN HTTP transfer adds latency on tiny sub-100 ms tasks (1,591 ms distributed vs 62.6 ms local NumPy on 2048²) |
Chunked HTTP Range resume + SHA-256 LRU worker cache (--cache-max-mb) amortize dataset transfers across multi-epoch ML & heavy compute sweeps |
| Economic & Cost Viability |
Pools sunk-cost laptops, campus desktops, and free-tier nodes at $0 marginal compute cost vs. $0.50–$4.00/hr cloud VMs |
Optional cloud bursting: mix free local machines with one cloud Coordinator (sharedots.onrender.com) or Tailscale mesh |
| Security & Multi-Tenancy |
Untrusted code on personal laptops is dangerous without strict isolation |
Room-scoped HMAC secrets, manifest verification before spawn, Wasmtime linear-memory/fuel caps, --network=none OCI, and PIN Away Mode |
🚀 Step-by-Step Installation & Usage Playbook
Choose Track A (prebuilt .exe & .apk installers in 60 seconds), Track B (full distributed compute mesh & ML from source), or combine both across your devices.
Track A — Prebuilt Desktop & Android Installers (60-Second Setup)
flowchart LR
A["1. Download Binary\n/#download or GitHub Releases"] --> B["2. Install Host (.exe)\nRemote-Dots or RemoteDots AI"]
B --> C["3. Install Mobile (.apk)\nAndroid 8.0+ Biometric Lock"]
C --> D["4. Pair via QR / Code\nLAN · Tailscale · Tunnel"]
D --> E["5. Operate Desktop\n60fps Trackpad or AI + Joystick"]
| Step |
Standard Remote-Dots (v1.5.3) |
RemoteDots AI Pro (0.1.0-alpha.*) |
| 1. Install Windows Host |
Run Remote-Dots-Setup.exe (installs to %LOCALAPPDATA%\Programs\Remote-Dots + optional Windows Service) |
Run RemoteDots-AI-Desktop-Setup.exe (or Beta) and wait until server status shows Running |
| 2. Configure Auth / AI |
Set permanent access password or accept one-time session confirmation |
Open Desktop Settings -> paste API key OR click Start beside Claude (:3456), Gemini (:3457), or Codex (:3458) CLI proxy |
| 3. Install Android APK |
Sideload sharedots-remote-android.apk (io.sharedots.remote) |
Sideload remotedots-ai-mobile.apk (com.remotedots.ai.mobile) |
| 4. Pair & Operate |
Enter peer ID + password for 60fps direct touch/trackpad control |
Scan Desktop Home QR (or Temp QR), toggle SUB mode if using CLI proxy, speak/type prompts or rotate to Landscape for Virtual Joystick |
Track B — Full Distributed Compute Mesh from Source (Step-by-Step)
- Install Prerequisites & Clone with Git LFS:
git lfs install
git clone https://github.com/Mausam5055/sharedots.git
cd sharedots
- Build TypeScript Workspaces, Python SDK & Rust Worker Daemon:
pnpm install
pnpm -r build
pip install numpy cloudpickle
cargo build --release --manifest-path Cargo.toml
- Boot the Core Stack (4 Terminals):
# Terminal 1 — Coordinator Control & Artifact Plane (:4000)
pnpm coordinator:dev
# Terminal 2 — Express Auth, 2FA & Saved Rooms Server (:8000)
cp apps/web-backend/.env.example apps/web-backend/.env # configure MONGO_URI & JWT secrets
pnpm --dir apps/web-backend dev
# Terminal 3 — Next.js Web Control Plane (:3000)
pnpm dashboard:dev
# Terminal 4 — Ink v5 Terminal UI (Create Room -> Displays sd_join_ QR & Code)
pnpm --filter @sharedots/tui dev
- Join Additional Laptops / Cloud Nodes into Your Room:
# On Machine 2 (LAN or Tailscale) — contribute up to 75% CPU and 8 GB RAM
node packages/cli/dist/index.js join sd_join_<INVITE_CODE> --cpu-limit 75 --memory-limit 8192
- Execute a Distributed Compute / ML Workload & Inspect Live Telemetry:
# Run 2048x2048 distributed matrix multiplication across connected nodes
node examples/matrix-multiplication/run.mjs --coordinator http://localhost:4000 --room <ROOM_ID> --token <SECRET> --size 2048 --partitions 4
# Or press [w] inside the Ink TUI to launch http://localhost:3000/dashboard pre-authenticated to your room
Track C — ML Workspace (Colab Mesh), Kaggle API & Local Quick-Test
See the dedicated guide at docs/23_ML_WORKSPACE_COLAB_KAGGLE.md for .ipynb import/export, !kaggle dataset pulls, fedavg-json multi-GPU weight averaging, and live inference verification.
Open & Test It Yourself Right Now
Your servers are running locally (:4000 Coordinator, :8000 Web-Backend with MongoDB, :3000 Web-Frontend) with room room-3f6a02c7 already created:
- Connect 1 or 2 workers in PowerShell (optional
--gpu to pool RTX 4050 VRAM):E:\SHAREDOTS\target\release\sharedots-daemon.exe --coordinator http://127.0.0.1:4000 --room-id room-3f6a02c7 --token d7be6a1f14bd6bfbd9ea0591aa7792d2d3dddadc11f36eeda885945c0dfef7fb --worker-id worker-1 --gpu
- Open the Workspace directly in Chrome/Edge:
http://localhost:3000/dashboard?tab=workspace&nav=workspace&room=room-3f6a02c7&token=d7be6a1f14bd6bfbd9ea0591aa7792d2d3dddadc11f36eeda885945c0dfef7fb&coordinator=http://127.0.0.1:4000
- Click
Run All (or use Kaggle API in the top bar / left database icon to pull a Kaggle dataset or upload a .csv), then use Export Weights (.json), Export Python Runner (.py), and Test Exported Model at the bottom once training finishes.
🏛️ Core Compute Mesh Architecture
Sharedots eliminates single-machine bottlenecks by federating heterogeneous hardware (developer laptops, lab workstations, cloud VMs, and edge nodes) into isolated cryptographic Compute Rooms. Every machine runs an autonomous Rust Worker Daemon (sharedots-daemon) that advertises live CPU, RAM, GPU, and runtime capabilities to a stateful Coordinator Control Plane over binary MessagePack WebSockets, while transferring large tensors and model artifacts out-of-band over a resumable, SHA-256-verified HTTP Data Plane.
1. Unified System Planes
flowchart LR
subgraph CLIENTS["Client & Operator Layer"]
SDK["TypeScript & Python @remote SDK"]
CLI["sharedots CLI & Ink v5 TUI"]
WEB["Next.js Control Plane :3000"]
AUTH["Express Auth & 2FA :8000"]
WEB -->|"/api/v1/* JWT"| AUTH
end
subgraph COORD["Coordinator Control Plane :4000"]
RM["Room & HMAC Auth"]
SCH["Work-Stealing Scheduler"]
AS["Chunked Artifact Store"]
DB[("SQLite WAL Store")]
RM --> SCH --> AS --> DB
end
subgraph FLEET["Heterogeneous Worker Fleet"]
W1["Worker 1: Rust Daemon\nPython · Wasmtime · OCI"]
W2["Worker 2: Rust Daemon\nPython · Wasmtime · OCI"]
WN["Worker N: LAN / Tailscale\nCPU · RAM · GPU Nodes"]
end
SDK & CLI -->|"REST + HMAC-SHA256"| COORD
WEB -->|"/api/coordinator/*"| COORD
COORD <-->|"MsgPack WS <= 256 KB"| W1 & W2 & WN
AS <-->|"HTTP Range + SHA-256"| W1 & W2 & WN
2. End-to-End Job & Shard Execution Flow
sequenceDiagram
autonumber
actor Dev as Developer / ML Engineer
participant SDK as Python @remote / TS SDK
participant Coord as Coordinator :4000
participant Sched as Work-Stealing Scheduler
participant Worker as Rust Daemon
participant Exec as Python / WASI / OCI Executor
Dev->>SDK: Submit matrix / ML batch or @client.remote.map()
SDK->>Coord: POST /api/artifacts/upload (input tensors + SHA-256)
SDK->>Coord: POST /api/jobs (HMAC-SHA256 signed spec)
Coord->>Coord: Persist job & tasks in SQLite WAL (status: queued)
Coord->>Sched: Partition into row-blocks / micro-chunks
Sched->>Sched: Filter workers -> Score headroom -> Reserve CPU/RAM/GPU
Sched->>Worker: TASK_ASSIGN (MsgPack frame + HMAC-signed manifest)
Worker->>Worker: Verify manifest signature + check LRU SHA-256 cache
Worker->>Coord: GET /api/artifacts/:id (HTTP Range resume on cache miss)
Worker->>Exec: Spawn isolated runtime (scrubbed env, RSS/fuel guards)
Exec-->>Worker: Shard output (.npy / stdout / metrics)
Worker->>Coord: POST /api/artifacts/upload (output shard + SHA-256)
Worker->>Coord: TASK_COMPLETED -> release capacity reservation
Coord->>Coord: Aggregate row-block shards -> final tensor/result
Coord-->>SDK: Job status: completed -> SharedotsFuture.result()
3. Resource-Aware Scheduling & Work-Stealing Pipeline
The scheduler (apps/coordinator/src/scheduler/) decouples capacity accounting from transport using a deterministic selection function (select(task, workers)), a strict Reservation Ledger, and a Guided Work-Stealing Queue (work-stealing-queue.ts):
flowchart TD
Q["Pending Task Queue"] --> E["1. Eligibility Filter\nOnline + Runtime + CPU + RAM + GPU"]
E --> S["2. Multi-Factor Scorer\nFree Ratio - Failure Penalty + Heartbeat Freshness"]
S --> T["3. Deterministic Tie-Breaker\nLexicographical sort by workerId"]
T --> R["4. Atomic Reservation Ledger\nLock CPU, RAM, and GPU slots"]
R --> D["5. TASK_ASSIGN Dispatch\nBounded lease + maxExpiresAt"]
D --> W{"Lease Watchdog\nProgress or Heartbeat?"}
W -->|"Completed"| REL["Release Reservation + Update Stats"]
W -->|"maxExpiresAt Exceeded\nor Worker Disconnect"| RE["Evict & Re-Queue Shard\nif attempt < maxAttempts"]
W -->|"Fast Peer Idle"| PULL["TASK_PULL Micro-Chunk\nWork-Stealing Rebalance"]
RE --> Q
PULL --> R
| Scheduler Stage |
Mechanism |
Exact Implementation Guarantee |
| Eligibility Gate |
computeCapacity(worker) |
Enforces effectiveCpu - reservedCpu >= task.cpu, effectiveMem - reservedMem >= task.memoryBytes, runtime support (python, wasm, container, gpu), and GPU backend constraints (none, optional, required) |
| Scoring Function |
Normalized headroom + reliability |
Balances free CPU/RAM ratio against historical failedTasks / max(1, totalTasks) and heartbeat recency |
| Reservation Ledger |
Pre-dispatch atomic locking |
Prevents capacity overcommitment across concurrent jobs on the same node; released atomically on completion, failure, cancellation, or eviction |
| Work-Stealing Queue |
work-stealing-queue.ts |
Splits compute workloads using guided micro-chunking so fast multi-core or GPU hosts continuously task.pull remaining shards without waiting for slower nodes |
| Anti-Hoarding Watchdog |
lease-manager.ts (maxExpiresAt) |
Heartbeats alone cannot extend an execution lease past maxExpiresAt; stalled shards are forcibly reclaimed and reassigned within bounded time |
| Failure Recovery |
SIGKILL & disconnect re-queue |
On 15s heartbeat timeout (SHAREDOTS_HEARTBEAT_TIMEOUT_MS) or socket close, active tasks return to pending up to maxAttempts (default 3) |
4. Worker Daemon State Machine & Supervision
stateDiagram-v2
[*] --> Connecting: sharedots-daemon start
Connecting --> Registering: WebSocket upgrade + HMAC auth
Connecting --> Connecting: Exponential backoff + jitter
Registering --> Online: WORKER_REGISTERED ack
Registering --> Connecting: Auth or version error
Online --> Busy: TASK_ASSIGN received\nCPU & RAM reserved
Online --> Online: 5s heartbeat + systemTelemetry
Online --> Offline: SIGTERM / socket close
Busy --> Online: TASK_COMPLETED or retryable fail\nreservation released
Busy --> Offline: Crash / SIGKILL\nCoordinator re-queues tasks
Offline --> Connecting: Automatic reconnect loop
Offline --> [*]: sharedots worker leave
🧠 Distributed ML & Execution Engines
Sharedots's primary engineering goal is pooling idle compute across everyday machines to run distributed numerical pipelines and train machine learning models across clusters without requiring expensive homogeneous cloud instances. Workloads execute inside pluggable, resource-guarded runtimes managed by the Rust worker daemon (crates/sharedots-daemon) and TypeScript engine abstractions (engines/*).
1. How Distributed ML Training & Tensor Compute Work Across the Mesh
flowchart LR
subgraph DRIVER["ML Driver Node (Python @client.remote)"]
MODEL["Model / Dataset / Hyperparameters"]
PART["Partitioner\nData Shards · Layer Splits · Hyperparam Grid"]
AGG["Coordinator Aggregator\n.npy Block Merge · Gradient / Metric Sync"]
end
subgraph WORKERS["Pooled Multi-Machine Compute Nodes"]
N1["Node A (Laptop · 12C / 16GB)\nPython/NumPy + PyTorch Shard 0"]
N2["Node B (Desktop · RTX GPU)\nCUDA / Data-Parallel Shard 1"]
N3["Node C (Cloud VM · Linux)\nWASI / OCI Container Shard 2"]
end
MODEL --> PART
PART -->|"Chunked SHA-256 Artifacts"| N1 & N2 & N3
N1 & N2 & N3 -->|"Trained Weights / Tensor Blocks"| AGG
AGG -->|"Synchronized Model / Result"| MODEL
2. Supported Runtimes & Distributed ML Parallelism Matrix
| Engine / Package |
Runtime ID |
Status |
Parallelism & Isolation Capabilities |
Source |
Python / NumPy Engine |
python |
 |
cloudpickle closure serialization, @client.remote, .map(), sd.gather(), .npy row-block matrix aggregation, RLIMIT_AS + cross-platform RSS watchdog |
engines/python/ |
Wasmtime WASI Engine |
wasm |
 |
Deterministic fuel metering, StoreLimits memory caps, epoch preemption, /input read-only + /output read-write WASI preopen isolation |
engines/wasm/ |
OCI Container Engine |
container |
 |
Docker / Podman daemon probe, --network=none sandbox, NVIDIA Container Toolkit GPU passthrough detection |
engines/container/ |
PyTorch Distributed Adapter |
pytorch |
 |
Planned strategies: data-parallel (All-Reduce DDP), model-parallel (layer sharding), pipeline-parallel (micro-batch stages) |
engines/ml/pytorch/ |
TensorFlow Distributed Adapter |
tensorflow |
 |
Planned strategy: data-parallel (MultiWorkerMirroredStrategy parameter synchronization) |
engines/ml/tensorflow/ |
JAX SPMD Adapter |
jax |
 |
Structured Executor interface for pmap / multi-host jax.distributed mesh execution |
engines/ml/jax/ |
Native GPU Kernel Engine |
gpu |
 |
Structured dispatch interface for cuda, rocm, and metal compute kernels (hardware discovery via nvidia-smi already active in daemon) |
engines/gpu/ |
3. Machine-Level Resource Guards & Hardware Pinning
| Protection Layer |
Enforcement Mechanism |
Why It Matters for Shared ML Nodes |
| Hardware Discovery |
sysinfo + nvidia-smi + ROCm/Metal probes |
Detects exact physical/logical CPU cores, live available RAM, GPU VRAM, and pinned Python/NumPy interpreter paths at startup |
| Contribution Caps |
--cpu-limit <1..100> & --memory-limit <MiB> |
Guarantees contributor laptops remain responsive while donating idle compute to cluster training runs |
| Memory Watchdog |
Unix RLIMIT_AS + cross-platform RSS polling |
Terminates runaway tensor allocations cleanly before triggering host OOM killer |
| Process-Tree Cleanup |
OS process-group termination on timeout or job.cancel |
Prevents orphaned Python training child processes from leaking GPU/RAM after cancellation |
| Environment Scrubbing |
Whitelisted subprocess env vars |
Prevents untrusted remote workloads from reading host credentials or .env secrets |
| LRU Artifact Cache |
--cache-max-mb (default 2048 MiB) |
Content-addressed by SHA-256 so repeated epoch datasets and shared model weights stay cached locally across shards |
🔐 Wire Protocol & Cryptographic Security
All control-plane and data-plane contracts are generated from a single TypeScript Zod source of truth (packages/protocol) and verified against canonical binary fixtures across both Node.js (msgpackr) and Rust (rmp-serde).
1. Control Plane vs. Data Plane Separation
flowchart LR
subgraph CONTROL["Control Plane — WebSocket /ws"]
ZOD["Zod Schemas\n22 JSON Schemas"] --> MP["Binary MessagePack\nMax Frame <= 256 KB"]
MP -->|"useRecords: false\nrmp_serde::to_vec_named"| SIG["HMAC-SHA256\nRoom + Manifest Signing"]
end
subgraph DATA["Data Plane — Chunked HTTP /api/artifacts/*"]
UP["Init -> PUT /chunks/:i\n-> Finalize (SHA-256)"]
DL["GET /artifacts/:id\nHTTP Range Resume"]
LRU["Worker Local LRU Cache\nContent-Addressed SHA-256"]
UP --> DL --> LRU
end
2. Envelope Format & Message Catalog (v: 1)
Every WebSocket message uses a canonical MessagePack map envelope (v: 1, id: uuid-v4, ts: epoch_ms, from: sender_id, type, payload):
| Category |
Message Types |
Direction |
Purpose |
| Worker Lifecycle |
worker.register, worker.heartbeat, worker.status |
Worker ↔ Coordinator |
Registers capabilities (cpu, memory, gpus, supportedRuntimes) and streams 5s heartbeats + optional systemTelemetry |
| Job Lifecycle |
job.submit, job.accepted, job.cancel, job.completed, job.failed, job.log |
Client ↔ Coordinator |
Submits declarative or @remote specs, streams task logs, and signals terminal completion or failure |
| Task & Work-Stealing |
task.assign, task.pull, task.yield, task.started, task.progress, task.completed, task.failed |
Coordinator ↔ Worker |
Assigns signed task manifests, enables fast workers to pull micro-chunks, and reports shard telemetry (downloadMs, computeMs, uploadMs) |
| Artifacts & Control |
artifact.request, artifact.response, ack, error |
Bidirectional |
Artifact resolution, delivery acknowledgements, and UNSUPPORTED_PROTOCOL_VERSION / FRAME_TOO_LARGE (262,144 bytes) errors |
3. Cryptographic Trust & Request Signing
| Security Boundary |
Formula / Mechanism |
Details |
| HTTP & WS Transport Auth |
HMAC-SHA256(roomSecret, "${method}\n${path}\n${timestamp}\n${roomId}") |
Passed via x-sharedots-room, x-sharedots-ts, x-sharedots-sig headers; prevents replay and cross-room tampering |
| Task Manifest Signing |
HMAC-SHA256(roomSecret, canonicalManifestJson) |
Coordinator signs every task manifest; Rust daemon refuses to spawn any executor if signature verification fails |
| Invite Tokens |
sd_join_<base64url> |
Self-contained pairing payloads encoding Coordinator URL, roomId, and room secret for instant CLI/TUI/QR onboarding |
| Optional API Key Gate |
SHAREDOTS_API_KEY (x-sharedots-api-key or Authorization: Bearer) |
Locks down Coordinator management endpoints (/api/overview, /api/rooms, /api/workers) in multi-tenant deployments |
| Artifact Integrity |
Full-payload & per-chunk SHA-256 (x-sha256, x-chunk-sha256) |
Rejects corrupt transfers immediately before storage or execution |
🖥️ Web Control Plane, Telemetry & Auth/2FA
The web platform splits cleanly into the Next.js 14 Control Plane (apps/web-frontend, port 3000) and the Express + MongoDB Auth & Workspace Server (apps/web-backend, port 8000).
1. Three-Way Session Isolation & Telemetry Truthfulness
To ensure live cluster telemetry is never fabricated when workers are offline and evaluator demos never leak real user sessions, the dashboard enforces strict session isolation (resolveAuthPresentation in apps/web-frontend/src/lib/demo-profile.ts) and live disconnect safety:
flowchart TD
REQ["Dashboard Load & 2.5s Telemetry Poll"] --> SESS{"Session Mode?"}
SESS -->|"Authenticated JWT"| USER["Real MongoDB Profile\nSaved Rooms + Real TOTP 2FA"]
SESS -->|"judgeMode=1 Cookie"| JUDGE["Judge Bypass Profile\[email protected] · Isolated"]
SESS -->|"Unauthenticated"| DEMO["Read-Only Guest Demo\nSharedots Demo"]
USER & JUDGE & DEMO --> COORD{"Coordinator\nReachable?"}
COORD -->|"No / 503"| WIPE["online = false\nClear cached workers & jobs"]
COORD -->|"Yes"| NODE{"Same Host as\nDashboard?"}
NODE -->|"Yes"| HOST["Enrich via /api/host-telemetry\niGPU · RTX dGPU · Wi-Fi TX/RX · Disk · Handles"]
NODE -->|"No Remote Host"| REMOTE["Render remote CPU, RAM, OS, Services\n& remote systemTelemetry only"]
2. Authentication, Email OTP & TOTP 2FA Flows
sequenceDiagram
participant U as User Browser
participant FE as Next.js :3000
participant BE as Express Auth :8000
participant DB as MongoDB Atlas
participant MAIL as Resend Mailer
U->>FE: Sign up (/signup)
FE->>BE: POST /api/v1/auth/register
BE->>DB: Save User (bcrypt) + VerificationCode (EMAIL_VERIFICATION)
BE->>MAIL: Send verification email via Resend
U->>FE: Submit code (/confirm-account)
FE->>BE: POST /api/v1/auth/verify/email
BE->>DB: Mark isEmailVerified = true
U->>FE: Log in (/login)
FE->>BE: POST /api/v1/auth/login
alt 2FA Enabled
BE-->>FE: mfaRequired: true
U->>FE: Submit 6-digit TOTP or backup code (/verify-mfa)
FE->>BE: POST /api/v1/mfa/verify-login (speakeasy TOTP)
end
BE->>DB: Create Session (30d expiry)
BE-->>FE: Set HttpOnly accessToken (15m) + refreshToken (30d) cookies
/login — Email/password JWT authentication, OAuth entrypoints, and isolated one-click Judge Bypass
3. Control Plane Surfaces & Alert Separation
| Surface / Tab |
Purpose |
Key Data & Controls |
| Overview |
Cluster & selected-node health |
Live CPU%, RAM%, iGPU, dGPU, Wi-Fi TX/RX kbps, Disk I/O, active/completed job feed, capacity ring |
| Processes |
OS process & service inspection |
Live host process tree, handles, threads, and background service states |
| Firewall / Mesh |
Network & Tailscale peer matrix |
Node IPv4/Tailscale endpoints, heartbeat jitter, worker eviction controls (DELETE /api/workers/:id) |
| DAG Topology |
Job & task shard visualization |
Row-block partitions, per-shard downloadMs/computeMs/uploadMs, retries, and cancellation |
| Orbital 3D Mesh |
Full-screen cluster explorer |
Interactive cluster rings, kernel strips, particle task chunks, and aggregate GFLOPS view |
| Benchmarks |
Performance telemetry |
Historical scripts/bench/results/*.json comparisons (distributed vs. baseline) |
>_ Logs Console |
Raw stream diagnostics |
Merges Coordinator /api/logs, local worker.log, and TUI tui-stream.jsonl (ANSI stripped, regex searchable) |
| Notifications Inbox |
High-signal alerts only |
Coordinator outages, worker evictions, >= 92% CPU/RAM guardrails, job terminal events, and 2FA changes |
🤖 Remote-Dots & RemoteDots AI Subsystems
Alongside the distributed compute mesh, Sharedots ships two complementary peer-to-peer remote workstation suites under services/ — cleanly separated into Standard Remote-Dots (direct ultra-low-latency desktop control) and RemoteDots AI (autonomous voice/text AI workstation execution + landscape virtual joystick):
1. Edition Comparison
| Dimension |
Standard Edition (Remote-Dots) |
Pro Edition (RemoteDots AI) |
| Primary Engine |
services/rustdesk (Rust + Flutter, AGPL-3.0) |
services/remotedots-ai (Tauri 2 + Python + Node + Expo SDK 55, MIT) |
| Interaction Model |
Classic direct touch / laptop-style trackpad + pinch-to-zoom |
Voice & chat AI agent + landscape virtual joystick controller (ManualControlOverlay) |
| Video & Transport |
60fps P2P streaming (NVENC / AMF / QSV) |
Low-latency WebRTC video + Cloudflare Tunnel / LAN / Tailscale signaling |
| AI & Automation |
None (pure low-overhead remote desktop) |
33+ Agent Tools: CLI execution, OmniParser + PyAutoGUI vision, Gemini Computer Use, Accessibility Tree, PinchTab Chrome control, Dual-Tool safety evaluator |
Subscription Proxy (SUB) |
Not applicable |
Local CLI OAuth proxy (remotedots-ai-cli-proxy) for Claude (:3456), Gemini (:3457), and OpenAI Codex (:3458) — no API key needed |
| Security & Privacy |
Unattended Windows service (UAC/lock screen), Android MPIN & biometrics |
Biometric/PIN app lock, temporary one-off QR pairing, PIN-locked Away Mode privacy screen, risky command approval prompts |
| Desktop / Mobile Targets |
Remote-Dots-Setup.exe, sharedots-remote-win64.zip, sharedots-remote-android.apk |
RemoteDots-AI-Desktop-Setup.exe, RemoteDots-AI-Desktop-Beta-Setup.exe, remotedots-ai-mobile.apk |
2. RemoteDots AI System Architecture
flowchart LR
subgraph PHONE["Mobile Client — Expo SDK 55 / RN 0.83"]
CHAT["Voice / Chat Thread\nSTT: Gemini · Whisper · OpenRouter"]
JOY["Landscape Joystick Overlay\n30fps Cursor · L/R Drag · Hotkeys"]
SUB_UI["SUB Mode Selector\nConversation + Execution Models"]
end
subgraph HOST["Windows Host — Tauri 2 NSIS Bundle"]
SRV["remotedots-ai-server\nWebRTC · Tunnel · Safety Evaluator"]
VISION["Vision Grounding\nOmniParser · PyAutoGUI · A11y Tree"]
CHROME["PinchTab Browser\nAutomated Chrome Actions"]
PROXY["remotedots-ai-cli-proxy\nClaude :3456 · Gemini :3457 · Codex :3458"]
end
CHAT & SUB_UI -->|"Encrypted WebRTC / HTTPS Tunnel"| SRV
JOY -->|"30fps Input Events"| SRV
SRV --> VISION & CHROME & PROXY
3. RemoteDots AI Subscription Proxy Ports & Vision Backends
| Component |
Port / Backend |
Capabilities & Configuration |
Claude CLI Proxy |
localhost:3456 |
Routes SUB mode requests through authenticated claude CLI login (Claude Sonnet / Opus) |
Gemini CLI Proxy |
localhost:3457 |
Routes SUB mode requests through authenticated gemini CLI login (Gemini 2.5 / 3 Flash) |
OpenAI Codex Proxy |
localhost:3458 |
Reads active model slug from ~/.codex/config.toml (fallback ~/.codex/models_cache.json) with dynamic model lookup & tool-call routing |
Vision Grounding |
OmniParser + PyAutoGUI / Gemini Computer Use / Accessibility Tree |
Inspects screen coordinates and UI elements even when CLI proxy text sessions run in NO VISION mode |
Built-in Skills |
Skills tab on Desktop |
ide-chat, web-research, office-documents, cli-command-patterns, and skill-authoring |
📦 Compiled Releases & Binary Matrix (APK & EXE)
All prebuilt Windows installers (.exe), portable archives (.zip), and signed Android builds (.apk) are stored via Git LFS inside compiled_apps/, mirrored to apps/web-frontend/public/downloads/ for /#download, and published as versioned GitHub Releases.
1. Complete Release & Version Matrix
| Product & Platform |
Binary Filename |
Version / Build |
Package ID / Arch |
Size |
Direct GitHub Release |
Remote-Dots Installer |
Remote-Dots-Setup.exe |
v1.5.3 |
Windows x64 SFX Installer |
31.37 MiB |
 |
Remote-Dots Portable |
sharedots-remote-win64.zip |
v1.5.3 |
Windows x64 Portable ZIP |
31.11 MiB |
 |
Remote-Dots Mobile |
sharedots-remote-android.apk |
v1.5.3 (code 71) |
io.sharedots.remote · arm64-v8a |
28.40 MiB |
 |
RemoteDots AI (Stable) |
RemoteDots-AI-Desktop-Setup.exe |
v0.1.0-alpha.4 |
Windows x64 NSIS |
47.04 MiB |
 |
RemoteDots AI (Beta) |
RemoteDots-AI-Desktop-Beta-Setup.exe |
v0.1.0-alpha.4-beta |
Windows x64 NSIS |
47.05 MiB |
 |
RemoteDots AI Mobile |
remotedots-ai-mobile.apk |
v0.1.0-alpha.3 (code 1) |
com.remotedots.ai.mobile · 4-ABI |
164.39 MiB |
 |
Sharedots Desktop |
Sharedots-Desktop-Setup.exe |
v0.1.0 |
com.sharedots.desktop · x64 NSIS |
5.91 MiB |
 |
Sharedots Daemon |
sharedots-daemon-win64.zip |
v0.1.0 |
Windows x64 Release Binary |
6.69 MiB |
 |
Unified Platform Release: All 8 binaries plus SHA256SUMS.txt are also bundled in the latest release v0.1.0.
2. Cryptographic Verification (SHA-256) & Web Download Overrides
| Binary |
Full SHA-256 Digest |
Web Download Route |
Environment CDN Override |
Remote-Dots-Setup.exe |
e1b17623b3e8df8c30337f4b10893301eed514d5ea862961af6caacf468e761c |
/downloads/Remote-Dots-Setup.exe |
NEXT_PUBLIC_WINDOWS_DOWNLOAD_URL |
sharedots-remote-win64.zip |
8b9f9be54f9f63353d85002c47db800cabe3b0ce1e08045bc7b14ed15320ffa1 |
(Release / Repo LFS) |
— |
sharedots-remote-android.apk |
ec6ee9fd8c00cb67da2aed16840f264c0b99f7a9ad780d3ed3435a09335da29b |
/downloads/sharedots-remote-android.apk |
NEXT_PUBLIC_ANDROID_DOWNLOAD_URL |
RemoteDots-AI-Desktop-Setup.exe |
46344b518b5821dbab5282ff1a0d95d5c7fbe809e410d20b5863bf8976961639 |
/downloads/RemoteDots-AI-Desktop-Setup.exe |
NEXT_PUBLIC_AI_WINDOWS_STABLE_DOWNLOAD_URL |
RemoteDots-AI-Desktop-Beta-Setup.exe |
490be1adc3e34258b16c7174592ead2653a8166a1714e8a2529efa6997fb1e82 |
/downloads/RemoteDots-AI-Desktop-Beta-Setup.exe |
NEXT_PUBLIC_AI_WINDOWS_BETA_DOWNLOAD_URL |
remotedots-ai-mobile.apk |
bede358c2182be4a546f077ee82a1c63790e893803cd7a7dc467e3862547e8f5 |
/downloads/remotedots-ai-mobile.apk |
NEXT_PUBLIC_AI_ANDROID_DOWNLOAD_URL |
Sharedots-Desktop-Setup.exe |
b201a836b694a1272dd4ffd64c7afd7b781bb6e275f89b65277adc242fae7c38 |
(Release / Repo LFS) |
— |
sharedots-daemon-win64.zip |
585e45a52fe06015c47d0dda033e31738484aa9525aff3d4c62a1004bd3b28fb |
(Release / Repo LFS) |
— |
3. Rebuilding & Re-Staging Installers
# Re-stage Standard Remote-Dots Windows & Android artifacts into compiled_apps/ & public/downloads/
pnpm remote:stage
# Verify binary integrity against SHA256SUMS.txt
sha256sum -c compiled_apps/SHA256SUMS.txt
For rebuilding RemoteDots AI Desktop (Tauri 2 NSIS) and RemoteDots AI Mobile (Expo SDK 55 Universal APK) on Windows with JDK 17 and NDK 27.1.12297006, see docs/10_REMOTEDOTS_AI_GUIDE.md.
🔍 SEO & Search Console Architecture
The Next.js App Router frontend (apps/web-frontend) implements full technical SEO, canonical URL normalization, dynamic XML sitemap generation, crawler gating, and Google Search Console ownership verification (documented in docs/22_SEO.md).
1. SEO Implementation Components
| Module |
Path |
Responsibility |
| Site Origin Resolver |
src/lib/siteConfig.ts |
Resolves getSiteUrl() from NEXT_PUBLIC_SITE_URL, SITE_URL, VERCEL_PROJECT_PRODUCTION_URL, or VERCEL_URL (fallback https://sharedots.dev) |
| Root Metadata & OG |
src/app/layout.tsx |
Configures metadataBase, canonical /, OpenGraph (1200×630 /og-preview.jpg), Twitter summary_large_image, icons, googleBot max-preview rules, and optional NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION |
| Route Layouts |
how-it-works/layout.tsx & animated-explainer/layout.tsx |
Dedicated page titles, descriptions, canonical paths, and OpenGraph cards |
| Dynamic Sitemap |
src/app/sitemap.ts |
Emits /sitemap.xml with priority weights for all public crawlable routes |
| Crawler Policy |
src/app/robots.ts |
Emits /robots.txt allowing public routes while blocking private control-plane and auth utility routes |
| Middleware Pass-Through |
src/middleware.ts |
Excludes static filenames (.*\\..*) so /google6efec3a8c0dabd85.html, /sitemap.xml, /robots.txt, and /manifest.webmanifest always return HTTP 200 |
2. Indexed vs. Disallowed Routes
| Route |
Sitemap Priority |
Robots Policy |
Purpose |
/ |
1.0 |
Allow |
Compute Mesh landing, #features, #platform, #download binaries |
/how-it-works |
0.9 |
Allow |
Interactive RemoteDots AI architecture, 33 tools, skills & security |
/animated-explainer |
0.8 |
Allow |
GSAP ScrollTrigger & Lenis interactive workflow walkthrough |
/signup |
0.7 |
Allow |
Account registration & email verification entry |
/login |
0.6 |
Allow |
Account sign-in & Judge Bypass entry |
/dashboard, /home, /sessions |
— |
Disallow |
Private mesh control plane & account session views |
/api/*, /confirm-account, /forgot-password, /reset-password, /verify-mfa |
— |
Disallow |
Internal BFF proxy routes and one-time auth verification steps |
🗄️ Database Schemas (SQLite & MongoDB)
Sharedots separates ephemeral/cluster compute state (stored in embedded SQLite WAL inside apps/coordinator) from account, session, 2FA, and saved-room state (stored in MongoDB Atlas inside apps/web-backend).
1. Coordinator SQLite WAL Entity-Relationship Diagram
erDiagram
rooms ||--o{ workers : registers
rooms ||--o{ jobs : owns
jobs ||--o{ tasks : partitions_into
workers ||--o{ tasks : executes
jobs ||--o{ job_logs : emits
rooms ||--o{ artifacts : scopes
jobs ||--o{ artifacts : produces
rooms {
text room_id PK
text name
text secret
int created_at
}
workers {
text worker_id PK
text room_id FK
text hostname
text status
text capabilities_json
int last_heartbeat_at
int registered_at
int completed_tasks
int failed_tasks
}
jobs {
text job_id PK
text room_id FK
text name
text runtime
text strategy
text status
text spec_json
text result_json
text error_code
text error_message
int created_at
int started_at
int completed_at
}
tasks {
text task_id PK
text job_id FK
text room_id
int task_index
text status
text worker_id
int attempt
int max_attempts
text spec_json
text output_json
int duration_ms
int download_ms
int compute_ms
int upload_ms
text error_code
text error_message
int created_at
int started_at
int completed_at
}
job_logs {
int id PK
text job_id
text task_id
text worker_id
text stream
text line
int ts
}
artifacts {
text artifact_id PK
text room_id
text job_id
text filename
text sha256
int size_bytes
text storage_path
int created_at
}
audit_logs {
int id PK
text room_id
text actor
text action
text details_json
int ts
}
2. Coordinator SQLite Tables & Indexes (apps/coordinator/src/storage/sqlite.ts)
| Table |
Primary Key |
Foreign Keys & Indexes |
Purpose |
rooms |
room_id |
— |
Isolated compute room registry and HMAC signing secrets |
workers |
worker_id |
room_id -> rooms(room_id) CASCADE; idx_workers_room |
Hardware capabilities JSON, heartbeat timestamps, completed/failed counters |
jobs |
job_id |
room_id -> rooms(room_id) CASCADE; idx_jobs_room |
Declarative / @remote job spec, status, aggregated result JSON, timing |
tasks |
task_id |
job_id -> jobs(job_id) CASCADE; idx_tasks_job |
Partitioned shard state, retry attempt tracking, download_ms/compute_ms/upload_ms |
job_logs |
id (auto) |
idx_logs_job(job_id) |
Ordered stdout/stderr task log lines per worker shard |
artifacts |
artifact_id |
idx_artifacts_job(job_id) |
SHA-256 content-addressed artifact metadata, disk path, and TTL lifecycle |
audit_logs |
id (auto) |
— |
Security and lifecycle audit trail per room and actor |
3. Auth Backend MongoDB Collections (apps/web-backend/src/database/models/)
| Collection / Model |
Key Fields |
Unique / Index Constraints |
Purpose |
User (user.model.ts) |
name, email, password (bcrypt pre-save), isEmailVerified, userPreferences.{enable2FA, emailNotification, twoFactorSecret, twoFactorBackupCodes} |
email unique; toJSON strips password, TOTP secret & backup codes |
User account & 2FA credential store |
Session (session.model.ts) |
userId (ObjectId -> User), userAgent, createdAt, expiredAt (30d default) |
userId indexed |
Active multi-device login sessions & remote revocation |
UserRoom (room.model.ts, user_rooms) |
userId, roomId, name, coordinatorUrl, token |
Compound unique (userId, roomId) |
Saved compute rooms synced between local/Render coordinators and user accounts |
VerificationCode (verification.model.ts, verification_codes) |
userId, code, type (EMAIL_VERIFICATION / PASSWORD_RESET), expiresAt |
code unique; userId indexed |
Time-bounded verification and password-reset codes |
NewsletterSubscriber (newsletter.model.ts, newsletter_subscribers) |
email, source, status (subscribed/unsubscribed), unsubscribeToken, welcomeEmailSentAt |
email unique |
Landing-footer newsletter subscriptions with constant-time token unsubscribe |
📡 Complete API Reference
1. Coordinator Control & Data Plane (apps/coordinator, :4000)
| Method |
Path |
Auth |
Description |
GET / HEAD |
/ |
Public |
Coordinator metadata, version (0.1.0), and endpoint index |
GET / HEAD |
/api/health |
Public |
Health check, protocol version (1), and uptime |
GET |
/api/overview |
Optional SHAREDOTS_API_KEY |
Cluster-wide room, worker, job, and capacity overview |
GET |
/api/benchmarks |
Optional SHAREDOTS_API_KEY |
Historical benchmark JSON summaries from scripts/bench/results/ |
POST |
/api/rooms |
Optional SHAREDOTS_API_KEY |
Create an isolated compute room (roomId + generated secret) |
GET |
/api/rooms |
Optional SHAREDOTS_API_KEY |
List rooms with live online worker counts, cores, RAM, and GPUs |
GET |
/api/rooms/:roomId |
Optional SHAREDOTS_API_KEY |
Inspect single room metadata and worker capacity breakdown |
GET |
/api/workers |
Optional SHAREDOTS_API_KEY |
List registered workers (filterable via ?roomId=) |
GET |
/api/workers/:workerId |
Optional SHAREDOTS_API_KEY |
Inspect worker capabilities, status, and remaining capacity |
DELETE |
/api/workers/:workerId |
Optional SHAREDOTS_API_KEY |
Evict and remove a worker from the registry |
POST |
/api/jobs |
HMAC Room Auth |
Submit a partitioned distributed compute or ML job specification |
GET |
/api/jobs |
Optional SHAREDOTS_API_KEY |
List jobs (filterable via ?roomId=) |
GET |
/api/jobs/:jobId |
Optional SHAREDOTS_API_KEY |
Inspect full job state, task shards, timings, and result |
POST |
/api/jobs/:jobId/cancel |
HMAC Room Auth |
Cancel a running job and terminate worker subprocess trees |
GET |
/api/jobs/:jobId/logs |
Optional SHAREDOTS_API_KEY |
Fetch stdout/stderr logs for a specific job (?limit=) |
POST |
/api/daemon-logs |
HMAC Room Auth |
Ingest batched daemon/TUI log lines into Coordinator relay |
GET |
/api/logs |
Optional SHAREDOTS_API_KEY |
Unified Coordinator job logs + daemon relay logs (?limit=&jobId=) |
POST |
/api/artifacts/init |
HMAC Room Auth |
Initialize a multi-chunk artifact upload session |
PUT |
/api/artifacts/:id/chunks/:idx |
HMAC Room Auth |
Upload raw binary chunk with optional x-chunk-sha256 verification |
POST |
/api/artifacts/:id/finalize |
HMAC Room Auth |
Reassemble chunks and verify full artifact SHA-256 |
POST |
/api/artifacts/upload |
HMAC Room Auth |
Single-shot binary artifact upload (?filename=&jobId=&shared=) |
GET |
/api/artifacts/:id/stat |
HMAC Room Auth |
Inspect artifact size, SHA-256, and creation timestamp |
GET / HEAD |
/api/artifacts/:id |
HMAC Room Auth |
Stream artifact bytes with HTTP Range resume support |
WS |
/ws |
HMAC Upgrade Auth |
Binary MessagePack control plane (<= 256 KB frames) |
2. Auth, 2FA & Workspace Backend (apps/web-backend, :8000)
| Method |
Path |
Auth |
Description |
GET |
/ |
Public |
Service liveness probe |
POST |
/api/v1/auth/register |
Public |
Create user account and dispatch Resend email verification code |
POST |
/api/v1/auth/login |
Public |
Authenticate password and issue JWT cookies (or mfaRequired) |
POST |
/api/v1/auth/verify/email |
Public |
Verify registration email code and activate account |
POST |
/api/v1/auth/verify/resend |
Public |
Resend email verification OTP |
POST |
/api/v1/auth/password/forgot |
Public |
Request time-limited password reset email |
POST |
/api/v1/auth/password/reset |
Public |
Reset password using verification token |
POST |
/api/v1/auth/logout |
JWT Cookie |
Revoke active session and clear auth cookies |
GET |
/api/v1/auth/refresh |
Refresh Cookie |
Rotate 15-minute access JWT using 30-day refresh cookie |
GET |
/api/v1/mfa/setup |
JWT Cookie |
Generate TOTP secret, otpauth:// URI, and QR payload |
POST |
/api/v1/mfa/verify |
JWT Cookie |
Confirm TOTP setup and generate single-use backup codes |
POST |
/api/v1/mfa/backup-codes/regenerate |
JWT Cookie |
Rotate single-use MFA recovery codes |
PUT |
/api/v1/mfa/revoke |
JWT Cookie |
Disable TOTP 2FA on account |
POST |
/api/v1/mfa/verify-login |
Public (MFA Token) |
Complete login using 6-digit TOTP or backup recovery code |
GET |
/api/v1/session/all |
JWT Cookie |
List all active login sessions across devices |
GET |
/api/v1/session/ |
JWT Cookie |
Inspect current session metadata |
DELETE |
/api/v1/session/:id |
JWT Cookie |
Remotely terminate a specific device session |
GET |
/api/v1/rooms/ |
JWT Cookie |
List user's saved compute rooms |
POST |
/api/v1/rooms/ |
JWT Cookie |
Save or update a compute room (roomId, coordinatorUrl, token) |
DELETE |
/api/v1/rooms/:roomId |
JWT Cookie |
Delete a saved compute room bookmark |
POST |
/api/v1/newsletter/subscribe |
Public |
Subscribe email to release/SDK updates with welcome mail |
GET |
/api/v1/newsletter/unsubscribe |
Signed Token |
One-click constant-time token unsubscribe |
3. Next.js Web Control Plane BFF Routes (apps/web-frontend, :3000)
| Method |
Path |
Purpose |
GET |
/api/host-telemetry |
Same-host hardware collector: CPU, RAM, iGPU, dedicated RTX/AMD GPU, Wi-Fi TX/RX speed, Disk I/O, Handles & OS Processes |
GET / POST / DELETE |
/api/local-daemon |
Start, inspect, or stop the local host worker daemon from the browser dashboard |
GET |
/api/local-logs |
Tail local ~/.sharedots/worker.log and ~/.sharedots/tui-stream.jsonl into the >_ Logs tab |
ALL |
/api/coordinator/[...path] |
Server-side Coordinator proxy forwarding SHAREDOTS_API_KEY and HMAC headers |
GET |
/api/install.sh & /api/install.ps1 |
One-line cross-platform worker bootstrap installers |
💻 Developer SDKs, CLI & Ink TUI
1. Python @remote SDK (packages/sdk-python)
Built on cloudpickle and NumPy, allowing standard Python functions and ML training/inference closures to scale out across every online worker in a room:
import numpy as np
import sharedots as sd
client = sd.Client(coordinator="http://localhost:4000", room_id="room-abc-123", token="secret")
# 1. Single remote call -> SharedotsFuture
@client.remote(cpu=4, memory="2GB")
def matmul(a, b):
return np.dot(a, b)
result = matmul(np.eye(512), np.eye(512)).result(timeout=60)
# 2. Sharded batch -> work-stealing distribution across all workers
results = matmul.map([(A_i, B) for A_i in slices])
# 3. Gather multiple independent futures concurrently
all_results = sd.gather([matmul(A_i, B) for A_i in slices])
# 4. Local in-process debugging with identical API
local = matmul.local(np.eye(10), np.eye(10))
2. TypeScript SDK (packages/sdk)
import { Sharedots } from "sharedots";
const client = new Sharedots({ coordinator: "http://localhost:4000", token: "secret" });
const room = await client.connect("room-abc-123");
const job = await room.submit({
name: "matrix-multiply",
runtime: "python",
strategy: "row_partition",
spec: { matrixSize: 2048, partitions: 4 },
});
job.on("progress", ({ percent }) => console.log(`${percent}%`));
const result = await job.result();
3. sharedots CLI Reference (packages/cli)
| Command |
Arguments / Flags |
Description |
sharedots up |
[--cluster] [--contributor] [--join <CODE>] [--yes] |
Interactive onboarding wizard to create a room or join a mesh |
sharedots join |
<CODE|URL> [--cpu-limit N] [--memory-limit MB] [--gpu] |
Join a compute room using an sd_join_ invite or Coordinator URL |
sharedots tui |
[--coordinator URL] |
Launch the 5-tab Ink v5 interactive Terminal Dashboard |
sharedots dashboard |
[--room ID] [--coordinator URL] |
Open the Web Control Plane pre-authenticated to your active room |
sharedots run |
<script.py> [--partitions N] [--room ID] |
Partition and execute a local Python script across cluster workers |
sharedots job run / submit |
<job.json> [--room ID] [--token SECRET] |
Launch built-in presets or submit a declarative JSON distributed job |
sharedots worker |
start | status | stop | join | leave | logs |
Manage the background Rust daemon (--cpu-limit, --memory-limit, --gpu, --foreground) |
sharedots room create |
[--name NAME] [--coordinator URL] [--json] |
Provision a new isolated room with HMAC secret |
sharedots bench |
[--size N] [--partitions P] |
Execute distributed matrix multiplication benchmark |
4. Ink v5 Terminal UI (apps/tui)
| View Key |
Tab |
Capabilities |
1 |
Onboarding / Mesh |
Create room, generate terminal QR code (sd_join_), inspect Tailscale LocalAPI & WireGuard peer latency |
2 |
Daemon Supervisor |
Start/stop sharedots-daemon, adjust live --cpu-limit & --memory-limit dials without leaving TUI |
3 |
Cluster Fleet |
Real-time table of connected workers, OS/CPU/RAM/GPU telemetry, and heartbeat health |
4 |
Job Studio |
Launch presets (NumPy matmul, Monte Carlo Pi, WASI WASM, Python), inspect task DAG shards & progress |
5 |
Multi-Stream Logs |
Unified colorized streamer merging [COORD], [DAEMON], and [TASK] logs with / regex filter, [Space] pause, and [w] web launch |
⚡ Tech Stack & Monorepo Layout
1. Core Compute, Protocol & Runtime Stack
| Category |
Technology |
Version / Crate |
Role in Unified System |
| Control Protocol |
Zod + msgpackr |
TS 5.7 · useRecords: false |
Generates 22 JSON Schemas; binary MessagePack frames <= 256 KB |
| Rust Worker Daemon |
Rust + Tokio |
Rust 1.75+ (Cargo.toml) |
Async tokio-tungstenite WS client, supervision, zero-overhead parallelism |
| Rust Serialization |
serde + rmp-serde |
to_vec_named / from_slice |
Byte-identical MsgPack map compatibility verified via golden fixtures |
| WASM Isolation |
Wasmtime WASI |
Wasmtime 36 |
Fuel metering, StoreLimits, epoch preemption, /input RO & /output RW |
| Hardware Telemetry |
sysinfo + nvidia-smi |
Cross-platform |
CPU/RAM/CUDA/ROCm/Metal discovery + host iGPU/dGPU/Wi-Fi/Disk counters |
| Coordinator |
Node + ws + SQLite |
Node 20+ · better-sqlite3 · Pino |
Stateful room, scheduler, work-stealing, artifact store, and WAL persistence |
| Python Runtime |
NumPy + cloudpickle |
Python 3.11+ · NumPy 1.24+ |
Closure serialization, @remote decorator, .npy row-block aggregation |
| Artifact Transport |
reqwest + Node HTTP |
Chunked + Range + SHA-256 |
Resumable artifact transfers + LRU worker cache (--cache-max-mb) |
2. Web, Desktop, Mobile & DevOps Stack
| Category |
Technology |
Role |
| Web Control Plane |
Next.js 14 + Recharts + GSAP + Lenis |
Landing /, /#download, /how-it-works, /animated-explainer, /dashboard, SEO (:3000) |
| Auth & Account Server |
Express + MongoDB + TOTP + Resend |
Registration, email OTP, TOTP 2FA, backup codes, saved rooms, newsletter (:8000) |
| Terminal UI |
Ink v5 + React 18 |
Keyboard-driven 5-tab console, QR onboarding, daemon tuner, log bridge |
| Standard Remote-Dots |
RustDesk (Rust + Flutter) |
60fps P2P hardware-encoded Windows & Android remote desktop (v1.5.3) |
| RemoteDots AI |
Tauri 2 + Python + Expo SDK 55 |
Autonomous AI workstation execution, WebRTC + Tunnel, and virtual joystick (0.1.0-alpha.*) |
| Workspace & CI/CD |
pnpm + Cargo + Actions + LFS |
Unified multi-language build, parallel test matrix, and binary release storage |
3. Monorepo Directory Map
sharedots/
├── .github/workflows/ci.yml # 3-job CI matrix (TS+Python, Rust, E2E + multi-OS daemon builds)
├── .gitattributes # Git LFS rules for *.apk, *.exe, and *.zip
├── Cargo.toml / Cargo.lock # Rust workspace root (sharedots-daemon)
├── package.json / pnpm-workspace.yaml # pnpm monorepo scripts & workspace links
├── docker-compose.yml # Containerized multi-service orchestration
│
├── apps/
│ ├── coordinator/ # Node.js Coordinator (:4000 · SQLite WAL · work-stealing · artifacts)
│ ├── web-frontend/ # Next.js 14 Control Plane (:3000 · dashboard · 3D mesh · SEO · /downloads)
│ ├── web-backend/ # Express Auth & Account Server (:8000 · MongoDB · JWT · TOTP 2FA)
│ ├── tui/ # Ink v5 Terminal UI (Tabs 1–5 · Tailscale · daemon tuner · logs)
│ └── desktop/ # Tauri desktop control shell
│
├── crates/
│ └── sharedots-daemon/ # Rust worker binary (tokio · wasmtime · sysinfo · reqwest)
│
├── engines/
│ ├── python/ # Python/NumPy subprocess executor + RSS watchdog (active)
│ ├── wasm/ # Wasmtime WASI fuel-metered sandbox executor (active)
│ ├── container/ # OCI Docker/Podman isolated executor (active)
│ ├── gpu/ # CUDA / ROCm / Metal dispatch adapter (M11)
│ └── ml/ # PyTorch / TensorFlow / JAX distributed ML adapters (M12)
│
├── packages/
│ ├── protocol/ # Zod schemas -> 22 JSON Schemas · MsgPack golden fixtures · HMAC
│ ├── presets/ # Shared workload scripts & cross-platform path resolvers
│ ├── sdk/ # TypeScript SDK (sharedots)
│ ├── cli/ # sharedots CLI + fallback node-worker
│ └── sdk-python/ # Python SDK (@client.remote · .map() · .local() · gather)
│
├── services/
│ ├── rustdesk/ # Standard Remote-Dots P2P desktop & Android source (v1.5.3)
│ └── remotedots-ai/ # RemoteDots AI (server, cli-proxy, Tauri desktop, Expo mobile)
│
├── compiled_apps/ # Git LFS compiled .exe, .apk, .zip + SHA256SUMS.txt
├── examples/ # Runnable workloads (hello-compute, matmul, parallel, @remote, WASI, video, ML specs)
├── scripts/ # bench/, e2e.sh, simulate_cluster.py, run-tests-parallel.mjs
└── docs/ # Technical dossier (01_GETTING_STARTED.md .. 22_SEO.md) + assets/
🧬 Benchmarks, Testing & CI/CD
1. Honest Distributed Benchmark (2048 × 2048 float32 Matrix Multiplication)
Measured on a single physical host (2 workers · 4 row-block partitions), including full HTTP artifact upload/download, SHA-256 verification, subprocess spawn, and .npy aggregation. Multi-machine clusters amortize transfer overhead across larger compute/ML workloads.
| Metric |
Measured Result |
Notes |
| Single-machine NumPy baseline |
62.6 ms |
Local in-process np.dot reference |
| Coordinator job execution window |
875 ms |
Active distributed compute + aggregation window |
| Distributed wall-clock end-to-end |
1,591 ms |
Full client submit -> partition -> gather -> result |
| Artifact transfer overhead |
1,815 ms |
Cumulative chunked HTTP upload/download + SHA-256 checks |
Numerical equivalence (np.allclose) |
✅ Verified |
Max absolute error: 1.07 × 10⁻⁴ |
2. Automated Verification Matrix
| Suite / Workspace |
Command |
Scope Covered |
Status |
Protocol, Coordinator, TUI, CLI |
pnpm -r test |
MessagePack golden fixtures, Zod schemas, work-stealing, lease watchdog, TUI tabs, CLI flags (122+ tests across 18 files) |
 |
Web Control Plane (:3000) |
pnpm --filter @sharedots/web-frontend test + build |
12 Vitest files (37 tests) covering routes, coordinator proxy, install scripts, notifications, plus 22-route next build |
 |
Auth & 2FA Backend (:8000) |
pnpm --dir apps/web-backend exec tsc --noEmit |
Full TypeScript verification across JWT, TOTP MFA, MongoDB models, Resend mailers, and room bookmarks |
 |
Python @remote SDK |
python -m pytest |
5 test files, 24 tests covering cloudpickle serialization, .map(), .local(), gather(), and fault tolerance |
 |
Rust Worker Daemon |
cargo test --manifest-path Cargo.toml |
6 unit/integration tests including MsgPack wire parity and Wasmtime WASI fuel-trap execution |
 |
Full 8-Step E2E Acceptance |
bash ./scripts/e2e.sh |
Boots Coordinator + 2 Rust daemons, verifies 2048² matmul, SIGKILL worker-loss recovery, and 25 ms WASI WASM job |
 |
3. CI/CD Pipeline (.github/workflows/ci.yml)
flowchart LR
PUSH["Push / PR to main"] --> TS["Job 1: TypeScript & Python\npnpm build + Vitest + pytest"]
PUSH --> RS["Job 2: Rust Daemon\ncargo test"]
TS & RS --> E2E["Job 3: E2E Acceptance\n8-Step Cluster + SIGKILL + WASM"]
E2E --> REL["Release Matrix\nUbuntu · macOS · Windows Binaries"]
🔧 Configuration, Deployment & Quick Start
1. Environment Variables
Coordinator (apps/coordinator)
| Variable |
Default |
Purpose |
PORT / HOST |
4000 / 0.0.0.0 |
HTTP REST + WebSocket bind port and address |
SHAREDOTS_DATA_DIR |
.sharedots/coordinator |
SQLite WAL database and artifact storage directory |
SHAREDOTS_HEARTBEAT_TIMEOUT_MS |
15000 |
Worker eviction timeout in milliseconds |
SHAREDOTS_ARTIFACT_TTL_MS |
86400000 |
Automatic artifact eviction TTL (24h) |
SHAREDOTS_API_KEY |
(optional) |
Global API key protecting read/management endpoints |
SHAREDOTS_TLS_CERT / SHAREDOTS_TLS_KEY |
(optional) |
TLS certificate and private key paths for HTTPS/WSS |
Rust Worker Daemon (crates/sharedots-daemon)
| Variable |
Default |
Purpose |
SHAREDOTS_COORDINATOR |
http://localhost:4000 |
Coordinator base URL |
SHAREDOTS_ROOM_ID / SHAREDOTS_TOKEN |
(required) |
Target compute room ID and HMAC secret |
SHAREDOTS_CPU_LIMIT |
(all cores) |
Maximum CPU contribution percentage (1–100) |
SHAREDOTS_MEMORY_LIMIT |
(all RAM) |
Maximum RAM contribution in MiB |
SHAREDOTS_CACHE_MAX_MB |
2048 |
Local SHA-256 LRU artifact cache ceiling in MiB |
SHAREDOTS_GPU / SHAREDOTS_HEARTBEAT_SEC |
false / 5 |
Opt-in GPU contribution flag and heartbeat cadence |
Auth Backend (apps/web-backend/.env) & Web Frontend (apps/web-frontend)
| Variable |
Service |
Purpose |
PORT / MONGO_URI / APP_ORIGIN |
Auth Backend (:8000) |
Express port, MongoDB Atlas URI, and CORS origin (http://localhost:3000) |
JWT_SECRET / JWT_REFRESH_SECRET |
Auth Backend (:8000) |
Access (15m) and Refresh (30d) JWT signing secrets |
RESEND_API_KEY / MAILER_SENDER |
Auth Backend (:8000) |
Resend transactional OTP and newsletter email delivery |
NEXT_PUBLIC_COORDINATOR_URL / NEXT_PUBLIC_SITE_URL |
Web Frontend (:3000) |
Target Coordinator (https://sharedots.onrender.com or :4000) and canonical SEO URL |
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION |
Web Frontend (:3000) |
Optional Google Search Console <meta> verification token |
2. Local Development Quick Start
# 1. Clone (with Git LFS for compiled_apps/) & install workspace dependencies
git lfs install
git clone https://github.com/Mausam5055/sharedots.git && cd sharedots
pnpm install && pnpm -r build
pip install numpy cloudpickle
cargo build --release --manifest-path Cargo.toml
# 2. Launch services in separate terminals
pnpm coordinator:dev # Coordinator Control Plane -> http://localhost:4000
pnpm --dir apps/web-backend dev # Auth & 2FA Backend -> http://localhost:8000
pnpm dashboard:dev # Web Control Plane -> http://localhost:3000
pnpm --filter @sharedots/tui dev # Ink v5 Terminal UI (press [w] to open pre-auth dashboard)
3. Docker Compose & Multi-Device Tailscale Mesh
# Containerized local stack
docker compose up -d
# Multi-device LAN / Tailscale worker join (from any second laptop or cloud VM)
sharedots join sd_join_<INVITE_CODE> --cpu-limit 75 --memory-limit 8192
See docs/01_GETTING_STARTED.md, docs/03_HOSTED_VS_LOCAL.md, and docs/04_MULTI_DEVICE.md for hosted Render vs. local Coordinator workflows and Tailscale peer diagnostics.
🕸️ Distributed ML Topologies & Workload Catalog
Sharedots is engineered from the ground up to pool CPU, RAM, and GPU capacity across heterogeneous machines for numerical computing and distributed machine learning workflows. Rather than forcing users onto expensive homogeneous cloud clusters, the Coordinator partitions tensors, batches, and hyperparameter sweeps across every online device in a Compute Room.
1. Distributed ML Parallelism Strategies
flowchart LR
subgraph DP["Data-Parallel Training (All-Reduce / Map-Gather)"]
D0["Dataset / Tensor Shards"] --> W_A["Node 1: Batch 0..K"]
D0 --> W_B["Node 2: Batch K..2K"]
W_A & W_B --> SYNC["Coordinator Aggregation\nWeights / Metrics / .npy"]
end
subgraph PP["Pipeline / Model Parallelism (M12 Adapter)"]
L0["Input Batch"] --> S0["Worker 1: Layers 0..N"]
S0 -->|"Chunked Artifact"| S1["Worker 2: Layers N..M"]
S1 --> OUT["Loss / Checkpoints"]
end
| Parallelism Pattern |
Current Support |
Execution Mechanism |
Primary Artifacts |
| Sharded Tensor & Matrix Compute |
✅ Active |
row_partition splits rows across workers; pure-TS npy.ts concatenates .npy v1/v2/v3 buffers vertically on the Coordinator without spawning Python |
*.npy input matrices & row-block shards |
| Embarrassingly Parallel Sweeps & Batches |
✅ Active |
@client.remote.map() + sd.gather() serializes Python functions with cloudpickle and steals micro-chunks across heterogeneous nodes |
cloudpickle closures, JSON metrics, output files |
| Data-Parallel ML Training |
🚧 Adapter (M12) |
engines/ml/pytorch & engines/ml/tensorflow ("strategy": "data-parallel", "workers": "auto") coordinate multi-worker dataset shards (examples/pytorch-training/job.json) |
Model checkpoints, gradient tensors |
| Model & Pipeline Parallelism |
🚧 Adapter (M12) |
PyTorchExecutor planned strategies (model-parallel, pipeline-parallel) split oversized neural layers across pooled RAM/VRAM machines |
Intermediate layer activations via ArtifactStore |
| SPMD Array Compute |
🚧 Adapter (M12) |
JaxExecutor structured interface for sharded multi-host array transformations (engines/ml/jax/index.ts) |
Sharded array buffers |
2. Pure-TypeScript .npy Tensor Aggregation Pipeline (apps/coordinator/src/jobs/npy.ts)
flowchart LR
T0["Shard 0 (.npy)\nRows 0..511"] --> PARSE["parseNpy() Magic + Header\ndtype · fortran_order · shape"]
T1["Shard 1 (.npy)\nRows 512..1023"] --> PARSE
TN["Shard K (.npy)\nRows ...2047"] --> PARSE
PARSE --> VERIFY["Validate matching dtype\nand trailing column dimensions"]
VERIFY --> CONCAT["Buffer.concat() Raw Row Bytes\nencodeNpy() 64-byte aligned header"]
CONCAT --> ART["Store Final Tensor in ArtifactStore\nSHA-256 Verified"]
| Aggregation Step |
Implementation Detail |
Performance & Safety Benefit |
| Header Inspection |
Parses \x93NUMPY magic + v1/v2/v3 header length + 'descr', 'fortran_order', 'shape' |
Zero Python interpreter startup cost on the Coordinator (apps/coordinator) |
| Dimension & Dtype Guard |
Verifies identical descr (e.g. <f4) and non-batch axes across all completed task shards |
Prevents silent tensor corruption if a shard writes mismatched precision |
| 64-Byte Aligned Preamble |
encodeNpy() pads preamble (10 + headerLen) to a 64-byte boundary |
Guarantees SIMD/NumPy memory alignment on downstream client reads |
3. Runnable Examples & Workload Catalog (examples/)
| Example Directory |
Runtime |
Strategy / Focus |
Files & Entrypoint |
examples/hello-compute |
python |
Minimal declarative job.json execution and stdout artifact capture |
job.json, task.py |
examples/matrix-multiplication |
python |
2048 × 2048 float32 row_partition distributed matmul verified against NumPy np.allclose |
prepare_and_verify.py, run.mjs |
examples/parallel-processing |
python |
Sharded batch execution with mid-flight SIGKILL worker termination and automatic recovery |
batch_task.py, worker_loss_test.mjs |
examples/remote-decorator |
python |
Python @client.remote, .map(), .local(), SharedotsFuture, and sd.gather() |
demo.py, README.md |
examples/wasm-compute |
wasm |
Deterministic Wasmtime WASI sandbox execution with fuel metering (sandbox_demo.wat) |
run.mjs, sandbox_demo.wat |
examples/video-rendering |
python |
Distributed multi-frame batch rendering across pooled cluster nodes |
job.json, render_frame_batch.py |
examples/pytorch-training |
pytorch |
Declarative PyTorch DDP training spec (data-parallel, cpu: 4, memory: 8GB, gpu: required) |
job.json |
examples/tensorflow-training |
tensorflow |
Declarative TensorFlow MultiWorkerMirroredStrategy training spec (data-parallel, CUDA) |
job.json |
examples/heavy_stress_bench.py |
python |
Sustained multi-worker stress and throughput benchmark script |
heavy_stress_bench.py |
⚙️ Rust Daemon Internals & Sandbox Isolation
The Rust Worker Daemon (crates/sharedots-daemon) is a single compiled native binary designed for minimal idle footprint (~10–15 MB RSS), deterministic cross-language protocol parity, and strict sandboxing of remote workloads.
1. Rust Crate Module Map (crates/sharedots-daemon/src/)
| Module Path |
Responsibility |
Key Capabilities |
main.rs & lib.rs |
Binary entrypoint & crate exports |
CLI argument parsing (--coordinator, --room-id, --token, --cpu-limit, --memory-limit, --cache-max-mb, --gpu) |
daemon/lifecycle.rs |
Connection & reconnect loop |
WebSocket handshake, room registration, exponential backoff + jitter reconnect, clean SIGTERM drain |
daemon/task_runner.rs |
Task lifecycle supervisor |
Verifies HMAC manifest signature, fetches inputs, invokes executor, streams logs, uploads outputs |
supervisor.rs |
Subprocess & tree supervision |
Enforces task timeouts, kills entire OS process tree on job.cancel, scrubs environment variables |
hardware/mod.rs |
Cross-platform hardware probe |
sysinfo CPU/RAM census, nvidia-smi CUDA detection, ROCm/Metal probes, Python + NumPy version pinning |
monitoring/mod.rs |
Live telemetry collector |
Samples host CPU load, free memory, GPU stats, and uptime for 5s worker.heartbeat frames |
networking/mod.rs |
MsgPack WebSocket transport |
tokio-tungstenite async frame reader/writer enforcing 262,144 byte (256 KB) frame limit |
networking/artifacts.rs |
HTTP artifact client & LRU cache |
reqwest chunked upload/download, Range resume, SHA-256 verification, --cache-max-mb eviction |
protocol/crypto.rs |
Cryptographic verification |
Byte-exact HMAC-SHA256 request signing and canonical task manifest verification |
protocol/envelope.rs & messages.rs |
Wire structs & MsgPack codecs |
rmp_serde::to_vec_named structs matching packages/protocol/fixtures/*.msgpack |
executor/python.rs |
Python/NumPy executor |
Spawns pinned interpreter with RLIMIT_AS / RSS memory watchdog and stdout/stderr streaming |
executor/wasm.rs |
Wasmtime WASI executor |
Fuel-metered WASM sandbox with epoch interruption and strict preopened /input (RO) & /output (RW) |
executor/container.rs |
OCI container executor |
Detects docker / podman + NVIDIA Container Toolkit; executes isolated --network=none workloads |
executor/gpu.rs |
GPU adapter scaffold |
Interfaces with CUDA/ROCm/Metal discovery metadata for M11 kernel execution |
2. Multi-Layer Sandbox & Trust Boundary
flowchart TD
IN["Signed TASK_ASSIGN Frame"] --> SIG{"1. HMAC-SHA256\nManifest Valid?"}
SIG -->|"Invalid"| REJ["Reject Task & Emit Error"]
SIG -->|"Valid"| GUARD{"2. Resource Guard\nCPU & RAM Within Caps?"}
GUARD -->|"Exceeded"| REJ
GUARD -->|"Within Caps"| ART["3. SHA-256 Artifact Check\nLRU Cache or HTTP Range Pull"]
ART --> RUN{"4. Isolated Runtime"}
RUN -->|"Python"| PY["Scrubbed Env + RLIMIT_AS\n+ Process-Group Watchdog"]
RUN -->|"WASM"| WASM["Wasmtime WASI + Fuel Meter\n+ Epoch Preemption + RO /input"]
RUN -->|"OCI"| OCI["Docker / Podman --network=none\n+ CPU/RAM cgroup limits"]
| Sandbox Runtime |
CPU / Compute Cap |
Memory Cap |
Filesystem & Network Isolation |
Wasmtime WASI (wasm) |
Deterministic fuel metering + epoch preemption timer |
StoreLimits linear memory ceiling |
Only /input (read-only) and /output (read-write) preopened; zero network sockets |
Python Subprocess (python) |
Assigned core allocation + task timeout wall-clock guard |
Unix RLIMIT_AS + cross-platform RSS watchdog loop |
Isolated task scratch working directory; scrubbed environment variables |
OCI Container (container) |
--cpus container quota |
--memory cgroup hard limit |
--network=none, ephemeral container root, explicit bind mounts only |
🧭 Coordinator & Auth Backend Internals
1. Coordinator Subsystems (apps/coordinator/src/)
| Subsystem |
Source Path |
Core Responsibility |
| Server & WS Transport |
server.ts, transport/ws-server.ts |
Boots HTTP + WebSocket (/ws) server on :4000, validates HMAC upgrades, enforces 256 KB frame cap |
| HTTP Router & Responder |
http/router.ts, http/responder.ts, http/routes/* |
CORS headers, optional SHAREDOTS_API_KEY guard, HMAC room verification, JSON/streaming error handling |
| Room Manager |
rooms/room-manager.ts |
Creates rooms with cryptographic random secrets and persists room records to SQLite |
| Worker Registry |
workers/worker-registry.ts |
Tracks live worker capabilities, heartbeats, systemTelemetry, and 15s timeout eviction |
| Scheduler & Work-Stealing |
scheduler/scheduler.ts, scheduler/work-stealing-queue.ts |
Deterministic capacity reservation, reliability scoring, and dynamic task.pull micro-chunking |
| Lease Manager |
jobs/lease-manager.ts |
Enforces maxExpiresAt anti-hoarding leases and triggers shard reclamation on stalled workers |
| Job & Task Dispatcher |
jobs/job-manager.ts, jobs/task-dispatcher.ts, jobs/result-aggregator.ts |
Partitions jobs, dispatches signed manifests, handles SIGKILL retries, and aggregates .npy/JSON outputs |
| Artifact Store |
artifacts/artifact-store.ts |
Stores room-scoped artifacts on disk with chunked upload assembly, Range resume, SHA-256 checks, and TTL GC |
| Daemon Log Store |
logs/daemon-log-store.ts |
Buffers /api/daemon-logs entries from TUI/daemons for unified observability in >_ Logs |
2. Auth Backend Middleware & Security Stack (apps/web-backend/src/)
| Layer |
Implementation |
Security & Operational Behavior |
| Proxy Trust & CORS |
app.set("trust proxy", 1) + cors({ origin: APP_ORIGIN, credentials: true }) |
Supports reverse-proxied Render/Vercel HTTPS cookies while restricting cross-origin access to APP_ORIGIN |
| Password Hashing |
bcrypt Mongoose pre-save hook (user.model.ts) |
Automatically hashes passwords on creation/change; toJSON strips password, TOTP secret, and backup codes |
| JWT Strategy |
common/strategies/jwt.strategy.ts + cookie-parser |
Dual-token flow: short-lived accessToken (15m) + rotating refreshToken (30d) in HttpOnly cookies |
| TOTP 2FA & Recovery |
speakeasy + modules/mfa/mfa.service.ts |
RFC 6238 6-digit authenticator setup with single-use hashed backup codes and remote MFA revocation |
| Input Validation |
Zod schemas (auth.validator.ts, mfa.validator.ts, workspace.routes.ts) |
Strict request payload validation before database or mailer execution |
| Error Normalization |
middlewares/asyncHandler.ts, middlewares/errorHandler.ts, AppError.ts |
Unified HTTP status codes and structured JSON errors without leaking stack traces in production |
🛠️ Operational Runbooks & Troubleshooting
| Symptom / Scenario |
Root Cause |
Exact Resolution |
Workers vanish on sharedots.onrender.com |
Hosted Render free-tier container sleeps or restarts after idle windows, resetting ephemeral container state |
Run a persistent local Coordinator (pnpm coordinator:dev on :4000) for live demos or mount persistent disk storage on Render (docs/03_HOSTED_VS_LOCAL.md) |
Dashboard shows No node connected / hides GPU & Wi-Fi charts |
Truthful telemetry safeguard hides host charts when 0 workers are online or selected worker is on a different host |
Start a local worker (sharedots worker start) or click Join / Start Worker inside /dashboard |
Judge Bypass vs. real account mismatch |
Judge Bypass sets a client judgeMode=1 cookie isolated from MongoDB sessions |
Click Sign in inside /dashboard to clear judgeMode=1 and authenticate with your real MongoDB account + 2FA (docs/15_TROUBLESHOOTING.md) |
| Worker stuck in reconnect backoff loop |
Stale worker-config.json pointing to an expired room or orphaned background sharedots-daemon PID |
Run sharedots worker stop, delete stale config or re-run sharedots join <NEW_CODE>, and tail logs with sharedots worker logs |
| Cross-laptop join fails over LAN/Internet |
Firewall blocking :4000 or NAT traversal needed between machines |
Install Tailscale on participating hosts and pass the Tailscale MagicDNS / 100.x.y.z Coordinator URL to sharedots join (docs/04_MULTI_DEVICE.md) |
Android APK build fails on Windows (> 260 char CMake path) |
Deep repository path exceeds Windows Ninja/CMake path limit |
Map a short drive junction (e.g. D:\m) with JDK 17 and NDK 27.1.12297006 per docs/10_REMOTEDOTS_AI_GUIDE.md |
Git clone shows tiny 130-byte files in compiled_apps/ |
Git LFS was not initialized before cloning |
Run git lfs install && git lfs pull inside the repository root to fetch the full .exe, .apk, and .zip binaries |
📜 Protocol JSON Schemas & Golden Fixtures
Every wire message between TypeScript (msgpackr) and Rust (rmp-serde) is compiled from Zod schemas into 22 canonical JSON Schemas under packages/protocol/schema/ and regression-tested against 13 binary/JSON fixtures under packages/protocol/fixtures/.
1. All 22 Generated JSON Schemas (packages/protocol/schema/)
| Schema File |
Message / Entity |
Role in Wire Contract |
message-envelope.schema.json |
Envelope v1 |
Canonical frame wrapper (v, id, ts, from, type, payload) |
job-spec.schema.json |
JobSpec |
Declarative distributed compute or ML job specification (runtime, execution, resources, timeoutSec) |
task-manifest.schema.json |
TaskManifest |
HMAC-signed per-shard execution contract verified by Rust daemons before spawn |
worker-capabilities.schema.json |
WorkerCapabilities |
Advertised CPU cores, RAM, GPU devices, Python/NumPy pins, and supported runtimes |
payload-worker-register.schema.json |
worker.register |
Initial daemon registration payload with hostname, OS/arch, and capabilities |
payload-worker-heartbeat.schema.json |
worker.heartbeat |
5s liveness heartbeat + optional systemTelemetry (processes, services, GPU, Wi-Fi, disk) |
payload-worker-status.schema.json |
worker.status |
Explicit worker state transition (online, busy, offline) |
payload-job-submit.schema.json |
job.submit |
Client job submission envelope with artifact references and partitioning strategy |
payload-job-accepted.schema.json |
job.accepted |
Coordinator acknowledgement returning jobId and initial shard count |
payload-job-cancel.schema.json |
job.cancel |
Cancellation signal propagating down to worker process-group termination |
payload-job-completed.schema.json |
job.completed |
Terminal job summary with aggregated output artifact references and duration |
payload-job-failed.schema.json |
job.failed |
Terminal job failure payload with structured errorCode and diagnostic message |
payload-job-log.schema.json |
job.log |
Multiplexed stdout/stderr log line event emitted from worker task runners |
payload-task-assign.schema.json |
task.assign |
Coordinator -> Worker shard dispatch carrying signed manifest + maxExpiresAt lease |
payload-task-started.schema.json |
task.started |
Worker acknowledgement that isolated runtime process has spawned |
payload-task-progress.schema.json |
task.progress |
Intra-shard progress update renewing lease watchdog window |
payload-task-completed.schema.json |
task.completed |
Shard completion with output artifact ref + downloadMs / computeMs / uploadMs |
payload-task-failed.schema.json |
task.failed |
Shard failure (retryable flag, exit code, error message) triggering scheduler release/retry |
payload-artifact-request.schema.json |
artifact.request |
Control-plane artifact metadata lookup request |
payload-artifact-response.schema.json |
artifact.response |
Artifact metadata, SHA-256 digest, and HTTP fetch coordinates |
payload-ack.schema.json |
ack |
Generic frame delivery acknowledgement referencing ackId |
payload-error.schema.json |
error |
Protocol error frame (UNSUPPORTED_PROTOCOL_VERSION, FRAME_TOO_LARGE, AUTH_FAILED) |
2. Cross-Language Golden Fixtures (packages/protocol/fixtures/)
| Fixture Pair |
Verified Language Parity |
Assertion Scope |
envelope-register.{json,msgpack} |
Vitest (msgpackr) ↔ Cargo (rmp-serde) |
Exact map key ordering and WorkerCapabilities round-trip |
envelope-heartbeat.{json,msgpack} |
Vitest ↔ Cargo |
Periodic heartbeat + systemTelemetry serialization |
envelope-task-assign.{json,msgpack} |
Vitest ↔ Cargo |
Signed TaskManifest binary decoding in Rust |
envelope-task-completed.{json,msgpack} |
Vitest ↔ Cargo |
Timing metrics (downloadMs, computeMs, uploadMs) parity |
envelope-ack.{json,msgpack} |
Vitest ↔ Cargo |
Minimal control acknowledgement frame |
envelope-error.{json,msgpack} |
Vitest ↔ Cargo |
Structured protocol error deserialization |
crypto-vectors.json |
Vitest ↔ Cargo (protocol/crypto.rs) |
Byte-identical HMAC-SHA256 request & manifest signatures |
📱 RemoteDots AI Agent Tools & Mobile Specs
1. 33 Autonomous Agent Tool Categories
| Domain |
Capabilities |
Safety & Grounding Controls |
| Shell & Terminal |
Execute PowerShell/Bash commands, install packages, run builds, inspect logs |
Risky commands pause for Dual-Tool Safety Evaluator approval; sensitive env vars redacted; stalled commands auto-timed out |
| GUI Screen Control |
Capture live desktop state, detect clickable widgets, dispatch mouse move/click/drag/scroll/keyboard |
Supports OmniParser + PyAutoGUI (local), Gemini Computer Use, Accessibility Tree, or OpenRouter vision |
| Browser Automation (PinchTab) |
Launch & drive Chrome sessions (pinchtab.exe), navigate pages, inspect DOM, fill forms |
Runs as bundled Tauri resource (src-tauri/resources/pinchtab.exe) |
| Filesystem & Documents |
Read/edit source code, PDFs, images, spreadsheets, and Office documents |
Integrated with office-documents skill and undo history for reversible CLI/GUI operations |
| Window & Device Control |
Focus/resize desktop windows, monitor processes, toggle Keep Awake, trigger PIN-locked Away Mode |
Away Mode locks physical monitor behind a PIN privacy overlay while phone session continues |
| Skills & Workflows |
Load and execute reusable Markdown/Python skills (ide-chat, web-research, office-documents, cli-command-patterns) |
Managed in Desktop Skills tab; invoked automatically via voice or text |
2. Mobile Screen Layouts & Joystick Controls (remotedots-ai-mobile)
| Mode / Control |
Behavior |
Target Use Case |
Portrait: Split View / Video Focus / Thread Focus |
Balances live WebRTC desktop feed against AI chat/voice thread |
Prompting, reviewing Dual-Tool safety approvals, and monitoring builds |
Landscape: Side-by-Side / Fullscreen Video |
Maximizes 60fps desktop stream with floating HUD pill (Ready / Manual / Mic) |
Hands-on workstation operation and multi-window navigation |
| Zoom & Pan |
Two-finger pinch up to 3× fill scale, single-finger drag, double-tap reset |
Inspecting dense terminal logs or small IDE text on mobile screens |
Virtual Joystick (Manual) |
Bottom-left thumbstick (~30 fps cursor), L tap/hold-drag, R right-click, ▲/▼ scroll (250 ms hold repeats every 80 ms) |
Direct precision manipulation without a physical mouse |
| Quick Shortcut Strip |
Swipeable bar: Esc, Tab, Enter, Bksp, Del, Ctrl+C, Ctrl+V, Ctrl+Z, Ctrl+S, arrow keys |
Instant IDE and shell keyboard navigation from landscape overlay |
📁 Workspace Packages, Scripts & Port Matrix
1. Complete Workspace Inventory
| Workspace / Package |
Path |
Language |
Build / Entrypoint |
@sharedots/protocol |
packages/protocol |
 |
tsup + generate:schema + generate:fixtures |
@sharedots/presets |
packages/presets |
 |
Shared workload templates & daemon path resolvers |
sharedots (TS SDK) |
packages/sdk |
 |
Client Sharedots, Room, Job, chunked artifact uploader |
@sharedots/cli |
packages/cli |
 |
sharedots CLI binary + Node fallback worker (node-worker.ts) |
sharedots (Python SDK) |
packages/sdk-python |
 |
pyproject.toml, @client.remote, SharedotsFuture, sd.gather() |
@sharedots/coordinator |
apps/coordinator |
 |
Node HTTP/WS server (:4000), SQLite WAL, scheduler, ArtifactStore |
@sharedots/tui |
apps/tui |
 |
5-tab Ink v5 TUI (sharedots tui) |
@sharedots/web-frontend |
apps/web-frontend |
 |
Landing, /how-it-works, /animated-explainer, /dashboard (:3000) |
apps/web-backend |
apps/web-backend |
 |
MongoDB Atlas Auth, JWT, TOTP 2FA, saved rooms (:8000) |
apps/desktop |
apps/desktop |
 |
Desktop control shell wrapper |
sharedots-daemon |
crates/sharedots-daemon |
 |
Native worker daemon (cargo build --release) |
@sharedots/engine-* |
engines/ |
 |
python, wasm, container, gpu, ml (pytorch, tensorflow, jax) |
2. Root NPM Scripts & Port Allocation
Script (package.json) |
Action |
Port Allocation Summary |
Service |
pnpm build |
Build all TS workspaces |
:3000 |
Next.js Web Control Plane (apps/web-frontend) |
pnpm test / pnpm test:all |
Run Vitest / parallel TS+Py+Rust suites |
:4000 |
Coordinator Control & Artifact Plane (apps/coordinator) |
pnpm test:python / pnpm test:rust |
Run pytest / cargo test |
:8000 |
Express Auth & 2FA Backend (apps/web-backend) |
pnpm coordinator:dev / dashboard:dev |
Start Coordinator (:4000) or Web UI (:3000) |
:3456 |
RemoteDots AI Claude CLI OAuth Proxy |
pnpm daemon:build / daemon:test |
Release-build or test Rust daemon |
:3457 |
RemoteDots AI Gemini CLI OAuth Proxy |
pnpm remote:stage |
Stage compiled Remote-Dots .exe & .apk |
:3458 |
RemoteDots AI OpenAI Codex CLI OAuth Proxy |
pnpm protocol:schema / fixtures |
Regenerate 22 JSON Schemas & MsgPack fixtures |
:1420 |
Tauri 2 Vite Dev Server (remotedots-ai-desktop) |
pnpm bench / pnpm e2e |
Run 2048² matmul benchmark / 8-step E2E suite |
— |
(Internal IPC / Tailscale / WebRTC) |
🌐 Cross-Machine Tailscale Mesh Architecture
Sharedots operates seamlessly across laptops, university labs, home workstations, and cloud instances without manual router port forwarding by pairing Room Invite Codes (sd_join_) with Tailscale WireGuard Mesh Networking.
1. Multi-Device Topology Over Tailscale & LAN
flowchart LR
subgraph HOST["Host Machine A (Coordinator + Worker 1)"]
C["Coordinator :4000"]
TS1["Tailscale Node 100.x.y.1"]
D1["Rust Daemon 1"]
D1 --> C
end
subgraph PEER1["Laptop B (Remote Contributor)"]
TS2["Tailscale Node 100.x.y.2"]
D2["Rust Daemon 2\n--cpu-limit 50 --memory-limit 4096"]
end
subgraph PEER2["Workstation C (GPU / Compute Node)"]
TS3["Tailscale Node 100.x.y.3"]
D3["Rust Daemon 3\nPython · WASI · OCI"]
end
TS2 <-->|"Encrypted WireGuard Tunnel\nMsgPack WS + HTTP Artifacts"| TS1
TS3 <-->|"Encrypted WireGuard Tunnel\nMsgPack WS + HTTP Artifacts"| TS1
2. Multi-Device Join & Diagnostics Flow
| Stage |
Command / Component |
Behavior |
| 1. Room Bootstrap |
sharedots up or sharedots room create |
Creates a room and encodes { coordinatorUrl, roomId, secret } into an sd_join_... invite & terminal QR code |
| 2. Tailscale Peer Probe |
Ink TUI Tab 1 (apps/tui) |
Queries the local Tailscale LocalAPI socket/daemon to list active mesh peers, 100.x IPv4 addresses, and WireGuard P2P latency |
| 3. Remote Join |
sharedots join sd_join_<CODE> |
Decodes coordinates, persists ~/.sharedots/worker-config.json, verifies Python/NumPy/WASI, and connects via WebSocket |
| 4. Hosted Fallback |
NEXT_PUBLIC_COORDINATOR_URL |
When devices span non-Tailscale networks, https://sharedots.onrender.com bridges rooms across public HTTPS/WSS |
🧩 Web Frontend App Router & Component Tree
flowchart TB
ROOT["RootLayout (layout.tsx)\nDM Sans · Providers · Metadata · SEO"]
ROOT --> PUB["Public Pages\n/ · /how-it-works · /animated-explainer"]
ROOT --> AUTH["Auth Group (auth)\n/login · /signup · /confirm-account\n/forgot-password · /reset-password · /verify-mfa"]
ROOT --> CTRL["Control Plane\n/dashboard · /home · /sessions · /account"]
ROOT --> BFF["Next.js BFF (/api/*)\n/host-telemetry · /local-daemon\n/local-logs · /coordinator/[...path]"]
| Route Path |
Access Mode |
Primary Feature Modules (apps/web-frontend/src/) |
/ |
Public |
Lenis smooth landing hero, #features compute overview, #platform showcase, #download edition cards, newsletter footer |
/how-it-works |
Public |
RemoteDotsAnimatedExplainer, ConnectivitySection, FeaturesSection, AgentToolsSection, ModelProvidersSection, SkillsSection, SecuritySection, UseCasesSection |
/animated-explainer |
Public |
Dedicated GSAP ScrollTrigger & Lenis interactive step-by-step RemoteDots AI walkthrough |
/login & /signin |
Public |
Email/password JWT login, OAuth entrypoints, and one-click Judge Bypass (judgeMode=1) |
/signup & /confirm-account |
Public |
Account creation with Resend email verification OTP |
/forgot-password & /reset-password |
Public |
Email token password recovery workflow |
/verify-mfa |
MFA Step |
6-digit TOTP authenticator or single-use backup code verification |
/dashboard |
Auth / Judge / Demo |
Live cluster telemetry, iGPU/dGPU/Wi-Fi/TaskMgr charts, 3D Orbital Mesh, Job Shards, Benchmarks, >_ Logs, Alerts |
/home, /account, /sessions |
Authenticated |
Account security, TOTP 2FA setup/revocation, active multi-device session revocation, saved compute rooms |
✅ End-to-End 8-Step Acceptance Pipeline
The automated acceptance suite (scripts/e2e.sh) boots a full live cluster from scratch, runs distributed numerical and sandboxed workloads across two independent Rust daemons, injects a fatal SIGKILL failure mid-execution, and verifies zero leaked reservations:
flowchart LR
S1["1. Boot Coordinator\nPort 4199 + SQLite"] --> S2["2. CLI Room Create\nHMAC Secret"]
S2 --> S3["3. Spawn 2 Rust Daemons\n--cpu-limit 50"]
S3 --> S4["4. 2048x2048 Matmul\n4 Row Partitions"]
S4 --> S5["5. Verify /api/benchmarks\nnp.allclose OK"]
S5 --> S6["6. SIGKILL Worker 2\nMid-Job Fault"]
S6 --> S7["7. Assert Recovery\nreservedCpu = 0"]
S7 --> S8["8. Wasmtime WASI\nSandboxed Job"]
| Step |
Gate Verified |
Exact Pass Condition |
| 1 |
Coordinator startup |
apps/coordinator/dist/index.js starts on 127.0.0.1:4199 with fresh SQLite DB and passes /api/health |
| 2 |
CLI room creation |
@sharedots/cli room create --json emits valid roomId and cryptographic secret |
| 3 |
Dual daemon registration |
worker-e2e-1 & worker-e2e-2 advertise real CPU cores, RAM, and python runtime within 20s |
| 4 |
Distributed 2048² matmul |
examples/matrix-multiplication/run.mjs distributes 4 partitions across both workers (--require-multi-worker) |
| 5 |
Benchmark API integrity |
/api/benchmarks returns recorded JSON with verifiedAccurate === true and matrixSize === 2048 |
| 6 |
SIGKILL worker-loss recovery |
worker_loss_test.mjs sends SIGKILL to worker-e2e-2 mid-batch; surviving worker finishes all shards |
| 7 |
Reservation release audit |
/api/overview confirms reservedCpu === 0, reservedMemoryBytes === 0, and worker-e2e-2 is offline |
| 8 |
Sandboxed WASI execution |
examples/wasm-compute/run.mjs executes Wasmtime WASI job cleanly on surviving worker-e2e-1 |
💾 Artifact Store, LRU Cache & Range Resume
Large model weights, .npy tensors, and WASM modules never travel over the WebSocket control channel. Instead, the HTTP Artifact Store (apps/coordinator/src/artifacts/artifact-store.ts) and the Rust Worker LRU Cache (crates/sharedots-daemon/src/networking/artifacts.rs) manage reliable, resumable binary distribution:
flowchart LR
UP["1. Client / Worker Upload\nPOST /artifacts/init -> PUT /chunks/:i -> finalize"] --> SHA["2. Verify SHA-256\nContent-Addressed Disk Store"]
SHA --> FETCH["3. Worker Pull\nCheck Local LRU (--cache-max-mb)"]
FETCH -->|"Cache Hit"| EXEC["4. Mount Read-Only Input\nto Python / WASI / OCI"]
FETCH -->|"Cache Miss or Partial"| RNG["GET /artifacts/:id\nHTTP Range Resume"] --> EXEC
| Artifact Layer |
Mechanism |
Guarantee |
| Chunked Upload |
init -> PUT /chunks/:idx (x-chunk-sha256) -> finalize |
Supports large dataset/weight uploads without buffering full payloads in RAM |
HTTP Range Resume |
GET /api/artifacts/:id with Range: bytes=... |
Workers resume interrupted downloads mid-stream across unstable Wi-Fi/WAN links |
| Worker LRU Cache |
SHA-256 keyed directory bounded by --cache-max-mb (2048 MiB default) |
Eliminates redundant network transfers across repeated epochs and multi-shard jobs |
| Coordinator TTL GC |
SHAREDOTS_ARTIFACT_TTL_MS (86400000 ms / 24h) |
Automatically reclaims expired job artifacts from Coordinator disk storage |
🎛️ Mobile AI Settings & Subscription Routing
The RemoteDots AI Android app pairs dual-model routing (Conversation Model + Execution Model) with local desktop CLI Subscription Mode (SUB), allowing operators to drive desktop coding, vision grounding, and voice commands using existing ChatGPT Plus/Pro, Claude Pro/Max, or Gemini Advanced logins:
Mobile Settings: Dual SUB Model Selector, Vision Grounding, STT, and Desktop CLI Proxy Toggles
|
Dual-Model & Grounding Matrix
| Setting |
Active Options |
Behavior |
| Conversation Model |
Gemini 2.5/3 Flash, Claude, GPT-5.4 Mini |
Fast natural-language chat & voice response routing |
| Execution Model |
Claude Sonnet/Opus 4.6, GPT-5.4, Gemini Pro |
High-reasoning desktop CLI/GUI planning; shows NO VISION over text-only CLI proxy |
| Computer Use Backend |
Accessibility Tree + UI-TARS, OmniParser + PyAutoGUI, Gemini Computer Use, OpenRouter Vision |
Supplies visual/UI grounding whenever Execution Model operates in NO VISION mode |
| Speech-to-Text |
Gemini, OpenAI Whisper, OpenRouter, Disabled |
Transcribes mobile microphone audio directly into agent prompts |
| Subscription Toggles |
Gemini (:3457), Anthropic (:3456), OpenAI Codex (:3458) |
Connects live to remotedots-ai-cli-proxy ports with green health dot & instant refresh |
|
🛡️ Audit Scorecard & Production Hardening
Verified against docs/19_AUDIT_1.md and docs/11_SECURITY.md:
| Subsystem / Gate |
Verification Status |
Hardening Notes for Public Deployment |
| Protocol, Scheduler & CLI/TUI |
✅ Verified |
Zod + MessagePack golden parity, deterministic work-stealing, anti-hoarding maxExpiresAt leases, HMAC-SHA256 signing |
Next.js Control Plane (:3000) |
✅ Verified |
3-way isolated sessions (User / Judge / Guest), truthful disconnect cache-wipe, next build (22 routes) |
Auth & 2FA Backend (:8000) |
✅ Verified |
Express + MongoDB Atlas, bcrypt hashing, rotating 15m/30d JWT cookies, speakeasy TOTP 2FA + backup codes |
| Coordinator API Protection |
⚙️ Configurable |
Enable SHAREDOTS_API_KEY and SHAREDOTS_TLS_CERT/KEY when exposing :4000 outside trusted LAN/Tailscale |
| Coordinator Proxy Allowlist |
⚙️ Configurable |
Restrict x-sharedots-coordinator upstream targets to HTTPS allowlisted hosts in multi-tenant production |
| Secret & Credential Hygiene |
🔒 Required |
Keep .env files untracked; rotate any pre-production MongoDB/Resend credentials before public release |
📄 Declarative JobSpec v1 Contract
Every distributed job — whether submitted via CLI (sharedots job submit), TypeScript SDK, or Python @client.remote — normalizes to the validated job-spec.schema.json contract:
1. Schema Field & Enum Matrix
| Field Path |
Type / Allowed Values |
Default |
Description |
specVersion |
1 (const) |
1 |
Major job specification contract version |
name |
string (minLength: 1) |
(required) |
Human-readable workload identifier |
runtime |
python | container | wasm | gpu | pytorch | tensorflow | jax |
(required) |
Target worker execution engine |
execution.strategy |
task-parallel | remote | data-parallel | model-parallel | pipeline-parallel |
(required) |
Partitioning and parallel orchestration strategy |
execution.workers |
"auto" | positive integer |
"auto" |
Target worker pool count |
execution.partitions |
positive integer |
(optional) |
Explicit shard / row-block partition count |
resources.cpu |
positive number |
1 |
Logical CPU cores reserved per task shard |
resources.memory |
bytes int | "512MB" / "8GB" / "2GiB" |
"512MB" |
RAM cap enforced by scheduler reservation & daemon RSS guard |
resources.gpu |
none | optional | required |
"none" |
GPU scheduling constraint |
resources.gpuBackend |
string (e.g. "cuda") |
(optional) |
Required GPU acceleration backend |
resources.gpuMemoryBytes |
positive integer |
(optional) |
Minimum free VRAM required per shard |
timeoutSec |
positive integer |
600 |
Wall-clock task timeout before OS process-tree termination |
retry.maxAttempts |
integer (1..20) |
3 |
Maximum automatic re-queue attempts on retryable failure or SIGKILL |
entrypoint |
string |
(optional) |
Entrypoint script (task.py, train.py) or WASM/container target |
2. Minimal Declarative Job Specification (examples/hello-compute/job.json)
{
"specVersion": 1,
"name": "hello-compute",
"runtime": "python",
"execution": { "strategy": "remote", "workers": 1 },
"resources": { "cpu": 1, "memory": "512MB", "gpu": "none" },
"timeoutSec": 60,
"retry": { "maxAttempts": 2 },
"input": "./examples/hello-compute/task.py",
"entrypoint": "task.py"
}
🧪 Verified Host & Toolchain Matrix
Baseline hardware & toolchain verification recorded in docs/14_VERIFICATION.md and docs/10_REMOTEDOTS_AI_GUIDE.md:
| Component / Toolchain |
Verified Version(s) |
Supported Targets / Notes |
Windows Verification Host |
Windows x86_64 (12th Gen Intel i7-12700H 14C/20T, 15.70 GB RAM) |
Full monorepo build, Vitest, pytest, Cargo release daemon, and 8-step E2E suite |
Linux / macOS CI Runners |
ubuntu-latest, macos-latest, windows-latest |
Automated daemon-release-matrix builds + TS/Python/Rust tests |
Node.js & pnpm |
Node 22.20.0 (min >=20.0.0) · pnpm 10.31.0 |
Coordinator, Web Control Plane, Auth Backend, CLI, TUI, and SDK |
Rust & Cargo |
rustc 1.94.0 (MSRV 1.75+) · Wasmtime 36 |
sharedots-daemon zero-warning release binary & rustdesk core |
Python & Numerical Stack |
Python 3.11.0 · NumPy 2.1.3 · cloudpickle >= 3.0 |
@client.remote SDK, .map(), gather(), and .npy row-block execution |
Android Build Toolchain |
JDK 17 · Android SDK 36 · NDK 27.1.12297006 |
io.sharedots.remote (arm64-v8a) & com.remotedots.ai.mobile (Universal 4-ABI) |
Desktop Packaging |
Tauri 2.0 + NSIS (RemoteDots AI) · Flutter + SFX (Remote-Dots) |
Single-file Windows x64 installers under compiled_apps/Dekstop apps/ |
🗺️ Roadmap, Governance & Contributors
1. Milestone Roadmap
| Milestone |
Scope |
Status |
| M0–M2 |
Monorepo, CI pipeline, Zod/MsgPack protocol, HMAC auth, SQLite WAL, Rust daemon & hardware discovery |
 |
| M3–M4 |
TypeScript SDK, resource-aware scheduler, reservation ledger, chunked ArtifactStore, .npy aggregation, SIGKILL recovery |
 |
| M5–M6 |
Real benchmarks, 8-step E2E suite, Wasmtime WASI fuel/epoch sandbox, OCI --network=none executor |
 |
| M7–M8 |
Ink v5 TUI, Tailscale mesh probe, QR pairing, Python @client.remote / .map() / SharedotsFuture / sd.gather() |
 |
| M9–M10 |
Dynamic work-stealing micro-chunking, lease watchdog, Next.js Control Plane (:3000), Express/MongoDB 2FA (:8000), Remote-Dots & RemoteDots AI releases |
 |
| M11 |
Native GPU kernel execution across CUDA, ROCm, and Metal (engines/gpu) |
 |
| M12 |
Full Distributed ML training execution (PyTorch DDP/pipeline, TensorFlow, JAX in engines/ml) |
 |
| M13–M14 |
Prometheus metrics, OpenTelemetry tracing, and multi-coordinator global mesh federation |
 |
2. Documentation & Governance Index
| Document |
Topic |
Document |
Topic |
docs/01_GETTING_STARTED.md |
3-terminal local setup & first cluster run |
docs/11_SECURITY.md |
Trust boundaries, sandboxing, 2FA & proxy rules |
docs/02_SETUP.md |
Multi-device join & UI walkthrough |
docs/13_TESTING.md |
Workspace test suite & E2E verification |
docs/05_ARCHITECTURE.md |
Core platform & service separation |
docs/19_AUDIT_1.md |
System audit scorecard & security checklist |
docs/06_PROTOCOL.md |
MsgPack frames, work-stealing & HMAC |
docs/22_SEO.md |
Google Search Console, sitemap & robots guide |
docs/07_SCHEDULING.md |
Resource scoring, reservations & leases |
docs/23_ML_WORKSPACE_COLAB_KAGGLE.md |
Colab ML Workspace, Kaggle API & multi-GPU quick-test |
docs/08_WRITING_WORKLOADS.md |
Python, WASI WASM & OCI authoring |
CONTRIBUTING.md |
Branching model, conventions & PR workflow |
docs/10_REMOTEDOTS_AI_GUIDE.md |
RemoteDots AI desktop/mobile setup & rebuilds |
SECURITY.md |
Coordinated vulnerability disclosure policy |
docs/11_SECURITY.md |
Trust boundaries, sandboxing, 2FA & proxy rules |
PRIVACY.md |
Telemetry inventory & operator privacy guide |
3. Core Maintainers & Contributors
| Maintainer |
GitHub |
Core Ownership |
| Rachit Tiwari |
 |
Protocol, Coordinator, Work-Stealing Scheduler, Rust Daemon, CLI, Ink TUI & Standard Remote-Dots (.exe / .apk) |
| Mausam Kar |
 |
Web Control Plane (:3000), Auth & 2FA Backend (:8000), RemoteDots AI Suite (.exe / CLI Proxy), SEO & Documentation |
| Yamin |
 |
Python @remote SDK, Execution Engines (Python/WASI/OCI/ML), Tauri Desktop Shell, Mobile & Platform Packaging |
Licensed under the Apache License 2.0 — 2026 Sharedots Contributors
Repository ·
Releases (APK & EXE) ·
Live Web Control Plane ·
Issues ·
Discussions