Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix(cli): make the memory version verdict a warning and the test layout-independent (#3392)

ruva35901de80c2
diff --git a/v3/@claude-flow/cli/__tests__/doctor-memory-version-3392.test.ts b/v3/@claude-flow/cli/__tests__/doctor-memory-version-3392.test.ts
index 1f94229409..5b6a34e4d9 100644
--- a/v3/@claude-flow/cli/__tests__/doctor-memory-version-3392.test.ts
+++ b/v3/@claude-flow/cli/__tests__/doctor-memory-version-3392.test.ts
@@ -19,9 +19,9 @@ describe('#3392 evaluateMemoryPackageVersion', () => {
expect(evaluateMemoryPackageVersion('3.0.0-alpha.25', '3.0.0-alpha.25').status).toBe('pass');
});
- it('fails on a stale copy that a caret range would have accepted', () => {
+ it('warns on a stale copy that a caret range would have accepted', () => {
const check = evaluateMemoryPackageVersion('3.0.0-alpha.25', '3.0.0-alpha.24');
- expect(check.status).toBe('fail');
+ expect(check.status).toBe('warn');
expect(check.message).toContain('3.0.0-alpha.24');
expect(check.fix).toContain('_npx');
expect(check.fix).toContain('@claude-flow/[email protected]');
@@ -58,12 +58,13 @@ describe('#3392 cli declares an exact @claude-flow/memory pin', () => {
});
describe('#3392 checkMemoryPackageVersion (real resolution)', () => {
- it('reports the copy this CLI actually loads against its own pin', async () => {
+ it('reports on the copy this CLI actually loads, and never fails', async () => {
const check = await checkMemoryPackageVersion();
expect(check.name).toBe('@claude-flow/memory version');
- // In a healthy install the loaded copy satisfies the pin; a warn is only
- // acceptable when the optional package is genuinely not installed.
+ // Which copy is loaded depends on the install layout (a hoisted workspace
+ // can legitimately hold another version), so only the verdict's shape is
+ // asserted here; the version comparison itself is covered above.
expect(['pass', 'warn']).toContain(check.status);
- if (check.status === 'pass') expect(check.message).toContain(pkg.dependencies!['@claude-flow/memory']);
+ expect(check.message).toContain(pkg.dependencies!['@claude-flow/memory']);
});
});
diff --git a/v3/@claude-flow/cli/src/commands/doctor.ts b/v3/@claude-flow/cli/src/commands/doctor.ts
index 24926442ee..5a0099f2ac 100644
--- a/v3/@claude-flow/cli/src/commands/doctor.ts
+++ b/v3/@claude-flow/cli/src/commands/doctor.ts
@@ -1068,9 +1068,11 @@ export function evaluateMemoryPackageVersion(declared: string | null, installed:
if (semver.satisfies(installed, declared, { includePrerelease: true })) {
return { name: NAME, status: 'pass', message: `v${installed} satisfies declared ${declared}` };
}
+ // warn, not fail: a dev/hoisted layout can legitimately differ, and doctor's
+ // exit code must not depend on which copy a package manager happened to hoist.
return {
name: NAME,
- status: 'fail',
+ status: 'warn',
message: `installed v${installed} does not satisfy declared ${declared} — a stale cached copy is running, so fixes shipped in a newer @claude-flow/memory are silently absent`,
fix: `rm -rf "$(npm config get cache)/_npx" && npx @claude-flow/cli@latest doctor # or: npm install @claude-flow/memory@${declared}`,
};