[importlinter]
root_packages =
    harddaysengine
include_external_packages = True

# ----------------------------------------------------------------------------
# Contract 1: Strict Clean Architecture Layering
# High-level modules may import low-level modules, never the reverse.
# ----------------------------------------------------------------------------
[importlinter:contract:layered_architecture]
name = Strict Clean Architecture Layer Topology
type = layers
layers =
    harddaysengine.cli
    harddaysengine.app
    harddaysengine.render
    harddaysengine.assets
    harddaysengine.sim

# ----------------------------------------------------------------------------
# Contract 2: Pure 50Hz PAL Simulation Core Isolation
# The simulation kernel must remain 100% deterministic, fast, and serializable.
# Zero C-extension rendering, windowing, audio, or disk I/O dependencies.
# ----------------------------------------------------------------------------
[importlinter:contract:pure_simulation_core]
name = Pure 50Hz Simulation Core (Zero Hardware/Framework Imports)
type = forbidden
source_modules =
    harddaysengine.sim
forbidden_modules =
    pygame
    moderngl
    PIL
    amitools
    pathlib
    shutil
    subprocess
    socket
    random
    time
    datetime
    os
    io
    threading
    secrets
    uuid
    harddaysengine.assets
    harddaysengine.render
    harddaysengine.app
    harddaysengine.cli

# ----------------------------------------------------------------------------
# Contract 3: Headless Asset Pipeline Isolation
# ADF/OFS extraction and Amiga bitplane decoding must run headlessly in CI
# without requiring an OpenGL context or SDL2 display initialization.
# ----------------------------------------------------------------------------
[importlinter:contract:headless_asset_pipeline]
name = Headless Asset Extractor (Forbidden from importing SDL2/OpenGL)
type = forbidden
source_modules =
    harddaysengine.assets
forbidden_modules =
    pygame
    moderngl
    harddaysengine.render
    harddaysengine.app
    harddaysengine.cli

# ----------------------------------------------------------------------------
# Contract 4: Renderer Independence from Application Host
# ModernGL shaders and framebuffer passes must not depend on pygame event loops.
# ----------------------------------------------------------------------------
[importlinter:contract:renderer_independence]
name = ModernGL Renderer Independence from SDL2/Pygame Host
type = forbidden
source_modules =
    harddaysengine.render
forbidden_modules =
    pygame
    amitools
    harddaysengine.app
    harddaysengine.cli