Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DEP-002DependencyForbidden cross-module dependency detected
Flags dependencies blocked by dependency rule configuration.
errorviolationNo auto-fix
How to fix
- Remove or reroute the forbidden dependency.
- Use an allowed public module boundary.
- Only update the rule if the architecture decision changed and is documented.
What the rule validates
A module depends on another module that dependency rules explicitly forbid.
Why it matters
Forbidden dependencies encode architectural decisions that should fail fast when bypassed.
Common causes
- A new import violates dependency policy.
- The rule config is stricter than the current implementation.
- A module boundary changed without updating policy.
Typical violation example
A domain module imports a UI module despite a forbidden dependency rule.Typical compliant example
The domain module exposes behavior through an allowed lower-level boundary.Related rules
AP-DEP-001 - Circular module dependency detectedAP-DEP-003 - Non-public cross-module import detectedAP-DEP-004 - Cross-module dependency missing from module contractAP-DEP-005 - Cross-module import bypasses public module surface
Adjacent categories
Related files/config
.archpilot/dependency-rules.json.archpilot/architecture.json.archpilot/contracts/*.json
Related CLI commands
archpilot validatearchpilot validate --ci