@claude-flow/cli 3.10.6 → 3.10.8

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 CHANGED
@@ -202,7 +202,7 @@ claude mcp add ruflo -- npx ruflo@latest mcp start
202
202
  | 📡 **Comms Layer** | Zero-trust federation — agents across machines/orgs discover, authenticate, and exchange work securely |
203
203
  | 🐝 **Swarm Coordination** | Hierarchical, mesh, and adaptive topologies with consensus |
204
204
  | 🧠 **Self-Learning** | SONA neural patterns, ReasoningBank, trajectory learning |
205
- | 💾 **Vector Memory** | HNSW-indexed AgentDB with 150x-12,500x faster search |
205
+ | 💾 **Vector Memory** | HNSW-indexed AgentDB measured ~1.9x faster at N=20k, ~3.2x–4.7x at N=5k vs brute force (recall@10 ~0.99); ANN wins above the crossover, ties/loses at small N. See [audit](docs/reviews/intelligence-system-audit-2026-05-29.md) + [`scripts/benchmark-intelligence.mjs`](scripts/benchmark-intelligence.mjs) |
206
206
  | ⚡ **Background Workers** | 12 auto-triggered workers (audit, optimize, testgaps, etc.) |
207
207
  | 🧩 **Plugin Marketplace** | 32 native Claude Code plugins + 21 npm plugins |
208
208
  | 🔌 **Multi-Provider** | Claude, GPT, Gemini, Cohere, Ollama with smart routing |
@@ -228,7 +228,7 @@ claude mcp add ruflo -- npx ruflo@latest mcp start
228
228
  | 🛠️ | **~210 tools, ready to call** | 5 server groups (Core, Intelligence, Agents, Memory, DevTools) plus an 18-tool gallery that runs entirely in your browser — works offline. |
229
229
  | 🔌 | **Bring your own MCP servers** | Click the **MCP (n)** pill in the chat input → *Add Server* and paste any MCP endpoint (HTTP, SSE, or stdio). Your tools join RuFlo's native ones in the same parallel-execution flow. Run a local MCP server on `localhost:3000` and it just works. |
230
230
  | ⚡ | **Tools run in parallel** | One model response can fire 4–6+ tools at the same time. The UI shows them as cards with a *Step 1 — 2 tools completed* badge so you can see exactly what ran. |
231
- | 💾 | **Memory that sticks** | Say *"remember my favorite color is indigo"* and ask weeks later — RuFlo recalls it. Backed by AgentDB + HNSW vector search (≥150× faster than brute force). |
231
+ | 💾 | **Memory that sticks** | Say *"remember my favorite color is indigo"* and ask weeks later — RuFlo recalls it. Backed by AgentDB + HNSW vector search (measured ~1.9x–4.7x faster than brute force above the crossover, recall@10 ~0.99). |
232
232
  | 📘 | **Built-in capabilities tour** | Click the question-mark icon in the sidebar — a "RuFlo Capabilities" modal opens with the full tool list, model strengths, architecture, and keyboard shortcuts. |
233
233
  | 🏠 | **Self-hostable** | Web UI is shipped as Docker (`ruflo/src/ruvocal/Dockerfile`) with embedded Mongo. Deploy to your own Cloud Run / Fly / Kubernetes / docker-compose. The hosted [flo.ruv.io](https://flo.ruv.io/) demo is one option; running your own is fully supported. |
234
234
  | 🚀 | **Zero install to try** | Open the hosted URL, pick a model, type a question. That's the whole onboarding. |
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/hooks-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,YAAY,CAAC;AAsrBzD,eAAO,MAAM,YAAY,EAAE,OAwC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OA+C3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAqC7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAmD9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,OAgLxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAoE1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OA8CvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAyF1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAuK3B,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,OA4E1B,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,OAiJ3B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,OAoE9B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MAAM,kBAAkB,EAAE,OAuKhC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OA4E/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,OAwGhC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,OAgNpC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,OAiGpC,CAAC;AAGF,eAAO,MAAM,0BAA0B,EAAE,OA8MxC,CAAC;AAgQF,eAAO,MAAM,eAAe,EAAE,OA8C7B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,OAwIjC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAuD/B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAkE/B,CAAC;AAiBF,eAAO,MAAM,eAAe,EAAE,OA4C7B,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,OAgC/B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,OAuB7B,CAAC;AAqBF,eAAO,MAAM,iBAAiB,EAAE,OA0C/B,CAAC;AAOF,eAAO,MAAM,iBAAiB,EAAE,OAwB/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,OA4BhC,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,OAAO,EA0C/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -2476,15 +2476,35 @@ export const hooksTrajectoryEnd = {
2476
2476
  const ewc = await getEWCConsolidator();
2477
2477
  if (ewc) {
2478
2478
  try {
2479
- // Record gradient sample for Fisher matrix update
2480
- // Create a simple gradient from trajectory steps
2481
- const gradients = new Array(384).fill(0).map((_, i) => Math.sin(i * 0.01) * (trajectory.steps.length / 10));
2482
- ewc.recordGradient(`trajectory-${trajectoryId}`, gradients, success);
2483
- const stats = ewc.getConsolidationStats();
2484
- ewcResult = {
2485
- consolidated: true,
2486
- penalty: stats.avgPenalty,
2487
- };
2479
+ // AUDIT FIX #4: derive a REAL gradient from the trajectory's
2480
+ // embedding (mirrors the DISTILL path, where step content is
2481
+ // embedded via generateEmbedding) instead of a synthetic sine
2482
+ // wave. The EWC library treats the embedding as the gradient
2483
+ // proxy (see recordPatternOutcome in ewc-consolidation.ts).
2484
+ let gradients = null;
2485
+ try {
2486
+ const { generateEmbedding } = await import('../memory/memory-initializer.js');
2487
+ // Embed the same summary that was persisted for semantic search,
2488
+ // so the Fisher update reflects the actual recorded trajectory.
2489
+ const summary = `Task: ${trajectory.task} | Agent: ${trajectory.agent} | Steps: ${trajectory.steps.map(s => `${s.action}=>${s.result}`).join('; ')}${feedback ? ` | Feedback: ${feedback}` : ''}`;
2490
+ const embeddingResult = await generateEmbedding(summary);
2491
+ if (embeddingResult?.embedding && embeddingResult.embedding.length > 0) {
2492
+ gradients = embeddingResult.embedding;
2493
+ }
2494
+ }
2495
+ catch {
2496
+ // Embedding generation unavailable — fall through and skip EWC
2497
+ }
2498
+ if (gradients) {
2499
+ ewc.recordGradient(`trajectory-${trajectoryId}`, gradients, success);
2500
+ const stats = ewc.getConsolidationStats();
2501
+ ewcResult = {
2502
+ consolidated: true,
2503
+ penalty: stats.avgPenalty,
2504
+ };
2505
+ }
2506
+ // If no real embedding-derived gradient is available, SKIP the EWC
2507
+ // update rather than feeding the Fisher matrix synthetic noise.
2488
2508
  }
2489
2509
  catch {
2490
2510
  // EWC consolidation failed, continue without it
@@ -2929,7 +2949,27 @@ export const hooksIntelligenceLearn = {
2929
2949
  handler: async (params) => {
2930
2950
  const consolidate = params.consolidate !== false;
2931
2951
  const startTime = Date.now();
2932
- // Get SONA statistics
2952
+ // AUDIT FIX #5: actually TRIGGER a learning/consolidation cycle instead of
2953
+ // only reading and echoing stats. This calls the real DISTILL path
2954
+ // (LoRA-style confidence updates with EWC++ consolidation protection) and
2955
+ // the background learning pass, then reports the resulting stats.
2956
+ let distill = null;
2957
+ let distillTriggered = false;
2958
+ try {
2959
+ const intelligence = await import('../memory/intelligence.js');
2960
+ // DISTILL + CONSOLIDATE: real LoRA update with EWC++ protection
2961
+ distill = await intelligence.distillLearning();
2962
+ distillTriggered = distill !== null;
2963
+ // Run background learning (ruvllm) pass as well — best-effort
2964
+ try {
2965
+ await intelligence.runBackgroundLearning();
2966
+ }
2967
+ catch { /* best-effort */ }
2968
+ }
2969
+ catch {
2970
+ // intelligence layer unavailable — fall back to stats-only reporting
2971
+ }
2972
+ // Get SONA statistics (AFTER triggering the cycle so they reflect the update)
2933
2973
  let sonaStats = {
2934
2974
  totalPatterns: 0,
2935
2975
  successfulRoutings: 0,
@@ -2948,7 +2988,7 @@ export const hooksIntelligenceLearn = {
2948
2988
  avgConfidence: stats.avgConfidence,
2949
2989
  };
2950
2990
  }
2951
- // Get EWC++ statistics and optionally trigger consolidation
2991
+ // Get EWC++ statistics after the consolidation cycle ran
2952
2992
  let ewcStats = {
2953
2993
  consolidation: false,
2954
2994
  fisherUpdated: false,
@@ -2963,16 +3003,20 @@ export const hooksIntelligenceLearn = {
2963
3003
  consolidation: true,
2964
3004
  fisherUpdated: stats.consolidationCount > 0,
2965
3005
  forgettingPrevented: stats.highImportancePatterns,
2966
- avgPenalty: stats.avgPenalty,
3006
+ avgPenalty: distill?.ewcPenalty ?? stats.avgPenalty,
2967
3007
  };
2968
3008
  }
2969
3009
  }
2970
3010
  return {
2971
- learned: sonaStats.totalPatterns > 0,
3011
+ // "learned" now reflects whether a real distill cycle actually ran
3012
+ learned: distillTriggered || sonaStats.totalPatterns > 0,
3013
+ cycleTriggered: distillTriggered,
3014
+ patternsDistilled: distill?.patternsDistilled ?? 0,
2972
3015
  duration: Date.now() - startTime,
2973
3016
  updates: {
2974
3017
  trajectoriesProcessed: sonaStats.trajectoriesProcessed,
2975
3018
  patternsLearned: sonaStats.totalPatterns,
3019
+ patternsDistilled: distill?.patternsDistilled ?? 0,
2976
3020
  successRate: sonaStats.trajectoriesProcessed > 0
2977
3021
  ? (sonaStats.successfulRoutings / (sonaStats.successfulRoutings + sonaStats.failedRoutings) * 100).toFixed(1) + '%'
2978
3022
  : '0%',
@@ -2982,7 +3026,9 @@ export const hooksIntelligenceLearn = {
2982
3026
  average: sonaStats.avgConfidence,
2983
3027
  implementation: sona ? 'real-sona' : 'not-available',
2984
3028
  },
2985
- implementation: sona ? 'real-sona-learning' : 'placeholder',
3029
+ implementation: distillTriggered
3030
+ ? 'real-distill-consolidate'
3031
+ : (sona ? 'real-sona-learning' : 'placeholder'),
2986
3032
  };
2987
3033
  },
2988
3034
  };