Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DQR-004Data / Query RiskCross-module direct database access bypasses module boundary
Flags database access that reaches into another module's owned data boundary directly.
warningviolationNo auto-fix
How to fix
- Use the owning module's public API or service boundary.
- Add a supported read model or event feed.
- Document temporary migration exceptions and remove them after the migration window.
What the rule validates
One module appears to read or write another module's database artifacts directly.
Why it matters
Direct data access bypasses module contracts and makes ownership, migration, and policy decisions harder to control.
Common causes
- A read model was built by querying another module's tables.
- A migration window introduced temporary direct access.
- The owning module does not expose a public query/API surface yet.
Typical violation example
risk imports payments ledger tables directly for scoring.Typical compliant example
risk consumes a payments-owned public query or event projection.Related rules
AP-DQR-001 - Missing tenant filter evidence in multi-tenant SQLAP-DQR-002 - Broad SELECT * usage in query pathAP-DQR-003 - Unbounded query risk without limit/pagination evidenceAP-DQR-005 - N+1 query evidence in collection loop
Adjacent categories
Related files/config
.archpilot/architecture.json.archpilot/contracts/*.json
Related CLI commands
archpilot validatearchpilot validate --ci