Those were rules for functions and classes. Apply the same thinking to a whole program and people start calling it architecture.
Layered architecture
Dividing a program into layers, such as interface, rules and storage, where each layer may only use the ones beneath it. The rule about direction is what does the work.
This is one of the best kinds of rule for an agent, because a check can read every import and refuse, every time. A direction rule that only lives in a document gets broken the first time an import is the shortcut.
Say it to your agent
“Add a structural test: read every import in src/ and fail if anything in src/repo imports from src/service or src/ui. The failure message must name the layer rule and tell the reader to pass the value in instead.”