Repository navigation
Expand file tree
/
Copy pathimportlinter.ini
More file actions
128 lines (118 loc) · 4.43 KB
/
Copy pathimportlinter.ini
File metadata and controls
128 lines (118 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Import boundary contracts — ARCHITECTURE.md §4.2 / AGENTS.md §5.
# Checked by `make imports` (lint-imports) and blocking in CI.
# When Phase 3 adds llm/client_openai.py, add `ignore_imports = consilium.llm.* -> openai.*`
# to the openai contract; when Phase 9 adds persistence code, add the equivalent
# sqlalchemy/alembic ignores to the db contract.
[importlinter]
root_package = consilium
include_external_packages = True
# ---------------------------------------------------------------------------
# schemas imports nothing internal; everything else may import schemas.
# ---------------------------------------------------------------------------
[importlinter:contract:schemas-independent]
name = schemas/ imports nothing from the rest of the package (AGENTS.md §5)
type = forbidden
source_modules =
consilium.schemas
forbidden_modules =
consilium.api
consilium.core
consilium.vision
consilium.intake
consilium.context
consilium.llm
consilium.agents
consilium.verify
consilium.guardrails
consilium.graph
consilium.persistence
consilium.review
consilium.jobs
consilium.eval
consilium.observability
# ---------------------------------------------------------------------------
# vision/ is CAD machinery: no LLM, no agents, no orchestration.
# ---------------------------------------------------------------------------
[importlinter:contract:vision-isolated]
name = vision/ must not import llm/, agents/, graph/, or intake/ (AGENTS.md §5)
type = forbidden
source_modules =
consilium.vision
forbidden_modules =
consilium.llm
consilium.agents
consilium.graph
consilium.intake
# ---------------------------------------------------------------------------
# intake/ uses llm/ for extraction; never agents/ or context/ (AGENTS.md §5).
# ---------------------------------------------------------------------------
[importlinter:contract:intake-boundary]
name = intake/ must not import agents/, context/, vision/, or graph/
type = forbidden
source_modules =
consilium.intake
forbidden_modules =
consilium.agents
consilium.context
consilium.vision
consilium.graph
# ---------------------------------------------------------------------------
# context/ is deterministic code: facts, builder, router. No LLM, no vision.
# ---------------------------------------------------------------------------
[importlinter:contract:context-deterministic]
name = context/ must not import llm/, vision/, agents/, or graph/ (I-2)
type = forbidden
source_modules =
consilium.context
forbidden_modules =
consilium.llm
consilium.vision
consilium.agents
consilium.graph
# ---------------------------------------------------------------------------
# agents/ receive facts, never CAD machinery (AGENTS.md §5, I-1).
# ---------------------------------------------------------------------------
[importlinter:contract:agents-no-cad]
name = agents/ must not import vision/ (agents receive facts, never CAD machinery)
type = forbidden
source_modules =
consilium.agents
forbidden_modules =
consilium.vision
# ---------------------------------------------------------------------------
# Only llm/ touches the OpenAI SDK (AGENTS.md §5).
# ---------------------------------------------------------------------------
[importlinter:contract:openai-only-in-llm]
name = only llm/ may import the openai SDK
type = forbidden
source_modules =
consilium
forbidden_modules =
openai
ignore_imports =
consilium.llm.client_openai -> openai
# ---------------------------------------------------------------------------
# Only persistence/ touches the database (AGENTS.md §5).
# ---------------------------------------------------------------------------
[importlinter:contract:db-only-in-persistence]
name = only persistence/ may import sqlalchemy/alembic
type = forbidden
source_modules =
consilium
forbidden_modules =
sqlalchemy
alembic
ignore_imports =
consilium.persistence.** -> sqlalchemy
# ---------------------------------------------------------------------------
# LangGraph is thin wiring, confined to graph/ (ARCHITECTURE.md §5.3).
# ---------------------------------------------------------------------------
[importlinter:contract:langgraph-only-in-graph]
name = only graph/ may import langgraph (thin wiring; logic lives in ordinary modules)
type = forbidden
source_modules =
consilium
forbidden_modules =
langgraph
ignore_imports =
consilium.graph.build -> langgraph