Summary
The hooks trajectory-end command pushes completed trajectories to data.trajectories[] but never increments data.stats.total_trajectories. The hooks stats command reads the stale counter and reports 0 trajectories even when the array has entries.
Root Cause
In bin/cli.js, the trajectory-end action (line ~4124) does:
intel.data.trajectories.push(traj);
delete trajectories[latestTrajId];
intel.save();
But never syncs: intel.data.stats.total_trajectories = intel.data.trajectories.length
Compare with learn() (line ~2910) which correctly does:
this.data.stats.total_trajectories = this.data.trajectories.length;
Fix
Defect RV-003 in claude-flow-patch.
Add intel.data.stats.total_trajectories = intel.data.trajectories.length; before intel.save() in the trajectory-end handler. Also sync total_patterns and total_memories for consistency.
Files Affected
bin/cli.js (ruvector package)
Affected Versions
ruvector bundled with @claude-flow/cli 3.1.0-alpha.41 through current
Related Issues
Summary
The
hooks trajectory-endcommand pushes completed trajectories todata.trajectories[]but never incrementsdata.stats.total_trajectories. Thehooks statscommand reads the stale counter and reports 0 trajectories even when the array has entries.Root Cause
In
bin/cli.js, thetrajectory-endaction (line ~4124) does:But never syncs:
intel.data.stats.total_trajectories = intel.data.trajectories.lengthCompare with
learn()(line ~2910) which correctly does:Fix
Defect RV-003 in claude-flow-patch.
Add
intel.data.stats.total_trajectories = intel.data.trajectories.length;beforeintel.save()in the trajectory-end handler. Also synctotal_patternsandtotal_memoriesfor consistency.Files Affected
bin/cli.js(ruvector package)Affected Versions
ruvectorbundled with@claude-flow/cli3.1.0-alpha.41 through currentRelated Issues