Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DEP-005DependencyCross-module import bypasses public module surface
Flags imports that reach into another module's internals instead of its public entrypoint.
errorviolationNo auto-fix
How to fix
- Export the supported symbol from the target module public entrypoint.
- Change consumers to import from that entrypoint.
- If the symbol should stay internal, move the behavior into the owning module.
What it means
A cross-module import points at an internal file rather than the target module's declared public surface. Component metadata can provide the larger app, service, or library context around that module.
Why it matters
Public surfaces keep module internals changeable without breaking consumers.
Common causes
- The needed symbol is not exported by the public entrypoint.
- A developer used an auto-import to an internal path.
- The public entrypoint is out of date.
Example bad pattern
import { SessionPolicy } from '../identity/internal/session-policy'Example good pattern
import { SessionPolicy } from '../identity'Related files/config
.archpilot/architecture.json.archpilot/contracts/*.json
Related CLI commands
archpilot validatearchpilot validate --ci
VS Code / Inspector action
Use the finding location to replace internal imports with the declared public entrypoint.
Related docs