arkgate 2.13.0 → 3.0.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 +39 -0
- package/README.md +37 -22
- package/bin/ark-check.mjs +62 -4
- package/bin/ark-mcp.mjs +108 -1
- package/bin/ark-shared.mjs +204 -149
- package/bin/ark.mjs +90 -25
- package/bin/lib/adapter-contract.mjs +93 -0
- package/bin/lib/agent-gates.mjs +1 -0
- package/bin/lib/analysis-engine.mjs +1171 -0
- package/bin/lib/architecture-scan.mjs +84 -135
- package/bin/lib/ci-and-commands.mjs +31 -0
- package/bin/lib/config-warnings.mjs +7 -205
- package/bin/lib/field-install.mjs +67 -10
- package/bin/lib/gate-files.mjs +42 -3
- package/bin/lib/graph-cycles.mjs +4 -54
- package/bin/lib/hook-templates.mjs +33 -1
- package/bin/lib/host-support-matrix.mjs +7 -1
- package/bin/lib/install-migrate.mjs +54 -16
- package/bin/lib/presets.mjs +42 -2
- package/bin/lib/safety-diagnostics.mjs +18 -17
- package/bin/lib/scan-files.mjs +12 -1
- package/bin/lib/skill-install.mjs +8 -1
- package/bin/lib/source-policy.mjs +36 -0
- package/bin/lib/start-preview.mjs +271 -0
- package/bin/lib/ts-resolve.mjs +11 -2
- package/bin/lib/write-path-capabilities.mjs +4 -0
- package/compat/nestjs.cjs +2 -0
- package/compat/nestjs.d.ts +2 -0
- package/compat/nestjs.js +1 -0
- package/compat/runtime.cjs +2 -0
- package/compat/runtime.d.ts +2 -0
- package/compat/runtime.js +1 -0
- package/dist/configContract-BxSIwVRo.d.cts +259 -0
- package/dist/configContract-BxSIwVRo.d.ts +259 -0
- package/dist/eslint/index.cjs +125 -48
- package/dist/eslint/index.d.cts +7 -1
- package/dist/eslint/index.d.ts +7 -1
- package/dist/eslint/index.js +125 -48
- package/dist/index.cjs +1248 -3302
- package/dist/index.d.cts +359 -483
- package/dist/index.d.ts +359 -483
- package/dist/index.js +1231 -3248
- package/docs/agent-guide.md +28 -16
- package/docs/ai-gates.md +30 -7
- package/docs/migrate-from-ark-runtime-kernel.md +2 -3
- package/docs/package-surface.md +8 -13
- package/docs/production-hardening.md +17 -4
- package/docs/typescript-support.md +27 -0
- package/package.json +33 -11
- package/schemas/ark.analysis-result.schema.json +91 -0
- package/server.json +2 -2
- package/templates/skills/ark-architect.md +3 -2
- package/dist/configContract-iBLxx5Tz.d.cts +0 -53
- package/dist/configContract-iBLxx5Tz.d.ts +0 -53
- package/dist/eslint/index.cjs.map +0 -1
- package/dist/eslint/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/nestjs/index.cjs +0 -2606
- package/dist/nestjs/index.cjs.map +0 -1
- package/dist/nestjs/index.d.cts +0 -23
- package/dist/nestjs/index.d.ts +0 -23
- package/dist/nestjs/index.js +0 -2582
- package/dist/nestjs/index.js.map +0 -1
- package/dist/runtime/index.cjs +0 -4014
- package/dist/runtime/index.cjs.map +0 -1
- package/dist/runtime/index.d.cts +0 -3
- package/dist/runtime/index.d.ts +0 -3
- package/dist/runtime/index.js +0 -3925
- package/dist/runtime/index.js.map +0 -1
- package/dist/types-BxBwnBpC.d.cts +0 -1041
- package/dist/types-Wcs_l1_J.d.ts +0 -1041
package/dist/index.d.ts
CHANGED
|
@@ -1,535 +1,337 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { c as ArkConfigLoadResult } from './configContract-iBLxx5Tz.js';
|
|
1
|
+
import { a as ArkConfigRule, b as ArkConfigLayer, A as ArkConfig, c as ArkConfigLoadResult } from './configContract-BxSIwVRo.js';
|
|
2
|
+
export { d as ARK_CONFIG_SCHEMA, e as ARK_CONFIG_SCHEMA_VERSION, l as loadArkConfigContract, p as parseArkConfigJson } from './configContract-BxSIwVRo.js';
|
|
4
3
|
|
|
5
4
|
/** ArkGate library version — single source of truth. */
|
|
6
|
-
declare const version = "
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
declare const version = "3.0.0";
|
|
6
|
+
|
|
7
|
+
/** Versioned public result contract shared by every ArkGate enforcement adapter. */
|
|
8
|
+
declare const ARK_ANALYSIS_RESULT_SCHEMA_VERSION: "1.0";
|
|
9
|
+
type AdapterSeverity = 'error' | 'warning';
|
|
10
|
+
type AdapterViolationInput = {
|
|
11
|
+
ruleId?: unknown;
|
|
12
|
+
code?: unknown;
|
|
13
|
+
message?: unknown;
|
|
14
|
+
file?: unknown;
|
|
15
|
+
line?: unknown;
|
|
16
|
+
column?: unknown;
|
|
17
|
+
target?: unknown;
|
|
18
|
+
fromLayer?: unknown;
|
|
19
|
+
toLayer?: unknown;
|
|
20
|
+
typeOnly?: unknown;
|
|
21
|
+
severity?: unknown;
|
|
22
|
+
};
|
|
23
|
+
type AdapterDiagnostic = {
|
|
24
|
+
ruleId: string;
|
|
25
|
+
severity: AdapterSeverity;
|
|
26
|
+
message: string;
|
|
27
|
+
location: {
|
|
28
|
+
file: string;
|
|
29
|
+
line: number;
|
|
30
|
+
column: number;
|
|
31
|
+
};
|
|
32
|
+
evidence: {
|
|
33
|
+
target?: string;
|
|
34
|
+
fromLayer?: string;
|
|
35
|
+
toLayer?: string;
|
|
36
|
+
typeOnly?: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type AdapterResult = {
|
|
40
|
+
schemaVersion: typeof ARK_ANALYSIS_RESULT_SCHEMA_VERSION;
|
|
41
|
+
valid: boolean;
|
|
42
|
+
diagnostics: AdapterDiagnostic[];
|
|
43
|
+
};
|
|
44
|
+
declare function toAdapterDiagnostic(violation: AdapterViolationInput, fallbackSeverity?: AdapterSeverity): AdapterDiagnostic;
|
|
45
|
+
declare function createAdapterResult(input: {
|
|
46
|
+
valid: boolean;
|
|
47
|
+
violations?: readonly AdapterViolationInput[];
|
|
48
|
+
warnings?: readonly AdapterViolationInput[];
|
|
49
|
+
}): AdapterResult;
|
|
50
|
+
declare const ARK_ANALYSIS_RESULT_SCHEMA: {
|
|
51
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
52
|
+
readonly $id: "https://unpkg.com/arkgate@2/schemas/ark.analysis-result.schema.json";
|
|
53
|
+
readonly title: "ArkGate analysis result";
|
|
54
|
+
readonly type: "object";
|
|
55
|
+
readonly additionalProperties: false;
|
|
56
|
+
readonly required: readonly ["schemaVersion", "valid", "diagnostics"];
|
|
57
|
+
readonly properties: {
|
|
58
|
+
readonly schemaVersion: {
|
|
59
|
+
readonly const: "1.0";
|
|
60
|
+
};
|
|
61
|
+
readonly valid: {
|
|
62
|
+
readonly type: "boolean";
|
|
63
|
+
};
|
|
64
|
+
readonly diagnostics: {
|
|
65
|
+
readonly type: "array";
|
|
66
|
+
readonly items: {
|
|
67
|
+
readonly type: "object";
|
|
68
|
+
readonly additionalProperties: false;
|
|
69
|
+
readonly required: readonly ["ruleId", "severity", "message", "location", "evidence"];
|
|
70
|
+
readonly properties: {
|
|
71
|
+
readonly ruleId: {
|
|
72
|
+
readonly type: "string";
|
|
73
|
+
readonly minLength: 1;
|
|
74
|
+
};
|
|
75
|
+
readonly severity: {
|
|
76
|
+
readonly enum: readonly ["error", "warning"];
|
|
77
|
+
};
|
|
78
|
+
readonly message: {
|
|
79
|
+
readonly type: "string";
|
|
80
|
+
readonly minLength: 1;
|
|
81
|
+
};
|
|
82
|
+
readonly location: {
|
|
83
|
+
readonly type: "object";
|
|
84
|
+
readonly additionalProperties: false;
|
|
85
|
+
readonly required: readonly ["file", "line", "column"];
|
|
86
|
+
readonly properties: {
|
|
87
|
+
readonly file: {
|
|
88
|
+
readonly type: "string";
|
|
89
|
+
readonly minLength: 1;
|
|
90
|
+
};
|
|
91
|
+
readonly line: {
|
|
92
|
+
readonly type: "integer";
|
|
93
|
+
readonly minimum: 1;
|
|
94
|
+
};
|
|
95
|
+
readonly column: {
|
|
96
|
+
readonly type: "integer";
|
|
97
|
+
readonly minimum: 1;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
readonly evidence: {
|
|
102
|
+
readonly type: "object";
|
|
103
|
+
readonly additionalProperties: false;
|
|
104
|
+
readonly properties: {
|
|
105
|
+
readonly target: {
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
};
|
|
108
|
+
readonly fromLayer: {
|
|
109
|
+
readonly type: "string";
|
|
110
|
+
};
|
|
111
|
+
readonly toLayer: {
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
};
|
|
114
|
+
readonly typeOnly: {
|
|
115
|
+
readonly type: "boolean";
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
20
124
|
|
|
21
125
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* This is the main entry point most users (and AI generators) will use.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* // Domain event
|
|
29
|
-
* const OrderPlaced = defineIntent<'Domain.Order.OrderPlaced', {
|
|
30
|
-
* orderId: string;
|
|
31
|
-
* amount: number;
|
|
32
|
-
* }>('Domain.Order.OrderPlaced');
|
|
33
|
-
*
|
|
34
|
-
* const event = OrderPlaced({ orderId: 'o-42', amount: 99.5 });
|
|
35
|
-
*
|
|
36
|
-
* // Application operation that declares a dependency at definition time
|
|
37
|
-
* const ConfirmOrder = defineIntent<'Application.ConfirmOrder', { orderId: string }>(
|
|
38
|
-
* 'Application.ConfirmOrder',
|
|
39
|
-
* { dependsOn: ['Domain.Order.OrderPlaced'] }
|
|
40
|
-
* );
|
|
41
|
-
* ```
|
|
126
|
+
* AI Code Gate (basic).
|
|
42
127
|
*
|
|
43
|
-
*
|
|
44
|
-
* - `Domain.*` for domain concepts and events
|
|
45
|
-
* - `Application.*` for use cases / orchestration
|
|
46
|
-
* - `Adapter.*` for external integrations
|
|
47
|
-
* - `Workflow.*` for sagas and long-running processes
|
|
48
|
-
* @param options - Optional initial relationship declarations (`dependsOn`, `produces`)
|
|
49
|
-
*/
|
|
50
|
-
declare function defineIntent<N extends IntentName, P = unknown>(name: N, options?: DefineIntentOptions): IntentCreator<N, P>;
|
|
51
|
-
/**
|
|
52
|
-
* Create an isolated IntentRegistry.
|
|
53
|
-
* Useful for testing, multiple bounded contexts, or advanced governance setups.
|
|
54
|
-
*/
|
|
55
|
-
declare function createIntentRegistry(): IntentRegistry;
|
|
56
|
-
/**
|
|
57
|
-
* The default registry backing the top-level `defineIntent` calls.
|
|
58
|
-
* You can inspect it or use it directly if needed.
|
|
59
|
-
*/
|
|
60
|
-
declare const defaultIntentRegistry: IntentRegistry;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Runtime validation for semantic intent naming conventions.
|
|
128
|
+
* Allows validation of generated source code against the defined architecture.
|
|
64
129
|
*/
|
|
65
|
-
interface
|
|
66
|
-
|
|
67
|
-
|
|
130
|
+
interface AICodeGateViolation {
|
|
131
|
+
/** Stable rule identifier for agents and CI pipelines. */
|
|
132
|
+
ruleId: string;
|
|
133
|
+
/** @deprecated Use ruleId — kept for backward compatibility. */
|
|
134
|
+
code: string;
|
|
135
|
+
message: string;
|
|
136
|
+
line?: number;
|
|
137
|
+
suggestion?: string;
|
|
138
|
+
source?: string;
|
|
139
|
+
filePath?: string;
|
|
140
|
+
target?: string;
|
|
141
|
+
fromLayer?: string;
|
|
142
|
+
toLayer?: string;
|
|
143
|
+
details?: unknown;
|
|
68
144
|
}
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Typed error thrown when hard policies are violated.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
declare class PolicyViolationError extends Error {
|
|
79
|
-
readonly violations: PolicyViolation[];
|
|
80
|
-
constructor(violations: PolicyViolation[]);
|
|
145
|
+
/** Extension point for external analyzers (AST, semantic, etc.). */
|
|
146
|
+
interface AIGateExtension<Context = unknown> {
|
|
147
|
+
readonly name: string;
|
|
148
|
+
analyze(source: string, context?: Context): AICodeGateViolation[];
|
|
81
149
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
version?: string;
|
|
95
|
-
rationale?: string;
|
|
96
|
-
enforcementMode?: PolicyEnforcementMode;
|
|
97
|
-
deprecated?: boolean | string;
|
|
98
|
-
replacedBy?: string;
|
|
99
|
-
check: (context: Context) => boolean | PolicyViolation | PolicyViolation[];
|
|
150
|
+
interface AICodeGateContext {
|
|
151
|
+
filePath?: string;
|
|
152
|
+
agentId?: string;
|
|
153
|
+
layer?: string;
|
|
154
|
+
[key: string]: unknown;
|
|
155
|
+
}
|
|
156
|
+
interface AICodeGateResult {
|
|
157
|
+
valid: boolean;
|
|
158
|
+
violations: AICodeGateViolation[];
|
|
159
|
+
}
|
|
160
|
+
interface AICodeGate<Context = AICodeGateContext> {
|
|
161
|
+
validate(source: string, context?: Context): AICodeGateResult;
|
|
100
162
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Creates a Policy from a declarative configuration.
|
|
103
|
-
*
|
|
104
|
-
* The provided `check` function is called as-is. The PolicyEngine is responsible
|
|
105
|
-
* for normalizing results (booleans, single violations, arrays) into a consistent
|
|
106
|
-
* set of PolicyViolation objects.
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* ```ts
|
|
110
|
-
* const noDomainToInfra = definePolicy({
|
|
111
|
-
* name: 'Domain must not depend on infrastructure',
|
|
112
|
-
* severity: 'hard',
|
|
113
|
-
* check: (ctx) => {
|
|
114
|
-
* const violations: PolicyViolation[] = [];
|
|
115
|
-
* // ... logic using ctx.registry.getAllRelationships()
|
|
116
|
-
* return violations.length > 0 ? violations : true;
|
|
117
|
-
* }
|
|
118
|
-
* });
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
declare function definePolicy<Context = unknown>(options: DefinePolicyOptions<Context>): Policy<Context>;
|
|
122
|
-
|
|
123
|
-
declare function createArchitectureProfile(options: CreateArchitectureProfileOptions): ArchitectureProfile;
|
|
124
|
-
declare function createArchitectureProfileFromArkConfig(config: ArkCheckConfig, options?: CreateArchitectureProfileFromArkConfigOptions): ArchitectureProfile;
|
|
125
|
-
declare const elevenLayerProfile: ArchitectureProfile;
|
|
126
|
-
declare function createElevenLayerArkConfig(options?: CreateElevenLayerArkConfigOptions): ArkCheckConfig;
|
|
127
163
|
|
|
128
164
|
/**
|
|
129
|
-
*
|
|
165
|
+
* Policy types for the Ark kernel.
|
|
130
166
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* Supports simple violation detection via rule functions.
|
|
167
|
+
* Policies allow declaring architectural rules that can be checked at runtime.
|
|
168
|
+
* Supports both hard policies (must never be violated) and soft policies (warnings).
|
|
134
169
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
170
|
+
type PolicySeverity = 'hard' | 'soft';
|
|
171
|
+
type PolicyEnforcementMode = 'runtime' | 'static' | 'runtime-and-static' | 'advisory';
|
|
138
172
|
/**
|
|
139
|
-
*
|
|
173
|
+
* Represents a single violation of a policy.
|
|
140
174
|
*/
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
175
|
+
interface PolicyViolation {
|
|
176
|
+
/** Name of the policy that was violated */
|
|
177
|
+
policyName: string;
|
|
178
|
+
/** Severity level of the policy */
|
|
179
|
+
severity: PolicySeverity;
|
|
180
|
+
/** Human-readable explanation of the violation */
|
|
181
|
+
message: string;
|
|
182
|
+
/** Optional additional structured details */
|
|
183
|
+
details?: unknown;
|
|
145
184
|
}
|
|
146
185
|
/**
|
|
147
|
-
*
|
|
186
|
+
* A Policy defines a rule that can be evaluated against a context.
|
|
148
187
|
*
|
|
149
|
-
* -
|
|
150
|
-
* - `produces` → `produces` edges
|
|
151
|
-
*/
|
|
152
|
-
declare function syncRegistryToGraph(registry: IntentRegistry, graph: DependencyGraph, options?: SyncRegistryOptions): void;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Built-in architectural policy helpers.
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
interface LayerFlowRule {
|
|
159
|
-
from: string;
|
|
160
|
-
to: string;
|
|
161
|
-
allowed: boolean;
|
|
162
|
-
message?: string;
|
|
163
|
-
}
|
|
164
|
-
interface LayerPolicyOptions {
|
|
165
|
-
name?: string;
|
|
166
|
-
severity?: 'hard' | 'soft';
|
|
167
|
-
/** Prefix rules — e.g. { from: 'Domain', to: 'Adapter', allowed: false } */
|
|
168
|
-
rules: LayerFlowRule[];
|
|
169
|
-
resolveLayer?: (name: string) => string | undefined;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Create a policy that enforces layer-crossing rules on graph edges or intent relationships.
|
|
188
|
+
* @template Context - The shape of data the policy evaluates (e.g. { registry, events })
|
|
173
189
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
edges?: GraphEdge[];
|
|
188
|
-
relationships?: IntentRelationship[];
|
|
189
|
-
}>;
|
|
190
|
+
interface Policy<Context = unknown> {
|
|
191
|
+
/** Unique name of the policy (used in violations and reporting) */
|
|
192
|
+
readonly name: string;
|
|
193
|
+
/** Whether this is a hard rule (enforced strictly) or soft (advisory) */
|
|
194
|
+
readonly severity: PolicySeverity;
|
|
195
|
+
/** Optional tags for policy classification (e.g. 'layer', 'naming') */
|
|
196
|
+
readonly tags?: readonly string[];
|
|
197
|
+
readonly owner?: string;
|
|
198
|
+
readonly version?: string;
|
|
199
|
+
readonly rationale?: string;
|
|
200
|
+
readonly enforcementMode?: PolicyEnforcementMode;
|
|
201
|
+
readonly deprecated?: boolean | string;
|
|
202
|
+
readonly replacedBy?: string;
|
|
190
203
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
204
|
+
* Evaluates the policy against the given context.
|
|
205
|
+
* Return true / [] for pass, false / single violation / array for failure.
|
|
193
206
|
*/
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
relationships?: IntentRelationship[];
|
|
197
|
-
}>;
|
|
198
|
-
};
|
|
199
|
-
declare function defineArchitectureProfilePolicy<Context extends {
|
|
200
|
-
edges?: GraphEdge[];
|
|
201
|
-
relationships?: IntentRelationship[];
|
|
202
|
-
}>(profile: ArchitectureProfile, options?: Omit<LayerPolicyOptions, 'rules' | 'resolveLayer'>): Policy<Context>;
|
|
207
|
+
check(context: Context): boolean | PolicyViolation | PolicyViolation[];
|
|
208
|
+
}
|
|
203
209
|
|
|
204
210
|
/**
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* durable log/DB (see `docs/production-hardening.md`).
|
|
211
|
+
* Core domain primitives for Ark.
|
|
212
|
+
* These types are the foundation for all governance concepts.
|
|
208
213
|
*/
|
|
209
|
-
declare class InMemoryAuditStore implements AuditStore {
|
|
210
|
-
private readonly maxRecords?;
|
|
211
|
-
private readonly records;
|
|
212
|
-
constructor(maxRecords?: number | undefined);
|
|
213
|
-
append(record: AuditRecord): void;
|
|
214
|
-
query(query?: AuditQuery): AuditRecord[];
|
|
215
|
-
clear(): void;
|
|
216
|
-
}
|
|
217
214
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
215
|
+
* Semantic intent names follow a convention:
|
|
216
|
+
* - Domain.* for domain events and entities
|
|
217
|
+
* - Application.* for use-cases / orchestration
|
|
218
|
+
* - Adapter.* for integration points
|
|
219
|
+
* - Workflow.* for sagas and processes
|
|
220
|
+
* - Job.* for background jobs and scheduling
|
|
221
|
+
* - Presentation.* for UI/API adapters
|
|
222
|
+
* - Reporting.* for read models and projections
|
|
223
|
+
* - Metadata.* for extensibility contracts
|
|
224
|
+
* - Security.* / Audit.* / Observability.* for cross-cutting kernel concerns
|
|
225
|
+
* - Kernel.* for Ark-owned governance signals
|
|
220
226
|
*/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
type IntentName = `Domain.${string}` | `Application.${string}` | `Adapter.${string}` | `Workflow.${string}` | `Job.${string}` | `Presentation.${string}` | `Reporting.${string}` | `Metadata.${string}` | `Security.${string}` | `Audit.${string}` | `Observability.${string}` | `Kernel.${string}`;
|
|
228
|
+
type CorrelationId = string;
|
|
229
|
+
interface EventMetadata {
|
|
230
|
+
occurredAt: string;
|
|
231
|
+
source: string;
|
|
232
|
+
kernelInstanceId?: string;
|
|
233
|
+
eventVersion?: string;
|
|
234
|
+
schemaVersion?: string;
|
|
235
|
+
allowInterception?: boolean;
|
|
236
|
+
interceptions?: Array<{
|
|
237
|
+
interceptorId: string;
|
|
238
|
+
timestamp: string;
|
|
239
|
+
}>;
|
|
240
|
+
correlationId?: CorrelationId;
|
|
241
|
+
causationId?: string;
|
|
242
|
+
traceId?: string;
|
|
243
|
+
spanId?: string;
|
|
244
|
+
parentSpanId?: string;
|
|
245
|
+
[key: string]: unknown;
|
|
231
246
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
* process exit. Use only for tests/demos/local single-process work; inject a durable
|
|
237
|
-
* `OutboxStore` in production (see `docs/production-hardening.md`).
|
|
238
|
-
*/
|
|
239
|
-
declare class InMemoryOutboxStore implements OutboxStore {
|
|
240
|
-
private readonly records;
|
|
241
|
-
enqueue(event: DomainEvent): Promise<OutboxRecord>;
|
|
242
|
-
markDispatched(id: string): Promise<void>;
|
|
243
|
-
markFailed(id: string, error: unknown): Promise<void>;
|
|
244
|
-
list(status?: OutboxStatus): Promise<OutboxRecord[]>;
|
|
245
|
-
clear(): Promise<void>;
|
|
247
|
+
interface DomainEvent<Name extends IntentName = IntentName, Payload = unknown> {
|
|
248
|
+
intent: Name;
|
|
249
|
+
payload: Payload;
|
|
250
|
+
metadata: EventMetadata;
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
/**
|
|
249
|
-
*
|
|
254
|
+
* Intent-specific types for the Ark kernel.
|
|
250
255
|
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
* policy → history/outbox/trace → handlers → onPublish hook
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
|
-
declare function createEventBus<Context = unknown>(options?: EventBusOptions<Context>): EventBus;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Helpers for building policy evaluation context on event publish.
|
|
256
|
+
* Intents provide semantic naming for every important concept in the system
|
|
257
|
+
* (domain events, application operations, adapters, workflows).
|
|
260
258
|
*/
|
|
261
259
|
|
|
262
260
|
/**
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
|
|
267
|
-
interface PublishPolicyContext {
|
|
268
|
-
event: DomainEvent;
|
|
269
|
-
relationships?: IntentRelationship[];
|
|
270
|
-
edges?: GraphEdge[];
|
|
271
|
-
}
|
|
272
|
-
interface GraphPolicyContext {
|
|
273
|
-
relationships?: IntentRelationship[];
|
|
274
|
-
edges?: GraphEdge[];
|
|
275
|
-
}
|
|
276
|
-
interface BuildPublishPolicyContextOptions {
|
|
277
|
-
intentRegistry?: IntentRegistry;
|
|
278
|
-
dependencyGraph?: DependencyGraph;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Build a getPolicyContext function that feeds registry + graph data to policies.
|
|
261
|
+
* An IntentCreator is a callable that creates a strongly-typed DomainEvent
|
|
262
|
+
* when invoked with a payload.
|
|
263
|
+
*
|
|
264
|
+
* It also carries the semantic `name`.
|
|
282
265
|
*
|
|
283
266
|
* @example
|
|
284
|
-
*
|
|
285
|
-
* const
|
|
286
|
-
* intentRegistry: registry,
|
|
287
|
-
* dependencyGraph: graph,
|
|
288
|
-
* policies: [architecturalPolicies.layerIsolation()],
|
|
289
|
-
* });
|
|
290
|
-
* ```
|
|
291
|
-
*/
|
|
292
|
-
declare function buildPublishPolicyContext(options: BuildPublishPolicyContextOptions): (event: DomainEvent) => PublishPolicyContext;
|
|
293
|
-
declare function definePublishPolicy(options: DefinePolicyOptions<PublishPolicyContext>): Policy<PublishPolicyContext>;
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Event bus governance errors.
|
|
267
|
+
* const OrderPlaced = defineIntent<'Domain.Order.OrderPlaced', { orderId: string }>('Domain.Order.OrderPlaced');
|
|
268
|
+
* const event = OrderPlaced({ orderId: 'o-1' });
|
|
297
269
|
*/
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
declare class LayerPolicyContextError extends Error {
|
|
308
|
-
constructor();
|
|
309
|
-
}
|
|
310
|
-
declare class EventContractViolationError extends Error {
|
|
311
|
-
readonly intentName: string;
|
|
312
|
-
readonly issues: unknown[];
|
|
313
|
-
constructor(intentName: string, issues: unknown[]);
|
|
314
|
-
}
|
|
315
|
-
declare class UnknownEventSourceError extends Error {
|
|
316
|
-
readonly intentName: string;
|
|
317
|
-
readonly source?: string;
|
|
318
|
-
constructor(intentName: string, source?: string);
|
|
319
|
-
}
|
|
320
|
-
declare class SourceMetadataOverrideError extends Error {
|
|
321
|
-
readonly boundSource: string;
|
|
322
|
-
readonly attemptedSource: string;
|
|
323
|
-
constructor(boundSource: string, attemptedSource: string);
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Thrown when the OBSERVED producer→event flow crosses a forbidden layer boundary
|
|
327
|
-
* under `enforceObservedLayerFlow: 'hard'`. Unlike declared-model policy errors, this
|
|
328
|
-
* reflects what the running system actually did at publish time.
|
|
329
|
-
*/
|
|
330
|
-
declare class ObservedLayerFlowViolationError extends Error {
|
|
331
|
-
readonly source: string;
|
|
332
|
-
readonly intentName: string;
|
|
333
|
-
readonly fromLayer: string;
|
|
334
|
-
readonly toLayer: string;
|
|
335
|
-
constructor(source: string, intentName: string, fromLayer: string, toLayer: string, message?: string);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
declare function createObservabilityReporter(options: CreateObservabilityReporterOptions): ObservabilityReporter;
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Basic MetadataRegistry implementation.
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
declare function createMetadataRegistry(): MetadataRegistry;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Reference in-process read-model store. **Not production durability.**
|
|
348
|
-
* See `docs/production-hardening.md`.
|
|
349
|
-
*/
|
|
350
|
-
declare class InMemoryReadModelStore implements ReadModelStore {
|
|
351
|
-
private readonly states;
|
|
352
|
-
load<State = unknown>(name: string): State | undefined;
|
|
353
|
-
save<State = unknown>(name: string, state: State): void;
|
|
354
|
-
clear(name?: string): void;
|
|
355
|
-
}
|
|
356
|
-
declare function createProjectionRegistry(options?: CreateProjectionRegistryOptions): ProjectionRegistry;
|
|
357
|
-
|
|
358
|
-
/** Current Ark manifest JSON schema version. */
|
|
359
|
-
declare const MANIFEST_SCHEMA_VERSION = "1.0";
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Aggregates kernel registries into a single machine-readable manifest.
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
interface CreateArkManifestOptions {
|
|
366
|
-
registry?: IntentRegistry;
|
|
367
|
-
policyEngine?: PolicyEngine;
|
|
368
|
-
metadata?: MetadataRegistry;
|
|
369
|
-
graph?: DependencyGraph;
|
|
370
|
-
profile?: ArchitectureProfile;
|
|
371
|
-
projections?: ProjectionRegistry;
|
|
372
|
-
eventContracts?: EventContractRegistry;
|
|
373
|
-
observability?: ObservabilityReporter;
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Create a machine-readable snapshot of the current architectural contract.
|
|
377
|
-
* Intended for AI agents, codegen tools, and documentation generators.
|
|
378
|
-
*/
|
|
379
|
-
declare function createArkManifest(options?: CreateArkManifestOptions): ArkManifest;
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* In-process workflow engine with durable-store seams.
|
|
383
|
-
*/
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Reference in-process workflow store. **Not production durability.**
|
|
387
|
-
* See `docs/production-hardening.md`.
|
|
388
|
-
*/
|
|
389
|
-
declare class InMemoryWorkflowStore implements WorkflowStore {
|
|
390
|
-
private readonly snapshots;
|
|
391
|
-
save<P extends SagaContext>(snapshot: WorkflowSnapshot<P>): void;
|
|
392
|
-
get<P extends SagaContext = SagaContext>(id: string): WorkflowSnapshot<P> | undefined;
|
|
393
|
-
list(workflowName?: string): WorkflowSnapshot[];
|
|
394
|
-
clear(): void;
|
|
270
|
+
interface IntentCreator<Name extends IntentName, Payload = unknown> {
|
|
271
|
+
/**
|
|
272
|
+
* Creates a DomainEvent for this intent.
|
|
273
|
+
*/
|
|
274
|
+
(payload: Payload): DomainEvent<Name, Payload>;
|
|
275
|
+
/**
|
|
276
|
+
* The fully-qualified semantic name of the intent (e.g. "Domain.Order.OrderPlaced").
|
|
277
|
+
*/
|
|
278
|
+
readonly name: Name;
|
|
395
279
|
}
|
|
396
|
-
declare function createWorkflowEngine(bus: EventBus, options?: CreateWorkflowEngineOptions): WorkflowEngine;
|
|
397
|
-
declare function createSaga<P extends SagaContext = SagaContext>(def: SagaDefinition<P>, bus: EventBus, options?: CreateWorkflowEngineOptions & {
|
|
398
|
-
id?: string;
|
|
399
|
-
}): SagaInstance<P>;
|
|
400
280
|
|
|
401
281
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
282
|
+
* Architecture layer profiles.
|
|
283
|
+
*
|
|
284
|
+
* A profile turns semantic names such as `Domain.Order.Placed` into governed
|
|
285
|
+
* layer names and dependency rules.
|
|
405
286
|
*/
|
|
406
|
-
declare const DEFAULT_MAX_HISTORY_SIZE = 1000;
|
|
407
|
-
declare function createArkKernel(options?: CreateArkKernelOptions): ArkKernel;
|
|
408
|
-
declare function createStrictArkKernel(options?: CreateArkKernelOptions): ArkKernel;
|
|
409
|
-
declare function createArkKernelFromConfig(config: ArkKernelConfig, options?: CreateArkKernelFromConfigOptions): ArkKernel;
|
|
410
|
-
declare function createStrictArkKernelFromConfig(config: ArkKernelConfig, options?: CreateArkKernelFromConfigOptions): ArkKernel;
|
|
411
|
-
declare function createLenientArkKernelFromConfig(config: ArkKernelConfig, options?: CreateArkKernelFromConfigOptions): ArkKernel;
|
|
412
|
-
declare function createLenientArkKernel(options?: CreateArkKernelOptions): ArkKernel;
|
|
413
|
-
|
|
414
|
-
interface ArkTestSnapshot {
|
|
415
|
-
events: DomainEvent[];
|
|
416
|
-
traces: TraceRecord[];
|
|
417
|
-
audit: AuditRecord[];
|
|
418
|
-
outbox: OutboxRecord[];
|
|
419
|
-
observability: ObservabilityDriftReport;
|
|
420
|
-
}
|
|
421
|
-
interface ArkTestHarness {
|
|
422
|
-
events(intent?: string): DomainEvent[];
|
|
423
|
-
traces(type?: TraceRecordType): TraceRecord[];
|
|
424
|
-
audit(query?: AuditQuery): Promise<AuditRecord[]>;
|
|
425
|
-
outbox(status?: OutboxStatus): Promise<OutboxRecord[]>;
|
|
426
|
-
observability(): ObservabilityDriftReport;
|
|
427
|
-
snapshot(): Promise<ArkTestSnapshot>;
|
|
428
|
-
clear(): Promise<void>;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
declare function createArkTestHarness(kernel: ArkKernel): ArkTestHarness;
|
|
432
287
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
288
|
+
interface ArchitectureLayer {
|
|
289
|
+
name: string;
|
|
290
|
+
prefixes: string[];
|
|
291
|
+
/**
|
|
292
|
+
* Custom matcher for teams whose intent names don't follow prefix conventions.
|
|
293
|
+
* Checked before any prefix matching, in layer declaration order. A layer may
|
|
294
|
+
* use `match` alone (with `prefixes: []`), prefixes alone, or both.
|
|
295
|
+
*/
|
|
296
|
+
match?: (name: string) => boolean;
|
|
297
|
+
description?: string;
|
|
298
|
+
order?: number;
|
|
442
299
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
300
|
+
type ArchitectureRule = ArkConfigRule;
|
|
301
|
+
interface ArchitectureProfile {
|
|
302
|
+
name: string;
|
|
303
|
+
layers: ArchitectureLayer[];
|
|
304
|
+
rules: ArchitectureRule[];
|
|
305
|
+
resolveLayer(name: string): string | undefined;
|
|
449
306
|
}
|
|
450
|
-
interface
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
307
|
+
interface CreateArchitectureProfileOptions {
|
|
308
|
+
name: string;
|
|
309
|
+
layers: ArchitectureLayer[];
|
|
310
|
+
rules?: ArchitectureRule[];
|
|
454
311
|
}
|
|
455
|
-
interface
|
|
312
|
+
interface CreateArchitectureProfileFromArkConfigOptions {
|
|
313
|
+
/** Runtime profile name. Default: config.name or "ark.config.json". */
|
|
456
314
|
name?: string;
|
|
457
|
-
layer?: string;
|
|
458
|
-
intent?: IntentName;
|
|
459
|
-
requiredKeys?: string[];
|
|
460
315
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
} | {
|
|
467
|
-
ok: false;
|
|
468
|
-
missing: string[];
|
|
316
|
+
type ArchitectureLayerConfig = ArkConfigLayer;
|
|
317
|
+
type ArkCheckConfig = Omit<ArkConfig, '$schema' | 'schemaVersion' | 'rules'> & {
|
|
318
|
+
$schema?: string;
|
|
319
|
+
schemaVersion?: ArkConfig['schemaVersion'];
|
|
320
|
+
rules?: ArchitectureRule[];
|
|
469
321
|
};
|
|
470
|
-
interface
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
322
|
+
interface CreateElevenLayerArkConfigOptions {
|
|
323
|
+
/** Source root used in generated file patterns. Default: "src". */
|
|
324
|
+
rootDir?: string;
|
|
325
|
+
/** Include entries for ark-check. Default: [rootDir]. */
|
|
326
|
+
include?: string[];
|
|
327
|
+
/** Mark generated layers optional. Default: true. */
|
|
328
|
+
optionalLayers?: boolean;
|
|
475
329
|
}
|
|
476
|
-
type AdapterGovernanceResult = {
|
|
477
|
-
ok: true;
|
|
478
|
-
issues: [];
|
|
479
|
-
} | {
|
|
480
|
-
ok: false;
|
|
481
|
-
issues: AdapterGovernanceIssue[];
|
|
482
|
-
};
|
|
483
330
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
*/
|
|
489
|
-
|
|
490
|
-
declare function definePort<T = unknown>(name: string, options?: DefinePortOptions): Port<T>;
|
|
491
|
-
declare function createAdapter<T>(port: Port<T>, impl: T, requiredKeysOrOptions?: string[] | CreateAdapterOptions, adapterOptions?: CreateAdapterOptions): Adapter<T>;
|
|
492
|
-
declare function checkContract(impl: unknown, requiredKeys?: string[]): ContractCheckResult;
|
|
493
|
-
declare function checkAdapterGovernance(adapter: Adapter): AdapterGovernanceResult;
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* AI Code Gate (basic).
|
|
497
|
-
*
|
|
498
|
-
* Allows validation of generated source code against the defined architecture.
|
|
499
|
-
*/
|
|
500
|
-
interface AICodeGateViolation {
|
|
501
|
-
/** Stable rule identifier for agents and CI pipelines. */
|
|
502
|
-
ruleId: string;
|
|
503
|
-
/** @deprecated Use ruleId — kept for backward compatibility. */
|
|
504
|
-
code: string;
|
|
505
|
-
message: string;
|
|
506
|
-
line?: number;
|
|
507
|
-
suggestion?: string;
|
|
508
|
-
source?: string;
|
|
509
|
-
filePath?: string;
|
|
510
|
-
target?: string;
|
|
511
|
-
fromLayer?: string;
|
|
512
|
-
toLayer?: string;
|
|
513
|
-
details?: unknown;
|
|
514
|
-
}
|
|
515
|
-
/** Extension point for external analyzers (AST, semantic, etc.). */
|
|
516
|
-
interface AIGateExtension<Context = unknown> {
|
|
517
|
-
readonly name: string;
|
|
518
|
-
analyze(source: string, context?: Context): AICodeGateViolation[];
|
|
519
|
-
}
|
|
520
|
-
interface AICodeGateContext {
|
|
521
|
-
filePath?: string;
|
|
522
|
-
agentId?: string;
|
|
523
|
-
layer?: string;
|
|
524
|
-
[key: string]: unknown;
|
|
525
|
-
}
|
|
526
|
-
interface AICodeGateResult {
|
|
527
|
-
valid: boolean;
|
|
528
|
-
violations: AICodeGateViolation[];
|
|
529
|
-
}
|
|
530
|
-
interface AICodeGate<Context = AICodeGateContext> {
|
|
531
|
-
validate(source: string, context?: Context): AICodeGateResult;
|
|
532
|
-
}
|
|
331
|
+
declare function createArchitectureProfile(options: CreateArchitectureProfileOptions): ArchitectureProfile;
|
|
332
|
+
declare function createArchitectureProfileFromArkConfig(config: ArkCheckConfig, options?: CreateArchitectureProfileFromArkConfigOptions): ArchitectureProfile;
|
|
333
|
+
declare const elevenLayerProfile: ArchitectureProfile;
|
|
334
|
+
declare function createElevenLayerArkConfig(options?: CreateElevenLayerArkConfigOptions): ArkCheckConfig;
|
|
533
335
|
|
|
534
336
|
/**
|
|
535
337
|
* Basic AI Code Gate implementation.
|
|
@@ -679,6 +481,25 @@ declare function deterministicHash(value: string): string;
|
|
|
679
481
|
/** Serialize JSON-like values with sorted object keys for reproducible hashes. */
|
|
680
482
|
declare function stableSerialize(value: unknown): string;
|
|
681
483
|
|
|
484
|
+
type SemanticDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
|
|
485
|
+
type SemanticDependency = {
|
|
486
|
+
specifier?: string;
|
|
487
|
+
kind: SemanticDependencyKind;
|
|
488
|
+
line: number;
|
|
489
|
+
typeOnly: boolean;
|
|
490
|
+
unresolved: boolean;
|
|
491
|
+
node: unknown;
|
|
492
|
+
};
|
|
493
|
+
type ForbiddenCapabilityUse = {
|
|
494
|
+
name: string;
|
|
495
|
+
line: number;
|
|
496
|
+
node: unknown;
|
|
497
|
+
};
|
|
498
|
+
/** Extract every dependency form whose specifier is statically knowable, plus unresolved calls. */
|
|
499
|
+
declare function extractSemanticDependencies(ts: any, sourceFile: any): SemanticDependency[];
|
|
500
|
+
/** Resolve forbidden ambient capabilities through symbols, aliases, globalThis, and static keys. */
|
|
501
|
+
declare function collectForbiddenCapabilityUses(ts: any, sourceFile: any, forbidden: readonly string[]): ForbiddenCapabilityUse[];
|
|
502
|
+
|
|
682
503
|
type AnalysisContract = ArkConfigLoadResult & {
|
|
683
504
|
policyHash: string;
|
|
684
505
|
};
|
|
@@ -693,9 +514,64 @@ type AnalyzeChangeInput = AnalyzeProjectInput & {
|
|
|
693
514
|
type AnalysisResult = {
|
|
694
515
|
ir: AnalysisIr;
|
|
695
516
|
};
|
|
517
|
+
type ArchitectureEngineViolation = {
|
|
518
|
+
ruleId: string;
|
|
519
|
+
message: string;
|
|
520
|
+
file?: string;
|
|
521
|
+
line?: number;
|
|
522
|
+
target?: string;
|
|
523
|
+
fromLayer?: string;
|
|
524
|
+
toLayer?: string;
|
|
525
|
+
[key: string]: unknown;
|
|
526
|
+
};
|
|
527
|
+
type ArchitectureEngineEdge = {
|
|
528
|
+
from: string;
|
|
529
|
+
fromLayer: string;
|
|
530
|
+
to?: string;
|
|
531
|
+
toLayer?: string;
|
|
532
|
+
line: number;
|
|
533
|
+
kind: string;
|
|
534
|
+
typeOnly?: boolean;
|
|
535
|
+
targetTypeOnlyExports?: boolean;
|
|
536
|
+
sourcePureTypeModule?: boolean;
|
|
537
|
+
namedBindingsTypeOnly?: boolean;
|
|
538
|
+
portProofEligible?: boolean;
|
|
539
|
+
};
|
|
540
|
+
type EvaluateArchitectureGraphInput = {
|
|
541
|
+
config: ArkConfig;
|
|
542
|
+
rules: ArkConfig['rules'];
|
|
543
|
+
files: readonly string[];
|
|
544
|
+
contentViolations: readonly ArchitectureEngineViolation[];
|
|
545
|
+
edges: readonly ArchitectureEngineEdge[];
|
|
546
|
+
warnings?: readonly ArchitectureEngineViolation[];
|
|
547
|
+
safety?: unknown;
|
|
548
|
+
};
|
|
549
|
+
type ArchitectureEngineResult = {
|
|
550
|
+
violations: ArchitectureEngineViolation[];
|
|
551
|
+
warnings: ArchitectureEngineViolation[];
|
|
552
|
+
safety?: unknown;
|
|
553
|
+
};
|
|
554
|
+
type CollectAnalysisConfigWarningsInput = {
|
|
555
|
+
config: ArkConfig;
|
|
556
|
+
rules: ArkConfig['rules'];
|
|
557
|
+
files: readonly string[];
|
|
558
|
+
manifest?: {
|
|
559
|
+
architecture?: {
|
|
560
|
+
layers?: readonly {
|
|
561
|
+
name?: string;
|
|
562
|
+
prefixes?: readonly string[];
|
|
563
|
+
}[];
|
|
564
|
+
};
|
|
565
|
+
};
|
|
566
|
+
};
|
|
696
567
|
declare function loadContract(input: unknown, source?: string): AnalysisContract;
|
|
697
568
|
declare function analyzeProject(input: AnalyzeProjectInput): AnalysisResult;
|
|
698
569
|
declare function analyzeChange(input: AnalyzeChangeInput): AnalysisResult;
|
|
699
570
|
declare function explainViolation(violation: AnalysisViolation): string;
|
|
571
|
+
declare function detectArchitectureCycles(graph: ReadonlyMap<string, ReadonlySet<string>>): ArchitectureEngineViolation[];
|
|
572
|
+
/** Canonical graph and layer-policy evaluator shared by library, CLI, and MCP adapters. */
|
|
573
|
+
declare function evaluateArchitectureGraph(input: EvaluateArchitectureGraphInput): ArchitectureEngineResult;
|
|
574
|
+
/** Canonical config diagnostics over repo-relative file paths. */
|
|
575
|
+
declare function collectAnalysisConfigWarnings(input: CollectAnalysisConfigWarningsInput): ArchitectureEngineViolation[];
|
|
700
576
|
|
|
701
|
-
export { type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, ANALYSIS_IR_SCHEMA_VERSION, type
|
|
577
|
+
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 AnalyzeChangeInput, type AnalyzeProjectInput, type ArchitectureEngineEdge, type ArchitectureEngineResult, type ArchitectureEngineViolation, type ArchitectureLayer, type ArchitectureLayerConfig, type ArchitectureProfile, type ArchitectureRule, type ArkCheckConfig, ArkConfig, ArkConfigLoadResult, type CollectAnalysisConfigWarningsInput, type CreateArchitectureProfileFromArkConfigOptions, type CreateArchitectureProfileOptions, type CreateElevenLayerArkConfigOptions, type EvaluateArchitectureGraphInput, type ForbiddenCapabilityUse, type SemanticDependency, type SemanticDependencyKind, analyzeChange, analyzeProject, collectAnalysisConfigWarnings, collectForbiddenCapabilityUses, createAICodeGate, createAdapterResult, createArchitectureProfile, createArchitectureProfileFromArkConfig, createElevenLayerArkConfig, detectArchitectureCycles, deterministicHash, elevenLayerProfile, evaluateArchitectureGraph, explainViolation, extractSemanticDependencies, loadContract, stableSerialize, toAdapterDiagnostic, version };
|