@cleocode/contracts 2026.4.100 → 2026.4.101
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/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 +8 -0
- package/dist/index.d.ts.map +1 -1
- 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 +51 -0
- package/dist/nexus-wiki-ops.d.ts.map +1 -0
- package/dist/nexus-wiki-ops.js +11 -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 +185 -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/exit-codes.ts +1 -1
- package/src/graph.ts +2 -0
- package/src/index.ts +109 -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 +53 -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 +217 -48
- package/src/operations/sticky.ts +308 -0
- package/src/operations/validate.ts +161 -55
- package/src/task-record.ts +19 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Validate Domain Operations
|
|
2
|
+
* Validate / 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
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
8
|
+
import type { WarpChain } from '../warp-chain.js';
|
|
9
|
+
|
|
11
10
|
export type ValidationSeverity = 'error' | 'warning' | 'info';
|
|
12
11
|
|
|
13
12
|
export interface ValidationViolation {
|
|
@@ -29,14 +28,11 @@ export interface ComplianceMetrics {
|
|
|
29
28
|
bySeverity: Record<ValidationSeverity, number>;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
/**
|
|
33
|
-
* Query Operations
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
// validate.schema
|
|
37
31
|
export interface ValidateSchemaParams {
|
|
38
|
-
fileType
|
|
32
|
+
fileType?: 'todo' | 'config' | 'archive' | 'log' | 'manifest';
|
|
39
33
|
filePath?: string;
|
|
34
|
+
type?: string;
|
|
35
|
+
data?: unknown;
|
|
40
36
|
}
|
|
41
37
|
export interface ValidateSchemaResult {
|
|
42
38
|
valid: boolean;
|
|
@@ -44,35 +40,55 @@ export interface ValidateSchemaResult {
|
|
|
44
40
|
violations: ValidationViolation[];
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
taskId
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
| 'consensus'
|
|
53
|
-
| 'specification'
|
|
54
|
-
| 'decomposition'
|
|
55
|
-
| 'implementation'
|
|
56
|
-
| 'contribution'
|
|
57
|
-
| 'release';
|
|
43
|
+
export interface ValidateProtocolBaseParams {
|
|
44
|
+
mode?: 'task' | 'manifest';
|
|
45
|
+
taskId?: string;
|
|
46
|
+
manifestFile?: string;
|
|
47
|
+
strict?: boolean;
|
|
58
48
|
}
|
|
49
|
+
|
|
50
|
+
export interface ValidateProtocolParams extends ValidateProtocolBaseParams {
|
|
51
|
+
protocolType?: string;
|
|
52
|
+
votingMatrixFile?: string;
|
|
53
|
+
epicId?: string;
|
|
54
|
+
specFile?: string;
|
|
55
|
+
hasCodeChanges?: boolean;
|
|
56
|
+
adrContent?: string;
|
|
57
|
+
status?: 'proposed' | 'accepted' | 'superseded' | 'deprecated';
|
|
58
|
+
hitlReviewed?: boolean;
|
|
59
|
+
downstreamFlagged?: boolean;
|
|
60
|
+
persistedInDb?: boolean;
|
|
61
|
+
specMatchConfirmed?: boolean;
|
|
62
|
+
testSuitePassed?: boolean;
|
|
63
|
+
protocolComplianceChecked?: boolean;
|
|
64
|
+
framework?: string;
|
|
65
|
+
testsRun?: number;
|
|
66
|
+
testsPassed?: number;
|
|
67
|
+
testsFailed?: number;
|
|
68
|
+
coveragePercent?: number;
|
|
69
|
+
coverageThreshold?: number;
|
|
70
|
+
ivtLoopConverged?: boolean;
|
|
71
|
+
ivtLoopIterations?: number;
|
|
72
|
+
version?: string;
|
|
73
|
+
hasChangelog?: boolean;
|
|
74
|
+
artifactType?: string;
|
|
75
|
+
buildPassed?: boolean;
|
|
76
|
+
hasAttestation?: boolean;
|
|
77
|
+
hasSbom?: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
59
80
|
export interface ValidateProtocolResult {
|
|
60
81
|
taskId: string;
|
|
61
82
|
protocol: string;
|
|
62
83
|
passed: boolean;
|
|
63
84
|
score: number;
|
|
64
85
|
violations: ValidationViolation[];
|
|
65
|
-
requirements: {
|
|
66
|
-
total: number;
|
|
67
|
-
met: number;
|
|
68
|
-
failed: number;
|
|
69
|
-
};
|
|
86
|
+
requirements: { total: number; met: number; failed: number };
|
|
70
87
|
}
|
|
71
88
|
|
|
72
|
-
// validate.task
|
|
73
89
|
export interface ValidateTaskParams {
|
|
74
90
|
taskId: string;
|
|
75
|
-
checkMode
|
|
91
|
+
checkMode?: 'basic' | 'strict' | 'anti-hallucination';
|
|
76
92
|
}
|
|
77
93
|
export interface ValidateTaskResult {
|
|
78
94
|
taskId: string;
|
|
@@ -87,24 +103,18 @@ export interface ValidateTaskResult {
|
|
|
87
103
|
};
|
|
88
104
|
}
|
|
89
105
|
|
|
90
|
-
// validate.manifest
|
|
91
106
|
export interface ValidateManifestParams {
|
|
92
107
|
entry?: string;
|
|
93
108
|
taskId?: string;
|
|
94
109
|
}
|
|
95
110
|
export interface ValidateManifestResult {
|
|
96
111
|
valid: boolean;
|
|
97
|
-
entry: {
|
|
98
|
-
id: string;
|
|
99
|
-
file: string;
|
|
100
|
-
exists: boolean;
|
|
101
|
-
};
|
|
112
|
+
entry: { id: string; file: string; exists: boolean };
|
|
102
113
|
violations: ValidationViolation[];
|
|
103
114
|
}
|
|
104
115
|
|
|
105
|
-
// validate.output
|
|
106
116
|
export interface ValidateOutputParams {
|
|
107
|
-
taskId
|
|
117
|
+
taskId?: string;
|
|
108
118
|
filePath: string;
|
|
109
119
|
}
|
|
110
120
|
export interface ValidateOutputResult {
|
|
@@ -121,32 +131,30 @@ export interface ValidateOutputResult {
|
|
|
121
131
|
violations: ValidationViolation[];
|
|
122
132
|
}
|
|
123
133
|
|
|
124
|
-
// validate.compliance.summary
|
|
125
134
|
export interface ValidateComplianceSummaryParams {
|
|
126
135
|
scope?: string;
|
|
127
136
|
since?: string;
|
|
137
|
+
detail?: boolean;
|
|
138
|
+
limit?: number;
|
|
139
|
+
type?: string;
|
|
140
|
+
taskId?: string;
|
|
141
|
+
days?: number;
|
|
142
|
+
global?: unknown;
|
|
128
143
|
}
|
|
129
144
|
export type ValidateComplianceSummaryResult = ComplianceMetrics;
|
|
130
145
|
|
|
131
|
-
// validate.compliance.violations
|
|
132
146
|
export interface ValidateComplianceViolationsParams {
|
|
133
147
|
severity?: ValidationSeverity;
|
|
134
148
|
protocol?: string;
|
|
135
149
|
}
|
|
136
150
|
export interface ValidateComplianceViolationsResult {
|
|
137
|
-
violations: Array<
|
|
138
|
-
ValidationViolation & {
|
|
139
|
-
taskId: string;
|
|
140
|
-
protocol: string;
|
|
141
|
-
timestamp: string;
|
|
142
|
-
}
|
|
143
|
-
>;
|
|
151
|
+
violations: Array<ValidationViolation & { taskId: string; protocol: string; timestamp: string }>;
|
|
144
152
|
total: number;
|
|
145
153
|
}
|
|
146
154
|
|
|
147
|
-
// validate.test.status
|
|
148
155
|
export interface ValidateTestStatusParams {
|
|
149
156
|
taskId?: string;
|
|
157
|
+
format?: string;
|
|
150
158
|
}
|
|
151
159
|
export interface ValidateTestStatusResult {
|
|
152
160
|
total: number;
|
|
@@ -157,7 +165,6 @@ export interface ValidateTestStatusResult {
|
|
|
157
165
|
byTask?: Record<string, { passed: number; failed: number }>;
|
|
158
166
|
}
|
|
159
167
|
|
|
160
|
-
// validate.test.coverage
|
|
161
168
|
export interface ValidateTestCoverageParams {
|
|
162
169
|
taskId?: string;
|
|
163
170
|
}
|
|
@@ -170,14 +177,109 @@ export interface ValidateTestCoverageResult {
|
|
|
170
177
|
meetsThreshold: boolean;
|
|
171
178
|
}
|
|
172
179
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
180
|
+
export interface ValidateCoherenceParams {
|
|
181
|
+
taskId?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ValidateCoherenceResult {
|
|
184
|
+
passed: boolean;
|
|
185
|
+
issues: string[];
|
|
186
|
+
warnings: string[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface ValidateGateParams {
|
|
190
|
+
taskId: string;
|
|
191
|
+
gate?: string;
|
|
192
|
+
value?: boolean;
|
|
193
|
+
agent?: string;
|
|
194
|
+
all?: boolean;
|
|
195
|
+
reset?: boolean;
|
|
196
|
+
evidence?: string;
|
|
197
|
+
sessionId?: string;
|
|
198
|
+
}
|
|
199
|
+
export interface ValidateGateResult {
|
|
200
|
+
taskId: string;
|
|
201
|
+
gates: Record<string, boolean>;
|
|
202
|
+
passed: boolean;
|
|
203
|
+
round: number;
|
|
204
|
+
}
|
|
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
|
+
|
|
222
|
+
export type ArchiveReportTypeAlias =
|
|
223
|
+
| 'summary'
|
|
224
|
+
| 'by-phase'
|
|
225
|
+
| 'by-label'
|
|
226
|
+
| 'by-priority'
|
|
227
|
+
| 'cycle-times'
|
|
228
|
+
| 'trends';
|
|
229
|
+
|
|
230
|
+
export interface ValidateArchiveStatsParams {
|
|
231
|
+
period?: number;
|
|
232
|
+
report?: ArchiveReportTypeAlias;
|
|
233
|
+
since?: string;
|
|
234
|
+
until?: string;
|
|
235
|
+
}
|
|
236
|
+
export type ValidateArchiveStatsResult = Record<string, unknown>;
|
|
237
|
+
|
|
238
|
+
export interface ValidateChainParams {
|
|
239
|
+
chain: WarpChain;
|
|
240
|
+
}
|
|
241
|
+
export interface ValidateChainResult {
|
|
242
|
+
wellFormed: boolean;
|
|
243
|
+
gateSatisfiable: boolean;
|
|
244
|
+
errors: string[];
|
|
245
|
+
warnings: string[];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface ValidateGradeParams {
|
|
249
|
+
sessionId: string;
|
|
250
|
+
}
|
|
251
|
+
export type ValidateGradeResult = Record<string, unknown>;
|
|
252
|
+
|
|
253
|
+
export interface ValidateGradeListParams {
|
|
254
|
+
sessionId?: string;
|
|
255
|
+
limit?: number;
|
|
256
|
+
offset?: number;
|
|
257
|
+
}
|
|
258
|
+
export interface ValidateGradeListResult {
|
|
259
|
+
grades: unknown[];
|
|
260
|
+
total: number;
|
|
261
|
+
filtered: number;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface ValidateCanonParams {
|
|
265
|
+
taskId?: string;
|
|
266
|
+
}
|
|
267
|
+
export interface ValidateCanonResult {
|
|
268
|
+
passed: boolean;
|
|
269
|
+
violations: unknown[];
|
|
270
|
+
assertions: Array<{ passed: boolean }>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface ValidateWorkflowComplianceParams {
|
|
274
|
+
since?: string;
|
|
275
|
+
}
|
|
276
|
+
export type ValidateWorkflowComplianceResult = Record<string, unknown>;
|
|
176
277
|
|
|
177
|
-
// validate.compliance.record
|
|
178
278
|
export interface ValidateComplianceRecordParams {
|
|
179
279
|
taskId: string;
|
|
180
|
-
result:
|
|
280
|
+
result: string;
|
|
281
|
+
protocol?: string;
|
|
282
|
+
violations?: Array<{ code: string; message: string; severity: 'error' | 'warning' }>;
|
|
181
283
|
}
|
|
182
284
|
export interface ValidateComplianceRecordResult {
|
|
183
285
|
taskId: string;
|
|
@@ -185,7 +287,6 @@ export interface ValidateComplianceRecordResult {
|
|
|
185
287
|
metrics: ComplianceMetrics;
|
|
186
288
|
}
|
|
187
289
|
|
|
188
|
-
// validate.test.run
|
|
189
290
|
export interface ValidateTestRunParams {
|
|
190
291
|
scope?: string;
|
|
191
292
|
pattern?: string;
|
|
@@ -197,3 +298,8 @@ export interface ValidateTestRunResult {
|
|
|
197
298
|
duration: string;
|
|
198
299
|
output?: string;
|
|
199
300
|
}
|
|
301
|
+
|
|
302
|
+
export interface ValidateComplianceSyncParams {
|
|
303
|
+
force?: boolean;
|
|
304
|
+
}
|
|
305
|
+
export type ValidateComplianceSyncResult = Record<string, unknown>;
|
package/src/task-record.ts
CHANGED
|
@@ -61,6 +61,25 @@ export interface TaskRecord {
|
|
|
61
61
|
cancellationReason?: string;
|
|
62
62
|
/** RCASD-IVTR+C pipeline stage. @task T060 */
|
|
63
63
|
pipelineStage?: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Task role axis — intent of work (string-widened from {@link TaskRole}).
|
|
66
|
+
* Values: work | research | experiment | bug | spike | release
|
|
67
|
+
* @task T944
|
|
68
|
+
*/
|
|
69
|
+
role?: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Task scope axis — granularity of work (string-widened from {@link TaskScope}).
|
|
72
|
+
* Values: project | feature | unit
|
|
73
|
+
* @task T944
|
|
74
|
+
*/
|
|
75
|
+
scope?: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* Bug severity (string-widened from {@link TaskSeverity}).
|
|
78
|
+
* Only valid when role='bug'. OWNER-WRITE-ONLY.
|
|
79
|
+
* Values: P0 | P1 | P2 | P3
|
|
80
|
+
* @task T944
|
|
81
|
+
*/
|
|
82
|
+
severity?: string | null;
|
|
64
83
|
}
|
|
65
84
|
|
|
66
85
|
/**
|