為什麼這三個 patch 值得學
Code intelligence 的錯誤通常不是「parser 完全壞掉」,而是更隱晦的:節點建出來了,但 symbol identity、import resolution 或跨 repo 關係連錯。v0.9.54~v0.9.56 主要就在修這一層。
跨 repo member call
v0.9.54 讓 merge-graphs 在 receiver type 定義於另一個 repo 時,可以在唯一且不歧義的 type + method match 下補出 member call。
這建立在先前 same_type_as 跨 repo 型別連結之上。重點是「不歧義才連」:如果同名 type / method 有多個候選,Graphify 不應為了看起來完整而製造假邊。
JS / TS module resolution
v0.9.56 補了兩個實務常見路徑:
- 沒有
tsconfig pathsmapping 時的@/project-root alias。 package.jsonimports中的#services/foo、wildcards 與 condition objects。
同時,named re-export / barrel / alias chain 也能更可靠地回到原始定義。
Rust / Python / Dart
- Rust trait 的 signature-only 與 default-bodied method 都會成為節點。
- Python imported type reference 會綁到精確的匯入來源;前導底線不同的 function id 不再衝突。
- Dart node / edge 補齊
source_location。
Query 行為
MCP query_graph 從「只有 incoming edge」的 leaf node 起查時改為 undirected traversal,因此像「誰呼叫這個 leaf function?」的問題不會因為起點沒有 outgoing edge 而得到空結果。
大型 TypeScript 效能
TS import-type normalization 原先可能出現 O(matches × ranges) 放大,v0.9.56 改用 sorted-index lookup。對大型 mixed TS file,這是從「CPU 長時間 100%」回到與輸入規模更合理的成本。
可攜性與寫入安全
definition_file改存 scan-root relative canonical path,跨機器 graph 更穩定。.graphify_version、Obsidian vault、graph.canvas改採 atomic write。- Windows 接近 component/MAX_PATH 限制時,atomic temp filename 會被 bounded。
- rebuild watchdog timeout 會先清掉 extraction workers。
升級後要不要重建?
如果你的 codebase 使用 Rust trait、JS/TS alias、Node subpath imports、Python imported types 或跨 repo member calls,建議升級後跑一次 graphify update;若你需要保證整張圖都使用新版 resolver,做 full rebuild 最乾淨。