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

rUv659133b18f1b
diff --git a/v3/@claude-flow/cli/.claude/helpers/intelligence.cjs b/v3/@claude-flow/cli/.claude/helpers/intelligence.cjs
index 0a7db2219a..50c43e93eb 100644
--- a/v3/@claude-flow/cli/.claude/helpers/intelligence.cjs
+++ b/v3/@claude-flow/cli/.claude/helpers/intelligence.cjs
@@ -127,18 +127,25 @@ function computePageRank(nodes, edges, damping, maxIter) {
const ranks = {};
for (const id of ids) ranks[id] = 1 / n;
- // Power iteration
+ // Power iteration (with dangling node redistribution)
for (let iter = 0; iter < maxIter; iter++) {
const newRanks = {};
let diff = 0;
+ // Collect rank from dangling nodes (no outgoing edges)
+ let danglingSum = 0;
+ for (const id of ids) {
+ if (outLinks[id].length === 0) danglingSum += ranks[id];
+ }
+
for (const id of ids) {
let sum = 0;
for (const src of inLinks[id]) {
const outCount = outLinks[src].length;
if (outCount > 0) sum += ranks[src] / outCount;
}
- newRanks[id] = (1 - damping) / n + damping * sum;
+ // Dangling rank distributed evenly + teleport
+ newRanks[id] = (1 - damping) / n + damping * (sum + danglingSum / n);
diff += Math.abs(newRanks[id] - ranks[id]);
}