ai-agents-metrics

ARCH-012: Integrate import-linter for architectural boundary enforcement

Status: done
Priority: medium
Complexity: low

Rationale

As the codebase grows, ensuring that module dependencies respect architectural layers becomes critical. import-linter (formerly architectural-boundaries) allows defining explicit rules:

Current state: No automated architectural boundary checks; boundaries are enforced only through code review.

Implementation

  1. Add import-linter to dev dependencies in pyproject.toml
  2. Create .importlinter configuration file defining architectural rules:
    • CLI layer → should not import from reporting/history pipelines except via public API
    • Domain layer → should not import from storage or CLI
    • History pipeline → internal modules should not be imported from outside
    • No circular dependencies between any of: domain, storage, CLI, reporting
  3. Add import-linter check to Makefile (under quality target or extended verify)
  4. Integrate into pre-push hook or CI
  5. Document the ruleset in AGENTS.md or architecture.md under “Layer Boundaries”

Acceptance Criteria