You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hooks graph-cluster / graph-mincut always fail (CLI passes wrong args); louvainCommunities returns {} and minCut modularity -3.75 when called correctly #1217
ruvector hooks graph-cluster and hooks graph-mincut fail on every input, in both 0.2.25 and 0.3.3:
$ ruvector hooks graph-cluster a.ts b.ts ... → {"success":false,"error":"graph.nodes is not iterable"}
$ ruvector hooks graph-mincut a.ts b.ts ... → {"success":false,"error":"Cannot read properties of undefined (reading 'length')"}
The ruflo-ruvectorvector-cluster skill says to run hooks init first. That doesn't help: I ran it in a throwaway repo with the same files and got the same errors.
Root cause (bin/cli.js → dist/core/graph-algorithms.js)
Signature mismatch. The CLI calls louvainCommunities(nodes, edges) / spectralClustering(nodes, edges, k), but both take a single graph built by buildGraph(nodes, edges) ({nodes, edges, adjacency}).
Edge shape mismatch. The CLI builds {source, target, weight}, while buildGraph destructures {from, to, weight}.
Import regex. It only matches from './x' (same directory), so ../x, ./x.js and subpaths produce no edges.
Node identity. Nodes are basename without extension, so two files named bytea.ts in different packages merge into one node.
The algorithms are also wrong when called correctly
With buildGraph and {from,to} edges on 11 real TypeScript files (6 import edges):
Modularity is bounded to [-0.5, 1], so -3.75 is an arithmetic error.
Expected
Build the graph with buildGraph, use one edge shape, resolve relative imports to full paths, return non-empty Louvain assignments, and keep modularity in range. A test with a known two-community graph would catch all of this.
Activity