Aggregates and the Tools Layer
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.
Every architecture diagram promises that dependencies flow one way. Every old codebase eventually contains a loop: A needs B, B needs C, and C quietly needs A. LVD makes a stronger claim than "we try to avoid loops". Inside the model, the rules leave no room for them. The reasoning is short enough to follow in words alone, and it explains why the rules are shaped the way they are.
Picture the layers as floors in a building, with Schema on the ground floor and the UI on top. Give every component the number of its floor. The central rule is that a component may depend only on something on its own floor or a lower one. Follow any chain of dependencies and you only ever stay level or move down. You never go up.
Now suppose a loop existed. You start at some component, follow its dependencies and, after some steps, arrive back where you began. You have returned to your starting floor, but you can never have climbed on the way. So you cannot have descended either, because you would then have needed a climb to return. The only possibility left is that you never changed floor at all: every component in the loop lives on one floor. That is the book's argument in essence. A loop would have to include at least one step upward, and the rule forbids upward steps.
The model sharpens this for dependencies between two different floors: they must point strictly downward. Staying level is a separate question, and that is where the next section picks up.
That argument eliminates every loop spanning more than one layer. It leaves loops confined to a single layer, and the model treats the two cases differently.
That second case is worth stating plainly. The ordering by itself is what rules out loops between layers. Inside a layer that permits sideways dependencies, the guarantee rests on an explicit no-loops requirement, not on the ordering. A codebase has to honour that requirement, and in practice checking it is a job for a tool. A loop-detection pass over the dependency graph takes time proportional to the graph's size, so running it on every build is cheap. The same caveat applies to the theorem as a whole: it describes architectures that follow the rules, and says nothing about a codebase that has quietly broken them.
The appendix builds on a classic result from graph theory: you can line up the nodes of a directed graph so that every arrow points the same way if and only if the graph has no loops. Both directions can be argued without symbols.
If such a line-up exists, a loop is impossible. Going once around a loop would require some node to come before itself.
If there are no loops, a line-up always exists, and the book proves it with a peeling procedure. Find a node that nothing else still points at, set it aside, and cross out the arrows it sends. Repeat. Suppose you get stuck with nodes left over. Then every remaining node is pointed at by another remaining node. Pick one and walk backwards along the arrows: since the supply of nodes is finite, you must eventually revisit one, and that is a loop. A graph without loops therefore never leaves you stuck.
For LVD this means the layer numbers are a ready-made ordering. The model does not have to discover one, because the numbers already provide it.
One more result in the appendix explains why the model can keep adding restrictions. Removing arrows from a graph without loops can never create a loop. Axioms A5 and A6, the tool-independence rule and the UI boundary, only take dependencies away from what the ordering would otherwise allow. They therefore inherit every guarantee the appendix proves, including this one.
The guarantee is not magic. A one-way ordering makes loops between layers impossible by construction, a flat ban handles the Tools layer, and a stated requirement plus a checker covers loops within the remaining layers. For the practical tooling, read detecting dependency cycles before they ship and architecture verification with graphs, and for the vocabulary behind the argument see graph theory for architects.