cmp-standards 2.6.0 → 2.8.0-alpha
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/README.md +633 -633
- package/dist/cache/EmbeddingCache.d.ts +109 -0
- package/dist/cache/EmbeddingCache.d.ts.map +1 -0
- package/dist/cache/EmbeddingCache.js +239 -0
- package/dist/cache/EmbeddingCache.js.map +1 -0
- package/dist/cache/index.d.ts +6 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +6 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/db/turso-client.js +11 -11
- package/dist/eslint/rules/no-async-useeffect.js +6 -6
- package/dist/events/EventBus.d.ts +87 -0
- package/dist/events/EventBus.d.ts.map +1 -0
- package/dist/events/EventBus.js +200 -0
- package/dist/events/EventBus.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +9 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/types.d.ts +989 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/events/types.js +136 -0
- package/dist/events/types.js.map +1 -0
- package/dist/experts/ConsensusEngine.d.ts +57 -0
- package/dist/experts/ConsensusEngine.d.ts.map +1 -0
- package/dist/experts/ConsensusEngine.js +146 -0
- package/dist/experts/ConsensusEngine.js.map +1 -0
- package/dist/experts/ExpertPanelService.d.ts +84 -0
- package/dist/experts/ExpertPanelService.d.ts.map +1 -0
- package/dist/experts/ExpertPanelService.js +204 -0
- package/dist/experts/ExpertPanelService.js.map +1 -0
- package/dist/experts/ExpertRouter.d.ts +68 -0
- package/dist/experts/ExpertRouter.d.ts.map +1 -0
- package/dist/experts/ExpertRouter.js +374 -0
- package/dist/experts/ExpertRouter.js.map +1 -0
- package/dist/experts/VoteCollector.d.ts +58 -0
- package/dist/experts/VoteCollector.d.ts.map +1 -0
- package/dist/experts/VoteCollector.js +146 -0
- package/dist/experts/VoteCollector.js.map +1 -0
- package/dist/experts/index.d.ts +9 -0
- package/dist/experts/index.d.ts.map +1 -0
- package/dist/experts/index.js +13 -0
- package/dist/experts/index.js.map +1 -0
- package/dist/hooks/cloud-pre-tool-use.js +20 -20
- package/dist/hooks/expert-review.d.ts +74 -0
- package/dist/hooks/expert-review.d.ts.map +1 -0
- package/dist/hooks/expert-review.js +220 -0
- package/dist/hooks/expert-review.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/performance/Debouncer.d.ts +91 -0
- package/dist/performance/Debouncer.d.ts.map +1 -0
- package/dist/performance/Debouncer.js +198 -0
- package/dist/performance/Debouncer.js.map +1 -0
- package/dist/performance/MemoryDecay.d.ts +82 -0
- package/dist/performance/MemoryDecay.d.ts.map +1 -0
- package/dist/performance/MemoryDecay.js +153 -0
- package/dist/performance/MemoryDecay.js.map +1 -0
- package/dist/performance/index.d.ts +7 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +9 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/schema/expert-types.d.ts +395 -0
- package/dist/schema/expert-types.d.ts.map +1 -0
- package/dist/schema/expert-types.js +250 -0
- package/dist/schema/expert-types.js.map +1 -0
- package/dist/schema/plans.d.ts +16 -16
- package/dist/schema/tracking.d.ts +90 -90
- package/dist/services/ContextGenerator.js +7 -7
- package/dist/services/ProjectScaffold.js +76 -76
- package/dist/services/context-injector.d.ts +6 -0
- package/dist/services/context-injector.d.ts.map +1 -1
- package/dist/services/context-injector.js +43 -3
- package/dist/services/context-injector.js.map +1 -1
- package/dist/services/memory-router.d.ts +25 -1
- package/dist/services/memory-router.d.ts.map +1 -1
- package/dist/services/memory-router.js +176 -32
- package/dist/services/memory-router.js.map +1 -1
- package/dist/services/pattern-tracker.d.ts +5 -1
- package/dist/services/pattern-tracker.d.ts.map +1 -1
- package/dist/services/pattern-tracker.js +114 -36
- package/dist/services/pattern-tracker.js.map +1 -1
- package/dist/services/semantic-search.js +2 -2
- package/dist/types/index.d.ts +329 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +186 -9
- package/dist/types/index.js.map +1 -1
- package/package.json +105 -100
- package/standards/README.md +50 -50
- package/standards/experts/expert-routing.md +215 -215
- package/standards/general/code-quality.md +86 -86
- package/standards/general/memory-usage.md +205 -205
- package/standards/general/sync-workflow.md +235 -235
- package/standards/general/workflow.md +82 -82
- package/standards/hooks/mandatory-tracking.md +446 -446
- package/standards/infrastructure/cloud-database.md +287 -287
- package/standards/mcp/server-design.md +243 -243
- package/standards/mcp/tool-patterns.md +354 -354
- package/standards/skills/skill-structure.md +286 -286
- package/standards/skills/workflow-design.md +323 -323
- package/standards/tools/tool-design.md +297 -297
- package/templates/agents/architecture-expert.md +61 -61
- package/templates/agents/database-expert.md +62 -62
- package/templates/agents/documentation-expert.md +57 -57
- package/templates/agents/memory-expert.md +88 -88
- package/templates/agents/performance-expert.md +61 -61
- package/templates/agents/security-expert.md +59 -59
- package/templates/agents/ux-expert.md +63 -63
- package/templates/agents/worker.md +75 -75
- package/templates/ai-skills/SKILL_TEMPLATE.md +55 -55
- package/templates/claude-settings.json +72 -72
- package/templates/commands/experts.md +138 -138
- package/templates/hooks/README.md +158 -158
- package/templates/hooks/project.config.json.template +77 -77
- package/templates/hooks/settings.local.json.template +57 -57
- package/templates/memory-config.json +56 -56
- package/templates/memory-config.schema.json +212 -212
- package/templates/settings.json +58 -58
- package/templates/skills/continue.md +205 -205
- package/templates/workflows/business-improvement.md +264 -264
- package/templates/workflows/expert-review.md +153 -153
- package/templates/workflows/internal-app.md +245 -245
- package/templates/workflows/sync-docs.md +187 -187
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Expert Types Schema - cmp-standards v2.8
|
|
3
|
+
* @description Type definitions for expert panel system
|
|
4
|
+
*
|
|
5
|
+
* These types extend the existing DEV_Items.content JSON schema
|
|
6
|
+
* to support expert decisions, recommendations, and pattern tracking.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
export declare const ExpertIssueSchema: z.ZodObject<{
|
|
10
|
+
/** Issue severity level */
|
|
11
|
+
severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
|
|
12
|
+
/** Issue description */
|
|
13
|
+
message: z.ZodString;
|
|
14
|
+
/** Affected file path */
|
|
15
|
+
file: z.ZodOptional<z.ZodString>;
|
|
16
|
+
/** Line number in file */
|
|
17
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
/** Suggested fix */
|
|
19
|
+
fix: z.ZodOptional<z.ZodString>;
|
|
20
|
+
/** Issue category */
|
|
21
|
+
category: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
message: string;
|
|
24
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
25
|
+
line?: number | undefined;
|
|
26
|
+
category?: string | undefined;
|
|
27
|
+
fix?: string | undefined;
|
|
28
|
+
file?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
message: string;
|
|
31
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
32
|
+
line?: number | undefined;
|
|
33
|
+
category?: string | undefined;
|
|
34
|
+
fix?: string | undefined;
|
|
35
|
+
file?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export type ExpertIssue = z.infer<typeof ExpertIssueSchema>;
|
|
38
|
+
export declare const ExpertVoteSchema: z.ZodEnum<["APPROVE", "REJECT", "WARN", "ABSTAIN"]>;
|
|
39
|
+
export type ExpertVote = z.infer<typeof ExpertVoteSchema>;
|
|
40
|
+
export declare const ExpertDecisionContentSchema: z.ZodObject<{
|
|
41
|
+
/** Expert identifier (e.g., 'security-expert', 'performance-expert') */
|
|
42
|
+
expertId: z.ZodString;
|
|
43
|
+
/** Associated task ID */
|
|
44
|
+
taskId: z.ZodString;
|
|
45
|
+
/** Expert's vote */
|
|
46
|
+
vote: z.ZodEnum<["APPROVE", "REJECT", "WARN", "ABSTAIN"]>;
|
|
47
|
+
/** Confidence level (0.0 - 1.0) */
|
|
48
|
+
confidence: z.ZodNumber;
|
|
49
|
+
/** Detailed reasoning for the decision */
|
|
50
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
51
|
+
/** List of issues found */
|
|
52
|
+
issues: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
53
|
+
/** Issue severity level */
|
|
54
|
+
severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
|
|
55
|
+
/** Issue description */
|
|
56
|
+
message: z.ZodString;
|
|
57
|
+
/** Affected file path */
|
|
58
|
+
file: z.ZodOptional<z.ZodString>;
|
|
59
|
+
/** Line number in file */
|
|
60
|
+
line: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
/** Suggested fix */
|
|
62
|
+
fix: z.ZodOptional<z.ZodString>;
|
|
63
|
+
/** Issue category */
|
|
64
|
+
category: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
message: string;
|
|
67
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
68
|
+
line?: number | undefined;
|
|
69
|
+
category?: string | undefined;
|
|
70
|
+
fix?: string | undefined;
|
|
71
|
+
file?: string | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
message: string;
|
|
74
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
75
|
+
line?: number | undefined;
|
|
76
|
+
category?: string | undefined;
|
|
77
|
+
fix?: string | undefined;
|
|
78
|
+
file?: string | undefined;
|
|
79
|
+
}>, "many">>;
|
|
80
|
+
/** Files reviewed */
|
|
81
|
+
filesReviewed: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
82
|
+
/** Time taken for review in milliseconds */
|
|
83
|
+
reviewDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
/** When the review was completed */
|
|
85
|
+
reviewedAt: z.ZodString;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
issues: {
|
|
88
|
+
message: string;
|
|
89
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
90
|
+
line?: number | undefined;
|
|
91
|
+
category?: string | undefined;
|
|
92
|
+
fix?: string | undefined;
|
|
93
|
+
file?: string | undefined;
|
|
94
|
+
}[];
|
|
95
|
+
taskId: string;
|
|
96
|
+
expertId: string;
|
|
97
|
+
vote: "APPROVE" | "REJECT" | "WARN" | "ABSTAIN";
|
|
98
|
+
confidence: number;
|
|
99
|
+
filesReviewed: string[];
|
|
100
|
+
reviewedAt: string;
|
|
101
|
+
reasoning?: string | undefined;
|
|
102
|
+
reviewDurationMs?: number | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
taskId: string;
|
|
105
|
+
expertId: string;
|
|
106
|
+
vote: "APPROVE" | "REJECT" | "WARN" | "ABSTAIN";
|
|
107
|
+
confidence: number;
|
|
108
|
+
reviewedAt: string;
|
|
109
|
+
issues?: {
|
|
110
|
+
message: string;
|
|
111
|
+
severity: "critical" | "high" | "medium" | "low";
|
|
112
|
+
line?: number | undefined;
|
|
113
|
+
category?: string | undefined;
|
|
114
|
+
fix?: string | undefined;
|
|
115
|
+
file?: string | undefined;
|
|
116
|
+
}[] | undefined;
|
|
117
|
+
reasoning?: string | undefined;
|
|
118
|
+
filesReviewed?: string[] | undefined;
|
|
119
|
+
reviewDurationMs?: number | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
export type ExpertDecisionContent = z.infer<typeof ExpertDecisionContentSchema>;
|
|
122
|
+
export declare const RecommendationPrioritySchema: z.ZodEnum<["critical", "high", "medium", "low"]>;
|
|
123
|
+
export declare const RecommendationEffortSchema: z.ZodEnum<["trivial", "small", "medium", "large"]>;
|
|
124
|
+
export declare const RecommendationStatusSchema: z.ZodEnum<["pending", "approved", "rejected", "implemented", "deferred"]>;
|
|
125
|
+
export declare const ExpertRecommendationContentSchema: z.ZodObject<{
|
|
126
|
+
/** Expert that made the recommendation */
|
|
127
|
+
expertId: z.ZodString;
|
|
128
|
+
/** Associated task ID */
|
|
129
|
+
taskId: z.ZodString;
|
|
130
|
+
/** Area/domain of the recommendation */
|
|
131
|
+
area: z.ZodString;
|
|
132
|
+
/** Recommendation title */
|
|
133
|
+
title: z.ZodString;
|
|
134
|
+
/** Detailed description */
|
|
135
|
+
description: z.ZodString;
|
|
136
|
+
/** Priority level */
|
|
137
|
+
priority: z.ZodEnum<["critical", "high", "medium", "low"]>;
|
|
138
|
+
/** Estimated effort to implement */
|
|
139
|
+
effort: z.ZodEnum<["trivial", "small", "medium", "large"]>;
|
|
140
|
+
/** Current status */
|
|
141
|
+
status: z.ZodDefault<z.ZodEnum<["pending", "approved", "rejected", "implemented", "deferred"]>>;
|
|
142
|
+
/** Implementation details if implemented */
|
|
143
|
+
implementation: z.ZodOptional<z.ZodObject<{
|
|
144
|
+
/** PR or commit URL */
|
|
145
|
+
url: z.ZodString;
|
|
146
|
+
/** When it was implemented */
|
|
147
|
+
appliedAt: z.ZodString;
|
|
148
|
+
/** Implementation result */
|
|
149
|
+
result: z.ZodEnum<["success", "partial", "failed"]>;
|
|
150
|
+
/** Notes about implementation */
|
|
151
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
appliedAt: string;
|
|
154
|
+
result: "failed" | "success" | "partial";
|
|
155
|
+
url: string;
|
|
156
|
+
notes?: string | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
appliedAt: string;
|
|
159
|
+
result: "failed" | "success" | "partial";
|
|
160
|
+
url: string;
|
|
161
|
+
notes?: string | undefined;
|
|
162
|
+
}>>;
|
|
163
|
+
/** Feedback from user */
|
|
164
|
+
feedback: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
helpful: z.ZodBoolean;
|
|
166
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
helpful: boolean;
|
|
169
|
+
comment?: string | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
helpful: boolean;
|
|
172
|
+
comment?: string | undefined;
|
|
173
|
+
}>>;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
title: string;
|
|
176
|
+
status: "pending" | "implemented" | "rejected" | "deferred" | "approved";
|
|
177
|
+
description: string;
|
|
178
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
179
|
+
effort: "medium" | "small" | "large" | "trivial";
|
|
180
|
+
taskId: string;
|
|
181
|
+
area: string;
|
|
182
|
+
expertId: string;
|
|
183
|
+
feedback?: {
|
|
184
|
+
helpful: boolean;
|
|
185
|
+
comment?: string | undefined;
|
|
186
|
+
} | undefined;
|
|
187
|
+
implementation?: {
|
|
188
|
+
appliedAt: string;
|
|
189
|
+
result: "failed" | "success" | "partial";
|
|
190
|
+
url: string;
|
|
191
|
+
notes?: string | undefined;
|
|
192
|
+
} | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
title: string;
|
|
195
|
+
description: string;
|
|
196
|
+
priority: "critical" | "high" | "medium" | "low";
|
|
197
|
+
effort: "medium" | "small" | "large" | "trivial";
|
|
198
|
+
taskId: string;
|
|
199
|
+
area: string;
|
|
200
|
+
expertId: string;
|
|
201
|
+
status?: "pending" | "implemented" | "rejected" | "deferred" | "approved" | undefined;
|
|
202
|
+
feedback?: {
|
|
203
|
+
helpful: boolean;
|
|
204
|
+
comment?: string | undefined;
|
|
205
|
+
} | undefined;
|
|
206
|
+
implementation?: {
|
|
207
|
+
appliedAt: string;
|
|
208
|
+
result: "failed" | "success" | "partial";
|
|
209
|
+
url: string;
|
|
210
|
+
notes?: string | undefined;
|
|
211
|
+
} | undefined;
|
|
212
|
+
}>;
|
|
213
|
+
export type ExpertRecommendationContent = z.infer<typeof ExpertRecommendationContentSchema>;
|
|
214
|
+
export declare const PatternTrendSchema: z.ZodEnum<["increasing", "stable", "decreasing"]>;
|
|
215
|
+
export declare const PatternStatContentSchema: z.ZodObject<{
|
|
216
|
+
/** Unique pattern identifier */
|
|
217
|
+
patternId: z.ZodString;
|
|
218
|
+
/** Human-readable pattern name */
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
/** Pattern description */
|
|
221
|
+
description: z.ZodOptional<z.ZodString>;
|
|
222
|
+
/** Total number of occurrences */
|
|
223
|
+
occurrenceCount: z.ZodDefault<z.ZodNumber>;
|
|
224
|
+
/** Average severity (0.0 - 1.0) */
|
|
225
|
+
avgSeverity: z.ZodDefault<z.ZodNumber>;
|
|
226
|
+
/** Last time this pattern was detected */
|
|
227
|
+
lastSeen: z.ZodOptional<z.ZodString>;
|
|
228
|
+
/** First time this pattern was detected */
|
|
229
|
+
firstSeen: z.ZodOptional<z.ZodString>;
|
|
230
|
+
/** Trend direction */
|
|
231
|
+
trend: z.ZodDefault<z.ZodEnum<["increasing", "stable", "decreasing"]>>;
|
|
232
|
+
/** Whether this pattern has been persistent */
|
|
233
|
+
isPersistent: z.ZodDefault<z.ZodBoolean>;
|
|
234
|
+
/** Files where this pattern was detected */
|
|
235
|
+
files: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
236
|
+
/** Whether auto-improvement has been triggered */
|
|
237
|
+
autoImproveTriggered: z.ZodDefault<z.ZodBoolean>;
|
|
238
|
+
/** Generated ESLint rule ID (if any) */
|
|
239
|
+
eslintRuleId: z.ZodOptional<z.ZodString>;
|
|
240
|
+
/** Pattern effectiveness score (based on compliance) */
|
|
241
|
+
effectivenessScore: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
patternId: string;
|
|
244
|
+
files: string[];
|
|
245
|
+
name: string;
|
|
246
|
+
autoImproveTriggered: boolean;
|
|
247
|
+
occurrenceCount: number;
|
|
248
|
+
avgSeverity: number;
|
|
249
|
+
trend: "increasing" | "decreasing" | "stable";
|
|
250
|
+
isPersistent: boolean;
|
|
251
|
+
description?: string | undefined;
|
|
252
|
+
firstSeen?: string | undefined;
|
|
253
|
+
lastSeen?: string | undefined;
|
|
254
|
+
eslintRuleId?: string | undefined;
|
|
255
|
+
effectivenessScore?: number | undefined;
|
|
256
|
+
}, {
|
|
257
|
+
patternId: string;
|
|
258
|
+
name: string;
|
|
259
|
+
description?: string | undefined;
|
|
260
|
+
files?: string[] | undefined;
|
|
261
|
+
firstSeen?: string | undefined;
|
|
262
|
+
lastSeen?: string | undefined;
|
|
263
|
+
autoImproveTriggered?: boolean | undefined;
|
|
264
|
+
occurrenceCount?: number | undefined;
|
|
265
|
+
avgSeverity?: number | undefined;
|
|
266
|
+
trend?: "increasing" | "decreasing" | "stable" | undefined;
|
|
267
|
+
isPersistent?: boolean | undefined;
|
|
268
|
+
eslintRuleId?: string | undefined;
|
|
269
|
+
effectivenessScore?: number | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
export type PatternStatContent = z.infer<typeof PatternStatContentSchema>;
|
|
272
|
+
export declare const MemoryRelationshipTypeSchema: z.ZodEnum<["relates_to", "contradicts", "extends", "replaces", "depends_on", "derived_from"]>;
|
|
273
|
+
export declare const MemoryLinkContentSchema: z.ZodObject<{
|
|
274
|
+
/** Source memory ID */
|
|
275
|
+
sourceId: z.ZodString;
|
|
276
|
+
/** Target memory ID */
|
|
277
|
+
targetId: z.ZodString;
|
|
278
|
+
/** Relationship type */
|
|
279
|
+
relationshipType: z.ZodEnum<["relates_to", "contradicts", "extends", "replaces", "depends_on", "derived_from"]>;
|
|
280
|
+
/** Confidence in the relationship (0.0 - 1.0) */
|
|
281
|
+
confidence: z.ZodNumber;
|
|
282
|
+
/** Optional description of the relationship */
|
|
283
|
+
description: z.ZodOptional<z.ZodString>;
|
|
284
|
+
/** Who/what created this link */
|
|
285
|
+
createdBy: z.ZodDefault<z.ZodEnum<["user", "system", "expert"]>>;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
createdBy: "user" | "system" | "expert";
|
|
288
|
+
confidence: number;
|
|
289
|
+
sourceId: string;
|
|
290
|
+
targetId: string;
|
|
291
|
+
relationshipType: "extends" | "relates_to" | "contradicts" | "replaces" | "depends_on" | "derived_from";
|
|
292
|
+
description?: string | undefined;
|
|
293
|
+
}, {
|
|
294
|
+
confidence: number;
|
|
295
|
+
sourceId: string;
|
|
296
|
+
targetId: string;
|
|
297
|
+
relationshipType: "extends" | "relates_to" | "contradicts" | "replaces" | "depends_on" | "derived_from";
|
|
298
|
+
description?: string | undefined;
|
|
299
|
+
createdBy?: "user" | "system" | "expert" | undefined;
|
|
300
|
+
}>;
|
|
301
|
+
export type MemoryLinkContent = z.infer<typeof MemoryLinkContentSchema>;
|
|
302
|
+
export declare const ConsensusThresholdSchema: z.ZodEnum<["UNANIMITY", "MAJORITY"]>;
|
|
303
|
+
export declare const ConsensusDecisionSchema: z.ZodEnum<["APPROVED", "REJECTED", "NEEDS_REVIEW"]>;
|
|
304
|
+
export declare const ConsensusResultContentSchema: z.ZodObject<{
|
|
305
|
+
/** Associated task ID */
|
|
306
|
+
taskId: z.ZodString;
|
|
307
|
+
/** Final decision */
|
|
308
|
+
decision: z.ZodEnum<["APPROVED", "REJECTED", "NEEDS_REVIEW"]>;
|
|
309
|
+
/** Threshold type used */
|
|
310
|
+
threshold: z.ZodEnum<["UNANIMITY", "MAJORITY"]>;
|
|
311
|
+
/** Whether threshold was met */
|
|
312
|
+
metThreshold: z.ZodBoolean;
|
|
313
|
+
/** Vote counts */
|
|
314
|
+
votes: z.ZodObject<{
|
|
315
|
+
approve: z.ZodNumber;
|
|
316
|
+
reject: z.ZodNumber;
|
|
317
|
+
warn: z.ZodNumber;
|
|
318
|
+
abstain: z.ZodNumber;
|
|
319
|
+
}, "strip", z.ZodTypeAny, {
|
|
320
|
+
warn: number;
|
|
321
|
+
approve: number;
|
|
322
|
+
reject: number;
|
|
323
|
+
abstain: number;
|
|
324
|
+
}, {
|
|
325
|
+
warn: number;
|
|
326
|
+
approve: number;
|
|
327
|
+
reject: number;
|
|
328
|
+
abstain: number;
|
|
329
|
+
}>;
|
|
330
|
+
/** Average confidence across all experts */
|
|
331
|
+
avgConfidence: z.ZodNumber;
|
|
332
|
+
/** List of expert decision IDs */
|
|
333
|
+
expertDecisionIds: z.ZodArray<z.ZodString, "many">;
|
|
334
|
+
/** Time taken for full panel review in ms */
|
|
335
|
+
panelDurationMs: z.ZodNumber;
|
|
336
|
+
}, "strip", z.ZodTypeAny, {
|
|
337
|
+
taskId: string;
|
|
338
|
+
decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
|
|
339
|
+
threshold: "UNANIMITY" | "MAJORITY";
|
|
340
|
+
votes: {
|
|
341
|
+
warn: number;
|
|
342
|
+
approve: number;
|
|
343
|
+
reject: number;
|
|
344
|
+
abstain: number;
|
|
345
|
+
};
|
|
346
|
+
metThreshold: boolean;
|
|
347
|
+
avgConfidence: number;
|
|
348
|
+
expertDecisionIds: string[];
|
|
349
|
+
panelDurationMs: number;
|
|
350
|
+
}, {
|
|
351
|
+
taskId: string;
|
|
352
|
+
decision: "APPROVED" | "REJECTED" | "NEEDS_REVIEW";
|
|
353
|
+
threshold: "UNANIMITY" | "MAJORITY";
|
|
354
|
+
votes: {
|
|
355
|
+
warn: number;
|
|
356
|
+
approve: number;
|
|
357
|
+
reject: number;
|
|
358
|
+
abstain: number;
|
|
359
|
+
};
|
|
360
|
+
metThreshold: boolean;
|
|
361
|
+
avgConfidence: number;
|
|
362
|
+
expertDecisionIds: string[];
|
|
363
|
+
panelDurationMs: number;
|
|
364
|
+
}>;
|
|
365
|
+
export type ConsensusResultContent = z.infer<typeof ConsensusResultContentSchema>;
|
|
366
|
+
/**
|
|
367
|
+
* Extended item types for v2.8
|
|
368
|
+
* These are stored in DEV_Items.type column
|
|
369
|
+
*/
|
|
370
|
+
export declare const ItemTypeV28Schema: z.ZodEnum<["memory", "task", "improvement", "plan", "session", "checkpoint", "expert_decision", "expert_recommendation", "pattern_stat", "memory_link", "consensus_result"]>;
|
|
371
|
+
export type ItemTypeV28 = z.infer<typeof ItemTypeV28Schema>;
|
|
372
|
+
/**
|
|
373
|
+
* Create an expert decision content object
|
|
374
|
+
*/
|
|
375
|
+
export declare function createExpertDecision(expertId: string, taskId: string, vote: ExpertVote, options?: {
|
|
376
|
+
confidence?: number;
|
|
377
|
+
reasoning?: string;
|
|
378
|
+
issues?: ExpertIssue[];
|
|
379
|
+
filesReviewed?: string[];
|
|
380
|
+
reviewDurationMs?: number;
|
|
381
|
+
}): ExpertDecisionContent;
|
|
382
|
+
/**
|
|
383
|
+
* Create a pattern stat content object
|
|
384
|
+
*/
|
|
385
|
+
export declare function createPatternStat(patternId: string, name: string, options?: {
|
|
386
|
+
description?: string;
|
|
387
|
+
occurrenceCount?: number;
|
|
388
|
+
avgSeverity?: number;
|
|
389
|
+
files?: string[];
|
|
390
|
+
}): PatternStatContent;
|
|
391
|
+
/**
|
|
392
|
+
* Create a memory link content object
|
|
393
|
+
*/
|
|
394
|
+
export declare function createMemoryLink(sourceId: string, targetId: string, relationshipType: z.infer<typeof MemoryRelationshipTypeSchema>, confidence?: number): MemoryLinkContent;
|
|
395
|
+
//# sourceMappingURL=expert-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expert-types.d.ts","sourceRoot":"","sources":["../../src/schema/expert-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,iBAAiB;IAC5B,2BAA2B;;IAE3B,wBAAwB;;IAExB,yBAAyB;;IAEzB,0BAA0B;;IAE1B,oBAAoB;;IAEpB,qBAAqB;;;;;;;;;;;;;;;;EAErB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,gBAAgB,qDAAmD,CAAA;AAEhF,MAAM,MAAM,UAAU,GA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AAC,EAAE,WAAW,EAAE,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACrB,GACL,qBAAqB,CAYvB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACZ,GACL,kBAAkB,CAepB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,EAC9D,UAAU,GAAE,MAAY,GACvB,iBAAiB,CAQnB"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Expert Types Schema - cmp-standards v2.8
|
|
3
|
+
* @description Type definitions for expert panel system
|
|
4
|
+
*
|
|
5
|
+
* These types extend the existing DEV_Items.content JSON schema
|
|
6
|
+
* to support expert decisions, recommendations, and pattern tracking.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Expert Decision Schema
|
|
11
|
+
// =============================================================================
|
|
12
|
+
export const ExpertIssueSchema = z.object({
|
|
13
|
+
/** Issue severity level */
|
|
14
|
+
severity: z.enum(['critical', 'high', 'medium', 'low']),
|
|
15
|
+
/** Issue description */
|
|
16
|
+
message: z.string(),
|
|
17
|
+
/** Affected file path */
|
|
18
|
+
file: z.string().optional(),
|
|
19
|
+
/** Line number in file */
|
|
20
|
+
line: z.number().optional(),
|
|
21
|
+
/** Suggested fix */
|
|
22
|
+
fix: z.string().optional(),
|
|
23
|
+
/** Issue category */
|
|
24
|
+
category: z.string().optional(),
|
|
25
|
+
});
|
|
26
|
+
export const ExpertVoteSchema = z.enum(['APPROVE', 'REJECT', 'WARN', 'ABSTAIN']);
|
|
27
|
+
export const ExpertDecisionContentSchema = z.object({
|
|
28
|
+
/** Expert identifier (e.g., 'security-expert', 'performance-expert') */
|
|
29
|
+
expertId: z.string(),
|
|
30
|
+
/** Associated task ID */
|
|
31
|
+
taskId: z.string(),
|
|
32
|
+
/** Expert's vote */
|
|
33
|
+
vote: ExpertVoteSchema,
|
|
34
|
+
/** Confidence level (0.0 - 1.0) */
|
|
35
|
+
confidence: z.number().min(0).max(1),
|
|
36
|
+
/** Detailed reasoning for the decision */
|
|
37
|
+
reasoning: z.string().optional(),
|
|
38
|
+
/** List of issues found */
|
|
39
|
+
issues: z.array(ExpertIssueSchema).default([]),
|
|
40
|
+
/** Files reviewed */
|
|
41
|
+
filesReviewed: z.array(z.string()).default([]),
|
|
42
|
+
/** Time taken for review in milliseconds */
|
|
43
|
+
reviewDurationMs: z.number().optional(),
|
|
44
|
+
/** When the review was completed */
|
|
45
|
+
reviewedAt: z.string(),
|
|
46
|
+
});
|
|
47
|
+
// =============================================================================
|
|
48
|
+
// Expert Recommendation Schema
|
|
49
|
+
// =============================================================================
|
|
50
|
+
export const RecommendationPrioritySchema = z.enum(['critical', 'high', 'medium', 'low']);
|
|
51
|
+
export const RecommendationEffortSchema = z.enum(['trivial', 'small', 'medium', 'large']);
|
|
52
|
+
export const RecommendationStatusSchema = z.enum([
|
|
53
|
+
'pending',
|
|
54
|
+
'approved',
|
|
55
|
+
'rejected',
|
|
56
|
+
'implemented',
|
|
57
|
+
'deferred',
|
|
58
|
+
]);
|
|
59
|
+
export const ExpertRecommendationContentSchema = z.object({
|
|
60
|
+
/** Expert that made the recommendation */
|
|
61
|
+
expertId: z.string(),
|
|
62
|
+
/** Associated task ID */
|
|
63
|
+
taskId: z.string(),
|
|
64
|
+
/** Area/domain of the recommendation */
|
|
65
|
+
area: z.string(),
|
|
66
|
+
/** Recommendation title */
|
|
67
|
+
title: z.string(),
|
|
68
|
+
/** Detailed description */
|
|
69
|
+
description: z.string(),
|
|
70
|
+
/** Priority level */
|
|
71
|
+
priority: RecommendationPrioritySchema,
|
|
72
|
+
/** Estimated effort to implement */
|
|
73
|
+
effort: RecommendationEffortSchema,
|
|
74
|
+
/** Current status */
|
|
75
|
+
status: RecommendationStatusSchema.default('pending'),
|
|
76
|
+
/** Implementation details if implemented */
|
|
77
|
+
implementation: z.object({
|
|
78
|
+
/** PR or commit URL */
|
|
79
|
+
url: z.string(),
|
|
80
|
+
/** When it was implemented */
|
|
81
|
+
appliedAt: z.string(),
|
|
82
|
+
/** Implementation result */
|
|
83
|
+
result: z.enum(['success', 'partial', 'failed']),
|
|
84
|
+
/** Notes about implementation */
|
|
85
|
+
notes: z.string().optional(),
|
|
86
|
+
}).optional(),
|
|
87
|
+
/** Feedback from user */
|
|
88
|
+
feedback: z.object({
|
|
89
|
+
helpful: z.boolean(),
|
|
90
|
+
comment: z.string().optional(),
|
|
91
|
+
}).optional(),
|
|
92
|
+
});
|
|
93
|
+
// =============================================================================
|
|
94
|
+
// Pattern Statistics Schema
|
|
95
|
+
// =============================================================================
|
|
96
|
+
export const PatternTrendSchema = z.enum(['increasing', 'stable', 'decreasing']);
|
|
97
|
+
export const PatternStatContentSchema = z.object({
|
|
98
|
+
/** Unique pattern identifier */
|
|
99
|
+
patternId: z.string(),
|
|
100
|
+
/** Human-readable pattern name */
|
|
101
|
+
name: z.string(),
|
|
102
|
+
/** Pattern description */
|
|
103
|
+
description: z.string().optional(),
|
|
104
|
+
/** Total number of occurrences */
|
|
105
|
+
occurrenceCount: z.number().default(0),
|
|
106
|
+
/** Average severity (0.0 - 1.0) */
|
|
107
|
+
avgSeverity: z.number().min(0).max(1).default(0.5),
|
|
108
|
+
/** Last time this pattern was detected */
|
|
109
|
+
lastSeen: z.string().optional(),
|
|
110
|
+
/** First time this pattern was detected */
|
|
111
|
+
firstSeen: z.string().optional(),
|
|
112
|
+
/** Trend direction */
|
|
113
|
+
trend: PatternTrendSchema.default('stable'),
|
|
114
|
+
/** Whether this pattern has been persistent */
|
|
115
|
+
isPersistent: z.boolean().default(false),
|
|
116
|
+
/** Files where this pattern was detected */
|
|
117
|
+
files: z.array(z.string()).default([]),
|
|
118
|
+
/** Whether auto-improvement has been triggered */
|
|
119
|
+
autoImproveTriggered: z.boolean().default(false),
|
|
120
|
+
/** Generated ESLint rule ID (if any) */
|
|
121
|
+
eslintRuleId: z.string().optional(),
|
|
122
|
+
/** Pattern effectiveness score (based on compliance) */
|
|
123
|
+
effectivenessScore: z.number().min(0).max(1).optional(),
|
|
124
|
+
});
|
|
125
|
+
// =============================================================================
|
|
126
|
+
// Memory Link Schema (Relationships between memories)
|
|
127
|
+
// =============================================================================
|
|
128
|
+
export const MemoryRelationshipTypeSchema = z.enum([
|
|
129
|
+
'relates_to',
|
|
130
|
+
'contradicts',
|
|
131
|
+
'extends',
|
|
132
|
+
'replaces',
|
|
133
|
+
'depends_on',
|
|
134
|
+
'derived_from',
|
|
135
|
+
]);
|
|
136
|
+
export const MemoryLinkContentSchema = z.object({
|
|
137
|
+
/** Source memory ID */
|
|
138
|
+
sourceId: z.string(),
|
|
139
|
+
/** Target memory ID */
|
|
140
|
+
targetId: z.string(),
|
|
141
|
+
/** Relationship type */
|
|
142
|
+
relationshipType: MemoryRelationshipTypeSchema,
|
|
143
|
+
/** Confidence in the relationship (0.0 - 1.0) */
|
|
144
|
+
confidence: z.number().min(0).max(1),
|
|
145
|
+
/** Optional description of the relationship */
|
|
146
|
+
description: z.string().optional(),
|
|
147
|
+
/** Who/what created this link */
|
|
148
|
+
createdBy: z.enum(['user', 'system', 'expert']).default('system'),
|
|
149
|
+
});
|
|
150
|
+
// =============================================================================
|
|
151
|
+
// Consensus Result Schema
|
|
152
|
+
// =============================================================================
|
|
153
|
+
export const ConsensusThresholdSchema = z.enum(['UNANIMITY', 'MAJORITY']);
|
|
154
|
+
export const ConsensusDecisionSchema = z.enum(['APPROVED', 'REJECTED', 'NEEDS_REVIEW']);
|
|
155
|
+
export const ConsensusResultContentSchema = z.object({
|
|
156
|
+
/** Associated task ID */
|
|
157
|
+
taskId: z.string(),
|
|
158
|
+
/** Final decision */
|
|
159
|
+
decision: ConsensusDecisionSchema,
|
|
160
|
+
/** Threshold type used */
|
|
161
|
+
threshold: ConsensusThresholdSchema,
|
|
162
|
+
/** Whether threshold was met */
|
|
163
|
+
metThreshold: z.boolean(),
|
|
164
|
+
/** Vote counts */
|
|
165
|
+
votes: z.object({
|
|
166
|
+
approve: z.number(),
|
|
167
|
+
reject: z.number(),
|
|
168
|
+
warn: z.number(),
|
|
169
|
+
abstain: z.number(),
|
|
170
|
+
}),
|
|
171
|
+
/** Average confidence across all experts */
|
|
172
|
+
avgConfidence: z.number().min(0).max(1),
|
|
173
|
+
/** List of expert decision IDs */
|
|
174
|
+
expertDecisionIds: z.array(z.string()),
|
|
175
|
+
/** Time taken for full panel review in ms */
|
|
176
|
+
panelDurationMs: z.number(),
|
|
177
|
+
});
|
|
178
|
+
// =============================================================================
|
|
179
|
+
// Item Type Enum Extension
|
|
180
|
+
// =============================================================================
|
|
181
|
+
/**
|
|
182
|
+
* Extended item types for v2.8
|
|
183
|
+
* These are stored in DEV_Items.type column
|
|
184
|
+
*/
|
|
185
|
+
export const ItemTypeV28Schema = z.enum([
|
|
186
|
+
// Existing types
|
|
187
|
+
'memory',
|
|
188
|
+
'task',
|
|
189
|
+
'improvement',
|
|
190
|
+
'plan',
|
|
191
|
+
'session',
|
|
192
|
+
'checkpoint',
|
|
193
|
+
// New v2.8 types
|
|
194
|
+
'expert_decision',
|
|
195
|
+
'expert_recommendation',
|
|
196
|
+
'pattern_stat',
|
|
197
|
+
'memory_link',
|
|
198
|
+
'consensus_result',
|
|
199
|
+
]);
|
|
200
|
+
// =============================================================================
|
|
201
|
+
// Factory Functions
|
|
202
|
+
// =============================================================================
|
|
203
|
+
/**
|
|
204
|
+
* Create an expert decision content object
|
|
205
|
+
*/
|
|
206
|
+
export function createExpertDecision(expertId, taskId, vote, options = {}) {
|
|
207
|
+
return {
|
|
208
|
+
expertId,
|
|
209
|
+
taskId,
|
|
210
|
+
vote,
|
|
211
|
+
confidence: options.confidence ?? 0.8,
|
|
212
|
+
reasoning: options.reasoning,
|
|
213
|
+
issues: options.issues ?? [],
|
|
214
|
+
filesReviewed: options.filesReviewed ?? [],
|
|
215
|
+
reviewDurationMs: options.reviewDurationMs,
|
|
216
|
+
reviewedAt: new Date().toISOString(),
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Create a pattern stat content object
|
|
221
|
+
*/
|
|
222
|
+
export function createPatternStat(patternId, name, options = {}) {
|
|
223
|
+
const now = new Date().toISOString();
|
|
224
|
+
return {
|
|
225
|
+
patternId,
|
|
226
|
+
name,
|
|
227
|
+
description: options.description,
|
|
228
|
+
occurrenceCount: options.occurrenceCount ?? 1,
|
|
229
|
+
avgSeverity: options.avgSeverity ?? 0.5,
|
|
230
|
+
lastSeen: now,
|
|
231
|
+
firstSeen: now,
|
|
232
|
+
trend: 'stable',
|
|
233
|
+
isPersistent: false,
|
|
234
|
+
files: options.files ?? [],
|
|
235
|
+
autoImproveTriggered: false,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Create a memory link content object
|
|
240
|
+
*/
|
|
241
|
+
export function createMemoryLink(sourceId, targetId, relationshipType, confidence = 0.8) {
|
|
242
|
+
return {
|
|
243
|
+
sourceId,
|
|
244
|
+
targetId,
|
|
245
|
+
relationshipType,
|
|
246
|
+
confidence,
|
|
247
|
+
createdBy: 'system',
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=expert-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expert-types.js","sourceRoot":"","sources":["../../src/schema/expert-types.ts"],"names":[],"mappings":"AAAA;;;;;;G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