diff --git a/.gitignore b/.gitignore index 9a25abf..13dac3e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ lib/ *.diagsession !tools/perf_diagsession.py __pycache__/ + +# CodeGraph 本地索引(codegraph init 生成,勿提交) +.codegraph/ diff --git a/AGENTS.md b/AGENTS.md index e53275a..4894993 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -72,3 +72,16 @@ powershell -NoProfile -ExecutionPolicy Bypass -File tools\run_acad_perf.ps1 | `notify-decision` | 需要用户拍板时主动推送通知(桌面 toast / IM 机器人),不让他干等终端 | 使用说明(常用命令、会话管理、Windows 终端问题、多机同步、插件取舍)见 `pi-agent-setup.md`。 + +## CodeGraph(代码知识图谱) + +本仓库已 `codegraph init`(索引在 `.codegraph/`,已 gitignore,约 700 MB)。 +适合回答 rg 做不到的问题:**谁调用 / 改了会影响谁 / 某个流程怎么串起来的**。 + +- MCP 工具 `codegraph_explore`(已挂进 pi,`~/.pi/agent/mcp.json`,exposure=direct); +- 命令行等价:`codegraph explore "<问题>"`、`codegraph callers <符号>`、 + `codegraph impact <符号>`、`codegraph node <符号|文件>`、`codegraph query <词>`; +- 代码改动后 `codegraph sync`(增量,几秒);索引损坏/卡住用 `codegraph unlock`; +- 解析是启发式的:C++ 的宏/MFC 大量展开时关系可能不全(实测 `AecDbX3dPart → AcDbX3dSolid` + 这类 `extends` 边偶有误判),**结论仍要用源码核实**; +- 提交前不要 `git add .codegraph/`。