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

Architecture overview of the Maintain build orchestrator: Rust binary and library, Rhai scripting engine, TOML/JSON5 config editing, data flow, integration points, and CLI configuration.

/Deep Dive

Maintain - Deep Dive

Architecture overview of the Maintain build orchestrator: Rust binary and library, Rhai scripting engine, TOML/JSON5 config editing, data flow, integration points, and CLI configuration.

PUBLISHED DEEP DIVE Source/Content/doc/deep-dive-maintain.md UNAVAILABLE UNAVAILABLE ARCHITECTURE 5

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

# PLATE_01 / MAINTAIN

FIGURE: The capture this record's evidence would show: blueprint in high contrast line work.

This element has no evidence manifest in the build, so there is no capture to describe. The record above still prints its working - form, boundary, dependencies, manual and trace - and none of those fields is a picture.

SUBJECT:
BLUEPRINT IN HIGH CONTRAST LINE WORK
MANIFEST:
UNAVAILABLE
STATE:
UNAVAILABLE
PLATE:
UNAVAILABLE

SOURCE: SOURCE/CONTENT/ELEMENT/WORKING.TS

Maintain is the build orchestrator for Land. It covers the internals of the Maintain Rust binary: its architecture, module layout, data flow, integration with other Land elements, and configuration options.


Architecture 🏗

Maintain is a Rust binary and library. The CLI layer accepts subcommands and delegates to the Rhai scripting engine or direct build functions. Configuration editing is performed through toml_edit and json5 for structured, non-lossy modifications to project configuration files.

Mermaid diagram

Key Modules 🔌

Path Description
Source/main.rs Binary entry point; dispatches to Build, Run, Eliminate or Architecture
Source/Library.rs Library root; re-exports the four modules
Source/Architecture.rs Emits the workspace architecture description
Source/Build/CLI/ clap CLI: Cli.rs, Commands.rs, GetAllProfiles.rs, OutputFormat.rs
Source/Build/Definition.rs Build group definitions: which elements to build, in what order
Source/Build/Fn.rs Core build function dispatch: clean, compile, link, post-process
Source/Build/Process/ Child process spawning (Process.rs) and plist environment assembly (BuildPlistEnvironment.rs)
Source/Build/TomlEdit.rs Non-lossy TOML editing for Cargo.toml version bumps and dependency changes
Source/Build/JsonEdit.rs JSON5-aware configuration editing for package.json and .json5 files
Source/Build/PlistEdit.rs Editing of macOS Info.plist values during bundling
Source/Build/Pascalize.rs PascalCase ↔ words conversion utilities for naming convention enforcement
Source/Build/WordsFromPascal.rs The inverse conversion, used by naming checks
Source/Build/GetTauriTargetTriple.rs Detects current Rust target triple for SideCar binary selection
Source/Build/EnvironmentResolver.rs Resolves environment variables with fallbacks for build-time configuration
Source/Build/Constant.rs Shared build constants
Source/Build/Logger.rs Colored terminal output using the colored crate
Source/Build/Error.rs Unified error type for build failures
Source/Build/Rhai/ConfigLoader.rs Loads and parses Rhai build configuration scripts
Source/Build/Rhai/ScriptRunner.rs Executes Rhai scripts within the build context with Land API bindings
Source/Build/Rhai/EnvironmentResolver.rs Exposes environment variable resolution to Rhai scripts
Source/Run/ The run pipeline: start an element or the editor from a built tree, with its own CLI.rs and Fn.rs
Source/Eliminate/ The elimination pass: Transform/ and the configuration pruning it drives

Data Flow 🔄

Mermaid diagram

Integration Points 🔗

Connecting Element Direction Mechanism Description
Mountain Build target cargo build subprocess Maintain compiles Mountain as part of the debug/release build group
Air Build target cargo build subprocess Air daemon compiled alongside Mountain
Echo Build target cargo build subprocess Echo scheduler compiled as a dependency of Mountain
Rest Build target cargo build subprocess Rest compiler binary built for use by Output
SideCar Build target cargo build subprocess SideCar Download tool compiled and run as part of setup
Output Build trigger pnpm run prepublishOnly subprocess Maintain triggers TypeScript builds via pnpm
Wind / Sky Build trigger pnpm run prepublishOnly subprocess Frontend packages built through Turborepo via Maintain

Configuration 🛠

Option CLI Flag Description
Build mode debug / release subcommand Controls --release flag and optimization level
Target triple --target Rust target triple for cross-compilation
Element filter --element Build only a specific element rather than the full group
Script path --script Override the default Rhai build configuration script
Verbosity --verbose Enable detailed subprocess output logging

Shell Script Entry Points

Script Purpose
Debug.sh Full debug build of all elements
Dev-Mountain.sh Hot-reload development mode for Mountain
Release.sh Optimized release build with all elements
Profile.sh Release build with profiling instrumentation
Debug/All.sh Debug all components including frontend
Debug/Wind.sh Debug Wind TypeScript service layer only

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:
BUILD ORCHESTRATOR
WRITTEN IN:
RUST RHAI
BOUNDARY:
COMMAND LINE
DEPENDS ON:
CARGO TAURI
MANUAL:
/DOC/DEEP-DIVE-MAINTAIN
EVIDENCE:
UNAVAILABLE NO MANIFEST IN THE BUILD

# TRACE / MAINTAIN 03 STEPS

  1. 01 Debug/Build.sh THE BUILD ENTRY
  2. 02 Debug/Run.sh THE RUN ENTRY
  3. 03 Debug/All.sh EVERY PROFILE

SOURCE: /DOC/DEEP-DIVE-MAINTAIN

Deep Dive, 15 PAGES, page 7 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