Skip to content

fix(mcp): align hooks_learn persistence path with hooks_batch_learn#330

Open
dmoellenbeck wants to merge 1 commit intoruvnet:mainfrom
dmoellenbeck:fix/hooks-learn-persistence
Open

fix(mcp): align hooks_learn persistence path with hooks_batch_learn#330
dmoellenbeck wants to merge 1 commit intoruvnet:mainfrom
dmoellenbeck:fix/hooks-learn-persistence

Conversation

@dmoellenbeck
Copy link
Copy Markdown

Summary

  • hooks_learn and related handlers (hooks_learning_config, hooks_learning_stats, hooks_learning_update) used intel.learning — an instance property that is never persisted by save() (which writes this.data)
  • hooks_batch_learn correctly used intel.data.learning — inside this.data, persisted to disk
  • This caused Q-table updates from hooks_learn to be lost on every MCP restart, and the two handlers maintained separate, disconnected Q-tables

Fix

Change all 7 occurrences of intel.learning to intel.data.learning in npm/packages/ruvector/bin/mcp-server.js (lines 2376-2477). One-line semantic change, applied consistently.

Test plan

  • Start MCP server, call hooks_learn with a reward experience
  • Verify hooks_learning_stats shows totalUpdates > 0
  • Restart MCP server
  • Verify hooks_learning_stats still shows the same totalUpdates (persisted)
  • Call hooks_batch_learn, then hooks_learn — verify both see the same Q-table

Ref: #280

hooks_learn, hooks_learning_config, hooks_learning_stats, and
hooks_learning_update all used `intel.learning` (instance property,
in-memory only, lost on restart). hooks_batch_learn used
`intel.data.learning` (inside `this.data`, persisted by `save()`).

This caused two bugs:
1. hooks_learn Q-table updates lost on MCP restart
2. hooks_learn and hooks_batch_learn maintained separate Q-tables

Fix: change all 7 occurrences of `intel.learning` to
`intel.data.learning` so all handlers share the same persisted path.

Ref: ruvnet#280
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