Summary
npx ruvector@0.2.27 hooks force-learn exits with code 1 and TypeError: intel.tick is not a function at npm/packages/ruvector/bin/cli.js:4420. The command is unusable. Confirmed still present on main (HEAD as of 2026-06-02) and in npm latest (0.2.27) — the code at that line is unchanged.
Root cause (confirmed)
The force-learn action constructs the lightweight, engine-disabled Intelligence wrapper and then calls intel.tick():
// npm/packages/ruvector/bin/cli.js
hooksCmd.command('force-learn')
.description('Force an immediate learning cycle')
.action(() => {
const intel = new Intelligence({ skipEngine: true }); // Fast mode
intel.tick(); // <-- line 4420: TypeError
console.log(JSON.stringify({ success: true, result: 'Learning cycle triggered', stats: intel.stats() }));
});
This is doubly wrong:
tick() / forceLearn() exist only on the native IntelligenceEngine (dist/core/sona-wrapper.js, dist/core/intelligence-engine.js) — not on the cli.js Intelligence JSON wrapper, which has no tick().
{ skipEngine: true } guarantees the engine is never initialized, so even getEngineIfReady() would return null here.
By contrast, the correct pattern is used elsewhere in the same file — e.g. sessionEnd() does const eng = this.getEngineIfReady(); if (eng) eng.forceLearn();.
The engine itself works
Constructing the engine directly and calling forceLearn() works fine:
const { IntelligenceEngine } = require('ruvector/dist/core/intelligence-engine.js');
const e = new IntelligenceEngine({ enableSona: true, enableOnnx: false });
e.forceLearn();
// => "Forced learning: 0 trajectories -> 0 patterns, status: skipped: insufficient trajectories"
So this is purely a CLI wiring bug, not an engine failure. (hooks stats and mcp start are unaffected.)
Environment
- ruvector:
0.2.27 (npm latest) and main HEAD
- node:
v24.15.0
- OS: macOS (Darwin 25.4.0)
- Install:
npx ruvector@0.2.27 …
Stack trace
.../node_modules/ruvector/bin/cli.js:4420
intel.tick();
^
TypeError: intel.tick is not a function
at Command.<anonymous> (.../ruvector/bin/cli.js:4420:11)
at Command.listener [as _actionHandler] (.../commander/lib/command.js:494:17)
...
Node.js v24.15.0
Suggested fix
Make the force-learn action use the engine the way sessionEnd() does — initialize the engine, then call forceLearn():
.action(() => {
const intel = new Intelligence(); // engine enabled
const eng = intel.getEngine(); // full init (imports existing data)
const result = eng ? eng.forceLearn() : 'engine unavailable';
intel.save();
console.log(JSON.stringify({ success: true, result, stats: intel.stats() }));
});
Impact
A nightly automation calls hooks force-learn as a best-effort consolidation step. The rc=1 was suppressed for ~a week as a "known issue" — which also masked an unrelated silent reset of intelligence.json during a v0.1.x → v0.2.x bump (~525 memories / 439 trajectories lost). The two together meant the learning layer was effectively non-functional for several days with no signal beyond an rc=1 that was being ignored. A crash here is especially costly because it hides other failures.
Summary
npx ruvector@0.2.27 hooks force-learnexits with code 1 andTypeError: intel.tick is not a functionatnpm/packages/ruvector/bin/cli.js:4420. The command is unusable. Confirmed still present onmain(HEAD as of 2026-06-02) and in npmlatest(0.2.27) — the code at that line is unchanged.Root cause (confirmed)
The
force-learnaction constructs the lightweight, engine-disabledIntelligencewrapper and then callsintel.tick():This is doubly wrong:
tick()/forceLearn()exist only on the nativeIntelligenceEngine(dist/core/sona-wrapper.js,dist/core/intelligence-engine.js) — not on the cli.jsIntelligenceJSON wrapper, which has notick().{ skipEngine: true }guarantees the engine is never initialized, so evengetEngineIfReady()would returnnullhere.By contrast, the correct pattern is used elsewhere in the same file — e.g.
sessionEnd()doesconst eng = this.getEngineIfReady(); if (eng) eng.forceLearn();.The engine itself works
Constructing the engine directly and calling
forceLearn()works fine:So this is purely a CLI wiring bug, not an engine failure. (
hooks statsandmcp startare unaffected.)Environment
0.2.27(npmlatest) andmainHEADv24.15.0npx ruvector@0.2.27 …Stack trace
Suggested fix
Make the
force-learnaction use the engine the waysessionEnd()does — initialize the engine, then callforceLearn():Impact
A nightly automation calls
hooks force-learnas a best-effort consolidation step. The rc=1 was suppressed for ~a week as a "known issue" — which also masked an unrelated silent reset ofintelligence.jsonduring a v0.1.x → v0.2.x bump (~525 memories / 439 trajectories lost). The two together meant the learning layer was effectively non-functional for several days with no signal beyond an rc=1 that was being ignored. A crash here is especially costly because it hides other failures.