🜂 · Build-Layer Catalog · v0.1.0 Beta
“Cooked once, copied forever.”

Toolchain layers and pre-cooked dependency caches for the lian ecosystem.

Reusable Build Strata for
Rust · Wasm · Leptos · Cargo-Chef · sccache

Downstream projects reference lamina layers as FROM bases or --build-context sources, eliminating repeated toolchain setup and dependency compilation on every CI run. Each layer is a single-artifact build_directives.ncl consumed by lian-build.

3
Axioms
13
Layers
3
ADRs
2
Native-dep Layers
Foundations · .ontology/core.ncl

Three Axioms

The invariant set the rest of the catalog rests on.

A1 · catalog-not-runtime

Catalog Not Runtime

lamina produces build artifacts only. Runtime images live in solera.

A2 · layer-dag-as-knowledge

Layer DAG as Knowledge

rust/ changes, which layers must rebuild?\") is answerable without parsing Dockerfiles." data-es="Las relaciones de dependencia entre capas son explícitas, tipadas y consultables — no implícitas solo en cadenas FROM de Dockerfile. workflow.ncl declara build_base y runtime_base por capa; la ontología codifica las aristas. Análisis de impacto (\"si cambia rust/, ¿qué capas deben reconstruirse?\") es responsable sin parsear Dockerfiles." data-key="ax2-p" >Layer dependencies are explicit, typed, and queryable via the ontology.

A3 · build-base-runtime-separation

Build Base / Runtime Base Separation

build_base and runtime_base are distinct workflow.ncl fields.

13 Layers · 3 Classes

Layer Catalog

Three layer classes: toolchain, source-dep, native-dep.

Toolchain Layers · 5
rust
rust:slim-bookworm
Root toolchain. cargo + rustup + cargo-chef + sccache.
wasm
rust
Adds wasm32 + wasm-bindgen + wasm-opt.
leptos
wasm
Adds cargo-leptos.
nickel
rust:slim → debian:slim
Multi-stage. Standalone nickel binary.
nushell
rust:slim → debian:slim
Multi-stage. Standalone nu binary.
Source-Dep Layers (cargo-chef pre-cooked) · 6
ontoref
rust
cargo-chef cook for ontoref (stratumiops peer).
rustelo
leptos
cargo-chef cook for rustelo (Leptos SSR).
stratumiops
rust
cargo-chef cook for stratumiops.
stratumiops-ia
stratumiops
Incremental on stratumiops (AI crates only).
typedialog
rust
cargo-chef cook for typedialog.
librosys
rust
cargo-chef cook for librosys (6 crates).
Native-Dep Layers (apt + cargo-chef) · 2
fastembed
rust
libonnxruntime-dev
apt: libonnxruntime-dev → chef cook.
secretumvault
rust
liboqs-devlibssl-dev
apt: liboqs+openssl (PQC) → chef cook.
Edges · .ontology/core.ncl

Layer DAG

Every edge below is declared as FlowsTo in the ontology.

nickeldebian:slimnushelldebian:slimrustrust:slim-bookwormwasmwasm32 + wasm-bindgenleptoscargo-leptosrustelochef cookontorefstratumiopstypedialoglibrosysstratumiops-iafastembed+ libonnxruntime-devsecretumvault+ liboqs-dev + libssl-dev edges = FlowsTo · solid jade = toolchain edge · solid mint = chef-cook dep edge · solid pine = native-dep edge
Cache Model · cargo-chef + sccache

Two Cache Layers

cargo-chef + sccache are stacked: chef solves the dep graph at layer-build time; sccache deduplicates downstream.

cargo-chef cook

Per-layer · Pre-cooked

cargo-chef cook produces a pre-warmed registry — consumers skip dep compilation.

sccache S3 backend

Cross-layer · Docker secrets

sccache via BuildKit secrets + S3 backend — compilation results deduped across layers.

Decisions · adrs/

Three ADRs

Each ADR carries typed constraints; Hard + Grep = enforceable invariants.

ADR-001 · build-base-runtime-separation
build_base / runtime_base must be distinct fields in workflow.ncl.
grep -E 'build_base|runtime_base' <layer>/workflow.ncl → must be present
Conflating would silently re-introduce build-toolchain bytes into runtime images.
ADR-002 · native-dep-layer-class
Native-dep layers declare native_deps and propagate the requirement to consumers.
grep 'native_deps' fastembed/workflow.ncl secretumvault/workflow.ncl → must be non-empty
Consumers need the same C libs at runtime; making it typed surfaces it to tooling.
ADR-003 · workflow-build-behavior-and-hook-runner
Build behavior declaration decoupled from runner via run-hooks.nu subprocess CLI.
grep -r 'run-hooks.nu' lian-build/ → must reference the subprocess contract
Resolves the Spiral tension declaration-completeness-vs-runner-coupling.
Consumption · downstream Dockerfiles

Consuming Layers

Two consumption modes: FROM base, or COPY --from registry donor.

# Toolchain base — replaces from-scratch rustup install
FROM daoreg.librecloud.online/lamina/rust:1.88 AS builder

# Pre-cooked dependency donor — skips ~minutes of cargo build
FROM daoreg.librecloud.online/lamina/rustelo:1.88 AS rustelo-deps
COPY --from=rustelo-deps /usr/local/cargo/registry /usr/local/cargo/registry
RUN cargo build --release   # source only — deps already cooked
# Suggest layers for a downstream project from its Cargo.toml
nu lian-build/catalog-suggest.nu --project /path/to/project

# Build every layer in the catalog via lian-build aggregate directives
just build-all

# Cascade-trigger: rebuild only descendants of a changed layer
nu lian-build/cascade-trigger.nu --changed rust
Ecosystem · part of the lian family

Sibling Projects

lamina is one of four projects in tetra-build.

Updates · double opt-in

Stay in the Loop

Sporadic updates about lamina. Double opt-in, one-click unsubscribe.

Powered by self-hosted Listmonk. Double opt-in, one-click unsubscribe.