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

926 B
Raw Blame
import { test } from 'vitest';
import assert from 'node:assert/strict';
import { mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { JsonMemoryBackend } from '../v3/@claude-flow/cli-core/src/memory/json-backend.ts';
test('substring searches omit unrelated records at the default threshold',async()=>{
 const dir=mkdtempSync(join(tmpdir(),'memory-search-'));const backend=new JsonMemoryBackend({path:join(dir,'memory.json')});
 try{
  await backend.store('alpha',{text:'First'});await backend.store('beta',{text:'Second'});
  assert.deepEqual(await backend.search('absent'),[]);
  assert.deepEqual((await backend.search('FIRST')).map(e=>e.key),['alpha']);
  assert.deepEqual((await backend.search('beta',{threshold:0})).map(e=>e.key),['beta']);
  assert.equal((await backend.search('',{limit:1})).length,1);
 }finally{rmSync(dir,{recursive:true,force:true});}
});