MCPcopy Create free account
hub / github.com/block/buzz / recordDangling

Function recordDangling

desktop/src/features/agent-memory/lib/buildMemoryGraph.ts:70–80  ·  view source on GitHub ↗
(refSlug: string, referencedBy: string)

Source from the content-addressed store, hash-verified

68 const danglingMap = new Map<string, string[]>();
69
70 function recordDangling(refSlug: string, referencedBy: string): void {
71 const list = danglingMap.get(refSlug);
72 if (list) {
73 // Don't double-count if the same body refs the same dangling slug
74 // twice — duplicate `[[foo]] [[foo]]` should still surface a single
75 // referrer in the UI.
76 if (!list.includes(referencedBy)) list.push(referencedBy);
77 } else {
78 danglingMap.set(refSlug, [referencedBy]);
79 }
80 }
81
82 function buildNode(entry: EngramEntry): MemoryTreeNode {
83 visited.add(entry.slug);

Callers 2

buildNodeFunction · 0.85
buildMemoryGraphFunction · 0.85

Calls 3

pushMethod · 0.80
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected