From 73af09c26edee5fb126cf80542e1965ac695e90b Mon Sep 17 00:00:00 2001 From: rUv Date: Mon, 9 Feb 2026 19:00:10 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: rebrand/ruvflow-umbrella - Timestamp: 2026-02-09T19:00:10Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../cli/src/init/statusline-generator.ts | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/v3/@claude-flow/cli/src/init/statusline-generator.ts b/v3/@claude-flow/cli/src/init/statusline-generator.ts index 4fa77d3685..edbe1ac223 100644 --- a/v3/@claude-flow/cli/src/init/statusline-generator.ts +++ b/v3/@claude-flow/cli/src/init/statusline-generator.ts @@ -477,17 +477,31 @@ function getSystemMetrics() { // Also get AgentDB stats for fallback intelligence calculation const agentdbStats = getAgentDBStats(); - // Intelligence % based on learned patterns, vectors, or project maturity - // Calculate all sources and take the maximum + // Intelligence % — priority chain (ADR-050): + // 1. Intelligence loop data (confidenceMean + accessRatio + density) + // 2. learning.json file metric + // 3. Pattern count / vector count fallback + // 4. Project maturity fallback (below) let intelligencePct = 0; - if (intelligenceFromFile !== null) { + // Priority 1: Intelligence loop real data + if (learning.confidenceMean > 0 || (learning.patterns > 0 && learning.accessedCount > 0)) { + const confScore = Math.min(100, Math.floor(learning.confidenceMean * 100)); + const accessRatio = learning.patterns > 0 ? (learning.accessedCount / learning.patterns) : 0; + const accessScore = Math.min(100, Math.floor(accessRatio * 100)); + const densityScore = Math.min(100, Math.floor(learning.patterns / 5)); + intelligencePct = Math.floor(confScore * 0.4 + accessScore * 0.3 + densityScore * 0.3); + } + + // Priority 2: learning.json file metric + if (intelligencePct === 0 && intelligenceFromFile !== null) { intelligencePct = intelligenceFromFile; - } else { - // Calculate from multiple sources and take the best + } + + // Priority 3: Pattern/vector count fallback + if (intelligencePct === 0) { const fromPatterns = learning.patterns > 0 ? Math.min(100, Math.floor(learning.patterns / 10)) : 0; const fromVectors = agentdbStats.vectorCount > 0 ? Math.min(100, Math.floor(agentdbStats.vectorCount / 100)) : 0; - intelligencePct = Math.max(fromPatterns, fromVectors); }