@neurcode-ai/contracts 0.1.2 → 0.1.3
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/dist/admission/framing.d.ts +38 -0
- package/dist/admission/framing.d.ts.map +1 -0
- package/dist/admission/framing.js +78 -0
- package/dist/admission/framing.js.map +1 -0
- package/dist/admission/index.d.ts +4 -0
- package/dist/admission/index.d.ts.map +1 -0
- package/dist/admission/index.js +37 -0
- package/dist/admission/index.js.map +1 -0
- package/dist/admission/privacy.d.ts +23 -0
- package/dist/admission/privacy.d.ts.map +1 -0
- package/dist/admission/privacy.js +99 -0
- package/dist/admission/privacy.js.map +1 -0
- package/dist/admission/schema.d.ts +277 -0
- package/dist/admission/schema.d.ts.map +1 -0
- package/dist/admission/schema.js +156 -0
- package/dist/admission/schema.js.map +1 -0
- package/dist/index.d.ts +91 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +182 -17
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +522 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +5 -0
- package/dist/intelligence.js.map +1 -0
- package/dist/remediation/capabilities.d.ts +36 -0
- package/dist/remediation/capabilities.d.ts.map +1 -0
- package/dist/remediation/capabilities.js +7 -0
- package/dist/remediation/capabilities.js.map +1 -0
- package/dist/remediation/index.d.ts +5 -0
- package/dist/remediation/index.d.ts.map +1 -0
- package/dist/remediation/index.js +3 -0
- package/dist/remediation/index.js.map +1 -0
- package/dist/remediation/request.d.ts +183 -0
- package/dist/remediation/request.d.ts.map +1 -0
- package/dist/remediation/request.js +15 -0
- package/dist/remediation/request.js.map +1 -0
- package/dist/remediation/response.d.ts +100 -0
- package/dist/remediation/response.d.ts.map +1 -0
- package/dist/remediation/response.js +11 -0
- package/dist/remediation/response.js.map +1 -0
- package/dist/remediation/validation.d.ts +87 -0
- package/dist/remediation/validation.d.ts.map +1 -0
- package/dist/remediation/validation.js +15 -0
- package/dist/remediation/validation.js.map +1 -0
- package/dist/status-vocabulary.d.ts +45 -0
- package/dist/status-vocabulary.d.ts.map +1 -0
- package/dist/status-vocabulary.js +101 -0
- package/dist/status-vocabulary.js.map +1 -0
- package/dist/verification/canonical-finding.d.ts +171 -0
- package/dist/verification/canonical-finding.d.ts.map +1 -0
- package/dist/verification/canonical-finding.js +3 -0
- package/dist/verification/canonical-finding.js.map +1 -0
- package/dist/verification/index.d.ts +6 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +11 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/pipeline.d.ts +134 -0
- package/dist/verification/pipeline.d.ts.map +1 -0
- package/dist/verification/pipeline.js +57 -0
- package/dist/verification/pipeline.js.map +1 -0
- package/dist/verification/taxonomy.d.ts +10 -0
- package/dist/verification/taxonomy.d.ts.map +1 -0
- package/dist/verification/taxonomy.js +16 -0
- package/dist/verification/taxonomy.js.map +1 -0
- package/package.json +1 -1
- package/src/admission/admission-framing.test.ts +93 -0
- package/src/admission/framing.ts +78 -0
- package/src/admission/index.ts +58 -0
- package/src/admission/privacy.ts +93 -0
- package/src/admission/schema.ts +392 -0
- package/src/index.ts +266 -26
- package/src/intelligence.ts +698 -0
- package/src/remediation/capabilities.ts +53 -0
- package/src/remediation/index.ts +29 -0
- package/src/remediation/request.ts +236 -0
- package/src/remediation/response.ts +129 -0
- package/src/remediation/validation.ts +109 -0
- package/src/status-vocabulary.ts +125 -0
- package/src/verification/canonical-finding.ts +196 -0
- package/src/verification/index.ts +41 -0
- package/src/verification/pipeline.ts +199 -0
- package/src/verification/taxonomy.ts +46 -0
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
export const ENGINEERING_INTELLIGENCE_SCHEMA_VERSION = 1 as const;
|
|
2
|
+
|
|
3
|
+
export type RepositoryIntelligenceNodeType =
|
|
4
|
+
| 'repository'
|
|
5
|
+
| 'module'
|
|
6
|
+
| 'service'
|
|
7
|
+
| 'file'
|
|
8
|
+
| 'manifest'
|
|
9
|
+
| 'boundary'
|
|
10
|
+
| 'external-repo';
|
|
11
|
+
|
|
12
|
+
export type RepositoryIntelligenceEdgeType =
|
|
13
|
+
| 'contains'
|
|
14
|
+
| 'imports'
|
|
15
|
+
| 'depends-on'
|
|
16
|
+
| 'crosses-boundary'
|
|
17
|
+
| 'cross-repo';
|
|
18
|
+
|
|
19
|
+
export type RepositoryIntelligenceConfidence = 'high' | 'medium' | 'low';
|
|
20
|
+
|
|
21
|
+
export interface RepositoryIntelligenceNode {
|
|
22
|
+
id: string;
|
|
23
|
+
type: RepositoryIntelligenceNodeType;
|
|
24
|
+
label: string;
|
|
25
|
+
path?: string | null;
|
|
26
|
+
category?: string | null;
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface RepositoryIntelligenceEdge {
|
|
31
|
+
from: string;
|
|
32
|
+
to: string;
|
|
33
|
+
type: RepositoryIntelligenceEdgeType;
|
|
34
|
+
confidence?: RepositoryIntelligenceConfidence;
|
|
35
|
+
evidence?: string | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type SemanticOwnershipKind =
|
|
39
|
+
| 'auth'
|
|
40
|
+
| 'payment'
|
|
41
|
+
| 'notification'
|
|
42
|
+
| 'api'
|
|
43
|
+
| 'ui'
|
|
44
|
+
| 'worker'
|
|
45
|
+
| 'shared'
|
|
46
|
+
| 'data'
|
|
47
|
+
| 'infra'
|
|
48
|
+
| 'ci'
|
|
49
|
+
| 'deployment'
|
|
50
|
+
| 'service'
|
|
51
|
+
| 'repository';
|
|
52
|
+
|
|
53
|
+
export interface RepositoryOwnershipBoundary {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
path: string;
|
|
57
|
+
kind: SemanticOwnershipKind;
|
|
58
|
+
domain: string;
|
|
59
|
+
stewardship: {
|
|
60
|
+
primaryOwner: string;
|
|
61
|
+
codeOwners: string[];
|
|
62
|
+
};
|
|
63
|
+
responsibilities: string[];
|
|
64
|
+
forbiddenResponsibilities: string[];
|
|
65
|
+
criticality: 'standard' | 'sensitive' | 'critical';
|
|
66
|
+
confidence: RepositoryIntelligenceConfidence;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type RepositorySemanticContractKind =
|
|
70
|
+
| 'service-contract'
|
|
71
|
+
| 'layering'
|
|
72
|
+
| 'dependency-direction'
|
|
73
|
+
| 'ownership'
|
|
74
|
+
| 'runtime-boundary'
|
|
75
|
+
| 'deployment-boundary';
|
|
76
|
+
|
|
77
|
+
export interface RepositorySemanticContract {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
kind: RepositorySemanticContractKind;
|
|
81
|
+
boundaryId: string | null;
|
|
82
|
+
boundaryName: string | null;
|
|
83
|
+
subjectPath: string;
|
|
84
|
+
expectedResponsibilities: string[];
|
|
85
|
+
forbiddenResponsibilities: string[];
|
|
86
|
+
allowedDependencyKinds: string[];
|
|
87
|
+
forbiddenDependencyKinds: string[];
|
|
88
|
+
rationale: string;
|
|
89
|
+
evidence: string[];
|
|
90
|
+
confidence: RepositoryIntelligenceConfidence;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type RepositoryArchitecturalInvariantCategory =
|
|
94
|
+
| 'layering'
|
|
95
|
+
| 'ownership'
|
|
96
|
+
| 'runtime'
|
|
97
|
+
| 'dependency'
|
|
98
|
+
| 'deployment'
|
|
99
|
+
| 'service-responsibility';
|
|
100
|
+
|
|
101
|
+
export interface RepositoryArchitecturalInvariant {
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
category: RepositoryArchitecturalInvariantCategory;
|
|
105
|
+
scope: 'repository' | 'service' | 'module';
|
|
106
|
+
subjectPath: string;
|
|
107
|
+
boundaryId: string | null;
|
|
108
|
+
boundaryName: string | null;
|
|
109
|
+
expectation: string;
|
|
110
|
+
impact: 'low' | 'medium' | 'high' | 'critical';
|
|
111
|
+
rationale: string;
|
|
112
|
+
relatedContractIds: string[];
|
|
113
|
+
evidence: string[];
|
|
114
|
+
confidence: RepositoryIntelligenceConfidence;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type RepositoryRuntimeBehaviorKind =
|
|
118
|
+
| 'api-provider'
|
|
119
|
+
| 'api-consumer'
|
|
120
|
+
| 'event-producer'
|
|
121
|
+
| 'event-consumer'
|
|
122
|
+
| 'state-owner'
|
|
123
|
+
| 'state-mutator'
|
|
124
|
+
| 'workflow-orchestrator'
|
|
125
|
+
| 'external-side-effect'
|
|
126
|
+
| 'deployment-aware'
|
|
127
|
+
| 'runtime-config-consumer';
|
|
128
|
+
|
|
129
|
+
export interface RepositoryRuntimeBehaviorProfile {
|
|
130
|
+
boundaryId: string;
|
|
131
|
+
boundaryName: string;
|
|
132
|
+
domain: string;
|
|
133
|
+
behaviorKinds: RepositoryRuntimeBehaviorKind[];
|
|
134
|
+
sideEffectKinds: string[];
|
|
135
|
+
externalDependencies: string[];
|
|
136
|
+
stateSurfaces: string[];
|
|
137
|
+
rolloutUnits: string[];
|
|
138
|
+
runtimeEnvironments: string[];
|
|
139
|
+
criticalFlows: string[];
|
|
140
|
+
confidence: RepositoryIntelligenceConfidence;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type RepositoryRuntimeInteractionKind =
|
|
144
|
+
| 'api-call'
|
|
145
|
+
| 'event-flow'
|
|
146
|
+
| 'state-access'
|
|
147
|
+
| 'state-mutation'
|
|
148
|
+
| 'deployment-dependency'
|
|
149
|
+
| 'operational-coupling';
|
|
150
|
+
|
|
151
|
+
export interface RepositoryRuntimeInteraction {
|
|
152
|
+
id: string;
|
|
153
|
+
kind: RepositoryRuntimeInteractionKind;
|
|
154
|
+
fromBoundaryId: string;
|
|
155
|
+
fromBoundaryName: string;
|
|
156
|
+
toBoundaryId: string | null;
|
|
157
|
+
toBoundaryName: string | null;
|
|
158
|
+
subject: string;
|
|
159
|
+
rationale: string;
|
|
160
|
+
confidence: RepositoryIntelligenceConfidence;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface RepositoryDeploymentBoundary {
|
|
164
|
+
id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
path: string;
|
|
167
|
+
type: 'kubernetes' | 'helm' | 'terraform' | 'docker' | 'ci' | 'manifest';
|
|
168
|
+
rolloutUnits: string[];
|
|
169
|
+
runtimeEnvironments: string[];
|
|
170
|
+
dependentBoundaryIds: string[];
|
|
171
|
+
dependentBoundaryNames: string[];
|
|
172
|
+
confidence: RepositoryIntelligenceConfidence;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface RepositoryRuntimeSemanticModel {
|
|
176
|
+
behaviorProfiles: RepositoryRuntimeBehaviorProfile[];
|
|
177
|
+
interactions: RepositoryRuntimeInteraction[];
|
|
178
|
+
deploymentBoundaries: RepositoryDeploymentBoundary[];
|
|
179
|
+
criticalFlows: string[];
|
|
180
|
+
blindSpots: string[];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface RepositorySemanticModel {
|
|
184
|
+
ownershipBoundaries: RepositoryOwnershipBoundary[];
|
|
185
|
+
contracts: RepositorySemanticContract[];
|
|
186
|
+
invariants: RepositoryArchitecturalInvariant[];
|
|
187
|
+
criticalDomains: string[];
|
|
188
|
+
runtime: RepositoryRuntimeSemanticModel;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface RepositoryIntelligenceGraph {
|
|
192
|
+
schemaVersion: typeof ENGINEERING_INTELLIGENCE_SCHEMA_VERSION;
|
|
193
|
+
graphId: string;
|
|
194
|
+
generatedAt: string;
|
|
195
|
+
repository: {
|
|
196
|
+
name: string;
|
|
197
|
+
rootPath: string;
|
|
198
|
+
branchName: string | null;
|
|
199
|
+
headSha: string | null;
|
|
200
|
+
workspaceId: string | null;
|
|
201
|
+
};
|
|
202
|
+
summary: {
|
|
203
|
+
scannedSourceFiles: number;
|
|
204
|
+
moduleCount: number;
|
|
205
|
+
serviceCount: number;
|
|
206
|
+
importEdges: number;
|
|
207
|
+
crossModuleEdges: number;
|
|
208
|
+
sensitiveBoundaryCount: number;
|
|
209
|
+
manifestCount: number;
|
|
210
|
+
crossRepoEdgeCount: number;
|
|
211
|
+
ownershipBoundaryCount: number;
|
|
212
|
+
semanticContractCount: number;
|
|
213
|
+
invariantCount: number;
|
|
214
|
+
runtimeBehaviorCount: number;
|
|
215
|
+
runtimeInteractionCount: number;
|
|
216
|
+
deploymentBoundaryCount: number;
|
|
217
|
+
};
|
|
218
|
+
nodes: RepositoryIntelligenceNode[];
|
|
219
|
+
edges: RepositoryIntelligenceEdge[];
|
|
220
|
+
boundaries: {
|
|
221
|
+
sensitivePaths: string[];
|
|
222
|
+
infraPaths: string[];
|
|
223
|
+
ciPaths: string[];
|
|
224
|
+
dependencyManifests: string[];
|
|
225
|
+
};
|
|
226
|
+
semantic: RepositorySemanticModel;
|
|
227
|
+
blindSpots: string[];
|
|
228
|
+
fingerprint: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface IntentPackBoundaryExpectation {
|
|
232
|
+
type:
|
|
233
|
+
| 'sensitive'
|
|
234
|
+
| 'infra'
|
|
235
|
+
| 'ci'
|
|
236
|
+
| 'dependency-manifest'
|
|
237
|
+
| 'service'
|
|
238
|
+
| 'module';
|
|
239
|
+
path: string;
|
|
240
|
+
policy: 'allowed' | 'review-required' | 'forbidden';
|
|
241
|
+
reason: string;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface IntentPackCheckpoint {
|
|
245
|
+
id: string;
|
|
246
|
+
label: string;
|
|
247
|
+
rationale: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface IntentPack {
|
|
251
|
+
schemaVersion: typeof ENGINEERING_INTELLIGENCE_SCHEMA_VERSION;
|
|
252
|
+
intentPackId: string;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
updatedAt: string;
|
|
255
|
+
intent: {
|
|
256
|
+
raw: string;
|
|
257
|
+
normalized: string;
|
|
258
|
+
};
|
|
259
|
+
governanceContext: {
|
|
260
|
+
repoName: string;
|
|
261
|
+
projectRoot: string;
|
|
262
|
+
branchName: string | null;
|
|
263
|
+
headSha: string | null;
|
|
264
|
+
orgId: string | null;
|
|
265
|
+
projectId: string | null;
|
|
266
|
+
};
|
|
267
|
+
approvedScope: {
|
|
268
|
+
files: string[];
|
|
269
|
+
modules: string[];
|
|
270
|
+
services: string[];
|
|
271
|
+
};
|
|
272
|
+
forbiddenBoundaries: IntentPackBoundaryExpectation[];
|
|
273
|
+
expectedDependencies: string[];
|
|
274
|
+
expectedInfrastructure: string[];
|
|
275
|
+
expectedBlastRadius: {
|
|
276
|
+
level: 'low' | 'medium' | 'high';
|
|
277
|
+
rationale: string;
|
|
278
|
+
expectedFiles: string[];
|
|
279
|
+
};
|
|
280
|
+
checkpoints: IntentPackCheckpoint[];
|
|
281
|
+
rolloutExpectations: string[];
|
|
282
|
+
governanceExpectations: string[];
|
|
283
|
+
constraints: string[];
|
|
284
|
+
detectedSignals: string[];
|
|
285
|
+
semanticExpectations: {
|
|
286
|
+
ownershipBoundaries: string[];
|
|
287
|
+
contractIds: string[];
|
|
288
|
+
invariantIds: string[];
|
|
289
|
+
expectedResponsibilities: string[];
|
|
290
|
+
expectedBehaviorKinds: string[];
|
|
291
|
+
expectedRuntimeFlows: string[];
|
|
292
|
+
expectedRolloutUnits: string[];
|
|
293
|
+
};
|
|
294
|
+
contextHints: {
|
|
295
|
+
suggestedFiles: string[];
|
|
296
|
+
confidence: number;
|
|
297
|
+
};
|
|
298
|
+
repositoryGraphId: string | null;
|
|
299
|
+
fingerprint: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export type ContextPackSource =
|
|
303
|
+
| 'context-engine'
|
|
304
|
+
| 'brain-context'
|
|
305
|
+
| 'static-context'
|
|
306
|
+
| 'repository-intelligence'
|
|
307
|
+
| 'workspace-federation';
|
|
308
|
+
|
|
309
|
+
export interface ContextPackFileSelection {
|
|
310
|
+
path: string;
|
|
311
|
+
confidence: number;
|
|
312
|
+
source: ContextPackSource;
|
|
313
|
+
reasons: string[];
|
|
314
|
+
summary?: string | null;
|
|
315
|
+
symbols?: string[];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface ContextPackServiceBoundary {
|
|
319
|
+
name: string;
|
|
320
|
+
path: string;
|
|
321
|
+
kind: 'service' | 'module' | 'infra' | 'api' | 'ui' | 'worker' | 'shared';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export interface ContextPack {
|
|
325
|
+
schemaVersion: typeof ENGINEERING_INTELLIGENCE_SCHEMA_VERSION;
|
|
326
|
+
contextPackId: string;
|
|
327
|
+
createdAt: string;
|
|
328
|
+
intentPackId: string;
|
|
329
|
+
repositoryGraphId: string;
|
|
330
|
+
compiler: {
|
|
331
|
+
mode: 'deterministic-bounded';
|
|
332
|
+
sources: ContextPackSource[];
|
|
333
|
+
precisionBudget: {
|
|
334
|
+
maxSuggestedFiles: number;
|
|
335
|
+
maxBrainMatches: number;
|
|
336
|
+
maxStaticContextBytes: number;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
selectedFiles: ContextPackFileSelection[];
|
|
340
|
+
relatedModules: string[];
|
|
341
|
+
serviceBoundaries: ContextPackServiceBoundary[];
|
|
342
|
+
dependencyManifests: string[];
|
|
343
|
+
infraBoundaries: string[];
|
|
344
|
+
staticContext: {
|
|
345
|
+
hash: string | null;
|
|
346
|
+
sourceCount: number;
|
|
347
|
+
};
|
|
348
|
+
brainContext: {
|
|
349
|
+
scopeFound: boolean;
|
|
350
|
+
fileEntries: number;
|
|
351
|
+
eventEntries: number;
|
|
352
|
+
matchedEntries: number;
|
|
353
|
+
};
|
|
354
|
+
advisory: {
|
|
355
|
+
blindSpots: string[];
|
|
356
|
+
rationale: string[];
|
|
357
|
+
};
|
|
358
|
+
fingerprint: string;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface SessionContinuitySnapshot {
|
|
362
|
+
sessionId: string;
|
|
363
|
+
createdAt: string;
|
|
364
|
+
branchName: string | null;
|
|
365
|
+
headSha: string | null;
|
|
366
|
+
intentPackId: string;
|
|
367
|
+
contextPackId: string;
|
|
368
|
+
repositoryGraphId: string;
|
|
369
|
+
invariantMemoryId?: string | null;
|
|
370
|
+
intentSummary: string;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export interface SessionContinuityRuntime {
|
|
374
|
+
schemaVersion: typeof ENGINEERING_INTELLIGENCE_SCHEMA_VERSION;
|
|
375
|
+
sessionId: string;
|
|
376
|
+
status: 'active' | 'archived';
|
|
377
|
+
createdAt: string;
|
|
378
|
+
updatedAt: string;
|
|
379
|
+
repoRoot: string;
|
|
380
|
+
branchName: string | null;
|
|
381
|
+
headSha: string | null;
|
|
382
|
+
orgId: string | null;
|
|
383
|
+
projectId: string | null;
|
|
384
|
+
intentPackId: string;
|
|
385
|
+
contextPackId: string;
|
|
386
|
+
repositoryGraphId: string;
|
|
387
|
+
invariantMemoryId: string | null;
|
|
388
|
+
planPath: string | null;
|
|
389
|
+
artifactPaths: {
|
|
390
|
+
intentPack: string;
|
|
391
|
+
contextPack: string;
|
|
392
|
+
repositoryGraph: string;
|
|
393
|
+
invariantMemory: string | null;
|
|
394
|
+
plan: string | null;
|
|
395
|
+
};
|
|
396
|
+
brainContext: {
|
|
397
|
+
path: string;
|
|
398
|
+
scopeFound: boolean;
|
|
399
|
+
fileEntries: number;
|
|
400
|
+
eventEntries: number;
|
|
401
|
+
lastUpdatedAt?: string;
|
|
402
|
+
lastRefreshAt?: string;
|
|
403
|
+
};
|
|
404
|
+
continuity: {
|
|
405
|
+
previousSessionId: string | null;
|
|
406
|
+
lineage: string[];
|
|
407
|
+
warnings: string[];
|
|
408
|
+
};
|
|
409
|
+
fingerprint: string;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export interface SessionContinuityIndex {
|
|
413
|
+
schemaVersion: typeof ENGINEERING_INTELLIGENCE_SCHEMA_VERSION;
|
|
414
|
+
activeSessionId: string | null;
|
|
415
|
+
sessions: SessionContinuitySnapshot[];
|
|
416
|
+
updatedAt: string;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export type DriftIntelligenceSeverity = 'info' | 'low' | 'medium' | 'high' | 'critical';
|
|
420
|
+
export type DriftIntelligenceCategory =
|
|
421
|
+
| 'scope-expansion'
|
|
422
|
+
| 'cross-service'
|
|
423
|
+
| 'dependency-spread'
|
|
424
|
+
| 'infra-leakage'
|
|
425
|
+
| 'sensitive-boundary'
|
|
426
|
+
| 'blast-radius'
|
|
427
|
+
| 'rollout-risk'
|
|
428
|
+
| 'runtime-coupling'
|
|
429
|
+
| 'architectural-leakage'
|
|
430
|
+
| 'layer-violation'
|
|
431
|
+
| 'contract-misuse'
|
|
432
|
+
| 'ownership-inversion'
|
|
433
|
+
| 'responsibility-drift'
|
|
434
|
+
| 'invariant-violation'
|
|
435
|
+
| 'behavioral-drift'
|
|
436
|
+
| 'deployment-coupling'
|
|
437
|
+
| 'state-ownership-risk';
|
|
438
|
+
|
|
439
|
+
export type DriftEvidenceTier =
|
|
440
|
+
| 'direct-diff'
|
|
441
|
+
| 'direct-file'
|
|
442
|
+
| 'bounded-inference'
|
|
443
|
+
| 'topology-only';
|
|
444
|
+
|
|
445
|
+
export type DriftActionability =
|
|
446
|
+
| 'directly-actionable'
|
|
447
|
+
| 'review-required'
|
|
448
|
+
| 'informational';
|
|
449
|
+
|
|
450
|
+
export type GovernancePriority =
|
|
451
|
+
| 'p0-rollout-blocker'
|
|
452
|
+
| 'p1-architecture-blocker'
|
|
453
|
+
| 'p2-review-required'
|
|
454
|
+
| 'p3-advisory';
|
|
455
|
+
|
|
456
|
+
export type GovernanceGate =
|
|
457
|
+
| 'advisory'
|
|
458
|
+
| 'review-blocker'
|
|
459
|
+
| 'rollout-blocker'
|
|
460
|
+
| 'architecture-blocker'
|
|
461
|
+
| 'policy-blocker';
|
|
462
|
+
|
|
463
|
+
export type GovernanceDecisionState =
|
|
464
|
+
| 'acknowledged'
|
|
465
|
+
| 'review-required'
|
|
466
|
+
| 'accepted-risk'
|
|
467
|
+
| 'rollout-approved'
|
|
468
|
+
| 'rollout-blocked'
|
|
469
|
+
| 'advisory-dismissed'
|
|
470
|
+
| 'temporary-exception';
|
|
471
|
+
|
|
472
|
+
export type RolloutTrustPosture =
|
|
473
|
+
| 'rollout-safe'
|
|
474
|
+
| 'review-required'
|
|
475
|
+
| 'architecture-risk'
|
|
476
|
+
| 'deployment-sensitive'
|
|
477
|
+
| 'boundary-violating'
|
|
478
|
+
| 'topology-advisory';
|
|
479
|
+
|
|
480
|
+
export type FindingRelationshipType =
|
|
481
|
+
| 'derived-from'
|
|
482
|
+
| 'parent-of'
|
|
483
|
+
| 'topology-derived'
|
|
484
|
+
| 'deployment-derived';
|
|
485
|
+
|
|
486
|
+
export interface GovernanceFindingRelationship {
|
|
487
|
+
type: FindingRelationshipType;
|
|
488
|
+
targetFindingId: string;
|
|
489
|
+
rationale: string;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export interface GovernanceDecisionLineageEntry {
|
|
493
|
+
decisionId: string;
|
|
494
|
+
state: GovernanceDecisionState;
|
|
495
|
+
findingId: string | null;
|
|
496
|
+
category: DriftIntelligenceCategory | null;
|
|
497
|
+
reason: string;
|
|
498
|
+
actor: string;
|
|
499
|
+
decidedAt: string;
|
|
500
|
+
expiresAt: string | null;
|
|
501
|
+
temporary: boolean;
|
|
502
|
+
expired: boolean;
|
|
503
|
+
previousGate: GovernanceGate | null;
|
|
504
|
+
resultingGate: GovernanceGate | null;
|
|
505
|
+
previousRolloutTrust: RolloutTrustPosture | null;
|
|
506
|
+
resultingRolloutTrust: RolloutTrustPosture | null;
|
|
507
|
+
sourcePath: string | null;
|
|
508
|
+
lineageHash: string;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export interface GovernanceDecisionSummary {
|
|
512
|
+
sourcePath: string | null;
|
|
513
|
+
decisionsApplied: number;
|
|
514
|
+
activeOverrides: number;
|
|
515
|
+
expiredOverrides: number;
|
|
516
|
+
findingsChanged: number;
|
|
517
|
+
lineage: GovernanceDecisionLineageEntry[];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export interface DriftFindingLineEvidence {
|
|
521
|
+
file: string;
|
|
522
|
+
line: number;
|
|
523
|
+
text: string;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export interface DriftFindingEvidence {
|
|
527
|
+
tier: DriftEvidenceTier;
|
|
528
|
+
changedFiles: string[];
|
|
529
|
+
changedLines: DriftFindingLineEvidence[];
|
|
530
|
+
dependencyEdges: string[];
|
|
531
|
+
boundary: string | null;
|
|
532
|
+
explanation: string;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export interface DriftRemediationGuidance {
|
|
536
|
+
actionability: DriftActionability;
|
|
537
|
+
evidenceTier: DriftEvidenceTier;
|
|
538
|
+
minimalCorrection: string;
|
|
539
|
+
boundaryToPreserve: string;
|
|
540
|
+
verifyAfterRemediation: string;
|
|
541
|
+
uncertainty: string[];
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export interface DriftIntelligenceFinding {
|
|
545
|
+
id: string;
|
|
546
|
+
category: DriftIntelligenceCategory;
|
|
547
|
+
severity: DriftIntelligenceSeverity;
|
|
548
|
+
file?: string | null;
|
|
549
|
+
module?: string | null;
|
|
550
|
+
service?: string | null;
|
|
551
|
+
message: string;
|
|
552
|
+
rationale: string;
|
|
553
|
+
expected?: string | null;
|
|
554
|
+
actual?: string | null;
|
|
555
|
+
evidenceTier?: DriftEvidenceTier;
|
|
556
|
+
actionability?: DriftActionability;
|
|
557
|
+
priority?: GovernancePriority;
|
|
558
|
+
governanceGate?: GovernanceGate;
|
|
559
|
+
rolloutTrust?: RolloutTrustPosture;
|
|
560
|
+
relationships?: GovernanceFindingRelationship[];
|
|
561
|
+
governanceDecision?: GovernanceDecisionLineageEntry;
|
|
562
|
+
evidence?: DriftFindingEvidence;
|
|
563
|
+
remediationGuidance?: DriftRemediationGuidance;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export interface GovernancePriorityCounts {
|
|
567
|
+
p0RolloutBlockers: number;
|
|
568
|
+
p1ArchitectureBlockers: number;
|
|
569
|
+
p2ReviewRequired: number;
|
|
570
|
+
p3Advisory: number;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export interface GovernancePostureSummary {
|
|
574
|
+
rolloutTrust: RolloutTrustPosture;
|
|
575
|
+
governanceGate: GovernanceGate;
|
|
576
|
+
summary: string;
|
|
577
|
+
reasons: string[];
|
|
578
|
+
priorityCounts: GovernancePriorityCounts;
|
|
579
|
+
remediationOrder: string[];
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export type DriftNarrativeCategory =
|
|
583
|
+
| 'service-boundary-escape'
|
|
584
|
+
| 'dependency-expansion'
|
|
585
|
+
| 'forbidden-boundary-breach'
|
|
586
|
+
| 'semantic-coupling'
|
|
587
|
+
| 'blast-radius-expansion'
|
|
588
|
+
| 'localized-scope-drift'
|
|
589
|
+
| 'ownership-boundary-breach'
|
|
590
|
+
| 'architectural-invariant-erosion'
|
|
591
|
+
| 'runtime-behavior-shift'
|
|
592
|
+
| 'deployment-semantics-breach'
|
|
593
|
+
| 'state-ownership-erosion';
|
|
594
|
+
|
|
595
|
+
export interface DriftIntelligenceNarrative {
|
|
596
|
+
id: string;
|
|
597
|
+
category: DriftNarrativeCategory;
|
|
598
|
+
severity: DriftIntelligenceSeverity;
|
|
599
|
+
confidence: 'low' | 'medium' | 'high';
|
|
600
|
+
primaryCategory: DriftIntelligenceCategory;
|
|
601
|
+
rootCause: string;
|
|
602
|
+
summary: string;
|
|
603
|
+
operationalRisk: string;
|
|
604
|
+
remediationBoundary: string;
|
|
605
|
+
causalChain: string[];
|
|
606
|
+
affectedFiles: string[];
|
|
607
|
+
affectedModules: string[];
|
|
608
|
+
affectedServices: string[];
|
|
609
|
+
evidenceFindingIds: string[];
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export interface DriftRiskSynthesis {
|
|
613
|
+
overallRisk: 'low' | 'medium' | 'high' | 'critical';
|
|
614
|
+
summary: string;
|
|
615
|
+
primaryNarratives: string[];
|
|
616
|
+
contributingCategories: DriftIntelligenceCategory[];
|
|
617
|
+
rawFindingCount: number;
|
|
618
|
+
compressedNarrativeCount: number;
|
|
619
|
+
authExposure: boolean;
|
|
620
|
+
infraExposure: boolean;
|
|
621
|
+
deploymentExposure: boolean;
|
|
622
|
+
dependencyExposure: boolean;
|
|
623
|
+
transitiveImpactCount: number;
|
|
624
|
+
runtimeFlowExposure: boolean;
|
|
625
|
+
externalSideEffectExposure: boolean;
|
|
626
|
+
stateOwnershipExposure: boolean;
|
|
627
|
+
affectedRolloutUnits: string[];
|
|
628
|
+
cascadingRisk: 'low' | 'medium' | 'high' | 'critical';
|
|
629
|
+
rolloutTrust: RolloutTrustPosture;
|
|
630
|
+
governanceGate: GovernanceGate;
|
|
631
|
+
postureSummary: string;
|
|
632
|
+
priorityCounts: GovernancePriorityCounts;
|
|
633
|
+
remediationOrder: string[];
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export interface DriftIntelligenceReport {
|
|
637
|
+
schemaVersion: typeof ENGINEERING_INTELLIGENCE_SCHEMA_VERSION;
|
|
638
|
+
source: 'intent-runtime' | 'fallback-plan';
|
|
639
|
+
flagged: boolean;
|
|
640
|
+
confidence: 'low' | 'medium' | 'high';
|
|
641
|
+
changedFiles: string[];
|
|
642
|
+
changedModules: string[];
|
|
643
|
+
changedServices: string[];
|
|
644
|
+
impactedModules: string[];
|
|
645
|
+
impactedServices: string[];
|
|
646
|
+
impactedRuntimeFlows: string[];
|
|
647
|
+
affectedRolloutUnits: string[];
|
|
648
|
+
unexpectedFiles: string[];
|
|
649
|
+
unexpectedModules: string[];
|
|
650
|
+
unexpectedServices: string[];
|
|
651
|
+
rolloutRisk: 'low' | 'medium' | 'high';
|
|
652
|
+
findings: DriftIntelligenceFinding[];
|
|
653
|
+
narratives: DriftIntelligenceNarrative[];
|
|
654
|
+
riskSynthesis: DriftRiskSynthesis;
|
|
655
|
+
governancePosture: GovernancePostureSummary;
|
|
656
|
+
governanceDecisions: GovernanceDecisionSummary;
|
|
657
|
+
explanation: string[];
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
export interface HistoricalDriftPattern {
|
|
661
|
+
id: string;
|
|
662
|
+
category: string;
|
|
663
|
+
count: number;
|
|
664
|
+
lastObservedAt: string;
|
|
665
|
+
latestSummary: string;
|
|
666
|
+
latestSeverity: DriftIntelligenceSeverity | null;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
export interface EngineeringInvariantMemory {
|
|
670
|
+
schemaVersion: typeof ENGINEERING_INTELLIGENCE_SCHEMA_VERSION;
|
|
671
|
+
invariantMemoryId: string;
|
|
672
|
+
generatedAt: string;
|
|
673
|
+
updatedAt: string;
|
|
674
|
+
sessionId: string;
|
|
675
|
+
intentPackId: string;
|
|
676
|
+
repositoryGraphId: string;
|
|
677
|
+
branchName: string | null;
|
|
678
|
+
headSha: string | null;
|
|
679
|
+
ownershipBoundaries: RepositoryOwnershipBoundary[];
|
|
680
|
+
contracts: RepositorySemanticContract[];
|
|
681
|
+
invariants: RepositoryArchitecturalInvariant[];
|
|
682
|
+
runtimeBehaviorProfiles: RepositoryRuntimeBehaviorProfile[];
|
|
683
|
+
runtimeInteractions: RepositoryRuntimeInteraction[];
|
|
684
|
+
deploymentBoundaries: RepositoryDeploymentBoundary[];
|
|
685
|
+
acceptedBoundaries: {
|
|
686
|
+
approvedModules: string[];
|
|
687
|
+
approvedServices: string[];
|
|
688
|
+
forbiddenBoundaries: string[];
|
|
689
|
+
};
|
|
690
|
+
lineage: {
|
|
691
|
+
previousSessionId: string | null;
|
|
692
|
+
sessionLineage: string[];
|
|
693
|
+
previousInvariantMemoryId: string | null;
|
|
694
|
+
};
|
|
695
|
+
historicalDriftPatterns: HistoricalDriftPattern[];
|
|
696
|
+
recentObservationHashes: string[];
|
|
697
|
+
fingerprint: string;
|
|
698
|
+
}
|