Process Model 🏗️
Land is one application made of processes, and the boundary between them is the architecture: the interface a reader types into is rendered by one process, the extensions they install run in a second, and the machine - the files, the terminals, the windows - is owned by a third. The interface is not the implementation; it is one of the three.
Land operates as a multi-process application with three concurrent processes:
| Process | Element | Language | Purpose |
|---|---|---|---|
| Native Backend | Mountain |
Rust (Tauri) |
Application lifecycle, OS operations, gRPC server, sidecar orchestration |
| Extension Host | Cocoon |
TypeScript (Node.js) |
VS Code extension execution, vscode API shim |
| UI Renderer | Wind + Sky |
TypeScript (WebView) |
Editor UI rendering, workbench services, Astro page composition |
A fourth optional process, the background daemon (Air), runs as a persistent
sidecar for updates and indexing.
Note
The TierIPC environment variable controls whether Wind/Output route IPC
through Mountain (default), fall back to Cocoon on miss (NodeDeferred),
or bypass Mountain entirely (Node). Per-subsystem overrides (TierTerminal,
TierSCM, TierAuth, etc.) allow independent routing per channel. See
EnvironmentVariables.md.
Follow One Operation 🔎
Opening a file is the shortest path through the system. It starts in the renderer’s typed service, crosses the one boundary between the renderer and the native host, and lands on the capability contract the host implements. Read once, it places every component the rest of this page describes.
| Step | Where it happens | What it carries |
|---|---|---|
| 01 | Element/Wind/Source/FileSystem/Implementation/FileSystemProviderImplementation.ts |
The file service the workbench calls; a read picks its wire string from MountainCommands.READ |
| 02 | Element/Wind/Source/Preload.ts |
invoke(channel, ...args) over @tauri-apps/api/core - the request leaves the renderer |
| 03 | Element/Mountain/Source/IPC/WindAirCommands/RegisterWindAirCommands.rs |
The native host’s command table, registered with tauri::generate_handler! |
| 04 | Element/Common/Source/FileSystem/FileSystemReader.rs |
The capability contract the handler requires and calls - ReadFile, StatFile, ReadDirectory (Element/Mountain/Source/Track/Effect/CreateEffectForRequest/FileSystem.rs) |
A change that originates in the host travels the other way: Mountain emits a
Tauri event on a sky:// channel, and Sky’s bridge
(Element/Sky/Source/Function/Sky/Bridge.ts, module Function/SkyBridge)
subscribes to every one of them and routes it to a workbench command - so
sky://editor/openDocument opens a document in the interface that asked for it.
An extension reaches the same capabilities through the extension host instead of
the renderer. Cocoon binds its Vine server on port 50052
(Element/Cocoon/Source/Service/Effect/RPCServer.ts), Mountain serves the
protocol on 50051 (Element/Vine/Source/Server/Constants.rs), and the contract
both sides compile against is Element/Vine/Proto/Vine.proto. Which path a call
takes is a runtime decision rather than a build one - TierIPC Routing below is
that switch - so the same workbench can run with every handler in Mountain,
every handler in Cocoon, or Mountain first with a Cocoon fallback.
Request Flow for UI Operations
All requests from the user interface follow a consistent flow through the system:
Component Map 🗺️
Rust Components (Native)
| Component | Crate Type | Role |
|---|---|---|
| Common | Library | Abstract trait definitions, ActionEffect system, DTOs, error types. Foundation layer with zero concrete implementations. All service interfaces (IFileService, IConfigurationService, etc.) are defined here as async traits. |
| Cache | Library | Process-wide caching primitives. AssetMemoryMap maps workbench asset files into memory (memmap2) so the webview reads them without a copy; PathCanon memoises canonical path resolution (Moka). Both caches are optional - a build without them is slower, not incorrect. Consumed by Mountain. |
| Echo | Library | Bounded work-stealing task scheduler. Implements priority-based scheduling (High/Normal/Low) with lock-free deques (crossbeam-deque). Core execution engine for Mountain’s async workloads. |
| Mountain | Binary (Tauri) |
Primary native application. Implements every trait from Common. Hosts the gRPC server (Vine protocol), manages AppState, dispatches Tauri commands, orchestrates sidecar lifecycle, owns OS-level capabilities (file system, terminal PTY, clipboard, dialogs). |
| Mist | Library + Binary | Local DNS server for *.editor.land resolution. Authoritative DNS for the private zone; resolves all subdomains to 127.0.0.1. Implements forward allowlisting for controlled external domain access. Used by Mountain and Air for network isolation. |
| Air | Binary | Background daemon. Runs as a persistent sidecar managed by Mountain. Handles: update downloads and verification, file indexing and search, cryptographic signing and authentication, background asset downloading, health monitoring, metrics collection. Communicates via gRPC on port 50053. |
| Maintain | Binary | Build orchestration. One Rust binary that compiles, bundles and packages the editor from named profiles (--profile, --list-profiles) in build mode, --run mode for the development server, and eliminate mode for the code-elimination pass; it replaces the ad-hoc shell scripts. A workspace member, but it runs at build time and never inside the editor. |
| Rest | Binary + Library | High-performance TypeScript compiler built on OXC (Oxidation Compiler). Replaces esbuild’s TypeScript loader with a Rust-powered OXC pipeline, producing VS Code-compatible output at 2-3x speed improvement. Handles decorators, class field transformations, JSX. |
| Grove | Library + Binary | Native Rust/WASM extension host. Provides a sandboxed environment via WASMtime for running WASM-compiled VS Code extensions. Shares the same VS Code API surface as Cocoon. Supports gRPC, IPC, and WASM host function transport strategies. |
| SideCar | Library | Vendored runtime binary management. Packages exact Node.js binaries per target triple (aarch64/x86_64 for macOS/Linux/Windows). Provides download, caching, version resolution, and Git LFS management. Consumed at Mountain build time. |
| Vine | Protocol Library | gRPC protocol definitions for all inter-process communication. Defines Vine.proto - the service contracts used between Mountain (port 50051) and Cocoon (port 50052), and between Mountain and Air (port 50053). Generated stubs are consumed by every element that speaks gRPC. |
TypeScript Components (Web / Node.js)
| Component | Framework | Role |
|---|---|---|
| Cocoon | Node.js + ESBuild |
Node.js extension host sidecar. Runs VS Code extensions in a supervised process. Provides a vscode API shim that translates extension calls to gRPC requests for Mountain or handles them in-process. Bootstrap is lean async (no Effect-TS runtime); stages run in a fixed order: RPCServer (port 50052) binds before MountainConnection so Mountain’s 30-second gRPC budget does not expire before Cocoon is ready. Extension dependencies are activated in topological order with a cycle guard. |
| Wind | Effect-TS + Vite |
UI service layer that recreates the VS Code workbench environment inside a Tauri WebView. Implements ~40 effect services (IPC, Configuration, Editor, Terminal, Clipboard, Dialog, FileSystem, Window) composed into three Layer stacks: TauriLiveLayer, ElectronLiveLayer, TestLayer. Services use Layer.succeed (not Layer.effect) and are composed with Layer.mergeAll. The TauriLiveLayer is backed by an eager ManagedRuntime (module singleton via globalThis.__CEL_WIND_RUNTIME__) for sub-5ms service lookup. |
| Sky | Astro + Vite |
UI component layer. Renders the editor interface (editor, sidebar, activity bar, status bar, panels) using Astro pages. Loads the VS Code workbench from @codeeditorland/output and bridges Tauri events through SkyBridge (~2900 lines). |
| Output | ESBuild |
Build artifact management. Handles compilation of VS Code platform source via dual-compiler support (esbuild primary, Rest OXC optional). Produces the @codeeditorland/output npm package consumed by Cocoon, Sky, and Wind. |
| Worker | ESBuild |
Service worker implementation. Provides asset caching (network-first for navigation, cache-first for static assets), offline support, and dynamic CSS loading. Intercepts JS imports of CSS files and responds with JS modules that trigger <link> tag injection. |
The eleven Rust rows are the workspace members Land/Cargo.toml declares; the
five TypeScript rows are the packages Land/pnpm-workspace.yaml covers that
run as processes or produce the packages the others consume.
IPC Architecture 🔌
Inter-Process Communication Matrix
| Source | Sink | Protocol | Transport | Port |
|---|---|---|---|---|
Mountain |
Cocoon |
gRPC (Vine.proto) |
TCP (localhost) | 50052 |
Cocoon |
Mountain |
gRPC (Vine.proto) |
TCP (localhost) | 50051 |
Mountain |
Air |
gRPC |
TCP (localhost) | 50053 |
Wind/Sky |
Mountain |
Tauri Commands |
IPC (in-process) | N/A |
Mountain |
Wind/Sky |
Tauri Events |
IPC (in-process) | N/A |
Cocoon extensions |
Mountain |
gRPC (via Cocoon) |
TCP (localhost) | 50051 |
Protocol Layers
Land’s IPC uses three distinct protocol layers:
-
TauriCommands (request-response):WindinvokesMountainhandlers through@tauri-apps/apiinvoke(). Each command maps to a registeredRusthandler inMountain.- Used for: file read/write, configuration get/set, dialog open, terminal operations
-
TauriEvents (push from Mountain):Mountainemits events thatWindlistens to.- Used for: configuration change notifications, extension activation signals, terminal output streaming
-
gRPC(bidirectional streaming):MountainandCocooncommunicate via protocol buffers overgRPC. The service contracts are defined inVine.proto.- Used for: extension host initialization, command execution, language feature requests (hover, completion, definition), webview panel communication
TierIPC Routing
Wind and Output both support three routing modes, selected by the TierIPC
environment variable:
| Value | Behaviour |
|---|---|
Mountain |
All IPC calls route to Mountain Tauri backend (default) |
NodeDeferred |
Mountain first; falls back to Cocoon cocoon:request bridge on miss or undefined return |
Node |
All calls route to Cocoon Node.js process via cocoon:request bridge |
Per-subsystem tier variables (TierTerminal, TierSCM, TierDebug,
TierLanguageFeatures, TierAuth, TierTasks, etc.) override TierIPC for
individual channel prefixes. For example, TierTasks=Node and TierAuth=Node
are the defaults even when the global TierIPC=Mountain, because those handlers
live in Cocoon’s extension host.
This is a runtime switch - no rebuild required. Set in .env.Land as
TierIPC=NodeDeferred to enable gradual migration of handlers to Cocoon.
Service Layer Design 🧩
Common Trait Architecture (Rust side)
The Common crate defines application capabilities as abstract async traits, one
domain per module under Common/Source/. Each trait represents a capability the
native host serves:
Common/Source
+-- FileSystem FileSystemReader (ReadFile, StatFile, ReadDirectory)
| FileSystemWriter (WriteFile, CreateFile, CreateDirectory,
| Rename, Copy, Delete)
| FileWatcherProvider (RegisterWatcher, UnregisterWatcher)
+-- Configuration ConfigurationProvider (GetConfigurationValue,
| UpdateConfigurationValue), ConfigurationInspector
+-- Terminal TerminalProvider (CreateTerminal, SendTextToTerminal,
| ResizeTerminal, ShowTerminal, HideTerminal, DisposeTerminal)
+-- Command RegisterCommand, UnregisterCommand, ExecuteCommand, GetAllCommands
+-- Document OpenDocument, SaveDocument, SaveAllDocuments, ApplyDocumentChanges
+-- LanguageFeature hover, completion, definition, symbols, references, rename
+-- ExtensionManagement scan, install, uninstall, list
+-- Search, Secret, Storage, SourceControlManagement
+-- StatusBar, TreeView, UserInterface, Webview, CustomEditor
+-- Debug, Diagnostic, Output, Telemetry
Mountain implements them with concrete Rust implementations. Cocoon and
Wind never implement these traits directly — they call Mountain’s
implementations through IPC.
Some operations reach the machine without a Common trait at all: clipboard,
dialog, window and process operations are dispatched by Mountain’s native-host
handlers (Mountain/Source/IPC/WindServiceHandlers/NativeHost/,
.../NativeDialog/), because they are Tauri capabilities rather than service
contracts.
Wind Effect-TS Service Architecture (UI side)
Wind recreates the VS Code workbench service architecture using Effect-TS.
Each service follows a consistent module structure:
Services compose into Layer stacks:
| Layer | Components | Purpose |
|---|---|---|
| TauriLiveLayer | All production services | Used in Tauri WebView for development and production |
| ElectronLiveLayer | Electron-compatible services | Used for Electron workbench variant |
| TestLayer | Mock implementations | Used in extension test runner |
Cocoon Bootstrap and Extension Architecture
Cocoon’s bootstrap is lean async - plain async/await functions with no
Effect-TS runtime overhead. The stages run sequentially in a fixed order, and
the order is the architectural constraint: Cocoon binds its own gRPC server on
port 50052 before it attempts to connect to Mountain, because Mountain
allows 30 seconds for the handshake and that budget must not be spent waiting for
a port that is still unbound. Extension dependencies are then activated in
topological order with an InProgress set cycle guard, so a circular dependency
cannot deadlock the host.
The stage-by-stage sequence, its payloads and its failure modes are Application Startup and Handshake’s subject.
The vscode API shim in Cocoon/Source/Services/Handler/VscodeAPI/ uses a
two-track dispatch model:
- Track A - Stock Node: Loads unmodified VS Code
extHost*.tssources. TheExtHostContext/MainContextRPC glue is provided byCocoon’s shim alongside stock extension host code. Maximizes compatibility. - Track B - Rust Native: For I/O-heavy APIs,
Cocoon’svscodeshim sendsgRPCrequests toMountainwhich performs the operation natively (filesystem, process, terminal, search, git). Faster than bouncing throughNode.js.
The per-call tier router in Cocoon/Source/Services/Handler/VscodeAPI/ selects
the track at runtime.
Tier-Gated Implementation ⚙️
Land uses a configuration-driven selection mechanism for capabilities that
have multiple implementation strategies. Each capability is assigned a tier
value in .env.Land:
| Capability | Tier Values | Purpose |
|---|---|---|
FileSystem |
Layer2 (gRPC), Layer3 (native in-language), Layer4 (pure Rust) |
File system access strategy |
RemoteProcedureCall |
gRPC, SharedMemory |
IPC transport mechanism |
FileWatcher |
Layer4, Layer5 (OS-level integration) |
File system change notification |
Glob |
JavaScript, Native (globset Rust) |
Glob pattern compilation |
Telemetry |
PostHog, OTLP, Disabled |
Telemetry backend selection |
HTTPProxy |
Hyper, Standard |
HTTP client implementation |
The tier selection propagates through every Element’s build system simultaneously. See Tier-Gated Implementation Selection for the full propagation workflow.
Data Flow Patterns 📊
Read Request (File Open)
Extension Feature Request (Hover)
Configuration Change
Sources and Limits 🧭
What this page is read from, and what it does not claim:
- The tables name directories and files under
Land/Element/. The component map’sRustrows are the workspace membersLand/Cargo.tomldeclares; itsTypeScriptrows are packages under the pnpm workspaceLand/pnpm-workspace.yamlcovers. A row that cannot be traced to one of them does not belong on the page. - The diagrams are figures of a process, not captures: they show the order a
request takes. The paths in
Follow One Operationand the tables beside each figure are what a reader can check for themselves. - Not every operation takes the same path. The trace above is a file read through
the renderer; a language-feature request goes to the extension host, and a
configuration change is pushed back as a
Taurievent rather than answered. - A system WebView is not one engine. On Windows the renderer can be a
Chromium-based
WebView2, so a statement about the renderer’s engine is a statement about a platform, not aboutLand. Cacheis optional: both caches are optional primitives, and a build without them is slower, not incorrect.TierIPCand its per-subsystem variables are read at runtime, so a build’s routing is a fact about the environment it started with, not about the binary.Land/.env.Landis the authority for the values a profile sets.
Related Documentation 📋
- BuildPipeline - Full build pipeline from env files to binary artifacts
- EditorCore - Editor workbench adaptation and
Windservice layer - Polyfills - Compatibility shims and initialization layers
- RustInfrastructure -
Rustbackend component internals - InterComponentProtocol -
gRPCprotocol specification - Building - Build instructions and prerequisites
- BuildMatrix - Build variant profile reference
- EnvironmentVariables - Complete env var reference
- Workflow/ - Detailed component interaction workflows
- VSCode-API-Coverage-Matrix -
vscode.*API implementation status per namespace
- 🟠 Low-Level Shim - Engine-level prototype hooks
- 🔵 Coverage / Telemetry - Application-level service routing
Project Maintainers: Source Open (Source/[email protected]) | GitHub Repository | Report an Issue
The records the process model names, drawn from the fifteen the site files: the native host that owns the application lifecycle, then the extension host, the two halves of the renderer and the background daemon that run under it.
-
Native Rust Backend -
Tauri -
Replaces Electron Main Process
SOURCE: LAND/ELEMENT/MOUNTAIN
NATIVE BACKEND
RUST + TAURI
HOSTMOUNTAIN
RUST SERVICES
Native Rust and Tauri backend. Implements the Common service traits: files, terminals, dialogs, processes, keychain. Hosts the gRPC server for the extension host and sidecars. Manages application state and sidecar lifecycle. Replaces the Electron main process. Active.
WORKING, 06
- FORM:
- NATIVE BACKEND
- WRITTEN IN:
- RUST
- BOUNDARY:
- VINE GRPC TAURI IPC
- DEPENDS ON:
- COMMON VINE
- MANUAL:
- /DOC/DEEP-DIVE-MOUNTAIN
- EVIDENCE:
- MANIFEST PLACEHOLDER PLATE NOT IN BUILD
# TRACE / MOUNTAIN 03 STEPS
- 01
Binary.rsTHE TAURI ENTRY - 02
IPC/WindServiceHandlers/mod.rsTHE WIND IPC SURFACE - 03
ApplicationState/Internal/ExtensionScanner/LoadFromCache.rsTHE EXTENSION SCAN
SOURCE: /DOC/DEEP-DIVE-MOUNTAIN
-
Extension Host -
Unmodified VS Code Extensions -
Effect-TS Services
SOURCE: LAND/ELEMENT/COCOON
EXTENSION HOST
DUAL-TRACK
HOSTCOCOON
EFFECT-TS
Node.js extension host. Runs existing VS Code extensions unmodified on the full VS Code API surface. Every extension runs in its own supervised Effect fiber. Crashes are trapped at the supervision boundary. Replaces the single-threaded extension host. Platform-native sandboxing planned.
WORKING, 06
- FORM:
- EXTENSION HOST SIDECAR
- WRITTEN IN:
- TYPESCRIPT EFFECT-TS
- BOUNDARY:
- VINE GRPC PORT 50052
- DEPENDS ON:
- MOUNTAIN VINE
- MANUAL:
- /DOC/DEEP-DIVE-COCOON
- EVIDENCE:
- MANIFEST PLACEHOLDER PLATE NOT IN BUILD
# TRACE / COCOON 03 STEPS
- 01
Effect/Bootstrap.tsTHE BOOTSTRAP ORDER - 02
Core/RequireInterceptor.tsTHE VSCODE MODULE PATCH - 03
Service/Ipc.tsTHE GRPC CLIENT
SOURCE: /DOC/DEEP-DIVE-COCOON
-
Workbench Services -
Effect-TS Layers -
Native Bridges
SOURCE: LAND/ELEMENT/WIND
WORKBENCH
EFFECT-TS LAYERS
FLOWWIND
SERVICE LAYER
Effect-TS service layer. Recreates the VS Code workbench environment inside the Tauri WebView. Typed Tauri commands replace Electron's untyped JSON IPC bridge. Layer stacks for Tauri, Electron compatibility, and isolated tests. Active.
WORKING, 06
- FORM:
- SERVICE LAYER
- WRITTEN IN:
- TYPESCRIPT EFFECT-TS
- BOUNDARY:
- IN-PROCESS
- DEPENDS ON:
- COCOON
- MANUAL:
- /DOC/DEEP-DIVE-WIND
- EVIDENCE:
- MANIFEST PLACEHOLDER PLATE NOT IN BUILD
# TRACE / WIND 03 STEPS
- 01
Effect/Configuration.tsCONFIGURATION - 02
Effect/Editor.tsTHE EDITOR SERVICE - 03
Effect/Clipboard.tsTHE CLIPBOARD
SOURCE: /DOC/DEEP-DIVE-WIND
-
Visual UI Layer -
Astro Components -
Three Workbench Layouts
SOURCE: LAND/ELEMENT/SKY
ASTRO UI
WEBVIEW BRIDGE
SCOPESKY
UI LAYER
Declarative UI layer built on Astro. Renders the editor interface in the OS WebView. SkyBridge routes Tauri events to VS Code workbench APIs. Conditional dynamic imports keep the bundle target-specific. Workbench layouts for Browser, Mountain-native, and Electron. Active.
WORKING, 06
- FORM:
- UI LAYER
- WRITTEN IN:
- ASTRO
- BOUNDARY:
- TAURI WEBVIEW
- DEPENDS ON:
- WIND
- MANUAL:
- /DOC/DEEP-DIVE-SKY
- EVIDENCE:
- MANIFEST PLACEHOLDER PLATE NOT IN BUILD
-
Background Services -
Downloader -
Workspace Indexer
SOURCE: LAND/ELEMENT/AIR
BACKGROUND SERVICES
DAEMON
CHANNELAIR
UPDATE SERVICE
Persistent Rust daemon. Updates, downloads, signing, and health checks outside the main window. Staged updates with automatic rollback. Warm file index across sessions. Replaces restart-to-update and cold-start indexing. Active.
WORKING, 06
- FORM:
- BACKGROUND SERVICE
- WRITTEN IN:
- RUST
- BOUNDARY:
- LOOPBACK DAEMON
- DEPENDS ON:
- MOUNTAIN
- MANUAL:
- /DOC/DEEP-DIVE-AIR
- EVIDENCE:
- MANIFEST PLACEHOLDER PLATE NOT IN BUILD
ELEMENTS, 05
SELECTION: 05 OF 16