# Import-linter architecture contracts (audit P1-1 / HAN-199).
#
# Enforces the layering the architecture audit recommended: domain/infrastructure
# modules must NOT depend on the interface layer (CLI / TUI / web daemon routes).
# These "forbidden" contracts encode invariants that hold TODAY and will fail CI
# on any future violation. Run: `lint-imports --config .importlinter`.

[importlinter]
root_package = agent_runtime_cockpit
# The private SwarmGraph SDK is an external, optional git dependency; ignore its
# bridge submodule graph so the linter can build the import graph without it.
include_external_packages = False

[importlinter:contract:domain-no-interfaces]
name = Domain/infra modules must not import interface layers (cli/tui/web)
type = forbidden
source_modules =
    agent_runtime_cockpit.security
    agent_runtime_cockpit.audit
    agent_runtime_cockpit.protocol
    agent_runtime_cockpit.isolation
    agent_runtime_cockpit.budget
    agent_runtime_cockpit.evals
    agent_runtime_cockpit.capabilities
    agent_runtime_cockpit.run_diff
    agent_runtime_cockpit.providers
    agent_runtime_cockpit.storage
forbidden_modules =
    agent_runtime_cockpit.cli
    agent_runtime_cockpit.tui
    agent_runtime_cockpit.web

[importlinter:contract:protocol-is-foundational]
name = Protocol must not depend on higher layers
type = forbidden
source_modules =
    agent_runtime_cockpit.protocol
forbidden_modules =
    agent_runtime_cockpit.cli
    agent_runtime_cockpit.tui
    agent_runtime_cockpit.web
    agent_runtime_cockpit.adapters
    agent_runtime_cockpit.integrations
