# Import-linter — keeps mgf.standard a federation leaf (rule DP-01).
#
# mgf-standard sits BELOW mgf-common in the dependency graph: it is
# the source of truth for the standards/contract and ships them as data,
# but it depends on NOTHING in the mgf.* namespace. This contract pins
# that invariant — if a future edit makes mgf.standard import the
# cornerstone (or any sibling), the build fails so reviewers catch the
# cycle before it ships. See docs/standards/DESIGN_PRINCIPLES.md (DP-01)
# and docs/design/federation.md (the one-way dependency contract).

[importlinter]
root_packages =
    mgf.standard
# Required because the contract below names external top-level packages
# (consumer projects) as forbidden — without this flag, import-linter
# refuses to start.
include_external_packages = True

[importlinter:contract:standard-is-the-federation-leaf]
name = mgf.standard does not import the cornerstone, a sibling, or a consumer
type = forbidden
source_modules =
    mgf.standard
forbidden_modules =
    vmanager
    plasmamapper
    inthewords
    # NOTE: the most important target — mgf.common (and any mgf.* sibling)
    # — CANNOT be listed here: import-linter rejects subpackages of an
    # external PEP 420 root (`mgf`) with "subpackages of external packages
    # are not valid" (the same limitation documented in mgf-common's own
    # .importlinter). The load-bearing rule — "mgf.standard imports
    # NOTHING from mgf.*; it is the federation leaf-of-leaves" — is
    # therefore enforced by code review + the fact that this package is
    # pure-stdlib (importlib.resources + pathlib only). An accidental
    # `import mgf.common` would reintroduce the dependency cycle this
    # package exists to avoid; reviewers must catch it.
