[importlinter]
root_package = fora
include_external_packages = true

[importlinter:contract:layers]
name = Layers run one way only
type = layers
layers =
    fora.adapters
    fora.runtime
    fora.tools
    fora.services
    fora.ports
    fora.core

[importlinter:contract:services]
name = Services do not know about each other
type = independence
modules =
    fora.services.workspace
    fora.services.library
    fora.services.history

[importlinter:contract:model-runtime]
name = Only adapters know the model runtime
type = forbidden
source_modules =
    fora.core
    fora.ports
    fora.services
    fora.tools
    fora.runtime
forbidden_modules =
    pydantic_ai

[importlinter:contract:storage-network]
name = Only adapters touch storage and the network
type = forbidden
source_modules =
    fora.core
    fora.services
    fora.tools
    fora.runtime
forbidden_modules =
    sqlite3
    httpx
    subprocess

[importlinter:contract:core]
name = Core is self contained
type = forbidden
source_modules =
    fora.core
forbidden_modules =
    fora.ports
    fora.services
    fora.tools
    fora.runtime
    fora.adapters
