c6aaa20 · graphify 0.9.36 · @colbymchenry/codegraph v1.5.0 · 分析日期 2026-08-10src/ + codegraph-kernel/src/ + __tests__/(501 個程式檔)做 --code-only 抽取(純本機 AST、零 LLM、零 API key)。@colbymchenry/codegraph@1.5.0,在 codegraph 自己的源碼上跑 init / status / query / explore / impact,真實輸出進教學頁。| 工具 | 語料 | 節點 | 邊 | 社群 / 種類 |
|---|---|---|---|---|
graphify 0.9.36(--code-only) | 501 個程式檔(src/ + kernel-src/ + tests/) | 7,987 | 18,148 | 683 社群(介面顯示 208 個,475 個細碎省略) |
codegraph v1.5.0(codegraph init) | 570 檔(全 repo) | 12,733 | 44,903 | function 2,706 · import 2,304 · method 1,850 · class 206 · route 16 … |
兩者不可直接比——graphify 用 Leiden 分群、codegraph 用自家 resolver;但同語料下的結構對照很有參考價值(graphify 有 683 個社群 hub,codegraph 索引時間僅 1.7s)。
超過 graphify 5,000 節點視覺化上限,自動聚合為社群檢視(683 個社群);想看單節點細節可用 graph.json。報告見 GRAPH_REPORT.md。
$ codegraph init
┌ Initializing CodeGraph
◆ Initialized in <repo-root>
Scanning files...
Parsing code...
Resolving refs...
Linking dynamic dispatch...
◆ Indexed 570 files
● 12,733 nodes, 44,903 edges in 1.7s
└ Done
$ codegraph explore "how does codegraph_explore build its answer"
**Exploration: how does codegraph_explore build its answer**
Found 35 symbols across 2 files.
**Blast radius — what depends on these ...**
- `CodeGraph` (src/index.ts:139) — 136 callers in ... +96
**Relationships**
instantiates:
- init → CodeGraph · initSync → CodeGraph
- open → CodeGraph · recreate → CodeGraph · openSync → CodeGraph
calls:
- constructor → wireLayers · sync → sync · watch → sync
- open → sync · init → indexAll · ... and 3 more
更多真實輸出(status / query / callers / impact / files / sync)見 worked/codegraph-source/dogfood.md,也都散落在各教學頁。
# 0. 準備:graphify 0.9.36(PyPI 套件名 graphifyy,雙 y)、Node ≥20
uv tool install graphifyy
npm i -g @colbymchenry/codegraph@1.5.0
# 1. 語料(codegraph 源碼,對齊 c6aaa20)
git clone https://github.com/colbymchenry/codegraph.git
git -C codegraph checkout c6aaa20
mkdir corpus && cp -R codegraph/src corpus/ && cp -R codegraph/codegraph-kernel/src corpus/kernel-src/
cp -R codegraph/__tests__ corpus/tests/
# 2. graphify 掃描(code-only,零 key)
graphify extract ./corpus --code-only
GRAPHIFY_VIZ_NODE_LIMIT=20000 graphify cluster-only ./corpus
# → corpus/graphify-out/:graph.html(互動)、graph.json、GRAPH_REPORT.md
# 3. 中文化互動圖:複製 graph.html → 替換 UI 字串 → graph-zh.html
# 4. codegraph 自跑(dogfooding)
cd codegraph
codegraph init # 570 檔 → 12,733 節點 / 44,903 邊 in 1.7s
codegraph status
codegraph explore "how does codegraph_explore build its answer"
graph.json。preceding_docstring、CodeGraph);這正好符合「節點 label 保留英文」的教學原則。