A code graph makes claims grep can't, including wrong ones
说明与用途
Graphify 的代码图将同名函数合并,导致错误的调用边。使用 36 行 Node 脚本逐行验证每条边,发现 184 条错误。升级到 0.9.0 后,节点按完整路径键入,消除了大部分错误。
问题
Code graphs can merge nodes with the same name across files, producing incorrect call edges that agents may act on as if they were true.
结果
Out of 1,142 call edges, 958 passed all checks, 184 failed at least one. 136 of the failures were tagged EXTRACTED, indicating that the graph had read them directly from source but still produced incorrect edges due to node merging.
工作流
- Clone the repo at commit 6085fd6.
- Run the provided 36‑line Node script to iterate over all 'calls' edges.
- For each edge, read the source line and check: (1) caller and callee are in the same language, (2) caller is defined in the file where the call occurs, (3) the line actually contains a call to the callee’s name.
- Collect faults such as 'wrongLanguage', 'callerFromOtherFile', and 'nameNotOnLine'.
- Summarize how many edges pass or fail the checks.
- Compare the results with the graph’s EXTRACTED and INFERRED tags to identify false positives.
证据
The most connected function in a code graph I opened this week has 124 edges. It doesn't exist.
I wrote a 36-line Node script. Every calls edge carries the file and line of the call, so for each one it reads that line and asks three questions:
The merges came from the dedup pass, which matched labels by fuzzy similarity, a sensible thing for doc concepts and a wrong one for code.
Issue #1205, opened June 9, reported a single --update dropping about 1,300 nodes from a 6,000-node graph. It was fixed the next day: code nodes are now keyed by ID only and never label-merged.
- 记录日期: 2026-10-23T19:11:30.346Z