-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Bug Summary
SonaTrajectoryService (from the agentdb package) fails to properly integrate with the native @ruvector/sona engine, resulting in SONA trajectory learning being effectively disabled. The service stores the module object instead of instantiating a SonaEngine, and calls nonexistent methods (recordStep, record, addStep, predict, selectAction) instead of the actual native API.
This bug has existed since the file first appeared in agentdb@3.0.0-alpha.4 and is present in every version through alpha.10.
Source File Missing from Git
The SonaTrajectoryService TypeScript source file does not exist anywhere in the git source of ruvnet/agentic-flow (agentdb's repo) — not on main, not on any of the 18 feature branches, and not in the commit history. The file only exists in the npm-published dist/ directory.
This is part of a broader pattern: 4 service files and 5 controller files exist in the npm package but have no corresponding source in git.
Impact
- SONA native learning is completely non-functional — trajectories are never recorded in the native engine
- Pattern extraction fails —
findPatternsis never called - The service silently falls back to a simple JavaScript frequency counter, giving the appearance of working while providing no actual RL-based learning
- All Micro-LoRA, EWC++, and pattern clustering features of
@ruvector/sonaare bypassed - The service reports
engineType: 'native'andavailable: truewhile doing nothing with the native engine
Root Cause (3 bugs)
Bug 1: initialize() — Module vs Instance
Looks for SONA/Sona class name instead of SonaEngine. Falls back to storing the raw module object.
Bug 2: recordTrajectory() — Nonexistent Methods
Calls recordStep(), record(), addStep() — none exist on SonaEngine. Silent catch {}.
Bug 3: predict() — Nonexistent Methods
Calls predict(), selectAction() — neither exist. Falls back to frequency counter.
Fix
PR submitted: ruvnet/agentic-flow#121
- Uses
SonaEngine.withConfig()for proper instantiation - Uses
beginTrajectory→addTrajectoryStep→endTrajectory→tick()pipeline - Uses
findPatterns()for pattern-based predictions - 54/54 test assertions passing across 10 test categories
- Full backward compatibility maintained