Dependency Rules
Dependency Rules
Section titled “Dependency Rules”These rules are the architectural contract for the workspace.
Allowed Directions
Section titled “Allowed Directions”graph LR App["rim-app"] --> Application["rim-application"] App --> Infra["rim-infra-*"] App --> Ports["rim-ports"] App --> Domain["rim-domain"] Application --> Domain Application --> Ports Infra --> Application Infra --> Domain Infra --> PortsDisallowed Directions
Section titled “Disallowed Directions”rim-domain -> rim-applicationrim-domain -> rim-infra-*rim-domain -> rim-apprim-ports -> rim-domainor any other workspace crate
Practical Rule Of Thumb
Section titled “Practical Rule Of Thumb”If a crate closer to the center needs something from an outer layer, introduce or refine a port instead of adding a direct dependency.
Review Checklist
Section titled “Review Checklist”When reviewing a dependency change, ask:
- Does this point inward toward more stable policy?
- Does this move workbench state into the domain?
If the answer to the second question is yes, the change is wrong.