CRUMB a card from devarno-cloud

Layered Architecture L0–L6

stratt intermediate 6 min read

ELI5

STRATT is built like a kitchen brigade: each station only talks to the one above and below it. The cleaver (identity) prepares ingredients, the line cook (schema) plates them, the expediter (graph) sequences orders — nobody reaches across the pass.

Technical Deep Dive

Layer Map

flowchart TB
L6["L6 MERIDIAN<br/>apps/meridian — Astro/Starlight site"]
L5["L5 CLI<br/>@stratt/cli — 9 Phase 1 commands"]
L4["L4 Council Registry<br/>councils/ content sets"]
L35["L3.5 n8n Exporter<br/>@stratt/n8n-exporter — chain compiler"]
L3["L3 Graph<br/>@stratt/graph — DAG, blast radius, CI"]
L2["L2 CRDT<br/>@stratt/crdt — Yjs documents"]
L1["L1 Schema<br/>@stratt/schema — Zod validators, URI parser"]
L0["L0 Identity<br/>@stratt/fingerprint — Blake3 + canonicalisation"]
L6 --> L5 --> L4 --> L35 --> L3 --> L2 --> L1 --> L0

Layer Contracts

LayerPackageOwnsDoes Not Own
L0@stratt/fingerprintcanonicalise(), fingerprintYaml(), blake3:{64hex} formatSchema validation
L1@stratt/schemaZod types, parseUri(), URI_REGEXHashing
L2@stratt/crdtPromptUnitDoc, applyEdit(), merge strategiesDependency resolution
L3@stratt/graphbuildDag(), blastRadius(), cycle detectionEditing
L3.5@stratt/n8n-exporterChain → n8n workflow JSONGeneric graph ops
L5@stratt/cliUser-facing commandsUI rendering
L6apps/meridianDocumentation site renderingAuthoring

L4 is content-only (councils/ directory), not a code package. Every upward call must pass through one layer at a time — @stratt/cli does not import @stratt/fingerprint directly; it goes via schema.

Key Terms

  • Layer → a package boundary with a single responsibility and a fixed downstream dependency.
  • Council → a content set of related units, registered at L4.
  • MERIDIAN → the L6 documentation app that renders units from R2.

Q&A

Q: Why is @stratt/n8n-exporter numbered L3.5 instead of L4? A: It depends on the L3 graph (chains are DAG nodes) but is optional and orthogonal to council content, so it sits between layers rather than above them.

Q: Can L1 schema code call L0 fingerprint code? A: Yes — adjacent layers may call downward. The rule forbids skipping or calling upward.

Examples

A stratt validate invocation: CLI (L5) → schema validators (L1) → URI parser (L1) → fingerprint verify (L0). The CRDT layer (L2) is bypassed because validation reads canonical YAML, not Yjs state.

neighbors on the map