The Nine Layers of LVD, Explained
A plain-English tour of LVD's nine layers, from Schema to UI: what each one holds, why it sits where it does, and the rule that connects them.
Volatility ν = 0.8 · Chapter 7
Business logic packaged as self-contained tools with validated inputs and predictable outputs. Tools may use lower layers but never each other (Axiom A5).
A plain-English tour of LVD's nine layers, from Schema to UI: what each one holds, why it sits where it does, and the rule that connects them.
Every LVD tool comes out of one factory with five named parts. Here is what they are, why validation stays out of the handler, and what a two-part result buys.
One tool per directory, names that read as commands, and a registry that discovers tools at startup: how LVD keeps Layer 4 easy to navigate as it grows.
Inside a tool, resource calls and pure functions combine in four ways: in sequence, in parallel, by condition, and with a plan for failure. How to choose.
Why the tool, not the repository, owns the transaction boundary, and when a workflow that spans services needs a saga with compensating steps instead.
Axiom A5 forbids tools from depending on other tools. Here is why that small rule keeps a business-logic layer testable, acyclic and easy to change.
How LVD tools are tested with injected resources, which four behaviours to pin down, where integration tests take over, and what the TradeX trading tools show.
How the book's ShopFlow example spreads a retail platform across nine layers, and how three teams split the work along those layers.
How to test Schema, Utils, Resources and Tools in LVD: exhaustive rule checks, property-based tests, containers for adapters and mocks at the resource boundary.
How DDD aggregates shape the Tools layer: one root per set of tools, one aggregate per transaction, and sagas driven by domain events for anything wider.
The whole idea of Layered Volatility Decomposition in one sitting: sort code by how often it changes, depend only downward, and let nine layers do the rest.
A one-page reference to LVD's nine layers: volatility coefficients, what lives in each, what does not, plus the dependency rule and axioms A5 and A6.
Where tools, MCP servers, skills, agents and the UI sit in LVD, why each is placed there, and how that keeps prompt tuning from rippling through your system.