Files
ruvnet__ruflo/v3/@claude-flow/cli/scripts/benchmark-self-learning.mjs
ruv ca77f83074 feat(intelligence): unified learning-stats aggregator (ADR-075, #2245 follow-up)
Resolves the "four contradictory stat sources" item ADR-074 deferred to a
future round. Turns out the four sources aren't duplicates — they
authoritatively measure four different layers (globalStats =
trajectory-pipeline counters, sonaCoordinator = in-process SONA, memory-bridge
= AgentDB entries, neural-patterns = neural store rows). So the fix is to
aggregate the *view*, not the store.

- getUnifiedLearningStats() — returns all 4 sub-views with each sub-view
  naming its source path, plus a consistency block that *flags* cross-store
  drift (e.g. globalStats reports N patterns but neural_patterns is empty)
  instead of silently disagreeing.
- hooks_intelligence_unified-stats — new MCP tool exposing it.
- getMemoryBridgeStats() + getNeuralStoreStats() — exported helpers so any
  caller wanting a coherent learning-state snapshot uses the same primitives.

Verification:
- 7 cross-store consistency tests (__tests__/unified-stats-2245.test.ts)
- Benchmark §F added — observed: globalStats=10/11 tracks SONA, bridge=10 rows,
  neural-patterns=10, sona.available=true, 1 consistency note (the pretrain-
  vs-neural-store gap the reporter caught in #2245)
- 123/123 across unified-stats + self-learning + mcp-tools-deep

bump 3.10.14 → 3.10.15.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-30 12:07:26 -04:00

13 KiB