clavix 4.12.0 → 5.0.0
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 +69 -61
- package/dist/templates/slash-commands/_canonical/archive.md +83 -121
- package/dist/templates/slash-commands/_canonical/execute.md +32 -42
- package/dist/templates/slash-commands/_canonical/implement.md +32 -44
- package/dist/templates/slash-commands/_canonical/improve.md +13 -52
- package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +84 -180
- package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +2 -2
- package/dist/templates/slash-commands/_components/agent-protocols/file-formats.md +41 -59
- package/dist/templates/slash-commands/_components/sections/file-saving-protocol.md +20 -27
- package/dist/templates/slash-commands/_components/troubleshooting/file-not-saved.md +4 -5
- package/package.json +2 -2
- package/dist/cli/commands/analyze.d.ts +0 -17
- package/dist/cli/commands/analyze.js +0 -133
- package/dist/cli/commands/archive.d.ts +0 -36
- package/dist/cli/commands/archive.js +0 -266
- package/dist/cli/commands/deep.d.ts +0 -17
- package/dist/cli/commands/deep.js +0 -170
- package/dist/cli/commands/execute.d.ts +0 -15
- package/dist/cli/commands/execute.js +0 -168
- package/dist/cli/commands/fast.d.ts +0 -18
- package/dist/cli/commands/fast.js +0 -219
- package/dist/cli/commands/implement.d.ts +0 -24
- package/dist/cli/commands/implement.js +0 -289
- package/dist/cli/commands/improve.d.ts +0 -32
- package/dist/cli/commands/improve.js +0 -250
- package/dist/cli/commands/list.d.ts +0 -17
- package/dist/cli/commands/list.js +0 -217
- package/dist/cli/commands/plan.d.ts +0 -21
- package/dist/cli/commands/plan.js +0 -297
- package/dist/cli/commands/prd.d.ts +0 -24
- package/dist/cli/commands/prd.js +0 -321
- package/dist/cli/commands/prompts/clear.d.ts +0 -16
- package/dist/cli/commands/prompts/clear.js +0 -222
- package/dist/cli/commands/prompts/list.d.ts +0 -8
- package/dist/cli/commands/prompts/list.js +0 -88
- package/dist/cli/commands/show.d.ts +0 -21
- package/dist/cli/commands/show.js +0 -191
- package/dist/cli/commands/start.d.ts +0 -40
- package/dist/cli/commands/start.js +0 -210
- package/dist/cli/commands/summarize.d.ts +0 -17
- package/dist/cli/commands/summarize.js +0 -196
- package/dist/cli/commands/task-complete.d.ts +0 -27
- package/dist/cli/commands/task-complete.js +0 -269
- package/dist/cli/commands/verify.d.ts +0 -28
- package/dist/cli/commands/verify.js +0 -349
- package/dist/core/archive-manager.d.ts +0 -100
- package/dist/core/archive-manager.js +0 -302
- package/dist/core/basic-checklist-generator.d.ts +0 -35
- package/dist/core/basic-checklist-generator.js +0 -344
- package/dist/core/checklist-parser.d.ts +0 -48
- package/dist/core/checklist-parser.js +0 -238
- package/dist/core/config-manager.d.ts +0 -149
- package/dist/core/config-manager.js +0 -230
- package/dist/core/conversation-analyzer.d.ts +0 -86
- package/dist/core/conversation-analyzer.js +0 -387
- package/dist/core/conversation-quality-tracker.d.ts +0 -81
- package/dist/core/conversation-quality-tracker.js +0 -195
- package/dist/core/git-manager.d.ts +0 -126
- package/dist/core/git-manager.js +0 -282
- package/dist/core/intelligence/confidence-calculator.d.ts +0 -93
- package/dist/core/intelligence/confidence-calculator.js +0 -124
- package/dist/core/intelligence/index.d.ts +0 -11
- package/dist/core/intelligence/index.js +0 -15
- package/dist/core/intelligence/intent-detector.d.ts +0 -54
- package/dist/core/intelligence/intent-detector.js +0 -723
- package/dist/core/intelligence/pattern-library.d.ts +0 -104
- package/dist/core/intelligence/pattern-library.js +0 -330
- package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +0 -27
- package/dist/core/intelligence/patterns/actionability-enhancer.js +0 -192
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +0 -29
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +0 -239
- package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +0 -22
- package/dist/core/intelligence/patterns/ambiguity-detector.js +0 -196
- package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/assumption-explicitizer.js +0 -296
- package/dist/core/intelligence/patterns/base-pattern.d.ts +0 -192
- package/dist/core/intelligence/patterns/base-pattern.js +0 -103
- package/dist/core/intelligence/patterns/completeness-validator.d.ts +0 -27
- package/dist/core/intelligence/patterns/completeness-validator.js +0 -221
- package/dist/core/intelligence/patterns/conciseness-filter.d.ts +0 -20
- package/dist/core/intelligence/patterns/conciseness-filter.js +0 -92
- package/dist/core/intelligence/patterns/context-precision.d.ts +0 -32
- package/dist/core/intelligence/patterns/context-precision.js +0 -389
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/conversation-summarizer.js +0 -277
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/dependency-identifier.js +0 -166
- package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +0 -21
- package/dist/core/intelligence/patterns/domain-context-enricher.js +0 -198
- package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +0 -30
- package/dist/core/intelligence/patterns/edge-case-identifier.js +0 -269
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +0 -22
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +0 -179
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +0 -24
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +0 -259
- package/dist/core/intelligence/patterns/objective-clarifier.d.ts +0 -22
- package/dist/core/intelligence/patterns/objective-clarifier.js +0 -126
- package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/output-format-enforcer.js +0 -151
- package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +0 -23
- package/dist/core/intelligence/patterns/prd-structure-enforcer.js +0 -183
- package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/prerequisite-identifier.js +0 -221
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +0 -24
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +0 -134
- package/dist/core/intelligence/patterns/scope-definer.d.ts +0 -26
- package/dist/core/intelligence/patterns/scope-definer.js +0 -236
- package/dist/core/intelligence/patterns/step-decomposer.d.ts +0 -31
- package/dist/core/intelligence/patterns/step-decomposer.js +0 -242
- package/dist/core/intelligence/patterns/structure-organizer.d.ts +0 -31
- package/dist/core/intelligence/patterns/structure-organizer.js +0 -218
- package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/success-criteria-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +0 -24
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +0 -25
- package/dist/core/intelligence/patterns/technical-context-enricher.js +0 -165
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +0 -26
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +0 -300
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +0 -24
- package/dist/core/intelligence/patterns/user-persona-enricher.js +0 -141
- package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +0 -31
- package/dist/core/intelligence/patterns/validation-checklist-creator.js +0 -242
- package/dist/core/intelligence/quality-assessor.d.ts +0 -71
- package/dist/core/intelligence/quality-assessor.js +0 -525
- package/dist/core/intelligence/types.d.ts +0 -111
- package/dist/core/intelligence/types.js +0 -3
- package/dist/core/intelligence/universal-optimizer.d.ts +0 -91
- package/dist/core/intelligence/universal-optimizer.js +0 -399
- package/dist/core/prd-generator.d.ts +0 -76
- package/dist/core/prd-generator.js +0 -173
- package/dist/core/prompt-manager.d.ts +0 -110
- package/dist/core/prompt-manager.js +0 -274
- package/dist/core/prompt-optimizer.d.ts +0 -268
- package/dist/core/prompt-optimizer.js +0 -959
- package/dist/core/question-engine.d.ts +0 -167
- package/dist/core/question-engine.js +0 -356
- package/dist/core/session-manager.d.ts +0 -139
- package/dist/core/session-manager.js +0 -365
- package/dist/core/task-manager.d.ts +0 -211
- package/dist/core/task-manager.js +0 -981
- package/dist/core/verification-hooks.d.ts +0 -67
- package/dist/core/verification-hooks.js +0 -309
- package/dist/core/verification-manager.d.ts +0 -107
- package/dist/core/verification-manager.js +0 -415
- package/dist/index 2.js +0 -13
- package/dist/index.d 2.ts +0 -4
- package/dist/types/session.d.ts +0 -78
- package/dist/types/session.js +0 -8
- package/dist/types/verification.d.ts +0 -205
- package/dist/types/verification.js +0 -9
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Clavix v4.11: Verification Manager
|
|
3
|
-
*
|
|
4
|
-
* Manages verification state, execution flow, and persistence.
|
|
5
|
-
* Coordinates between checklist parsing, hook execution, and result storage.
|
|
6
|
-
* v4.11: Updated for unified storage (no fast/deep subdirs)
|
|
7
|
-
*/
|
|
8
|
-
import fs from 'fs-extra';
|
|
9
|
-
import * as path from 'path';
|
|
10
|
-
import { ChecklistParser } from './checklist-parser.js';
|
|
11
|
-
import { VerificationHooks } from './verification-hooks.js';
|
|
12
|
-
import { PromptManager } from './prompt-manager.js';
|
|
13
|
-
/**
|
|
14
|
-
* Verification Manager
|
|
15
|
-
*/
|
|
16
|
-
export class VerificationManager {
|
|
17
|
-
promptManager;
|
|
18
|
-
checklistParser;
|
|
19
|
-
verificationHooks;
|
|
20
|
-
outputDir;
|
|
21
|
-
constructor(baseDir) {
|
|
22
|
-
this.outputDir = baseDir || path.join(process.cwd(), '.clavix', 'outputs', 'prompts');
|
|
23
|
-
this.promptManager = new PromptManager(this.outputDir);
|
|
24
|
-
this.checklistParser = new ChecklistParser();
|
|
25
|
-
this.verificationHooks = new VerificationHooks();
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Initialize verification for a prompt
|
|
29
|
-
*/
|
|
30
|
-
async initializeVerification(promptId) {
|
|
31
|
-
// Load prompt
|
|
32
|
-
const promptData = await this.promptManager.loadPrompt(promptId);
|
|
33
|
-
if (!promptData) {
|
|
34
|
-
throw new Error(`Prompt not found: ${promptId}`);
|
|
35
|
-
}
|
|
36
|
-
// Parse checklist from prompt content
|
|
37
|
-
const checklist = this.checklistParser.parse(promptData.content);
|
|
38
|
-
// Get all items
|
|
39
|
-
const items = [...checklist.validationItems, ...checklist.edgeCases, ...checklist.risks];
|
|
40
|
-
// Detect available hooks
|
|
41
|
-
const detectedHooks = await this.verificationHooks.detectHooks();
|
|
42
|
-
// v4.11: Create initial report with depthUsed
|
|
43
|
-
const report = {
|
|
44
|
-
version: '2.0',
|
|
45
|
-
promptId,
|
|
46
|
-
depthUsed: promptData.metadata.depthUsed,
|
|
47
|
-
startedAt: new Date().toISOString(),
|
|
48
|
-
status: items.length > 0 ? 'pending' : 'completed',
|
|
49
|
-
items,
|
|
50
|
-
results: items.map((item) => ({
|
|
51
|
-
itemId: item.id,
|
|
52
|
-
status: 'pending',
|
|
53
|
-
method: item.verificationType === 'automated' ? 'automated' : 'manual',
|
|
54
|
-
confidence: 'low',
|
|
55
|
-
verifiedAt: '',
|
|
56
|
-
})),
|
|
57
|
-
summary: this.calculateSummary([]),
|
|
58
|
-
detectedHooks,
|
|
59
|
-
};
|
|
60
|
-
// Save initial report
|
|
61
|
-
await this.saveReport(report);
|
|
62
|
-
return report;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* v4.11: Get verification report path (unified storage)
|
|
66
|
-
*/
|
|
67
|
-
getReportPath(promptId) {
|
|
68
|
-
return path.join(this.outputDir, `${promptId}.verification.json`);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* v4.11: Load verification report
|
|
72
|
-
*/
|
|
73
|
-
async loadReport(promptId) {
|
|
74
|
-
const reportPath = this.getReportPath(promptId);
|
|
75
|
-
if (await fs.pathExists(reportPath)) {
|
|
76
|
-
try {
|
|
77
|
-
return await fs.readJson(reportPath);
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
// Corrupt file, ignore
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* v4.11: Save verification report
|
|
87
|
-
*/
|
|
88
|
-
async saveReport(report) {
|
|
89
|
-
const reportPath = this.getReportPath(report.promptId);
|
|
90
|
-
await fs.ensureDir(path.dirname(reportPath));
|
|
91
|
-
await fs.writeJson(reportPath, report, { spaces: 2 });
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Mark a single item as verified
|
|
95
|
-
*/
|
|
96
|
-
async markItemVerified(promptId, itemId, status, options = {}) {
|
|
97
|
-
let report = await this.loadReport(promptId);
|
|
98
|
-
if (!report) {
|
|
99
|
-
// Initialize if doesn't exist
|
|
100
|
-
report = await this.initializeVerification(promptId);
|
|
101
|
-
}
|
|
102
|
-
// Find and update result
|
|
103
|
-
const resultIndex = report.results.findIndex((r) => r.itemId === itemId);
|
|
104
|
-
if (resultIndex === -1) {
|
|
105
|
-
throw new Error(`Item not found: ${itemId}`);
|
|
106
|
-
}
|
|
107
|
-
const item = report.items.find((i) => i.id === itemId);
|
|
108
|
-
report.results[resultIndex] = {
|
|
109
|
-
itemId,
|
|
110
|
-
status,
|
|
111
|
-
method: options.method || (item?.verificationType === 'automated' ? 'automated' : 'manual'),
|
|
112
|
-
confidence: options.confidence || 'medium',
|
|
113
|
-
evidence: options.evidence,
|
|
114
|
-
reason: options.reason,
|
|
115
|
-
verifiedAt: new Date().toISOString(),
|
|
116
|
-
};
|
|
117
|
-
// Recalculate summary and status
|
|
118
|
-
report.summary = this.calculateSummary(report.results);
|
|
119
|
-
report.status = this.calculateReportStatus(report.results);
|
|
120
|
-
if (report.status === 'completed') {
|
|
121
|
-
report.completedAt = new Date().toISOString();
|
|
122
|
-
}
|
|
123
|
-
await this.saveReport(report);
|
|
124
|
-
return report;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Run automated verification for a prompt
|
|
128
|
-
*/
|
|
129
|
-
async runAutomatedVerification(promptId) {
|
|
130
|
-
let report = await this.loadReport(promptId);
|
|
131
|
-
if (!report) {
|
|
132
|
-
report = await this.initializeVerification(promptId);
|
|
133
|
-
}
|
|
134
|
-
// Find automated items that are pending
|
|
135
|
-
const automatedItems = report.items.filter((item) => item.verificationType === 'automated' &&
|
|
136
|
-
report.results.find((r) => r.itemId === item.id)?.status === 'pending');
|
|
137
|
-
if (automatedItems.length === 0) {
|
|
138
|
-
return report;
|
|
139
|
-
}
|
|
140
|
-
// Detect hooks
|
|
141
|
-
const detectedHooks = await this.verificationHooks.detectHooks();
|
|
142
|
-
// Run relevant hooks
|
|
143
|
-
const hookResults = await this.verificationHooks.runAllHooks();
|
|
144
|
-
// Map hook results to checklist items
|
|
145
|
-
for (const item of automatedItems) {
|
|
146
|
-
const lowerContent = item.content.toLowerCase();
|
|
147
|
-
// Match item to hook result
|
|
148
|
-
let matched = false;
|
|
149
|
-
for (const hookResult of hookResults) {
|
|
150
|
-
if (this.matchItemToHook(lowerContent, hookResult.hook.name)) {
|
|
151
|
-
const resultIndex = report.results.findIndex((r) => r.itemId === item.id);
|
|
152
|
-
if (resultIndex !== -1) {
|
|
153
|
-
report.results[resultIndex] = {
|
|
154
|
-
itemId: item.id,
|
|
155
|
-
status: hookResult.success ? 'passed' : 'failed',
|
|
156
|
-
method: 'automated',
|
|
157
|
-
confidence: hookResult.confidence,
|
|
158
|
-
evidence: this.truncateOutput(hookResult.output),
|
|
159
|
-
reason: hookResult.success ? undefined : 'Hook failed',
|
|
160
|
-
verifiedAt: new Date().toISOString(),
|
|
161
|
-
};
|
|
162
|
-
matched = true;
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
// If no hook matched, mark as requiring manual verification
|
|
168
|
-
if (!matched) {
|
|
169
|
-
const resultIndex = report.results.findIndex((r) => r.itemId === item.id);
|
|
170
|
-
if (resultIndex !== -1 && report.results[resultIndex].status === 'pending') {
|
|
171
|
-
report.results[resultIndex].method = 'manual';
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
// Update summary and status
|
|
176
|
-
report.summary = this.calculateSummary(report.results);
|
|
177
|
-
report.status = this.calculateReportStatus(report.results);
|
|
178
|
-
report.detectedHooks = detectedHooks;
|
|
179
|
-
await this.saveReport(report);
|
|
180
|
-
return report;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Match checklist item content to hook type
|
|
184
|
-
*/
|
|
185
|
-
matchItemToHook(content, hookName) {
|
|
186
|
-
const hookKeywords = {
|
|
187
|
-
test: ['tests pass', 'test pass', 'all tests', 'unit test', 'test coverage'],
|
|
188
|
-
build: ['compiles', 'builds', 'build succeeds', 'no errors', 'runs without errors'],
|
|
189
|
-
lint: ['lint', 'no warnings', 'style guide', 'conventions'],
|
|
190
|
-
typecheck: ['typecheck', 'type check', 'type errors', 'typescript'],
|
|
191
|
-
};
|
|
192
|
-
const keywords = hookKeywords[hookName] || [];
|
|
193
|
-
return keywords.some((kw) => content.includes(kw));
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Truncate output for storage
|
|
197
|
-
*/
|
|
198
|
-
truncateOutput(output, maxLength = 500) {
|
|
199
|
-
if (output.length <= maxLength) {
|
|
200
|
-
return output;
|
|
201
|
-
}
|
|
202
|
-
return output.substring(0, maxLength) + '... (truncated)';
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Calculate summary from results
|
|
206
|
-
*/
|
|
207
|
-
calculateSummary(results) {
|
|
208
|
-
const total = results.length;
|
|
209
|
-
const passed = results.filter((r) => r.status === 'passed').length;
|
|
210
|
-
const failed = results.filter((r) => r.status === 'failed').length;
|
|
211
|
-
const skipped = results.filter((r) => r.status === 'skipped').length;
|
|
212
|
-
const notApplicable = results.filter((r) => r.status === 'not-applicable').length;
|
|
213
|
-
const automatedChecks = results.filter((r) => r.method === 'automated').length;
|
|
214
|
-
const manualChecks = results.filter((r) => r.method === 'manual' || r.method === 'semi-automated').length;
|
|
215
|
-
const denominator = total - skipped - notApplicable;
|
|
216
|
-
const coveragePercent = denominator > 0 ? Math.round((passed / denominator) * 100) : 0;
|
|
217
|
-
return {
|
|
218
|
-
total,
|
|
219
|
-
passed,
|
|
220
|
-
failed,
|
|
221
|
-
skipped,
|
|
222
|
-
notApplicable,
|
|
223
|
-
coveragePercent,
|
|
224
|
-
automatedChecks,
|
|
225
|
-
manualChecks,
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Calculate overall report status
|
|
230
|
-
*/
|
|
231
|
-
calculateReportStatus(results) {
|
|
232
|
-
const pending = results.filter((r) => r.status === 'pending').length;
|
|
233
|
-
const failed = results.filter((r) => r.status === 'failed').length;
|
|
234
|
-
if (pending === results.length) {
|
|
235
|
-
return 'pending';
|
|
236
|
-
}
|
|
237
|
-
if (pending > 0) {
|
|
238
|
-
return 'in-progress';
|
|
239
|
-
}
|
|
240
|
-
if (failed > 0) {
|
|
241
|
-
return 'requires-attention';
|
|
242
|
-
}
|
|
243
|
-
return 'completed';
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Get pending items from report
|
|
247
|
-
*/
|
|
248
|
-
getPendingItems(report) {
|
|
249
|
-
const pendingIds = new Set(report.results.filter((r) => r.status === 'pending').map((r) => r.itemId));
|
|
250
|
-
return report.items.filter((item) => pendingIds.has(item.id));
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Get failed items from report
|
|
254
|
-
*/
|
|
255
|
-
getFailedItems(report) {
|
|
256
|
-
return report.results
|
|
257
|
-
.filter((r) => r.status === 'failed')
|
|
258
|
-
.map((result) => ({
|
|
259
|
-
item: report.items.find((i) => i.id === result.itemId),
|
|
260
|
-
result,
|
|
261
|
-
}))
|
|
262
|
-
.filter((r) => r.item);
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Check if verification is complete
|
|
266
|
-
*/
|
|
267
|
-
isComplete(report) {
|
|
268
|
-
return report.status === 'completed';
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Check if verification requires attention (has failures)
|
|
272
|
-
*/
|
|
273
|
-
requiresAttention(report) {
|
|
274
|
-
return report.status === 'requires-attention';
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* v4.11: Delete verification report
|
|
278
|
-
*/
|
|
279
|
-
async deleteReport(promptId) {
|
|
280
|
-
const reportPath = this.getReportPath(promptId);
|
|
281
|
-
if (await fs.pathExists(reportPath)) {
|
|
282
|
-
await fs.remove(reportPath);
|
|
283
|
-
return true;
|
|
284
|
-
}
|
|
285
|
-
return false;
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* v4.11: Get all verification reports
|
|
289
|
-
*/
|
|
290
|
-
async listReports() {
|
|
291
|
-
const reports = [];
|
|
292
|
-
if (await fs.pathExists(this.outputDir)) {
|
|
293
|
-
const files = await fs.readdir(this.outputDir);
|
|
294
|
-
for (const file of files) {
|
|
295
|
-
if (file.endsWith('.verification.json')) {
|
|
296
|
-
try {
|
|
297
|
-
const report = await fs.readJson(path.join(this.outputDir, file));
|
|
298
|
-
reports.push(report);
|
|
299
|
-
}
|
|
300
|
-
catch {
|
|
301
|
-
// Ignore corrupt files
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
return reports;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Get verification status for a prompt
|
|
310
|
-
*/
|
|
311
|
-
async getVerificationStatus(promptId) {
|
|
312
|
-
const report = await this.loadReport(promptId);
|
|
313
|
-
if (!report) {
|
|
314
|
-
return {
|
|
315
|
-
hasReport: false,
|
|
316
|
-
status: null,
|
|
317
|
-
summary: null,
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
return {
|
|
321
|
-
hasReport: true,
|
|
322
|
-
status: report.status,
|
|
323
|
-
summary: report.summary,
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Format verification report for display
|
|
328
|
-
*/
|
|
329
|
-
formatReportForDisplay(report) {
|
|
330
|
-
const lines = [];
|
|
331
|
-
const sep = '═'.repeat(70);
|
|
332
|
-
lines.push(sep);
|
|
333
|
-
lines.push(' VERIFICATION REPORT');
|
|
334
|
-
lines.push(` ${report.promptId}`);
|
|
335
|
-
lines.push(sep);
|
|
336
|
-
lines.push('');
|
|
337
|
-
// Group results by category
|
|
338
|
-
const byCategory = new Map();
|
|
339
|
-
for (const item of report.items) {
|
|
340
|
-
const result = report.results.find((r) => r.itemId === item.id);
|
|
341
|
-
if (!result)
|
|
342
|
-
continue;
|
|
343
|
-
const category = item.category;
|
|
344
|
-
if (!byCategory.has(category)) {
|
|
345
|
-
byCategory.set(category, []);
|
|
346
|
-
}
|
|
347
|
-
byCategory.get(category).push({ item, result });
|
|
348
|
-
}
|
|
349
|
-
// Display each category
|
|
350
|
-
for (const [category, items] of byCategory.entries()) {
|
|
351
|
-
const categoryName = category === 'validation'
|
|
352
|
-
? 'VALIDATION CHECKLIST'
|
|
353
|
-
: category === 'edge-case'
|
|
354
|
-
? 'EDGE CASES'
|
|
355
|
-
: 'RISKS';
|
|
356
|
-
lines.push(`📋 ${categoryName} (${items.length} items)`);
|
|
357
|
-
lines.push('');
|
|
358
|
-
for (const { item, result } of items) {
|
|
359
|
-
const statusIcon = this.getStatusIcon(result.status);
|
|
360
|
-
const method = result.method === 'automated'
|
|
361
|
-
? '[automated]'
|
|
362
|
-
: result.method === 'semi-automated'
|
|
363
|
-
? '[semi-auto]'
|
|
364
|
-
: '[manual]';
|
|
365
|
-
lines.push(`${statusIcon} ${method} ${item.content}`);
|
|
366
|
-
if (result.evidence) {
|
|
367
|
-
lines.push(` Evidence: ${result.evidence.substring(0, 80)}`);
|
|
368
|
-
}
|
|
369
|
-
if (result.status === 'failed' && result.reason) {
|
|
370
|
-
lines.push(` Reason: ${result.reason}`);
|
|
371
|
-
}
|
|
372
|
-
if (result.confidence) {
|
|
373
|
-
lines.push(` Confidence: ${result.confidence.toUpperCase()}`);
|
|
374
|
-
}
|
|
375
|
-
lines.push('');
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
// Summary
|
|
379
|
-
lines.push(sep);
|
|
380
|
-
lines.push(' SUMMARY');
|
|
381
|
-
lines.push(sep);
|
|
382
|
-
lines.push(`Total: ${report.summary.total} items`);
|
|
383
|
-
lines.push(`Passed: ${report.summary.passed} (${report.summary.coveragePercent}%)`);
|
|
384
|
-
lines.push(`Failed: ${report.summary.failed}${report.summary.failed > 0 ? ' (requires attention)' : ''}`);
|
|
385
|
-
lines.push(`Skipped: ${report.summary.skipped}`);
|
|
386
|
-
lines.push('');
|
|
387
|
-
lines.push(`Automated: ${report.summary.automatedChecks} checks`);
|
|
388
|
-
lines.push(`Manual: ${report.summary.manualChecks} checks`);
|
|
389
|
-
if (report.summary.failed > 0) {
|
|
390
|
-
lines.push('');
|
|
391
|
-
lines.push(`⚠️ ${report.summary.failed} item(s) require attention before marking complete`);
|
|
392
|
-
}
|
|
393
|
-
lines.push(sep);
|
|
394
|
-
return lines.join('\n');
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Get status icon for display
|
|
398
|
-
*/
|
|
399
|
-
getStatusIcon(status) {
|
|
400
|
-
switch (status) {
|
|
401
|
-
case 'passed':
|
|
402
|
-
return '✅';
|
|
403
|
-
case 'failed':
|
|
404
|
-
return '❌';
|
|
405
|
-
case 'skipped':
|
|
406
|
-
return '⏭️';
|
|
407
|
-
case 'not-applicable':
|
|
408
|
-
return '➖';
|
|
409
|
-
case 'pending':
|
|
410
|
-
default:
|
|
411
|
-
return '⏳';
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
//# sourceMappingURL=verification-manager.js.map
|
package/dist/index 2.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { run, handle, settings } from '@oclif/core';
|
|
3
|
-
// Disable debug mode (stack traces) unless explicitly requested via DEBUG env var
|
|
4
|
-
if (!process.env.DEBUG) {
|
|
5
|
-
settings.debug = false;
|
|
6
|
-
}
|
|
7
|
-
// Run if called directly
|
|
8
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
9
|
-
run().catch(handle);
|
|
10
|
-
}
|
|
11
|
-
// Export for testing
|
|
12
|
-
export { run };
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.d 2.ts
DELETED
package/dist/types/session.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session management types
|
|
3
|
-
*
|
|
4
|
-
* Sessions store conversational state for the `clavix start` command,
|
|
5
|
-
* allowing users to have multi-turn conversations that can be summarized later.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Complete session object with all data
|
|
9
|
-
*/
|
|
10
|
-
export interface Session {
|
|
11
|
-
id: string;
|
|
12
|
-
projectName: string;
|
|
13
|
-
agent: string;
|
|
14
|
-
created: Date;
|
|
15
|
-
updated: Date;
|
|
16
|
-
status: SessionStatus;
|
|
17
|
-
messages: SessionMessage[];
|
|
18
|
-
tags?: string[];
|
|
19
|
-
description?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Session status tracking
|
|
23
|
-
*/
|
|
24
|
-
export type SessionStatus = 'active' | 'completed' | 'archived';
|
|
25
|
-
/**
|
|
26
|
-
* Individual message in a conversation
|
|
27
|
-
*/
|
|
28
|
-
export interface SessionMessage {
|
|
29
|
-
role: 'user' | 'assistant';
|
|
30
|
-
content: string;
|
|
31
|
-
timestamp: Date;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Lightweight metadata for session listings
|
|
35
|
-
*/
|
|
36
|
-
export interface SessionMetadata {
|
|
37
|
-
id: string;
|
|
38
|
-
projectName: string;
|
|
39
|
-
agent: string;
|
|
40
|
-
created: string;
|
|
41
|
-
updated: string;
|
|
42
|
-
status: SessionStatus;
|
|
43
|
-
messageCount: number;
|
|
44
|
-
tags?: string[];
|
|
45
|
-
description?: string;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Filter options for session queries
|
|
49
|
-
*/
|
|
50
|
-
export interface SessionFilter {
|
|
51
|
-
status?: SessionStatus;
|
|
52
|
-
projectName?: string;
|
|
53
|
-
agent?: string;
|
|
54
|
-
tags?: string[];
|
|
55
|
-
startDate?: Date;
|
|
56
|
-
endDate?: Date;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Serialized session for file storage
|
|
60
|
-
* Uses ISO strings instead of Date objects
|
|
61
|
-
*/
|
|
62
|
-
export interface SerializedSession {
|
|
63
|
-
id: string;
|
|
64
|
-
projectName: string;
|
|
65
|
-
agent: string;
|
|
66
|
-
created: string;
|
|
67
|
-
updated: string;
|
|
68
|
-
status: SessionStatus;
|
|
69
|
-
messages: SerializedSessionMessage[];
|
|
70
|
-
tags?: string[];
|
|
71
|
-
description?: string;
|
|
72
|
-
}
|
|
73
|
-
export interface SerializedSessionMessage {
|
|
74
|
-
role: 'user' | 'assistant';
|
|
75
|
-
content: string;
|
|
76
|
-
timestamp: string;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=session.d.ts.map
|
package/dist/types/session.js
DELETED