Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DEP-006DependencyDeclared module dependency not used
Flags a module contract dependency that no longer appears in implementation imports.
warningviolationNo auto-fix
How to fix
- Remove stale dependsOn entries.
- If the dependency is intentional but dynamic, document the reason.
- Run validation after contract cleanup.
What the rule validates
The contract says a module depends on another module, but current imports do not show that relationship.
Why it matters
Stale dependency declarations make architecture diagrams and reviews noisier than they need to be.
Common causes
- A dependency was removed from code but not from the contract.
- The dependency is only used dynamically.
- The module is being prepared for a near-future change.
Typical violation example
billing declares notifications but no billing code imports notifications.Typical compliant example
billing only declares modules it actually depends on, or documents intentional dynamic dependency evidence.Related rules
AP-DEP-001 - Circular module dependency detectedAP-DEP-002 - Forbidden cross-module dependency detectedAP-DEP-003 - Non-public cross-module import detectedAP-DEP-004 - Cross-module dependency missing from module contract
Adjacent categories
Related files/config
.archpilot/architecture.json.archpilot/contracts/*.json
Related CLI commands
archpilot validatearchpilot validate --ci
Related docs