arkgate 3.2.0 → 3.4.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 +77 -0
- package/README.md +4 -3
- package/bin/ark-check.mjs +1 -0
- package/bin/ark-mcp.mjs +10 -0
- package/bin/lib/adapter-contract.mjs +3 -0
- package/bin/lib/ambient-state.mjs +221 -0
- package/bin/lib/analysis-engine.mjs +6 -5
- package/bin/lib/architecture-scan.mjs +31 -0
- package/bin/lib/config-contract.mjs +25 -0
- package/bin/lib/doctor-advisories.mjs +20 -0
- package/bin/lib/doctor-plan.mjs +5 -5
- package/bin/lib/remediation.mjs +14 -0
- package/bin/lib/ts-resolve.mjs +2 -1
- package/bin/lib/violations.mjs +2 -0
- package/dist/configTypes-DAPvBqK6.d.cts +61 -0
- package/dist/configTypes-DAPvBqK6.d.ts +61 -0
- package/dist/eslint/index.cjs +3 -3
- package/dist/eslint/index.d.cts +3 -2
- package/dist/eslint/index.d.ts +3 -2
- package/dist/eslint/index.js +3 -3
- package/dist/index.cjs +6 -5
- package/dist/index.d.cts +344 -82
- package/dist/index.d.ts +344 -82
- package/dist/index.js +6 -5
- package/docs/agent-guide.md +18 -0
- package/docs/configuration.md +3 -0
- package/docs/package-surface.md +5 -1
- package/package.json +4 -3
- package/schemas/ark.config.schema.json +25 -0
- package/server.json +2 -2
- package/dist/configContract-BxSIwVRo.d.cts +0 -259
- package/dist/configContract-BxSIwVRo.d.ts +0 -259
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,240 @@
|
|
|
1
|
-
import { a as ArkConfigRule, b as
|
|
2
|
-
|
|
1
|
+
import { a as ArkConfigRule, b as ArkConfigSchemaVersion, c as ArkConfigLoadResult, d as ArkConfigLayer, A as ArkConfig } from './configTypes-DAPvBqK6.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Canonical, pure contract for ark.config.json.
|
|
5
|
+
*
|
|
6
|
+
* Tooling adapters own filesystem I/O; this module owns JSON parsing, deterministic
|
|
7
|
+
* migration, defaults, validation, diagnostics, and the published JSON Schema.
|
|
8
|
+
* The standalone CLI artifact is generated into bin/lib/config-contract.mjs.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare const ARK_CONFIG_SCHEMA_VERSION: ArkConfigSchemaVersion;
|
|
12
|
+
declare const ARK_CONFIG_SCHEMA: {
|
|
13
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
14
|
+
readonly $id: "https://unpkg.com/arkgate@2/schemas/ark.config.schema.json";
|
|
15
|
+
readonly title: "ArkGate architecture contract";
|
|
16
|
+
readonly description: "Versioned contract consumed identically by ArkGate CLI, MCP, and ESLint surfaces.";
|
|
17
|
+
readonly type: "object";
|
|
18
|
+
readonly additionalProperties: false;
|
|
19
|
+
readonly required: readonly ["$schema", "schemaVersion", "include", "layers", "rules"];
|
|
20
|
+
readonly properties: {
|
|
21
|
+
readonly $schema: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly minLength: 1;
|
|
24
|
+
readonly default: "https://unpkg.com/arkgate@2/schemas/ark.config.schema.json";
|
|
25
|
+
readonly description: "Editor-facing URL or local path for this JSON Schema.";
|
|
26
|
+
};
|
|
27
|
+
readonly schemaVersion: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly const: "1.0";
|
|
30
|
+
readonly default: "1.0";
|
|
31
|
+
};
|
|
32
|
+
readonly name: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly minLength: 1;
|
|
35
|
+
};
|
|
36
|
+
readonly include: {
|
|
37
|
+
readonly minItems: 1;
|
|
38
|
+
readonly default: readonly ["src"];
|
|
39
|
+
readonly type: "array";
|
|
40
|
+
readonly items: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly minLength: 1;
|
|
43
|
+
};
|
|
44
|
+
readonly uniqueItems: true;
|
|
45
|
+
};
|
|
46
|
+
readonly exclude: {
|
|
47
|
+
readonly default: readonly [];
|
|
48
|
+
readonly type: "array";
|
|
49
|
+
readonly items: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly minLength: 1;
|
|
52
|
+
};
|
|
53
|
+
readonly uniqueItems: true;
|
|
54
|
+
};
|
|
55
|
+
readonly excludeGenerated: {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
readonly default: true;
|
|
58
|
+
};
|
|
59
|
+
readonly frameworkOverlay: {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
readonly minLength: 1;
|
|
62
|
+
};
|
|
63
|
+
readonly layers: {
|
|
64
|
+
readonly type: "array";
|
|
65
|
+
readonly default: readonly [];
|
|
66
|
+
readonly items: {
|
|
67
|
+
readonly $ref: "#/$defs/layer";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
readonly rules: {
|
|
71
|
+
readonly type: "array";
|
|
72
|
+
readonly default: ArkConfigRule[];
|
|
73
|
+
readonly items: {
|
|
74
|
+
readonly $ref: "#/$defs/rule";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly cyclePolicy: {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly enum: readonly ["strict", "soft", "framework-soft", "off"];
|
|
80
|
+
readonly default: "strict";
|
|
81
|
+
};
|
|
82
|
+
readonly dynamicImportAllowlist: {
|
|
83
|
+
readonly default: readonly [];
|
|
84
|
+
readonly type: "array";
|
|
85
|
+
readonly items: {
|
|
86
|
+
readonly type: "string";
|
|
87
|
+
readonly minLength: 1;
|
|
88
|
+
};
|
|
89
|
+
readonly uniqueItems: true;
|
|
90
|
+
};
|
|
91
|
+
readonly safety: {
|
|
92
|
+
readonly $ref: "#/$defs/safety";
|
|
93
|
+
readonly default: {
|
|
94
|
+
readonly maxTsSuppressions: 0;
|
|
95
|
+
readonly maxAnyCasts: 0;
|
|
96
|
+
readonly allowInMemory: false;
|
|
97
|
+
readonly allowDisabledPeerIsolation: false;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
readonly $defs: {
|
|
102
|
+
readonly layer: {
|
|
103
|
+
readonly type: "object";
|
|
104
|
+
readonly additionalProperties: false;
|
|
105
|
+
readonly required: readonly ["name", "patterns"];
|
|
106
|
+
readonly properties: {
|
|
107
|
+
readonly name: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly minLength: 1;
|
|
110
|
+
};
|
|
111
|
+
readonly patterns: {
|
|
112
|
+
readonly minItems: 1;
|
|
113
|
+
readonly type: "array";
|
|
114
|
+
readonly items: {
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
readonly minLength: 1;
|
|
117
|
+
};
|
|
118
|
+
readonly uniqueItems: true;
|
|
119
|
+
};
|
|
120
|
+
readonly exclude: {
|
|
121
|
+
readonly type: "array";
|
|
122
|
+
readonly items: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly minLength: 1;
|
|
125
|
+
};
|
|
126
|
+
readonly uniqueItems: true;
|
|
127
|
+
};
|
|
128
|
+
readonly intentPrefixes: {
|
|
129
|
+
readonly type: "array";
|
|
130
|
+
readonly items: {
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
readonly minLength: 1;
|
|
133
|
+
};
|
|
134
|
+
readonly uniqueItems: true;
|
|
135
|
+
};
|
|
136
|
+
readonly description: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
readonly minLength: 1;
|
|
139
|
+
};
|
|
140
|
+
readonly forbiddenGlobals: {
|
|
141
|
+
readonly type: "array";
|
|
142
|
+
readonly items: {
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
readonly minLength: 1;
|
|
145
|
+
};
|
|
146
|
+
readonly uniqueItems: true;
|
|
147
|
+
};
|
|
148
|
+
readonly capabilities: {
|
|
149
|
+
readonly type: "object";
|
|
150
|
+
readonly additionalProperties: false;
|
|
151
|
+
readonly properties: {
|
|
152
|
+
readonly deny: {
|
|
153
|
+
readonly type: "array";
|
|
154
|
+
readonly uniqueItems: true;
|
|
155
|
+
readonly items: {
|
|
156
|
+
readonly type: "string";
|
|
157
|
+
readonly enum: readonly ["network", "filesystem", "clock", "randomness", "environment", "process", "persistence"];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly pure: {
|
|
163
|
+
readonly type: "boolean";
|
|
164
|
+
};
|
|
165
|
+
readonly mayImportInfrastructure: {
|
|
166
|
+
readonly type: "boolean";
|
|
167
|
+
};
|
|
168
|
+
readonly optional: {
|
|
169
|
+
readonly type: "boolean";
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
readonly rule: {
|
|
174
|
+
readonly type: "object";
|
|
175
|
+
readonly additionalProperties: false;
|
|
176
|
+
readonly required: readonly ["from", "to", "allowed"];
|
|
177
|
+
readonly properties: {
|
|
178
|
+
readonly from: {
|
|
179
|
+
readonly type: "string";
|
|
180
|
+
readonly minLength: 1;
|
|
181
|
+
};
|
|
182
|
+
readonly to: {
|
|
183
|
+
readonly type: "string";
|
|
184
|
+
readonly minLength: 1;
|
|
185
|
+
};
|
|
186
|
+
readonly allowed: {
|
|
187
|
+
readonly type: "boolean";
|
|
188
|
+
};
|
|
189
|
+
readonly message: {
|
|
190
|
+
readonly type: "string";
|
|
191
|
+
readonly minLength: 1;
|
|
192
|
+
};
|
|
193
|
+
readonly peerIsolation: {
|
|
194
|
+
readonly type: "boolean";
|
|
195
|
+
};
|
|
196
|
+
readonly sliceFolders: {
|
|
197
|
+
readonly minItems: 1;
|
|
198
|
+
readonly type: "array";
|
|
199
|
+
readonly items: {
|
|
200
|
+
readonly type: "string";
|
|
201
|
+
readonly minLength: 1;
|
|
202
|
+
};
|
|
203
|
+
readonly uniqueItems: true;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
readonly safety: {
|
|
208
|
+
readonly type: "object";
|
|
209
|
+
readonly additionalProperties: false;
|
|
210
|
+
readonly properties: {
|
|
211
|
+
readonly maxTsSuppressions: {
|
|
212
|
+
readonly type: "integer";
|
|
213
|
+
readonly minimum: 0;
|
|
214
|
+
readonly default: 0;
|
|
215
|
+
};
|
|
216
|
+
readonly maxAnyCasts: {
|
|
217
|
+
readonly type: "integer";
|
|
218
|
+
readonly minimum: 0;
|
|
219
|
+
readonly default: 0;
|
|
220
|
+
};
|
|
221
|
+
readonly allowInMemory: {
|
|
222
|
+
readonly type: "boolean";
|
|
223
|
+
readonly default: false;
|
|
224
|
+
};
|
|
225
|
+
readonly allowDisabledPeerIsolation: {
|
|
226
|
+
readonly type: "boolean";
|
|
227
|
+
readonly default: false;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
declare function loadArkConfigContract(input: unknown, source?: string): ArkConfigLoadResult;
|
|
234
|
+
declare function parseArkConfigJson(json: string, source?: string): ArkConfigLoadResult;
|
|
3
235
|
|
|
4
236
|
/** ArkGate library version — single source of truth. */
|
|
5
|
-
declare const version = "3.
|
|
237
|
+
declare const version = "3.4.0";
|
|
6
238
|
|
|
7
239
|
/** Versioned public result contract shared by every ArkGate enforcement adapter. */
|
|
8
240
|
declare const ARK_ANALYSIS_RESULT_SCHEMA_VERSION: "1.1";
|
|
@@ -23,6 +255,8 @@ type AdapterViolationInput = {
|
|
|
23
255
|
peerIsolation?: unknown;
|
|
24
256
|
severity?: unknown;
|
|
25
257
|
nextAction?: unknown;
|
|
258
|
+
/** U04: the denied capability id on CAPABILITY_VIOLATION. */
|
|
259
|
+
capability?: unknown;
|
|
26
260
|
};
|
|
27
261
|
type AdapterDiagnostic = {
|
|
28
262
|
ruleId: string;
|
|
@@ -386,6 +620,13 @@ interface AICodeGateOptions<Context = AICodeGateContext> {
|
|
|
386
620
|
* to a listed layer — mirrors ark-check's FORBIDDEN_GLOBAL rule.
|
|
387
621
|
*/
|
|
388
622
|
forbiddenGlobals?: Record<string, string[]>;
|
|
623
|
+
/**
|
|
624
|
+
* Layer → effective capability deny set (U04 walls; ADR 0009). Enforced like
|
|
625
|
+
* forbiddenGlobals when the target file's layer is known. An ambient use
|
|
626
|
+
* already covered by the layer's forbiddenGlobals reports only
|
|
627
|
+
* FORBIDDEN_GLOBAL (D7 — one violation, one voice).
|
|
628
|
+
*/
|
|
629
|
+
capabilityWalls?: Record<string, string[]>;
|
|
389
630
|
/**
|
|
390
631
|
* Layer names whose role is infrastructure and may therefore import infrastructure
|
|
391
632
|
* (a persistence adapter importing the DB is correct, not a violation). The built-in
|
|
@@ -421,6 +662,85 @@ interface AICodeGateOptions<Context = AICodeGateContext> {
|
|
|
421
662
|
}
|
|
422
663
|
declare function createAICodeGate<Context = AICodeGateContext>(options?: AICodeGateOptions<Context>): AICodeGate<Context>;
|
|
423
664
|
|
|
665
|
+
declare const ARK_CHANGE_MAP_SCHEMA_VERSION: "1.0";
|
|
666
|
+
type ArchitectureChangeOperation = 'create' | 'update' | 'delete';
|
|
667
|
+
type ArchitectureChangeMapFile = {
|
|
668
|
+
path: string;
|
|
669
|
+
operation: ArchitectureChangeOperation;
|
|
670
|
+
layer: string;
|
|
671
|
+
};
|
|
672
|
+
type ArchitectureChangeMapDependency = {
|
|
673
|
+
from: string;
|
|
674
|
+
to: string;
|
|
675
|
+
};
|
|
676
|
+
type ArchitectureChangeMap = {
|
|
677
|
+
$schema: string;
|
|
678
|
+
schemaVersion: typeof ARK_CHANGE_MAP_SCHEMA_VERSION;
|
|
679
|
+
files: ArchitectureChangeMapFile[];
|
|
680
|
+
dependencies: ArchitectureChangeMapDependency[];
|
|
681
|
+
};
|
|
682
|
+
type ArchitectureChangeMapContract = {
|
|
683
|
+
map: ArchitectureChangeMap;
|
|
684
|
+
hash: string;
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
type ArchitectureDependency = {
|
|
688
|
+
from: string;
|
|
689
|
+
to: string;
|
|
690
|
+
};
|
|
691
|
+
type ArchitectureActualChange = {
|
|
692
|
+
path: string;
|
|
693
|
+
operation: ArchitectureChangeOperation;
|
|
694
|
+
};
|
|
695
|
+
type ArchitectureConvergenceClassification = 'satisfied' | 'missing' | 'contradictory' | 'unplanned';
|
|
696
|
+
type ArchitectureConvergenceFinding = {
|
|
697
|
+
id: string;
|
|
698
|
+
classification: ArchitectureConvergenceClassification;
|
|
699
|
+
subject: 'file' | 'dependency';
|
|
700
|
+
message: string;
|
|
701
|
+
nextAction?: string;
|
|
702
|
+
path?: string;
|
|
703
|
+
from?: string;
|
|
704
|
+
to?: string;
|
|
705
|
+
expectedOperation?: ArchitectureChangeOperation;
|
|
706
|
+
actualOperation?: ArchitectureChangeOperation | 'added' | 'removed';
|
|
707
|
+
};
|
|
708
|
+
type ArchitectureConvergenceResult = {
|
|
709
|
+
schemaVersion: '1.0';
|
|
710
|
+
readOnly: true;
|
|
711
|
+
changeMapHash: string;
|
|
712
|
+
structurallyConverged: boolean;
|
|
713
|
+
behavioralCompletion: 'not-evaluated';
|
|
714
|
+
summary: Record<ArchitectureConvergenceClassification, number>;
|
|
715
|
+
findings: ArchitectureConvergenceFinding[];
|
|
716
|
+
};
|
|
717
|
+
type AnalyzeArchitectureConvergenceInput = {
|
|
718
|
+
changeMap: ArchitectureChangeMapContract;
|
|
719
|
+
changes: readonly ArchitectureActualChange[];
|
|
720
|
+
baseDependencies: readonly ArchitectureDependency[];
|
|
721
|
+
candidateDependencies: readonly ArchitectureDependency[];
|
|
722
|
+
};
|
|
723
|
+
declare function analyzeArchitectureConvergence(input: AnalyzeArchitectureConvergenceInput): ArchitectureConvergenceResult;
|
|
724
|
+
|
|
725
|
+
type SemanticDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
|
|
726
|
+
type SemanticDependency = {
|
|
727
|
+
specifier?: string;
|
|
728
|
+
kind: SemanticDependencyKind;
|
|
729
|
+
line: number;
|
|
730
|
+
typeOnly: boolean;
|
|
731
|
+
unresolved: boolean;
|
|
732
|
+
node: unknown;
|
|
733
|
+
};
|
|
734
|
+
type ForbiddenCapabilityUse = {
|
|
735
|
+
name: string;
|
|
736
|
+
line: number;
|
|
737
|
+
node: unknown;
|
|
738
|
+
};
|
|
739
|
+
/** Extract every dependency form whose specifier is statically knowable, plus unresolved calls. */
|
|
740
|
+
declare function extractSemanticDependencies(ts: any, sourceFile: any): SemanticDependency[];
|
|
741
|
+
/** Resolve forbidden ambient capabilities through symbols, aliases, globalThis, and static keys. */
|
|
742
|
+
declare function collectForbiddenCapabilityUses(ts: any, sourceFile: any, forbidden: readonly string[]): ForbiddenCapabilityUse[];
|
|
743
|
+
|
|
424
744
|
/**
|
|
425
745
|
* Stable, pure vocabulary for ArkGate's importable analysis engine.
|
|
426
746
|
*
|
|
@@ -470,6 +790,10 @@ type AnalysisViolation = {
|
|
|
470
790
|
ruleId: string;
|
|
471
791
|
message: string;
|
|
472
792
|
edge?: AnalysisImportEdge;
|
|
793
|
+
/** U04 (additive): present on CAPABILITY_VIOLATION — the denied capability id. */
|
|
794
|
+
capability?: string;
|
|
795
|
+
/** U04 (additive): the matched module specifier or ambient path. */
|
|
796
|
+
symbol?: string;
|
|
473
797
|
evidence: AnalysisEvidence;
|
|
474
798
|
};
|
|
475
799
|
type AnalysisIr = {
|
|
@@ -521,84 +845,12 @@ declare function policyDeltaAcknowledgementMatches(acknowledgement: PolicyDeltaA
|
|
|
521
845
|
findingIds: readonly string[];
|
|
522
846
|
}): boolean;
|
|
523
847
|
|
|
524
|
-
|
|
525
|
-
type
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
};
|
|
531
|
-
type ArchitectureChangeMapDependency = {
|
|
532
|
-
from: string;
|
|
533
|
-
to: string;
|
|
534
|
-
};
|
|
535
|
-
type ArchitectureChangeMap = {
|
|
536
|
-
$schema: string;
|
|
537
|
-
schemaVersion: typeof ARK_CHANGE_MAP_SCHEMA_VERSION;
|
|
538
|
-
files: ArchitectureChangeMapFile[];
|
|
539
|
-
dependencies: ArchitectureChangeMapDependency[];
|
|
540
|
-
};
|
|
541
|
-
type ArchitectureChangeMapContract = {
|
|
542
|
-
map: ArchitectureChangeMap;
|
|
543
|
-
hash: string;
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
type ArchitectureDependency = {
|
|
547
|
-
from: string;
|
|
548
|
-
to: string;
|
|
549
|
-
};
|
|
550
|
-
type ArchitectureActualChange = {
|
|
551
|
-
path: string;
|
|
552
|
-
operation: ArchitectureChangeOperation;
|
|
553
|
-
};
|
|
554
|
-
type ArchitectureConvergenceClassification = 'satisfied' | 'missing' | 'contradictory' | 'unplanned';
|
|
555
|
-
type ArchitectureConvergenceFinding = {
|
|
556
|
-
id: string;
|
|
557
|
-
classification: ArchitectureConvergenceClassification;
|
|
558
|
-
subject: 'file' | 'dependency';
|
|
559
|
-
message: string;
|
|
560
|
-
nextAction?: string;
|
|
561
|
-
path?: string;
|
|
562
|
-
from?: string;
|
|
563
|
-
to?: string;
|
|
564
|
-
expectedOperation?: ArchitectureChangeOperation;
|
|
565
|
-
actualOperation?: ArchitectureChangeOperation | 'added' | 'removed';
|
|
566
|
-
};
|
|
567
|
-
type ArchitectureConvergenceResult = {
|
|
568
|
-
schemaVersion: '1.0';
|
|
569
|
-
readOnly: true;
|
|
570
|
-
changeMapHash: string;
|
|
571
|
-
structurallyConverged: boolean;
|
|
572
|
-
behavioralCompletion: 'not-evaluated';
|
|
573
|
-
summary: Record<ArchitectureConvergenceClassification, number>;
|
|
574
|
-
findings: ArchitectureConvergenceFinding[];
|
|
575
|
-
};
|
|
576
|
-
type AnalyzeArchitectureConvergenceInput = {
|
|
577
|
-
changeMap: ArchitectureChangeMapContract;
|
|
578
|
-
changes: readonly ArchitectureActualChange[];
|
|
579
|
-
baseDependencies: readonly ArchitectureDependency[];
|
|
580
|
-
candidateDependencies: readonly ArchitectureDependency[];
|
|
581
|
-
};
|
|
582
|
-
declare function analyzeArchitectureConvergence(input: AnalyzeArchitectureConvergenceInput): ArchitectureConvergenceResult;
|
|
583
|
-
|
|
584
|
-
type SemanticDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
|
|
585
|
-
type SemanticDependency = {
|
|
586
|
-
specifier?: string;
|
|
587
|
-
kind: SemanticDependencyKind;
|
|
588
|
-
line: number;
|
|
589
|
-
typeOnly: boolean;
|
|
590
|
-
unresolved: boolean;
|
|
591
|
-
node: unknown;
|
|
592
|
-
};
|
|
593
|
-
type ForbiddenCapabilityUse = {
|
|
594
|
-
name: string;
|
|
595
|
-
line: number;
|
|
596
|
-
node: unknown;
|
|
597
|
-
};
|
|
598
|
-
/** Extract every dependency form whose specifier is statically knowable, plus unresolved calls. */
|
|
599
|
-
declare function extractSemanticDependencies(ts: any, sourceFile: any): SemanticDependency[];
|
|
600
|
-
/** Resolve forbidden ambient capabilities through symbols, aliases, globalThis, and static keys. */
|
|
601
|
-
declare function collectForbiddenCapabilityUses(ts: any, sourceFile: any, forbidden: readonly string[]): ForbiddenCapabilityUse[];
|
|
848
|
+
/**
|
|
849
|
+
* Public type vocabulary of the canonical analysis API (U02 pilot 2).
|
|
850
|
+
*
|
|
851
|
+
* Declarations only — the C02 entry point src/kernel/analysis.ts re-exports
|
|
852
|
+
* everything here, so consumer import paths never change.
|
|
853
|
+
*/
|
|
602
854
|
|
|
603
855
|
type AnalysisContract = ArkConfigLoadResult & {
|
|
604
856
|
policyHash: string;
|
|
@@ -704,21 +956,31 @@ type CollectAnalysisConfigWarningsInput = {
|
|
|
704
956
|
};
|
|
705
957
|
};
|
|
706
958
|
};
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Contract loading, project/change analysis, and policy-delta analysis
|
|
962
|
+
* (U02 pilot 2). Reached through the src/kernel/analysis.ts facade; consumer
|
|
963
|
+
* import paths never change.
|
|
964
|
+
*/
|
|
965
|
+
|
|
707
966
|
declare function loadContract(input: unknown, source?: string): AnalysisContract;
|
|
708
967
|
declare function analyzePolicyDelta(input: AnalyzePolicyDeltaInput): PolicyDeltaAnalysis;
|
|
709
968
|
declare function analyzeProject(input: AnalyzeProjectInput): AnalysisResult;
|
|
710
969
|
declare function analyzeChange(input: AnalyzeChangeInput): AnalysisResult;
|
|
711
970
|
declare function explainViolation(violation: AnalysisViolation): string;
|
|
971
|
+
|
|
712
972
|
declare function detectArchitectureCycles(graph: ReadonlyMap<string, ReadonlySet<string>>): ArchitectureEngineViolation[];
|
|
713
973
|
/** Canonical graph and layer-policy evaluator shared by library, CLI, and MCP adapters. */
|
|
714
974
|
declare function evaluateArchitectureGraph(input: EvaluateArchitectureGraphInput): ArchitectureEngineResult;
|
|
975
|
+
|
|
715
976
|
/**
|
|
716
977
|
* Evaluate one create/update/delete set as a single in-memory candidate.
|
|
717
978
|
* The function never writes and returns hashes that bind a later host commit to
|
|
718
979
|
* the exact base, policy, compiler options, and candidate contents it checked.
|
|
719
980
|
*/
|
|
720
981
|
declare function preflightChange(input: AnalyzeChangeInput): ChangePreflightResult;
|
|
982
|
+
|
|
721
983
|
/** Canonical config diagnostics over repo-relative file paths. */
|
|
722
984
|
declare function collectAnalysisConfigWarnings(input: CollectAnalysisConfigWarningsInput): ArchitectureEngineViolation[];
|
|
723
985
|
|
|
724
|
-
export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, ANALYSIS_IR_SCHEMA_VERSION, ARK_ANALYSIS_RESULT_SCHEMA, ARK_ANALYSIS_RESULT_SCHEMA_VERSION, type AdapterDiagnostic, type AdapterResult, type AdapterSeverity, type AdapterViolationInput, type AnalysisCapabilityUse, type AnalysisCompilerOptions, type AnalysisContract, type AnalysisEvidence, type AnalysisFile, type AnalysisFileChange, type AnalysisFileInput, type AnalysisImportEdge, type AnalysisIr, type AnalysisResult, type AnalysisViolation, type AnalyzeArchitectureConvergenceInput, type AnalyzeChangeInput, type AnalyzePolicyDeltaInput, type AnalyzeProjectInput, type ArchitectureActualChange, type ArchitectureChangeMap, type ArchitectureChangeMapContract, type ArchitectureChangeMapDependency, type ArchitectureChangeMapFile, type ArchitectureChangeOperation, type ArchitectureConvergenceClassification, type ArchitectureConvergenceFinding, type ArchitectureConvergenceResult, type ArchitectureDependency, type ArchitectureEngineEdge, type ArchitectureEngineResult, type ArchitectureEngineViolation, type ArchitectureLayer, type ArchitectureLayerConfig, type ArchitectureProfile, type ArchitectureRule, type ArkCheckConfig, ArkConfig, ArkConfigLoadResult, type ChangePreflightResult, type CollectAnalysisConfigWarningsInput, type CreateArchitectureProfileFromArkConfigOptions, type CreateArchitectureProfileOptions, type CreateElevenLayerArkConfigOptions, type EvaluateArchitectureGraphInput, type ForbiddenCapabilityUse, POLICY_DELTA_SCHEMA_VERSION, type PolicyDelta, type PolicyDeltaAcknowledgement, type PolicyDeltaAnalysis, type PolicyDeltaClassification, type PolicyDeltaFinding, type PreparedChangeFile, type SemanticDependency, type SemanticDependencyKind, analyzeArchitectureConvergence, analyzeChange, analyzePolicyDelta, analyzeProject, classifyArkPolicyDelta, collectAnalysisConfigWarnings, collectForbiddenCapabilityUses, createAICodeGate, createAdapterResult, createArchitectureProfile, createArchitectureProfileFromArkConfig, createElevenLayerArkConfig, detectArchitectureCycles, deterministicHash, elevenLayerProfile, evaluateArchitectureGraph, explainViolation, extractSemanticDependencies, loadContract, policyDeltaAcknowledgementMatches, preflightChange, stableSerialize, toAdapterDiagnostic, version };
|
|
986
|
+
export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, ANALYSIS_IR_SCHEMA_VERSION, ARK_ANALYSIS_RESULT_SCHEMA, ARK_ANALYSIS_RESULT_SCHEMA_VERSION, ARK_CONFIG_SCHEMA, ARK_CONFIG_SCHEMA_VERSION, type AdapterDiagnostic, type AdapterResult, type AdapterSeverity, type AdapterViolationInput, type AnalysisCapabilityUse, type AnalysisCompilerOptions, type AnalysisContract, type AnalysisEvidence, type AnalysisFile, type AnalysisFileChange, type AnalysisFileInput, type AnalysisImportEdge, type AnalysisIr, type AnalysisResult, type AnalysisViolation, type AnalyzeArchitectureConvergenceInput, type AnalyzeChangeInput, type AnalyzePolicyDeltaInput, type AnalyzeProjectInput, type ArchitectureActualChange, type ArchitectureChangeMap, type ArchitectureChangeMapContract, type ArchitectureChangeMapDependency, type ArchitectureChangeMapFile, type ArchitectureChangeOperation, type ArchitectureConvergenceClassification, type ArchitectureConvergenceFinding, type ArchitectureConvergenceResult, type ArchitectureDependency, type ArchitectureEngineEdge, type ArchitectureEngineResult, type ArchitectureEngineViolation, type ArchitectureLayer, type ArchitectureLayerConfig, type ArchitectureProfile, type ArchitectureRule, type ArkCheckConfig, ArkConfig, ArkConfigLoadResult, type ChangePreflightResult, type CollectAnalysisConfigWarningsInput, type CreateArchitectureProfileFromArkConfigOptions, type CreateArchitectureProfileOptions, type CreateElevenLayerArkConfigOptions, type EvaluateArchitectureGraphInput, type ForbiddenCapabilityUse, POLICY_DELTA_SCHEMA_VERSION, type PolicyDelta, type PolicyDeltaAcknowledgement, type PolicyDeltaAnalysis, type PolicyDeltaClassification, type PolicyDeltaFinding, type PreparedChangeFile, type SemanticDependency, type SemanticDependencyKind, analyzeArchitectureConvergence, analyzeChange, analyzePolicyDelta, analyzeProject, classifyArkPolicyDelta, collectAnalysisConfigWarnings, collectForbiddenCapabilityUses, createAICodeGate, createAdapterResult, createArchitectureProfile, createArchitectureProfileFromArkConfig, createElevenLayerArkConfig, detectArchitectureCycles, deterministicHash, elevenLayerProfile, evaluateArchitectureGraph, explainViolation, extractSemanticDependencies, loadArkConfigContract, loadContract, parseArkConfigJson, policyDeltaAcknowledgementMatches, preflightChange, stableSerialize, toAdapterDiagnostic, version };
|