# Import-linter contracts for mgf-sqlalchemy (WF-02 / DP-01).
#
# mgf-sqlalchemy is a thin async-SQLAlchemy adapter. Its closed-box invariant
# (__init__.py): it depends on mgf-common + SQLAlchemy and NOTHING ELSE in the
# federation. SQLAlchemy is the framework it adapts and mgf.common is its
# cornerstone runtime dep — both allowed. Everything else (UI frameworks, other
# heavy third-party SDKs, and other mgf-* siblings) is forbidden; CI runs lint-imports.

[importlinter]
root_packages =
    mgf.sqlalchemy
include_external_packages = True

[importlinter:contract:mgf-sqlalchemy-closed-box]
name = mgf.sqlalchemy imports no UI framework, unrelated heavy SDK, or non-cornerstone sibling
type = forbidden
source_modules =
    mgf.sqlalchemy
forbidden_modules =
    # UI frameworks
    PySide6
    PyQt6
    PyQt5
    textual
    rich
    click
    # Web / unrelated heavy third-party (sqlalchemy + mgf.common are the allowed deps)
    fastapi
    starlette
    flask
    django
    requests
    httpx
    pydantic
    numpy
    pandas
    # (mgf-* siblings are external subpackages — not nameable here — but any
    # third-party they would pull is forbidden above, so a sibling import is
    # caught transitively. mgf.common is the ONE allowed federation dep.)
