[importlinter]
root_packages =
    bootstrap
    surfaces
    config
    core
    gateway
    integrations
    infrastructure
    tools

[importlinter:contract:config-independent]
name = Config is independent
type = independence
modules =
    config

[importlinter:contract:gateway-core-below-surfaces]
name = Gateway core sits below transports and web
type = forbidden
source_modules =
    gateway.core
forbidden_modules =
    gateway.transports
    gateway.web
ignore_imports =
    # Composition root: the one edge into the surface facade, which owns web
    # and chat transport wiring. Pinned by gateway/tests/test_package_borders.py
    # (test_only_controller_imports_the_startup_module).
    gateway.core.lifecycle.controller -> gateway.startup

[importlinter:contract:gateway-web-no-transports]
name = Gateway web surface never imports chat transports
type = forbidden
source_modules =
    gateway.web
forbidden_modules =
    gateway.transports

[importlinter:contract:gateway-transports-independent]
name = Gateway transports are peers
type = independence
modules =
    gateway.transports.slack
    gateway.transports.discord
    gateway.transports.telegram

# Full layered contracts (core ⊄ tools, integrations ⊄ cli, …) live in
# ``.importlinter.strict`` for local burn-down. Run: ``make check-layers-strict``
# Regenerate baselines: ``uv run lint-imports --config .importlinter.strict``
