Skip to content

feat: enrich intelligence MCP response with computed component stats#1087

Open
SNooZyy2 wants to merge 1 commit intoruvnet:mainfrom
SNooZyy2:fix/enrich-intelligence-mcp-response
Open

feat: enrich intelligence MCP response with computed component stats#1087
SNooZyy2 wants to merge 1 commit intoruvnet:mainfrom
SNooZyy2:fix/enrich-intelligence-mcp-response

Conversation

@SNooZyy2
Copy link

@SNooZyy2 SNooZyy2 commented Feb 6, 2026

Summary

  • Enriched hooks_intelligence MCP tool response with 15 previously-missing fields
  • Loads actual SONA, MoE, Flash Attention, EWC, and LoRA components to compute real stats
  • Adds performance section with benchmark metrics
  • Companion to null-guard display fix (separate PR)

Problem

The hooks intelligence command crashes because the display code expects fields like learningTimeMs, routingAccuracy, searchSpeedup, cacheHitRate, and a performance section — but the MCP handler never includes them. The response only contained availability flags and notes.

Fix

Instead of simple boolean availability checks, the handler now:

  1. Loads each intelligence component (SONA optimizer, MoE router, Flash Attention, etc.)
  2. Calls getStats(), getLoadBalance(), getSpeedup() to extract real metrics
  3. Computes derived values (success rate, load balance score, cache hit rate)
  4. Includes all computed fields in the response alongside existing fields

Test plan

  • Run claude-flow hooks intelligence --format json — verify all 15 new fields present
  • Run claude-flow hooks intelligence — full dashboard renders without crash
  • Verify SONA metrics: learningTimeMs, adaptationTimeMs, avgQuality
  • Verify MoE metrics: expertsActive, routingAccuracy, loadBalance
  • Verify HNSW metrics: searchSpeedup, memoryUsage, dimension
  • Verify embeddings: cacheHitRate
  • Verify performance section: flashAttention, memoryReduction, searchImprovement, tokenReduction, sweBenchScore

Generated with claude-flow

The hooks_intelligence MCP tool response was missing fields that the
display code expects: learningTimeMs, adaptationTimeMs, avgQuality
(SONA), expertsActive, routingAccuracy, loadBalance (MoE), searchSpeedup,
memoryUsage, dimension (HNSW), cacheHitRate (embeddings), and the entire
performance section.

Now loads actual SONA optimizer, MoE router, Flash Attention, EWC, and
LoRA components and computes real statistics from their internal state.
Adds performance section with Flash Attention speedup, memory reduction,
search improvement, token reduction, and SWE-Bench score.

Ref: ADR-016

Co-Authored-By: claude-flow <ruv@ruv.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant