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

feat(init): turn on persistent AgentDB memory by default

ruv9e596df5afb9
diff --git a/.claude/helpers/statusline.cjs b/.claude/helpers/statusline.cjs
index afcffb035e..5f99707fd8 100755
--- a/.claude/helpers/statusline.cjs
+++ b/.claude/helpers/statusline.cjs
@@ -618,7 +618,7 @@ function getPkgVersion() {
// version (see generateStatuslineScript()'s doc comment) β€” correct even
// when this renders via a pure npx invocation with no local install for
// the candidate scan below to find.
- let ver = "3.27.3";
+ let ver = "3.27.4";
try {
const home = os.homedir();
const pkgPaths = [
diff --git a/v3/@claude-flow/cli/.claude/helpers/helpers.manifest.json b/v3/@claude-flow/cli/.claude/helpers/helpers.manifest.json
index c5ca847b41..40168657d3 100644
--- a/v3/@claude-flow/cli/.claude/helpers/helpers.manifest.json
+++ b/v3/@claude-flow/cli/.claude/helpers/helpers.manifest.json
@@ -1,12 +1,13 @@
{
"manifest": {
- "version": "3.23.0",
+ "version": "3.27.4",
"files": {
"auto-memory-hook.mjs": "68be7e9a9eba7bf9c4e8a230db7bf61a243b965639f8504842799d6c6ca28762",
- "hook-handler.cjs": "bc4d2d26823d49b3ab1dded2946b66369f1f67bd76b4c30dca9f3b6df3cca8f0",
- "intelligence.cjs": "760cb82ed2000031abc1ac1fa90a014e7d91d93966e3aa4741b07ab7aff8d066"
+ "hook-handler.cjs": "2e4927ff158c0079a67a6f0ef0b99ac748d600d33798b0a5fbd5a6a82225ec03",
+ "intelligence.cjs": "bd1f8e4b034944aee1df0391dc47ac2e8cc4b3aa542c65407a59d49620bbf76b",
+ "statusline.cjs": "19586a8052bd032cea909a2d020f680aa8da31f5c4229068af612811cc694d5a"
}
},
- "signature": "of5l9RP68iPcmcC5dckDv+KIOiENJKifWxYKwQTwAiXiyRNNZuMwQ8y8Bd8+wGviTRxIzBfSuxL1nuJ/rX3xDQ==",
+ "signature": "y9y4o3fDtk7y2fBJy4NFbL3SF2Rog1GyVougqEHupMzxLctiKjS+k51WSnO35cFCUsMO6It3Vh30cNPsSwlzCA==",
"algorithm": "ed25519"
}
diff --git a/v3/@claude-flow/cli/.claude/helpers/statusline.cjs b/v3/@claude-flow/cli/.claude/helpers/statusline.cjs
index afcffb035e..5f99707fd8 100644
--- a/v3/@claude-flow/cli/.claude/helpers/statusline.cjs
+++ b/v3/@claude-flow/cli/.claude/helpers/statusline.cjs
@@ -618,7 +618,7 @@ function getPkgVersion() {
// version (see generateStatuslineScript()'s doc comment) β€” correct even
// when this renders via a pure npx invocation with no local install for
// the candidate scan below to find.
- let ver = "3.27.3";
+ let ver = "3.27.4";
try {
const home = os.homedir();
const pkgPaths = [
diff --git a/v3/@claude-flow/cli/__tests__/init-wizard-bugs.test.ts b/v3/@claude-flow/cli/__tests__/init-wizard-bugs.test.ts
index bd07c0def9..d7b0a25418 100644
--- a/v3/@claude-flow/cli/__tests__/init-wizard-bugs.test.ts
+++ b/v3/@claude-flow/cli/__tests__/init-wizard-bugs.test.ts
@@ -354,3 +354,80 @@ describe('#2208 β€” CLAUDE.md backup before overwrite', () => {
expect(existsSync(path.join(tmp, 'CLAUDE.md.pre-ruflo'))).toBe(false);
});
});
+
+describe('persistent memory ON BY DEFAULT β€” .swarm/memory.db created during init', () => {
+ let tmp: string;
+
+ beforeEach(() => {
+ tmp = mkdtempSync(path.join(tmpdir(), 'wizard-memdefault-'));
+ });
+
+ afterEach(() => {
+ rmSync(tmp, { recursive: true, force: true });
+ });
+
+ it('eagerly creates .swarm/memory.db when runtime.memoryBackend is persistent (hybrid)', async () => {
+ // DEFAULT_INIT_OPTIONS already declares memoryBackend: 'hybrid' β€” this
+ // pins that the DB file itself gets created at init time, not left for
+ // a separate `memory init --force` the user has to remember to run.
+ const { executeInit } = await import('../src/init/executor.js');
+ const opts: InitOptions = {
+ ...makeMCPOptions(),
+ targetDir: tmp,
+ force: true,
+ interactive: false,
+ components: {
+ settings: false,
+ skills: false,
+ commands: false,
+ agents: false,
+ helpers: true,
+ statusline: false,
+ mcp: false,
+ runtime: false,
+ claudeMd: false,
+ },
+ skipGlobalClaudeMd: true,
+ };
+
+ const result = await executeInit(opts);
+
+ expect(existsSync(path.join(tmp, '.swarm', 'memory.db'))).toBe(true);
+ expect(result.created.files).toContain('.swarm/memory.db');
+ }, 20000);
+
+ it('does NOT create .swarm/memory.db when runtime.memoryBackend is "memory" (non-persistent opt-out)', async () => {
+ // MINIMAL_INIT_OPTIONS uses memoryBackend: 'memory' deliberately β€” this
+ // pins that the opt-out is respected, not overridden by the new eager path.
+ const { executeInit } = await import('../src/init/executor.js');
+ const opts: InitOptions = {
+ ...makeMCPOptions(),
+ targetDir: tmp,
+ force: true,
+ interactive: false,
+ components: {
+ settings: false,
+ skills: false,
+ commands: false,
+ agents: false,
+ helpers: true,
+ statusline: false,
+ mcp: false,
+ runtime: false,
+ claudeMd: false,
+ },
+ runtime: {
+ topology: 'mesh',
+ maxAgents: 5,
+ memoryBackend: 'memory',
+ enableHNSW: false,
+ enableNeural: false,
+ },
+ skipGlobalClaudeMd: true,
+ };
+
+ await executeInit(opts);
+
+ expect(existsSync(path.join(tmp, '.swarm', 'memory.db'))).toBe(false);
+ }, 20000);
+});
diff --git a/v3/@claude-flow/cli/catalog-manifest.json b/v3/@claude-flow/cli/catalog-manifest.json
index 0c5f406efb..a7c89de4c4 100644
--- a/v3/@claude-flow/cli/catalog-manifest.json
+++ b/v3/@claude-flow/cli/catalog-manifest.json
@@ -1,8 +1,8 @@
{
"schemaVersion": 1,
"generation": 1,
- "generatedAt": "2026-07-14T04:26:59.494Z",
- "gitSha": "6643d44d",
+ "generatedAt": "2026-07-14T04:41:45.824Z",
+ "gitSha": "b254e321",
"catalog": {
"agents": 164,
"tools": 387,
diff --git a/v3/@claude-flow/cli/package-lock.json b/v3/@claude-flow/cli/package-lock.json
index 39875f227c..90a640e6a0 100644
--- a/v3/@claude-flow/cli/package-lock.json
+++ b/v3/@claude-flow/cli/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@claude-flow/cli",
- "version": "3.27.3",
+ "version": "3.27.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@claude-flow/cli",
- "version": "3.27.3",
+ "version": "3.27.4",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json
index 52a1fcb8ba..c3a55d3a16 100644
--- a/v3/@claude-flow/cli/package.json
+++ b/v3/@claude-flow/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@claude-flow/cli",
- "version": "3.27.3",
+ "version": "3.27.4",
"type": "module",
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
"main": "dist/src/index.js",
diff --git a/v3/@claude-flow/cli/src/commands/init.ts b/v3/@claude-flow/cli/src/commands/init.ts
index c4e61750ae..bfc85359b4 100644
--- a/v3/@claude-flow/cli/src/commands/init.ts
+++ b/v3/@claude-flow/cli/src/commands/init.ts
@@ -547,7 +547,9 @@ const initAction = async (ctx: CommandContext): Promise<CommandResult> => {
output.writeln(output.bold('Next steps:'));
output.printList([
`Run ${output.highlight(`${bin} daemon start`)} to start background workers`,
- `Run ${output.highlight(`${bin} memory init`)} to initialize memory database`,
+ // Memory is initialized automatically during init (persistent by
+ // default β€” see executor.ts) β€” no separate `memory init` step needed
+ // unless the DB was skipped (MINIMAL_INIT_OPTIONS) or needs --force.
`Run ${output.highlight(`${bin} swarm init`)} to initialize a swarm`,
`Or use ${output.highlight(`${bin} init --start-all`)} to do all of the above`,
options.components.settings ? `Review ${output.highlight('.claude/settings.json')} for hook configurations` : '',
diff --git a/v3/@claude-flow/cli/src/init/executor.ts b/v3/@claude-flow/cli/src/init/executor.ts
index 48d236c368..0ee4a152eb 100644
--- a/v3/@claude-flow/cli/src/init/executor.ts
+++ b/v3/@claude-flow/cli/src/init/executor.ts
@@ -241,14 +241,37 @@ export async function executeInit(options: InitOptions): Promise<InitResult> {
// the `vector_indexes` table (older CLI / agentdb-written), self-heal it
// so the statusline vector count + namespace routing work. Best-effort,
// dynamically imported so a WASM-only host without better-sqlite3 just
- // skips it. Fresh projects have no DB yet β€” this is a no-op there.
+ // skips it.
+ //
+ // Persistent memory ON BY DEFAULT: `runtime.memoryBackend` already
+ // defaults to 'hybrid' in DEFAULT_INIT_OPTIONS, but that only ever
+ // configured the DECLARED backend β€” the actual .swarm/memory.db file
+ // was never created until something eventually called `memory store`
+ // or the user ran `memory init --force` by hand (both the generated
+ // CLAUDE.md and the quickstart docs told users to do this as a
+ // separate step). A fresh project could sit for days looking
+ // "configured for AgentDB" while genuinely capturing nothing, with no
+ // signal that the config and the on-disk reality had diverged. Fresh
+ // projects now get the DB eagerly created here, matching what
+ // `memoryBackend` already promised; MINIMAL_INIT_OPTIONS
+ // (memoryBackend: 'memory') opts out, matching its non-persistent intent.
try {
const memDbPath = path.join(targetDir, '.swarm', 'memory.db');
if (fs.existsSync(memDbPath)) {
const { repairVectorIndexes } = await import('../memory/memory-initializer.js');
await repairVectorIndexes(memDbPath, { autoRecover: true });
+ } else if (options.runtime.memoryBackend !== 'memory') {
+ const { initializeMemoryDatabase } = await import('../memory/memory-initializer.js');
+ const initResult = await initializeMemoryDatabase({
+ backend: options.runtime.memoryBackend,
+ dbPath: memDbPath,
+ verbose: false,
+ });
+ if (initResult.success) {
+ result.created.files.push('.swarm/memory.db');
+ }
}
- } catch { /* best-effort β€” never block init on memory repair */ }
+ } catch { /* best-effort β€” never block init on memory setup */ }
}
// Generate statusline