# .importlinter — Tier-1 directional import contracts (Track C)
# Enforced via `lint-imports` inside `make verify` (wired next). Every contract
# below targets a REAL module path verified by recon (C-RECON-06..08), not the
# strategy-doc's vocabulary — e.g. Capability lives at zeo_core.contracts.capabilities,
# NOT zeo_core.capabilities; a contract against the doc name would resolve to
# nothing and never fire.
#
# Deliberately OMITTED here, recorded for Master (Rev 4):
#   - producer->consumer (zeocore/zeointegrations/zeoplugins): cross-PACKAGE,
#     not resolvable inside the zeocore-only work_repo. Belongs to a monorepo
#     linter, outside Track C's single-work_repo scope (§15).
#   - Plugin -> Tool/Cap: `plugin.py` is a per-subsystem MODULE (core/paths, core/fs,
#     config, prompt), not a package — no import-linter target. Handled as a
#     plugin.py grep-ban instead.
#   - "nothing imports a Tool" as a GLOBAL rule: tools legitimately import their own
#     submodules, so a blanket forbidden would fire on legitimate internal imports.
#     The enforceable core (non-tool layers not importing tools) is expressed below;
#     the broad form needs an allowlist/independence design — Master's call.

[importlinter]
root_package = zeo_core
include_external_packages = true

[importlinter:contract:capabilities-not-import-tools]
name = Capabilities must not import Tools
type = forbidden
source_modules =
    zeo_core.contracts.capabilities
forbidden_modules =
    zeo_core.tools

[importlinter:contract:integrations-are-leaves]
name = Integrations are leaves (no Capability/Tool imports)
type = forbidden
source_modules =
    zeo_core.integrations
forbidden_modules =
    zeo_core.tools
    zeo_core.contracts.capabilities

[importlinter:contract:fs-internal-not-import-service]
name = fs _internal must not import service
type = forbidden
source_modules =
    zeo_core.core.fs._internal
forbidden_modules =
    zeo_core.core.fs.service

[importlinter:contract:fs-ops-not-import-results]
name = fs _ops must not import Result types
type = forbidden
source_modules =
    zeo_core.core.fs._ops
forbidden_modules =
    zeo_core.core.fs.results

[importlinter:contract:no-sovereign-or-governance-imports]
name = ZeoCore must not import Sovereign Agent or Zero Employee
type = forbidden
source_modules =
    zeo_core
forbidden_modules =
    sovereign_agent
    zero_employee


# zeocore-SOW-36 slice 0: zeocore code must not import the integrations that
# move to the zeointegrations repository. The sources are wildcards, never the
# bare root package: import-linter skips any source/forbidden pair where one
# contains the other, so `source_modules = zeo_core` would check nothing, and
# the same skip is what exempts each integration's own directory. Every edge
# that exists today is listed below, so the list can only shrink; a listed
# edge that disappears fails the run (unmatched_ignore_imports_alerting).
[importlinter:contract:sow36-core-does-not-import-moving-integrations]
name = zeocore does not import the integrations that move (zeocore-SOW-36 slice 0)
type = forbidden
source_modules =
    zeo_core.*
    zeo_core.integrations.*
forbidden_modules =
    zeo_core.integrations.github
    zeo_core.integrations.google
    zeo_core.integrations.hubspot
    zeo_core.integrations.kit
    zeo_core.integrations.notion
    zeo_core.integrations.database
    zeo_core.integrations.social
    zeo_core.integrations.llms
    zeo_core.integrations.revolut
    zeo_core.integrations.meetings
    zeo_core.integrations.gemini
    zeo_core.integrations.pandoc
    zeo_core.integrations.ffmpeg
    zeo_core.integrations.jupytext
    zeo_core.integrations.notebook
ignore_imports =
    zeo_core.tools.builtin.hubspot -> zeo_core.integrations.hubspot.client
    zeo_core.tools.builtin.hubspot -> zeo_core.integrations.hubspot.models
    zeo_core.tools.builtin.hubspot -> zeo_core.integrations.hubspot.service
    zeo_core.tools.builtin.hubspot -> zeo_core.integrations.hubspot.transport
    zeo_core.tools.builtin.kit -> zeo_core.integrations.kit.client
    zeo_core.tools.builtin.kit -> zeo_core.integrations.kit.models
    zeo_core.tools.builtin.kit -> zeo_core.integrations.kit.service
    zeo_core.tools.builtin.kit -> zeo_core.integrations.kit.transport
    zeo_core.prompt._internal.enhancer -> zeo_core.integrations.llms.models
    zeo_core.prompt._internal.enhancer -> zeo_core.integrations.llms.service
    zeo_core.integrations.hosted.services -> zeo_core.integrations.google.docs
    zeo_core.integrations.hosted.services -> zeo_core.integrations.google.drive
    zeo_core.integrations.hosted.services -> zeo_core.integrations.social.bluesky
    zeo_core.integrations.meetings.adapters -> zeo_core.integrations.google.calendar
    zeo_core.integrations.meetings.adapters -> zeo_core.integrations.google.sheets
    zeo_core.integrations.meetings.adapters -> zeo_core.integrations.notion.upsert

# The two files the wildcards above cannot cover (their packages contain every
# forbidden module), checked on their own imports only.
[importlinter:contract:sow36-package-roots-do-not-import-moving-integrations]
name = zeo_core and zeo_core.integrations package files import no moving integration
type = forbidden
as_packages = False
source_modules =
    zeo_core
    zeo_core.integrations
forbidden_modules =
    zeo_core.integrations.github
    zeo_core.integrations.google
    zeo_core.integrations.hubspot
    zeo_core.integrations.kit
    zeo_core.integrations.notion
    zeo_core.integrations.database
    zeo_core.integrations.social
    zeo_core.integrations.llms
    zeo_core.integrations.revolut
    zeo_core.integrations.meetings
    zeo_core.integrations.gemini
    zeo_core.integrations.pandoc
    zeo_core.integrations.ffmpeg
    zeo_core.integrations.jupytext
    zeo_core.integrations.notebook
