# Import-linter contracts for mgf-logship (WF-02 / DP-01).
#
# Two contracts: (A) closed-box — the package imports no UI framework, unrelated
# heavy SDK, or other mgf-* sibling; (B) layering — the SHIPPER core (handler +
# wire protocol) must stay stdlib-only: no FastAPI and no httpx. The optional
# collector gateway (behind the [collector] extra) MAY use fastapi + httpx (it
# forwards to OpenObserve). CI runs lint-imports.

[importlinter]
root_packages =
    mgf.logship
include_external_packages = True

[importlinter:contract:mgf-logship-closed-box]
name = mgf.logship imports no UI framework, unrelated heavy SDK, or non-cornerstone sibling
type = forbidden
source_modules =
    mgf.logship
forbidden_modules =
    PySide6
    PyQt6
    PyQt5
    textual
    rich
    click
    requests
    sqlalchemy
    redis
    celery
    numpy
    pandas

[importlinter:contract:mgf-logship-core-stdlib-only]
name = the shipper core (handler + wire protocol) stays stdlib-only (no FastAPI / httpx — only the collector gateway may)
type = forbidden
source_modules =
    mgf.logship._shipper
    mgf.logship._protocol
forbidden_modules =
    fastapi
    starlette
    uvicorn
    httpx
