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

test(cli): shared-sqlite identity test follows the installed @claude-flow/memory

Dragan Spiridonov197bfb727272
diff --git a/v3/@claude-flow/cli/__tests__/shared-sqlite-host-driver.test.ts b/v3/@claude-flow/cli/__tests__/shared-sqlite-host-driver.test.ts
index 93ba7e6c32..16c8e7815e 100644
--- a/v3/@claude-flow/cli/__tests__/shared-sqlite-host-driver.test.ts
+++ b/v3/@claude-flow/cli/__tests__/shared-sqlite-host-driver.test.ts
@@ -2,23 +2,31 @@
* #3693/#3883 single-copy invariant after @claude-flow/memory started opening
* AgentDB with its own better-sqlite3 (Node 24 Statement-GC abort): the CLI's
* shared loader must hand out the exact constructor AgentDB's handle uses.
+ *
+ * The installed @claude-flow/memory may be the workspace source (>= 3.0.3,
+ * routes AgentDB through getHostSqliteDriver) or a published copy that does
+ * not (<= 3.0.2, AgentDB loads its own); both must keep one copy.
*/
import { describe, expect, it } from 'vitest';
+import { existsSync } from 'node:fs';
import { createRequire } from 'node:module';
+import { dirname, join } from 'node:path';
import { pathToFileURL } from 'node:url';
const req = createRequire(import.meta.url);
// This package's vitest config externalizes both; import the resolved files natively.
const importInstalled = (name: string): Promise<any> => import(pathToFileURL(req.resolve(name)).href);
+const memoryEntry = req.resolve('@claude-flow/memory');
+const memoryRoutesAgentDB = existsSync(join(dirname(memoryEntry), 'agentdb-native-driver.js'));
-describe('shared-sqlite follows @claude-flow/memory getHostSqliteDriver()', () => {
- it('resolves the owner to the installed @claude-flow/memory', async () => {
+describe('shared-sqlite follows the copy AgentDB opens its handle with', () => {
+ it('owner is @claude-flow/memory when it routes AgentDB, else agentdb', async () => {
const { resolveSqliteOwnerEntry } = await import('../src/memory/shared-sqlite.js');
- expect(resolveSqliteOwnerEntry()).toBe(req.resolve('@claude-flow/memory'));
+ expect(resolveSqliteOwnerEntry()).toBe(memoryRoutesAgentDB ? memoryEntry : req.resolve('agentdb'));
});
- it("loadBetterSqlite3() is the constructor of AgentDB's handle", async () => {
+ it.skipIf(!memoryRoutesAgentDB)("loadBetterSqlite3() is the constructor of AgentDB's handle", async () => {
const memory = await importInstalled('@claude-flow/memory');
const { AgentDB } = await importInstalled('agentdb');
const { loadBetterSqlite3 } = await import('../src/memory/shared-sqlite.js');