-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathboundaries.toml
More file actions
246 lines (212 loc) · 5.8 KB
/
Copy pathboundaries.toml
File metadata and controls
246 lines (212 loc) · 5.8 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# boundaries.toml — semantic module dependency policy (v2)
#
# Enforces the architecture rules from docs/architecture/dependency-rules.md
# through the repo-owned `cargo xtask architecture` checker.
#
# Run: cargo xtask architecture check
# CI: cargo run --locked --package xtask -- architecture check
#
# Boundaries listed below are evaluated as source boundaries. Omitting a
# top-level module (e.g. internal_tests) keeps it out of the governed set.
version = 1
# internal_tests is intentionally omitted. It remains a cross-pipeline bucket
# for owner-spanning regressions rather than a governed architecture boundary.
[modules]
errors = {}
format = {}
timeline = {}
simplification = {}
graph = {}
mermaid = {}
engines = { tags = { role = "runtime-facade" } }
render = { tags = { role = "runtime-facade" } }
payload = {}
registry = {}
diagrams = {}
builtins = { tags = { role = "runtime-facade" } }
commands = {}
mmds = {}
views = {}
frontends = { tags = { role = "runtime-facade" } }
runtime = {}
# --- Allow rules (one per governed source boundary) ---
[[rules]]
id = "allow-errors"
type = "allow"
[rules.config]
source = "errors"
allowed = []
[[rules]]
id = "allow-format"
type = "allow"
[rules.config]
source = "format"
allowed = ["errors"]
[[rules]]
id = "allow-timeline"
type = "allow"
[rules.config]
source = "timeline"
allowed = []
[[rules]]
id = "allow-simplification"
type = "allow"
[rules.config]
source = "simplification"
allowed = ["errors", "format"]
# Must not import render, engines, diagrams, or runtime.
[[rules]]
id = "allow-graph"
type = "allow"
[rules.config]
source = "graph"
allowed = ["errors", "format"]
# Plan 0146: graph::edge_marker is a leaf submodule — pure data keyed on Arrow,
# consumed by graph::routing's label clamp and by internal_tests' boundary
# assertion. Enumerate allowed inbound deps explicitly so the helper cannot
# silently grow couplings to other graph submodules.
[[rules]]
id = "edge-marker-leaf-allow"
type = "allow"
[rules.config]
source = "graph::edge_marker"
allowed = ["graph::edge"]
[[rules]]
id = "allow-mermaid"
type = "allow"
[rules.config]
source = "mermaid"
allowed = ["errors", "graph", "timeline"]
# Must not import render, diagrams, or runtime.
[[rules]]
id = "allow-engines"
type = "allow"
[rules.config]
source = "engines"
allowed = ["errors", "format", "graph"]
# Must not import diagrams, config, engines, or runtime.
[[rules]]
id = "allow-render"
type = "allow"
[rules.config]
source = "render"
allowed = ["format", "graph", "simplification", "timeline"]
# Shared text/SVG helpers sit below the family-specific renderers.
[[rules]]
id = "render-submodule-layers"
type = "layers"
[rules.config]
order = ["render::text", "render::svg", "render::graph", "render::timeline"]
# Shared render utility layers should not depend on each other directly.
[[rules]]
id = "render-shared-submodules-independent"
type = "independence"
[rules.config]
members = ["render::text", "render::svg"]
[[rules]]
id = "allow-payload"
type = "allow"
[rules.config]
source = "payload"
allowed = ["graph", "timeline"]
[[rules]]
id = "allow-registry"
type = "allow"
[rules.config]
source = "registry"
allowed = ["errors", "format", "payload"]
# Must not import render or engines (stops at into_payload).
[[rules]]
id = "allow-diagrams"
type = "allow"
[rules.config]
source = "diagrams"
allowed = ["errors", "graph", "mermaid", "payload", "registry", "timeline"]
[[rules]]
id = "allow-builtins"
type = "allow"
[rules.config]
source = "builtins"
allowed = ["diagrams", "format", "registry"]
[[rules]]
id = "allow-commands"
type = "allow"
[rules.config]
source = "commands"
allowed = ["errors", "format", "graph", "mmds", "runtime"]
# Must not import diagrams, config, engines, render, or runtime.
[[rules]]
id = "allow-mmds"
type = "allow"
[rules.config]
source = "mmds"
allowed = ["errors", "format", "graph", "simplification", "timeline"]
[[rules]]
id = "allow-views"
type = "allow"
[rules.config]
source = "views"
allowed = ["graph", "mmds"]
[[rules]]
id = "allow-frontends"
type = "allow"
[rules.config]
source = "frontends"
allowed = ["mermaid", "mmds"]
[[rules]]
id = "allow-runtime"
type = "allow"
[rules.config]
source = "runtime"
allowed = [
"builtins", "engines", "errors",
"format", "frontends", "graph", "mermaid", "mmds",
"payload", "registry", "render", "simplification", "timeline", "views",
]
# --- Layers rule (pipeline spine ordering) ---
# Lower layers must not depend on higher layers.
[[rules]]
id = "pipeline-layers"
type = "layers"
[rules.config]
order = ["errors", "format", "graph", "engines", "render", "runtime"]
# --- Independence rules (peer isolation) ---
# These frontends must not depend on each other.
[[rules]]
id = "parser-independence"
type = "independence"
[rules.config]
members = ["mermaid", "mmds"]
# The three pipeline pillars must not cross-depend.
[[rules]]
id = "pipeline-pillar-independence"
type = "independence"
[rules.config]
members = ["engines", "render", "diagrams"]
# --- Protected rules (facade-only access) ---
# Boundaries tagged role=runtime-facade are only accessible through runtime.
[[rules]]
id = "protect-runtime-facades"
type = "protected"
[rules.config]
targets = { tag = "role", value = "runtime-facade" }
allowed_importers = ["runtime"]
# diagrams is accessed only by builtins (which wires it into the registry).
[[rules]]
id = "protect-diagrams"
type = "protected"
[rules.config]
targets = ["diagrams"]
allowed_importers = ["builtins"]
# --- Acyclic rule (DAG guarantee) ---
# The full boundary graph must be cycle-free.
# The "*" wildcard expands to every discovered module at all depths.
# Parent/child edges (mod.rs ↔ child) are skipped — these are a normal
# Rust structural pattern. Any non-structural cycle must be documented
# as an explicit exception below.
[[rules]]
id = "no-boundary-cycles"
type = "acyclic"
[rules.config]
members = ["*"]
skip_parent_child = true