arkgate 4.7.5 → 4.8.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 -3
- package/README.md +24 -12
- package/bin/lib/analysis-engine.mjs +6 -6
- package/bin/lib/ark-order-error.mjs +18 -0
- package/bin/lib/ark-order-facts.mjs +53 -0
- package/bin/lib/ark-order-invariants.mjs +160 -0
- package/bin/lib/ark-order-sensors.mjs +118 -0
- package/bin/lib/ark-order-types.mjs +11 -0
- package/bin/lib/ark-run-sensors.mjs +13 -5
- package/bin/lib/config-contract.mjs +16 -72
- package/bin/lib/config-extras.mjs +151 -0
- package/bin/lib/diagnostic-catalog.mjs +7 -2
- package/bin/lib/extra-merge-teeth.mjs +8 -2
- package/bin/lib/install-migrate.mjs +4 -2
- package/bin/lib/managed-upgrade.mjs +1 -1
- package/bin/lib/mcp-adoption.mjs +9 -3
- package/bin/lib/remediation.mjs +48 -9
- package/bin/lib/resolved-candidate-facts.mjs +43 -0
- package/bin/lib/skill-install.mjs +17 -2
- package/bin/lib/start-preview.mjs +1 -0
- package/bin/lib/status-manifest.mjs +1 -1
- package/bin/lib/write-path-capabilities.mjs +2 -2
- package/dist/{configTypes-CgJimx9o.d.ts → configTypes-BdCe_gvv.d.ts} +22 -6
- package/dist/diagnosticCatalog-RiKPUFRG.d.ts +2307 -0
- package/dist/eslint/index.cjs +7 -6
- package/dist/eslint/index.d.ts +33 -2
- package/dist/eslint/index.js +7 -6
- package/dist/index.cjs +35 -35
- package/dist/index.d.ts +271 -2554
- package/dist/index.js +35 -35
- package/dist/nestjs/index.cjs +18 -0
- package/dist/nestjs/index.d.ts +24 -0
- package/dist/nestjs/index.js +18 -0
- package/dist/order/index.cjs +1 -0
- package/dist/order/index.d.ts +79 -0
- package/dist/order/index.js +1 -0
- package/dist/runtime/index.cjs +25 -0
- package/dist/runtime/index.d.ts +497 -0
- package/dist/runtime/index.js +25 -0
- package/dist/types-C9KApBzX.d.ts +1237 -0
- package/dist/types-DCSlrRnV.d.ts +181 -0
- package/docs/README.md +4 -5
- package/docs/agent-guide.md +1 -1
- package/docs/ai-gates.md +9 -2
- package/docs/configuration.md +13 -6
- package/docs/develop.md +12 -3
- package/docs/diagnostics.md +57 -3
- package/docs/package-surface.md +21 -17
- package/docs/product-voice.md +2 -1
- package/docs/use.md +8 -0
- package/package.json +21 -2
- package/schemas/ark.config.schema.json +54 -2
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
- package/server.json +2 -2
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +2 -2
- package/templates/agent-skills/ark-contract/SKILL.md +1 -1
- package/templates/agent-skills/ark-place/SKILL.md +15 -6
- package/templates/agent-skills/ark-runtime/SKILL.md +10 -15
- package/templates/skills/ark-adopt.md +2 -2
- package/templates/skills/ark-contract.md +1 -1
- package/templates/skills/ark-place.md +15 -6
- package/templates/skills/ark-runtime.md +10 -15
|
@@ -0,0 +1,2307 @@
|
|
|
1
|
+
import { e as CreateArchitectureProfileOptions, b as ArchitectureProfile, d as ArkCheckConfig, C as CreateArchitectureProfileFromArkConfigOptions, f as CreateElevenLayerArkConfigOptions, i as Policy, j as IntentCreator, I as IntentName } from './types-DCSlrRnV.js';
|
|
2
|
+
import { A as ArkConfig, c as ArkConfigLoadResult } from './configTypes-BdCe_gvv.js';
|
|
3
|
+
|
|
4
|
+
/** Versioned public result contract shared by every ArkGate enforcement adapter. */
|
|
5
|
+
/**
|
|
6
|
+
* 1.5 adds stable finding refs on every factory-emitted diagnostic (ACS06):
|
|
7
|
+
* `findingRef`, `targetKey` (baseline-compatible), `docsCodePath`.
|
|
8
|
+
* 1.4 added optional evidence.arkruleId + evidence.arkruleSource (ADR 0012 / AR03).
|
|
9
|
+
*/
|
|
10
|
+
declare const ARK_ANALYSIS_RESULT_SCHEMA_VERSION: "1.5";
|
|
11
|
+
/** Repo-relative diagnostics docs path (parity with ACS02 diagnostic catalog). */
|
|
12
|
+
declare const ADAPTER_DIAGNOSTIC_DOCS_RELATIVE_PATH: "docs/diagnostics.md";
|
|
13
|
+
type AdapterSeverity = 'error' | 'warning';
|
|
14
|
+
type AnalysisCompleteness = 'complete' | 'partial' | 'unavailable';
|
|
15
|
+
type AnalysisMode = 'lexical-compatibility' | 'resolved-candidate-facts';
|
|
16
|
+
type AdapterCompletenessReason = {
|
|
17
|
+
code: string;
|
|
18
|
+
message: string;
|
|
19
|
+
file?: string;
|
|
20
|
+
};
|
|
21
|
+
type AdapterViolationInput = {
|
|
22
|
+
ruleId?: unknown;
|
|
23
|
+
code?: unknown;
|
|
24
|
+
message?: unknown;
|
|
25
|
+
file?: unknown;
|
|
26
|
+
line?: unknown;
|
|
27
|
+
column?: unknown;
|
|
28
|
+
target?: unknown;
|
|
29
|
+
fromLayer?: unknown;
|
|
30
|
+
toLayer?: unknown;
|
|
31
|
+
typeOnly?: unknown;
|
|
32
|
+
targetTypeOnlyExports?: unknown;
|
|
33
|
+
sourcePureTypeModule?: unknown;
|
|
34
|
+
namedBindingsTypeOnly?: unknown;
|
|
35
|
+
portProofEligible?: unknown;
|
|
36
|
+
peerIsolation?: unknown;
|
|
37
|
+
edgeKind?: unknown;
|
|
38
|
+
severity?: unknown;
|
|
39
|
+
/** When false, finding is non-blocking (e.g. type-only placement debt). */
|
|
40
|
+
failsStrict?: unknown;
|
|
41
|
+
nextAction?: unknown;
|
|
42
|
+
/** U04: the denied capability id on CAPABILITY_VIOLATION. */
|
|
43
|
+
capability?: unknown;
|
|
44
|
+
/** AR03: ArkRule identity for structure/invariant diagnostics. */
|
|
45
|
+
arkruleId?: unknown;
|
|
46
|
+
/** AR03: project-relative ArkRules source file that declared the rule. */
|
|
47
|
+
arkruleSource?: unknown;
|
|
48
|
+
};
|
|
49
|
+
type AdapterDiagnostic = {
|
|
50
|
+
ruleId: string;
|
|
51
|
+
severity: AdapterSeverity;
|
|
52
|
+
message: string;
|
|
53
|
+
location: {
|
|
54
|
+
file: string;
|
|
55
|
+
line: number;
|
|
56
|
+
column: number;
|
|
57
|
+
};
|
|
58
|
+
evidence: {
|
|
59
|
+
target?: string;
|
|
60
|
+
fromLayer?: string;
|
|
61
|
+
toLayer?: string;
|
|
62
|
+
typeOnly?: boolean;
|
|
63
|
+
targetTypeOnlyExports?: boolean;
|
|
64
|
+
sourcePureTypeModule?: boolean;
|
|
65
|
+
namedBindingsTypeOnly?: boolean;
|
|
66
|
+
portProofEligible?: boolean;
|
|
67
|
+
peerIsolation?: boolean;
|
|
68
|
+
capability?: string;
|
|
69
|
+
edgeKind?: string;
|
|
70
|
+
/** AR03 — ArkRule id (structure or invariant). */
|
|
71
|
+
arkruleId?: string;
|
|
72
|
+
/** AR03 — ArkRules source file path. */
|
|
73
|
+
arkruleSource?: string;
|
|
74
|
+
};
|
|
75
|
+
/** Added in schema 1.1; optional in TypeScript so 1.0 consumer-owned values remain valid. */
|
|
76
|
+
nextAction?: string;
|
|
77
|
+
/**
|
|
78
|
+
* ACS06 / schema 1.5 — compact stable id for multi-turn re-address
|
|
79
|
+
* (`fnv1a-` + hex). Always derived from `targetKey`. Optional so 1.0–1.4
|
|
80
|
+
* consumer-owned diagnostics remain assignable.
|
|
81
|
+
*/
|
|
82
|
+
findingRef?: string;
|
|
83
|
+
/**
|
|
84
|
+
* ACS06 / schema 1.5 — baseline-compatible freeze identity
|
|
85
|
+
* (`ruleId|file|fromLayer|toLayer|target`, with occurrence `#N` suffixes in lists).
|
|
86
|
+
* Must match `baselineKey` / `baselineOccurrenceKeys` so refs never orphan baselines.
|
|
87
|
+
*/
|
|
88
|
+
targetKey?: string;
|
|
89
|
+
/**
|
|
90
|
+
* ACS06 / schema 1.5 — package-relative docs path with rule anchor
|
|
91
|
+
* (`docs/diagnostics.md#RULE_ID`). Optional for legacy consumer-owned values.
|
|
92
|
+
*/
|
|
93
|
+
docsCodePath?: string;
|
|
94
|
+
};
|
|
95
|
+
type LegacyAdapterResult = {
|
|
96
|
+
schemaVersion: '1.0' | '1.1';
|
|
97
|
+
valid: boolean;
|
|
98
|
+
diagnostics: AdapterDiagnostic[];
|
|
99
|
+
completeness?: never;
|
|
100
|
+
mode?: never;
|
|
101
|
+
};
|
|
102
|
+
type Version12AdapterResultBase = {
|
|
103
|
+
schemaVersion: '1.2';
|
|
104
|
+
diagnostics: AdapterDiagnostic[];
|
|
105
|
+
mode?: never;
|
|
106
|
+
};
|
|
107
|
+
type Version12AdapterResult = (Version12AdapterResultBase & {
|
|
108
|
+
completeness: 'complete';
|
|
109
|
+
valid: boolean;
|
|
110
|
+
}) | (Version12AdapterResultBase & {
|
|
111
|
+
completeness: 'partial' | 'unavailable';
|
|
112
|
+
valid: false;
|
|
113
|
+
});
|
|
114
|
+
type CurrentAdapterResultBase = {
|
|
115
|
+
schemaVersion: typeof ARK_ANALYSIS_RESULT_SCHEMA_VERSION;
|
|
116
|
+
completenessReasons: AdapterCompletenessReason[];
|
|
117
|
+
diagnostics: AdapterDiagnostic[];
|
|
118
|
+
};
|
|
119
|
+
type ResolvedAdapterEvidence = {
|
|
120
|
+
policyHash: string;
|
|
121
|
+
resolverIdentity: string;
|
|
122
|
+
factsHash: string;
|
|
123
|
+
candidateTreeHash: string;
|
|
124
|
+
};
|
|
125
|
+
type CurrentAdapterResult = (CurrentAdapterResultBase & Partial<ResolvedAdapterEvidence> & {
|
|
126
|
+
mode: 'lexical-compatibility';
|
|
127
|
+
valid: boolean;
|
|
128
|
+
completeness: 'complete';
|
|
129
|
+
}) | (CurrentAdapterResultBase & Partial<ResolvedAdapterEvidence> & {
|
|
130
|
+
mode: 'lexical-compatibility';
|
|
131
|
+
valid: false;
|
|
132
|
+
completeness: 'partial' | 'unavailable';
|
|
133
|
+
}) | (CurrentAdapterResultBase & ResolvedAdapterEvidence & {
|
|
134
|
+
mode: 'resolved-candidate-facts';
|
|
135
|
+
valid: boolean;
|
|
136
|
+
completeness: 'complete';
|
|
137
|
+
}) | (CurrentAdapterResultBase & ResolvedAdapterEvidence & {
|
|
138
|
+
mode: 'resolved-candidate-facts';
|
|
139
|
+
valid: false;
|
|
140
|
+
completeness: 'partial';
|
|
141
|
+
}) | (CurrentAdapterResultBase & Partial<ResolvedAdapterEvidence> & {
|
|
142
|
+
mode: 'resolved-candidate-facts';
|
|
143
|
+
valid: false;
|
|
144
|
+
completeness: 'unavailable';
|
|
145
|
+
});
|
|
146
|
+
type AdapterResult = LegacyAdapterResult | Version12AdapterResult | CurrentAdapterResult;
|
|
147
|
+
/**
|
|
148
|
+
* Baseline-compatible target key for a violation input.
|
|
149
|
+
* Field order and empty-string fallbacks **must** match `baselineKey` in
|
|
150
|
+
* `baselineKey.ts` — parity tests guard this so finding refs never orphan freezes.
|
|
151
|
+
*
|
|
152
|
+
* Note: uses raw ruleId/file strings (including empty) the same way baseline does;
|
|
153
|
+
* display `ruleId` / `location.file` may still normalize to ARK_UNKNOWN / `<unknown>`.
|
|
154
|
+
*/
|
|
155
|
+
declare function adapterFindingTargetKey(violation: AdapterViolationInput): string;
|
|
156
|
+
/**
|
|
157
|
+
* Occurrence-aware target keys for a violation list (parity with baselineOccurrenceKeys).
|
|
158
|
+
* First occurrence keeps the historical base key; duplicates get `#N`.
|
|
159
|
+
*/
|
|
160
|
+
declare function adapterFindingOccurrenceTargetKeys(violations: readonly AdapterViolationInput[]): string[];
|
|
161
|
+
/** FNV-1a finding ref from a baseline-compatible targetKey (not a security hash). */
|
|
162
|
+
declare function adapterFindingRefFromTargetKey(targetKey: string): string;
|
|
163
|
+
/** Package-relative docs path with fragment for a public ruleId. */
|
|
164
|
+
declare function adapterDocsCodePath(ruleId: string): string;
|
|
165
|
+
declare function toAdapterDiagnostic(violation: AdapterViolationInput, fallbackSeverity?: AdapterSeverity,
|
|
166
|
+
/**
|
|
167
|
+
* Optional precomputed baseline-compatible targetKey (e.g. occurrence-aware from
|
|
168
|
+
* `adapterFindingOccurrenceTargetKeys`). When omitted, uses the first-occurrence key.
|
|
169
|
+
*/
|
|
170
|
+
targetKeyOverride?: string): AdapterDiagnostic;
|
|
171
|
+
declare function createAdapterResult(input: {
|
|
172
|
+
valid: boolean;
|
|
173
|
+
completeness?: AnalysisCompleteness;
|
|
174
|
+
mode?: AnalysisMode;
|
|
175
|
+
policyHash?: unknown;
|
|
176
|
+
resolverIdentity?: unknown;
|
|
177
|
+
factsHash?: unknown;
|
|
178
|
+
candidateTreeHash?: unknown;
|
|
179
|
+
completenessReasons?: readonly AdapterCompletenessReason[];
|
|
180
|
+
violations?: readonly AdapterViolationInput[];
|
|
181
|
+
warnings?: readonly AdapterViolationInput[];
|
|
182
|
+
}): CurrentAdapterResult;
|
|
183
|
+
declare const ARK_ANALYSIS_RESULT_SCHEMA: {
|
|
184
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
185
|
+
readonly $id: "https://unpkg.com/arkgate@3/schemas/ark.analysis-result.schema.json";
|
|
186
|
+
readonly title: "ArkGate analysis result";
|
|
187
|
+
readonly type: "object";
|
|
188
|
+
readonly additionalProperties: false;
|
|
189
|
+
readonly required: readonly ["schemaVersion", "mode", "valid", "completeness", "completenessReasons", "diagnostics"];
|
|
190
|
+
readonly allOf: readonly [{
|
|
191
|
+
readonly if: {
|
|
192
|
+
readonly properties: {
|
|
193
|
+
readonly completeness: {
|
|
194
|
+
readonly enum: readonly ["partial", "unavailable"];
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
readonly required: readonly ["completeness"];
|
|
198
|
+
};
|
|
199
|
+
readonly then: {
|
|
200
|
+
readonly properties: {
|
|
201
|
+
readonly valid: {
|
|
202
|
+
readonly const: false;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
}, {
|
|
207
|
+
readonly if: {
|
|
208
|
+
readonly properties: {
|
|
209
|
+
readonly mode: {
|
|
210
|
+
readonly const: "resolved-candidate-facts";
|
|
211
|
+
};
|
|
212
|
+
readonly completeness: {
|
|
213
|
+
readonly enum: readonly ["complete", "partial"];
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
readonly required: readonly ["mode", "completeness"];
|
|
217
|
+
};
|
|
218
|
+
readonly then: {
|
|
219
|
+
readonly required: readonly ["policyHash", "resolverIdentity", "factsHash", "candidateTreeHash"];
|
|
220
|
+
};
|
|
221
|
+
}, {
|
|
222
|
+
readonly if: {
|
|
223
|
+
readonly properties: {
|
|
224
|
+
readonly completeness: {
|
|
225
|
+
readonly const: "complete";
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
readonly required: readonly ["completeness"];
|
|
229
|
+
};
|
|
230
|
+
readonly then: {
|
|
231
|
+
readonly properties: {
|
|
232
|
+
readonly completenessReasons: {
|
|
233
|
+
readonly maxItems: 0;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
readonly else: {
|
|
238
|
+
readonly properties: {
|
|
239
|
+
readonly completenessReasons: {
|
|
240
|
+
readonly minItems: 1;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
}];
|
|
245
|
+
readonly properties: {
|
|
246
|
+
readonly schemaVersion: {
|
|
247
|
+
readonly const: "1.5";
|
|
248
|
+
};
|
|
249
|
+
readonly mode: {
|
|
250
|
+
readonly enum: readonly ["lexical-compatibility", "resolved-candidate-facts"];
|
|
251
|
+
};
|
|
252
|
+
readonly valid: {
|
|
253
|
+
readonly type: "boolean";
|
|
254
|
+
};
|
|
255
|
+
readonly completeness: {
|
|
256
|
+
readonly enum: readonly ["complete", "partial", "unavailable"];
|
|
257
|
+
};
|
|
258
|
+
readonly completenessReasons: {
|
|
259
|
+
readonly type: "array";
|
|
260
|
+
readonly items: {
|
|
261
|
+
readonly type: "object";
|
|
262
|
+
readonly additionalProperties: false;
|
|
263
|
+
readonly required: readonly ["code", "message"];
|
|
264
|
+
readonly properties: {
|
|
265
|
+
readonly code: {
|
|
266
|
+
readonly type: "string";
|
|
267
|
+
readonly minLength: 1;
|
|
268
|
+
};
|
|
269
|
+
readonly message: {
|
|
270
|
+
readonly type: "string";
|
|
271
|
+
readonly minLength: 1;
|
|
272
|
+
};
|
|
273
|
+
readonly file: {
|
|
274
|
+
readonly type: "string";
|
|
275
|
+
readonly minLength: 1;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
readonly policyHash: {
|
|
281
|
+
readonly type: "string";
|
|
282
|
+
readonly minLength: 1;
|
|
283
|
+
};
|
|
284
|
+
readonly resolverIdentity: {
|
|
285
|
+
readonly type: "string";
|
|
286
|
+
readonly minLength: 1;
|
|
287
|
+
};
|
|
288
|
+
readonly factsHash: {
|
|
289
|
+
readonly type: "string";
|
|
290
|
+
readonly minLength: 1;
|
|
291
|
+
};
|
|
292
|
+
readonly candidateTreeHash: {
|
|
293
|
+
readonly type: "string";
|
|
294
|
+
readonly minLength: 1;
|
|
295
|
+
};
|
|
296
|
+
readonly diagnostics: {
|
|
297
|
+
readonly type: "array";
|
|
298
|
+
readonly items: {
|
|
299
|
+
readonly type: "object";
|
|
300
|
+
readonly additionalProperties: false;
|
|
301
|
+
readonly required: readonly ["ruleId", "severity", "message", "location", "evidence"];
|
|
302
|
+
readonly properties: {
|
|
303
|
+
readonly ruleId: {
|
|
304
|
+
readonly type: "string";
|
|
305
|
+
readonly minLength: 1;
|
|
306
|
+
};
|
|
307
|
+
readonly severity: {
|
|
308
|
+
readonly enum: readonly ["error", "warning"];
|
|
309
|
+
};
|
|
310
|
+
readonly message: {
|
|
311
|
+
readonly type: "string";
|
|
312
|
+
readonly minLength: 1;
|
|
313
|
+
};
|
|
314
|
+
readonly location: {
|
|
315
|
+
readonly type: "object";
|
|
316
|
+
readonly additionalProperties: false;
|
|
317
|
+
readonly required: readonly ["file", "line", "column"];
|
|
318
|
+
readonly properties: {
|
|
319
|
+
readonly file: {
|
|
320
|
+
readonly type: "string";
|
|
321
|
+
readonly minLength: 1;
|
|
322
|
+
};
|
|
323
|
+
readonly line: {
|
|
324
|
+
readonly type: "integer";
|
|
325
|
+
readonly minimum: 1;
|
|
326
|
+
};
|
|
327
|
+
readonly column: {
|
|
328
|
+
readonly type: "integer";
|
|
329
|
+
readonly minimum: 1;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
readonly evidence: {
|
|
334
|
+
readonly type: "object";
|
|
335
|
+
readonly additionalProperties: false;
|
|
336
|
+
readonly properties: {
|
|
337
|
+
readonly target: {
|
|
338
|
+
readonly type: "string";
|
|
339
|
+
};
|
|
340
|
+
readonly fromLayer: {
|
|
341
|
+
readonly type: "string";
|
|
342
|
+
};
|
|
343
|
+
readonly toLayer: {
|
|
344
|
+
readonly type: "string";
|
|
345
|
+
};
|
|
346
|
+
readonly typeOnly: {
|
|
347
|
+
readonly type: "boolean";
|
|
348
|
+
};
|
|
349
|
+
readonly targetTypeOnlyExports: {
|
|
350
|
+
readonly type: "boolean";
|
|
351
|
+
};
|
|
352
|
+
readonly sourcePureTypeModule: {
|
|
353
|
+
readonly type: "boolean";
|
|
354
|
+
};
|
|
355
|
+
readonly namedBindingsTypeOnly: {
|
|
356
|
+
readonly type: "boolean";
|
|
357
|
+
};
|
|
358
|
+
readonly portProofEligible: {
|
|
359
|
+
readonly type: "boolean";
|
|
360
|
+
};
|
|
361
|
+
readonly peerIsolation: {
|
|
362
|
+
readonly type: "boolean";
|
|
363
|
+
};
|
|
364
|
+
readonly capability: {
|
|
365
|
+
readonly type: "string";
|
|
366
|
+
readonly minLength: 1;
|
|
367
|
+
};
|
|
368
|
+
readonly edgeKind: {
|
|
369
|
+
readonly type: "string";
|
|
370
|
+
readonly minLength: 1;
|
|
371
|
+
};
|
|
372
|
+
readonly arkruleId: {
|
|
373
|
+
readonly type: "string";
|
|
374
|
+
readonly minLength: 1;
|
|
375
|
+
};
|
|
376
|
+
readonly arkruleSource: {
|
|
377
|
+
readonly type: "string";
|
|
378
|
+
readonly minLength: 1;
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
readonly nextAction: {
|
|
383
|
+
readonly type: "string";
|
|
384
|
+
readonly minLength: 1;
|
|
385
|
+
};
|
|
386
|
+
/** ACS06 — compact multi-turn id; always derived from targetKey when emitted. */
|
|
387
|
+
readonly findingRef: {
|
|
388
|
+
readonly type: "string";
|
|
389
|
+
readonly minLength: 1;
|
|
390
|
+
readonly pattern: "^fnv1a-[0-9a-f]{8}$";
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* ACS06 — baseline-compatible freeze identity
|
|
394
|
+
* (`ruleId|file|from|to|target` with optional `#N` occurrence suffix).
|
|
395
|
+
*/
|
|
396
|
+
readonly targetKey: {
|
|
397
|
+
readonly type: "string";
|
|
398
|
+
readonly minLength: 1;
|
|
399
|
+
};
|
|
400
|
+
/** ACS06 — package-relative diagnostics anchor path. */
|
|
401
|
+
readonly docsCodePath: {
|
|
402
|
+
readonly type: "string";
|
|
403
|
+
readonly minLength: 1;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
/** ArkGate library version — single source of truth. */
|
|
412
|
+
declare const version = "4.8.0";
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* AI Code Gate (basic).
|
|
416
|
+
*
|
|
417
|
+
* Allows validation of generated source code against the defined architecture.
|
|
418
|
+
*/
|
|
419
|
+
interface AICodeGateViolation {
|
|
420
|
+
/** Stable rule identifier for agents and CI pipelines. */
|
|
421
|
+
ruleId: string;
|
|
422
|
+
/** @deprecated Use ruleId — kept for backward compatibility. */
|
|
423
|
+
code: string;
|
|
424
|
+
message: string;
|
|
425
|
+
line?: number;
|
|
426
|
+
suggestion?: string;
|
|
427
|
+
source?: string;
|
|
428
|
+
filePath?: string;
|
|
429
|
+
target?: string;
|
|
430
|
+
fromLayer?: string;
|
|
431
|
+
toLayer?: string;
|
|
432
|
+
details?: unknown;
|
|
433
|
+
}
|
|
434
|
+
/** Extension point for external analyzers (AST, semantic, etc.). */
|
|
435
|
+
interface AIGateExtension<Context = unknown> {
|
|
436
|
+
readonly name: string;
|
|
437
|
+
analyze(source: string, context?: Context): AICodeGateViolation[];
|
|
438
|
+
}
|
|
439
|
+
interface AICodeGateContext {
|
|
440
|
+
filePath?: string;
|
|
441
|
+
agentId?: string;
|
|
442
|
+
layer?: string;
|
|
443
|
+
[key: string]: unknown;
|
|
444
|
+
}
|
|
445
|
+
interface AICodeGateResult {
|
|
446
|
+
/** Single-source snippets do not carry project-wide resolver evidence. */
|
|
447
|
+
mode: 'lexical-compatibility';
|
|
448
|
+
/** A snippet result is intentionally never an authoritative complete verdict. */
|
|
449
|
+
completeness: 'partial';
|
|
450
|
+
completenessReasons: string[];
|
|
451
|
+
/** Authoritative verdict. Always false until the complete candidate is resolved. */
|
|
452
|
+
valid: boolean;
|
|
453
|
+
/** Compatibility signal for the bounded lexical checks performed here. */
|
|
454
|
+
lexicalValid: boolean;
|
|
455
|
+
violations: AICodeGateViolation[];
|
|
456
|
+
}
|
|
457
|
+
interface AICodeGate<Context = AICodeGateContext> {
|
|
458
|
+
validate(source: string, context?: Context): AICodeGateResult;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare function createArchitectureProfile(options: CreateArchitectureProfileOptions): ArchitectureProfile;
|
|
462
|
+
declare function createArchitectureProfileFromArkConfig(config: ArkCheckConfig, options?: CreateArchitectureProfileFromArkConfigOptions): ArchitectureProfile;
|
|
463
|
+
declare const elevenLayerProfile: ArchitectureProfile;
|
|
464
|
+
declare function createElevenLayerArkConfig(options?: CreateElevenLayerArkConfigOptions): ArkCheckConfig;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Basic AI Code Gate implementation.
|
|
468
|
+
*
|
|
469
|
+
* Uses simple string heuristics + registered intent names to detect obvious
|
|
470
|
+
* architectural violations in generated code (e.g. direct infra imports from domain).
|
|
471
|
+
* Not a full static analyzer — documented limitation.
|
|
472
|
+
*/
|
|
473
|
+
|
|
474
|
+
interface AICodeGatePolicyContext<Context = AICodeGateContext> {
|
|
475
|
+
source: string;
|
|
476
|
+
context?: Context;
|
|
477
|
+
}
|
|
478
|
+
interface AICodeGateOptions<Context = AICodeGateContext> {
|
|
479
|
+
policies?: Policy<AICodeGatePolicyContext<Context>>[];
|
|
480
|
+
intents?: Array<string | Pick<IntentCreator<IntentName, unknown>, 'name'>>;
|
|
481
|
+
/**
|
|
482
|
+
* Additional forbidden patterns (regex or strings).
|
|
483
|
+
*/
|
|
484
|
+
forbiddenPatterns?: Array<string | RegExp>;
|
|
485
|
+
/**
|
|
486
|
+
* External analyzer extensions (type-only contract; plug in AST tools later).
|
|
487
|
+
*/
|
|
488
|
+
extensions?: AIGateExtension<Context>[];
|
|
489
|
+
/**
|
|
490
|
+
* Optional architecture profile for layer-aware generated-code checks.
|
|
491
|
+
* When context.layer is provided, intent references are checked against it.
|
|
492
|
+
*/
|
|
493
|
+
architectureProfile?: ArchitectureProfile;
|
|
494
|
+
/**
|
|
495
|
+
* When true, flag string literals that look like intent names but are not registered.
|
|
496
|
+
*/
|
|
497
|
+
enforceIntentAllowlist?: boolean;
|
|
498
|
+
/**
|
|
499
|
+
* Optional TypeScript module object. When provided, AICodeGate adds AST-backed checks
|
|
500
|
+
* for publish misuse without taking a runtime dependency on TypeScript.
|
|
501
|
+
*/
|
|
502
|
+
typescript?: unknown;
|
|
503
|
+
/**
|
|
504
|
+
* Ambient globals forbidden per layer (layer name → entries such as "fetch" or
|
|
505
|
+
* "Date.now"). Checked only when `typescript` is provided and context.layer resolves
|
|
506
|
+
* to a listed layer — mirrors ark-check's FORBIDDEN_GLOBAL rule.
|
|
507
|
+
*/
|
|
508
|
+
forbiddenGlobals?: Record<string, string[]>;
|
|
509
|
+
/**
|
|
510
|
+
* Layer → effective capability deny set (U04 walls; ADR 0009). Enforced like
|
|
511
|
+
* forbiddenGlobals when the target file's layer is known. An ambient use
|
|
512
|
+
* already covered by the layer's forbiddenGlobals reports only
|
|
513
|
+
* FORBIDDEN_GLOBAL (D7 — one violation, one voice).
|
|
514
|
+
*/
|
|
515
|
+
capabilityWalls?: Record<string, string[]>;
|
|
516
|
+
/**
|
|
517
|
+
* Layer names whose role is infrastructure and may therefore import infrastructure
|
|
518
|
+
* (a persistence adapter importing the DB is correct, not a violation). The built-in
|
|
519
|
+
* infra-import heuristics are suppressed for these layers and for any layer whose
|
|
520
|
+
* name matches the conventional infra tokens. Populate from ark.config.json layers
|
|
521
|
+
* flagged `mayImportInfrastructure: true`, so unconventionally-named infra layers
|
|
522
|
+
* opt in explicitly. User-supplied `forbiddenPatterns` still apply everywhere.
|
|
523
|
+
*/
|
|
524
|
+
infrastructureLayers?: string[];
|
|
525
|
+
/**
|
|
526
|
+
* Preferred single resolve step: import specifier or absolute source file →
|
|
527
|
+
* `{ layer, relPath }` for contract + peerIsolation. Prefer this over the
|
|
528
|
+
* legacy layer-only callback.
|
|
529
|
+
*/
|
|
530
|
+
resolveImportTarget?: (specifierOrFilePath: string, fromFilePath?: string) => {
|
|
531
|
+
layer?: string;
|
|
532
|
+
relPath?: string;
|
|
533
|
+
} | undefined;
|
|
534
|
+
/**
|
|
535
|
+
* @deprecated Prefer resolveImportTarget. Layer-only resolve for governed imports.
|
|
536
|
+
*/
|
|
537
|
+
resolveImportLayer?: (specifier: string, fromFilePath?: string) => string | undefined;
|
|
538
|
+
/**
|
|
539
|
+
* Layer configs (patterns) used to infer sliceFolders when a peerIsolation rule
|
|
540
|
+
* omits an explicit list.
|
|
541
|
+
*/
|
|
542
|
+
architectureLayers?: Array<{
|
|
543
|
+
name: string;
|
|
544
|
+
patterns?: string[];
|
|
545
|
+
}>;
|
|
546
|
+
/** Explicit file-level escape hatch for reviewed non-literal import()/require() calls. */
|
|
547
|
+
allowNonLiteralDynamicImport?: (filePath?: string) => boolean;
|
|
548
|
+
}
|
|
549
|
+
declare function createAICodeGate<Context = AICodeGateContext>(options?: AICodeGateOptions<Context>): AICodeGate<Context>;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Portable identity/fingerprint primitives for pure Domain contracts.
|
|
553
|
+
*
|
|
554
|
+
* FNV-1a is intentional: no Node crypto dependency for CLI/MCP/browserless consumers.
|
|
555
|
+
*/
|
|
556
|
+
/** Stable FNV-1a hash. Identity/fingerprint only — not a security primitive. */
|
|
557
|
+
declare function deterministicHash(value: string): string;
|
|
558
|
+
/** Serialize JSON-like values with sorted object keys for reproducible hashes. */
|
|
559
|
+
declare function stableSerialize(value: unknown): string;
|
|
560
|
+
|
|
561
|
+
type ResolvedArkOrderPlaneCallFact = {
|
|
562
|
+
file: string;
|
|
563
|
+
line: number;
|
|
564
|
+
callee: string;
|
|
565
|
+
};
|
|
566
|
+
type ResolvedArkOrderGenericUpdateFact = {
|
|
567
|
+
file: string;
|
|
568
|
+
line: number;
|
|
569
|
+
method: string;
|
|
570
|
+
};
|
|
571
|
+
type ResolvedArkOrderRootHitFact = {
|
|
572
|
+
file: string;
|
|
573
|
+
matchedRoot: string;
|
|
574
|
+
hasPlaneFactory: boolean;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Versioned type vocabulary for resolved candidate facts (schema 1.0).
|
|
579
|
+
*
|
|
580
|
+
* Pure declarations + schema version identity. Create/load live in
|
|
581
|
+
* resolvedCandidateFacts.ts; JSON Schema lives in resolvedCandidateFactsSchema.ts.
|
|
582
|
+
*/
|
|
583
|
+
|
|
584
|
+
/** 1.1 adds optional classShapes[] (ADR 0013). 1.2 adds optional ArkRun facts (ADR 0022). 1.0/1.1 remain loadable. */
|
|
585
|
+
declare const RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION: "1.2";
|
|
586
|
+
type ResolvedFactsCompleteness = 'complete' | 'partial' | 'unavailable';
|
|
587
|
+
type ResolvedDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
|
|
588
|
+
type ResolvedDependencyState = 'resolved-project' | 'resolved-external' | 'unresolved' | 'dynamic';
|
|
589
|
+
type ResolvedCapability = 'network' | 'filesystem' | 'clock' | 'randomness' | 'environment' | 'process' | 'persistence';
|
|
590
|
+
type ResolvedFactsReason = {
|
|
591
|
+
code: string;
|
|
592
|
+
message: string;
|
|
593
|
+
file?: string;
|
|
594
|
+
};
|
|
595
|
+
type ResolvedFileFact = {
|
|
596
|
+
path: string;
|
|
597
|
+
contentHash: string;
|
|
598
|
+
parseStatus: 'parsed' | 'invalid';
|
|
599
|
+
parseDiagnosticCount: number;
|
|
600
|
+
exportsOnlyTypes: boolean;
|
|
601
|
+
typeOnlyExportNames: string[];
|
|
602
|
+
hasTopLevelSideEffects: boolean;
|
|
603
|
+
};
|
|
604
|
+
/** ADR 0022 kernel API call-site evidence. Sensors consume this in RN04. */
|
|
605
|
+
type ResolvedArkRunKernelCallKind = 'factory' | 'publisher' | 'publish' | 'raise' | 'send' | 'subscribe' | 'register-handler' | 'resolve' | 'resolve-singleton';
|
|
606
|
+
type ResolvedArkRunKernelCallFact = {
|
|
607
|
+
file: string;
|
|
608
|
+
line: number;
|
|
609
|
+
kind: ResolvedArkRunKernelCallKind;
|
|
610
|
+
callee: string;
|
|
611
|
+
viaImport: boolean;
|
|
612
|
+
receiver?: string;
|
|
613
|
+
nameLiteral?: string;
|
|
614
|
+
};
|
|
615
|
+
/** `new` of a class admitted for kernel creation (classShapes name or kernel import). */
|
|
616
|
+
type ResolvedArkRunManagedNewFact = {
|
|
617
|
+
file: string;
|
|
618
|
+
line: number;
|
|
619
|
+
typeName: string;
|
|
620
|
+
importedFrom?: string;
|
|
621
|
+
};
|
|
622
|
+
/** Governed file that matched an `arkRun.compositionRoots` glob. */
|
|
623
|
+
type ResolvedArkRunCompositionRootHitFact = {
|
|
624
|
+
file: string;
|
|
625
|
+
matchedRoot: string;
|
|
626
|
+
hasKernelFactory: boolean;
|
|
627
|
+
};
|
|
628
|
+
/** File-scoped interaction declaration lists (ADR 0023). Sensors consume this in RN04. */
|
|
629
|
+
type ResolvedArkRunDeclarationFact = {
|
|
630
|
+
file: string;
|
|
631
|
+
line: number;
|
|
632
|
+
uses: string[];
|
|
633
|
+
reactsTo: string[];
|
|
634
|
+
raises: string[];
|
|
635
|
+
sends: string[];
|
|
636
|
+
};
|
|
637
|
+
/** ADR 0013 class-shape evidence for ArkRules structure sensors. */
|
|
638
|
+
type ResolvedClassShapeFact = {
|
|
639
|
+
file: string;
|
|
640
|
+
className: string;
|
|
641
|
+
exported: boolean;
|
|
642
|
+
hasPublicMutableFields: boolean;
|
|
643
|
+
hasPublicSetters: boolean;
|
|
644
|
+
hasPublicConstructor: boolean;
|
|
645
|
+
hasStaticFactory: boolean;
|
|
646
|
+
mutatingMethods: readonly {
|
|
647
|
+
name: string;
|
|
648
|
+
referencesGuardOrPublish: boolean;
|
|
649
|
+
}[];
|
|
650
|
+
dataOnly?: boolean;
|
|
651
|
+
};
|
|
652
|
+
type ResolvedDependencyFact = {
|
|
653
|
+
from: string;
|
|
654
|
+
specifier?: string;
|
|
655
|
+
kind: ResolvedDependencyKind;
|
|
656
|
+
typeOnly: boolean;
|
|
657
|
+
line: number;
|
|
658
|
+
resolution: ResolvedDependencyState;
|
|
659
|
+
target?: string;
|
|
660
|
+
namedBindings?: string[];
|
|
661
|
+
targetTypeOnlyExports?: boolean;
|
|
662
|
+
sourcePureTypeModule?: boolean;
|
|
663
|
+
namedBindingsTypeOnly?: boolean;
|
|
664
|
+
portProofEligible?: boolean;
|
|
665
|
+
};
|
|
666
|
+
type ResolvedCapabilityFact = {
|
|
667
|
+
file: string;
|
|
668
|
+
line: number;
|
|
669
|
+
symbol: string;
|
|
670
|
+
capability: ResolvedCapability;
|
|
671
|
+
source: 'ambient-global' | 'import-based';
|
|
672
|
+
};
|
|
673
|
+
type ResolvedAmbientFact = {
|
|
674
|
+
file: string;
|
|
675
|
+
line: number;
|
|
676
|
+
symbol: string;
|
|
677
|
+
};
|
|
678
|
+
type ResolvedPublishFact = {
|
|
679
|
+
file: string;
|
|
680
|
+
line: number;
|
|
681
|
+
rawIntentName?: string;
|
|
682
|
+
objectHasIntent: boolean;
|
|
683
|
+
arkPublishCandidate: boolean;
|
|
684
|
+
hasSource: boolean;
|
|
685
|
+
sourceIntent?: string;
|
|
686
|
+
};
|
|
687
|
+
type ResolvedIntentReferenceFact = {
|
|
688
|
+
file: string;
|
|
689
|
+
line: number;
|
|
690
|
+
intent: string;
|
|
691
|
+
};
|
|
692
|
+
type ResolvedSafetyKind = 'ts-suppression' | 'any-cast' | 'dynamic-import' | 'dynamic-require' | 'in-memory-store';
|
|
693
|
+
/** Neutral syntax evidence for policy-controlled safety diagnostics. */
|
|
694
|
+
type ResolvedSafetyFact = {
|
|
695
|
+
file: string;
|
|
696
|
+
line: number;
|
|
697
|
+
kind: ResolvedSafetyKind;
|
|
698
|
+
symbol?: string;
|
|
699
|
+
};
|
|
700
|
+
type ResolvedCandidateFactsInput = {
|
|
701
|
+
schemaVersion: '1.0' | '1.1' | typeof RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION;
|
|
702
|
+
completeness: ResolvedFactsCompleteness;
|
|
703
|
+
completenessReasons: readonly ResolvedFactsReason[];
|
|
704
|
+
resolverIdentity: string;
|
|
705
|
+
compilerIdentity: string;
|
|
706
|
+
compilerOptionsHash: string;
|
|
707
|
+
tsconfigHash: string;
|
|
708
|
+
evidenceRequirementsHash: string;
|
|
709
|
+
projectPackageName?: string;
|
|
710
|
+
files: readonly ResolvedFileFact[];
|
|
711
|
+
dependencies: readonly ResolvedDependencyFact[];
|
|
712
|
+
capabilityUses: readonly ResolvedCapabilityFact[];
|
|
713
|
+
ambientUses: readonly ResolvedAmbientFact[];
|
|
714
|
+
publishCalls: readonly ResolvedPublishFact[];
|
|
715
|
+
intentReferences: readonly ResolvedIntentReferenceFact[];
|
|
716
|
+
safetyUses: readonly ResolvedSafetyFact[];
|
|
717
|
+
/** ADR 0013 — optional on 1.0; default [] on load. */
|
|
718
|
+
classShapes?: readonly ResolvedClassShapeFact[];
|
|
719
|
+
/** ADR 0022 / RN03 — optional on 1.0/1.1; default [] on load. */
|
|
720
|
+
arkRunKernelCalls?: readonly ResolvedArkRunKernelCallFact[];
|
|
721
|
+
arkRunManagedNews?: readonly ResolvedArkRunManagedNewFact[];
|
|
722
|
+
arkRunCompositionRootHits?: readonly ResolvedArkRunCompositionRootHitFact[];
|
|
723
|
+
arkRunDeclarations?: readonly ResolvedArkRunDeclarationFact[];
|
|
724
|
+
arkOrderPlaneCalls?: readonly ResolvedArkOrderPlaneCallFact[];
|
|
725
|
+
arkOrderGenericUpdates?: readonly ResolvedArkOrderGenericUpdateFact[];
|
|
726
|
+
arkOrderRootHits?: readonly ResolvedArkOrderRootHitFact[];
|
|
727
|
+
};
|
|
728
|
+
type ResolvedCandidateFacts = Omit<ResolvedCandidateFactsInput, 'candidateTreeHash' | 'classShapes' | 'arkRunKernelCalls' | 'arkOrderPlaneCalls' | 'arkOrderGenericUpdates' | 'arkOrderRootHits' | 'arkRunManagedNews' | 'arkRunCompositionRootHits' | 'arkRunDeclarations'> & {
|
|
729
|
+
schemaVersion: typeof RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION;
|
|
730
|
+
completenessReasons: ResolvedFactsReason[];
|
|
731
|
+
candidateTreeHash: string;
|
|
732
|
+
files: ResolvedFileFact[];
|
|
733
|
+
dependencies: ResolvedDependencyFact[];
|
|
734
|
+
capabilityUses: ResolvedCapabilityFact[];
|
|
735
|
+
ambientUses: ResolvedAmbientFact[];
|
|
736
|
+
publishCalls: ResolvedPublishFact[];
|
|
737
|
+
intentReferences: ResolvedIntentReferenceFact[];
|
|
738
|
+
safetyUses: ResolvedSafetyFact[];
|
|
739
|
+
classShapes: ResolvedClassShapeFact[];
|
|
740
|
+
arkRunKernelCalls: ResolvedArkRunKernelCallFact[];
|
|
741
|
+
arkRunManagedNews: ResolvedArkRunManagedNewFact[];
|
|
742
|
+
arkRunCompositionRootHits: ResolvedArkRunCompositionRootHitFact[];
|
|
743
|
+
arkRunDeclarations: ResolvedArkRunDeclarationFact[];
|
|
744
|
+
arkOrderPlaneCalls: ResolvedArkOrderPlaneCallFact[];
|
|
745
|
+
arkOrderGenericUpdates: ResolvedArkOrderGenericUpdateFact[];
|
|
746
|
+
arkOrderRootHits: ResolvedArkOrderRootHitFact[];
|
|
747
|
+
factsHash: string;
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Canonical create/load for versioned resolved candidate facts.
|
|
752
|
+
*
|
|
753
|
+
* Types: resolvedCandidateFactsTypes.ts · Schema: resolvedCandidateFactsSchema.ts ·
|
|
754
|
+
* Hash: stableHash.ts. Plan-B god-module pilot cluster (pattern-b:god-module).
|
|
755
|
+
*/
|
|
756
|
+
|
|
757
|
+
/** Identity of the policy-controlled evidence a resolver must attempt to collect. */
|
|
758
|
+
declare function resolvedFactsEvidenceRequirementsHash(config: ArkConfig): string;
|
|
759
|
+
declare function createResolvedCandidateFacts(input: ResolvedCandidateFactsInput): ResolvedCandidateFacts;
|
|
760
|
+
declare function loadResolvedCandidateFacts(input: unknown): ResolvedCandidateFacts;
|
|
761
|
+
|
|
762
|
+
declare const RESOLVED_CANDIDATE_FACTS_SCHEMA: {
|
|
763
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
764
|
+
readonly $id: "https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json";
|
|
765
|
+
readonly title: "ArkGate resolved candidate facts";
|
|
766
|
+
readonly type: "object";
|
|
767
|
+
readonly additionalProperties: false;
|
|
768
|
+
readonly required: readonly ["schemaVersion", "completeness", "completenessReasons", "resolverIdentity", "compilerIdentity", "compilerOptionsHash", "tsconfigHash", "candidateTreeHash", "evidenceRequirementsHash", "files", "dependencies", "capabilityUses", "ambientUses", "publishCalls", "intentReferences", "safetyUses", "factsHash"];
|
|
769
|
+
readonly properties: {
|
|
770
|
+
readonly schemaVersion: {
|
|
771
|
+
readonly enum: readonly ["1.0", "1.1", "1.2"];
|
|
772
|
+
};
|
|
773
|
+
readonly completeness: {
|
|
774
|
+
readonly enum: readonly ["complete", "partial", "unavailable"];
|
|
775
|
+
};
|
|
776
|
+
readonly completenessReasons: {
|
|
777
|
+
readonly type: "array";
|
|
778
|
+
readonly items: {
|
|
779
|
+
readonly type: "object";
|
|
780
|
+
readonly additionalProperties: false;
|
|
781
|
+
readonly required: readonly ["code", "message"];
|
|
782
|
+
readonly properties: {
|
|
783
|
+
readonly code: {
|
|
784
|
+
readonly type: "string";
|
|
785
|
+
readonly minLength: 1;
|
|
786
|
+
};
|
|
787
|
+
readonly message: {
|
|
788
|
+
readonly type: "string";
|
|
789
|
+
readonly minLength: 1;
|
|
790
|
+
};
|
|
791
|
+
readonly file: {
|
|
792
|
+
readonly type: "string";
|
|
793
|
+
readonly minLength: 1;
|
|
794
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
readonly resolverIdentity: {
|
|
800
|
+
readonly type: "string";
|
|
801
|
+
readonly minLength: 1;
|
|
802
|
+
};
|
|
803
|
+
readonly compilerIdentity: {
|
|
804
|
+
readonly type: "string";
|
|
805
|
+
readonly minLength: 1;
|
|
806
|
+
};
|
|
807
|
+
readonly compilerOptionsHash: {
|
|
808
|
+
readonly type: "string";
|
|
809
|
+
readonly minLength: 1;
|
|
810
|
+
};
|
|
811
|
+
readonly tsconfigHash: {
|
|
812
|
+
readonly type: "string";
|
|
813
|
+
readonly minLength: 1;
|
|
814
|
+
};
|
|
815
|
+
readonly candidateTreeHash: {
|
|
816
|
+
readonly type: "string";
|
|
817
|
+
readonly minLength: 1;
|
|
818
|
+
};
|
|
819
|
+
readonly evidenceRequirementsHash: {
|
|
820
|
+
readonly type: "string";
|
|
821
|
+
readonly minLength: 1;
|
|
822
|
+
};
|
|
823
|
+
readonly projectPackageName: {
|
|
824
|
+
readonly type: "string";
|
|
825
|
+
readonly minLength: 1;
|
|
826
|
+
};
|
|
827
|
+
readonly files: {
|
|
828
|
+
readonly type: "array";
|
|
829
|
+
readonly uniqueItems: true;
|
|
830
|
+
readonly items: {
|
|
831
|
+
readonly type: "object";
|
|
832
|
+
readonly additionalProperties: false;
|
|
833
|
+
readonly required: readonly ["path", "contentHash", "parseStatus", "parseDiagnosticCount", "exportsOnlyTypes", "typeOnlyExportNames", "hasTopLevelSideEffects"];
|
|
834
|
+
readonly properties: {
|
|
835
|
+
readonly path: {
|
|
836
|
+
readonly type: "string";
|
|
837
|
+
readonly minLength: 1;
|
|
838
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
839
|
+
};
|
|
840
|
+
readonly contentHash: {
|
|
841
|
+
readonly type: "string";
|
|
842
|
+
readonly minLength: 1;
|
|
843
|
+
};
|
|
844
|
+
readonly parseStatus: {
|
|
845
|
+
readonly enum: readonly ["parsed", "invalid"];
|
|
846
|
+
};
|
|
847
|
+
readonly parseDiagnosticCount: {
|
|
848
|
+
readonly type: "integer";
|
|
849
|
+
readonly minimum: 0;
|
|
850
|
+
};
|
|
851
|
+
readonly exportsOnlyTypes: {
|
|
852
|
+
readonly type: "boolean";
|
|
853
|
+
};
|
|
854
|
+
readonly typeOnlyExportNames: {
|
|
855
|
+
readonly type: "array";
|
|
856
|
+
readonly items: {
|
|
857
|
+
readonly type: "string";
|
|
858
|
+
readonly minLength: 1;
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
readonly hasTopLevelSideEffects: {
|
|
862
|
+
readonly type: "boolean";
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
readonly allOf: readonly [{
|
|
866
|
+
readonly if: {
|
|
867
|
+
readonly properties: {
|
|
868
|
+
readonly parseStatus: {
|
|
869
|
+
readonly const: "parsed";
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
readonly then: {
|
|
874
|
+
readonly properties: {
|
|
875
|
+
readonly parseDiagnosticCount: {
|
|
876
|
+
readonly const: 0;
|
|
877
|
+
};
|
|
878
|
+
};
|
|
879
|
+
};
|
|
880
|
+
}, {
|
|
881
|
+
readonly if: {
|
|
882
|
+
readonly properties: {
|
|
883
|
+
readonly parseStatus: {
|
|
884
|
+
readonly const: "invalid";
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
};
|
|
888
|
+
readonly then: {
|
|
889
|
+
readonly properties: {
|
|
890
|
+
readonly parseDiagnosticCount: {
|
|
891
|
+
readonly minimum: 1;
|
|
892
|
+
};
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
}];
|
|
896
|
+
};
|
|
897
|
+
};
|
|
898
|
+
readonly dependencies: {
|
|
899
|
+
readonly type: "array";
|
|
900
|
+
readonly items: {
|
|
901
|
+
readonly type: "object";
|
|
902
|
+
readonly additionalProperties: false;
|
|
903
|
+
readonly required: readonly ["from", "kind", "typeOnly", "line", "resolution"];
|
|
904
|
+
readonly properties: {
|
|
905
|
+
readonly from: {
|
|
906
|
+
readonly type: "string";
|
|
907
|
+
readonly minLength: 1;
|
|
908
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
909
|
+
};
|
|
910
|
+
readonly specifier: {
|
|
911
|
+
readonly type: "string";
|
|
912
|
+
readonly minLength: 1;
|
|
913
|
+
};
|
|
914
|
+
readonly kind: {
|
|
915
|
+
readonly enum: readonly ["import", "export", "dynamic-import", "require"];
|
|
916
|
+
};
|
|
917
|
+
readonly typeOnly: {
|
|
918
|
+
readonly type: "boolean";
|
|
919
|
+
};
|
|
920
|
+
readonly line: {
|
|
921
|
+
readonly type: "integer";
|
|
922
|
+
readonly minimum: 1;
|
|
923
|
+
};
|
|
924
|
+
readonly resolution: {
|
|
925
|
+
readonly enum: readonly ["resolved-project", "resolved-external", "unresolved", "dynamic"];
|
|
926
|
+
};
|
|
927
|
+
readonly target: {
|
|
928
|
+
readonly type: "string";
|
|
929
|
+
readonly minLength: 1;
|
|
930
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
931
|
+
};
|
|
932
|
+
readonly namedBindings: {
|
|
933
|
+
readonly type: "array";
|
|
934
|
+
readonly items: {
|
|
935
|
+
readonly type: "string";
|
|
936
|
+
readonly minLength: 1;
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
readonly targetTypeOnlyExports: {
|
|
940
|
+
readonly type: "boolean";
|
|
941
|
+
};
|
|
942
|
+
readonly sourcePureTypeModule: {
|
|
943
|
+
readonly type: "boolean";
|
|
944
|
+
};
|
|
945
|
+
readonly namedBindingsTypeOnly: {
|
|
946
|
+
readonly type: "boolean";
|
|
947
|
+
};
|
|
948
|
+
readonly portProofEligible: {
|
|
949
|
+
readonly type: "boolean";
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
readonly allOf: readonly [{
|
|
953
|
+
readonly if: {
|
|
954
|
+
readonly properties: {
|
|
955
|
+
readonly resolution: {
|
|
956
|
+
readonly const: "resolved-project";
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
readonly then: {
|
|
961
|
+
readonly required: readonly ["target"];
|
|
962
|
+
};
|
|
963
|
+
readonly else: {
|
|
964
|
+
readonly not: {
|
|
965
|
+
readonly required: readonly ["target"];
|
|
966
|
+
};
|
|
967
|
+
};
|
|
968
|
+
}, {
|
|
969
|
+
readonly if: {
|
|
970
|
+
readonly properties: {
|
|
971
|
+
readonly resolution: {
|
|
972
|
+
readonly const: "dynamic";
|
|
973
|
+
};
|
|
974
|
+
};
|
|
975
|
+
};
|
|
976
|
+
readonly else: {
|
|
977
|
+
readonly required: readonly ["specifier"];
|
|
978
|
+
};
|
|
979
|
+
}];
|
|
980
|
+
};
|
|
981
|
+
};
|
|
982
|
+
readonly capabilityUses: {
|
|
983
|
+
readonly type: "array";
|
|
984
|
+
readonly items: {
|
|
985
|
+
readonly type: "object";
|
|
986
|
+
readonly additionalProperties: false;
|
|
987
|
+
readonly required: readonly ["file", "line", "symbol", "capability", "source"];
|
|
988
|
+
readonly properties: {
|
|
989
|
+
readonly file: {
|
|
990
|
+
readonly type: "string";
|
|
991
|
+
readonly minLength: 1;
|
|
992
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
993
|
+
};
|
|
994
|
+
readonly line: {
|
|
995
|
+
readonly type: "integer";
|
|
996
|
+
readonly minimum: 1;
|
|
997
|
+
};
|
|
998
|
+
readonly symbol: {
|
|
999
|
+
readonly type: "string";
|
|
1000
|
+
readonly minLength: 1;
|
|
1001
|
+
};
|
|
1002
|
+
readonly capability: {
|
|
1003
|
+
readonly enum: readonly ["network", "filesystem", "clock", "randomness", "environment", "process", "persistence"];
|
|
1004
|
+
};
|
|
1005
|
+
readonly source: {
|
|
1006
|
+
readonly enum: readonly ["ambient-global", "import-based"];
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
readonly ambientUses: {
|
|
1012
|
+
readonly type: "array";
|
|
1013
|
+
readonly items: {
|
|
1014
|
+
readonly type: "object";
|
|
1015
|
+
readonly additionalProperties: false;
|
|
1016
|
+
readonly required: readonly ["file", "line", "symbol"];
|
|
1017
|
+
readonly properties: {
|
|
1018
|
+
readonly file: {
|
|
1019
|
+
readonly type: "string";
|
|
1020
|
+
readonly minLength: 1;
|
|
1021
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1022
|
+
};
|
|
1023
|
+
readonly line: {
|
|
1024
|
+
readonly type: "integer";
|
|
1025
|
+
readonly minimum: 1;
|
|
1026
|
+
};
|
|
1027
|
+
readonly symbol: {
|
|
1028
|
+
readonly type: "string";
|
|
1029
|
+
readonly minLength: 1;
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
readonly publishCalls: {
|
|
1035
|
+
readonly type: "array";
|
|
1036
|
+
readonly items: {
|
|
1037
|
+
readonly type: "object";
|
|
1038
|
+
readonly additionalProperties: false;
|
|
1039
|
+
readonly required: readonly ["file", "line", "objectHasIntent", "arkPublishCandidate", "hasSource"];
|
|
1040
|
+
readonly properties: {
|
|
1041
|
+
readonly file: {
|
|
1042
|
+
readonly type: "string";
|
|
1043
|
+
readonly minLength: 1;
|
|
1044
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1045
|
+
};
|
|
1046
|
+
readonly line: {
|
|
1047
|
+
readonly type: "integer";
|
|
1048
|
+
readonly minimum: 1;
|
|
1049
|
+
};
|
|
1050
|
+
readonly rawIntentName: {
|
|
1051
|
+
readonly type: "string";
|
|
1052
|
+
readonly minLength: 1;
|
|
1053
|
+
};
|
|
1054
|
+
readonly objectHasIntent: {
|
|
1055
|
+
readonly type: "boolean";
|
|
1056
|
+
};
|
|
1057
|
+
readonly arkPublishCandidate: {
|
|
1058
|
+
readonly type: "boolean";
|
|
1059
|
+
};
|
|
1060
|
+
readonly hasSource: {
|
|
1061
|
+
readonly type: "boolean";
|
|
1062
|
+
};
|
|
1063
|
+
readonly sourceIntent: {
|
|
1064
|
+
readonly type: "string";
|
|
1065
|
+
readonly minLength: 1;
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
};
|
|
1069
|
+
};
|
|
1070
|
+
readonly intentReferences: {
|
|
1071
|
+
readonly type: "array";
|
|
1072
|
+
readonly items: {
|
|
1073
|
+
readonly type: "object";
|
|
1074
|
+
readonly additionalProperties: false;
|
|
1075
|
+
readonly required: readonly ["file", "line", "intent"];
|
|
1076
|
+
readonly properties: {
|
|
1077
|
+
readonly file: {
|
|
1078
|
+
readonly type: "string";
|
|
1079
|
+
readonly minLength: 1;
|
|
1080
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1081
|
+
};
|
|
1082
|
+
readonly line: {
|
|
1083
|
+
readonly type: "integer";
|
|
1084
|
+
readonly minimum: 1;
|
|
1085
|
+
};
|
|
1086
|
+
readonly intent: {
|
|
1087
|
+
readonly type: "string";
|
|
1088
|
+
readonly minLength: 1;
|
|
1089
|
+
};
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
readonly safetyUses: {
|
|
1094
|
+
readonly type: "array";
|
|
1095
|
+
readonly items: {
|
|
1096
|
+
readonly type: "object";
|
|
1097
|
+
readonly additionalProperties: false;
|
|
1098
|
+
readonly required: readonly ["file", "line", "kind"];
|
|
1099
|
+
readonly properties: {
|
|
1100
|
+
readonly file: {
|
|
1101
|
+
readonly type: "string";
|
|
1102
|
+
readonly minLength: 1;
|
|
1103
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1104
|
+
};
|
|
1105
|
+
readonly line: {
|
|
1106
|
+
readonly type: "integer";
|
|
1107
|
+
readonly minimum: 1;
|
|
1108
|
+
};
|
|
1109
|
+
readonly kind: {
|
|
1110
|
+
readonly enum: readonly ["ts-suppression", "any-cast", "dynamic-import", "dynamic-require", "in-memory-store"];
|
|
1111
|
+
};
|
|
1112
|
+
readonly symbol: {
|
|
1113
|
+
readonly type: "string";
|
|
1114
|
+
readonly minLength: 1;
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
readonly allOf: readonly [{
|
|
1118
|
+
readonly if: {
|
|
1119
|
+
readonly properties: {
|
|
1120
|
+
readonly kind: {
|
|
1121
|
+
readonly const: "in-memory-store";
|
|
1122
|
+
};
|
|
1123
|
+
};
|
|
1124
|
+
};
|
|
1125
|
+
readonly then: {
|
|
1126
|
+
readonly required: readonly ["symbol"];
|
|
1127
|
+
};
|
|
1128
|
+
readonly else: {
|
|
1129
|
+
readonly not: {
|
|
1130
|
+
readonly required: readonly ["symbol"];
|
|
1131
|
+
};
|
|
1132
|
+
};
|
|
1133
|
+
}];
|
|
1134
|
+
};
|
|
1135
|
+
};
|
|
1136
|
+
readonly classShapes: {
|
|
1137
|
+
readonly type: "array";
|
|
1138
|
+
readonly items: {
|
|
1139
|
+
readonly type: "object";
|
|
1140
|
+
readonly additionalProperties: false;
|
|
1141
|
+
readonly required: readonly ["file", "className", "exported", "hasPublicMutableFields", "hasPublicSetters", "hasPublicConstructor", "hasStaticFactory", "mutatingMethods"];
|
|
1142
|
+
readonly properties: {
|
|
1143
|
+
readonly file: {
|
|
1144
|
+
readonly type: "string";
|
|
1145
|
+
readonly minLength: 1;
|
|
1146
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1147
|
+
};
|
|
1148
|
+
readonly className: {
|
|
1149
|
+
readonly type: "string";
|
|
1150
|
+
readonly minLength: 1;
|
|
1151
|
+
};
|
|
1152
|
+
readonly exported: {
|
|
1153
|
+
readonly type: "boolean";
|
|
1154
|
+
};
|
|
1155
|
+
readonly hasPublicMutableFields: {
|
|
1156
|
+
readonly type: "boolean";
|
|
1157
|
+
};
|
|
1158
|
+
readonly hasPublicSetters: {
|
|
1159
|
+
readonly type: "boolean";
|
|
1160
|
+
};
|
|
1161
|
+
readonly hasPublicConstructor: {
|
|
1162
|
+
readonly type: "boolean";
|
|
1163
|
+
};
|
|
1164
|
+
readonly hasStaticFactory: {
|
|
1165
|
+
readonly type: "boolean";
|
|
1166
|
+
};
|
|
1167
|
+
readonly dataOnly: {
|
|
1168
|
+
readonly type: "boolean";
|
|
1169
|
+
};
|
|
1170
|
+
readonly mutatingMethods: {
|
|
1171
|
+
readonly type: "array";
|
|
1172
|
+
readonly items: {
|
|
1173
|
+
readonly type: "object";
|
|
1174
|
+
readonly additionalProperties: false;
|
|
1175
|
+
readonly required: readonly ["name", "referencesGuardOrPublish"];
|
|
1176
|
+
readonly properties: {
|
|
1177
|
+
readonly name: {
|
|
1178
|
+
readonly type: "string";
|
|
1179
|
+
readonly minLength: 1;
|
|
1180
|
+
};
|
|
1181
|
+
readonly referencesGuardOrPublish: {
|
|
1182
|
+
readonly type: "boolean";
|
|
1183
|
+
};
|
|
1184
|
+
};
|
|
1185
|
+
};
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
};
|
|
1189
|
+
};
|
|
1190
|
+
readonly arkRunKernelCalls: {
|
|
1191
|
+
readonly type: "array";
|
|
1192
|
+
readonly items: {
|
|
1193
|
+
readonly type: "object";
|
|
1194
|
+
readonly additionalProperties: false;
|
|
1195
|
+
readonly required: readonly ["file", "line", "kind", "callee", "viaImport"];
|
|
1196
|
+
readonly properties: {
|
|
1197
|
+
readonly file: {
|
|
1198
|
+
readonly type: "string";
|
|
1199
|
+
readonly minLength: 1;
|
|
1200
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1201
|
+
};
|
|
1202
|
+
readonly line: {
|
|
1203
|
+
readonly type: "integer";
|
|
1204
|
+
readonly minimum: 1;
|
|
1205
|
+
};
|
|
1206
|
+
readonly kind: {
|
|
1207
|
+
readonly enum: readonly ["factory", "publisher", "publish", "raise", "send", "subscribe", "register-handler", "resolve", "resolve-singleton"];
|
|
1208
|
+
};
|
|
1209
|
+
readonly callee: {
|
|
1210
|
+
readonly type: "string";
|
|
1211
|
+
readonly minLength: 1;
|
|
1212
|
+
};
|
|
1213
|
+
readonly viaImport: {
|
|
1214
|
+
readonly type: "boolean";
|
|
1215
|
+
};
|
|
1216
|
+
readonly receiver: {
|
|
1217
|
+
readonly type: "string";
|
|
1218
|
+
readonly minLength: 1;
|
|
1219
|
+
};
|
|
1220
|
+
readonly nameLiteral: {
|
|
1221
|
+
readonly type: "string";
|
|
1222
|
+
readonly minLength: 1;
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
readonly arkRunManagedNews: {
|
|
1228
|
+
readonly type: "array";
|
|
1229
|
+
readonly items: {
|
|
1230
|
+
readonly type: "object";
|
|
1231
|
+
readonly additionalProperties: false;
|
|
1232
|
+
readonly required: readonly ["file", "line", "typeName"];
|
|
1233
|
+
readonly properties: {
|
|
1234
|
+
readonly file: {
|
|
1235
|
+
readonly type: "string";
|
|
1236
|
+
readonly minLength: 1;
|
|
1237
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1238
|
+
};
|
|
1239
|
+
readonly line: {
|
|
1240
|
+
readonly type: "integer";
|
|
1241
|
+
readonly minimum: 1;
|
|
1242
|
+
};
|
|
1243
|
+
readonly typeName: {
|
|
1244
|
+
readonly type: "string";
|
|
1245
|
+
readonly minLength: 1;
|
|
1246
|
+
};
|
|
1247
|
+
readonly importedFrom: {
|
|
1248
|
+
readonly type: "string";
|
|
1249
|
+
readonly minLength: 1;
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
};
|
|
1254
|
+
readonly arkRunCompositionRootHits: {
|
|
1255
|
+
readonly type: "array";
|
|
1256
|
+
readonly items: {
|
|
1257
|
+
readonly type: "object";
|
|
1258
|
+
readonly additionalProperties: false;
|
|
1259
|
+
readonly required: readonly ["file", "matchedRoot", "hasKernelFactory"];
|
|
1260
|
+
readonly properties: {
|
|
1261
|
+
readonly file: {
|
|
1262
|
+
readonly type: "string";
|
|
1263
|
+
readonly minLength: 1;
|
|
1264
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1265
|
+
};
|
|
1266
|
+
readonly matchedRoot: {
|
|
1267
|
+
readonly type: "string";
|
|
1268
|
+
readonly minLength: 1;
|
|
1269
|
+
};
|
|
1270
|
+
readonly hasKernelFactory: {
|
|
1271
|
+
readonly type: "boolean";
|
|
1272
|
+
};
|
|
1273
|
+
};
|
|
1274
|
+
};
|
|
1275
|
+
};
|
|
1276
|
+
readonly arkRunDeclarations: {
|
|
1277
|
+
readonly type: "array";
|
|
1278
|
+
readonly items: {
|
|
1279
|
+
readonly type: "object";
|
|
1280
|
+
readonly additionalProperties: false;
|
|
1281
|
+
readonly required: readonly ["file", "line", "uses", "reactsTo", "raises", "sends"];
|
|
1282
|
+
readonly properties: {
|
|
1283
|
+
readonly file: {
|
|
1284
|
+
readonly type: "string";
|
|
1285
|
+
readonly minLength: 1;
|
|
1286
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1287
|
+
};
|
|
1288
|
+
readonly line: {
|
|
1289
|
+
readonly type: "integer";
|
|
1290
|
+
readonly minimum: 1;
|
|
1291
|
+
};
|
|
1292
|
+
readonly uses: {
|
|
1293
|
+
readonly type: "array";
|
|
1294
|
+
readonly items: {
|
|
1295
|
+
readonly type: "string";
|
|
1296
|
+
readonly minLength: 1;
|
|
1297
|
+
};
|
|
1298
|
+
};
|
|
1299
|
+
readonly reactsTo: {
|
|
1300
|
+
readonly type: "array";
|
|
1301
|
+
readonly items: {
|
|
1302
|
+
readonly type: "string";
|
|
1303
|
+
readonly minLength: 1;
|
|
1304
|
+
};
|
|
1305
|
+
};
|
|
1306
|
+
readonly raises: {
|
|
1307
|
+
readonly type: "array";
|
|
1308
|
+
readonly items: {
|
|
1309
|
+
readonly type: "string";
|
|
1310
|
+
readonly minLength: 1;
|
|
1311
|
+
};
|
|
1312
|
+
};
|
|
1313
|
+
readonly sends: {
|
|
1314
|
+
readonly type: "array";
|
|
1315
|
+
readonly items: {
|
|
1316
|
+
readonly type: "string";
|
|
1317
|
+
readonly minLength: 1;
|
|
1318
|
+
};
|
|
1319
|
+
};
|
|
1320
|
+
};
|
|
1321
|
+
};
|
|
1322
|
+
};
|
|
1323
|
+
readonly arkOrderPlaneCalls: {
|
|
1324
|
+
readonly type: "array";
|
|
1325
|
+
readonly items: {
|
|
1326
|
+
readonly type: "object";
|
|
1327
|
+
readonly additionalProperties: false;
|
|
1328
|
+
readonly required: readonly ["file", "line", "callee"];
|
|
1329
|
+
readonly properties: {
|
|
1330
|
+
readonly file: {
|
|
1331
|
+
readonly type: "string";
|
|
1332
|
+
readonly minLength: 1;
|
|
1333
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1334
|
+
};
|
|
1335
|
+
readonly line: {
|
|
1336
|
+
readonly type: "integer";
|
|
1337
|
+
readonly minimum: 1;
|
|
1338
|
+
};
|
|
1339
|
+
readonly callee: {
|
|
1340
|
+
readonly type: "string";
|
|
1341
|
+
readonly minLength: 1;
|
|
1342
|
+
};
|
|
1343
|
+
};
|
|
1344
|
+
};
|
|
1345
|
+
};
|
|
1346
|
+
readonly arkOrderGenericUpdates: {
|
|
1347
|
+
readonly type: "array";
|
|
1348
|
+
readonly items: {
|
|
1349
|
+
readonly type: "object";
|
|
1350
|
+
readonly additionalProperties: false;
|
|
1351
|
+
readonly required: readonly ["file", "line", "method"];
|
|
1352
|
+
readonly properties: {
|
|
1353
|
+
readonly file: {
|
|
1354
|
+
readonly type: "string";
|
|
1355
|
+
readonly minLength: 1;
|
|
1356
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1357
|
+
};
|
|
1358
|
+
readonly line: {
|
|
1359
|
+
readonly type: "integer";
|
|
1360
|
+
readonly minimum: 1;
|
|
1361
|
+
};
|
|
1362
|
+
readonly method: {
|
|
1363
|
+
readonly type: "string";
|
|
1364
|
+
readonly minLength: 1;
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
readonly arkOrderRootHits: {
|
|
1370
|
+
readonly type: "array";
|
|
1371
|
+
readonly items: {
|
|
1372
|
+
readonly type: "object";
|
|
1373
|
+
readonly additionalProperties: false;
|
|
1374
|
+
readonly required: readonly ["file", "matchedRoot", "hasPlaneFactory"];
|
|
1375
|
+
readonly properties: {
|
|
1376
|
+
readonly file: {
|
|
1377
|
+
readonly type: "string";
|
|
1378
|
+
readonly minLength: 1;
|
|
1379
|
+
readonly pattern: "^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$";
|
|
1380
|
+
};
|
|
1381
|
+
readonly matchedRoot: {
|
|
1382
|
+
readonly type: "string";
|
|
1383
|
+
readonly minLength: 1;
|
|
1384
|
+
};
|
|
1385
|
+
readonly hasPlaneFactory: {
|
|
1386
|
+
readonly type: "boolean";
|
|
1387
|
+
};
|
|
1388
|
+
};
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1391
|
+
readonly factsHash: {
|
|
1392
|
+
readonly type: "string";
|
|
1393
|
+
readonly minLength: 1;
|
|
1394
|
+
};
|
|
1395
|
+
};
|
|
1396
|
+
readonly allOf: readonly [{
|
|
1397
|
+
readonly if: {
|
|
1398
|
+
readonly properties: {
|
|
1399
|
+
readonly completeness: {
|
|
1400
|
+
readonly const: "complete";
|
|
1401
|
+
};
|
|
1402
|
+
};
|
|
1403
|
+
};
|
|
1404
|
+
readonly then: {
|
|
1405
|
+
readonly properties: {
|
|
1406
|
+
readonly completenessReasons: {
|
|
1407
|
+
readonly maxItems: 0;
|
|
1408
|
+
};
|
|
1409
|
+
readonly files: {
|
|
1410
|
+
readonly items: {
|
|
1411
|
+
readonly properties: {
|
|
1412
|
+
readonly parseStatus: {
|
|
1413
|
+
readonly const: "parsed";
|
|
1414
|
+
};
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
};
|
|
1419
|
+
};
|
|
1420
|
+
}, {
|
|
1421
|
+
readonly if: {
|
|
1422
|
+
readonly properties: {
|
|
1423
|
+
readonly completeness: {
|
|
1424
|
+
readonly enum: readonly ["partial", "unavailable"];
|
|
1425
|
+
};
|
|
1426
|
+
};
|
|
1427
|
+
};
|
|
1428
|
+
readonly then: {
|
|
1429
|
+
readonly properties: {
|
|
1430
|
+
readonly completenessReasons: {
|
|
1431
|
+
readonly minItems: 1;
|
|
1432
|
+
};
|
|
1433
|
+
};
|
|
1434
|
+
};
|
|
1435
|
+
}];
|
|
1436
|
+
};
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* Stable, pure vocabulary for ArkGate's importable analysis engine.
|
|
1440
|
+
*
|
|
1441
|
+
* This module owns the Analysis IR types and re-exports the resolved-candidate-facts
|
|
1442
|
+
* pilot cluster (plan-B / pattern-b:god-module). Parsing and filesystem discovery
|
|
1443
|
+
* belong to adapters.
|
|
1444
|
+
*
|
|
1445
|
+
* Cluster:
|
|
1446
|
+
* - `stableHash` — identity/fingerprint primitives
|
|
1447
|
+
* - `resolvedCandidateFactsTypes` — versioned fact types
|
|
1448
|
+
* - `resolvedCandidateFacts` — create/load/canonicalize
|
|
1449
|
+
* - `resolvedCandidateFactsSchema` — published JSON Schema
|
|
1450
|
+
*
|
|
1451
|
+
* Consumer import paths through this facade remain stable (same pattern as Kernel
|
|
1452
|
+
* `analysis.ts` after U02).
|
|
1453
|
+
*/
|
|
1454
|
+
|
|
1455
|
+
declare const ANALYSIS_IR_SCHEMA_VERSION: "1.0";
|
|
1456
|
+
type AnalysisFileInput = {
|
|
1457
|
+
path: string;
|
|
1458
|
+
content: string;
|
|
1459
|
+
};
|
|
1460
|
+
type AnalysisFileChange = {
|
|
1461
|
+
path: string;
|
|
1462
|
+
content: string;
|
|
1463
|
+
} | {
|
|
1464
|
+
path: string;
|
|
1465
|
+
delete: true;
|
|
1466
|
+
};
|
|
1467
|
+
type AnalysisCompilerOptions = Readonly<Record<string, unknown>>;
|
|
1468
|
+
type AnalysisFile = AnalysisFileInput & {
|
|
1469
|
+
contentHash: string;
|
|
1470
|
+
layer: string | null;
|
|
1471
|
+
};
|
|
1472
|
+
type AnalysisImportEdge = {
|
|
1473
|
+
from: string;
|
|
1474
|
+
specifier: string;
|
|
1475
|
+
to: string | null;
|
|
1476
|
+
resolution: 'resolved' | 'unresolved';
|
|
1477
|
+
fromLayer: string | null;
|
|
1478
|
+
toLayer: string | null;
|
|
1479
|
+
evidence: AnalysisEvidence;
|
|
1480
|
+
};
|
|
1481
|
+
/** A capability use is reserved for C04's symbol-aware implementation. */
|
|
1482
|
+
type AnalysisCapabilityUse = {
|
|
1483
|
+
file: string;
|
|
1484
|
+
symbol: string;
|
|
1485
|
+
capability: string;
|
|
1486
|
+
evidence: AnalysisEvidence;
|
|
1487
|
+
};
|
|
1488
|
+
type AnalysisEvidence = {
|
|
1489
|
+
kind: 'import' | 'policy';
|
|
1490
|
+
file: string;
|
|
1491
|
+
line: number;
|
|
1492
|
+
excerpt: string;
|
|
1493
|
+
};
|
|
1494
|
+
type AnalysisViolation = {
|
|
1495
|
+
ruleId: string;
|
|
1496
|
+
message: string;
|
|
1497
|
+
edge?: AnalysisImportEdge;
|
|
1498
|
+
/** U04 (additive): present on CAPABILITY_VIOLATION — the denied capability id. */
|
|
1499
|
+
capability?: string;
|
|
1500
|
+
/** U04 (additive): the matched module specifier or ambient path. */
|
|
1501
|
+
symbol?: string;
|
|
1502
|
+
evidence: AnalysisEvidence;
|
|
1503
|
+
};
|
|
1504
|
+
type AnalysisIr = {
|
|
1505
|
+
schemaVersion: typeof ANALYSIS_IR_SCHEMA_VERSION;
|
|
1506
|
+
policyHash: string;
|
|
1507
|
+
compilerOptionsHash: string;
|
|
1508
|
+
files: AnalysisFile[];
|
|
1509
|
+
layers: string[];
|
|
1510
|
+
edges: AnalysisImportEdge[];
|
|
1511
|
+
capabilityUses: AnalysisCapabilityUse[];
|
|
1512
|
+
violations: AnalysisViolation[];
|
|
1513
|
+
};
|
|
1514
|
+
|
|
1515
|
+
declare const ARK_CHANGE_MAP_SCHEMA_VERSION: "1.0";
|
|
1516
|
+
type ArchitectureChangeOperation = 'create' | 'update' | 'delete';
|
|
1517
|
+
type ArchitectureChangeMapFile = {
|
|
1518
|
+
path: string;
|
|
1519
|
+
operation: ArchitectureChangeOperation;
|
|
1520
|
+
layer: string;
|
|
1521
|
+
};
|
|
1522
|
+
type ArchitectureChangeMapDependency = {
|
|
1523
|
+
from: string;
|
|
1524
|
+
to: string;
|
|
1525
|
+
};
|
|
1526
|
+
type ArchitectureChangeMap = {
|
|
1527
|
+
$schema: string;
|
|
1528
|
+
schemaVersion: typeof ARK_CHANGE_MAP_SCHEMA_VERSION;
|
|
1529
|
+
files: ArchitectureChangeMapFile[];
|
|
1530
|
+
dependencies: ArchitectureChangeMapDependency[];
|
|
1531
|
+
};
|
|
1532
|
+
type ArchitectureChangeMapContract = {
|
|
1533
|
+
map: ArchitectureChangeMap;
|
|
1534
|
+
hash: string;
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
type ArchitectureDependency = {
|
|
1538
|
+
from: string;
|
|
1539
|
+
to: string;
|
|
1540
|
+
};
|
|
1541
|
+
type ArchitectureActualChange = {
|
|
1542
|
+
path: string;
|
|
1543
|
+
operation: ArchitectureChangeOperation;
|
|
1544
|
+
};
|
|
1545
|
+
type ArchitectureConvergenceClassification = 'satisfied' | 'missing' | 'contradictory' | 'unplanned';
|
|
1546
|
+
type ArchitectureConvergenceFinding = {
|
|
1547
|
+
id: string;
|
|
1548
|
+
classification: ArchitectureConvergenceClassification;
|
|
1549
|
+
subject: 'file' | 'dependency';
|
|
1550
|
+
message: string;
|
|
1551
|
+
nextAction?: string;
|
|
1552
|
+
path?: string;
|
|
1553
|
+
from?: string;
|
|
1554
|
+
to?: string;
|
|
1555
|
+
expectedOperation?: ArchitectureChangeOperation;
|
|
1556
|
+
actualOperation?: ArchitectureChangeOperation | 'added' | 'removed';
|
|
1557
|
+
};
|
|
1558
|
+
type ArchitectureConvergenceResult = {
|
|
1559
|
+
schemaVersion: '1.0';
|
|
1560
|
+
readOnly: true;
|
|
1561
|
+
changeMapHash: string;
|
|
1562
|
+
structurallyConverged: boolean;
|
|
1563
|
+
behavioralCompletion: 'not-evaluated';
|
|
1564
|
+
summary: Record<ArchitectureConvergenceClassification, number>;
|
|
1565
|
+
findings: ArchitectureConvergenceFinding[];
|
|
1566
|
+
};
|
|
1567
|
+
type AnalyzeArchitectureConvergenceInput = {
|
|
1568
|
+
changeMap: ArchitectureChangeMapContract;
|
|
1569
|
+
changes: readonly ArchitectureActualChange[];
|
|
1570
|
+
baseDependencies: readonly ArchitectureDependency[];
|
|
1571
|
+
candidateDependencies: readonly ArchitectureDependency[];
|
|
1572
|
+
};
|
|
1573
|
+
declare function analyzeArchitectureConvergence(input: AnalyzeArchitectureConvergenceInput): ArchitectureConvergenceResult;
|
|
1574
|
+
|
|
1575
|
+
type SemanticDependencyKind = 'import' | 'export' | 'dynamic-import' | 'require';
|
|
1576
|
+
type SemanticDependency = {
|
|
1577
|
+
specifier?: string;
|
|
1578
|
+
kind: SemanticDependencyKind;
|
|
1579
|
+
line: number;
|
|
1580
|
+
typeOnly: boolean;
|
|
1581
|
+
unresolved: boolean;
|
|
1582
|
+
node: unknown;
|
|
1583
|
+
};
|
|
1584
|
+
type ForbiddenCapabilityUse = {
|
|
1585
|
+
name: string;
|
|
1586
|
+
line: number;
|
|
1587
|
+
node: unknown;
|
|
1588
|
+
};
|
|
1589
|
+
/** Extract every dependency form whose specifier is statically knowable, plus unresolved calls. */
|
|
1590
|
+
declare function extractSemanticDependencies(ts: any, sourceFile: any): SemanticDependency[];
|
|
1591
|
+
/** Resolve forbidden ambient capabilities through symbols, aliases, globalThis, and static keys. */
|
|
1592
|
+
declare function collectForbiddenCapabilityUses(ts: any, sourceFile: any, forbidden: readonly string[]): ForbiddenCapabilityUse[];
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* Type vocabulary for ArkRules files (ADR 0012).
|
|
1596
|
+
*
|
|
1597
|
+
* Pure declarations only — runtime validation and the published JSON Schema live in
|
|
1598
|
+
* ./arkRulesContract.ts so generate:cli-pure can emit a self-contained artifact.
|
|
1599
|
+
*/
|
|
1600
|
+
/** Closed sensor vocabulary (ADR 0013). Unknown sensors fail closed at load time. */
|
|
1601
|
+
declare const ARK_RULE_SENSOR_IDS: readonly ["aggregate-private-state", "always-valid-factory", "domain-event-on-mutation", "orchestration-only", "thin-adapter", "no-anemic-model", "invariant-coverage"];
|
|
1602
|
+
type ArkRuleSensorId = (typeof ARK_RULE_SENSOR_IDS)[number];
|
|
1603
|
+
type ArkRuleMode = 'advisory' | 'enforced';
|
|
1604
|
+
type ArkRuleStructureEntry = {
|
|
1605
|
+
id: string;
|
|
1606
|
+
sensor: ArkRuleSensorId;
|
|
1607
|
+
mode?: ArkRuleMode;
|
|
1608
|
+
appliesTo?: string[];
|
|
1609
|
+
description?: string;
|
|
1610
|
+
};
|
|
1611
|
+
type ArkRuleInvariantCoverage = {
|
|
1612
|
+
test?: boolean;
|
|
1613
|
+
symbol?: string;
|
|
1614
|
+
};
|
|
1615
|
+
type ArkRuleInvariantEntry = {
|
|
1616
|
+
id: string;
|
|
1617
|
+
description: string;
|
|
1618
|
+
aggregate?: string;
|
|
1619
|
+
coverage?: ArkRuleInvariantCoverage;
|
|
1620
|
+
mode?: ArkRuleMode;
|
|
1621
|
+
appliesTo?: string[];
|
|
1622
|
+
};
|
|
1623
|
+
type ArkRulesFile = {
|
|
1624
|
+
$schema?: string;
|
|
1625
|
+
schemaVersion: '1.0';
|
|
1626
|
+
layer: string;
|
|
1627
|
+
structure?: ArkRuleStructureEntry[];
|
|
1628
|
+
invariants?: ArkRuleInvariantEntry[];
|
|
1629
|
+
};
|
|
1630
|
+
type ArkRuleProvenance = {
|
|
1631
|
+
sourceFile: string;
|
|
1632
|
+
ruleId: string;
|
|
1633
|
+
layer: string;
|
|
1634
|
+
};
|
|
1635
|
+
type EffectiveStructureRule = ArkRuleStructureEntry & {
|
|
1636
|
+
mode: ArkRuleMode;
|
|
1637
|
+
provenance: ArkRuleProvenance;
|
|
1638
|
+
};
|
|
1639
|
+
type EffectiveInvariantRule = ArkRuleInvariantEntry & {
|
|
1640
|
+
mode: ArkRuleMode;
|
|
1641
|
+
provenance: ArkRuleProvenance;
|
|
1642
|
+
};
|
|
1643
|
+
type EffectiveArkRules = {
|
|
1644
|
+
schemaVersion: '1.0';
|
|
1645
|
+
byLayer: Record<string, {
|
|
1646
|
+
sourceFile: string;
|
|
1647
|
+
structure: EffectiveStructureRule[];
|
|
1648
|
+
invariants: EffectiveInvariantRule[];
|
|
1649
|
+
}>;
|
|
1650
|
+
structure: EffectiveStructureRule[];
|
|
1651
|
+
invariants: EffectiveInvariantRule[];
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* Pure invariant coverage evidence (ADR 0014 / AR09–AR10).
|
|
1656
|
+
*
|
|
1657
|
+
* Mines test titles and symbol presence against the Effective ArkRules catalog.
|
|
1658
|
+
* No filesystem — Tooling supplies file contents and test globs.
|
|
1659
|
+
*/
|
|
1660
|
+
|
|
1661
|
+
type InvariantCoverageEvidence = {
|
|
1662
|
+
invariantId: string;
|
|
1663
|
+
layer: string;
|
|
1664
|
+
sourceFile: string;
|
|
1665
|
+
mode: 'advisory' | 'enforced';
|
|
1666
|
+
covered: boolean;
|
|
1667
|
+
evidence: Array<'test-title' | 'symbol'>;
|
|
1668
|
+
/** When no test globs were supplied, coverage cannot be proven. */
|
|
1669
|
+
partial: boolean;
|
|
1670
|
+
description: string;
|
|
1671
|
+
};
|
|
1672
|
+
type InvariantUncoveredKind = 'never-had-tests' | 'tests-disappeared';
|
|
1673
|
+
type InvariantCoverageViolation = {
|
|
1674
|
+
ruleId: 'INVARIANT_UNCOVERED';
|
|
1675
|
+
message: string;
|
|
1676
|
+
file: string;
|
|
1677
|
+
line: number;
|
|
1678
|
+
arkruleId: string;
|
|
1679
|
+
arkruleSource: string;
|
|
1680
|
+
fromLayer: string;
|
|
1681
|
+
severity: 'error' | 'warning';
|
|
1682
|
+
failsStrict: boolean;
|
|
1683
|
+
/** Adopt residual (no test suite) vs regression (suite exists, coverage gone). */
|
|
1684
|
+
kind: InvariantUncoveredKind;
|
|
1685
|
+
};
|
|
1686
|
+
type EvaluateInvariantCoverageInput = {
|
|
1687
|
+
arkRules: EffectiveArkRules;
|
|
1688
|
+
/** Project-relative path → file contents (tests + domain sources). */
|
|
1689
|
+
fileContents: Readonly<Record<string, string>>;
|
|
1690
|
+
/** Paths considered tests (already filtered by Tooling via globs). */
|
|
1691
|
+
testFiles?: readonly string[];
|
|
1692
|
+
/** When true, missing test files make coverage partial (never green covered). */
|
|
1693
|
+
testGlobsMissing?: boolean;
|
|
1694
|
+
};
|
|
1695
|
+
declare function evaluateInvariantCoverage(input: EvaluateInvariantCoverageInput): {
|
|
1696
|
+
coverage: InvariantCoverageEvidence[];
|
|
1697
|
+
violations: InvariantCoverageViolation[];
|
|
1698
|
+
partial: boolean;
|
|
1699
|
+
};
|
|
1700
|
+
/**
|
|
1701
|
+
* Deterministic promotion gate: refuse advisory→enforced when invariant is uncovered.
|
|
1702
|
+
*/
|
|
1703
|
+
declare function canPromoteInvariant(coverage: InvariantCoverageEvidence | undefined): {
|
|
1704
|
+
ok: boolean;
|
|
1705
|
+
reason: string;
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Pure ArkRules structure sensor evaluation (ADR 0013).
|
|
1710
|
+
*
|
|
1711
|
+
* Consumes closed class-shape / file facts + Effective ArkRules. Emits violations with
|
|
1712
|
+
* arkrule provenance. No filesystem, no TypeScript compiler.
|
|
1713
|
+
*/
|
|
1714
|
+
|
|
1715
|
+
type ClassShapeFact = {
|
|
1716
|
+
file: string;
|
|
1717
|
+
className: string;
|
|
1718
|
+
exported: boolean;
|
|
1719
|
+
hasPublicMutableFields: boolean;
|
|
1720
|
+
hasPublicSetters: boolean;
|
|
1721
|
+
hasPublicConstructor: boolean;
|
|
1722
|
+
hasStaticFactory: boolean;
|
|
1723
|
+
mutatingMethods: readonly {
|
|
1724
|
+
name: string;
|
|
1725
|
+
referencesGuardOrPublish: boolean;
|
|
1726
|
+
}[];
|
|
1727
|
+
/** Heuristic: data-only class (fields, no methods beyond accessors). */
|
|
1728
|
+
dataOnly?: boolean;
|
|
1729
|
+
};
|
|
1730
|
+
type ArkRuleSensorViolation = {
|
|
1731
|
+
ruleId: string;
|
|
1732
|
+
code: string;
|
|
1733
|
+
message: string;
|
|
1734
|
+
file: string;
|
|
1735
|
+
line: number;
|
|
1736
|
+
fromLayer?: string;
|
|
1737
|
+
arkruleId: string;
|
|
1738
|
+
arkruleSource: string;
|
|
1739
|
+
severity: 'error' | 'warning';
|
|
1740
|
+
sensor: ArkRuleSensorId;
|
|
1741
|
+
/** When true, advisory surfaces only (does not fail strict). */
|
|
1742
|
+
failsStrict: boolean;
|
|
1743
|
+
};
|
|
1744
|
+
type EvaluateArkRuleSensorsInput = {
|
|
1745
|
+
arkRules: EffectiveArkRules;
|
|
1746
|
+
classShapes: readonly ClassShapeFact[];
|
|
1747
|
+
/** Project-relative paths in scope for the analysis. */
|
|
1748
|
+
files: readonly string[];
|
|
1749
|
+
/**
|
|
1750
|
+
* Optional layer membership: path → layer name. When omitted, structure rules
|
|
1751
|
+
* apply by appliesTo globs only (or all files when appliesTo is absent).
|
|
1752
|
+
*/
|
|
1753
|
+
layerForFile?: (path: string) => string | null | undefined;
|
|
1754
|
+
/**
|
|
1755
|
+
* Optional thin/orchestration heuristic flags per file (Tooling-supplied).
|
|
1756
|
+
*/
|
|
1757
|
+
fileHints?: Readonly<Record<string, {
|
|
1758
|
+
orchestrationHeavy?: boolean;
|
|
1759
|
+
adapterThick?: boolean;
|
|
1760
|
+
}>>;
|
|
1761
|
+
};
|
|
1762
|
+
/**
|
|
1763
|
+
* Evaluate all structure sensors. Empty Effective Contract → no findings (byte-for-byte parity).
|
|
1764
|
+
*/
|
|
1765
|
+
declare function evaluateArkRuleSensors(input: EvaluateArkRuleSensorsInput): ArkRuleSensorViolation[];
|
|
1766
|
+
/**
|
|
1767
|
+
* ADR 0012 D3 — a structure rule whose appliesTo matches zero governed files is
|
|
1768
|
+
* never silent green. Advisory → warning; enforced → failsStrict.
|
|
1769
|
+
* Rules without appliesTo (whole-layer) never emit this signal.
|
|
1770
|
+
*/
|
|
1771
|
+
declare function collectEmptyAppliesToFindings(arkRules: EffectiveArkRules, files: readonly string[]): ArkRuleSensorViolation[];
|
|
1772
|
+
/**
|
|
1773
|
+
* Pure Tooling/Domain heuristic for orchestration-only / thin-adapter fileHints.
|
|
1774
|
+
* Prefers false negatives over false positives (ADR 0013 discipline).
|
|
1775
|
+
* Returns null when neither flag is set (callers may omit the path).
|
|
1776
|
+
*/
|
|
1777
|
+
declare function deriveArkRuleFileHints(_file: string, content: string): {
|
|
1778
|
+
orchestrationHeavy?: boolean;
|
|
1779
|
+
adapterThick?: boolean;
|
|
1780
|
+
} | null;
|
|
1781
|
+
/**
|
|
1782
|
+
* Build fileHints map from path→content. Omits paths with no flags (sparse map).
|
|
1783
|
+
*/
|
|
1784
|
+
declare function buildArkRuleFileHints(fileContents: Readonly<Record<string, string>>): Record<string, {
|
|
1785
|
+
orchestrationHeavy?: boolean;
|
|
1786
|
+
adapterThick?: boolean;
|
|
1787
|
+
}>;
|
|
1788
|
+
/**
|
|
1789
|
+
* Lightweight class-shape extraction from TypeScript source text (no compiler).
|
|
1790
|
+
* Conservative: prefers false negatives over false positives for mutability.
|
|
1791
|
+
* Tooling may replace with TypeScript-API facts; sensors consume the same shape.
|
|
1792
|
+
*
|
|
1793
|
+
* Limitation (AR05/AR06): only `export class` / `export abstract class` forms.
|
|
1794
|
+
* `export default class`, re-exported classes, and non-exported aggregates are
|
|
1795
|
+
* invisible — enforced structure sensors stay silent (false negative). Silence
|
|
1796
|
+
* is never proof of compliance.
|
|
1797
|
+
*/
|
|
1798
|
+
declare function extractClassShapesFromSource(file: string, content: string): ClassShapeFact[];
|
|
1799
|
+
|
|
1800
|
+
declare const POLICY_DELTA_SCHEMA_VERSION: "1.0";
|
|
1801
|
+
type PolicyDeltaClassification = 'strengthening' | 'neutral' | 'judgment-required' | 'weakening';
|
|
1802
|
+
type PolicyDeltaFinding = {
|
|
1803
|
+
id: string;
|
|
1804
|
+
path: string;
|
|
1805
|
+
classification: Exclude<PolicyDeltaClassification, 'neutral'>;
|
|
1806
|
+
message: string;
|
|
1807
|
+
nextAction?: string;
|
|
1808
|
+
before?: unknown;
|
|
1809
|
+
after?: unknown;
|
|
1810
|
+
};
|
|
1811
|
+
type PolicyDelta = {
|
|
1812
|
+
schemaVersion: typeof POLICY_DELTA_SCHEMA_VERSION;
|
|
1813
|
+
classification: PolicyDeltaClassification;
|
|
1814
|
+
findings: PolicyDeltaFinding[];
|
|
1815
|
+
};
|
|
1816
|
+
type PolicyDeltaAcknowledgement = {
|
|
1817
|
+
schemaVersion: typeof POLICY_DELTA_SCHEMA_VERSION;
|
|
1818
|
+
basePolicyHash: string;
|
|
1819
|
+
candidatePolicyHash: string;
|
|
1820
|
+
findingIds: readonly string[];
|
|
1821
|
+
reason: string;
|
|
1822
|
+
};
|
|
1823
|
+
type ClassifyArkPolicyDeltaOptions = {
|
|
1824
|
+
baseArkRules?: EffectiveArkRules;
|
|
1825
|
+
candidateArkRules?: EffectiveArkRules;
|
|
1826
|
+
/**
|
|
1827
|
+
* AR11 — coverage evidence for candidate invariants. Required to auto-allow
|
|
1828
|
+
* advisory→enforced promotion; without it (or when uncovered), promotion is
|
|
1829
|
+
* judgment-required / refused.
|
|
1830
|
+
*/
|
|
1831
|
+
candidateInvariantCoverage?: readonly InvariantCoverageEvidence[];
|
|
1832
|
+
};
|
|
1833
|
+
declare function classifyArkPolicyDelta(base: ArkConfig, candidate: ArkConfig, options?: ClassifyArkPolicyDeltaOptions): PolicyDelta;
|
|
1834
|
+
declare function policyDeltaAcknowledgementMatches(acknowledgement: PolicyDeltaAcknowledgement | undefined, expected: {
|
|
1835
|
+
basePolicyHash: string;
|
|
1836
|
+
candidatePolicyHash: string;
|
|
1837
|
+
findingIds: readonly string[];
|
|
1838
|
+
}): boolean;
|
|
1839
|
+
|
|
1840
|
+
type AnalysisContract = ArkConfigLoadResult & {
|
|
1841
|
+
policyHash: string;
|
|
1842
|
+
/**
|
|
1843
|
+
* ADR 0012 Effective ArkRules (empty when arkRules is absent).
|
|
1844
|
+
* Included in policyHash when non-empty so arkrules edits invalidate identity.
|
|
1845
|
+
*/
|
|
1846
|
+
arkRules?: EffectiveArkRules;
|
|
1847
|
+
/**
|
|
1848
|
+
* ADR 0013 class-shape facts for ArkRules sensors (Tooling-supplied).
|
|
1849
|
+
* Empty / absent when ArkRules are not active.
|
|
1850
|
+
*/
|
|
1851
|
+
classShapes?: ClassShapeFact[];
|
|
1852
|
+
};
|
|
1853
|
+
type AnalyzeProjectInput = {
|
|
1854
|
+
contract: AnalysisContract;
|
|
1855
|
+
files: readonly AnalysisFileInput[];
|
|
1856
|
+
compilerOptions?: AnalysisCompilerOptions;
|
|
1857
|
+
};
|
|
1858
|
+
type AnalyzeChangeInput = AnalyzeProjectInput & {
|
|
1859
|
+
changes: readonly AnalysisFileChange[];
|
|
1860
|
+
changeMap?: ArchitectureChangeMapContract;
|
|
1861
|
+
};
|
|
1862
|
+
type AnalysisResult = {
|
|
1863
|
+
mode: 'lexical-compatibility';
|
|
1864
|
+
completeness: ResolvedFactsCompleteness;
|
|
1865
|
+
completenessReasons: ResolvedFactsReason[];
|
|
1866
|
+
valid: boolean;
|
|
1867
|
+
ir: AnalysisIr;
|
|
1868
|
+
};
|
|
1869
|
+
type AnalyzeResolvedProjectInput = {
|
|
1870
|
+
contract: AnalysisContract;
|
|
1871
|
+
facts: unknown;
|
|
1872
|
+
/**
|
|
1873
|
+
* AR10 — Tooling-supplied contents for invariant coverage evidence.
|
|
1874
|
+
* When omitted and the Effective Contract has invariants, coverage is partial
|
|
1875
|
+
* (never false green covered).
|
|
1876
|
+
*/
|
|
1877
|
+
coverageInputs?: {
|
|
1878
|
+
fileContents: Readonly<Record<string, string>>;
|
|
1879
|
+
testFiles?: readonly string[];
|
|
1880
|
+
testGlobsMissing?: boolean;
|
|
1881
|
+
};
|
|
1882
|
+
/**
|
|
1883
|
+
* AR07 — Tooling-supplied orchestration/thin-adapter heuristics per file.
|
|
1884
|
+
* Prefer deriveArkRuleFileHints / buildArkRuleFileHints (Domain pure).
|
|
1885
|
+
* When omitted, orchestration-only and thin-adapter sensors stay silent.
|
|
1886
|
+
*/
|
|
1887
|
+
fileHints?: Readonly<Record<string, {
|
|
1888
|
+
orchestrationHeavy?: boolean;
|
|
1889
|
+
adapterThick?: boolean;
|
|
1890
|
+
}>>;
|
|
1891
|
+
};
|
|
1892
|
+
type PreflightResolvedChangeInput = {
|
|
1893
|
+
contract: AnalysisContract;
|
|
1894
|
+
baseFacts: unknown;
|
|
1895
|
+
candidateFacts: unknown;
|
|
1896
|
+
changes: readonly AnalysisFileChange[];
|
|
1897
|
+
changeMap?: ArchitectureChangeMapContract;
|
|
1898
|
+
};
|
|
1899
|
+
type ResolvedAnalysisFile = ResolvedFileFact & {
|
|
1900
|
+
layer: string | null;
|
|
1901
|
+
};
|
|
1902
|
+
type ResolvedAnalysisIr = {
|
|
1903
|
+
schemaVersion: '1.0';
|
|
1904
|
+
policyHash: string;
|
|
1905
|
+
compilerOptionsHash: string;
|
|
1906
|
+
files: ResolvedAnalysisFile[];
|
|
1907
|
+
layers: string[];
|
|
1908
|
+
edges: ArchitectureEngineEdge[];
|
|
1909
|
+
capabilityUses: ResolvedCapabilityFact[];
|
|
1910
|
+
violations: ArchitectureEngineViolation[];
|
|
1911
|
+
warnings: ArchitectureEngineViolation[];
|
|
1912
|
+
};
|
|
1913
|
+
type ResolvedSafetyReport = {
|
|
1914
|
+
tsSuppressions: {
|
|
1915
|
+
file: string;
|
|
1916
|
+
line: number;
|
|
1917
|
+
}[];
|
|
1918
|
+
anyCasts: {
|
|
1919
|
+
file: string;
|
|
1920
|
+
line: number;
|
|
1921
|
+
}[];
|
|
1922
|
+
nonLiteralDynamicImports: {
|
|
1923
|
+
file: string;
|
|
1924
|
+
line: number;
|
|
1925
|
+
kind: 'import' | 'require';
|
|
1926
|
+
}[];
|
|
1927
|
+
inMemoryProductionStores: {
|
|
1928
|
+
file: string;
|
|
1929
|
+
line: number;
|
|
1930
|
+
store: string;
|
|
1931
|
+
}[];
|
|
1932
|
+
disabledPeerIsolationRules: {
|
|
1933
|
+
from: string;
|
|
1934
|
+
to: string;
|
|
1935
|
+
}[];
|
|
1936
|
+
thresholds: {
|
|
1937
|
+
maxTsSuppressions: number;
|
|
1938
|
+
maxAnyCasts: number;
|
|
1939
|
+
};
|
|
1940
|
+
};
|
|
1941
|
+
type ResolvedAnalysisResult = {
|
|
1942
|
+
mode: 'resolved-candidate-facts';
|
|
1943
|
+
completeness: ResolvedFactsCompleteness;
|
|
1944
|
+
completenessReasons: ResolvedFactsReason[];
|
|
1945
|
+
valid: boolean;
|
|
1946
|
+
strictValid: boolean;
|
|
1947
|
+
policyHash: string;
|
|
1948
|
+
factsHash: ResolvedCandidateFacts['factsHash'];
|
|
1949
|
+
resolverIdentity: ResolvedCandidateFacts['resolverIdentity'];
|
|
1950
|
+
candidateTreeHash: ResolvedCandidateFacts['candidateTreeHash'];
|
|
1951
|
+
safety: ResolvedSafetyReport;
|
|
1952
|
+
ir: ResolvedAnalysisIr;
|
|
1953
|
+
};
|
|
1954
|
+
type ResolvedChangePreflightResult = {
|
|
1955
|
+
schemaVersion: '1.0';
|
|
1956
|
+
mode: 'resolved-candidate-facts';
|
|
1957
|
+
valid: boolean;
|
|
1958
|
+
readOnly: true;
|
|
1959
|
+
policyHash: string;
|
|
1960
|
+
resolverIdentity: string;
|
|
1961
|
+
compilerIdentity: string;
|
|
1962
|
+
compilerOptionsHash: string;
|
|
1963
|
+
tsconfigHash: string;
|
|
1964
|
+
baseCompilerOptionsHash: string;
|
|
1965
|
+
candidateCompilerOptionsHash: string;
|
|
1966
|
+
baseTsconfigHash: string;
|
|
1967
|
+
candidateTsconfigHash: string;
|
|
1968
|
+
evidenceRequirementsHash: string;
|
|
1969
|
+
baseFactsHash: string;
|
|
1970
|
+
candidateFactsHash: string;
|
|
1971
|
+
baseTreeHash: string;
|
|
1972
|
+
candidateTreeHash: string;
|
|
1973
|
+
baseCompleteness: ResolvedFactsCompleteness;
|
|
1974
|
+
candidateCompleteness: ResolvedFactsCompleteness;
|
|
1975
|
+
baseCompletenessReasons: ResolvedFactsReason[];
|
|
1976
|
+
candidateCompletenessReasons: ResolvedFactsReason[];
|
|
1977
|
+
changeMapHash?: string;
|
|
1978
|
+
convergence?: ArchitectureConvergenceResult;
|
|
1979
|
+
changes: PreparedChangeFile[];
|
|
1980
|
+
violations: ArchitectureEngineViolation[];
|
|
1981
|
+
warnings: ArchitectureEngineViolation[];
|
|
1982
|
+
};
|
|
1983
|
+
type AnalyzePolicyDeltaInput = {
|
|
1984
|
+
baseConfig: unknown;
|
|
1985
|
+
candidateConfig: unknown;
|
|
1986
|
+
acknowledgement?: PolicyDeltaAcknowledgement;
|
|
1987
|
+
baseSource?: string;
|
|
1988
|
+
candidateSource?: string;
|
|
1989
|
+
/** Optional pre-resolved Effective ArkRules for each side (ADR 0012 / AR02). */
|
|
1990
|
+
baseArkRules?: EffectiveArkRules;
|
|
1991
|
+
candidateArkRules?: EffectiveArkRules;
|
|
1992
|
+
/**
|
|
1993
|
+
* AR11 — optional coverage evidence for candidate invariants.
|
|
1994
|
+
* When omitted, advisory→enforced promotion is judgment-required (refuse auto-allow).
|
|
1995
|
+
*/
|
|
1996
|
+
candidateInvariantCoverage?: readonly InvariantCoverageEvidence[];
|
|
1997
|
+
};
|
|
1998
|
+
type PolicyDeltaAnalysis = {
|
|
1999
|
+
schemaVersion: '1.0';
|
|
2000
|
+
basePolicyHash: string;
|
|
2001
|
+
candidatePolicyHash: string;
|
|
2002
|
+
classification: PolicyDeltaClassification;
|
|
2003
|
+
findings: PolicyDeltaFinding[];
|
|
2004
|
+
blockingFindingIds: string[];
|
|
2005
|
+
requiresAcknowledgement: boolean;
|
|
2006
|
+
acknowledged: boolean;
|
|
2007
|
+
valid: boolean;
|
|
2008
|
+
};
|
|
2009
|
+
type ArchitectureEngineViolation = {
|
|
2010
|
+
ruleId: string;
|
|
2011
|
+
message: string;
|
|
2012
|
+
file?: string;
|
|
2013
|
+
line?: number;
|
|
2014
|
+
target?: string;
|
|
2015
|
+
fromLayer?: string;
|
|
2016
|
+
toLayer?: string;
|
|
2017
|
+
nextAction?: string;
|
|
2018
|
+
[key: string]: unknown;
|
|
2019
|
+
};
|
|
2020
|
+
type ArchitectureEngineEdge = {
|
|
2021
|
+
from: string;
|
|
2022
|
+
fromLayer: string | null;
|
|
2023
|
+
to?: string;
|
|
2024
|
+
toLayer?: string;
|
|
2025
|
+
line: number;
|
|
2026
|
+
kind: string;
|
|
2027
|
+
typeOnly?: boolean;
|
|
2028
|
+
targetTypeOnlyExports?: boolean;
|
|
2029
|
+
sourcePureTypeModule?: boolean;
|
|
2030
|
+
namedBindingsTypeOnly?: boolean;
|
|
2031
|
+
portProofEligible?: boolean;
|
|
2032
|
+
};
|
|
2033
|
+
type EvaluateArchitectureGraphInput = {
|
|
2034
|
+
config: ArkConfig;
|
|
2035
|
+
rules: ArkConfig['rules'];
|
|
2036
|
+
files: readonly string[];
|
|
2037
|
+
contentViolations: readonly ArchitectureEngineViolation[];
|
|
2038
|
+
edges: readonly ArchitectureEngineEdge[];
|
|
2039
|
+
warnings?: readonly ArchitectureEngineViolation[];
|
|
2040
|
+
safety?: unknown;
|
|
2041
|
+
};
|
|
2042
|
+
type ArchitectureEngineResult = {
|
|
2043
|
+
violations: ArchitectureEngineViolation[];
|
|
2044
|
+
warnings: ArchitectureEngineViolation[];
|
|
2045
|
+
safety?: unknown;
|
|
2046
|
+
};
|
|
2047
|
+
type PreparedChangeFile = {
|
|
2048
|
+
path: string;
|
|
2049
|
+
operation: 'create' | 'update' | 'delete';
|
|
2050
|
+
beforeContentHash?: string;
|
|
2051
|
+
candidateContentHash?: string;
|
|
2052
|
+
};
|
|
2053
|
+
type ChangePreflightResult = {
|
|
2054
|
+
schemaVersion: '1.0';
|
|
2055
|
+
mode: 'lexical-compatibility';
|
|
2056
|
+
valid: boolean;
|
|
2057
|
+
readOnly: true;
|
|
2058
|
+
policyHash: string;
|
|
2059
|
+
compilerOptionsHash: string;
|
|
2060
|
+
baseTreeHash: string;
|
|
2061
|
+
candidateTreeHash: string;
|
|
2062
|
+
baseCompleteness: ResolvedFactsCompleteness;
|
|
2063
|
+
candidateCompleteness: ResolvedFactsCompleteness;
|
|
2064
|
+
baseCompletenessReasons: ResolvedFactsReason[];
|
|
2065
|
+
candidateCompletenessReasons: ResolvedFactsReason[];
|
|
2066
|
+
changeMapHash?: string;
|
|
2067
|
+
convergence?: ArchitectureConvergenceResult;
|
|
2068
|
+
changes: PreparedChangeFile[];
|
|
2069
|
+
violations: ArchitectureEngineViolation[];
|
|
2070
|
+
warnings: ArchitectureEngineViolation[];
|
|
2071
|
+
};
|
|
2072
|
+
type CollectAnalysisConfigWarningsInput = {
|
|
2073
|
+
config: ArkConfig;
|
|
2074
|
+
rules: ArkConfig['rules'];
|
|
2075
|
+
files: readonly string[];
|
|
2076
|
+
manifest?: {
|
|
2077
|
+
architecture?: {
|
|
2078
|
+
layers?: readonly {
|
|
2079
|
+
name?: string;
|
|
2080
|
+
prefixes?: readonly string[];
|
|
2081
|
+
}[];
|
|
2082
|
+
};
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* Contract loading, project/change analysis, and policy-delta analysis
|
|
2088
|
+
* (U02 pilot 2). Reached through the src/kernel/analysis.ts facade; consumer
|
|
2089
|
+
* import paths never change.
|
|
2090
|
+
*/
|
|
2091
|
+
|
|
2092
|
+
type LoadContractOptions = {
|
|
2093
|
+
/** Pre-resolved Effective ArkRules (from resolveEffectiveContract). */
|
|
2094
|
+
arkRules?: EffectiveArkRules;
|
|
2095
|
+
};
|
|
2096
|
+
declare function loadContract(input: unknown, source?: string, options?: LoadContractOptions): AnalysisContract;
|
|
2097
|
+
declare function analyzePolicyDelta(input: AnalyzePolicyDeltaInput): PolicyDeltaAnalysis;
|
|
2098
|
+
declare function analyzeProject(input: AnalyzeProjectInput): AnalysisResult;
|
|
2099
|
+
declare function analyzeChange(input: AnalyzeChangeInput): AnalysisResult;
|
|
2100
|
+
declare function explainViolation(violation: AnalysisViolation): string;
|
|
2101
|
+
|
|
2102
|
+
declare function detectArchitectureCycles(graph: ReadonlyMap<string, ReadonlySet<string>>): ArchitectureEngineViolation[];
|
|
2103
|
+
/** Canonical graph and layer-policy evaluator shared by library, CLI, and MCP adapters. */
|
|
2104
|
+
declare function evaluateArchitectureGraph(input: EvaluateArchitectureGraphInput): ArchitectureEngineResult;
|
|
2105
|
+
|
|
2106
|
+
/**
|
|
2107
|
+
* Pure evaluation of validated, resolver-supplied candidate facts (ADR 0011).
|
|
2108
|
+
*
|
|
2109
|
+
* Filesystem discovery and TypeScript resolution remain Tooling concerns. This
|
|
2110
|
+
* module only classifies canonical paths against the supplied contract and
|
|
2111
|
+
* produces the one architecture verdict consumed by every resolved adapter.
|
|
2112
|
+
*/
|
|
2113
|
+
|
|
2114
|
+
/** Validate supplied facts and evaluate their graph without host effects. */
|
|
2115
|
+
declare function analyzeResolvedProject(input: AnalyzeResolvedProjectInput): ResolvedAnalysisResult;
|
|
2116
|
+
|
|
2117
|
+
/**
|
|
2118
|
+
* Evaluate one create/update/delete set as a single in-memory candidate.
|
|
2119
|
+
* The function never writes and returns hashes that bind a later host commit to
|
|
2120
|
+
* the exact base, policy, compiler options, and candidate contents it checked.
|
|
2121
|
+
*/
|
|
2122
|
+
declare function preflightChange(input: AnalyzeChangeInput): ChangePreflightResult;
|
|
2123
|
+
|
|
2124
|
+
/**
|
|
2125
|
+
* Validate that the supplied candidate is exactly the declared in-memory
|
|
2126
|
+
* overlay, then return its canonical resolved verdict. No project file is read
|
|
2127
|
+
* or written here.
|
|
2128
|
+
*/
|
|
2129
|
+
declare function preflightResolvedChange(input: PreflightResolvedChangeInput): ResolvedChangePreflightResult;
|
|
2130
|
+
|
|
2131
|
+
/** Canonical config diagnostics over repo-relative file paths. */
|
|
2132
|
+
declare function collectAnalysisConfigWarnings(input: CollectAnalysisConfigWarningsInput): ArchitectureEngineViolation[];
|
|
2133
|
+
|
|
2134
|
+
/** Public, evidence-backed enforcement state shared by doctor adapters. */
|
|
2135
|
+
declare const ARK_ENFORCEMENT_STATE_SCHEMA_VERSION: "1.1";
|
|
2136
|
+
type EnforcementVerification = boolean | 'unverified';
|
|
2137
|
+
type EnforcementEvidenceField = 'configured' | 'installed' | 'active' | 'runtimeObserved' | 'operationCoverage' | 'bypassable' | 'required' | 'hard';
|
|
2138
|
+
type EnforcementEvidence = {
|
|
2139
|
+
field: 'configured' | 'installed' | 'runtimeObserved' | 'hard';
|
|
2140
|
+
source: string;
|
|
2141
|
+
value: boolean;
|
|
2142
|
+
} | {
|
|
2143
|
+
field: 'active' | 'operationCoverage' | 'bypassable' | 'required';
|
|
2144
|
+
source: string;
|
|
2145
|
+
value: EnforcementVerification;
|
|
2146
|
+
};
|
|
2147
|
+
/**
|
|
2148
|
+
* State for one enforcement boundary.
|
|
2149
|
+
*
|
|
2150
|
+
* `configured` records valid wiring, while `installed` requires the referenced
|
|
2151
|
+
* package or executable to resolve. Runtime/provider facts remain
|
|
2152
|
+
* `unverified` until observed; local files never prove `required: true`.
|
|
2153
|
+
*/
|
|
2154
|
+
type EnforcementBoundaryState = {
|
|
2155
|
+
supported: boolean;
|
|
2156
|
+
analyzed: boolean;
|
|
2157
|
+
configured: boolean;
|
|
2158
|
+
installed: boolean;
|
|
2159
|
+
active: EnforcementVerification;
|
|
2160
|
+
runtimeObserved: boolean;
|
|
2161
|
+
operation: string | null;
|
|
2162
|
+
operationCoverage: EnforcementVerification;
|
|
2163
|
+
bypassable: EnforcementVerification;
|
|
2164
|
+
required: EnforcementVerification;
|
|
2165
|
+
hard: boolean;
|
|
2166
|
+
evidence: readonly EnforcementEvidence[];
|
|
2167
|
+
};
|
|
2168
|
+
type ArkEnforcementHost = 'claude' | 'grok' | 'cursor' | 'codex' | 'unknown';
|
|
2169
|
+
type ArkEnforcementState = {
|
|
2170
|
+
schemaVersion: typeof ARK_ENFORCEMENT_STATE_SCHEMA_VERSION;
|
|
2171
|
+
activeHost: ArkEnforcementHost;
|
|
2172
|
+
localWrite: EnforcementBoundaryState;
|
|
2173
|
+
advisoryMcp: EnforcementBoundaryState;
|
|
2174
|
+
ciMerge: EnforcementBoundaryState;
|
|
2175
|
+
};
|
|
2176
|
+
|
|
2177
|
+
/** Public neutral contract for the opt-in new-code design-fitness ratchet. */
|
|
2178
|
+
declare const ARK_DESIGN_DELTA_SCHEMA_VERSION: "1.0";
|
|
2179
|
+
type DesignSmellId = 'io-under-application' | 'handler-in-persistence' | 'god-module' | 'domain-logic-in-ui' | 'facade-sql-in-routes' | 'mixed-pattern-cluster' | 'soft-contract';
|
|
2180
|
+
type DesignDeltaIdentity = {
|
|
2181
|
+
kind: 'git-tree' | 'candidate-tree';
|
|
2182
|
+
value: string;
|
|
2183
|
+
commit?: string;
|
|
2184
|
+
};
|
|
2185
|
+
type DesignSmellEvidence = {
|
|
2186
|
+
kind: string;
|
|
2187
|
+
path: string;
|
|
2188
|
+
line?: number;
|
|
2189
|
+
symbol?: string;
|
|
2190
|
+
detail?: string;
|
|
2191
|
+
magnitude: number;
|
|
2192
|
+
};
|
|
2193
|
+
type DesignSmellFinding = {
|
|
2194
|
+
smellId: DesignSmellId;
|
|
2195
|
+
fingerprint: string;
|
|
2196
|
+
identity: string;
|
|
2197
|
+
evidence: DesignSmellEvidence;
|
|
2198
|
+
repairHint: string;
|
|
2199
|
+
};
|
|
2200
|
+
type DesignDeltaChange = DesignSmellFinding & {
|
|
2201
|
+
classification: 'new' | 'worsened';
|
|
2202
|
+
baseMagnitude: number;
|
|
2203
|
+
candidateMagnitude: number;
|
|
2204
|
+
};
|
|
2205
|
+
/** Created-path merge vs full new+worsened ratchet (Z10). Omitted on older producers. */
|
|
2206
|
+
type DesignDeltaEnforcementScope = 'created-paths' | 'touched-new-or-worsened';
|
|
2207
|
+
type ArkDesignDeltaResult = {
|
|
2208
|
+
schemaVersion: typeof ARK_DESIGN_DELTA_SCHEMA_VERSION;
|
|
2209
|
+
mode: 'git-base' | 'write-candidate';
|
|
2210
|
+
complete: boolean;
|
|
2211
|
+
valid: boolean;
|
|
2212
|
+
base: DesignDeltaIdentity;
|
|
2213
|
+
candidate: DesignDeltaIdentity;
|
|
2214
|
+
supportedSmellIds: readonly DesignSmellId[];
|
|
2215
|
+
touchedPaths: readonly string[];
|
|
2216
|
+
changes: readonly DesignDeltaChange[];
|
|
2217
|
+
baseFindingCount: number;
|
|
2218
|
+
candidateFindingCount: number;
|
|
2219
|
+
historicalResidualCount: number;
|
|
2220
|
+
enforcementScope?: DesignDeltaEnforcementScope;
|
|
2221
|
+
error?: string;
|
|
2222
|
+
};
|
|
2223
|
+
|
|
2224
|
+
/**
|
|
2225
|
+
* Public diagnostic code catalog (ACS02).
|
|
2226
|
+
*
|
|
2227
|
+
* Closed vocabulary of stable `ruleId` values emitted by ArkGate adapters with
|
|
2228
|
+
* human/agent `why` / `fix` anchors and docs fragment ids. Cataloguing only —
|
|
2229
|
+
* no new rule semantics, no LLM verdict, no enforcement from prose.
|
|
2230
|
+
*
|
|
2231
|
+
* **Canonical** for docs, agent projection (ACS04), and finding refs (ACS06).
|
|
2232
|
+
* Runtime remediation remains in `remediation.ts`; parity tests bind the two.
|
|
2233
|
+
*
|
|
2234
|
+
* Zero Node I/O. Optional CLI surface: generated `bin/lib/diagnostic-catalog.mjs`.
|
|
2235
|
+
*
|
|
2236
|
+
* @see docs/diagnostics.md
|
|
2237
|
+
* @see docs/plans/agent-contract-surface-4.3/README.md
|
|
2238
|
+
*/
|
|
2239
|
+
/** Product-relative docs path (shipped in the npm tarball when listed in package files). */
|
|
2240
|
+
declare const DIAGNOSTIC_DOCS_RELATIVE_PATH: "docs/diagnostics.md";
|
|
2241
|
+
/** Schema id for serializing the catalog snapshot (agents / install projection). */
|
|
2242
|
+
declare const DIAGNOSTIC_CATALOG_SCHEMA_VERSION: "1.0";
|
|
2243
|
+
type DiagnosticCategory = 'layer' | 'capability' | 'publish' | 'safety' | 'arkrules' | 'arkrun' | 'arkorder' | 'preflight' | 'analysis' | 'snippet-policy' | 'config' | 'adapter' | 'meta';
|
|
2244
|
+
type DiagnosticCatalogEntry = {
|
|
2245
|
+
/** Stable public violation / diagnostic id. */
|
|
2246
|
+
ruleId: string;
|
|
2247
|
+
/** Short title for indexes and agent projection. */
|
|
2248
|
+
title: string;
|
|
2249
|
+
/** Why this finding exists (contract intent). */
|
|
2250
|
+
why: string;
|
|
2251
|
+
/**
|
|
2252
|
+
* Canonical fix guidance (agent + human). Contextual nextAction on live
|
|
2253
|
+
* findings may specialize this (e.g. type-only vs value layer import).
|
|
2254
|
+
*/
|
|
2255
|
+
fix: string;
|
|
2256
|
+
/** Markdown fragment id for docs/diagnostics.md (without leading #). */
|
|
2257
|
+
docsAnchor: string;
|
|
2258
|
+
category: DiagnosticCategory;
|
|
2259
|
+
/**
|
|
2260
|
+
* When true, finding is commonly advisory / non-blocking in default profiles
|
|
2261
|
+
* (doctor/config warnings, type-only placement debt, empty ArkRule scope).
|
|
2262
|
+
* Not a severity bit for the engine — documentation only.
|
|
2263
|
+
*/
|
|
2264
|
+
oftenAdvisory?: boolean;
|
|
2265
|
+
};
|
|
2266
|
+
/**
|
|
2267
|
+
* Closed public catalog. Order is stable (category groups, then ruleId) for
|
|
2268
|
+
* deterministic serialization and docs generation.
|
|
2269
|
+
*
|
|
2270
|
+
* Every production-emitted `ruleId` must appear here. Remediation switch cases
|
|
2271
|
+
* and adapter nextAction branches are parity-tested against this list.
|
|
2272
|
+
*/
|
|
2273
|
+
declare const DIAGNOSTIC_CATALOG: readonly DiagnosticCatalogEntry[];
|
|
2274
|
+
/** All public ruleIds in catalog order. */
|
|
2275
|
+
declare const DIAGNOSTIC_RULE_IDS: readonly string[];
|
|
2276
|
+
declare function isKnownDiagnosticCode(ruleId: string | null | undefined): boolean;
|
|
2277
|
+
/**
|
|
2278
|
+
* True when the code is catalogued or is an ArkRule-family id handled by the
|
|
2279
|
+
* ARKRULE_* prefix fallback in remediation (structure sensors may add members later
|
|
2280
|
+
* only via catalog + ROADMAP — prefix alone is not a license for free-form ids).
|
|
2281
|
+
*/
|
|
2282
|
+
declare function isCataloguedOrArkRuleFamily(ruleId: string | null | undefined): boolean;
|
|
2283
|
+
declare function getDiagnosticCatalogEntry(ruleId: string | null | undefined): DiagnosticCatalogEntry | undefined;
|
|
2284
|
+
/** Fragment for docs links, e.g. `#LAYER_IMPORT_VIOLATION`. */
|
|
2285
|
+
declare function diagnosticDocsFragment(ruleId: string): string;
|
|
2286
|
+
/**
|
|
2287
|
+
* Repo-relative docs path with fragment (for agents and JSON).
|
|
2288
|
+
* Package consumers resolve against the installed package root or GitHub tree.
|
|
2289
|
+
*/
|
|
2290
|
+
declare function diagnosticDocsPath(ruleId: string): string;
|
|
2291
|
+
/** Catalog snapshot for JSON export / agent projection (stable field order). */
|
|
2292
|
+
declare function serializeDiagnosticCatalog(): {
|
|
2293
|
+
schemaVersion: typeof DIAGNOSTIC_CATALOG_SCHEMA_VERSION;
|
|
2294
|
+
docsPath: typeof DIAGNOSTIC_DOCS_RELATIVE_PATH;
|
|
2295
|
+
codes: readonly DiagnosticCatalogEntry[];
|
|
2296
|
+
};
|
|
2297
|
+
/**
|
|
2298
|
+
* Static catalog fix for a ruleId when no live violation context is available.
|
|
2299
|
+
* Live adapters should still use deterministicNextAction for specialized edges.
|
|
2300
|
+
*/
|
|
2301
|
+
declare function catalogFixForRuleId(ruleId: string | null | undefined): string | undefined;
|
|
2302
|
+
/**
|
|
2303
|
+
* Static catalog why for a ruleId (agent “why” surface).
|
|
2304
|
+
*/
|
|
2305
|
+
declare function catalogWhyForRuleId(ruleId: string | null | undefined): string | undefined;
|
|
2306
|
+
|
|
2307
|
+
export { type ArchitectureConvergenceClassification as $, type ArkRulesFile as A, type AnalysisCapabilityUse as B, type AnalysisCompilerOptions as C, type AnalysisCompleteness as D, type EffectiveArkRules as E, type AnalysisContract as F, type AnalysisEvidence as G, type AnalysisFile as H, type AnalysisFileChange as I, type AnalysisFileInput as J, type AnalysisImportEdge as K, type AnalysisIr as L, type AnalysisMode as M, type AnalysisResult as N, type AnalysisViolation as O, type AnalyzeArchitectureConvergenceInput as P, type AnalyzeChangeInput as Q, type ResolvedArkRunKernelCallKind as R, type AnalyzePolicyDeltaInput as S, type AnalyzeProjectInput as T, type AnalyzeResolvedProjectInput as U, type ArchitectureActualChange as V, type ArchitectureChangeMap as W, type ArchitectureChangeMapContract as X, type ArchitectureChangeMapDependency as Y, type ArchitectureChangeMapFile as Z, type ArchitectureChangeOperation as _, type ResolvedArkRunDeclarationFact as a, adapterFindingOccurrenceTargetKeys as a$, type ArchitectureConvergenceFinding as a0, type ArchitectureConvergenceResult as a1, type ArchitectureDependency as a2, type ArchitectureEngineEdge as a3, type ArchitectureEngineResult as a4, type ArchitectureEngineViolation as a5, type ArkDesignDeltaResult as a6, type ArkEnforcementHost as a7, type ArkEnforcementState as a8, type ArkRuleSensorViolation as a9, type PolicyDeltaClassification as aA, type PolicyDeltaFinding as aB, type PreflightResolvedChangeInput as aC, type PreparedChangeFile as aD, RESOLVED_CANDIDATE_FACTS_SCHEMA as aE, RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION as aF, type ResolvedAmbientFact as aG, type ResolvedAnalysisFile as aH, type ResolvedAnalysisIr as aI, type ResolvedAnalysisResult as aJ, type ResolvedCandidateFacts as aK, type ResolvedCandidateFactsInput as aL, type ResolvedCapability as aM, type ResolvedCapabilityFact as aN, type ResolvedChangePreflightResult as aO, type ResolvedDependencyKind as aP, type ResolvedDependencyState as aQ, type ResolvedFactsCompleteness as aR, type ResolvedFileFact as aS, type ResolvedIntentReferenceFact as aT, type ResolvedPublishFact as aU, type ResolvedSafetyFact as aV, type ResolvedSafetyKind as aW, type ResolvedSafetyReport as aX, type SemanticDependency as aY, type SemanticDependencyKind as aZ, adapterDocsCodePath as a_, type ChangePreflightResult as aa, type ClassShapeFact as ab, type CollectAnalysisConfigWarningsInput as ac, DIAGNOSTIC_CATALOG as ad, DIAGNOSTIC_CATALOG_SCHEMA_VERSION as ae, DIAGNOSTIC_DOCS_RELATIVE_PATH as af, DIAGNOSTIC_RULE_IDS as ag, type DesignDeltaChange as ah, type DesignDeltaEnforcementScope as ai, type DesignDeltaIdentity as aj, type DesignSmellEvidence as ak, type DesignSmellFinding as al, type DesignSmellId as am, type DiagnosticCatalogEntry as an, type DiagnosticCategory as ao, type EnforcementBoundaryState as ap, type EnforcementEvidence as aq, type EnforcementEvidenceField as ar, type EnforcementVerification as as, type EvaluateArchitectureGraphInput as at, type ForbiddenCapabilityUse as au, type InvariantCoverageEvidence as av, POLICY_DELTA_SCHEMA_VERSION as aw, type PolicyDelta as ax, type PolicyDeltaAcknowledgement as ay, type PolicyDeltaAnalysis as az, type ResolvedArkRunKernelCallFact as b, adapterFindingRefFromTargetKey as b0, adapterFindingTargetKey as b1, analyzeArchitectureConvergence as b2, analyzeChange as b3, analyzePolicyDelta as b4, analyzeProject as b5, analyzeResolvedProject as b6, buildArkRuleFileHints as b7, canPromoteInvariant as b8, catalogFixForRuleId as b9, loadContract as bA, loadResolvedCandidateFacts as bB, policyDeltaAcknowledgementMatches as bC, preflightChange as bD, preflightResolvedChange as bE, resolvedFactsEvidenceRequirementsHash as bF, serializeDiagnosticCatalog as bG, stableSerialize as bH, toAdapterDiagnostic as bI, version as bJ, catalogWhyForRuleId as ba, classifyArkPolicyDelta as bb, collectAnalysisConfigWarnings as bc, collectEmptyAppliesToFindings as bd, collectForbiddenCapabilityUses as be, createAICodeGate as bf, createAdapterResult as bg, createArchitectureProfile as bh, createArchitectureProfileFromArkConfig as bi, createElevenLayerArkConfig as bj, createResolvedCandidateFacts as bk, deriveArkRuleFileHints as bl, detectArchitectureCycles as bm, deterministicHash as bn, diagnosticDocsFragment as bo, diagnosticDocsPath as bp, elevenLayerProfile as bq, evaluateArchitectureGraph as br, evaluateArkRuleSensors as bs, evaluateInvariantCoverage as bt, explainViolation as bu, extractClassShapesFromSource as bv, extractSemanticDependencies as bw, getDiagnosticCatalogEntry as bx, isCataloguedOrArkRuleFamily as by, isKnownDiagnosticCode as bz, type ResolvedArkRunManagedNewFact as c, type ResolvedDependencyFact as d, type ResolvedArkRunCompositionRootHitFact as e, type ResolvedFactsReason as f, type ResolvedArkOrderPlaneCallFact as g, type ResolvedArkOrderGenericUpdateFact as h, type ResolvedArkOrderRootHitFact as i, ADAPTER_DIAGNOSTIC_DOCS_RELATIVE_PATH as j, type AICodeGate as k, type AICodeGateContext as l, type AICodeGateOptions as m, type AICodeGateResult as n, type AICodeGateViolation as o, type AIGateExtension as p, ANALYSIS_IR_SCHEMA_VERSION as q, ARK_ANALYSIS_RESULT_SCHEMA as r, ARK_ANALYSIS_RESULT_SCHEMA_VERSION as s, ARK_DESIGN_DELTA_SCHEMA_VERSION as t, ARK_ENFORCEMENT_STATE_SCHEMA_VERSION as u, type AdapterCompletenessReason as v, type AdapterDiagnostic as w, type AdapterResult as x, type AdapterSeverity as y, type AdapterViolationInput as z };
|