fix(mcp): align hooks_learn persistence path with hooks_batch_learn#330
Open
dmoellenbeck wants to merge 1 commit intoruvnet:mainfrom
Open
fix(mcp): align hooks_learn persistence path with hooks_batch_learn#330dmoellenbeck wants to merge 1 commit intoruvnet:mainfrom
dmoellenbeck wants to merge 1 commit intoruvnet:mainfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hooks_learnand related handlers (hooks_learning_config,hooks_learning_stats,hooks_learning_update) usedintel.learning— an instance property that is never persisted bysave()(which writesthis.data)hooks_batch_learncorrectly usedintel.data.learning— insidethis.data, persisted to diskhooks_learnto be lost on every MCP restart, and the two handlers maintained separate, disconnected Q-tablesFix
Change all 7 occurrences of
intel.learningtointel.data.learninginnpm/packages/ruvector/bin/mcp-server.js(lines 2376-2477). One-line semantic change, applied consistently.Test plan
hooks_learnwith a reward experiencehooks_learning_statsshowstotalUpdates > 0hooks_learning_statsstill shows the sametotalUpdates(persisted)hooks_batch_learn, thenhooks_learn— verify both see the same Q-tableRef: #280