Skip to main content

SHEET 06 OF 41

/DOC/:SLUG

PART:
03 DOCUMENTATION
CIRCULATION:
PUBLIC
SOURCE:
pages/Doc/[...Slug].astro
AS OF:
2026-12-02

Technical architecture of the Air background daemon: module layout, the AirService gRPC contract, connection lifecycle with Mountain, the Air.toml configuration schema, and current limitations.

/Deep Dive

Air - Deep Dive

Technical architecture of the Air background daemon: module layout, the AirService gRPC contract, connection lifecycle with Mountain, the Air.toml configuration schema, and current limitations.

PUBLISHED DEEP DIVE Source/Content/doc/deep-dive-air.md UNAVAILABLE UNAVAILABLE ARCHITECTURE 0

STATUS UNAVAILABLE NEXT OPEN THE ELEMENT'S MANUAL - IT DESCRIBES THE THING THE CAPTURE WOULD HAVE SHOWN.

# PLATE_01 / AIR

FIGURE: The capture this record's evidence would show: vapor in low light macro.

The manifest is in the build and the plate beside it is not. The capture it describes is a texture study of the element's material, not a screenshot of its interface.

SUBJECT:
VAPOR IN LOW LIGHT MACRO
MANIFEST:
Public/Evidence/Air/manifest.yaml
STATE:
MANIFEST PLACEHOLDER
PLATE:
UNAVAILABLE

SOURCE: Public/Evidence/Air/manifest.yaml

Air is a standalone Rust binary structured around a central gRPC server that receives task delegation from Mountain. It runs as a persistent sidecar process alongside Mountain, offloading resource-intensive operations so the editor remains responsive. Internal modules handle distinct responsibilities: updates, downloads, authentication, and health monitoring.

The crate ships a binary (Air, Source/Binary.rs) and a library (AirLibrary, Source/Library.rs). The binary is the daemon; the library is what the integration tests and Mountain’s client link against.

Mermaid diagram

Key Modules

Path Description
Source/Binary.rs Binary entry point; bootstraps the Tokio runtime and starts the daemon
Source/Library.rs Library root: constants (DefaultConfigFile = "Air.toml", DefaultBindAddress = "[::1]:50053"), error type, public API
Source/Initialize/ Startup sequence, split into Build/, Command/, Configure/ and Service/; Configure/Port/SelectPort.rs resolves the bind port
Source/Vine/ gRPC server implementation using tonic; registers AirService and routes incoming calls
Source/ApplicationState/ Shared state: connection info and type, connection-health report, performance metrics
Source/Client/ AirClient and AirServiceProvider - the client side of AirService, used by callers
Source/Mountain/ MountainClient, MountainClientConfig, TlsConfig, Constants - Air’s outbound connection back to Mountain
Source/Updates/ Update lifecycle: check, download, verify, apply; UpdateManager.rs holds the channel and signature policy
Source/Downloader/ Resilient download manager with pause, resume, retry and progress reporting
Source/Authentication/ Cryptographic signing of binaries and secure token storage
Source/Security/ Signature verification and secure storage utilities
Source/HTTP/ HTTP client built on Mist’s resolvers (LandDnsResolver, TokioResolver)
Source/Indexing/ File content indexing for workspace search
Source/HealthCheck/ Self-monitoring and watchdog for process health
Source/Metrics/ Resource and request telemetry reported to Mountain
Source/Tracing/ Distributed tracing: span events, trace generation, sampling config and propagation context
Source/Logging/ Structured log output, split from tracing
Source/Configuration/ AirConfiguration, ConfigurationManager, Schema, HotReload - file loading, validation and live reload
Source/Daemon/ DaemonManager, DaemonStatus, ExitCode, Platform, PlatformInfo - daemon lifecycle (start, stop, restart, shutdown request)
Source/Resilience/ Retry logic and circuit breakers for network operations
Source/Plugins/ Plugin model: Plugin, PluginCapability, PluginDependency, ApiVersion, EventBus
Source/CLI/ Command-line argument parsing for daemon startup options
Source/DevLog.rs Development log helper used across the modules

Protocol

Proto/Air.proto declares one service, AirService. The RPCs group by concern:

service AirService {
  // Authentication
  rpc Authenticate(AuthenticationRequest) returns (AuthenticationResponse);

  // Updates
  rpc CheckForUpdates(UpdateCheckRequest) returns (UpdateCheckResponse);
  rpc DownloadUpdate(DownloadRequest) returns (DownloadResponse);
  rpc ApplyUpdate(ApplyUpdateRequest) returns (ApplyUpdateResponse);

  // Downloads
  rpc DownloadFile(DownloadRequest) returns (DownloadResponse);
  rpc DownloadStream(DownloadStreamRequest) returns (stream DownloadStreamResponse);

  // File indexing
  rpc IndexFiles(IndexRequest) returns (IndexResponse);
  rpc SearchFiles(SearchRequest) returns (SearchResponse);
  rpc GetFileInfo(FileInfoRequest) returns (FileInfoResponse);

  // Status and monitoring
  rpc GetStatus(StatusRequest) returns (StatusResponse);
  rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);
  rpc GetMetrics(MetricsRequest) returns (MetricsResponse);

  // Resource management
  rpc GetResourceUsage(ResourceUsageRequest) returns (ResourceUsageResponse);
  rpc SetResourceLimits(ResourceLimitsRequest) returns (ResourceLimitsResponse);

  // Configuration
  rpc GetConfiguration(ConfigurationRequest) returns (ConfigurationResponse);
  rpc UpdateConfiguration(UpdateConfigurationRequest) returns (UpdateConfigurationResponse);
}

DownloadStream is the one server-streaming RPC; every other call is request-response. AuthenticationRequest carries a provider identifier such as github, gitlab or microsoft; UpdateCheckRequest carries a channel of stable, beta or nightly.

Data Flow

The following sequence shows how Mountain delegates an update task to Air and receives progress notifications.

Mermaid diagram

Port Allocation

  • Air listens on [::1]:50053 (reserved for the Air daemon).
  • Cocoon uses [::1]:50052 (the VS Code extension host).
  • 50054 and 50055 are reserved - 50054 for a future SideCar service and 50055 for future metrics endpoints.

Source/Initialize/Configure/Port/SelectPort.rs resolves the bind address from a --bind command-line argument when one is given, and from the DefaultBindAddress constant ([::1]:50053) otherwise. It validates the address and fails on an unparsable value; it does not probe for a free port.

Integration Points

Connecting Element Direction Mechanism Description
Mountain Bidirectional gRPC over Proto/Air.proto Mountain delegates tasks through AirService; Air streams progress back and sends heartbeats over its own MountainClient
Mist Inbound Local DNS resolver Air’s HTTP client uses Mist::Resolver::LandDnsResolver for secure resolution
Vine Inbound Protocol definition Proto/Air.proto defines the service contract; tonic-prost generates the Rust server and client stubs
Cache Not connected - Cache is a Mountain-side crate; Air does not depend on it

Configuration

Configuration is a file, not a set of loose environment variables. ConfigurationManager resolves the path as <config_dir>/Air/Air.toml and creates it from defaults on first run. The schema requires SchemaVersion (default 1.0.0) and profile (default dev).

Section Field Default
grpc bind_address [::1]:50053
grpc max_connections 100
grpc request_timeout 30
authentication enabled true
authentication credentials_path ~/.Air/credentials
authentication token_expiration 24
authentication max_sessions 10
update enabled true
update check_interval_hours 6
update server_url https://update.editor.land
update auto_download true
update auto_install false
update channel stable
download enabled true
download max_concurrent_downloads 5
download timeout 300
download max_retries 3
download cache_dir ~/.Air/cache
indexing enabled true
indexing max_file_size_mb 10
indexing update_interval 30
indexing directory ~/.Air/index
indexing max_parallel_indexing 10
logging level info
logging file_path ~/.Air/logs/Air.log
logging console_enabled true
logging max_file_size 10
logging max_files 5
performance memory_limit 512
performance cpu_limit 50
performance disk_limit 1024
performance task_interval 60

Any field can be overridden from the environment as AIR_<SECTION>_<FIELD>, which is how Mountain sets AIR_GRPC_BIND_ADDRESS when it spawns the daemon. HotReload watches the file and applies changes without a restart; the gRPC bind address is the exception that requires one.

AIR_LOG_DIR and AIR_LOG_FILE override where the log lands, and AIR_LOG_JSON switches the encoder.

Lifecycle

Mountain spawns Air from Binary/Service/AirStart.rs with three environment variables - AIR_GRPC_ADDRESS, AIR_GRPC_BIND_ADDRESS and AIR_LOG_DIR - and then detaches: it holds no Child handle, drains the child’s stdout and stderr into its own dev log, and never waits on it. Air is therefore not a supervised child in the usual sense; it manages its own shutdown through DaemonManager::RequestShutdown or the OS’s SIGTERM.

Two switches gate the spawn. The AirIntegration Cargo feature decides whether the code is compiled in at all, and Spawn=false (or 0) disables it at runtime. Because Mountain keeps no handle, it cannot tell whether a previous Air is still alive - the guard is on the daemon side, where DaemonManager returns ServiceUnavailable("Air daemon is already running") instead of starting a second instance on the same address.

Limitations

  • Signature verification is opt-in. UpdateManager reads LAND_UPDATE_PUBLIC_KEY; when it is unset the log says signature verification is disabled and updates are applied on checksum alone.
  • No shutdown RPC. Proto/Air.proto declares no Shutdown method. Shutdown is an in-process request or a signal, so a remote caller cannot stop the daemon over gRPC.
  • The index is a content index, not a language index. Source/Indexing/ builds a searchable content index for workspace search; symbol-level intelligence stays with the language servers in Cocoon.
  • Air is optional at launch. AirStart logs running without Air and returns success when the binary is missing or the spawn fails, so a broken Air build degrades features rather than failing the editor.
  • The port can move. A taken 50053 sends SelectPort to the next free port, so a client that hard-codes the number can miss the daemon.

The record this page documents, as the site files it: the six facts the claim is checked against, and the three files the manual names to check it.

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

# TRACE / AIR 03 STEPS

  1. 01 Source/Binary.rs THE DAEMON BINARY
  2. 02 Source/HTTP/Client.rs THE UPDATE CLIENT
  3. 03 Source/Library.rs WHAT THE CRATE EXPORTS

SOURCE: /DOC/DEEP-DIVE-AIR

Deep Dive, 15 PAGES, page 1 of 15

THE LAYER'S INDEX

NEXT: /BLOG 04 BLOG

NOTES FROM THE BUILD, NEWEST FIRST

〈06〉 /DOC/:SLUG 41 SHEETS AS OF: 2026-12-02