跳到主內容

Theme / v0.9.103

Graphify

Codebase 知識圖譜

基礎觀念

v0.9.103:抽取器、解析與安裝的正確性與效能

整理 Graphify v0.9.103 的變更:C# 前置處理器空白化、Solidity library 呼叫與事件連結、YAML merge 金鑰先後、Python 內建名呼叫不自動綁定、hooks mtime 判定與效能改進,及安裝與執行緒安全。含互動測驗與檢查清單。

概述

Graphify v0.9.103 於 2026-11-05 發布。官方 release notes 的定位是:

“A broad correctness, performance and robustness release across the extractors, resolution, hooks, the query and update paths, install and the skill runbook.”

也就是說,這是一個橫跨抽取器(extractors)、解析(resolution)、hooks、查詢與更新路徑(query and update paths)、安裝(install)與 skill runbook 的廣泛正確性、效能與穩健性版本。本課逐項對應 release notes 原文;上游沒有細節的行為,這裡也不推測。注意:release notes 原文未附 PR 號。

抽取器(extractors)

C#:前置處理器指令空白化

Release notes 原文:“preprocessor directives and #if branches that derail tree-sitter are blanked before parsing (byte-length preserving), so a directive no longer closes a class early and drops later members or calls.”

會讓 tree-sitter 出錯的 preprocessor directives 與 #if branches 在解析前被空白化(blanked),且是 byte-length preserving(位元組長度不變)。效果:一個 directive 不再提前關閉 class,導致後面的 members 或 calls 被丟失。

Solidity:library 呼叫與 event/error 連結

Release notes 原文:“library calls (Lib.f(), including aliased imports) and emit/revert/require naming a declared event or error now link to the member they name, gated to a unique visible type and member.”

  • Library calls(Lib.f(),含 aliased imports)現在會連結到它們指名的 member。
  • 指名已宣告 event 或 error 的 emit/revert/require 也會連結到該 member。
  • 兩者都以 gated to a unique visible type and member 為門檻——只有在能唯一對應到一個可見型別與成員時才連結。

YAML:merge sequence 的重複鍵先後

Release notes 原文:“a << merge sequence gives the earlier anchor precedence for a duplicated key, matching the spec and PyYAML.”

<< merge sequence 對重複的 key 給較早的 anchor 優先權(precedence),與 spec 及 PyYAML 一致。

Markdown:code span 的 namespace 與型別限定解析

Release notes 原文:“a code span written as a backslash namespace (\Foo\Bar) or a type-qualified member (Type::member) resolves to the real node; a dotted mention whose method name is a language builtin is no longer dropped.”

  • 寫成反斜線 namespace(\Foo\Bar)或型別限定成員(Type::member)的 code span 會解析到真實節點。
  • Method 名是語言內建(builtin)的 dotted mention 不再被丟棄(dropped)。

Python:裸的內建名稱呼叫不跨模組綁定

Release notes 原文:“a bare builtin-named call (raise NotImplementedError(...)) no longer binds to a same-named class in another module unless imported.”

裸的內建名稱呼叫(bare builtin-named call),如 raise NotImplementedError(...),不再綁到另一個模組中的同名 class——除非該 class 有被 import。

解析(resolution):_main 不再碰撞到 main

Release notes 原文:“A call inside a top-level def _main() is attributed to _main, not the public main it collides with after id normalization, without misattributing a class member’s type reference.”

Top-level def _main() 內的呼叫歸屬於 _main,而不是在 id normalization 後與它碰撞的公開 main;同時不會錯誤歸屬(misattribute)class member 的型別參照。

Hooks

Release notes 原文:“A file unchanged in content is not re-flagged stale by mtime (the extraction hash is checked against the manifest). A dedicated Grep is held to the strict orientation gate; a Bash file read (cat/head/sed -n) of an in-project code file gets the read nudge; a search whose every target is outside the project emits no project hint; the nudge budget is restored after a Claude Code compaction; and the toplevel anchor keeps working when CDPATH is exported.”

逐項整理:

  • mtime 判定:內容未變的檔案不再因 mtime 被重複標記 stale——extraction hash 會對 manifest 檢查。
  • Grep 與 Bash 讀取:專用 Grep 受 strict orientation gate 約束;對專案內 code 檔的 Bash 檔案讀取(cat/head/sed -n)會得到 read nudge。
  • 外部搜尋:所有目標都在專案外的搜尋不發出 project hint。
  • Nudge budget:Claude Code compaction 之後 nudge budget 會恢復。
  • CDPATH:匯出 CDPATH 時 toplevel anchor 仍可運作。

效能(performance)

Release notes 原文:“Lower peak memory in load, resolution and extraction; a faster #3252 cross-file repoint; and the watch reconcile pass resolves AST ownership once per file instead of re-reading each header per node — all with identical graph output.”

  • Load、resolution 與 extraction 的尖峰記憶體(peak memory)下降。
  • 跨檔 repoint #3252 更快。
  • Watch reconcile pass 對每個檔案只解析一次 AST ownership,而非每個節點重讀每個 header。
  • Graph 輸出完全相同(identical graph output)——純效能改進、不改行為。

Update/build/cache 與 Query/tree:與 v0.9.102 重複列出

安裝與執行緒安全(install / thread-safety)

Release notes 原文:“The Pi project skill is written to .pi/skills; uninstall removes the global skill registration it wrote. The ambient scan root is held in a ContextVar so concurrent library callers extracting different roots do not clobber each other.”

  • Pi project skill 寫入 .pi/skills;uninstall 會移除它寫入的全域 skill registration。
  • Ambient scan root 保存在 ContextVar,並發(concurrent)的 library callers 抽取不同 root 時不會互相覆蓋(clobber)。

AST cache schema bump 至 39

Release notes 原文:“The AST cache schema is bumped to 39; warm caches re-run the affected extractions.”

AST cache schema 版號升至 39(v0.9.102 為 37,本版直接跳到 39);已有 warm cache 的使用者,受影響的抽取(extractions)會自動重跑。

自我測驗

隨堂測驗

v0.9.103 對 C# 的 preprocessor directives 做了什麼處理?

💡 想先看個提示?

兩個關鍵詞:blanked before parsing、byte-length preserving。

隨堂測驗

關於 v0.9.103 的「Update / build / cache」與「Query / tree」段落,下列敘述何者正確?

💡 想先看個提示?

與前一版 release notes 對照即可發現是重複列出。

隨堂測驗

v0.9.103 的執行緒安全改進做了什麼?

💡 想先看個提示?

關鍵資料結構是 ContextVar。

隨堂測驗

升級到 v0.9.103 後,AST cache schema 的變化是?

💡 想先看個提示?

從 37 直接跳到 39。

動手檢查清單

升級 v0.9.103:動手檢查清單

逐項勾選,確認你已完成升級必要的步驟(進度會保存在此瀏覽器)

0 / 4

延伸閱讀