Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

πŸ”– Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/verification.js

rUvcf8f38c29de7
diff --git a/.claude/checkpoints/task-1755013154.json b/.claude/checkpoints/task-1755013154.json
new file mode 100644
index 0000000000..83ab85c99f
--- /dev/null
+++ b/.claude/checkpoints/task-1755013154.json
@@ -0,0 +1 @@
+{"checkpoint": "task-20250812-153913", "task": "@ruvnet ➜ /workspaces/claude-code-flow (alpha-89) $ ./claude-flow truth --agent coder --detailed ", "timestamp": "2025-08-12T15:39:14Z", "commit": "72e39496bbba90aa58343da5eabeb176ed0b8d19", "github_release": "true"}
diff --git a/src/cli/simple-commands/verification.js b/src/cli/simple-commands/verification.js
index 36bfeb551f..43c6b1b63b 100644
--- a/src/cli/simple-commands/verification.js
+++ b/src/cli/simple-commands/verification.js
@@ -226,19 +226,86 @@ export async function verificationCommand(args, flags) {
case 'truth':
case 'score':
await system.loadMemory();
- const report = await system.generateTruthReport();
+
+ // Filter by agent if specified
+ let filteredHistory = system.verificationHistory;
+ if (flags.agent) {
+ filteredHistory = system.verificationHistory.filter(v => v.agentType === flags.agent);
+ if (filteredHistory.length === 0) {
+ console.log(`\n⚠️ No verification history found for agent: ${flags.agent}`);
+ return;
+ }
+ }
+
+ // Generate report (with filtered data if agent specified)
+ const report = flags.agent ?
+ await generateFilteredReport(system, filteredHistory, flags.agent) :
+ await system.generateTruthReport();
// Basic report (always shown)
- console.log('\nπŸ“Š Truth Scoring Report');
+ console.log('\nπŸ“Š Truth Scoring Report' + (flags.agent ? ` - Agent: ${flags.agent}` : ''));
console.log('━'.repeat(50));
- console.log(`Mode: ${report.mode}`);
- console.log(`Threshold: ${report.threshold}`);
+ console.log(`Mode: ${report.mode || system.mode}`);
+ console.log(`Threshold: ${report.threshold || VERIFICATION_MODES[system.mode].threshold}`);
console.log(`Total Verifications: ${report.totalVerifications}`);
console.log(`Passed: ${report.passedVerifications}`);
console.log(`Average Score: ${report.averageScore.toFixed(3)}`);
- console.log('\nπŸ€– Agent Reliability:');
- for (const [agent, reliability] of Object.entries(report.agentReliability)) {
- console.log(` ${agent}: ${(reliability * 100).toFixed(1)}%`);
+
+ if (flags.agent) {
+ // Show detailed info for specific agent
+ console.log(`\nπŸ€– ${flags.agent} Agent Details:`);
+ console.log(` Reliability: ${(report.agentReliability[flags.agent] * 100).toFixed(1)}%`);
+ console.log(` Total Tasks: ${filteredHistory.length}`);
+ console.log(` Passed: ${filteredHistory.filter(v => v.passed).length}`);
+ console.log(` Failed: ${filteredHistory.filter(v => !v.passed).length}`);
+
+ if (flags.detailed || flags.detail) {
+ console.log('\nπŸ“‹ Verification History:');
+ const recentAgent = filteredHistory.slice(-10);
+ for (const v of recentAgent) {
+ const time = new Date(v.timestamp).toLocaleTimeString();
+ console.log(` ${v.passed ? 'βœ…' : '❌'} [${time}] ${v.taskId}: ${v.score.toFixed(3)}`);
+ if (v.results && flags.verbose) {
+ for (const [check, result] of Object.entries(v.results)) {
+ console.log(` β€’ ${check}: ${result.passed ? 'βœ“' : 'βœ—'} (${result.score.toFixed(2)})`);
+ }
+ }
+ }
+
+ // Score distribution
+ const scores = filteredHistory.map(v => v.score);
+ const minScore = Math.min(...scores);
+ const maxScore = Math.max(...scores);
+ console.log('\nπŸ“Š Score Distribution:');
+ console.log(` Min Score: ${minScore.toFixed(3)}`);
+ console.log(` Max Score: ${maxScore.toFixed(3)}`);
+ console.log(` Average: ${report.averageScore.toFixed(3)}`);
+
+ // Performance trend
+ if (filteredHistory.length > 5) {
+ const recent5 = filteredHistory.slice(-5);
+ const older5 = filteredHistory.slice(-10, -5);
+ const recentAvg = recent5.reduce((sum, v) => sum + v.score, 0) / recent5.length;
+ const olderAvg = older5.length > 0 ?
+ older5.reduce((sum, v) => sum + v.score, 0) / older5.length : 0;
+
+ console.log('\nπŸ“ˆ Performance Trend:');
+ if (olderAvg > 0) {
+ const trend = recentAvg - olderAvg;
+ const trendSymbol = trend > 0 ? '↑' : trend < 0 ? '↓' : 'β†’';
+ console.log(` Recent Average: ${recentAvg.toFixed(3)} ${trendSymbol}`);
+ console.log(` Previous Average: ${olderAvg.toFixed(3)}`);
+ console.log(` Change: ${trend >= 0 ? '+' : ''}${(trend * 100).toFixed(1)}%`);
+ } else {
+ console.log(` Recent Average: ${recentAvg.toFixed(3)}`);
+ }
+ }
+ }
+ } else {
+ console.log('\nπŸ€– Agent Reliability:');
+ for (const [agent, reliability] of Object.entries(report.agentReliability)) {
+ console.log(` ${agent}: ${(reliability * 100).toFixed(1)}%`);
+ }
}
// Detailed report with --report flag