diff --git a/package.json b/package.json index 7ddf6da39e..9bc76e7c6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claude-flow", - "version": "3.7.0-alpha.3", + "version": "3.7.0-alpha.4", "description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration", "main": "dist/index.js", "type": "module", diff --git a/ruflo/package.json b/ruflo/package.json index 0553560723..345967ec10 100644 --- a/ruflo/package.json +++ b/ruflo/package.json @@ -1,6 +1,6 @@ { "name": "ruflo", - "version": "3.7.0-alpha.3", + "version": "3.7.0-alpha.4", "description": "Ruflo - Enterprise AI agent orchestration platform. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration", "main": "bin/ruflo.js", "type": "module", diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json index 5fe4d2e35b..e17339443e 100644 --- a/v3/@claude-flow/cli/package.json +++ b/v3/@claude-flow/cli/package.json @@ -1,6 +1,6 @@ { "name": "@claude-flow/cli", - "version": "3.7.0-alpha.3", + "version": "3.7.0-alpha.4", "type": "module", "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code", "main": "dist/src/index.js", diff --git a/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts b/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts index 2a5c68678c..822a218404 100644 --- a/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts +++ b/v3/@claude-flow/cli/src/mcp-tools/neural-tools.ts @@ -696,7 +696,18 @@ export const neuralTools: MCPTool[] = [ features: { hnsw: true, quantization: true, - flashAttention: false, + // #1770: probe the real loader instead of returning a literal false. + // Was hardcoded false, which contradicted hooks_intelligence_stats's + // simultaneous claim of `implementation: real-flash-attention`. + // The two surfaces now agree on a single source of truth. + flashAttention: await (async () => { + try { + const { getFlashAttention } = await import('../ruvector/flash-attention.js'); + return getFlashAttention() !== null; + } catch { + return false; + } + })(), reasoningBank: true, }, }; diff --git a/v3/@claude-flow/cli/src/memory/intelligence.ts b/v3/@claude-flow/cli/src/memory/intelligence.ts index dad0cd2f67..79061bfd2b 100644 --- a/v3/@claude-flow/cli/src/memory/intelligence.ts +++ b/v3/@claude-flow/cli/src/memory/intelligence.ts @@ -13,6 +13,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; import { homedir } from 'node:os'; +import { createRequire } from 'node:module'; import { dirname, join } from 'node:path'; // ============================================================================ @@ -717,20 +718,37 @@ class LocalReasoningBank { let ruvllmCoordinator: any = null; let ruvllmLoaded = false; -async function loadRuvllmCoordinator(): Promise { +/** + * Synchronously load the @ruvector/ruvllm SonaCoordinator. Used both by the + * async init path (initializeIntelligence) and by sync stat readers like + * getIntelligenceStats — the dashboard would otherwise report "unavailable" + * when stats are queried before any async init has fired (#1770). + */ +function loadRuvllmCoordinatorSync(): any { if (ruvllmLoaded) return ruvllmCoordinator; ruvllmLoaded = true; try { - const { createRequire } = await import('module'); const requireCjs = createRequire(import.meta.url); const ruvllm = requireCjs('@ruvector/ruvllm'); ruvllmCoordinator = new ruvllm.SonaCoordinator(ruvllm.DEFAULT_SONA_CONFIG); return ruvllmCoordinator; - } catch { + } catch (err) { + // Surface the reason on debug builds so future regressions of #1770 don't + // disappear silently. Stays quiet by default to avoid noise on the cli's + // hot path (e.g., npx invocations). + if (process.env.CLAUDE_FLOW_DEBUG) { + // eslint-disable-next-line no-console + console.error('[ruvllm] SonaCoordinator load failed, falling back to JS:', (err as Error).message); + } + ruvllmCoordinator = null; return null; } } +async function loadRuvllmCoordinator(): Promise { + return loadRuvllmCoordinatorSync(); +} + // ============================================================================ // Module State // ============================================================================ @@ -1078,6 +1096,14 @@ export function getIntelligenceStats(): IntelligenceStats & { const sonaStats = sonaCoordinator?.stats(); const bankStats = reasoningBank?.stats(); + // Lazy-init the ruvllm coordinator if it hasn't been loaded yet. The MCP + // dashboard (`hooks_intelligence_stats`) hits this path before any + // initializeIntelligence() call has fired, so the coordinator field would + // otherwise stay null and the dashboard would report "unavailable" even + // when @ruvector/ruvllm is fully resolvable. Sync require — cheap, idempotent. + if (!ruvllmLoaded) { + loadRuvllmCoordinatorSync(); + } const ruvllmStats = ruvllmCoordinator?.stats?.() || null; // Fetch cross-module stats for unified reporting