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
CausalMemoryGraph.addCausalEdge() silently creates orphan edges when NodeIdMapper.getNodeId() returns undefined #7
In CausalMemoryGraph.addCausalEdge() (bundled [email protected]), when NodeIdMapper.getNodeId() returns undefined for a numeric memory id that was never registered, the code constructs a fallback string ${memoryType}-${memoryId} (e.g. episode-123) and silently creates the edge — even if no node with that id exists in the graph. Surfaced by ruvnet/ruflo#2246 §3.
Where (per the reporter's read of alpha.16's dist)
// dist/controllers/CausalMemoryGraph.js — addCausalEdge()constmapper=NodeIdMapper.getInstance();constfromNodeId=typeofedge.fromMemoryId==='string'
? edge.fromMemoryId
: (mapper.getNodeId(edge.fromMemoryId)||`${edge.fromMemoryType}-${edge.fromMemoryId}`);// ...same for toNodeId, then createCausalEdge(graphEdge)
The || ... fallback path runs with no console.warn, no validation, no rejection. The edge is created against an id the graph never registered → dangling/orphan edge.
Impact (from the reporter)
"We hit this as recurring causal-edge deprecation noise with no actionable guidance about required id formats (e.g. entity: / mem: prefixes)."
Silent orphans corrupt graph topology — pagerank, shortest-path, and similar traversals will encounter dangling endpoints with no diagnostic trail.
Reproduction
Call addCausalEdge() with a numeric fromMemoryId that was never registered via NodeIdMapper.register(). Observe: edge created against episode-<id> with no warning. Run a graph traversal: orphan endpoint encountered.
Suggested fix (any one)
Reject the edge when the mapper returns undefined, with an actionable error message naming the missing id + the registration call.
Emit console.warn documenting what id format was expected and how to register it (e.g. NodeIdMapper.register(rawId, 'entity:foo')).
Validate at the end of addCausalEdge that both endpoints actually exist as nodes in the graph; reject otherwise.
Reporter's preference (#2246): "emit one actionable warning ... or reject the edge, instead of constructing an unvalidated id."
Activity
feat(beir): 3-dataset BEIR + [email protected] + #2246 fixes (ADR-089/0…