Search docs

Docs search
Back to Rule Catalog
AP-DEP-004Dependency

Cross-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

  1. Decide whether the dependency is legitimate.
  2. If legitimate, add the target module to the source module contract dependsOn list.
  3. 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 validate
  • archpilot validate --ci

VS Code / Inspector action

Open the finding and compare the source module, target module, and contract dependsOn list.

AP-DEP-004 - Cross-module dependency missing from module contract | ArchPilot Docs