The invariant set the rest of the system is built on. Each is declared in .ontology/core.ncl with invariant = true; violating one is an architectural break, not a routine refactor.
A1 · ephemeral-builds
Ephemeral Builds
Build environments are spawned on demand, torn down after completion. No persistent build state exists outside the content-addressed cache and the registry. This prevents environment drift and makes builds reproducible by construction.
A2 · provider-pluggability
Provider Pluggability
Compute and registry are plug-in slots, not hard dependencies.
A3 · cache-content-addressed
Content-Addressed Cache
All build cache is stored as OCI artifacts, keyed by content hash.
A4 · caller-supplies-directives
Caller Supplies Directives
lian-build does not decide what to build or how — callers do.
Build Flow · src/main.rs::main
Architecture
A single binary orchestrates an external HTTP service, drives a spawned VM over SSH, and emits lifecycle events on NATS.
Module
Responsibility
main.rs
CLI parsing, top-level orchestration, NATS event dispatch, OOM-retry control flow.
orchestrator_client.rs
HTTP client: spawn/destroy/p95/record_metrics, wrapping responses in ApiResponse<T>.
buildctl_runner.rs
Drives the spawned VM over SSH. Rsyncs primary context and named extra_contexts (local paths → /build/extra-contexts/<name>/; image refs as docker-image://). Runs buildctl remotely, detects OOM via exit 137.
lian-build is the build driver at the centre of tetra-build — forge-fleet supplies the compute, lamina the build-time layers, solera the runtime images.