Mountain is the native Rust backend that hosts our Tauri app, the gRPC server we expose to Cocoon, and the runtime that owns every workbench service routed through Rust. This file records what we built in our voice, version by version. Format adapted from Keep a Changelog.
We brought the bundled-electron profile to correctness parity with the unbundled path and started landing the substrate fixes that take us past it. Headline number: we drove the Cocoon-facing circuit-breaker cascade from 17,134 rejections per workspace session to zero.
- JSON-RPC code
-32004for benign 404s. Mountain'sLooksLike404predicate inVine/Server/MountainVinegRPCService.rsnow matchesno such file or directory,entity not found,os error 2,path is outside of the registered workspace,permission denied for operation, andworkspace is not trusted, so Rust'sstd::io::Errorformatting stops tripping the breaker on extension probes. We stamp-32004for these so the client classifies on code first. - Three-shape
GetURLFromURIComponentsDTOinEnvironment/Utility/UriParsing.rs: accepts a plain string,{external}object, or{scheme,path}components. Diagnostic publishes from rust-analyzer stop dropping when the URI shape varies between code paths. - Deferred-no-op file watching in
Environment/FileWatcherProvider.rs. Watch on absent path now records the entry without a live OS watcher and returnsOkso the optional config dirs every workspace probes (~/.roo/skills-*,.vscode/settings.jsonin fresh workspaces) stop counting against the breaker. FileWatcher.Registerhandle acceptsValue::NumberinTrack/Effect/CreateEffectForRequest/FileWatcher.rs. Cocoon's numericNextProviderHandle()no longer collapses 136 watcher handles to a single empty-string entry.- Canonical-path comparison in
Environment/Utility/PathSecurity.rs::IsPathAllowedForAccess. We try both raw and canonical paths on each side so workspace folders mounted under/Volumes/...on macOS stop rejecting their own descendants. Reject details now log under thevfstag. Identifier:Stringfield onSourceControlManagementProviderDTOin Common, threaded throughEnvironment/SourceControlManagementProvider.rsso SCM replay re-emits with the original provider id (git,github,hg, …) instead of a hardcoded fallback.sky:replay-eventsIPC handler inIPC/WindServiceHandlers/mod.rs. On renderer-bridge install we drain tree-view registrations, SCM providers, extension-registered commands, active terminals + their per-PTY ring buffer, and re-emit each on its canonical channel. Closes the boot-window event-race that silently dropped startup events between Mountain emit and renderer listen.- 64 KB per-terminal ring buffer in
Environment/TerminalProvider.rs. PTY reader appends every chunk to the buffer before emitting; replay drains it on listener install so the shell's first prompt + zsh MOTD reach xterm even when the renderer bundle takes ~1.5 s to boot. LogSkyEmitinstrumentation on the SCM register emit (Vine/Server/Notification/RegisterScmProvider.rs). Visibility for the prior fire-and-forget path that dropped silently.
tree:getChildrentimeout 5000 ms → 1500 ms inIPC/WindServiceHandlers/mod.rs. Slow extensions stop eating five seconds of perceived UI responsiveness; we fall back to empty array and let the workbench schedule its own retry.
We brought the bundled VS Code workbench up in our Tauri webview end-to-end. Mountain compiles clean, Cocoon attaches over gRPC, all 113 of our test extensions scan, the workbench renders, and we kept chasing gaps until search, SCM, debug, and custom editors all worked.
- 24-module split of
WindServiceHandlersand 15-submodule split ofCocoonServiceso each domain (Commands, Configuration, Extensions, FileSystem, Model, NativeHost, Navigation, Output, Search, Storage, Terminal/PTY, UI, Utilities, …) lives in its own file. Easier to grep, easier to land per-domain fixes. dev_log!macro rolled across 170 files. Replaces the oldlogcrate with a tag-filtered stream -Trace=terminal,exthost ./Mountainfilters live. 38 granular tags (terminal,extensions,search,themes,window,nativehost,clipboard,commands,model,output,notification,progress,quickinput,workingcopy,workspaces,keybinding,label,history,decorations,textfile,update,encryption,menubar,url,grpc,cocoon,bootstrap,preload, …).Trace=shortmode: compresses module targets (D::Binary::Main::Entry→Entry), aliases verbose app-data path to$APP, and dedupes consecutive identical messages with(xN)suffix.- 18 CocoonService handlers + 14 language-feature RPC methods.
Stub implementations replaced with real delegations to
LanguageFeatureProviderRegistrycovering document highlights / symbols / workspace symbols, rename edits, formatting (document / range / on-type), signature help, code lenses, folding ranges, selection ranges, semantic tokens, inlay hints, type hierarchy, call hierarchy, linked-editing ranges. - Comprehensive
CreateEffectForRequesteffect creators for Authentication, Clipboard, Commands, Configuration, Debug, Diagnostics, Documents, FileSystem, FileWatcher, Git, Keybinding, Languages, NativeHost, SCM, Search, Secrets, StatusBar, Storage, Task, Terminal, TreeView, UserInterface, Webview, WindowUI, Workspace. - PostHog plugin (
Binary/Build/PostHogPlugin.rs) for debug-build analytics: lifecycle events, IPC commands, errors. API key, host, and enable flag baked at compile time viabuild.rs'sPropagatePostHogSentinel(). - OTLP proxy in
LocalhostPlugin. Forwards/v1/tracesrequests to a local OTLP collector at127.0.0.1:4318via raw TCP so the renderer'sOTELBridge.tscan send telemetry without CORS issues. NodeResolvermodule (ProcessManagement/NodeResolver.rs). Eight-step ladder:Pickenv → shipped runtime → fnm / volta / asdf / nvm → Homebrew → PATH fallback. Verifies version againstRequire(default 20) and warns on downgrade.UriComponentshelper module (Environment/UriComponents/). Centralises every URI payload sent to the renderer with the required$mid: 1marshalling marker. ExposesFromFilePath,FromUrl,StampMidUri,Normalize.- Local VSIX installer (
Environment/VsixInstaller.rs). Two-pass extraction reads the manifest before writing, includes zip-slip protection, unpacks into~/.land/extensions, then notifies Cocoon via$deltaExtensionsfor hot activation without a workbench reload. extensions:getManifestIPC handler. Readsextension/package.jsonstraight from a.vsixarchive without disk extraction so the Install-from-VSIX preview dialog works.extensions:scanSystemExtensions/scanUserExtensionsrouting with explicit type filter so VSIX-installed extensions show up under Installed with an Uninstall action.extensions:resetPinnedStateForAllUserExtensions.- Native file watcher (
Environment/FileWatcherProvider.rs). Backed by thenotifycrate. Includes debouncing, glob-to-regex pattern filtering, and IPC forwarding to Cocoon as$fileWatcher:event. BuildInitialUrlreads~/.land/workspaces/RecentlyOpened.jsonand passes?folder=<path>to the initial webview URL, skipping the destructive reload-on-Welcome.ParseWorkspaceFoldersCLI parsing:--folderflags, positional dirs,Openenv.- DevLog file sink:
~/Library/Application Support/<bundle>/logs/ <timestamp>/Mountain.dev.log. Enabled viaRecord=1. DevLog::InitEager()at binary startup so a session log exists before any panic, preserving post-mortem evidence.- Atomic shutdown guard in
Binary/Main/Entry.rs. Tauri re-deliversExitRequested { code: Some(0) }afterapp_handle.exit(0)- without the guard the shutdown task ran twice, tried to SIGKILL an already-dead Cocoon, and logged spurious tcp-connect errors.
- Pre-boot zombie sweep (
SweepStaleCocoon). TCP-probes port 50052 and SIGTERMs/SIGKILLs a stale Cocoon process so successive boots don't fail withEADDRINUSE. Paired with post-shutdownHardKillCocoon. - Tier-gating system (
Cargo.tomlfeature flags +build.rs): compile-time tier selection with a runtime banner so we know which layer is active per profile (TierFileSystem=Layer2etc.). - Five extension-path env vars (
Skip,Ship,Lodge,Extend,Probe) for switching between bundled, user, and test-extension layouts. - Navigation history state with
goBack,goForward,canGoBack,canGoForward,push,clear,getStackIPC handlers. - Label resolution IPC handlers (
getUri,getWorkspace,getBase) for human-readable display labels. - Text model registry IPC handlers (
open,close,get,getAll,updateContent). - DualTrack env knobs (
LAND_DEFER_RUST*): per-method, per-domain, or global Rust deference for A/B testing Mountain vs Cocoon paths. - macOS window dragging via overlay title-bar:
TitleBarStyle::Overlay+hidden_title(true). Removed themaximized(true)that blocked drag.
SkyEventtyped constants replace hardcoded"sky://output/*"string literals. Source of truth inCommonLibrary::IPC::SkyEvent.- Vine protocol PascalCase end-to-end. All RPC methods renamed
from
snake_casetoPascalCase(e.g.initial_handshake→InitialHandshake);vine.rsregenerated. - Vine gRPC binding moved from IPv6
[::1]to IPv4127.0.0.1for cross-platform reach. - PascalCase rename across entire RPC subsystem: every snake_case
.rsfile renamed; deprecated service modules removed; module-level re-exports cleaned so import paths spell out where each symbol lives. - DTO serialization: removed
skip_serializing_if = "String::is_empty"fromName,Version,PublisheronExtensionDescriptionStateDTO. Trusted-publishers migration in the workbench was crashing onmanifest.publisher.toLowerCase()when the field was absent. posthog-rs0.5 API migration:api_endpoint()→host().sha20.11 migration:LowerHeximpl →hex::encode()for our session-id hash.- Resource-not-found 404s downgraded from
warntoinfo. The benign-ENOENT ignore list expanded forchatLanguageModels.json, window log files,.copilot/agents,.vscode/tasks.json,/User/mcp.json,vscode-chat-images,/output_<TIMESTAMP>. - Cocoon health monitor stops flooding logs after a crash; AppLifecycle fallback timers extended (2 s → 8 s, 5 s → 15 s).
- Workspace folder API sync → async.
GetFolders().awaitreplaced withGetWorkspaceFolders(); add/remove use direct manipulation viaGetWorkspaceFolders/SetWorkspaceFolders. - Vine protobuf field names aligned:
RegisterTreeViewProviderRequestdisplay_name→extension_id;GitExecRequestrepository/cwd→repository_path/args.
- Extension type filtering in
IPC/WindServiceHandlers/Extensions.rs.getInstalled(type?)now respects the optional filter (0 = System, 1 = User) so VSIX-installed extensions appear under Installed. - Post-install activation burst: after
$deltaExtensionsadds an extension to Cocoon's registry we fireonStartupFinished. Without this, extensions with that activation event registered but never activated until the next workbench reload. - Extension manifest passthrough: 14 fields added to
ExtensionDescriptionStateDTO(Categories,DisplayName,Description,Keywords,Repository,Bugs,Homepage,License,Icon,AiKey,ExtensionKind,Capabilities,ExtensionDependencies,ExtensionPack). - Static asset path resolution in
Utilities.rs. Accepts both/Static/Application/(absolute) andStatic/Application/(relative). The WKWebView WASM loader strips the leading slash before reachingfile:read, which used to fail withENOENTand broke TextMate syntax highlighting for every grammar. vscode-file://absolute OS-path handling: detects macOS/Linux absolute path roots insidevscode-file://vscode-app/and serves files directly from disk. Fixes extension-contributed icon themes, grammars, woff fonts.- NLS placeholder resolution in the extension scanner: loads
package.nls.jsonand recursively replaces%key%placeholders before parsing the manifest. MutexGuardSend fix inFeatureMethods.rs: lock scope narrowed across.awaitpoints.- MIME-type override in
LocalhostPlugin: explicit MIME for JS / CSS / JSON / HTML / SVG assets. - Provider selector format standardised to
[{"language": ...}];SideCarIdentifieralways routes to"cocoon-main". - Language-inference fallback in
ProviderLookup: derives language from file extension (.rs→ rust,.ts→ typescript, …) when the document isn't in open state. - Storage
DeleteItemreplaced withUpdateStorageValue(true, Key, None). QuickInputfield naming:Placeholder→PlaceHolder.- Dialog options DTO: wrapped in
Basefield withDialogOptionsDTOcontainingTitle. Path strings via.display(). - First-run scanner directory now
debug-level instead ofwarn. .js.map204 handling in thevscode-filescheme handler.
We took Mountain from "compiles" to "boots and renders" and put every core service in place to back the workbench.
Source/Binary/modular startup:Tray/(SwitchTrayIcon,EnableTray).Shutdown/(SchedulerShutdown,RuntimeShutdown).Service/(VineStartfor gRPC on 50051/50052,CocoonStart,ConfigurationInitialize).Register/(AdvancedFeaturesRegister,IPCServerRegister,StatusReporterRegister,WindSyncRegister).Initialize/(RuntimeBuild,StateBuild, CLI argument parser, dynamic port selection).
- 20+ Tauri commands exposed: workbench/desktop configuration query, update-subscription endpoint, tray-icon switch, IPC status query, performance statistics, message-reception endpoint, generic-IPC-method invocation, document synchronisation, collaboration session, status history.
- TreeView foundation: stub interaction handlers, state
persistence skeleton, Tauri event propagation. Concrete
OnTreeNodeExpanded/OnTreeSelectionChangedfollowed in v2.0 withApplicationStatelocks and event broadcast. - Hover feature (
Source/Command/Hover/):Fn.rs(164 lines) with hover-request handling. - Debug state (
ApplicationState/State/FeatureState/Debug/ DebugState.rs, ~155 lines) withDebugConfigurationProviderRegistrationandDebugAdapterDescriptorFactoryRegistration. - Vine gRPC protocol expansion: full coverage for language features, window operations (quick-pick, input-box, progress, webview messaging, external URI), file system, output channels, tasks, authentication, extensions, terminal resize, configuration.
- Generic request router (
process_mountain_request): routesfs.*andcommands.executemethods. - Terminal I/O, secret storage, UI dialogs:
terminal_input,close_terminal,get_secret/store_secret/delete_secretvia OS keychain,show_quick_pick,show_input_box. - Output channel events + configuration retrieval with Tauri emit fan-out to the renderer.
/Static/Applicationpath mapping innormalize_uri_path, pre-creating system-extensions directory to avoidENOENTon first scan.- 351 Rust files across the workspace, 70+ gRPC RPCs, 24 IPC domain modules.
- TLS, AES-256-GCM, OpenTelemetry, PostHog initial plumbing.
dev_log!macro replaceslogcrate project-wide.- Domain-module split: 167 KB monolithic
WindServiceHandlers→ 24 modules; 2,800-lineCocoonService→ 15 submodules. - Thread safety:
static mut→RwLockinScheme.rs(829 lines),ServiceRegistry.rs(820 lines),CertificateManager.rs(395 lines),TlsCommands.rs(184 lines). Cleaned 150+ unused imports across 40+ provider files. - Binary entry point moved from
Library.rsintoSource/Binary.rs. Library API and binary configuration now separable.
- RPC error response: string → proper
RpcErrorstruct with JSON-RPC code-32601. - DTO deserialisation for
InputBoxOptionsDTO,OpenDialogOptionsDTO,SaveDialogOptionsDTO. CompletionItemDTO: missingdocumentationfield added.
We held steady. gen/schemas/macOS-schema.json added for tray /
menu bar / dock integration. actions/cache 4.3.0 → 5.0.1 and
actions/checkout 5.0.0 → 6.0.1 in CI; regular .github/Update.md
auto-increments.
We standardised error handling across SourceControlManagement,
DocumentProvider, and TerminalProvider; consolidated sidecar
naming; added the 22NodeVersion label to build artifacts so the
Node.js sidecar binary version is visible from the file name; and
standardised Windows installer naming across debug and release
profiles.
The complete-architecture quarter - 185 commits.
Source/Command/:CommandRegistry,Keybinding,LanguageFeature,SourceControlManagement,TreeView,Bootstrap,Hover.Source/Environment/: 14 provider implementations (Configuration,Document,FileSystem,Output,Search,Secret,StatusBar,Storage,Terminal,TreeView,UserInterface,Webview,Workspace,Utility).Source/ProcessManagement/(CocoonManagement,InitializationData).Source/RunTime/-ApplicationRunTimeexecutable lifecycle.Source/Track/- request routing + effect system (DispatchLogic,EffectCreation).Source/Update/,Source/Workspace/WorkSpaceFileService,Source/FileSystem/FileExplorerViewProvider.Source/Vine/Server/(MountainVinegRPCService,Initialize).Source/Vine/Generated/vine_ipc.rs(1,714 lines auto-generated fromVine.proto).- Node.js sidecar bundled alongside the binary in
Target/debug/andTarget/release/. - Windows artefacts:
.exe,.msi.
- Error handling unified via
CommonError+MapLockErrorpattern. - Module renames:
handlers→Command,app_state→ApplicationState. - README rewritten with architecture overview (76 lines);
docs/Deep Dive.mdrewritten (182 lines). - License transitioned to CC0 1.0 Universal.
Source/ApplicationState/reorganization:Internal/{Persistence, Recovery, TextProcessing, PathResolution, ExtensionScanner, Serialization},DTO/with 12 classes (DocumentStateDTO,TerminalStateDTO,TreeViewStateDTO,WindowStateDTO, …),State/with feature-organized state..github/workflows/Auto.yml(68 lines) for the automated update/push CI.Knowledge.dot+Knowledge.svgmodule dependency graph.
- Deprecated
Source/app_state/→Source/ApplicationState/. Cargo.toml: removed 45 redundant entries, added 17 new ones.
We brought up the Android scaffolding. gen/android/ includes
AndroidManifest.xml, MainActivity.kt, RustPlugin.kt,
BuildTask.kt (Rust → Android cross-compilation), and resources for
drawable / mipmap (hdpi → xxxhdpi) / layout / values.
gen/schemas/{mobile,android}-schema.json (11,162 lines each)
landed alongside, and we added the Cargo.toml feature-flag family
(AirIntegration, ExtensionHostCocoon, MistNative, Debug,
grove, cocoon, terminals, debug-protocol, scm-support,
Telemetry).
We did our biggest schema reduction in the same window: 8,467 →
~1,000 lines in ACL manifests (78 % cut). Removed bloated
capabilities; kept only essential Tauri permissions. Refactored
Source/Fn/Binary.rs from 106 to ~20 lines and added
Source/Fn/Binary/Notes.md (91 lines) as architectural reference.
We relocated the project from Editor/editor/src-tauri/ to the
monorepo root. Source/Library.rs became the single Tauri entry
point. tauri.conf.json (94 lines) covered Windows NSIS, macOS DMG,
and .deb bundle targets; build.rs integrated the Tauri build
system. CI landed via .github/workflows/{Rust,GitHub}.yml plus
dependabot.yml. App icons (PNG, ICNS, ICO, Windows tiles),
capabilities/ ACL manifest, and gen/schemas/{desktop,windows}-schema.json
all shipped in this window.
- Core:
tauri,tokio,serde,serde_json,tonic(gRPC). - Plugins:
tauri-plugin-{dialog,fs,localhost,log}. - Serialisation:
prost(protobuf),bincode. - Crypto:
sha2,md5,ring,rcgen,p256,x509-parser,rustls,pem. - Network:
tokio-tungstenite,http,url. - Terminal:
portable-pty. - Process:
sysinfo,hostname.