arkgate 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +2 -1
- package/bin/ark-check.mjs +194 -3867
- package/bin/ark-layer-match.mjs +168 -0
- package/bin/ark-shared.mjs +8 -131
- package/bin/lib/agent-gates.mjs +1550 -0
- package/bin/lib/doctor-plan.mjs +503 -0
- package/bin/lib/html-report.mjs +1301 -0
- package/bin/lib/presets.mjs +244 -0
- package/bin/lib/suggestions.mjs +109 -0
- package/bin/lib/violations.mjs +170 -0
- package/dist/eslint/index.cjs +263 -23
- package/dist/eslint/index.cjs.map +1 -1
- package/dist/eslint/index.d.cts +54 -1
- package/dist/eslint/index.d.ts +54 -1
- package/dist/eslint/index.js +245 -22
- package/dist/eslint/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.cjs +1 -1
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.js +1 -1
- package/dist/nestjs/index.js.map +1 -1
- package/docs/agent-guide.md +4 -3
- package/docs/ai-gates.md +15 -29
- package/package.json +2 -1
- package/server.json +2 -2
package/dist/eslint/index.js
CHANGED
|
@@ -1,4 +1,166 @@
|
|
|
1
1
|
// src/eslint/index.ts
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
// src/domain/layerMatch.ts
|
|
6
|
+
var regexpCache = /* @__PURE__ */ new Map();
|
|
7
|
+
function escapeLiteral(ch) {
|
|
8
|
+
return /[.*+?^${}()|[\]\\]/.test(ch) ? `\\${ch}` : ch;
|
|
9
|
+
}
|
|
10
|
+
function bracesBalanced(glob) {
|
|
11
|
+
let depth = 0;
|
|
12
|
+
for (let i = 0; i < glob.length; i += 1) {
|
|
13
|
+
const c = glob[i];
|
|
14
|
+
if (c === "\\") {
|
|
15
|
+
i += 1;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (c === "{") depth += 1;
|
|
19
|
+
else if (c === "}") {
|
|
20
|
+
depth -= 1;
|
|
21
|
+
if (depth < 0) return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return depth === 0;
|
|
25
|
+
}
|
|
26
|
+
function globToRegExp(pattern) {
|
|
27
|
+
const cached = regexpCache.get(pattern);
|
|
28
|
+
if (cached) return cached;
|
|
29
|
+
const glob = pattern.split("\\").join("/");
|
|
30
|
+
const useBraces = bracesBalanced(glob);
|
|
31
|
+
let out = "";
|
|
32
|
+
let braceDepth = 0;
|
|
33
|
+
for (let i = 0; i < glob.length; i += 1) {
|
|
34
|
+
const c = glob[i];
|
|
35
|
+
if (c === "\\" && i + 1 < glob.length) {
|
|
36
|
+
out += escapeLiteral(glob[i + 1]);
|
|
37
|
+
i += 1;
|
|
38
|
+
} else if (c === "*") {
|
|
39
|
+
if (glob[i + 1] === "*") {
|
|
40
|
+
if (glob[i + 2] === "/") {
|
|
41
|
+
out += "(?:.*/)?";
|
|
42
|
+
i += 2;
|
|
43
|
+
} else {
|
|
44
|
+
out += ".*";
|
|
45
|
+
i += 1;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
out += "[^/]*";
|
|
49
|
+
}
|
|
50
|
+
} else if (c === "?") {
|
|
51
|
+
out += "[^/]";
|
|
52
|
+
} else if (c === "{" && useBraces) {
|
|
53
|
+
out += "(?:";
|
|
54
|
+
braceDepth += 1;
|
|
55
|
+
} else if (c === "}" && useBraces && braceDepth > 0) {
|
|
56
|
+
out += ")";
|
|
57
|
+
braceDepth -= 1;
|
|
58
|
+
} else if (c === "," && useBraces && braceDepth > 0) {
|
|
59
|
+
out += "|";
|
|
60
|
+
} else {
|
|
61
|
+
out += escapeLiteral(c);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const re = new RegExp(`^${out}$`);
|
|
65
|
+
regexpCache.set(pattern, re);
|
|
66
|
+
return re;
|
|
67
|
+
}
|
|
68
|
+
function patternSpecificity(pattern) {
|
|
69
|
+
const glob = String(pattern).split("\\").join("/");
|
|
70
|
+
const beforeWildcard = glob.split("*")[0];
|
|
71
|
+
const literalSegments = beforeWildcard.split("/").filter(Boolean).length;
|
|
72
|
+
const literalLength = glob.replace(/\*/g, "").length;
|
|
73
|
+
return literalSegments * 1e4 + literalLength;
|
|
74
|
+
}
|
|
75
|
+
function layerForRelativePath(relPath, layers) {
|
|
76
|
+
const rel = String(relPath).split("\\").join("/");
|
|
77
|
+
let bestName;
|
|
78
|
+
let bestScore = -1;
|
|
79
|
+
for (const layer of layers ?? []) {
|
|
80
|
+
if ((layer.exclude ?? []).some((pattern) => globToRegExp(pattern).test(rel))) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
for (const pattern of layer.patterns ?? []) {
|
|
84
|
+
if (globToRegExp(pattern).test(rel)) {
|
|
85
|
+
const score = patternSpecificity(pattern);
|
|
86
|
+
if (score > bestScore) {
|
|
87
|
+
bestScore = score;
|
|
88
|
+
bestName = layer.name;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return bestName;
|
|
94
|
+
}
|
|
95
|
+
function isEdgeDenied(rules2, from, to) {
|
|
96
|
+
if (from === to) return false;
|
|
97
|
+
const hit = (rules2 ?? []).find((r) => r.from === from && r.to === to);
|
|
98
|
+
return hit?.allowed === false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/eslint/index.ts
|
|
102
|
+
function lintedFilename(context) {
|
|
103
|
+
if (typeof context.physicalFilename === "string" && context.physicalFilename.length > 0) {
|
|
104
|
+
return context.physicalFilename;
|
|
105
|
+
}
|
|
106
|
+
if (typeof context.filename === "string" && context.filename.length > 0) {
|
|
107
|
+
return context.filename;
|
|
108
|
+
}
|
|
109
|
+
if (typeof context.getFilename === "function") {
|
|
110
|
+
try {
|
|
111
|
+
const name = context.getFilename();
|
|
112
|
+
if (typeof name === "string" && name.length > 0) return name;
|
|
113
|
+
} catch {
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return "";
|
|
117
|
+
}
|
|
118
|
+
function findConfigPath(startFile) {
|
|
119
|
+
if (!startFile || startFile === "<input>" || startFile.startsWith("stdin")) return null;
|
|
120
|
+
let dir = path.dirname(path.resolve(startFile));
|
|
121
|
+
for (; ; ) {
|
|
122
|
+
const candidate = path.join(dir, "ark.config.json");
|
|
123
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
124
|
+
const parent = path.dirname(dir);
|
|
125
|
+
if (parent === dir) return null;
|
|
126
|
+
dir = parent;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
var _configCache = /* @__PURE__ */ new Map();
|
|
130
|
+
function loadArkConfig(configPath) {
|
|
131
|
+
if (_configCache.has(configPath)) return _configCache.get(configPath) ?? null;
|
|
132
|
+
try {
|
|
133
|
+
const raw = JSON.parse(fs.readFileSync(configPath, "utf8"));
|
|
134
|
+
_configCache.set(configPath, raw);
|
|
135
|
+
return raw;
|
|
136
|
+
} catch {
|
|
137
|
+
_configCache.set(configPath, null);
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function resolveRelativeImport(fromFile, specifier) {
|
|
142
|
+
if (!specifier.startsWith(".")) return null;
|
|
143
|
+
const base = path.resolve(path.dirname(fromFile), specifier);
|
|
144
|
+
const candidates = [
|
|
145
|
+
base,
|
|
146
|
+
`${base}.ts`,
|
|
147
|
+
`${base}.tsx`,
|
|
148
|
+
`${base}.mts`,
|
|
149
|
+
`${base}.cts`,
|
|
150
|
+
`${base}.js`,
|
|
151
|
+
`${base}.jsx`,
|
|
152
|
+
path.join(base, "index.ts"),
|
|
153
|
+
path.join(base, "index.tsx"),
|
|
154
|
+
path.join(base, "index.js")
|
|
155
|
+
];
|
|
156
|
+
for (const c of candidates) {
|
|
157
|
+
try {
|
|
158
|
+
if (fs.existsSync(c) && fs.statSync(c).isFile()) return c;
|
|
159
|
+
} catch {
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return `${base}.ts`;
|
|
163
|
+
}
|
|
2
164
|
function stringValue(node) {
|
|
3
165
|
return typeof node?.value === "string" ? node.value : void 0;
|
|
4
166
|
}
|
|
@@ -19,14 +181,18 @@ function objectHasMetadataSource(node) {
|
|
|
19
181
|
return objectHasProperty(metadata, "source");
|
|
20
182
|
}
|
|
21
183
|
function looksLikeIntent(value) {
|
|
22
|
-
return /^(Domain|Application|Adapter|Workflow|Job|Presentation|Reporting|Metadata|Security|Audit|Observability|Kernel)\.[A-Za-z0-9_.]+$/.test(
|
|
184
|
+
return /^(Domain|Application|Adapter|Workflow|Job|Presentation|Reporting|Metadata|Security|Audit|Observability|Kernel)\.[A-Za-z0-9_.]+$/.test(
|
|
185
|
+
value
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
function isPublishCall(node) {
|
|
189
|
+
return calleePropertyName(node) === "publish";
|
|
23
190
|
}
|
|
24
|
-
function
|
|
25
|
-
const filename = context.getFilename?.() ?? "";
|
|
191
|
+
function isDomainFileHeuristic(filename) {
|
|
26
192
|
const normalized = filename.split("\\").join("/").toLowerCase();
|
|
27
193
|
return normalized.includes("/domain/") || normalized.endsWith("/domain.ts");
|
|
28
194
|
}
|
|
29
|
-
function
|
|
195
|
+
function isInfraImportHeuristic(specifier) {
|
|
30
196
|
const normalized = specifier.toLowerCase();
|
|
31
197
|
return [
|
|
32
198
|
"adapter",
|
|
@@ -40,26 +206,49 @@ function isInfraImport(specifier) {
|
|
|
40
206
|
"db"
|
|
41
207
|
].some((token) => normalized.includes(token));
|
|
42
208
|
}
|
|
43
|
-
|
|
44
|
-
return calleePropertyName(node) === "publish";
|
|
45
|
-
}
|
|
209
|
+
var DEFAULT_FORBIDDEN_GLOBALS = ["fetch", "process", "Date.now", "Math.random"];
|
|
46
210
|
var noDomainInfraImports = {
|
|
47
211
|
meta: {
|
|
48
212
|
type: "problem",
|
|
49
213
|
docs: {
|
|
50
|
-
description: "Disallow
|
|
214
|
+
description: "Disallow imports that violate ark.config.json layer rules (same contract as arkgate-check). Falls back to domain\u2192infra path heuristics when no config is found."
|
|
51
215
|
},
|
|
52
216
|
messages: {
|
|
53
|
-
forbiddenImport: "
|
|
217
|
+
forbiddenImport: "Architecture: {{fromLayer}} must not import {{toLayer}} (ark.config.json). Specifier: {{specifier}}",
|
|
218
|
+
forbiddenImportHeuristic: "Domain code must not import infrastructure, adapters, repositories, or database modules."
|
|
54
219
|
},
|
|
55
220
|
schema: []
|
|
56
221
|
},
|
|
57
222
|
create(context) {
|
|
223
|
+
const filename = lintedFilename(context);
|
|
224
|
+
const configPath = findConfigPath(filename);
|
|
225
|
+
const config = configPath ? loadArkConfig(configPath) : null;
|
|
226
|
+
const root = configPath ? path.dirname(configPath) : null;
|
|
58
227
|
const check = (node) => {
|
|
59
|
-
if (!isDomainFile(context)) return;
|
|
60
228
|
const source = stringValue(node.source);
|
|
61
|
-
if (source
|
|
62
|
-
|
|
229
|
+
if (!source) return;
|
|
230
|
+
if (config && root && filename) {
|
|
231
|
+
const absFile = path.isAbsolute(filename) ? filename : path.resolve(filename);
|
|
232
|
+
const relFile = path.relative(root, absFile).split(path.sep).join("/");
|
|
233
|
+
const fromLayer = layerForRelativePath(relFile, config.layers);
|
|
234
|
+
if (!fromLayer) return;
|
|
235
|
+
const targetAbs = resolveRelativeImport(absFile, source);
|
|
236
|
+
if (!targetAbs) return;
|
|
237
|
+
const relTarget = path.relative(root, targetAbs).split(path.sep).join("/");
|
|
238
|
+
if (relTarget.startsWith("..")) return;
|
|
239
|
+
const toLayer = layerForRelativePath(relTarget, config.layers);
|
|
240
|
+
if (!toLayer) return;
|
|
241
|
+
if (isEdgeDenied(config.rules, fromLayer, toLayer)) {
|
|
242
|
+
context.report({
|
|
243
|
+
node,
|
|
244
|
+
messageId: "forbiddenImport",
|
|
245
|
+
data: { fromLayer, toLayer, specifier: source }
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (isDomainFileHeuristic(filename) && isInfraImportHeuristic(source)) {
|
|
251
|
+
context.report({ node, messageId: "forbiddenImportHeuristic" });
|
|
63
252
|
}
|
|
64
253
|
};
|
|
65
254
|
return {
|
|
@@ -118,15 +307,15 @@ var requirePublishSource = {
|
|
|
118
307
|
};
|
|
119
308
|
}
|
|
120
309
|
};
|
|
121
|
-
var DEFAULT_FORBIDDEN_GLOBALS = ["fetch", "process", "Date.now", "Math.random"];
|
|
122
310
|
var noForbiddenGlobals = {
|
|
123
311
|
meta: {
|
|
124
312
|
type: "problem",
|
|
125
313
|
docs: {
|
|
126
|
-
description:
|
|
314
|
+
description: "Disallow ambient globals from the layer\u2019s forbiddenGlobals in ark.config.json (same purity surface as arkgate-check). Option `globals` overrides. Without config, defaults apply only on domain-like paths."
|
|
127
315
|
},
|
|
128
316
|
messages: {
|
|
129
|
-
forbiddenGlobal: 'Ambient global "{{name}}" is forbidden
|
|
317
|
+
forbiddenGlobal: 'Ambient global "{{name}}" is forbidden in {{layer}} (ark.config.json); inject the capability through a port instead.',
|
|
318
|
+
forbiddenGlobalDefault: 'Ambient global "{{name}}" is forbidden here; inject the capability through a port instead.'
|
|
130
319
|
},
|
|
131
320
|
schema: [
|
|
132
321
|
{
|
|
@@ -139,13 +328,39 @@ var noForbiddenGlobals = {
|
|
|
139
328
|
]
|
|
140
329
|
},
|
|
141
330
|
create(context) {
|
|
331
|
+
const filename = lintedFilename(context);
|
|
142
332
|
const option = context.options?.[0];
|
|
143
|
-
const
|
|
144
|
-
const
|
|
333
|
+
const configPath = findConfigPath(filename);
|
|
334
|
+
const config = configPath ? loadArkConfig(configPath) : null;
|
|
335
|
+
const root = configPath ? path.dirname(configPath) : null;
|
|
336
|
+
let globals = null;
|
|
337
|
+
let layerName = "this layer";
|
|
338
|
+
if (option?.globals) {
|
|
339
|
+
globals = new Set(option.globals);
|
|
340
|
+
} else if (config && root && filename) {
|
|
341
|
+
const absFile = path.isAbsolute(filename) ? filename : path.resolve(filename);
|
|
342
|
+
const relFile = path.relative(root, absFile).split(path.sep).join("/");
|
|
343
|
+
const layer = config.layers?.find(
|
|
344
|
+
(l) => l.name === layerForRelativePath(relFile, config.layers)
|
|
345
|
+
);
|
|
346
|
+
if (layer?.forbiddenGlobals?.length) {
|
|
347
|
+
globals = new Set(layer.forbiddenGlobals);
|
|
348
|
+
layerName = layer.name;
|
|
349
|
+
} else {
|
|
350
|
+
globals = null;
|
|
351
|
+
}
|
|
352
|
+
} else if (isDomainFileHeuristic(filename)) {
|
|
353
|
+
globals = new Set(DEFAULT_FORBIDDEN_GLOBALS);
|
|
354
|
+
}
|
|
355
|
+
if (!globals) {
|
|
356
|
+
return {};
|
|
357
|
+
}
|
|
358
|
+
const report = (node, name) => context.report({
|
|
359
|
+
node,
|
|
360
|
+
messageId: config ? "forbiddenGlobal" : "forbiddenGlobalDefault",
|
|
361
|
+
data: { name, layer: layerName }
|
|
362
|
+
});
|
|
145
363
|
return {
|
|
146
|
-
// Same positional detection as ark-check's FORBIDDEN_GLOBAL: property accesses on a
|
|
147
|
-
// forbidden base (console.log, Date.now), direct calls, and constructions. Bare
|
|
148
|
-
// identifier mentions elsewhere are not flagged (avoids shadowed-local false positives).
|
|
149
364
|
MemberExpression(node) {
|
|
150
365
|
const base = node.object?.type === "Identifier" ? node.object.name : void 0;
|
|
151
366
|
if (!base) return;
|
|
@@ -177,17 +392,25 @@ plugin.configs = {
|
|
|
177
392
|
rules: {
|
|
178
393
|
"ark/no-domain-infra-imports": "error",
|
|
179
394
|
"ark/no-raw-event-publish": "error",
|
|
180
|
-
"ark/require-publish-source": "error"
|
|
395
|
+
"ark/require-publish-source": "error",
|
|
396
|
+
"ark/no-forbidden-globals": "error"
|
|
181
397
|
}
|
|
182
398
|
}
|
|
183
399
|
};
|
|
184
400
|
var eslint_default = plugin;
|
|
185
401
|
export {
|
|
186
402
|
eslint_default as default,
|
|
403
|
+
findConfigPath,
|
|
404
|
+
globToRegExp,
|
|
405
|
+
isEdgeDenied,
|
|
406
|
+
layerForRelativePath,
|
|
407
|
+
loadArkConfig,
|
|
187
408
|
noDomainInfraImports,
|
|
188
409
|
noForbiddenGlobals,
|
|
189
410
|
noRawEventPublish,
|
|
411
|
+
patternSpecificity,
|
|
190
412
|
plugin,
|
|
191
|
-
requirePublishSource
|
|
413
|
+
requirePublishSource,
|
|
414
|
+
resolveRelativeImport
|
|
192
415
|
};
|
|
193
416
|
//# sourceMappingURL=index.js.map
|
package/dist/eslint/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/eslint/index.ts"],"sourcesContent":["type RuleContext = {\n report(descriptor: Record<string, unknown>): void;\n getFilename?: () => string;\n options?: unknown[];\n};\n\ntype RuleListener = Record<string, (node: AstNode) => void>;\n\ntype AstNode = {\n type?: string;\n name?: string;\n value?: unknown;\n source?: AstNode;\n callee?: AstNode;\n object?: AstNode;\n property?: AstNode;\n key?: AstNode;\n arguments?: AstNode[];\n properties?: AstNode[];\n};\n\ntype ArkRule = {\n meta: {\n type: 'problem';\n docs: { description: string };\n messages: Record<string, string>;\n schema: unknown[];\n };\n create(context: RuleContext): RuleListener;\n};\n\ntype ArkEslintPlugin = {\n rules: Record<string, ArkRule>;\n configs?: Record<string, unknown>;\n};\n\nfunction stringValue(node: AstNode | undefined): string | undefined {\n return typeof node?.value === 'string' ? node.value : undefined;\n}\n\nfunction propertyName(node: AstNode | undefined): string | undefined {\n return node?.name ?? stringValue(node);\n}\n\nfunction calleePropertyName(node: AstNode): string | undefined {\n return propertyName(node.callee?.property);\n}\n\nfunction objectProperty(node: AstNode | undefined, name: string): AstNode | undefined {\n return node?.properties?.find((property) => propertyName(property.key) === name);\n}\n\nfunction objectHasProperty(node: AstNode | undefined, name: string): boolean {\n return objectProperty(node, name) !== undefined;\n}\n\nfunction objectHasMetadataSource(node: AstNode | undefined): boolean {\n const metadata = objectProperty(node, 'metadata')?.value as AstNode | undefined;\n return objectHasProperty(metadata, 'source');\n}\n\nfunction looksLikeIntent(value: string): boolean {\n return /^(Domain|Application|Adapter|Workflow|Job|Presentation|Reporting|Metadata|Security|Audit|Observability|Kernel)\\.[A-Za-z0-9_.]+$/.test(value);\n}\n\nfunction isDomainFile(context: RuleContext): boolean {\n const filename = context.getFilename?.() ?? '';\n const normalized = filename.split('\\\\').join('/').toLowerCase();\n return normalized.includes('/domain/') || normalized.endsWith('/domain.ts');\n}\n\nfunction isInfraImport(specifier: string): boolean {\n const normalized = specifier.toLowerCase();\n return [\n 'adapter',\n 'adapters',\n 'infrastructure',\n 'persistence',\n 'repository',\n 'repositories',\n 'integration',\n 'database',\n 'db',\n ].some((token) => normalized.includes(token));\n}\n\nfunction isPublishCall(node: AstNode): boolean {\n return calleePropertyName(node) === 'publish';\n}\n\nexport const noDomainInfraImports: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow importing infrastructure or adapters from domain files.',\n },\n messages: {\n forbiddenImport: 'Domain code must not import infrastructure, adapters, repositories, or database modules.',\n },\n schema: [],\n },\n create(context) {\n const check = (node: AstNode) => {\n if (!isDomainFile(context)) return;\n const source = stringValue(node.source);\n if (source && isInfraImport(source)) {\n context.report({ node, messageId: 'forbiddenImport' });\n }\n };\n\n return {\n ImportDeclaration: check,\n ExportNamedDeclaration: check,\n ExportAllDeclaration: check,\n };\n },\n};\n\nexport const noRawEventPublish: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description: 'Require event bus publish calls to use registered intent creators instead of raw event objects or intent strings.',\n },\n messages: {\n rawPublish: 'Publish through a registered intent creator; raw event objects or intent strings bypass Ark contracts.',\n },\n schema: [],\n },\n create(context) {\n return {\n CallExpression(node) {\n if (!isPublishCall(node)) return;\n const firstArg = node.arguments?.[0];\n const firstValue = stringValue(firstArg);\n if (\n firstValue && looksLikeIntent(firstValue) ||\n objectHasProperty(firstArg, 'intent')\n ) {\n context.report({ node, messageId: 'rawPublish' });\n }\n },\n };\n },\n};\n\nexport const requirePublishSource: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description: 'Require event bus publish calls to include source metadata.',\n },\n messages: {\n missingSource: 'Strict Ark publish calls must include metadata.source.',\n },\n schema: [],\n },\n create(context) {\n return {\n CallExpression(node) {\n if (!isPublishCall(node)) return;\n const firstArg = node.arguments?.[0];\n const metadataArg = node.arguments?.[2];\n if (objectHasMetadataSource(firstArg) || objectHasProperty(metadataArg, 'source')) {\n return;\n }\n context.report({ node, messageId: 'missingSource' });\n },\n };\n },\n};\n\nconst DEFAULT_FORBIDDEN_GLOBALS = ['fetch', 'process', 'Date.now', 'Math.random'];\n\nexport const noForbiddenGlobals: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow ambient globals (e.g. fetch, Date.now) in architecture-governed code; scope the rule to layer directories via ESLint \"files\" patterns.',\n },\n messages: {\n forbiddenGlobal: 'Ambient global \"{{name}}\" is forbidden here; inject the capability through a port instead.',\n },\n schema: [\n {\n type: 'object',\n properties: {\n globals: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n ],\n },\n create(context) {\n const option = context.options?.[0] as { globals?: string[] } | undefined;\n const globals = new Set(option?.globals ?? DEFAULT_FORBIDDEN_GLOBALS);\n const report = (node: AstNode, name: string) =>\n context.report({ node, messageId: 'forbiddenGlobal', data: { name } });\n\n return {\n // Same positional detection as ark-check's FORBIDDEN_GLOBAL: property accesses on a\n // forbidden base (console.log, Date.now), direct calls, and constructions. Bare\n // identifier mentions elsewhere are not flagged (avoids shadowed-local false positives).\n MemberExpression(node) {\n const base = node.object?.type === 'Identifier' ? node.object.name : undefined;\n if (!base) return;\n const dotted = `${base}.${propertyName(node.property) ?? ''}`;\n if (globals.has(dotted)) report(node, dotted);\n else if (globals.has(base)) report(node, base);\n },\n CallExpression(node) {\n const callee = node.callee?.type === 'Identifier' ? node.callee.name : undefined;\n if (callee && globals.has(callee)) report(node, callee);\n },\n NewExpression(node) {\n const callee = node.callee?.type === 'Identifier' ? node.callee.name : undefined;\n if (callee && globals.has(callee)) report(node, callee);\n },\n };\n },\n};\n\nconst rules = {\n 'no-domain-infra-imports': noDomainInfraImports,\n 'no-raw-event-publish': noRawEventPublish,\n 'require-publish-source': requirePublishSource,\n 'no-forbidden-globals': noForbiddenGlobals,\n};\n\nconst plugin: ArkEslintPlugin = { rules };\n\nplugin.configs = {\n recommended: {\n plugins: { ark: plugin },\n rules: {\n 'ark/no-domain-infra-imports': 'error',\n 'ark/no-raw-event-publish': 'error',\n 'ark/require-publish-source': 'error',\n },\n },\n};\n\nexport { plugin };\nexport default plugin;\n"],"mappings":";AAoCA,SAAS,YAAY,MAA+C;AAClE,SAAO,OAAO,MAAM,UAAU,WAAW,KAAK,QAAQ;AACxD;AAEA,SAAS,aAAa,MAA+C;AACnE,SAAO,MAAM,QAAQ,YAAY,IAAI;AACvC;AAEA,SAAS,mBAAmB,MAAmC;AAC7D,SAAO,aAAa,KAAK,QAAQ,QAAQ;AAC3C;AAEA,SAAS,eAAe,MAA2B,MAAmC;AACpF,SAAO,MAAM,YAAY,KAAK,CAAC,aAAa,aAAa,SAAS,GAAG,MAAM,IAAI;AACjF;AAEA,SAAS,kBAAkB,MAA2B,MAAuB;AAC3E,SAAO,eAAe,MAAM,IAAI,MAAM;AACxC;AAEA,SAAS,wBAAwB,MAAoC;AACnE,QAAM,WAAW,eAAe,MAAM,UAAU,GAAG;AACnD,SAAO,kBAAkB,UAAU,QAAQ;AAC7C;AAEA,SAAS,gBAAgB,OAAwB;AAC/C,SAAO,kIAAkI,KAAK,KAAK;AACrJ;AAEA,SAAS,aAAa,SAA+B;AACnD,QAAM,WAAW,QAAQ,cAAc,KAAK;AAC5C,QAAM,aAAa,SAAS,MAAM,IAAI,EAAE,KAAK,GAAG,EAAE,YAAY;AAC9D,SAAO,WAAW,SAAS,UAAU,K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M,EAAE,KAAK,EAAE,CAAC;AAEvE,WAAO;AAAA;AAAA;AAAA;AAAA,MAIL,iBAAiB,MAAM;AACrB,cAAM,OAAO,KAAK,QAAQ,SAAS,eAAe,KAAK,OAAO,OAAO;AACrE,YAAI,CAAC,KAAM;AACX,cAAM,SAAS,GAAG,IAAI,IAAI,aAAa,KAAK,QAAQ,KAAK,EAAE;AAC3D,YAAI,QAAQ,IAAI,MAAM,EAAG,QAAO,MAAM,MAAM;AAAA,iBACnC,QAAQ,IAAI,IAAI,EAAG,QAAO,MAAM,IAAI;AAAA,MAC/C;AAAA,MACA,eAAe,MAAM;AACnB,cAAM,SAAS,KAAK,QAAQ,SAAS,eAAe,KAAK,OAAO,OAAO;AACvE,YAAI,UAAU,QAAQ,IAAI,MAAM,EAAG,QAAO,MAAM,MAAM;AAAA,MACxD;AAAA,MACA,cAAc,MAAM;AAClB,cAAM,SAAS,KAAK,QAAQ,SAAS,eAAe,KAAK,OAAO,OAAO;AACvE,YAAI,UAAU,QAAQ,IAAI,MAAM,EAAG,QAAO,MAAM,MAAM;AAAA,MACxD;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAM,QAAQ;AAAA,EACZ,2BAA2B;AAAA,EAC3B,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B,wBAAwB;AAC1B;AAEA,IAAM,SAA0B,EAAE,MAAM;AAExC,OAAO,UAAU;AAAA,EACf,aAAa;AAAA,IACX,SAAS,EAAE,KAAK,OAAO;AAAA,IACvB,OAAO;AAAA,MACL,+BAA+B;AAAA,MAC/B,4BAA4B;AAAA,MAC5B,8BAA8B;AAAA,IAChC;AAAA,EACF;AACF;AAGA,IAAO,iBAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/eslint/index.ts","../../src/domain/layerMatch.ts"],"sourcesContent":["/**\n * arkgate/eslint — editor-side architecture gate.\n *\n * Layer / import / forbidden-globals rules load `ark.config.json` from the linted\n * project (walk-up from the file) and use the same glob specificity + edge semantics\n * as ark-check. Matching primitives come from `bin/ark-layer-match.mjs` (bundled) so\n * CLI and editor share one implementation — no Kernel imports.\n */\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport {\n globToRegExp,\n patternSpecificity,\n layerForRelativePath,\n isEdgeDenied,\n} from '../domain/layerMatch';\n\nexport { globToRegExp, patternSpecificity, layerForRelativePath, isEdgeDenied };\n\ntype RuleContext = {\n report(descriptor: Record<string, unknown>): void;\n /** ESLint 9+ / 10: preferred path on the context object. */\n filename?: string;\n /** ESLint 8-style physical path when linting with processors / virtual files. */\n physicalFilename?: string;\n /** ESLint ≤8 API — still present on some hosts; removed in ESLint 10. */\n getFilename?: () => string;\n options?: unknown[];\n};\n\n/** Resolve the file path being linted across ESLint 8–10 context shapes. */\nfunction lintedFilename(context: RuleContext): string {\n if (typeof context.physicalFilename === 'string' && context.physicalFilename.length > 0) {\n return context.physicalFilename;\n }\n if (typeof context.filename === 'string' && context.filename.length > 0) {\n return context.filename;\n }\n if (typeof context.getFilename === 'function') {\n try {\n const name = context.getFilename();\n if (typeof name === 'string' && name.length > 0) return name;\n } catch {\n /* ignore */\n }\n }\n return '';\n}\n\ntype RuleListener = Record<string, (node: AstNode) => void>;\n\ntype AstNode = {\n type?: string;\n name?: string;\n value?: unknown;\n source?: AstNode;\n callee?: AstNode;\n object?: AstNode;\n property?: AstNode;\n key?: AstNode;\n arguments?: AstNode[];\n properties?: AstNode[];\n importKind?: string;\n specifiers?: AstNode[];\n};\n\ntype ArkRule = {\n meta: {\n type: 'problem';\n docs: { description: string };\n messages: Record<string, string>;\n schema: unknown[];\n };\n create(context: RuleContext): RuleListener;\n};\n\ntype ArkEslintPlugin = {\n rules: Record<string, ArkRule>;\n configs?: Record<string, unknown>;\n};\n\ntype LayerConfig = {\n name: string;\n patterns?: string[];\n exclude?: string[];\n forbiddenGlobals?: string[];\n};\n\ntype EdgeRule = { from: string; to: string; allowed?: boolean };\n\ntype ArkConfig = {\n layers?: LayerConfig[];\n rules?: EdgeRule[];\n};\n\n// ── Config I/O (editor-only; matching primitives come from ark-layer-match.mjs) ──\n\nexport function findConfigPath(startFile: string): string | null {\n if (!startFile || startFile === '<input>' || startFile.startsWith('stdin')) return null;\n let dir = path.dirname(path.resolve(startFile));\n for (;;) {\n const candidate = path.join(dir, 'ark.config.json');\n if (fs.existsSync(candidate)) return candidate;\n const parent = path.dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n}\n\nconst _configCache = new Map<string, ArkConfig | null>();\n\nexport function loadArkConfig(configPath: string): ArkConfig | null {\n if (_configCache.has(configPath)) return _configCache.get(configPath) ?? null;\n try {\n const raw = JSON.parse(fs.readFileSync(configPath, 'utf8')) as ArkConfig;\n _configCache.set(configPath, raw);\n return raw;\n } catch {\n _configCache.set(configPath, null);\n return null;\n }\n}\n\n/** Resolve relative import specifier to an absolute path candidate (TS-oriented). */\nexport function resolveRelativeImport(fromFile: string, specifier: string): string | null {\n if (!specifier.startsWith('.')) return null;\n const base = path.resolve(path.dirname(fromFile), specifier);\n const candidates = [\n base,\n `${base}.ts`,\n `${base}.tsx`,\n `${base}.mts`,\n `${base}.cts`,\n `${base}.js`,\n `${base}.jsx`,\n path.join(base, 'index.ts'),\n path.join(base, 'index.tsx'),\n path.join(base, 'index.js'),\n ];\n for (const c of candidates) {\n try {\n if (fs.existsSync(c) && fs.statSync(c).isFile()) return c;\n } catch {\n /* continue */\n }\n }\n // Prefer .ts for layer matching when the target is not on disk yet (editor typing).\n return `${base}.ts`;\n}\n\n// ── AST helpers ────────────────────────────────────────────────────────────\n\nfunction stringValue(node: AstNode | undefined): string | undefined {\n return typeof node?.value === 'string' ? node.value : undefined;\n}\n\nfunction propertyName(node: AstNode | undefined): string | undefined {\n return node?.name ?? stringValue(node);\n}\n\nfunction calleePropertyName(node: AstNode): string | undefined {\n return propertyName(node.callee?.property);\n}\n\nfunction objectProperty(node: AstNode | undefined, name: string): AstNode | undefined {\n return node?.properties?.find((property) => propertyName(property.key) === name);\n}\n\nfunction objectHasProperty(node: AstNode | undefined, name: string): boolean {\n return objectProperty(node, name) !== undefined;\n}\n\nfunction objectHasMetadataSource(node: AstNode | undefined): boolean {\n const metadata = objectProperty(node, 'metadata')?.value as AstNode | undefined;\n return objectHasProperty(metadata, 'source');\n}\n\nfunction looksLikeIntent(value: string): boolean {\n return /^(Domain|Application|Adapter|Workflow|Job|Presentation|Reporting|Metadata|Security|Audit|Observability|Kernel)\\.[A-Za-z0-9_.]+$/.test(\n value\n );\n}\n\nfunction isPublishCall(node: AstNode): boolean {\n return calleePropertyName(node) === 'publish';\n}\n\n/** Heuristic fallback when no ark.config.json (pre-contract projects). */\nfunction isDomainFileHeuristic(filename: string): boolean {\n const normalized = filename.split('\\\\').join('/').toLowerCase();\n return normalized.includes('/domain/') || normalized.endsWith('/domain.ts');\n}\n\nfunction isInfraImportHeuristic(specifier: string): boolean {\n const normalized = specifier.toLowerCase();\n return [\n 'adapter',\n 'adapters',\n 'infrastructure',\n 'persistence',\n 'repository',\n 'repositories',\n 'integration',\n 'database',\n 'db',\n ].some((token) => normalized.includes(token));\n}\n\nconst DEFAULT_FORBIDDEN_GLOBALS = ['fetch', 'process', 'Date.now', 'Math.random'];\n\n// ── Rules ──────────────────────────────────────────────────────────────────\n\n/**\n * Config-driven layer import boundary (primary editor gate).\n * Replaces path-token domain/infra heuristics when ark.config.json is present.\n * Rule id kept as `no-domain-infra-imports` for recommended-config / upgrade stability.\n */\nexport const noDomainInfraImports: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow imports that violate ark.config.json layer rules (same contract as arkgate-check). Falls back to domain→infra path heuristics when no config is found.',\n },\n messages: {\n forbiddenImport:\n 'Architecture: {{fromLayer}} must not import {{toLayer}} (ark.config.json). Specifier: {{specifier}}',\n forbiddenImportHeuristic:\n 'Domain code must not import infrastructure, adapters, repositories, or database modules.',\n },\n schema: [],\n },\n create(context) {\n const filename = lintedFilename(context);\n const configPath = findConfigPath(filename);\n const config = configPath ? loadArkConfig(configPath) : null;\n const root = configPath ? path.dirname(configPath) : null;\n\n const check = (node: AstNode) => {\n const source = stringValue(node.source);\n if (!source) return;\n\n if (config && root && filename) {\n const absFile = path.isAbsolute(filename) ? filename : path.resolve(filename);\n const relFile = path.relative(root, absFile).split(path.sep).join('/');\n const fromLayer = layerForRelativePath(relFile, config.layers);\n if (!fromLayer) return;\n\n const targetAbs = resolveRelativeImport(absFile, source);\n if (!targetAbs) return; // package import — CI resolves via TS; editor skips non-relative\n\n const relTarget = path.relative(root, targetAbs).split(path.sep).join('/');\n // Outside project or up-and-out: skip\n if (relTarget.startsWith('..')) return;\n\n const toLayer = layerForRelativePath(relTarget, config.layers);\n if (!toLayer) return;\n if (isEdgeDenied(config.rules, fromLayer, toLayer)) {\n context.report({\n node,\n messageId: 'forbiddenImport',\n data: { fromLayer, toLayer, specifier: source },\n });\n }\n return;\n }\n\n // No contract: legacy heuristic so bare domain folders still get a signal.\n if (isDomainFileHeuristic(filename) && isInfraImportHeuristic(source)) {\n context.report({ node, messageId: 'forbiddenImportHeuristic' });\n }\n };\n\n return {\n ImportDeclaration: check,\n ExportNamedDeclaration: check,\n ExportAllDeclaration: check,\n };\n },\n};\n\nexport const noRawEventPublish: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Require event bus publish calls to use registered intent creators instead of raw event objects or intent strings.',\n },\n messages: {\n rawPublish:\n 'Publish through a registered intent creator; raw event objects or intent strings bypass Ark contracts.',\n },\n schema: [],\n },\n create(context) {\n return {\n CallExpression(node) {\n if (!isPublishCall(node)) return;\n const firstArg = node.arguments?.[0];\n const firstValue = stringValue(firstArg);\n if ((firstValue && looksLikeIntent(firstValue)) || objectHasProperty(firstArg, 'intent')) {\n context.report({ node, messageId: 'rawPublish' });\n }\n },\n };\n },\n};\n\nexport const requirePublishSource: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description: 'Require event bus publish calls to include source metadata.',\n },\n messages: {\n missingSource: 'Strict Ark publish calls must include metadata.source.',\n },\n schema: [],\n },\n create(context) {\n return {\n CallExpression(node) {\n if (!isPublishCall(node)) return;\n const firstArg = node.arguments?.[0];\n const metadataArg = node.arguments?.[2];\n if (objectHasMetadataSource(firstArg) || objectHasProperty(metadataArg, 'source')) {\n return;\n }\n context.report({ node, messageId: 'missingSource' });\n },\n };\n },\n};\n\nexport const noForbiddenGlobals: ArkRule = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow ambient globals from the layer’s forbiddenGlobals in ark.config.json (same purity surface as arkgate-check). Option `globals` overrides. Without config, defaults apply only on domain-like paths.',\n },\n messages: {\n forbiddenGlobal:\n 'Ambient global \"{{name}}\" is forbidden in {{layer}} (ark.config.json); inject the capability through a port instead.',\n forbiddenGlobalDefault:\n 'Ambient global \"{{name}}\" is forbidden here; inject the capability through a port instead.',\n },\n schema: [\n {\n type: 'object',\n properties: {\n globals: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n ],\n },\n create(context) {\n const filename = lintedFilename(context);\n const option = context.options?.[0] as { globals?: string[] } | undefined;\n const configPath = findConfigPath(filename);\n const config = configPath ? loadArkConfig(configPath) : null;\n const root = configPath ? path.dirname(configPath) : null;\n\n let globals: Set<string> | null = null;\n let layerName = 'this layer';\n\n if (option?.globals) {\n globals = new Set(option.globals);\n } else if (config && root && filename) {\n const absFile = path.isAbsolute(filename) ? filename : path.resolve(filename);\n const relFile = path.relative(root, absFile).split(path.sep).join('/');\n const layer = config.layers?.find(\n (l) => l.name === layerForRelativePath(relFile, config.layers)\n );\n if (layer?.forbiddenGlobals?.length) {\n globals = new Set(layer.forbiddenGlobals);\n layerName = layer.name;\n } else {\n // Layer has no purity list — do not invent defaults (matches CI).\n globals = null;\n }\n } else if (isDomainFileHeuristic(filename)) {\n globals = new Set(DEFAULT_FORBIDDEN_GLOBALS);\n }\n\n if (!globals) {\n return {} as RuleListener;\n }\n\n const report = (node: AstNode, name: string) =>\n context.report({\n node,\n messageId: config ? 'forbiddenGlobal' : 'forbiddenGlobalDefault',\n data: { name, layer: layerName },\n });\n\n return {\n MemberExpression(node) {\n const base = node.object?.type === 'Identifier' ? node.object.name : undefined;\n if (!base) return;\n const dotted = `${base}.${propertyName(node.property) ?? ''}`;\n if (globals!.has(dotted)) report(node, dotted);\n else if (globals!.has(base)) report(node, base);\n },\n CallExpression(node) {\n const callee = node.callee?.type === 'Identifier' ? node.callee.name : undefined;\n if (callee && globals!.has(callee)) report(node, callee);\n },\n NewExpression(node) {\n const callee = node.callee?.type === 'Identifier' ? node.callee.name : undefined;\n if (callee && globals!.has(callee)) report(node, callee);\n },\n };\n },\n};\n\nconst rules = {\n 'no-domain-infra-imports': noDomainInfraImports,\n 'no-raw-event-publish': noRawEventPublish,\n 'require-publish-source': requirePublishSource,\n 'no-forbidden-globals': noForbiddenGlobals,\n};\n\nconst plugin: ArkEslintPlugin = { rules };\n\nplugin.configs = {\n recommended: {\n plugins: { ark: plugin },\n rules: {\n 'ark/no-domain-infra-imports': 'error',\n 'ark/no-raw-event-publish': 'error',\n 'ark/require-publish-source': 'error',\n 'ark/no-forbidden-globals': 'error',\n },\n },\n};\n\nexport { plugin };\nexport default plugin;\n","/**\n * Pure layer-glob matching for ark.config.json.\n * Single TypeScript source of truth for the library (eslint / kernel consumers).\n * CLI re-exports the identical algorithm from `bin/ark-layer-match.mjs` — keep in\n * lockstep via tests/unit/static-check/layerMatchParity.test.ts.\n */\n\nexport type LayerConfig = {\n name: string;\n patterns?: string[];\n exclude?: string[];\n forbiddenGlobals?: string[];\n};\n\nexport type EdgeRule = { from: string; to: string; allowed?: boolean };\n\nconst regexpCache = new Map<string, RegExp>();\n\nfunction escapeLiteral(ch: string): string {\n return /[.*+?^${}()|[\\]\\\\]/.test(ch) ? `\\\\${ch}` : ch;\n}\n\nfunction bracesBalanced(glob: string): boolean {\n let depth = 0;\n for (let i = 0; i < glob.length; i += 1) {\n const c = glob[i];\n if (c === '\\\\') {\n i += 1;\n continue;\n }\n if (c === '{') depth += 1;\n else if (c === '}') {\n depth -= 1;\n if (depth < 0) return false;\n }\n }\n return depth === 0;\n}\n\nexport function globToRegExp(pattern: string): RegExp {\n const cached = regexpCache.get(pattern);\n if (cached) return cached;\n\n const glob = pattern.split('\\\\').join('/');\n const useBraces = bracesBalanced(glob);\n let out = '';\n let braceDepth = 0;\n for (let i = 0; i < glob.length; i += 1) {\n const c = glob[i];\n if (c === '\\\\' && i + 1 < glob.length) {\n out += escapeLiteral(glob[i + 1]);\n i += 1;\n } else if (c === '*') {\n if (glob[i + 1] === '*') {\n if (glob[i + 2] === '/') {\n out += '(?:.*/)?';\n i += 2;\n } else {\n out += '.*';\n i += 1;\n }\n } else {\n out += '[^/]*';\n }\n } else if (c === '?') {\n out += '[^/]';\n } else if (c === '{' && useBraces) {\n out += '(?:';\n braceDepth += 1;\n } else if (c === '}' && useBraces && braceDepth > 0) {\n out += ')';\n braceDepth -= 1;\n } else if (c === ',' && useBraces && braceDepth > 0) {\n out += '|';\n } else {\n out += escapeLiteral(c);\n }\n }\n const re = new RegExp(`^${out}$`);\n regexpCache.set(pattern, re);\n return re;\n}\n\nexport function patternSpecificity(pattern: string): number {\n const glob = String(pattern).split('\\\\').join('/');\n const beforeWildcard = glob.split('*')[0];\n const literalSegments = beforeWildcard.split('/').filter(Boolean).length;\n const literalLength = glob.replace(/\\*/g, '').length;\n return literalSegments * 10000 + literalLength;\n}\n\nexport function layerForRelativePath(\n relPath: string,\n layers: LayerConfig[] | undefined\n): string | undefined {\n const rel = String(relPath).split('\\\\').join('/');\n let bestName: string | undefined;\n let bestScore = -1;\n for (const layer of layers ?? []) {\n if ((layer.exclude ?? []).some((pattern) => globToRegExp(pattern).test(rel))) {\n continue;\n }\n for (const pattern of layer.patterns ?? []) {\n if (globToRegExp(pattern).test(rel)) {\n const score = patternSpecificity(pattern);\n if (score > bestScore) {\n bestScore = score;\n bestName = layer.name;\n }\n }\n }\n }\n return bestName;\n}\n\nexport function isEdgeDenied(\n rules: EdgeRule[] | undefined,\n from: string,\n to: string\n): boolean {\n if (from === to) return false;\n const hit = (rules ?? []).find((r) => r.from === from && r.to === to);\n return hit?.allowed === false;\n}\n"],"mappings":";AAQA,OAAO,QAAQ;AACf,OAAO,UAAU;;;ACOjB,IAAM,cAAc,oBAAI,IAAoB;AAE5C,SAAS,cAAc,IAAoB;AACzC,SAAO,qBAAqB,KAAK,EAAE,IAAI,KAAK,EAAE,KAAK;AACrD;AAEA,SAAS,eAAe,MAAuB;AAC7C,MAAI,QAAQ;AACZ,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK,GAAG;AACvC,UAAM,IAAI,KAAK,CAAC;AAChB,QAAI,MAAM,MAAM;AACd,WAAK;AACL;AAAA,IACF;AACA,QAAI,MAAM,IAAK,UAAS;AAAA,aACf,MAAM,KAAK;AAClB,eAAS;AACT,UAAI,QAAQ,EAAG,QAAO;AAAA,IACxB;AAAA,EACF;AACA,SAAO,UAAU;AACnB;AAEO,SAAS,aAAa,SAAyB;AACpD,QAAM,SAAS,YAAY,IAAI,OAAO;AACtC,MAAI,OAAQ,QAAO;AAEnB,QAAM,OAAO,QAAQ,MAAM,IAAI,EAAE,KAAK,GAAG;AACzC,QAAM,YAAY,eAAe,IAAI;AACrC,MAAI,MAAM;AACV,MAAI,aAAa;AACjB,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK,GAAG;AACvC,UAAM,IAAI,KAAK,CAAC;AAChB,QAAI,MAAM,QAAQ,IAAI,IAAI,KAAK,QAAQ;AACrC,aAAO,cAAc,KAAK,IAAI,CAAC,CAAC;AAChC,WAAK;AAAA,IACP,WAAW,MAAM,KAAK;AACpB,UAAI,KAAK,IAAI,CAAC,MAAM,KAAK;AACvB,YAAI,KAAK,IAAI,CAAC,MAAM,KAAK;AACvB,iBAAO;AACP,eAAK;AAAA,QACP,OAAO;AACL,iBAAO;AACP,eAAK;AAAA,QACP;AAAA,MACF,OAAO;AACL,eAAO;AAAA,MACT;AAAA,IACF,WAAW,MAAM,KAAK;AACpB,aAA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