@cleocode/contracts 2026.4.100 → 2026.4.102
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/brain-graph.d.ts +245 -0
- package/dist/brain-graph.d.ts.map +1 -0
- package/dist/brain-graph.js +30 -0
- package/dist/brain-graph.js.map +1 -0
- package/dist/branch-lock.d.ts +225 -0
- package/dist/branch-lock.d.ts.map +1 -0
- package/dist/branch-lock.js +43 -0
- package/dist/branch-lock.js.map +1 -0
- package/dist/exit-codes.d.ts +1 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +1 -1
- package/dist/exit-codes.js.map +1 -1
- package/dist/graph.d.ts +2 -0
- package/dist/graph.d.ts.map +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/nexus-contract-ops.d.ts +186 -0
- package/dist/nexus-contract-ops.d.ts.map +1 -0
- package/dist/nexus-contract-ops.js +11 -0
- package/dist/nexus-contract-ops.js.map +1 -0
- package/dist/nexus-living-brain-ops.d.ts +314 -0
- package/dist/nexus-living-brain-ops.d.ts.map +1 -0
- package/dist/nexus-living-brain-ops.js +15 -0
- package/dist/nexus-living-brain-ops.js.map +1 -0
- package/dist/nexus-query-ops.d.ts +82 -0
- package/dist/nexus-query-ops.d.ts.map +1 -0
- package/dist/nexus-query-ops.js +11 -0
- package/dist/nexus-query-ops.js.map +1 -0
- package/dist/nexus-route-ops.d.ts +103 -0
- package/dist/nexus-route-ops.d.ts.map +1 -0
- package/dist/nexus-route-ops.js +10 -0
- package/dist/nexus-route-ops.js.map +1 -0
- package/dist/nexus-tasks-bridge-ops.d.ts +68 -0
- package/dist/nexus-tasks-bridge-ops.d.ts.map +1 -0
- package/dist/nexus-tasks-bridge-ops.js +11 -0
- package/dist/nexus-tasks-bridge-ops.js.map +1 -0
- package/dist/nexus-wiki-ops.d.ts +127 -0
- package/dist/nexus-wiki-ops.d.ts.map +1 -0
- package/dist/nexus-wiki-ops.js +12 -0
- package/dist/nexus-wiki-ops.js.map +1 -0
- package/dist/operations/admin.d.ts +1781 -0
- package/dist/operations/admin.d.ts.map +1 -0
- package/dist/operations/admin.js +27 -0
- package/dist/operations/admin.js.map +1 -0
- package/dist/operations/brain.d.ts +34 -26
- package/dist/operations/brain.d.ts.map +1 -1
- package/dist/operations/brain.js +7 -6
- package/dist/operations/brain.js.map +1 -1
- package/dist/operations/docs.d.ts +279 -0
- package/dist/operations/docs.d.ts.map +1 -0
- package/dist/operations/docs.js +31 -0
- package/dist/operations/docs.js.map +1 -0
- package/dist/operations/intelligence.d.ts +319 -0
- package/dist/operations/intelligence.d.ts.map +1 -0
- package/dist/operations/intelligence.js +24 -0
- package/dist/operations/intelligence.js.map +1 -0
- package/dist/operations/orchestrate.d.ts +113 -2
- package/dist/operations/orchestrate.d.ts.map +1 -1
- package/dist/operations/orchestrate.js +3 -2
- package/dist/operations/orchestrate.js.map +1 -1
- package/dist/operations/session.d.ts +193 -47
- package/dist/operations/session.d.ts.map +1 -1
- package/dist/operations/session.js +7 -6
- package/dist/operations/session.js.map +1 -1
- package/dist/operations/sticky.d.ts +264 -0
- package/dist/operations/sticky.d.ts.map +1 -0
- package/dist/operations/sticky.js +19 -0
- package/dist/operations/sticky.js.map +1 -0
- package/dist/operations/validate.d.ts +145 -19
- package/dist/operations/validate.d.ts.map +1 -1
- package/dist/operations/validate.js +3 -3
- package/dist/task-record.d.ts +19 -0
- package/dist/task-record.d.ts.map +1 -1
- package/package.json +41 -1
- package/src/brain-graph.ts +282 -0
- package/src/branch-lock.ts +254 -0
- package/src/exit-codes.ts +1 -1
- package/src/graph.ts +2 -0
- package/src/index.ts +128 -0
- package/src/nexus-contract-ops.ts +244 -0
- package/src/nexus-living-brain-ops.ts +345 -0
- package/src/nexus-query-ops.ts +100 -0
- package/src/nexus-route-ops.ts +134 -0
- package/src/nexus-tasks-bridge-ops.ts +71 -0
- package/src/nexus-wiki-ops.ts +133 -0
- package/src/operations/admin.ts +2087 -0
- package/src/operations/brain.ts +34 -26
- package/src/operations/docs.ts +322 -0
- package/src/operations/intelligence.ts +399 -0
- package/src/operations/orchestrate.ts +117 -2
- package/src/operations/session.ts +225 -48
- package/src/operations/sticky.ts +308 -0
- package/src/operations/validate.ts +161 -55
- package/src/task-record.ts +19 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Validate Domain Operations
|
|
2
|
+
* Validate / Check Domain Operations
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Common validation types
|
|
4
|
+
* T982 extension: Added new types for gate, archive, coherence, compliance-sync,
|
|
5
|
+
* chain, grade, canon, workflow-compliance, verify-explain, and all protocol subtypes.
|
|
9
6
|
*/
|
|
7
|
+
import type { WarpChain } from '../warp-chain.js';
|
|
10
8
|
export type ValidationSeverity = 'error' | 'warning' | 'info';
|
|
11
9
|
export interface ValidationViolation {
|
|
12
10
|
rule: string;
|
|
@@ -28,21 +26,51 @@ export interface ComplianceMetrics {
|
|
|
28
26
|
}>;
|
|
29
27
|
bySeverity: Record<ValidationSeverity, number>;
|
|
30
28
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Query Operations
|
|
33
|
-
*/
|
|
34
29
|
export interface ValidateSchemaParams {
|
|
35
|
-
fileType
|
|
30
|
+
fileType?: 'todo' | 'config' | 'archive' | 'log' | 'manifest';
|
|
36
31
|
filePath?: string;
|
|
32
|
+
type?: string;
|
|
33
|
+
data?: unknown;
|
|
37
34
|
}
|
|
38
35
|
export interface ValidateSchemaResult {
|
|
39
36
|
valid: boolean;
|
|
40
37
|
schemaVersion: string;
|
|
41
38
|
violations: ValidationViolation[];
|
|
42
39
|
}
|
|
43
|
-
export interface
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
export interface ValidateProtocolBaseParams {
|
|
41
|
+
mode?: 'task' | 'manifest';
|
|
42
|
+
taskId?: string;
|
|
43
|
+
manifestFile?: string;
|
|
44
|
+
strict?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface ValidateProtocolParams extends ValidateProtocolBaseParams {
|
|
47
|
+
protocolType?: string;
|
|
48
|
+
votingMatrixFile?: string;
|
|
49
|
+
epicId?: string;
|
|
50
|
+
specFile?: string;
|
|
51
|
+
hasCodeChanges?: boolean;
|
|
52
|
+
adrContent?: string;
|
|
53
|
+
status?: 'proposed' | 'accepted' | 'superseded' | 'deprecated';
|
|
54
|
+
hitlReviewed?: boolean;
|
|
55
|
+
downstreamFlagged?: boolean;
|
|
56
|
+
persistedInDb?: boolean;
|
|
57
|
+
specMatchConfirmed?: boolean;
|
|
58
|
+
testSuitePassed?: boolean;
|
|
59
|
+
protocolComplianceChecked?: boolean;
|
|
60
|
+
framework?: string;
|
|
61
|
+
testsRun?: number;
|
|
62
|
+
testsPassed?: number;
|
|
63
|
+
testsFailed?: number;
|
|
64
|
+
coveragePercent?: number;
|
|
65
|
+
coverageThreshold?: number;
|
|
66
|
+
ivtLoopConverged?: boolean;
|
|
67
|
+
ivtLoopIterations?: number;
|
|
68
|
+
version?: string;
|
|
69
|
+
hasChangelog?: boolean;
|
|
70
|
+
artifactType?: string;
|
|
71
|
+
buildPassed?: boolean;
|
|
72
|
+
hasAttestation?: boolean;
|
|
73
|
+
hasSbom?: boolean;
|
|
46
74
|
}
|
|
47
75
|
export interface ValidateProtocolResult {
|
|
48
76
|
taskId: string;
|
|
@@ -58,7 +86,7 @@ export interface ValidateProtocolResult {
|
|
|
58
86
|
}
|
|
59
87
|
export interface ValidateTaskParams {
|
|
60
88
|
taskId: string;
|
|
61
|
-
checkMode
|
|
89
|
+
checkMode?: 'basic' | 'strict' | 'anti-hallucination';
|
|
62
90
|
}
|
|
63
91
|
export interface ValidateTaskResult {
|
|
64
92
|
taskId: string;
|
|
@@ -86,7 +114,7 @@ export interface ValidateManifestResult {
|
|
|
86
114
|
violations: ValidationViolation[];
|
|
87
115
|
}
|
|
88
116
|
export interface ValidateOutputParams {
|
|
89
|
-
taskId
|
|
117
|
+
taskId?: string;
|
|
90
118
|
filePath: string;
|
|
91
119
|
}
|
|
92
120
|
export interface ValidateOutputResult {
|
|
@@ -105,6 +133,12 @@ export interface ValidateOutputResult {
|
|
|
105
133
|
export interface ValidateComplianceSummaryParams {
|
|
106
134
|
scope?: string;
|
|
107
135
|
since?: string;
|
|
136
|
+
detail?: boolean;
|
|
137
|
+
limit?: number;
|
|
138
|
+
type?: string;
|
|
139
|
+
taskId?: string;
|
|
140
|
+
days?: number;
|
|
141
|
+
global?: unknown;
|
|
108
142
|
}
|
|
109
143
|
export type ValidateComplianceSummaryResult = ComplianceMetrics;
|
|
110
144
|
export interface ValidateComplianceViolationsParams {
|
|
@@ -121,6 +155,7 @@ export interface ValidateComplianceViolationsResult {
|
|
|
121
155
|
}
|
|
122
156
|
export interface ValidateTestStatusParams {
|
|
123
157
|
taskId?: string;
|
|
158
|
+
format?: string;
|
|
124
159
|
}
|
|
125
160
|
export interface ValidateTestStatusResult {
|
|
126
161
|
total: number;
|
|
@@ -144,12 +179,99 @@ export interface ValidateTestCoverageResult {
|
|
|
144
179
|
threshold: number;
|
|
145
180
|
meetsThreshold: boolean;
|
|
146
181
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
182
|
+
export interface ValidateCoherenceParams {
|
|
183
|
+
taskId?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface ValidateCoherenceResult {
|
|
186
|
+
passed: boolean;
|
|
187
|
+
issues: string[];
|
|
188
|
+
warnings: string[];
|
|
189
|
+
}
|
|
190
|
+
export interface ValidateGateParams {
|
|
191
|
+
taskId: string;
|
|
192
|
+
gate?: string;
|
|
193
|
+
value?: boolean;
|
|
194
|
+
agent?: string;
|
|
195
|
+
all?: boolean;
|
|
196
|
+
reset?: boolean;
|
|
197
|
+
evidence?: string;
|
|
198
|
+
sessionId?: string;
|
|
199
|
+
}
|
|
200
|
+
export interface ValidateGateResult {
|
|
201
|
+
taskId: string;
|
|
202
|
+
gates: Record<string, boolean>;
|
|
203
|
+
passed: boolean;
|
|
204
|
+
round: number;
|
|
205
|
+
}
|
|
206
|
+
export interface ValidateVerifyExplainParams {
|
|
207
|
+
taskId: string;
|
|
208
|
+
}
|
|
209
|
+
export interface ValidateVerifyExplainResult {
|
|
210
|
+
taskId: string;
|
|
211
|
+
title?: string;
|
|
212
|
+
status?: string;
|
|
213
|
+
passed: boolean;
|
|
214
|
+
round: number;
|
|
215
|
+
gates: Record<string, boolean>;
|
|
216
|
+
evidence: Record<string, unknown[]>;
|
|
217
|
+
requiredGates: string[];
|
|
218
|
+
missingGates: string[];
|
|
219
|
+
explanation: string;
|
|
220
|
+
}
|
|
221
|
+
export type ArchiveReportTypeAlias = 'summary' | 'by-phase' | 'by-label' | 'by-priority' | 'cycle-times' | 'trends';
|
|
222
|
+
export interface ValidateArchiveStatsParams {
|
|
223
|
+
period?: number;
|
|
224
|
+
report?: ArchiveReportTypeAlias;
|
|
225
|
+
since?: string;
|
|
226
|
+
until?: string;
|
|
227
|
+
}
|
|
228
|
+
export type ValidateArchiveStatsResult = Record<string, unknown>;
|
|
229
|
+
export interface ValidateChainParams {
|
|
230
|
+
chain: WarpChain;
|
|
231
|
+
}
|
|
232
|
+
export interface ValidateChainResult {
|
|
233
|
+
wellFormed: boolean;
|
|
234
|
+
gateSatisfiable: boolean;
|
|
235
|
+
errors: string[];
|
|
236
|
+
warnings: string[];
|
|
237
|
+
}
|
|
238
|
+
export interface ValidateGradeParams {
|
|
239
|
+
sessionId: string;
|
|
240
|
+
}
|
|
241
|
+
export type ValidateGradeResult = Record<string, unknown>;
|
|
242
|
+
export interface ValidateGradeListParams {
|
|
243
|
+
sessionId?: string;
|
|
244
|
+
limit?: number;
|
|
245
|
+
offset?: number;
|
|
246
|
+
}
|
|
247
|
+
export interface ValidateGradeListResult {
|
|
248
|
+
grades: unknown[];
|
|
249
|
+
total: number;
|
|
250
|
+
filtered: number;
|
|
251
|
+
}
|
|
252
|
+
export interface ValidateCanonParams {
|
|
253
|
+
taskId?: string;
|
|
254
|
+
}
|
|
255
|
+
export interface ValidateCanonResult {
|
|
256
|
+
passed: boolean;
|
|
257
|
+
violations: unknown[];
|
|
258
|
+
assertions: Array<{
|
|
259
|
+
passed: boolean;
|
|
260
|
+
}>;
|
|
261
|
+
}
|
|
262
|
+
export interface ValidateWorkflowComplianceParams {
|
|
263
|
+
since?: string;
|
|
264
|
+
}
|
|
265
|
+
export type ValidateWorkflowComplianceResult = Record<string, unknown>;
|
|
150
266
|
export interface ValidateComplianceRecordParams {
|
|
151
267
|
taskId: string;
|
|
152
|
-
result:
|
|
268
|
+
result: string;
|
|
269
|
+
protocol?: string;
|
|
270
|
+
violations?: Array<{
|
|
271
|
+
code: string;
|
|
272
|
+
message: string;
|
|
273
|
+
severity: 'error' | 'warning';
|
|
274
|
+
}>;
|
|
153
275
|
}
|
|
154
276
|
export interface ValidateComplianceRecordResult {
|
|
155
277
|
taskId: string;
|
|
@@ -167,4 +289,8 @@ export interface ValidateTestRunResult {
|
|
|
167
289
|
duration: string;
|
|
168
290
|
output?: string;
|
|
169
291
|
}
|
|
292
|
+
export interface ValidateComplianceSyncParams {
|
|
293
|
+
force?: boolean;
|
|
294
|
+
}
|
|
295
|
+
export type ValidateComplianceSyncResult = Record<string, unknown>;
|
|
170
296
|
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/operations/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/operations/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,MA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Check Domain Operations
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* T982 extension: Added new types for gate, archive, coherence, compliance-sync,
|
|
5
|
+
* chain, grade, canon, workflow-compliance, verify-explain, and all protocol subtypes.
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=validate.js.map
|
package/dist/task-record.d.ts
CHANGED
|
@@ -57,6 +57,25 @@ export interface TaskRecord {
|
|
|
57
57
|
cancellationReason?: string;
|
|
58
58
|
/** RCASD-IVTR+C pipeline stage. @task T060 */
|
|
59
59
|
pipelineStage?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Task role axis — intent of work (string-widened from {@link TaskRole}).
|
|
62
|
+
* Values: work | research | experiment | bug | spike | release
|
|
63
|
+
* @task T944
|
|
64
|
+
*/
|
|
65
|
+
role?: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Task scope axis — granularity of work (string-widened from {@link TaskScope}).
|
|
68
|
+
* Values: project | feature | unit
|
|
69
|
+
* @task T944
|
|
70
|
+
*/
|
|
71
|
+
scope?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Bug severity (string-widened from {@link TaskSeverity}).
|
|
74
|
+
* Only valid when role='bug'. OWNER-WRITE-ONLY.
|
|
75
|
+
* Values: P0 | P1 | P2 | P3
|
|
76
|
+
* @task T944
|
|
77
|
+
*/
|
|
78
|
+
severity?: string | null;
|
|
60
79
|
}
|
|
61
80
|
/**
|
|
62
81
|
* Minimal task representation for find results.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-record.d.ts","sourceRoot":"","sources":["../src/task-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC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ACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/contracts",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.102",
|
|
4
4
|
"description": "Domain types, interfaces, and contracts for the CLEO ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,46 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./nexus-contract-ops": {
|
|
14
|
+
"types": "./dist/nexus-contract-ops.d.ts",
|
|
15
|
+
"import": "./dist/nexus-contract-ops.js"
|
|
16
|
+
},
|
|
17
|
+
"./nexus-contract-ops.js": {
|
|
18
|
+
"types": "./dist/nexus-contract-ops.d.ts",
|
|
19
|
+
"import": "./dist/nexus-contract-ops.js"
|
|
20
|
+
},
|
|
21
|
+
"./nexus-living-brain-ops": {
|
|
22
|
+
"types": "./dist/nexus-living-brain-ops.d.ts",
|
|
23
|
+
"import": "./dist/nexus-living-brain-ops.js"
|
|
24
|
+
},
|
|
25
|
+
"./nexus-living-brain-ops.js": {
|
|
26
|
+
"types": "./dist/nexus-living-brain-ops.d.ts",
|
|
27
|
+
"import": "./dist/nexus-living-brain-ops.js"
|
|
28
|
+
},
|
|
29
|
+
"./nexus-query-ops": {
|
|
30
|
+
"types": "./dist/nexus-query-ops.d.ts",
|
|
31
|
+
"import": "./dist/nexus-query-ops.js"
|
|
32
|
+
},
|
|
33
|
+
"./nexus-query-ops.js": {
|
|
34
|
+
"types": "./dist/nexus-query-ops.d.ts",
|
|
35
|
+
"import": "./dist/nexus-query-ops.js"
|
|
36
|
+
},
|
|
37
|
+
"./nexus-route-ops": {
|
|
38
|
+
"types": "./dist/nexus-route-ops.d.ts",
|
|
39
|
+
"import": "./dist/nexus-route-ops.js"
|
|
40
|
+
},
|
|
41
|
+
"./nexus-route-ops.js": {
|
|
42
|
+
"types": "./dist/nexus-route-ops.d.ts",
|
|
43
|
+
"import": "./dist/nexus-route-ops.js"
|
|
44
|
+
},
|
|
45
|
+
"./nexus-tasks-bridge-ops": {
|
|
46
|
+
"types": "./dist/nexus-tasks-bridge-ops.d.ts",
|
|
47
|
+
"import": "./dist/nexus-tasks-bridge-ops.js"
|
|
48
|
+
},
|
|
49
|
+
"./nexus-tasks-bridge-ops.js": {
|
|
50
|
+
"types": "./dist/nexus-tasks-bridge-ops.d.ts",
|
|
51
|
+
"import": "./dist/nexus-tasks-bridge-ops.js"
|
|
12
52
|
}
|
|
13
53
|
},
|
|
14
54
|
"engines": {
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Brain unified-graph types.
|
|
3
|
+
*
|
|
4
|
+
* These are the **single source of truth** for `BrainNode`, `BrainEdge`,
|
|
5
|
+
* `BrainGraph`, and their supporting types across the entire CLEO monorepo.
|
|
6
|
+
*
|
|
7
|
+
* All other packages MUST import these types from `@cleocode/contracts`
|
|
8
|
+
* (or a relative path into this file) rather than defining their own copies.
|
|
9
|
+
* Runtime packages such as `@cleocode/brain` re-export these types directly
|
|
10
|
+
* so downstream consumers do not need to change their import path.
|
|
11
|
+
*
|
|
12
|
+
* ## Shape rationale
|
|
13
|
+
*
|
|
14
|
+
* The types here are the **runtime** shapes produced by the substrate
|
|
15
|
+
* adapters in `@cleocode/brain` and consumed by every graph renderer,
|
|
16
|
+
* SSE stream, and API route in `@cleocode/studio`. The wire-format
|
|
17
|
+
* operation contracts in `./operations/brain.ts` are intentionally distinct
|
|
18
|
+
* (they use `from`/`to`/`kind` field names and a separate `BrainSubstrateName`
|
|
19
|
+
* vocabulary) and are namespaced under `ops.*` to avoid collisions.
|
|
20
|
+
*
|
|
21
|
+
* @task T989 — canonical type unification (was split across packages/brain
|
|
22
|
+
* and packages/contracts/operations/brain)
|
|
23
|
+
* @task T973 — LB* → Brain* rename
|
|
24
|
+
* @task T969 — `@cleocode/brain` package extraction
|
|
25
|
+
* @see packages/brain/src/types.ts (re-exports from here for backwards compat)
|
|
26
|
+
* @see packages/contracts/src/operations/brain.ts (wire-format / ops contracts)
|
|
27
|
+
* @see docs/plans/brain-synaptic-visualization-research.md §5.2
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Supporting enum types
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* All possible node kinds across the five CLEO substrates.
|
|
36
|
+
*
|
|
37
|
+
* - `observation` / `decision` / `pattern` / `learning` → BRAIN typed tables
|
|
38
|
+
* - `task` / `session` → TASKS
|
|
39
|
+
* - `symbol` / `file` → NEXUS
|
|
40
|
+
* - `agent` → SIGNALDOCK
|
|
41
|
+
* - `message` → CONDUIT
|
|
42
|
+
*/
|
|
43
|
+
export type BrainNodeKind =
|
|
44
|
+
| 'observation'
|
|
45
|
+
| 'decision'
|
|
46
|
+
| 'pattern'
|
|
47
|
+
| 'learning'
|
|
48
|
+
| 'task'
|
|
49
|
+
| 'session'
|
|
50
|
+
| 'symbol'
|
|
51
|
+
| 'file'
|
|
52
|
+
| 'agent'
|
|
53
|
+
| 'message';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Which database a node or edge originates from.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Uses the literal `'brain'` to match the on-disk `brain.db` filename.
|
|
60
|
+
* This differs from `BrainSubstrateName` in `./operations/brain.ts` which
|
|
61
|
+
* uses `'memory'` to align with the cognitive-memory domain rename. Callers
|
|
62
|
+
* that bridge runtime output to the wire format translate between the two
|
|
63
|
+
* naming planes at the adapter boundary.
|
|
64
|
+
*/
|
|
65
|
+
export type BrainSubstrate = 'brain' | 'nexus' | 'tasks' | 'conduit' | 'signaldock';
|
|
66
|
+
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Canonical graph node
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* A single node in the unified CLEO Brain graph.
|
|
73
|
+
*
|
|
74
|
+
* The `id` field is always substrate-prefixed so nodes from different
|
|
75
|
+
* substrates can be merged without collisions:
|
|
76
|
+
* - `"brain:O-abc"` — a brain observation
|
|
77
|
+
* - `"nexus:sym-123"` — a nexus code symbol
|
|
78
|
+
* - `"tasks:T949"` — a CLEO task
|
|
79
|
+
* - `"conduit:msg-7f3a2b1c"` — a conduit message
|
|
80
|
+
* - `"signaldock:agent-cleo-prime"` — a SignalDock agent
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* This is the shape produced by all substrate adapters in `@cleocode/brain`
|
|
84
|
+
* and consumed by graph renderers and SSE streams. It differs from the
|
|
85
|
+
* `BrainNodeWire` wire-format type in `./operations/brain.ts` which uses
|
|
86
|
+
* `type`/`data` instead of `kind`/`meta`.
|
|
87
|
+
*/
|
|
88
|
+
export interface BrainNode {
|
|
89
|
+
/** Substrate-prefixed identifier, e.g. `"brain:O-abc"`, `"nexus:sym-123"`. */
|
|
90
|
+
id: string;
|
|
91
|
+
/** Semantic category of this node. */
|
|
92
|
+
kind: BrainNodeKind;
|
|
93
|
+
/** Source database. */
|
|
94
|
+
substrate: BrainSubstrate;
|
|
95
|
+
/** Human-readable display label. */
|
|
96
|
+
label: string;
|
|
97
|
+
/**
|
|
98
|
+
* Optional numeric weight in `[0, 1]`.
|
|
99
|
+
*
|
|
100
|
+
* - BRAIN: `quality_score` (0.0–1.0)
|
|
101
|
+
* - NEXUS: in-degree / caller count (normalised)
|
|
102
|
+
* - TASKS: priority rank (critical=4 → 1.0, low=1 → 0.25)
|
|
103
|
+
* - CONDUIT / SIGNALDOCK: omitted
|
|
104
|
+
*/
|
|
105
|
+
weight?: number;
|
|
106
|
+
/**
|
|
107
|
+
* ISO-8601 creation timestamp, or `null` when the substrate does not
|
|
108
|
+
* expose a timestamp for this node type.
|
|
109
|
+
*
|
|
110
|
+
* - BRAIN: `brain_*` tables `created_at` column (ISO text)
|
|
111
|
+
* - NEXUS: `nexus_nodes.indexed_at` column (ISO text)
|
|
112
|
+
* - TASKS: `tasks.created_at` / `sessions.started_at` column (ISO text)
|
|
113
|
+
* - CONDUIT: `messages.created_at` converted from UNIX epoch (INTEGER)
|
|
114
|
+
* - SIGNALDOCK: `agents.created_at` converted from UNIX epoch (INTEGER), or null
|
|
115
|
+
*/
|
|
116
|
+
createdAt: string | null;
|
|
117
|
+
/** Substrate-specific metadata (source row fields, opaque to super-graph callers). */
|
|
118
|
+
meta: Record<string, unknown>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
// Canonical graph edge
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A directed edge between two nodes in the unified CLEO Brain graph.
|
|
127
|
+
*
|
|
128
|
+
* Both `source` and `target` reference `BrainNode.id` values
|
|
129
|
+
* (substrate-prefixed). Cross-substrate edges use `substrate: 'cross'`.
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* This type uses `source`/`target`/`type` field names (matching D3/Cosmograph
|
|
133
|
+
* conventions). The wire-format type `BrainEdgeWire` in `./operations/brain.ts`
|
|
134
|
+
* uses `from`/`to`/`kind` and is a separate concern.
|
|
135
|
+
*/
|
|
136
|
+
export interface BrainEdge {
|
|
137
|
+
/** Source node ID (substrate-prefixed, references {@link BrainNode.id}). */
|
|
138
|
+
source: string;
|
|
139
|
+
/** Target node ID (substrate-prefixed, references {@link BrainNode.id}). */
|
|
140
|
+
target: string;
|
|
141
|
+
/**
|
|
142
|
+
* Semantic edge type.
|
|
143
|
+
*
|
|
144
|
+
* In-substrate examples: `'supersedes'` | `'derived_from'` | `'calls'` | `'imports'`
|
|
145
|
+
* Cross-substrate examples: `'mentions'` | `'applies_to'` | `'authored_by'` | `'modified'`
|
|
146
|
+
*/
|
|
147
|
+
type: string;
|
|
148
|
+
/**
|
|
149
|
+
* Edge weight in `[0, 1]`. Higher = stronger / more confident.
|
|
150
|
+
*
|
|
151
|
+
* - BRAIN: `brain_page_edges.weight` (Hebbian/STDP-trained)
|
|
152
|
+
* - NEXUS: relation `confidence`
|
|
153
|
+
* - Others: `0.5` default
|
|
154
|
+
*/
|
|
155
|
+
weight: number;
|
|
156
|
+
/** Which substrate produced this edge, or `'cross'` for synthesized cross-substrate edges. */
|
|
157
|
+
substrate: BrainSubstrate | 'cross';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ---------------------------------------------------------------------------
|
|
161
|
+
// Canonical graph response
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Unified graph response returned by the Brain unified-graph API and the
|
|
166
|
+
* `getAllSubstrates` adapter in `@cleocode/brain`.
|
|
167
|
+
*
|
|
168
|
+
* - `nodes` / `edges`: combined projection across all requested substrates.
|
|
169
|
+
* - `counts`: per-substrate contribution breakdown.
|
|
170
|
+
* - `truncated`: `true` when results were capped by the `limit` parameter.
|
|
171
|
+
*/
|
|
172
|
+
export interface BrainGraph {
|
|
173
|
+
/** Merged, deduplicated nodes across all requested substrates. */
|
|
174
|
+
nodes: BrainNode[];
|
|
175
|
+
/** Directed edges (may reference stub nodes for cross-substrate targets). */
|
|
176
|
+
edges: BrainEdge[];
|
|
177
|
+
/** Per-substrate node/edge contribution counts. */
|
|
178
|
+
counts: {
|
|
179
|
+
/** Nodes contributed per substrate. */
|
|
180
|
+
nodes: Record<BrainSubstrate, number>;
|
|
181
|
+
/** Edges contributed per substrate (including `'cross'`). */
|
|
182
|
+
edges: Record<BrainSubstrate | 'cross', number>;
|
|
183
|
+
};
|
|
184
|
+
/** `true` when the response was capped by the node limit. */
|
|
185
|
+
truncated: boolean;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Project context (minimal, used for path resolution in adapters)
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Minimum project context required by Brain substrate adapters to resolve
|
|
194
|
+
* per-project database paths.
|
|
195
|
+
*
|
|
196
|
+
* The studio's richer `ProjectContext` type carries additional fields
|
|
197
|
+
* (`projectId`, `name`, `brainDbExists`, etc.) and satisfies this interface
|
|
198
|
+
* via TypeScript structural typing.
|
|
199
|
+
*
|
|
200
|
+
* @remarks
|
|
201
|
+
* Defined here (rather than in `@cleocode/brain`) so that `BrainQueryOptions`
|
|
202
|
+
* can reference it without creating a circular dependency.
|
|
203
|
+
*/
|
|
204
|
+
export interface BrainProjectContext {
|
|
205
|
+
/** Absolute path to the project root. */
|
|
206
|
+
projectPath: string;
|
|
207
|
+
/** Absolute path to `brain.db` for this project. */
|
|
208
|
+
brainDbPath: string;
|
|
209
|
+
/** Absolute path to `tasks.db` for this project. */
|
|
210
|
+
tasksDbPath: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// ---------------------------------------------------------------------------
|
|
214
|
+
// Query options
|
|
215
|
+
// ---------------------------------------------------------------------------
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Query options forwarded from API route query parameters to substrate adapters.
|
|
219
|
+
*
|
|
220
|
+
* - `substrates`: filter to specific databases; omit for all five.
|
|
221
|
+
* - `limit`: cap on total node count (default 500, max 2000).
|
|
222
|
+
* - `minWeight`: excludes nodes/edges below this quality threshold.
|
|
223
|
+
* - `projectCtx`: resolves per-project DB paths; required for correct
|
|
224
|
+
* multi-project routing.
|
|
225
|
+
*/
|
|
226
|
+
export interface BrainQueryOptions {
|
|
227
|
+
/** Which substrates to include. Defaults to all five. */
|
|
228
|
+
substrates?: BrainSubstrate[];
|
|
229
|
+
/** Maximum number of nodes to return across all substrates. Default `500`. */
|
|
230
|
+
limit?: number;
|
|
231
|
+
/** Minimum quality/weight threshold for nodes and edges (0.0–1.0). Default `0`. */
|
|
232
|
+
minWeight?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Active project context from `event.locals.projectCtx`.
|
|
235
|
+
* Per-project substrates (brain, tasks, conduit) use this to resolve DB paths.
|
|
236
|
+
* When absent, adapters fall back to the process-default paths.
|
|
237
|
+
*/
|
|
238
|
+
projectCtx?: BrainProjectContext;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// ---------------------------------------------------------------------------
|
|
242
|
+
// SSE stream event union
|
|
243
|
+
// ---------------------------------------------------------------------------
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Discriminated union of all SSE event payloads emitted by
|
|
247
|
+
* `GET /api/brain/stream`.
|
|
248
|
+
*
|
|
249
|
+
* Every variant carries a top-level `ts` field (ISO-8601 timestamp) so
|
|
250
|
+
* clients can sequence events even when they arrive out-of-order.
|
|
251
|
+
*
|
|
252
|
+
* - `hello` — sent immediately on connect; confirms the stream is live.
|
|
253
|
+
* - `heartbeat` — sent every 30 s to prevent connection timeout.
|
|
254
|
+
* - `node.create` — a new row was inserted into `brain_observations`.
|
|
255
|
+
* - `edge.strengthen` — a `brain_page_edges` row had its `weight` updated.
|
|
256
|
+
* - `task.status` — a `tasks` row changed its `status` column.
|
|
257
|
+
* - `message.send` — a new row was inserted into conduit messages.
|
|
258
|
+
*/
|
|
259
|
+
export type BrainStreamEvent =
|
|
260
|
+
| { type: 'hello'; ts: string }
|
|
261
|
+
| { type: 'heartbeat'; ts: string }
|
|
262
|
+
| { type: 'node.create'; node: BrainNode; ts: string }
|
|
263
|
+
| {
|
|
264
|
+
type: 'edge.strengthen';
|
|
265
|
+
fromId: string;
|
|
266
|
+
toId: string;
|
|
267
|
+
edgeType: string;
|
|
268
|
+
weight: number;
|
|
269
|
+
ts: string;
|
|
270
|
+
}
|
|
271
|
+
| { type: 'task.status'; taskId: string; status: string; ts: string }
|
|
272
|
+
| {
|
|
273
|
+
type: 'message.send';
|
|
274
|
+
messageId: string;
|
|
275
|
+
fromAgentId: string;
|
|
276
|
+
toAgentId: string;
|
|
277
|
+
preview: string;
|
|
278
|
+
ts: string;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/** Connection state for the SSE client subscription in the studio brain viewer. */
|
|
282
|
+
export type BrainConnectionStatus = 'connecting' | 'connected' | 'error' | 'disconnected';
|