Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DEP-004DependencyCross-module dependency missing from module contract
Flags an actual cross-module import that is not declared in the source module contract.
errorviolationNo auto-fix
How to fix
- Decide whether the dependency is legitimate.
- If legitimate, add the target module to the source module contract dependsOn list.
- If not legitimate, move the behavior behind the correct public module boundary.
What it means
A module depends on another module in code, but that relationship is not declared in its contract. In component-aware repositories, the module is the code-level grouping inside the owning component.
Why it matters
Undeclared dependencies hide coupling and make architecture impact hard to review.
Common causes
- A new import was added without updating dependsOn.
- The module contract is stale.
- The code should call a different module boundary instead.
Example bad pattern
mobile imports notifications code while mobile's contract does not declare notifications.Example good pattern
mobile declares notifications in dependsOn or routes the behavior through an approved boundary.Related files/config
.archpilot/architecture.json.archpilot/contracts/*.json
Related CLI commands
archpilot validatearchpilot validate --ci
VS Code / Inspector action
Open the finding and compare the source module, target module, and contract dependsOn list.