@su-record/vibe 3.2.19 → 3.2.21
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/cli/setup/ProjectSetup.d.ts.map +1 -1
- package/dist/cli/setup/ProjectSetup.js +13 -1
- package/dist/cli/setup/ProjectSetup.js.map +1 -1
- package/dist/tools/dispatch/deterministicSignals.d.ts.map +1 -1
- package/dist/tools/dispatch/deterministicSignals.js +15 -10
- package/dist/tools/dispatch/deterministicSignals.js.map +1 -1
- package/dist/tools/dispatch/vibePaths.d.ts +7 -0
- package/dist/tools/dispatch/vibePaths.d.ts.map +1 -0
- package/dist/tools/dispatch/vibePaths.js +35 -0
- package/dist/tools/dispatch/vibePaths.js.map +1 -0
- package/dist/tools/spec/validateSpecDocument.d.ts.map +1 -1
- package/dist/tools/spec/validateSpecDocument.js +33 -6
- package/dist/tools/spec/validateSpecDocument.js.map +1 -1
- package/hooks/scripts/code-check.js +90 -16
- package/hooks/scripts/lib/anchor.js +15 -4
- package/hooks/scripts/lib/inbox.js +10 -2
- package/package.json +1 -1
- package/dist/infra/lib/DeepInit.d.ts +0 -60
- package/dist/infra/lib/DeepInit.d.ts.map +0 -1
- package/dist/infra/lib/DeepInit.js +0 -245
- package/dist/infra/lib/DeepInit.js.map +0 -1
- package/dist/infra/lib/FrameworkDetector.d.ts +0 -56
- package/dist/infra/lib/FrameworkDetector.d.ts.map +0 -1
- package/dist/infra/lib/FrameworkDetector.js +0 -287
- package/dist/infra/lib/FrameworkDetector.js.map +0 -1
- package/dist/infra/lib/ModelRouter.d.ts +0 -48
- package/dist/infra/lib/ModelRouter.d.ts.map +0 -1
- package/dist/infra/lib/ModelRouter.js +0 -216
- package/dist/infra/lib/ModelRouter.js.map +0 -1
- package/dist/infra/lib/ReviewRace.d.ts +0 -86
- package/dist/infra/lib/ReviewRace.d.ts.map +0 -1
- package/dist/infra/lib/ReviewRace.js +0 -454
- package/dist/infra/lib/ReviewRace.js.map +0 -1
- package/dist/infra/lib/RuleBuildSystem.d.ts +0 -157
- package/dist/infra/lib/RuleBuildSystem.d.ts.map +0 -1
- package/dist/infra/lib/RuleBuildSystem.js +0 -550
- package/dist/infra/lib/RuleBuildSystem.js.map +0 -1
- package/dist/infra/lib/SkillQualityGate.d.ts +0 -42
- package/dist/infra/lib/SkillQualityGate.d.ts.map +0 -1
- package/dist/infra/lib/SkillQualityGate.js +0 -220
- package/dist/infra/lib/SkillQualityGate.js.map +0 -1
- package/dist/infra/lib/SkillRepository.d.ts +0 -134
- package/dist/infra/lib/SkillRepository.d.ts.map +0 -1
- package/dist/infra/lib/SkillRepository.js +0 -500
- package/dist/infra/lib/SkillRepository.js.map +0 -1
- package/dist/infra/lib/UltraQA.d.ts +0 -89
- package/dist/infra/lib/UltraQA.d.ts.map +0 -1
- package/dist/infra/lib/UltraQA.js +0 -301
- package/dist/infra/lib/UltraQA.js.map +0 -1
|
@@ -1,550 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rule Build System - Compile individual rule files into consolidated AGENTS.md
|
|
3
|
-
* Inspired by agent-skills architecture
|
|
4
|
-
*/
|
|
5
|
-
import { readFile, writeFile, readdir } from 'fs/promises';
|
|
6
|
-
import { join, basename } from 'path';
|
|
7
|
-
export const IMPACT_ORDER = {
|
|
8
|
-
'CRITICAL': 0,
|
|
9
|
-
'HIGH': 1,
|
|
10
|
-
'MEDIUM-HIGH': 2,
|
|
11
|
-
'MEDIUM': 3,
|
|
12
|
-
'LOW-MEDIUM': 4,
|
|
13
|
-
'LOW': 5
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Parse YAML frontmatter from markdown file
|
|
17
|
-
*/
|
|
18
|
-
function parseFrontmatter(content) {
|
|
19
|
-
const frontmatter = {};
|
|
20
|
-
let body = content;
|
|
21
|
-
if (content.startsWith('---')) {
|
|
22
|
-
const endIndex = content.indexOf('---', 3);
|
|
23
|
-
if (endIndex !== -1) {
|
|
24
|
-
const frontmatterText = content.slice(3, endIndex).trim();
|
|
25
|
-
frontmatterText.split('\n').forEach(line => {
|
|
26
|
-
const colonIndex = line.indexOf(':');
|
|
27
|
-
if (colonIndex !== -1) {
|
|
28
|
-
const key = line.slice(0, colonIndex).trim();
|
|
29
|
-
const value = line.slice(colonIndex + 1).trim().replace(/^["']|["']$/g, '');
|
|
30
|
-
frontmatter[key] = value;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
body = content.slice(endIndex + 3).trim();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return { frontmatter, body };
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Parse a rule markdown file
|
|
40
|
-
*/
|
|
41
|
-
export async function parseRuleFile(filePath) {
|
|
42
|
-
const rawContent = await readFile(filePath, 'utf-8');
|
|
43
|
-
const content = rawContent.replace(/\r\n/g, '\n'); // Normalize line endings
|
|
44
|
-
const { frontmatter, body } = parseFrontmatter(content);
|
|
45
|
-
const lines = body.split('\n');
|
|
46
|
-
// Extract title (first ## heading)
|
|
47
|
-
let title = '';
|
|
48
|
-
let titleLine = 0;
|
|
49
|
-
for (let i = 0; i < lines.length; i++) {
|
|
50
|
-
if (lines[i].startsWith('##')) {
|
|
51
|
-
title = lines[i].replace(/^##+\s*/, '').trim();
|
|
52
|
-
titleLine = i;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
let impact = 'MEDIUM';
|
|
57
|
-
let impactDescription = '';
|
|
58
|
-
let explanation = '';
|
|
59
|
-
const examples = [];
|
|
60
|
-
const references = [];
|
|
61
|
-
let currentExample = null;
|
|
62
|
-
let inCodeBlock = false;
|
|
63
|
-
let codeBlockLanguage = 'typescript';
|
|
64
|
-
let codeBlockContent = [];
|
|
65
|
-
let afterCodeBlock = false;
|
|
66
|
-
let additionalText = [];
|
|
67
|
-
for (let i = titleLine + 1; i < lines.length; i++) {
|
|
68
|
-
const line = lines[i];
|
|
69
|
-
// Impact line
|
|
70
|
-
if (line.includes('**Impact:')) {
|
|
71
|
-
const match = line.match(/\*\*Impact:\s*(\w+(?:-\w+)?)\s*(?:\(([^)]+)\))?/i);
|
|
72
|
-
if (match) {
|
|
73
|
-
impact = match[1].toUpperCase();
|
|
74
|
-
impactDescription = match[2] || '';
|
|
75
|
-
}
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
// Code block handling
|
|
79
|
-
if (line.startsWith('```')) {
|
|
80
|
-
if (inCodeBlock) {
|
|
81
|
-
if (currentExample) {
|
|
82
|
-
currentExample.code = codeBlockContent.join('\n');
|
|
83
|
-
currentExample.language = codeBlockLanguage;
|
|
84
|
-
}
|
|
85
|
-
codeBlockContent = [];
|
|
86
|
-
inCodeBlock = false;
|
|
87
|
-
afterCodeBlock = true;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
inCodeBlock = true;
|
|
91
|
-
codeBlockLanguage = line.slice(3).trim() || 'typescript';
|
|
92
|
-
codeBlockContent = [];
|
|
93
|
-
afterCodeBlock = false;
|
|
94
|
-
}
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
if (inCodeBlock) {
|
|
98
|
-
codeBlockContent.push(line);
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
// Example label detection
|
|
102
|
-
const labelMatch = line.match(/^\*\*([^:]+?):\*?\*?$/);
|
|
103
|
-
if (labelMatch) {
|
|
104
|
-
if (currentExample) {
|
|
105
|
-
if (additionalText.length > 0) {
|
|
106
|
-
currentExample.additionalText = additionalText.join('\n\n');
|
|
107
|
-
additionalText = [];
|
|
108
|
-
}
|
|
109
|
-
examples.push(currentExample);
|
|
110
|
-
}
|
|
111
|
-
afterCodeBlock = false;
|
|
112
|
-
const fullLabel = labelMatch[1].trim();
|
|
113
|
-
const descMatch = fullLabel.match(/^([A-Za-z]+(?:\s+[A-Za-z]+)*)\s*\(([^()]+)\)$/);
|
|
114
|
-
currentExample = {
|
|
115
|
-
label: descMatch ? descMatch[1].trim() : fullLabel,
|
|
116
|
-
description: descMatch ? descMatch[2].trim() : undefined,
|
|
117
|
-
code: '',
|
|
118
|
-
language: codeBlockLanguage,
|
|
119
|
-
};
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
// Reference links
|
|
123
|
-
if (line.startsWith('Reference:') || line.startsWith('References:')) {
|
|
124
|
-
if (currentExample) {
|
|
125
|
-
if (additionalText.length > 0) {
|
|
126
|
-
currentExample.additionalText = additionalText.join('\n\n');
|
|
127
|
-
additionalText = [];
|
|
128
|
-
}
|
|
129
|
-
examples.push(currentExample);
|
|
130
|
-
currentExample = null;
|
|
131
|
-
}
|
|
132
|
-
const refMatch = line.match(/\[([^\]]+)\]\(([^)]+)\)/g);
|
|
133
|
-
if (refMatch) {
|
|
134
|
-
refMatch.forEach(ref => {
|
|
135
|
-
const m = ref.match(/\[([^\]]+)\]\(([^)]+)\)/);
|
|
136
|
-
if (m)
|
|
137
|
-
references.push(m[2]);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
// Regular text
|
|
143
|
-
if (line.trim() && !line.startsWith('#')) {
|
|
144
|
-
if (!currentExample && !inCodeBlock) {
|
|
145
|
-
explanation += (explanation ? '\n\n' : '') + line;
|
|
146
|
-
}
|
|
147
|
-
else if (currentExample && afterCodeBlock) {
|
|
148
|
-
additionalText.push(line);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Handle last example
|
|
153
|
-
if (currentExample) {
|
|
154
|
-
if (additionalText.length > 0) {
|
|
155
|
-
currentExample.additionalText = additionalText.join('\n\n');
|
|
156
|
-
}
|
|
157
|
-
examples.push(currentExample);
|
|
158
|
-
}
|
|
159
|
-
// Section mapping from filename prefix
|
|
160
|
-
const filename = basename(filePath);
|
|
161
|
-
const sectionMap = {
|
|
162
|
-
security: 1,
|
|
163
|
-
performance: 2,
|
|
164
|
-
architecture: 3,
|
|
165
|
-
complexity: 4,
|
|
166
|
-
testing: 5,
|
|
167
|
-
typescript: 6,
|
|
168
|
-
react: 7,
|
|
169
|
-
advanced: 8,
|
|
170
|
-
};
|
|
171
|
-
const area = filename.split('-')[0];
|
|
172
|
-
const section = frontmatter.section ? parseInt(frontmatter.section) : (sectionMap[area] || 0);
|
|
173
|
-
const rule = {
|
|
174
|
-
id: '',
|
|
175
|
-
title: frontmatter.title || title,
|
|
176
|
-
section,
|
|
177
|
-
impact: frontmatter.impact || impact,
|
|
178
|
-
impactDescription: frontmatter.impactDescription || impactDescription,
|
|
179
|
-
explanation: explanation.trim(),
|
|
180
|
-
examples,
|
|
181
|
-
references: frontmatter.references
|
|
182
|
-
? frontmatter.references.split(',').map(r => r.trim())
|
|
183
|
-
: references,
|
|
184
|
-
tags: frontmatter.tags
|
|
185
|
-
? frontmatter.tags.split(',').map(t => t.trim())
|
|
186
|
-
: undefined,
|
|
187
|
-
};
|
|
188
|
-
return { section, rule };
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Generate markdown from sections
|
|
192
|
-
*/
|
|
193
|
-
export function generateMarkdown(sections, metadata) {
|
|
194
|
-
let md = `# ${metadata.title}\n\n`;
|
|
195
|
-
md += `**Version ${metadata.version}**\n`;
|
|
196
|
-
if (metadata.organization) {
|
|
197
|
-
md += `${metadata.organization}\n`;
|
|
198
|
-
}
|
|
199
|
-
md += `${metadata.date}\n\n`;
|
|
200
|
-
md += `> **Note:**\n`;
|
|
201
|
-
md += `> This document is for AI agents and LLMs to follow when maintaining,\n`;
|
|
202
|
-
md += `> generating, or refactoring code. Optimized for automation.\n\n`;
|
|
203
|
-
md += `---\n\n`;
|
|
204
|
-
md += `## Abstract\n\n`;
|
|
205
|
-
md += `${metadata.abstract}\n\n`;
|
|
206
|
-
md += `---\n\n`;
|
|
207
|
-
md += `## Table of Contents\n\n`;
|
|
208
|
-
// Generate TOC
|
|
209
|
-
sections.forEach(section => {
|
|
210
|
-
const anchor = `${section.number}-${section.title.toLowerCase().replace(/\s+/g, '-')}`;
|
|
211
|
-
md += `${section.number}. [${section.title}](#${anchor}) — **${section.impact}**\n`;
|
|
212
|
-
section.rules.forEach(rule => {
|
|
213
|
-
const ruleAnchor = `${rule.id}-${rule.title}`.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]/g, '');
|
|
214
|
-
md += ` - ${rule.id} [${rule.title}](#${ruleAnchor})\n`;
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
md += `\n---\n\n`;
|
|
218
|
-
// Generate sections
|
|
219
|
-
sections.forEach(section => {
|
|
220
|
-
md += `## ${section.number}. ${section.title}\n\n`;
|
|
221
|
-
md += `**Impact: ${section.impact}${section.impactDescription ? ` (${section.impactDescription})` : ''}**\n\n`;
|
|
222
|
-
if (section.introduction) {
|
|
223
|
-
md += `${section.introduction}\n\n`;
|
|
224
|
-
}
|
|
225
|
-
section.rules.forEach(rule => {
|
|
226
|
-
md += `### ${rule.id} ${rule.title}\n\n`;
|
|
227
|
-
md += `**Impact: ${rule.impact}${rule.impactDescription ? ` (${rule.impactDescription})` : ''}**\n\n`;
|
|
228
|
-
md += `${rule.explanation}\n\n`;
|
|
229
|
-
rule.examples.forEach(example => {
|
|
230
|
-
if (example.description) {
|
|
231
|
-
md += `**${example.label}: ${example.description}**\n\n`;
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
md += `**${example.label}:**\n\n`;
|
|
235
|
-
}
|
|
236
|
-
if (example.code && example.code.trim()) {
|
|
237
|
-
md += `\`\`\`${example.language || 'typescript'}\n`;
|
|
238
|
-
md += `${example.code}\n`;
|
|
239
|
-
md += `\`\`\`\n\n`;
|
|
240
|
-
}
|
|
241
|
-
if (example.additionalText) {
|
|
242
|
-
md += `${example.additionalText}\n\n`;
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
if (rule.references && rule.references.length > 0) {
|
|
246
|
-
md += `Reference: ${rule.references.map(ref => `[${ref}](${ref})`).join(', ')}\n\n`;
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
md += `---\n\n`;
|
|
250
|
-
});
|
|
251
|
-
// Add references section
|
|
252
|
-
if (metadata.references && metadata.references.length > 0) {
|
|
253
|
-
md += `## References\n\n`;
|
|
254
|
-
metadata.references.forEach((ref, i) => {
|
|
255
|
-
md += `${i + 1}. [${ref}](${ref})\n`;
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
return md;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Build AGENTS.md from individual rule files
|
|
262
|
-
*/
|
|
263
|
-
export async function buildRulesDocument(rulesDir, outputFile, metadata) {
|
|
264
|
-
const files = await readdir(rulesDir);
|
|
265
|
-
const ruleFiles = files.filter(f => f.endsWith('.md') && !f.startsWith('_') && f !== 'README.md').sort();
|
|
266
|
-
const ruleData = [];
|
|
267
|
-
for (const file of ruleFiles) {
|
|
268
|
-
const filePath = join(rulesDir, file);
|
|
269
|
-
try {
|
|
270
|
-
const parsed = await parseRuleFile(filePath);
|
|
271
|
-
ruleData.push(parsed);
|
|
272
|
-
}
|
|
273
|
-
catch (error) {
|
|
274
|
-
console.error(`Error parsing ${file}:`, error);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
// Group by section
|
|
278
|
-
const sectionsMap = new Map();
|
|
279
|
-
ruleData.forEach(({ section, rule }) => {
|
|
280
|
-
if (!sectionsMap.has(section)) {
|
|
281
|
-
const sectionMeta = metadata.sectionMeta?.[section];
|
|
282
|
-
sectionsMap.set(section, {
|
|
283
|
-
number: section,
|
|
284
|
-
title: sectionMeta?.title || `Section ${section}`,
|
|
285
|
-
impact: sectionMeta?.impact || rule.impact,
|
|
286
|
-
introduction: sectionMeta?.introduction,
|
|
287
|
-
rules: [],
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
sectionsMap.get(section).rules.push(rule);
|
|
291
|
-
});
|
|
292
|
-
// Sort rules and assign IDs
|
|
293
|
-
sectionsMap.forEach(section => {
|
|
294
|
-
section.rules.sort((a, b) => a.title.localeCompare(b.title, 'en-US'));
|
|
295
|
-
section.rules.forEach((rule, index) => {
|
|
296
|
-
rule.id = `${section.number}.${index + 1}`;
|
|
297
|
-
rule.subsection = index + 1;
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
const sections = Array.from(sectionsMap.values()).sort((a, b) => a.number - b.number);
|
|
301
|
-
const markdown = generateMarkdown(sections, {
|
|
302
|
-
version: metadata.version,
|
|
303
|
-
title: metadata.title,
|
|
304
|
-
organization: metadata.organization,
|
|
305
|
-
date: metadata.date || new Date().toLocaleDateString('en-US', { month: 'long', year: 'numeric' }),
|
|
306
|
-
abstract: metadata.abstract,
|
|
307
|
-
references: metadata.references,
|
|
308
|
-
});
|
|
309
|
-
await writeFile(outputFile, markdown, 'utf-8');
|
|
310
|
-
return { sections: sections.length, rules: ruleData.length };
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Extract test cases from rules for LLM evaluation
|
|
314
|
-
*/
|
|
315
|
-
export function extractTestCases(rules) {
|
|
316
|
-
const testCases = [];
|
|
317
|
-
rules.forEach(rule => {
|
|
318
|
-
rule.examples.forEach(example => {
|
|
319
|
-
const label = example.label.toLowerCase();
|
|
320
|
-
const isBad = label.includes('incorrect') || label.includes('wrong') || label.includes('bad');
|
|
321
|
-
const isGood = label.includes('correct') || label.includes('good');
|
|
322
|
-
if ((isBad || isGood) && example.code.trim()) {
|
|
323
|
-
testCases.push({
|
|
324
|
-
ruleId: rule.id,
|
|
325
|
-
ruleTitle: rule.title,
|
|
326
|
-
type: isBad ? 'bad' : 'good',
|
|
327
|
-
code: example.code,
|
|
328
|
-
language: example.language || 'typescript',
|
|
329
|
-
description: example.description || `${example.label} example for ${rule.title}`,
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
});
|
|
334
|
-
return testCases;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Extract test cases from rules directory
|
|
338
|
-
*/
|
|
339
|
-
export async function extractTestCasesFromDir(rulesDir, outputFile) {
|
|
340
|
-
const files = await readdir(rulesDir);
|
|
341
|
-
const ruleFiles = files.filter(f => f.endsWith('.md') && !f.startsWith('_') && f !== 'README.md');
|
|
342
|
-
const allTestCases = [];
|
|
343
|
-
for (const file of ruleFiles) {
|
|
344
|
-
const filePath = join(rulesDir, file);
|
|
345
|
-
try {
|
|
346
|
-
const { rule } = await parseRuleFile(filePath);
|
|
347
|
-
rule.id = file.replace('.md', ''); // Temporary ID
|
|
348
|
-
const testCases = extractTestCases([rule]);
|
|
349
|
-
allTestCases.push(...testCases);
|
|
350
|
-
}
|
|
351
|
-
catch (error) {
|
|
352
|
-
console.error(`Error processing ${file}:`, error);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
await writeFile(outputFile, JSON.stringify(allTestCases, null, 2), 'utf-8');
|
|
356
|
-
return {
|
|
357
|
-
total: allTestCases.length,
|
|
358
|
-
bad: allTestCases.filter(tc => tc.type === 'bad').length,
|
|
359
|
-
good: allTestCases.filter(tc => tc.type === 'good').length,
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Validate rule file structure
|
|
364
|
-
*/
|
|
365
|
-
export function validateRule(rule) {
|
|
366
|
-
const errors = [];
|
|
367
|
-
if (!rule.title)
|
|
368
|
-
errors.push('Missing title');
|
|
369
|
-
if (!rule.explanation)
|
|
370
|
-
errors.push('Missing explanation');
|
|
371
|
-
if (!rule.impact)
|
|
372
|
-
errors.push('Missing impact level');
|
|
373
|
-
if (rule.examples.length === 0)
|
|
374
|
-
errors.push('No examples provided');
|
|
375
|
-
const hasIncorrect = rule.examples.some(e => e.label.toLowerCase().includes('incorrect') || e.label.toLowerCase().includes('bad'));
|
|
376
|
-
const hasCorrect = rule.examples.some(e => e.label.toLowerCase().includes('correct') || e.label.toLowerCase().includes('good'));
|
|
377
|
-
if (!hasIncorrect && !hasCorrect) {
|
|
378
|
-
errors.push('Should have at least one Incorrect or Correct example');
|
|
379
|
-
}
|
|
380
|
-
return { valid: errors.length === 0, errors };
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Get impact level color for display
|
|
384
|
-
*/
|
|
385
|
-
export function getImpactColor(impact) {
|
|
386
|
-
switch (impact) {
|
|
387
|
-
case 'CRITICAL': return '\x1b[31m'; // Red
|
|
388
|
-
case 'HIGH': return '\x1b[33m'; // Yellow
|
|
389
|
-
case 'MEDIUM-HIGH': return '\x1b[33m';
|
|
390
|
-
case 'MEDIUM': return '\x1b[36m'; // Cyan
|
|
391
|
-
case 'LOW-MEDIUM': return '\x1b[36m';
|
|
392
|
-
case 'LOW': return '\x1b[32m'; // Green
|
|
393
|
-
default: return '\x1b[0m';
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Compare two impact levels
|
|
398
|
-
*/
|
|
399
|
-
export function compareImpact(a, b) {
|
|
400
|
-
return IMPACT_ORDER[a] - IMPACT_ORDER[b];
|
|
401
|
-
}
|
|
402
|
-
// --- Rules TDD (Pressure Testing) ---
|
|
403
|
-
const DEFAULT_PRESSURE_CONFIG = {
|
|
404
|
-
minExamples: 2,
|
|
405
|
-
requireBothTypes: true,
|
|
406
|
-
requireRationalization: false,
|
|
407
|
-
minCodeLength: 20,
|
|
408
|
-
};
|
|
409
|
-
const RATIONALIZATION_KEYWORDS = [
|
|
410
|
-
'excuse', 'why wrong', 'avoid', 'rationalization',
|
|
411
|
-
'변명', '왜 틀렸', '합리화', '회피',
|
|
412
|
-
];
|
|
413
|
-
/**
|
|
414
|
-
* Pressure-test a single rule for completeness and quality
|
|
415
|
-
* Returns weighted score (0-100) with 70+ = passed
|
|
416
|
-
*/
|
|
417
|
-
export function pressureTestRule(rule, config = {}) {
|
|
418
|
-
const cfg = { ...DEFAULT_PRESSURE_CONFIG, ...config };
|
|
419
|
-
const issues = [];
|
|
420
|
-
// Check 1: Has examples (20 points)
|
|
421
|
-
const hasExamples = rule.examples.length >= 1;
|
|
422
|
-
if (!hasExamples)
|
|
423
|
-
issues.push('No examples provided');
|
|
424
|
-
// Check 2: Has both Incorrect + Correct (25 points)
|
|
425
|
-
const hasIncorrect = rule.examples.some(e => /incorrect|wrong|bad|❌/i.test(e.label));
|
|
426
|
-
const hasCorrect = rule.examples.some(e => /correct|good|✅/i.test(e.label));
|
|
427
|
-
const hasBothTypes = hasIncorrect && hasCorrect;
|
|
428
|
-
if (!hasBothTypes)
|
|
429
|
-
issues.push('Missing Incorrect or Correct example');
|
|
430
|
-
// Check 3: Has rationalization counters (20 points)
|
|
431
|
-
const fullText = `${rule.explanation} ${rule.examples.map(e => e.code).join(' ')}`;
|
|
432
|
-
const hasRationalization = RATIONALIZATION_KEYWORDS.some(kw => fullText.toLowerCase().includes(kw.toLowerCase()));
|
|
433
|
-
if (cfg.requireRationalization && !hasRationalization) {
|
|
434
|
-
issues.push('No rationalization counter patterns found');
|
|
435
|
-
}
|
|
436
|
-
// Check 4: Has edge cases / 3+ examples (15 points)
|
|
437
|
-
const hasEdgeCases = rule.examples.length >= 3;
|
|
438
|
-
if (!hasEdgeCases)
|
|
439
|
-
issues.push(`Only ${rule.examples.length} examples (recommend 3+)`);
|
|
440
|
-
// Check 5: Example code quality (20 points)
|
|
441
|
-
const codeExamples = rule.examples.filter(e => e.code.trim().length > 0);
|
|
442
|
-
const avgCodeLength = codeExamples.length > 0
|
|
443
|
-
? codeExamples.reduce((sum, e) => sum + e.code.length, 0) / codeExamples.length
|
|
444
|
-
: 0;
|
|
445
|
-
const exampleQuality = Math.min(100, Math.round((avgCodeLength / cfg.minCodeLength) * 100));
|
|
446
|
-
// Calculate weighted coverage score
|
|
447
|
-
const coverageScore = (hasExamples ? 20 : 0) +
|
|
448
|
-
(hasBothTypes ? 25 : 0) +
|
|
449
|
-
(hasRationalization ? 20 : 0) +
|
|
450
|
-
(hasEdgeCases ? 15 : 0) +
|
|
451
|
-
Math.round(exampleQuality * 0.2);
|
|
452
|
-
return {
|
|
453
|
-
ruleId: rule.id,
|
|
454
|
-
ruleTitle: rule.title,
|
|
455
|
-
scores: {
|
|
456
|
-
hasExamples,
|
|
457
|
-
hasBothTypes,
|
|
458
|
-
hasRationalization,
|
|
459
|
-
hasEdgeCases,
|
|
460
|
-
exampleQuality,
|
|
461
|
-
coverageScore,
|
|
462
|
-
},
|
|
463
|
-
issues,
|
|
464
|
-
passed: coverageScore >= 70,
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Batch pressure-test all rules in a directory
|
|
469
|
-
*/
|
|
470
|
-
export async function pressureTestRulesDirectory(rulesDir, config = {}) {
|
|
471
|
-
const files = await readdir(rulesDir);
|
|
472
|
-
const ruleFiles = files.filter(f => f.endsWith('.md') && !f.startsWith('_') && f !== 'README.md');
|
|
473
|
-
const results = [];
|
|
474
|
-
for (const file of ruleFiles) {
|
|
475
|
-
const filePath = join(rulesDir, file);
|
|
476
|
-
try {
|
|
477
|
-
const { rule } = await parseRuleFile(filePath);
|
|
478
|
-
rule.id = file.replace('.md', '');
|
|
479
|
-
results.push(pressureTestRule(rule, config));
|
|
480
|
-
}
|
|
481
|
-
catch {
|
|
482
|
-
results.push({
|
|
483
|
-
ruleId: file,
|
|
484
|
-
ruleTitle: file,
|
|
485
|
-
scores: {
|
|
486
|
-
hasExamples: false,
|
|
487
|
-
hasBothTypes: false,
|
|
488
|
-
hasRationalization: false,
|
|
489
|
-
hasEdgeCases: false,
|
|
490
|
-
exampleQuality: 0,
|
|
491
|
-
coverageScore: 0,
|
|
492
|
-
},
|
|
493
|
-
issues: ['Failed to parse rule file'],
|
|
494
|
-
passed: false,
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
return {
|
|
499
|
-
total: results.length,
|
|
500
|
-
passed: results.filter(r => r.passed).length,
|
|
501
|
-
failed: results.filter(r => !r.passed).length,
|
|
502
|
-
results,
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
/**
|
|
506
|
-
* Format pressure test results as markdown report
|
|
507
|
-
*/
|
|
508
|
-
export function formatPressureTestReport(summary) {
|
|
509
|
-
const lines = [];
|
|
510
|
-
const passRate = summary.total > 0
|
|
511
|
-
? Math.round((summary.passed / summary.total) * 100)
|
|
512
|
-
: 0;
|
|
513
|
-
lines.push('# Rules TDD - Pressure Test Report\n');
|
|
514
|
-
lines.push(`| Metric | Value |`);
|
|
515
|
-
lines.push(`|--------|-------|`);
|
|
516
|
-
lines.push(`| Total Rules | ${summary.total} |`);
|
|
517
|
-
lines.push(`| Passed | ${summary.passed} |`);
|
|
518
|
-
lines.push(`| Failed | ${summary.failed} |`);
|
|
519
|
-
lines.push(`| Pass Rate | ${passRate}% |`);
|
|
520
|
-
lines.push('');
|
|
521
|
-
const failed = summary.results.filter(r => !r.passed);
|
|
522
|
-
if (failed.length > 0) {
|
|
523
|
-
lines.push('## Failed Rules\n');
|
|
524
|
-
for (const r of failed) {
|
|
525
|
-
lines.push(`### ${r.ruleId}: ${r.ruleTitle} (${r.scores.coverageScore}/100)\n`);
|
|
526
|
-
lines.push(`| Check | Status |`);
|
|
527
|
-
lines.push(`|-------|--------|`);
|
|
528
|
-
lines.push(`| Examples | ${r.scores.hasExamples ? '✅' : '❌'} |`);
|
|
529
|
-
lines.push(`| Both Types | ${r.scores.hasBothTypes ? '✅' : '❌'} |`);
|
|
530
|
-
lines.push(`| Rationalization | ${r.scores.hasRationalization ? '✅' : '❌'} |`);
|
|
531
|
-
lines.push(`| Edge Cases (3+) | ${r.scores.hasEdgeCases ? '✅' : '❌'} |`);
|
|
532
|
-
lines.push(`| Code Quality | ${r.scores.exampleQuality}/100 |`);
|
|
533
|
-
if (r.issues.length > 0) {
|
|
534
|
-
lines.push(`\n**Issues:** ${r.issues.join(', ')}\n`);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
const passed = summary.results.filter(r => r.passed);
|
|
539
|
-
if (passed.length > 0) {
|
|
540
|
-
lines.push('## Passed Rules\n');
|
|
541
|
-
lines.push(`| Rule | Score | Rationalization |`);
|
|
542
|
-
lines.push(`|------|-------|-----------------|`);
|
|
543
|
-
for (const r of passed) {
|
|
544
|
-
const rat = r.scores.hasRationalization ? '✅' : '⚠️';
|
|
545
|
-
lines.push(`| ${r.ruleTitle} | ${r.scores.coverageScore}/100 | ${rat} |`);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
return lines.join('\n');
|
|
549
|
-
}
|
|
550
|
-
//# sourceMappingURL=RuleBuildSystem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RuleBuildSystem.js","sourceRoot":"","sources":["../../../src/infra/lib/RuleBuildSystem.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAKtC,MAAM,CAAC,MAAM,YAAY,GAAgC;IACvD,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,CAAC;IACT,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE,CAAC;IACf,KAAK,EAAE,CAAC;CACT,CAAC;AAwFF;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACvC,MAAM,WAAW,GAA2B,EAAE,CAAC;IAC/C,IAAI,IAAI,GAAG,OAAO,CAAC;IAEnB,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3C,IAAI,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;YACpB,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,eAAe,CAAC,KAAK,CAAC,IAAI,CAA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,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;YACzE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,cAAc,QAAQ,CAAC,CAAC;YAChE,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QACjD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;YACrD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,MAAM,CAAC,aAAa,UAAU,GAAG,IAAI,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill Quality Gate
|
|
3
|
-
* 저장할 메모리/스킬의 품질을 검증
|
|
4
|
-
*
|
|
5
|
-
* @deprecated Not wired into the vibe runtime (no hook/skill/CLI consumer).
|
|
6
|
-
* No consumer in the shipped pipeline.
|
|
7
|
-
* Retained for API compatibility; may be removed in a future major.
|
|
8
|
-
*/
|
|
9
|
-
export interface QualityCheckResult {
|
|
10
|
-
isValid: boolean;
|
|
11
|
-
score: number;
|
|
12
|
-
issues: string[];
|
|
13
|
-
suggestions: string[];
|
|
14
|
-
category: 'principle' | 'discovery' | 'decision' | 'code' | 'generic';
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* 메모리/스킬 품질 검증
|
|
18
|
-
*/
|
|
19
|
-
export declare function validateSkillQuality(key: string, value: string, category?: string): QualityCheckResult;
|
|
20
|
-
/**
|
|
21
|
-
* 원칙 형태로 변환 도우미
|
|
22
|
-
*/
|
|
23
|
-
export declare function suggestPrincipleFormat(value: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* 스킬 분류
|
|
26
|
-
*/
|
|
27
|
-
export declare function classifySkill(value: string): {
|
|
28
|
-
type: 'principle' | 'discovery' | 'decision' | 'reference' | 'generic';
|
|
29
|
-
confidence: number;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* 저장 전 검증 래퍼
|
|
33
|
-
*/
|
|
34
|
-
export declare function validateBeforeSave(key: string, value: string, options?: {
|
|
35
|
-
bypassValidation?: boolean;
|
|
36
|
-
minScore?: number;
|
|
37
|
-
}): {
|
|
38
|
-
canSave: boolean;
|
|
39
|
-
result: QualityCheckResult;
|
|
40
|
-
formattedFeedback: string;
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=SkillQualityGate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SkillQualityGate.d.ts","sourceRoot":"","sources":["../../../src/infra/lib/SkillQualityGate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;CACvE;AAoDD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,kBAAkB,CAyFpB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiB5D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;IAC5C,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC;CACpB,CAsCA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CA6B7E"}
|