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

Checkpoint: File edits

rUv8f7889de979d
diff --git a/v3/@claude-flow/guidance/src/retriever.ts b/v3/@claude-flow/guidance/src/retriever.ts
index 46e615bb58..7c31606e46 100644
--- a/v3/@claude-flow/guidance/src/retriever.ts
+++ b/v3/@claude-flow/guidance/src/retriever.ts
@@ -426,15 +426,21 @@ export class ShardRetriever {
}
/**
- * Simple glob matching (supports * and **)
+ * Simple glob matching (supports * and **).
+ * Compiled regexes are cached per glob to avoid re-compiling on every call.
*/
private matchGlob(path: string, glob: string): boolean {
- const regex = glob
- .replace(/\*\*/g, '{{GLOBSTAR}}')
- .replace(/\*/g, '[^/]*')
- .replace(/{{GLOBSTAR}}/g, '.*')
- .replace(/\//g, '\\/');
- return new RegExp(`^${regex}$`).test(path);
+ let re = this.globCache.get(glob);
+ if (!re) {
+ const pattern = glob
+ .replace(/\*\*/g, '{{GLOBSTAR}}')
+ .replace(/\*/g, '[^/]*')
+ .replace(/{{GLOBSTAR}}/g, '.*')
+ .replace(/\//g, '\\/');
+ re = new RegExp(`^${pattern}$`);
+ this.globCache.set(glob, re);
+ }
+ return re.test(path);
}
/**